Skip to content

Commit

Permalink
Merge branch 'main' into docs/PPDSC-2709-update-icons-scenarios-story…
Browse files Browse the repository at this point in the history
…book
  • Loading branch information
LukeFinch authored Mar 29, 2023
2 parents 57fe261 + 279953d commit c93bad3
Show file tree
Hide file tree
Showing 17 changed files with 316 additions and 330 deletions.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/a11y_investigation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: A11y Investigation
about: Details an accessibility investigation that needs to be done
title: '(A11y) - '
about: Details an accessibility investigation that needs to be done
labels: ["a11y", "triage"]
assignees: ''

Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Bug report
about: Create a report to help us improve
title: '(Bug) - '
labels: ["bug", "triage"]
assignees: ''

Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Feature request
about: Suggest a feature/enhancement for NewsKit - External teams should use this instead of story,task,spike etc.
title: ''
labels: ["request", "triage"]
assignees: ''

Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/spike.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Technical Spike
about: Details a piece of technical research or an investigation that needs to be conducted
title: '(Spike) - '
labels: ["spike", "triage"]
assignees: ''

Expand Down
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/story.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: User Story
about: Details a specific user facing feature
title: '(Story) - '
about: Details a specific user facing feature
labels: ["story", "triage"]
assignees: ''

Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/task.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Task
about: Details a task
title: '(Task) - '
labels: ["task", "triage"]
assignees: ''

Expand Down
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PPDSC-XXXX
<!-- Replace #000 with github issue number e.g #1234 -->
#000

**What**

Expand Down
2 changes: 1 addition & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ changelog:
- fix
- title: Documentation 📝
labels:
- doc
- docs
- title: Other Changes 🧱
labels:
- "*"
10 changes: 0 additions & 10 deletions .storybook/addons/tealium/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Helmet from 'react-helmet';
import {IconButton, Icons} from '@storybook/components';

import {
Consent,
Tealium,
ConsentSettingsLink,
newskitLightTheme,
Expand Down Expand Up @@ -55,11 +54,6 @@ const CONFIG = {
profileId: 'thetimes.storybook',
env: isProduction ? 'prod' : 'dev',
},
consent: {
accountId: 259,
propertyHref: 'https://newskit.co.uk',
gdpr: {},
},
};

const Tool = () => {
Expand All @@ -81,10 +75,6 @@ const Tool = () => {
{''}
</ConsentSettingsLink>
<Tealium {...CONFIG.tealium} reactHelmet={Helmet} />
<Consent
sourcePointConfigUnified={CONFIG.consent}
reactHelmet={Helmet}
/>
<Tooltip content="Privacy Manager" asLabel placement="left">
<span>
<IconButton
Expand Down
2 changes: 1 addition & 1 deletion githooks/commitmsg.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const read = require('@commitlint/read');

const customMessages = {
'scope-enum': {
level2: 'The scope should be a Jira ticket number',
level2: 'The scope should be a GitHub issue number',
},
};

Expand Down
4 changes: 2 additions & 2 deletions githooks/constants.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const chalk = require('chalk');

const TYPES = ['docs', 'feat', 'fix', 'refactor', 'revert', 'upkeep', 'spike'];
const SCOPE_REGEX = /^[A-Z]{2,5}-\d{1,5}$/;
const SCOPE_REGEX = /^[A-Z]{2,5}-\d{1,5}|\d{1,5}$/;
const PLAIN_PREFIX_ERROR_MSG =
"The commit message should be in the format 'type - fix/feat/etc(ticket-number): message'";
"The commit message should be in the format 'type - fix/feat/etc(issue-number): message'";
const FORMATTED_PREFIX_ERROR_MSG = `The commit message should be in the format ${chalk.bold(
"'type",
)}${chalk.reset.dim(' - fix/feat/etc')}${chalk.bold(
Expand Down
8 changes: 4 additions & 4 deletions githooks/preparecommitmsg.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ const createPrompts = ({type, scope}) => {
SEM_VER_COMMIT_TYPES[SEM_VER_COMMIT_TYPES.length - 1],
},
{
message: 'Enter the Jira ticket number for this commit',
message: 'Enter the github issue number for this commit',
name: 'scope',
transformer: input => input.toUpperCase(),
type: 'input',
validate: input =>
SCOPE_REGEX.test(input.toUpperCase()) || 'e.g. PPDSC-1608',
validate: input => SCOPE_REGEX.test(input.toUpperCase()) || 'e.g. 1608',
when: !scope,
},
];
Expand All @@ -69,7 +68,7 @@ const createPrompts = ({type, scope}) => {

const getBranchData = ({type, scope}) =>
new Promise((resolve, reject) => {
const branchNameRegex = /^(?:(\w*)\/)?([a-z]{2,5}-\d{1,5})?/i;
const branchNameRegex = /^(?:(\w*)\/)?([a-z]{2,5}-\d{1,5}|\d{1,5})?/i;
exec('git rev-parse --abbrev-ref HEAD', (err, stdout, stderr) => {
if (stdout && typeof stdout === 'string') {
const matches = stdout.trim().match(branchNameRegex);
Expand Down Expand Up @@ -102,6 +101,7 @@ if (msgFilePath) {
)
.then(({scope, type, ...parsed}) => {
// remove any already defined type and scope info

const message = parsed.raw
.replace(type, '')
.replace(`(${scope})`, '')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "newskit",
"version": "7.0.0",
"version": "7.1.0",
"description": "A React Component library implementing the News design language",
"keywords": [
"react",
Expand Down
9 changes: 4 additions & 5 deletions site/components/site-footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as React from 'react';
import {
Grid,
Cell,
ConsentSettingsLink,
getColorCssFromTheme,
getSizingCssFromTheme,
getMediaQueryFromTheme,
Expand Down Expand Up @@ -96,14 +95,14 @@ const SiteFooter: React.FC<FooterProps> = ({cellProps = {xs: 12}}) => (
</Link>
</FooterLink>
<FooterLink>
<ConsentSettingsLink
privacyManagerId="407619"
gdpr
<Link
type="standalone"
href="/"
overrides={linkOverrides}
eventContext={{value: 'Privacy policy'}}
>
Privacy policy
</ConsentSettingsLink>
</Link>
</FooterLink>
<FooterLink>
<Link
Expand Down
15 changes: 2 additions & 13 deletions site/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Document, {Head, Main, NextScript, Html} from 'next/document';
import {
Global,
css,
Consent,
Tealium,
compileTheme,
newskitLightTheme,
Expand All @@ -22,30 +21,19 @@ const baseHref =

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

const compiledNewskitLightTheme = compileTheme(newskitLightTheme);
export default class MyDocument extends Document {
render() {
const isSiteEnvProduction = process.env.SITE_ENV === 'production';

const helmet = Helmet.rewind();

const compiledNewskitLightTheme = compileTheme(newskitLightTheme);

return (
<Html lang="en">
<Head>
<Base />
{helmet.script.toComponent()}
<HTMLMeta />
{isSiteEnvProduction && (
<Consent
sourcePointConfigUnified={{
accountId: 259,
propertyHref: 'https://newskit.co.uk',
gdpr: {},
}}
reactHelmet={Helmet}
/>
)}
</Head>
<body>
<Global
Expand Down Expand Up @@ -278,6 +266,7 @@ export default class MyDocument extends Document {
reactHelmet={Helmet}
/>
)}

<Main />
<NextScript />
</body>
Expand Down
77 changes: 42 additions & 35 deletions site/pages/help/terms-and-conditions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,44 +39,51 @@ const Introduction = ({path, ...props}: LayoutProps) => (
name="Website terms and conditions of use"
introduction={
<>
<P overrides={contentOverrides}>
Welcome to the Website Terms and Conditions of Use (<b>Terms</b>)
which apply to{' '}
<Link href="https://newskit.co.uk/" target="_blank">
https://newskit.co.uk/
</Link>{' '}
(the <b>Website</b>).
<br />
<br />
By using our Website you agree to be legally bound by these Terms.
If you do not agree to these Terms, you should not use our Website.
<br />
<br />
On this Website, we make available various software components,
features and tools (<b>Components</b>), including code which has
been developed by or on behalf of News UK to form the basis of
NewsKit (<b>NewsKit OSS</b>).
<br />
<br />
Separate terms may apply to your usage of NewsKit OSS and other
Components, including these{' '}
<Link
href="https://github.com/newscorp-ghfb/newskit/blob/main/LICENSE"
target="_blank"
>
Open Source Terms
</Link>
. You should ensure that you check, and comply with, the terms of
the licences for any such Components before using them.
<br />
<br />
In the event of a conflict between these Terms and the Open Source
Terms in any way, the Open Source Terms shall prevail in relation to
your usage of any Components (including NewsKit OSS).
</P>
Welcome to the Website Terms and Conditions of Use (<b>Terms</b>)
which apply to{' '}
<Link href="https://newskit.co.uk/" target="_blank">
https://newskit.co.uk/
</Link>{' '}
(the <b>Website</b>).
</>
}
/>
<ComponentPageCell>
<ContentSection>
<ContentSecondary
description={
<>
By using our Website you agree to be legally bound by these Terms.
If you do not agree to these Terms, you should not use our
Website.
<br />
<br />
On this Website, we make available various software components,
features and tools (<b>Components</b>), including code which has
been developed by or on behalf of News UK to form the basis of
NewsKit (<b>NewsKit OSS</b>).
<br />
<br />
Separate terms may apply to your usage of NewsKit OSS and other
Components, including these{' '}
<Link
href="https://github.com/newscorp-ghfb/newskit/blob/main/LICENSE"
target="_blank"
>
Open Source Terms
</Link>
. You should ensure that you check, and comply with, the terms of
the licences for any such Components before using them.
<br />
<br />
In the event of a conflict between these Terms and the Open Source
Terms in any way, the Open Source Terms shall prevail in relation
to your usage of any Components (including NewsKit OSS).
</>
}
/>
</ContentSection>
</ComponentPageCell>

<ComponentPageCell>
<ContentSection sectionName="accessing and using our website">
Expand Down
Loading

0 comments on commit c93bad3

Please sign in to comment.