Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/ppdsc 2113 prodtealium not being served #194

Merged
merged 31 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
eb7f87f
docs(PPDSC-0000): testing permissions
Vanals Apr 11, 2022
20cf719
docs(PPDSC-0000): removing test changed from readme
Vanals Apr 11, 2022
dc4bd3c
docs(PPDSC-0000): removing test changed from readme
Vanals Apr 11, 2022
aecea28
chore(PPDSC-2007): rolling back release
Vanals Apr 11, 2022
53afa86
Merge branch 'main' of github.com:newscorp-ghfb/newskit into main
Vanals Apr 25, 2022
017a5a6
ci(PPDSC-2017): updated template
Vanals May 4, 2022
a6acda6
ci(PPDSC-2017): updated template
Vanals May 6, 2022
02fd607
fix(PPDSC-2113): testing vars
Vanals May 9, 2022
25b0ac0
fix(PPDSC-2113): updated name
Vanals May 9, 2022
2dc69eb
fix(PPDSC-2113): trying to make test job work
Vanals May 9, 2022
a2da01d
fix(PPDSC-2113): changing context to test
Vanals May 9, 2022
17e16fe
fix(PPDSC-2113): remove comments hoping t works
Vanals May 9, 2022
b16e412
fix(PPDSC-2113): removed console.log
Vanals May 9, 2022
094f9f2
fix(PPDSC-2113): removed echo
Vanals May 9, 2022
367e511
fix(PPDSC-2113): testing
Vanals May 9, 2022
82223a4
fix(PPDSC-2113): consologging stuff
Vanals May 9, 2022
e6a1d2a
fix(PPDSC-2113): debugging
Vanals May 9, 2022
33b4fa7
fix(PPDSC-2113): static to initial props
Vanals May 9, 2022
21215d8
fix(PPDSC-2113): nested props into props obj
Vanals May 10, 2022
a9a75a4
fix(PPDSC-2113): to getStaticProps
Vanals May 10, 2022
0fbca9d
fix(PPDSC-2113): console logging stuff
Vanals May 10, 2022
2d582f7
fix(PPDSC-2113): tealium with props and clog
Vanals May 10, 2022
1ec69ad
fix(PPDSC-2113): removed static props - get var from process
Vanals May 10, 2022
5409cac
fix(PPDSC-2113): cleaned _document file
Vanals May 11, 2022
1024d93
fix(PPDSC-2113): added new line
Vanals May 11, 2022
1c1e84e
Merge branch 'main' into fix/PPDSC-2113-prodtealium-not-being-served
Vanals May 11, 2022
0f9e559
fix(PPDSC-2113): added back pr env for job
Vanals May 11, 2022
03f6d4e
fix(PPDSC-2113): merged main
Vanals May 11, 2022
a0e4cf2
fix(PPDSC-2113): improved naming var
Vanals May 11, 2022
b88fe9e
Merge branch 'main' into fix/PPDSC-2113-prodtealium-not-being-served
Vanals May 11, 2022
a2b9368
Merge branch 'main' into fix/PPDSC-2113-prodtealium-not-being-served
Vanals May 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -934,9 +934,9 @@ workflows:
pull_request:
when:
matches:
# Supporting Pr branches starting with feat/, docs/, fix/, chore/, style/, refactor/, perf/, test/, etc.
pattern: '^build\/.*|chore\/.*|ci\/.*|docs\/.*|feat\/.*|fix\/.*|improvement\/.*|perf\/.*|refactor\/.*|revert\/.*|style\/.*|test\/.*|^dependabot\/.*'
value: << pipeline.git.branch >>
# Supporting Pr branches starting with feat/, docs/, fix/, chore/, style/, refactor/, perf/, test/, etc.
pattern: '^build\/.*|chore\/.*|ci\/.*|docs\/.*|feat\/.*|fix\/.*|improvement\/.*|perf\/.*|refactor\/.*|revert\/.*|style\/.*|test\/.*|^dependabot\/.*'
value: << pipeline.git.branch >>
jobs:
- install_deps
- install_cypress
Expand Down
29 changes: 4 additions & 25 deletions site/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
/* eslint react/no-array-index-key: 0 */

import * as React from 'react';
import Document, {
Head,
Main,
NextScript,
Html,
DocumentContext,
} from 'next/document';
import Document, {Head, Main, NextScript, Html} from 'next/document';
import {Consent, Global, css, Tealium} from 'newskit';
import Helmet from 'react-helmet';
import {HTMLMeta} from '../components/html-meta';

interface Props {
production: boolean;
productionSiteEnv: boolean;
}

// Is added so relative paths work when we are on a sub dir e.g. s-3.com/ppdsc-123-foo/
const baseHref =
process.env.SITE_ENV && process.env.SITE_ENV === 'pr'
Expand All @@ -25,19 +14,9 @@ const baseHref =

const Base = () => <base href={baseHref} />;

export default class MyDocument extends Document<Props> {
static async getStaticProps(ctx: DocumentContext) {
const {html} = await ctx.renderPage();
return {
html,
// Are we in local dev mode or "built and served"?
production: process.env.NODE_ENV === 'production',
// Are we production "newskit.co.uk" or not?
productionSiteEnv: process.env.SITE_ENV === 'production',
};
}

export default class MyDocument extends Document {
render() {
const isSiteEnvProduction = process.env.SITE_ENV === 'production';
const helmet = Helmet.rewind();
return (
<Html lang="en">
Expand Down Expand Up @@ -257,7 +236,7 @@ export default class MyDocument extends Document<Props> {
<Tealium
accountId="newsinternational"
profileId="thetimes.newskit"
env={this.props.productionSiteEnv ? 'prod' : 'dev'}
env={isSiteEnvProduction ? 'prod' : 'dev'}
/>
<Main />
<NextScript />
Expand Down