@newskit-render/core 1.75.2-alpha.0 → 1.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.75.2](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.75.2-alpha.0...@newskit-render/core@1.75.2) (2022-07-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @newskit-render/core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [1.75.1](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.75.1-alpha.0...@newskit-render/core@1.75.1) (2022-07-14)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @newskit-render/core
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newskit-render/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.76.0",
|
|
4
4
|
"description": "Newskit Render - Core package",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"@apollo/client": "3.4.16",
|
|
36
36
|
"@newskit-render/api": "^0.36.0",
|
|
37
37
|
"@newskit-render/auth": "^0.44.0",
|
|
38
|
-
"@newskit-render/checkout": "^0.
|
|
38
|
+
"@newskit-render/checkout": "^0.51.0",
|
|
39
39
|
"@newskit-render/feature-flags": "^0.24.0",
|
|
40
40
|
"@newskit-render/feed": "^0.24.0",
|
|
41
|
-
"@newskit-render/my-account": "^0.
|
|
42
|
-
"@newskit-render/shared-components": "^0.
|
|
43
|
-
"@newskit-render/standalone-components": "^0.
|
|
41
|
+
"@newskit-render/my-account": "^0.182.0",
|
|
42
|
+
"@newskit-render/shared-components": "^0.67.0",
|
|
43
|
+
"@newskit-render/standalone-components": "^0.29.0",
|
|
44
44
|
"@newskit-render/validation": "^0.50.0",
|
|
45
45
|
"cross-fetch": "3.1.5",
|
|
46
46
|
"graphql": "15.6.0",
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
2
|
import newrelic from 'newrelic'
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
ProviderPropsMapper,
|
|
4
|
+
HelpHubArticlePage,
|
|
5
|
+
helpHubArticleProvider,
|
|
7
6
|
} from '@newskit-render/standalone-components'
|
|
8
7
|
import { createThemeDropdownObject } from '../../../../helpers/createThemeDropdownObject'
|
|
9
8
|
import { AppContext } from '../../../../context'
|
|
9
|
+
import { addCacheHeaders } from '../../../../helpers/addCacheHeaders'
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const ArticlePage = (props) => {
|
|
12
12
|
const { theme, setTheme } = useContext(AppContext)
|
|
13
13
|
const themeDropdownObject = createThemeDropdownObject(setTheme)
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
|
-
<
|
|
16
|
+
<HelpHubArticlePage
|
|
17
17
|
{...props}
|
|
18
|
-
contextName="articlePage"
|
|
19
18
|
customTheme={theme}
|
|
20
19
|
themeDropdownObject={themeDropdownObject}
|
|
21
20
|
/>
|
|
@@ -26,6 +25,8 @@ export const getServerSideProps = async (context) => {
|
|
|
26
25
|
newrelic.setTransactionName('HelpHubArticlePage')
|
|
27
26
|
console.warn('context:')
|
|
28
27
|
console.warn(context.req && context.req.headers)
|
|
29
|
-
|
|
28
|
+
|
|
29
|
+
addCacheHeaders(context.res)
|
|
30
|
+
return helpHubArticleProvider({ ...context })
|
|
30
31
|
}
|
|
31
|
-
export default
|
|
32
|
+
export default ArticlePage
|
package/pages/help-hub/index.tsx
CHANGED
|
@@ -1,39 +1,63 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
|
+
import newrelic from 'newrelic'
|
|
2
3
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
ContextName,
|
|
4
|
+
HelpHubLandingPage,
|
|
5
|
+
helpHubLandingPageProvider,
|
|
6
6
|
} from '@newskit-render/standalone-components'
|
|
7
7
|
import { createThemeDropdownObject } from '../../helpers/createThemeDropdownObject'
|
|
8
8
|
import { AppContext } from '../../context'
|
|
9
|
-
import {
|
|
9
|
+
import { addCacheHeaders } from '../../helpers/addCacheHeaders'
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const mostReadArticles = [
|
|
12
|
+
{
|
|
13
|
+
title: 'Sign-in with Google',
|
|
14
|
+
objectID: 'sign-with-google',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
title:
|
|
18
|
+
'I am trying to share an article via Google+ but an error message keeps appearing',
|
|
19
|
+
objectID:
|
|
20
|
+
'i-am-trying-to-share-an-article-via-google-but-an-error-message-keeps-appearing',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
title: 'How will I find out if I have won a competition?',
|
|
24
|
+
objectID: 'how-will-i-find-out-if-i-have-won-a-competition',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
title: 'How do I login/reset my password?',
|
|
28
|
+
objectID: 'how-do-i-login-reset-my-password',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: 'How do I cancel or change my pack?',
|
|
32
|
+
objectID: 'how-do-i-cancel-or-change-my-pack',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: 'Can I share my Times & Sunday Times iPad subscription access?',
|
|
36
|
+
objectID: 'can-i-share-my-times-sunday-times-ipad-subscription-access',
|
|
37
|
+
},
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
const LandingPage = ({ credentials }) => {
|
|
14
41
|
const { theme, setTheme } = useContext(AppContext)
|
|
15
42
|
const themeDropdownObject = createThemeDropdownObject(setTheme)
|
|
16
43
|
|
|
17
44
|
return (
|
|
18
|
-
<
|
|
19
|
-
{
|
|
20
|
-
|
|
45
|
+
<HelpHubLandingPage
|
|
46
|
+
credentials={credentials}
|
|
47
|
+
context={{ mostReadArticles }}
|
|
21
48
|
customTheme={theme}
|
|
22
49
|
themeDropdownObject={themeDropdownObject}
|
|
23
50
|
/>
|
|
24
51
|
)
|
|
25
52
|
}
|
|
26
53
|
|
|
27
|
-
export
|
|
28
|
-
return {
|
|
29
|
-
props: {
|
|
30
|
-
credentials: {
|
|
31
|
-
appId: algoliaAppId,
|
|
32
|
-
apiKey: algoliaApiKey,
|
|
33
|
-
indexName: algoliaIndex,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
}
|
|
37
|
-
}
|
|
54
|
+
export default LandingPage
|
|
38
55
|
|
|
39
|
-
export
|
|
56
|
+
export const getServerSideProps = async (context) => {
|
|
57
|
+
newrelic.setTransactionName('HelpHubLandingPage')
|
|
58
|
+
console.warn('context:')
|
|
59
|
+
console.warn(context.req && context.req.headers)
|
|
60
|
+
addCacheHeaders(context.res)
|
|
61
|
+
|
|
62
|
+
return helpHubLandingPageProvider()
|
|
63
|
+
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React, { useContext } from 'react'
|
|
2
|
+
import newrelic from 'newrelic'
|
|
2
3
|
import {
|
|
3
|
-
|
|
4
|
+
HelpHubResultsPage,
|
|
4
5
|
AlgoliaCredentials,
|
|
5
6
|
Hit,
|
|
6
|
-
|
|
7
|
-
ContextName,
|
|
7
|
+
helpHubResultsProvider,
|
|
8
8
|
} from '@newskit-render/standalone-components'
|
|
9
9
|
import { createThemeDropdownObject } from '../../helpers/createThemeDropdownObject'
|
|
10
10
|
import { AppContext } from '../../context'
|
|
11
|
+
import { addCacheHeaders } from '../../helpers/addCacheHeaders'
|
|
11
12
|
|
|
12
|
-
const
|
|
13
|
+
const ResultsPage: React.FC<{
|
|
13
14
|
credentilas: AlgoliaCredentials
|
|
14
15
|
hits: Hit[]
|
|
15
16
|
}> = (props) => {
|
|
@@ -17,9 +18,8 @@ const HelpHubResultsPage: React.FC<{
|
|
|
17
18
|
const themeDropdownObject = createThemeDropdownObject(setTheme)
|
|
18
19
|
const credentials = { props }
|
|
19
20
|
return (
|
|
20
|
-
<
|
|
21
|
+
<HelpHubResultsPage
|
|
21
22
|
{...props}
|
|
22
|
-
contextName={ContextName.resultsPage}
|
|
23
23
|
customTheme={theme}
|
|
24
24
|
themeDropdownObject={themeDropdownObject}
|
|
25
25
|
credentials={credentials}
|
|
@@ -27,8 +27,15 @@ const HelpHubResultsPage: React.FC<{
|
|
|
27
27
|
)
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export default
|
|
30
|
+
export default ResultsPage
|
|
31
31
|
|
|
32
32
|
export const getServerSideProps = async (context) => {
|
|
33
|
-
|
|
33
|
+
newrelic.setTransactionName('HelpHubResultsPage')
|
|
34
|
+
console.warn('context:')
|
|
35
|
+
console.warn(context.req && context.req.headers)
|
|
36
|
+
|
|
37
|
+
addCacheHeaders(context.res)
|
|
38
|
+
|
|
39
|
+
const results = await helpHubResultsProvider({ ...context })
|
|
40
|
+
return results
|
|
34
41
|
}
|