@pearsonedunext/frontend-component-cookie-policy-banner 5.0.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/.eslintignore +3 -0
- package/.eslintrc +22 -0
- package/.github/ISSUE_TEMPLATE/config.yml +12 -0
- package/.github/ISSUE_TEMPLATE/depr-ticket.yml +91 -0
- package/.github/workflows/add-depr-ticket-to-depr-board.yml +19 -0
- package/.github/workflows/add-remove-label-on-comment.yml +20 -0
- package/.github/workflows/ci.yml +47 -0
- package/.github/workflows/commitlint.yml +10 -0
- package/.github/workflows/lockfileversion-check.yml +13 -0
- package/.github/workflows/npm-publish.yml +45 -0
- package/.github/workflows/self-assign-issue.yml +12 -0
- package/.nvmrc +1 -0
- package/.storybook/addons.js +2 -0
- package/.storybook/config.js +22 -0
- package/.storybook/webpack.config.js +58 -0
- package/LICENSE +661 -0
- package/README.md +108 -0
- package/babel.config.json +19 -0
- package/build/CookiePolicyBanner/CookiePolicyBanner.stories.jsx +20 -0
- package/build/CookiePolicyBanner/_cookie-policy-banner.scss +96 -0
- package/build/CookiePolicyBanner/_storybook-styles.scss +5 -0
- package/build/CookiePolicyBanner/index.js +116 -0
- package/build/_cookie-policy-banner.css +56 -0
- package/build/_cookie-policy-banner.scss +96 -0
- package/build/constants.js +38 -0
- package/build/index.js +2 -0
- package/build/setupTest.js +6 -0
- package/build/utilities.js +58 -0
- package/fileTransformer.js +7 -0
- package/jest.config.js +20 -0
- package/migration-storybook.log +224 -0
- package/openedx.yaml +8 -0
- package/package.json +108 -0
- package/renovate.json +17 -0
- package/storybook.log +34 -0
package/.eslintignore
ADDED
package/.eslintrc
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["@edx/eslint-config"],
|
|
3
|
+
"parserOptions": {
|
|
4
|
+
"ecmaFeatures": {
|
|
5
|
+
"jsx": true
|
|
6
|
+
}
|
|
7
|
+
},
|
|
8
|
+
"env": {
|
|
9
|
+
"jest": true
|
|
10
|
+
},
|
|
11
|
+
"overrides": [
|
|
12
|
+
{
|
|
13
|
+
"files": ["*.stories.jsx", "*.test.jsx"],
|
|
14
|
+
"rules": {
|
|
15
|
+
"import/no-extraneous-dependencies": "off"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"globals": {
|
|
20
|
+
"jsdom": true
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
## This configuration file overrides the inherited configuration file defined
|
|
2
|
+
## in openedx/.github/.github/ISSUE_TEMPLATE because this repo currently does
|
|
3
|
+
## not have Issues turned on, so we create this override to *only* show DEPR
|
|
4
|
+
## issues to users creating Issues. Once Issues are turned on and the repo is
|
|
5
|
+
## ready to accept Issues of all types, this file must be deleted so inheritance
|
|
6
|
+
## of standard openedx configuration works properly.
|
|
7
|
+
|
|
8
|
+
blank_issues_enabled: false
|
|
9
|
+
contact_links:
|
|
10
|
+
- name: Open edX Community Support
|
|
11
|
+
url: https://discuss.openedx.org/
|
|
12
|
+
about: Please ask all questions, suggest all enhancements, and report all bugs here.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
## This configuration file overrides the inherited configuration file defined
|
|
2
|
+
## in openedx/.github/.github/ISSUE_TEMPLATE because this repo currently does
|
|
3
|
+
## not have Issues turned on, so we create this override to *only* show DEPR
|
|
4
|
+
## issues to users creating Issues. Once Issues are turned on and the repo is
|
|
5
|
+
## ready to accept Issues of all types, this file must be deleted so inheritance
|
|
6
|
+
## of standard openedx configuration works properly.
|
|
7
|
+
|
|
8
|
+
name: Deprecation (DEPR) Ticket
|
|
9
|
+
description: Per OEP-21, use this template to begin the technology deprecation process.
|
|
10
|
+
title: "[DEPR]: <Technology Name>"
|
|
11
|
+
labels: ["DEPR"]
|
|
12
|
+
body:
|
|
13
|
+
- type: markdown
|
|
14
|
+
attributes:
|
|
15
|
+
value: |
|
|
16
|
+
Refer to [OEP-21](https://open-edx-proposals.readthedocs.io/en/latest/processes/oep-0021-proc-deprecation.html) for more detail on the deprecation and removal process. This ticket should only be used for proposing the removal of an Open edX technology.
|
|
17
|
+
Please leave [DEPR] in the title of your ticket!
|
|
18
|
+
- type: input
|
|
19
|
+
id: todays-date
|
|
20
|
+
attributes:
|
|
21
|
+
label: Proposal Date
|
|
22
|
+
description: The start date of this proposal (likely today)
|
|
23
|
+
placeholder: 29 February 2020
|
|
24
|
+
validations:
|
|
25
|
+
required: true
|
|
26
|
+
- type: input
|
|
27
|
+
id: accept-date
|
|
28
|
+
attributes:
|
|
29
|
+
label: Ticket Acceptance Date
|
|
30
|
+
description: When is the target date for getting this proposal accepted?
|
|
31
|
+
placeholder: 29 February 2020
|
|
32
|
+
validations:
|
|
33
|
+
required: true
|
|
34
|
+
- type: input
|
|
35
|
+
id: remove-date
|
|
36
|
+
attributes:
|
|
37
|
+
label: Technology Removal Date
|
|
38
|
+
description: When is the target date for getting this technology removed?
|
|
39
|
+
placeholder: 29 February 2020
|
|
40
|
+
validations:
|
|
41
|
+
required: true
|
|
42
|
+
- type: input
|
|
43
|
+
id: named-release-without
|
|
44
|
+
attributes:
|
|
45
|
+
label: First Open edX Named Release Without This Functionality
|
|
46
|
+
description: Named releases are generally CUT in early April and early October. Based on the above removal date, what named release would be the first without this code? Please reach out to the Build Test Release working group (#wg-build-test-release in Slack) if you're not sure.
|
|
47
|
+
placeholder: Dogwood
|
|
48
|
+
validations:
|
|
49
|
+
required: true
|
|
50
|
+
- type: textarea
|
|
51
|
+
id: rationale
|
|
52
|
+
attributes:
|
|
53
|
+
label: Rationale
|
|
54
|
+
description: Explain, in a few sentences, why this technology should be removed - what's the usage pattern? What's wrong with keeping it around?
|
|
55
|
+
validations:
|
|
56
|
+
required: true
|
|
57
|
+
- type: textarea
|
|
58
|
+
id: removal
|
|
59
|
+
attributes:
|
|
60
|
+
label: Removal
|
|
61
|
+
description: Include a description with links to what exactly is being removed.
|
|
62
|
+
validations:
|
|
63
|
+
required: true
|
|
64
|
+
- type: textarea
|
|
65
|
+
id: replacement
|
|
66
|
+
attributes:
|
|
67
|
+
label: Replacement
|
|
68
|
+
description: Include a description with links to what this is being replaced by.
|
|
69
|
+
validations:
|
|
70
|
+
required: true
|
|
71
|
+
- type: textarea
|
|
72
|
+
id: deprecation
|
|
73
|
+
attributes:
|
|
74
|
+
label: Deprecation
|
|
75
|
+
description: If you plan to mark the code for deprecation, explain how.
|
|
76
|
+
validations:
|
|
77
|
+
required: false
|
|
78
|
+
- type: textarea
|
|
79
|
+
id: migration
|
|
80
|
+
attributes:
|
|
81
|
+
label: Migration
|
|
82
|
+
description: If automated migration will be needed, explain your migration plan.
|
|
83
|
+
validations:
|
|
84
|
+
required: false
|
|
85
|
+
- type: textarea
|
|
86
|
+
id: addl-info
|
|
87
|
+
attributes:
|
|
88
|
+
label: Additional Info
|
|
89
|
+
description: If there is any additional publicly sharable information or data from your earlier analysis, include that.
|
|
90
|
+
validations:
|
|
91
|
+
required: false
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Run the workflow that adds new tickets that are either:
|
|
2
|
+
# - labelled "DEPR"
|
|
3
|
+
# - title starts with "[DEPR]"
|
|
4
|
+
# - body starts with "Proposal Date" (this is the first template field)
|
|
5
|
+
# to the org-wide DEPR project board
|
|
6
|
+
|
|
7
|
+
name: Add newly created DEPR issues to the DEPR project board
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
issues:
|
|
11
|
+
types: [opened]
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
routeissue:
|
|
15
|
+
uses: openedx/.github/.github/workflows/add-depr-ticket-to-depr-board.yml@master
|
|
16
|
+
secrets:
|
|
17
|
+
GITHUB_APP_ID: ${{ secrets.GRAPHQL_AUTH_APP_ID }}
|
|
18
|
+
GITHUB_APP_PRIVATE_KEY: ${{ secrets.GRAPHQL_AUTH_APP_PEM }}
|
|
19
|
+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ISSUE_BOT_TOKEN }}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# This workflow runs when a comment is made on the ticket
|
|
2
|
+
# If the comment starts with "label: " it tries to apply
|
|
3
|
+
# the label indicated in rest of comment.
|
|
4
|
+
# If the comment starts with "remove label: ", it tries
|
|
5
|
+
# to remove the indicated label.
|
|
6
|
+
# Note: Labels are allowed to have spaces and this script does
|
|
7
|
+
# not parse spaces (as often a space is legitimate), so the command
|
|
8
|
+
# "label: really long lots of words label" will apply the
|
|
9
|
+
# label "really long lots of words label"
|
|
10
|
+
|
|
11
|
+
name: Allows for the adding and removing of labels via comment
|
|
12
|
+
|
|
13
|
+
on:
|
|
14
|
+
issue_comment:
|
|
15
|
+
types: [created]
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
add_remove_labels:
|
|
19
|
+
uses: openedx/.github/.github/workflows/add-remove-label-on-comment.yml@master
|
|
20
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: node_js CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- '**'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
tests:
|
|
10
|
+
runs-on: ubuntu-20.04
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout
|
|
13
|
+
uses: actions/checkout@v2
|
|
14
|
+
|
|
15
|
+
- name: Setup Nodejs Env
|
|
16
|
+
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
|
|
17
|
+
|
|
18
|
+
- name: Setup Nodejs
|
|
19
|
+
uses: actions/setup-node@v1
|
|
20
|
+
with:
|
|
21
|
+
node-version: ${{ env.NODE_VER }}
|
|
22
|
+
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: npm ci
|
|
25
|
+
|
|
26
|
+
- name: Lint
|
|
27
|
+
run: npm run lint
|
|
28
|
+
|
|
29
|
+
- name: Test
|
|
30
|
+
run: npm run test
|
|
31
|
+
|
|
32
|
+
- name: Compile
|
|
33
|
+
run: npm run compile-prod
|
|
34
|
+
|
|
35
|
+
- name: Run Coverage
|
|
36
|
+
uses: codecov/codecov-action@v3
|
|
37
|
+
|
|
38
|
+
- name: Extract branch name
|
|
39
|
+
shell: bash
|
|
40
|
+
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
|
41
|
+
id: extract_branch
|
|
42
|
+
|
|
43
|
+
- name: Preview semantic-release version
|
|
44
|
+
env:
|
|
45
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
46
|
+
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
|
|
47
|
+
run: npm run semantic-release --dry-run --branches=${{ steps.extract_branch.outputs.branch}}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Release CI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- master
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
release:
|
|
9
|
+
name: Release
|
|
10
|
+
runs-on: ubuntu-20.04
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout
|
|
13
|
+
uses: actions/checkout@v2
|
|
14
|
+
with:
|
|
15
|
+
fetch-depth: 0
|
|
16
|
+
token: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
|
|
17
|
+
|
|
18
|
+
- name: Setup Nodejs Env
|
|
19
|
+
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
|
|
20
|
+
|
|
21
|
+
- name: Setup Node.js
|
|
22
|
+
uses: actions/setup-node@v1
|
|
23
|
+
with:
|
|
24
|
+
node-version: ${{ env.NODE_VER }}
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: npm ci
|
|
28
|
+
|
|
29
|
+
- name: Lint
|
|
30
|
+
run: npm run lint
|
|
31
|
+
|
|
32
|
+
- name: Test
|
|
33
|
+
run: npm run test
|
|
34
|
+
|
|
35
|
+
- name: Create Build
|
|
36
|
+
run: npm run compile-prod
|
|
37
|
+
|
|
38
|
+
- name: Run Coverage
|
|
39
|
+
uses: codecov/codecov-action@v2
|
|
40
|
+
|
|
41
|
+
- name: Release Package
|
|
42
|
+
env:
|
|
43
|
+
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
|
|
44
|
+
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
|
|
45
|
+
run: npm run semantic-release
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# This workflow runs when a comment is made on the ticket
|
|
2
|
+
# If the comment starts with "assign me" it assigns the author to the
|
|
3
|
+
# ticket (case insensitive)
|
|
4
|
+
|
|
5
|
+
name: Assign comment author to ticket if they say "assign me"
|
|
6
|
+
on:
|
|
7
|
+
issue_comment:
|
|
8
|
+
types: [created]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
self_assign_by_comment:
|
|
12
|
+
uses: openedx/.github/.github/workflows/self-assign-issue.yml@master
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
18
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { configure, addDecorator } from '@storybook/react';
|
|
2
|
+
import { setOptions } from '@storybook/addon-options';
|
|
3
|
+
import { setDefaults } from '@storybook/addon-info';
|
|
4
|
+
|
|
5
|
+
setDefaults({
|
|
6
|
+
inline: false,
|
|
7
|
+
header: true,
|
|
8
|
+
source: true,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
setTimeout(() => setOptions({
|
|
12
|
+
name: 'EDX COOKIE POLICY BANNER',
|
|
13
|
+
url: 'https://github.com/openedx/frontend-component-cookie-policy-banner',
|
|
14
|
+
showAddonPanel: true,
|
|
15
|
+
addonPanelInRight: true,
|
|
16
|
+
}), 1000);
|
|
17
|
+
|
|
18
|
+
function loadStories() {
|
|
19
|
+
require('../src/CookiePolicyBanner/CookiePolicyBanner.stories.jsx');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
configure(loadStories, module);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const WebpackBuildNotifierPlugin = require('webpack-build-notifier');
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
plugins: [
|
|
6
|
+
new WebpackBuildNotifierPlugin({
|
|
7
|
+
title: 'edX Cookie Banner',
|
|
8
|
+
warningSound: true,
|
|
9
|
+
failureSound: true,
|
|
10
|
+
}),
|
|
11
|
+
],
|
|
12
|
+
devtool: 'source-map',
|
|
13
|
+
module: {
|
|
14
|
+
rules: [
|
|
15
|
+
{
|
|
16
|
+
test: /\.(js|jsx)$/,
|
|
17
|
+
exclude: /(node_modules)/,
|
|
18
|
+
use: [
|
|
19
|
+
{
|
|
20
|
+
loader: 'babel-loader',
|
|
21
|
+
options: {
|
|
22
|
+
presets: ['@babel/preset-env'],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{ loader: 'source-map-loader' },
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
test: /\.scss|\.css$/,
|
|
30
|
+
use: [
|
|
31
|
+
{
|
|
32
|
+
loader: 'style-loader',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
loader: 'css-loader',
|
|
36
|
+
options: {
|
|
37
|
+
modules: true,
|
|
38
|
+
localIdentName: '[local]',
|
|
39
|
+
sourceMap: true,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
loader: 'sass-loader',
|
|
44
|
+
options: {
|
|
45
|
+
sassOptions: {
|
|
46
|
+
includePaths: [
|
|
47
|
+
path.join(__dirname, '../src/utils'),
|
|
48
|
+
path.join(__dirname, '../node_modules'),
|
|
49
|
+
],
|
|
50
|
+
sourceMap: true,
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
};
|