Skip to content

Commit b865717

Browse files
authored
Merge pull request #167 from digi-trust/master
Add company name
2 parents 16c1840 + b5d7ad8 commit b865717

File tree

6 files changed

+85
-2
lines changed

6 files changed

+85
-2
lines changed

spec/configuration.spec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,16 @@ describe('different configurations', () => {
100100
});
101101
});
102102

103+
describe('Company Name', () => {
104+
beforeEach(() => {
105+
browser.get("/e2e/company_name.html");
106+
browser.sleep(300);
107+
});
108+
109+
it('title contains the company name specified in the config', () => {
110+
const el = element.all(by.css('[class^=intro_title]')).first();
111+
expect(el.getText()).toContain("Roadrunner and Coyote Enterprises");
112+
});
113+
});
114+
103115
});

src/components/popup/intro/intro.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ export default class Intro extends Component {
4040
}
4141
<div class={style.title + " primaryText"}>
4242
<LocalLabel providedValue={localization && localization.intro ? localization.intro.title : ''} localizeKey='title'>Thanks for visiting </LocalLabel>
43-
<LocalLabel providedValue={localization && localization.intro ? localization.intro.domain : ''} localizeKey='domain'></LocalLabel>
43+
{config && config.companyName &&
44+
<span>{config.companyName}</span>
45+
}
4446
</div>
4547
<div class={style.description + " primaryText"}>
4648
<LocalLabel providedValue={localization && localization.intro ? localization.intro.description : ''} localizeKey='description'>Ads help us run this site. When you use our site selected companies may access and use information on your device for various purposes including to serve relevant ads or personalised content.</LocalLabel>

src/components/popup/intro/introV2.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ export default class IntroV2 extends Component {
4141
}
4242
<div class={config.logoUrl ? style.title + " " + style.imagePadding : style.title}>
4343
<LocalLabel providedValue={localization && localization.intro ? localization.intro.title : ''} localizeKey='title'>Thanks for visiting </LocalLabel>
44-
<LocalLabel providedValue={localization && localization.intro ? localization.intro.domain : ''} localizeKey='domain'></LocalLabel>
44+
{config && config.companyName &&
45+
<span>{config.companyName}</span>
46+
}
4547
</div>
4648
</div>
4749
<div class={style.description + " primaryText"}>

src/e2e/company_name.html

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>GDPR Documentation</title>
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimal-ui">
7+
<meta name="apple-mobile-web-app-capable" content="yes">
8+
<script>
9+
(function(window) {
10+
window.__cmp = (function() {
11+
window.addEventListener('message', function(event) {
12+
window.__cmp.receiveMessage(event);
13+
});
14+
15+
var commandQueue = [];
16+
var cmp = function(command, parameter, callback) {
17+
commandQueue.push({
18+
command: command,
19+
parameter: parameter,
20+
callback: callback
21+
});
22+
};
23+
cmp.commandQueue = commandQueue;
24+
cmp.receiveMessage = function(event) {
25+
var data = event && event.data && event.data.__cmpCall;
26+
if (data) {
27+
commandQueue.push({
28+
callId: data.callId,
29+
command: data.command,
30+
parameter: data.parameter,
31+
event: event
32+
});
33+
}
34+
};
35+
cmp.config = {
36+
companyName: "Roadrunner and Coyote Enterprises",
37+
customPurposeListLocation: '../../docs/purposes.json',
38+
globalVendorListLocation: '../../docs/vendors.json',
39+
globalConsentLocation: '../../docs/portal.html',
40+
storeConsentGlobally: false,
41+
storePublisherConsentGlobally: false,
42+
storePublisherData: true,
43+
logging: "debug",
44+
blockBrowsing: false,
45+
forceLocale: 'en',
46+
testingMode: 'always show',
47+
showFooterAfterSubmit: true,
48+
};
49+
return cmp;
50+
}());
51+
})(window);
52+
53+
window.__cmp('renderCmpIfNeeded');
54+
</script>
55+
</head>
56+
<body>
57+
<a href="#">Some Link</a>
58+
<div><p>Some Text</p></div>
59+
<script type="text/javascript" src="../../cmp.bundle.js"></script></body>
60+
</body>
61+
</html>

src/lib/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import log from './log';
22
const metadata = require('../../metadata.json');
33
const defaultConfig = {
4+
companyName: null,
45
storePublisherData: true,
56
customPurposeListLocation: null,
67
storeConsentGlobally: true,

webpack.config.babel.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@ module.exports = [
204204
template: 'e2e/layout-thin.html',
205205
chunks: ['e2e']
206206
}),
207+
new HtmlWebpackPlugin({
208+
filename: 'e2e/company_name.html',
209+
template: 'e2e/company_name.html',
210+
chunks: ['e2e']
211+
}),
207212
// Static assets copy
208213
new CopyWebpackPlugin([
209214
{ from: './geoip.json' }

0 commit comments

Comments
 (0)