@postnord/pn-marketweb-components 2.1.1 → 2.1.3
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/cjs/loader.cjs.js +1 -1
- package/cjs/pn-language-selector_9.cjs.entry.js +7 -4
- package/cjs/pn-market-web-components.cjs.js +1 -1
- package/cjs/{pn-marketweb-siteheader-login-button_4.cjs.entry.js → pn-marketweb-siteheader-login-button_5.cjs.entry.js} +71 -29
- package/cjs/pn-marketweb-siteheader-login-linklist.cjs.entry.js +53 -6
- package/cjs/pn-marketweb-siteheader.cjs.entry.js +74 -58
- package/cjs/pn-proxio-findprice.cjs.entry.js +0 -5
- package/collection/collection-manifest.json +1 -0
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.js +8 -38
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.css +3 -1
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.js +74 -8
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.js +20 -1
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.js +64 -8
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.css +0 -0
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.js +88 -0
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.css +9 -2
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.js +24 -2
- package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.stories.js +1 -1
- package/collection/components/layout-components/pn-marketweb-siteheader/translations.js +67 -55
- package/collection/components/layout-components/pn-marketweb-siteheader/unifiedLoginHelper.js +46 -0
- package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice.js +0 -5
- package/custom-elements/index.d.ts +6 -0
- package/custom-elements/index.js +212 -107
- package/esm/loader.js +1 -1
- package/esm/pn-language-selector_9.entry.js +7 -4
- package/esm/pn-market-web-components.js +1 -1
- package/esm/{pn-marketweb-siteheader-login-button_4.entry.js → pn-marketweb-siteheader-login-button_5.entry.js} +71 -30
- package/esm/pn-marketweb-siteheader-login-linklist.entry.js +53 -6
- package/esm/pn-marketweb-siteheader.entry.js +74 -58
- package/esm/pn-proxio-findprice.entry.js +0 -5
- package/esm-es5/loader.js +1 -1
- package/esm-es5/pn-language-selector_9.entry.js +1 -1
- package/esm-es5/pn-market-web-components.js +1 -1
- package/esm-es5/pn-marketweb-siteheader-login-button_5.entry.js +1 -0
- package/esm-es5/pn-marketweb-siteheader-login-linklist.entry.js +1 -1
- package/esm-es5/pn-marketweb-siteheader.entry.js +1 -1
- package/esm-es5/pn-proxio-findprice.entry.js +1 -1
- package/package.json +2 -2
- package/pn-market-web-components/p-3120cc66.system.entry.js +1 -0
- package/pn-market-web-components/{p-70b360dd.entry.js → p-39b54d40.entry.js} +1 -1
- package/pn-market-web-components/p-4b0020a0.system.entry.js +1 -0
- package/pn-market-web-components/p-67887512.system.js +1 -1
- package/pn-market-web-components/p-6995075c.entry.js +1 -0
- package/pn-market-web-components/{p-2b4c41aa.system.entry.js → p-8df74fc3.system.entry.js} +1 -1
- package/pn-market-web-components/p-b7adbd6d.system.entry.js +1 -0
- package/pn-market-web-components/p-c8ceda2e.entry.js +1 -0
- package/pn-market-web-components/p-e1618047.entry.js +1 -0
- package/pn-market-web-components/{p-7f9c643c.system.entry.js → p-e881d111.system.entry.js} +1 -1
- package/pn-market-web-components/p-fefc9629.entry.js +1 -0
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.d.ts +2 -4
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.d.ts +4 -0
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.d.ts +1 -0
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.d.ts +4 -0
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-types.d.ts +2 -2
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.d.ts +8 -0
- package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.d.ts +2 -0
- package/types/components/layout-components/pn-marketweb-siteheader/translations.d.ts +12 -0
- package/types/components/layout-components/pn-marketweb-siteheader/unifiedLoginHelper.d.ts +1 -0
- package/types/components.d.ts +45 -0
- package/esm-es5/pn-marketweb-siteheader-login-button_4.entry.js +0 -1
- package/pn-market-web-components/p-20be85a1.system.entry.js +0 -1
- package/pn-market-web-components/p-dd01024a.system.entry.js +0 -1
- package/pn-market-web-components/p-de823255.entry.js +0 -1
- package/pn-market-web-components/p-e4ebf17d.system.entry.js +0 -1
- package/pn-market-web-components/p-e7a1cda9.entry.js +0 -1
- package/pn-market-web-components/p-fe95397b.entry.js +0 -1
- package/pn-market-web-components/p-ff83e974.entry.js +0 -1
|
@@ -17,8 +17,8 @@ export class PnMarketwebSiteheaderLogin {
|
|
|
17
17
|
mainMenuButton: '',
|
|
18
18
|
menuStartButton: '',
|
|
19
19
|
profileSelectionFlyoutHeading: '',
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
unifiedLoginButton: '',
|
|
21
|
+
unifiedMyPagesButton: '',
|
|
22
22
|
};
|
|
23
23
|
this.siteUrl = '';
|
|
24
24
|
this.emitEvents = true;
|
|
@@ -29,13 +29,16 @@ export class PnMarketwebSiteheaderLogin {
|
|
|
29
29
|
this.loggedin = false;
|
|
30
30
|
/** If this is selected we will show the new profile selection dropdown instead of the login version */
|
|
31
31
|
this.showProfileSelection = false;
|
|
32
|
+
/** if this is selected we will show the unifiedlogin button along with new look for dropdown */
|
|
33
|
+
this.showUnifiedLogin = false;
|
|
32
34
|
/** Continiously check if a user is logged in **/
|
|
33
35
|
this.checkUserLoggedInStateInterval = 0;
|
|
36
|
+
this.loginButtonText = 'Placeholder';
|
|
37
|
+
this.loginInformationRichText = '<a href="#">Read more about the benefits of becoming a customer in the business portal</a>';
|
|
34
38
|
this.toggleButtonText = ((_a = this.loginDialog) === null || _a === void 0 ? void 0 : _a.loginMenuLinkText) ? this.loginDialog.loginMenuLinkText : '';
|
|
35
39
|
this.username = this.fullname;
|
|
36
40
|
}
|
|
37
41
|
componentWillLoad() {
|
|
38
|
-
console.log('env: ', this.environment);
|
|
39
42
|
const userInfo = this.loggedin && this.fullname ? { given_name: this.fullname } : null;
|
|
40
43
|
headerState.loginManager = new MarketWebLoginManager({
|
|
41
44
|
endpoint: this.endpoint,
|
|
@@ -157,10 +160,9 @@ export class PnMarketwebSiteheaderLogin {
|
|
|
157
160
|
}
|
|
158
161
|
return (h(Host, Object.assign({}, hostElementAttribute),
|
|
159
162
|
h("pn-nav-dropdown", { label: this.toggleButtonText, icon: "user", class: "siteheader-logindialog" },
|
|
160
|
-
this.
|
|
161
|
-
this.
|
|
162
|
-
this.
|
|
163
|
-
this.environment !== 'production' && h("p", null, "L\u00E4s mer om v\u00E5ra inloggade tj\u00E4nster och hur du anv\u00E4nder dem"))));
|
|
163
|
+
this.showUnifiedLogin && (h("pn-marketweb-siteheader-unified-login", { loggedIn: this.loggedin, myPageLabel: this.i18n.unifiedMyPagesButton, myPageUrl: "https://account.postnord.com/secure/profile", logInLabel: this.i18n.unifiedLoginButton })),
|
|
164
|
+
this.loggedin && this.showProfileSelection ? (h("pn-marketweb-siteheader-login-profileselection", { loginDialog: this.loginDialog, loggedin: this.loggedin, i18n: this.i18n, idNamespace: this.emitEvents ? '1' : '2', endpoint: this.endpoint })) : (h("pn-marketweb-siteheader-login-links", { loginDialog: this.loginDialog, loggedin: this.loggedin, idNamespace: this.emitEvents ? '1' : '2', username: this.username, showUnifiedLogin: this.showUnifiedLogin })),
|
|
165
|
+
this.showUnifiedLogin && h("span", { innerHTML: `${this.loginInformationRichText}` }))));
|
|
164
166
|
}
|
|
165
167
|
static get is() { return "pn-marketweb-siteheader-login"; }
|
|
166
168
|
static get originalStyleUrls() { return {
|
|
@@ -225,7 +227,7 @@ export class PnMarketwebSiteheaderLogin {
|
|
|
225
227
|
"tags": [],
|
|
226
228
|
"text": ""
|
|
227
229
|
},
|
|
228
|
-
"defaultValue": "{\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n
|
|
230
|
+
"defaultValue": "{\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n unifiedLoginButton: '',\n unifiedMyPagesButton: '',\n } as SiteHeaderI18N"
|
|
229
231
|
},
|
|
230
232
|
"siteUrl": {
|
|
231
233
|
"type": "string",
|
|
@@ -338,6 +340,24 @@ export class PnMarketwebSiteheaderLogin {
|
|
|
338
340
|
"reflect": false,
|
|
339
341
|
"defaultValue": "false"
|
|
340
342
|
},
|
|
343
|
+
"showUnifiedLogin": {
|
|
344
|
+
"type": "boolean",
|
|
345
|
+
"mutable": false,
|
|
346
|
+
"complexType": {
|
|
347
|
+
"original": "boolean",
|
|
348
|
+
"resolved": "boolean",
|
|
349
|
+
"references": {}
|
|
350
|
+
},
|
|
351
|
+
"required": false,
|
|
352
|
+
"optional": false,
|
|
353
|
+
"docs": {
|
|
354
|
+
"tags": [],
|
|
355
|
+
"text": "if this is selected we will show the unifiedlogin button along with new look for dropdown"
|
|
356
|
+
},
|
|
357
|
+
"attribute": "show-unified-login",
|
|
358
|
+
"reflect": false,
|
|
359
|
+
"defaultValue": "false"
|
|
360
|
+
},
|
|
341
361
|
"checkUserLoggedInStateInterval": {
|
|
342
362
|
"type": "number",
|
|
343
363
|
"mutable": false,
|
|
@@ -372,6 +392,42 @@ export class PnMarketwebSiteheaderLogin {
|
|
|
372
392
|
},
|
|
373
393
|
"attribute": "environment",
|
|
374
394
|
"reflect": false
|
|
395
|
+
},
|
|
396
|
+
"loginButtonText": {
|
|
397
|
+
"type": "string",
|
|
398
|
+
"mutable": false,
|
|
399
|
+
"complexType": {
|
|
400
|
+
"original": "string",
|
|
401
|
+
"resolved": "string",
|
|
402
|
+
"references": {}
|
|
403
|
+
},
|
|
404
|
+
"required": false,
|
|
405
|
+
"optional": false,
|
|
406
|
+
"docs": {
|
|
407
|
+
"tags": [],
|
|
408
|
+
"text": ""
|
|
409
|
+
},
|
|
410
|
+
"attribute": "login-button-text",
|
|
411
|
+
"reflect": false,
|
|
412
|
+
"defaultValue": "'Placeholder'"
|
|
413
|
+
},
|
|
414
|
+
"loginInformationRichText": {
|
|
415
|
+
"type": "string",
|
|
416
|
+
"mutable": false,
|
|
417
|
+
"complexType": {
|
|
418
|
+
"original": "string",
|
|
419
|
+
"resolved": "string",
|
|
420
|
+
"references": {}
|
|
421
|
+
},
|
|
422
|
+
"required": false,
|
|
423
|
+
"optional": false,
|
|
424
|
+
"docs": {
|
|
425
|
+
"tags": [],
|
|
426
|
+
"text": ""
|
|
427
|
+
},
|
|
428
|
+
"attribute": "login-information-rich-text",
|
|
429
|
+
"reflect": false,
|
|
430
|
+
"defaultValue": "'<a href=\"#\">Read more about the benefits of becoming a customer in the business portal</a>'"
|
|
375
431
|
}
|
|
376
432
|
}; }
|
|
377
433
|
static get states() { return {
|
|
File without changes
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Component, Element, h, Host, Prop } from '@stencil/core';
|
|
2
|
+
export class PnMarketwebSiteheaderUnifiedLogin {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.loggedIn = false;
|
|
5
|
+
}
|
|
6
|
+
render() {
|
|
7
|
+
return (h(Host, null, this.loggedIn ? (h("pn-marketweb-siteheader-login-mypage-button", { label: this.myPageLabel, myPageUrl: this.myPageUrl })) : (h("pn-marketweb-siteheader-login-button", { label: this.logInLabel }))));
|
|
8
|
+
}
|
|
9
|
+
static get is() { return "pn-marketweb-siteheader-unified-login"; }
|
|
10
|
+
static get originalStyleUrls() { return {
|
|
11
|
+
"$": ["pn-marketweb-siteheader-unified-login.scss"]
|
|
12
|
+
}; }
|
|
13
|
+
static get styleUrls() { return {
|
|
14
|
+
"$": ["pn-marketweb-siteheader-unified-login.css"]
|
|
15
|
+
}; }
|
|
16
|
+
static get properties() { return {
|
|
17
|
+
"loggedIn": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"mutable": false,
|
|
20
|
+
"complexType": {
|
|
21
|
+
"original": "boolean",
|
|
22
|
+
"resolved": "boolean",
|
|
23
|
+
"references": {}
|
|
24
|
+
},
|
|
25
|
+
"required": false,
|
|
26
|
+
"optional": false,
|
|
27
|
+
"docs": {
|
|
28
|
+
"tags": [],
|
|
29
|
+
"text": ""
|
|
30
|
+
},
|
|
31
|
+
"attribute": "logged-in",
|
|
32
|
+
"reflect": false,
|
|
33
|
+
"defaultValue": "false"
|
|
34
|
+
},
|
|
35
|
+
"myPageLabel": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"mutable": false,
|
|
38
|
+
"complexType": {
|
|
39
|
+
"original": "string",
|
|
40
|
+
"resolved": "string",
|
|
41
|
+
"references": {}
|
|
42
|
+
},
|
|
43
|
+
"required": false,
|
|
44
|
+
"optional": false,
|
|
45
|
+
"docs": {
|
|
46
|
+
"tags": [],
|
|
47
|
+
"text": ""
|
|
48
|
+
},
|
|
49
|
+
"attribute": "my-page-label",
|
|
50
|
+
"reflect": false
|
|
51
|
+
},
|
|
52
|
+
"myPageUrl": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"mutable": false,
|
|
55
|
+
"complexType": {
|
|
56
|
+
"original": "string",
|
|
57
|
+
"resolved": "string",
|
|
58
|
+
"references": {}
|
|
59
|
+
},
|
|
60
|
+
"required": false,
|
|
61
|
+
"optional": false,
|
|
62
|
+
"docs": {
|
|
63
|
+
"tags": [],
|
|
64
|
+
"text": ""
|
|
65
|
+
},
|
|
66
|
+
"attribute": "my-page-url",
|
|
67
|
+
"reflect": false
|
|
68
|
+
},
|
|
69
|
+
"logInLabel": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"mutable": false,
|
|
72
|
+
"complexType": {
|
|
73
|
+
"original": "string",
|
|
74
|
+
"resolved": "string",
|
|
75
|
+
"references": {}
|
|
76
|
+
},
|
|
77
|
+
"required": false,
|
|
78
|
+
"optional": false,
|
|
79
|
+
"docs": {
|
|
80
|
+
"tags": [],
|
|
81
|
+
"text": ""
|
|
82
|
+
},
|
|
83
|
+
"attribute": "log-in-label",
|
|
84
|
+
"reflect": false
|
|
85
|
+
}
|
|
86
|
+
}; }
|
|
87
|
+
static get elementRef() { return "hostElement"; }
|
|
88
|
+
}
|
package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.css
CHANGED
|
@@ -98,7 +98,7 @@ pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dro
|
|
|
98
98
|
width: 100%;
|
|
99
99
|
}
|
|
100
100
|
pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content pn-marketweb-siteheader-login-links::before,
|
|
101
|
-
pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content
|
|
101
|
+
pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content span::before {
|
|
102
102
|
display: block;
|
|
103
103
|
content: "";
|
|
104
104
|
height: 2px;
|
|
@@ -106,10 +106,17 @@ pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dro
|
|
|
106
106
|
width: 100%;
|
|
107
107
|
margin-bottom: 2.4rem;
|
|
108
108
|
}
|
|
109
|
-
pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content
|
|
109
|
+
pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content span {
|
|
110
110
|
font-size: 1.4rem;
|
|
111
111
|
color: #005D92;
|
|
112
112
|
}
|
|
113
|
+
pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content span a {
|
|
114
|
+
text-decoration: none;
|
|
115
|
+
color: #005D92;
|
|
116
|
+
}
|
|
117
|
+
pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content span a:hover {
|
|
118
|
+
text-decoration: underline;
|
|
119
|
+
}
|
|
113
120
|
pn-marketweb-siteheader pn-nav-dropdown:not(.hydrated) .nav-dropdown-content-container {
|
|
114
121
|
display: none;
|
|
115
122
|
}
|
package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.js
CHANGED
|
@@ -36,6 +36,8 @@ export class PnMarketwebSiteheader {
|
|
|
36
36
|
this.hideLogin = false;
|
|
37
37
|
/** If this is selected we will show the new profile selection dropdown instead of the login version */
|
|
38
38
|
this.showProfileSelection = false;
|
|
39
|
+
/** if this is selected we will show the unified-login button aswell as a new look for dropdown menu */
|
|
40
|
+
this.showUnifiedLogin = false;
|
|
39
41
|
/** Adjusts the menus URLs */
|
|
40
42
|
this.siteDomainInUrls = false;
|
|
41
43
|
/** Autocomplete endpoint */
|
|
@@ -59,6 +61,8 @@ export class PnMarketwebSiteheader {
|
|
|
59
61
|
mainMenuButton: '',
|
|
60
62
|
menuStartButton: '',
|
|
61
63
|
profileSelectionFlyoutHeading: '',
|
|
64
|
+
unifiedLoginButton: '',
|
|
65
|
+
unifiedMyPagesButton: '',
|
|
62
66
|
};
|
|
63
67
|
this.gotData = false;
|
|
64
68
|
this.fetchingData = false;
|
|
@@ -345,7 +349,7 @@ export class PnMarketwebSiteheader {
|
|
|
345
349
|
h("path", { d: "M108.84,13.35c0,6.34-5.17,9-10,9S89,19.76,89,13.63c0-6.28,5.08-9,10-9S108.84,7.25,108.84,13.35Zm-6.56.18a3.4,3.4,0,1,0-6.8,0,3.29,3.29,0,0,0,3.42,3.41A3.24,3.24,0,0,0,102.28,13.54Zm-83,0c0,4.83-3.32,8.82-8.49,8.82a6.54,6.54,0,0,1-4.65-1.57v5.86H0V5.16H6.17V6.8a6.43,6.43,0,0,1,5.11-2.18C16.41,4.62,19.31,8.58,19.31,13.54Zm-6.53,0A3.27,3.27,0,0,0,9.4,10,3.28,3.28,0,0,0,6,13.54,3.29,3.29,0,0,0,9.4,16.95,3.24,3.24,0,0,0,12.78,13.54Zm103.69,0.27c0-2.54,1.54-3.32,3.6-3.32a6.56,6.56,0,0,1,2.08.3L122.3,5.1a3.92,3.92,0,0,0-1.45-.18c-3.45,0-4.38,2.18-4.38,2.18V5.16H110.3V21.84h6.17v-8ZM141.73,0V21.84h-6.16V20.21a6.43,6.43,0,0,1-5.11,2.18c-5.14,0-8-4-8-8.91s3.32-8.82,8.49-8.82a6.54,6.54,0,0,1,4.65,1.57v-5Zm-6,13.48a3.28,3.28,0,0,0-3.41-3.41A3.24,3.24,0,0,0,129,13.47,3.4,3.4,0,1,0,135.75,13.47ZM81.35,4.62c-3.6,0-4.9,2.18-4.9,2.18V5.16H70.29V21.84h6.16V13.29c0-2.11.79-3.08,2.69-3.08s2.18,1.57,2.18,3.57v8.07h6.22V11.6C87.55,7,85.34,4.62,81.35,4.62ZM64.07,1.42H57.9V21.84h6.16V10.36H67l2.81-5.2H64.07V1.42ZM50.26,11.21c-2-.3-2.87-0.3-2.87-1.09s0.81-.94,2.42-0.94a16.15,16.15,0,0,1,5.11.91L56,5.41a24.56,24.56,0,0,0-6.13-.75c-5.89,0-9,2.27-9,5.89,0,2.81,1.66,4.47,6.53,5.11,2.06,0.27,2.81.39,2.81,1.15s-0.82,1-2.24,1a16.67,16.67,0,0,1-6-1.3L40.77,21.3a22.14,22.14,0,0,0,6.68,1c6.35,0,9.28-2.24,9.28-5.89C56.72,13.54,55.15,12,50.26,11.21ZM40.19,13.35c0,6.34-5.17,9-10,9s-9.82-2.6-9.82-8.73c0-6.28,5.08-9,10-9S40.19,7.25,40.19,13.35Zm-6.56.18a3.4,3.4,0,1,0-6.8,0,3.28,3.28,0,0,0,3.41,3.41A3.24,3.24,0,0,0,33.63,13.54Z", fill: "#00A0D6", transform: "translate(0 0)" }))))),
|
|
346
350
|
h("div", { class: "siteheader-topright" },
|
|
347
351
|
h("slot", { name: "toprightstart" }),
|
|
348
|
-
this.gotData && this.loginDialog && !this.hideLogin && (h("pn-marketweb-siteheader-login", { token: this.userToken, siteUrl: this.siteDefinition.url, fullname: this.userFullname, loggedin: this.userLoggedin, loginDialog: this.loginDialog, endpoint: this.endpoint, i18n: this.i18n, showProfileSelection: this.showProfileSelection, "check-user-logged-in-state-interval": this.checkUserLoggedInStateInterval })),
|
|
352
|
+
this.gotData && this.loginDialog && !this.hideLogin && (h("pn-marketweb-siteheader-login", { token: this.userToken, siteUrl: this.siteDefinition.url, fullname: this.userFullname, loggedin: this.userLoggedin, loginDialog: this.loginDialog, endpoint: this.endpoint, i18n: this.i18n, showProfileSelection: this.showProfileSelection, showUnifiedLogin: this.showUnifiedLogin, "check-user-logged-in-state-interval": this.checkUserLoggedInStateInterval })),
|
|
349
353
|
this.gotData && this.languageOptions && this.languageOptions.length && !this.hideLanguageSelector && (h("pn-language-selector", { value: this.language }, this.languageOptions.map(language => (h("pn-language-selector-option", { name: language.nativeName, code: language.twoLetterISOLanguageName, selected: language.isCurrent, url: this.getLanguageVersionUrl(language) }))))),
|
|
350
354
|
h("slot", { name: "toprightend" }),
|
|
351
355
|
h("div", { class: "siteheader-menu-top-search" },
|
|
@@ -367,7 +371,7 @@ export class PnMarketwebSiteheader {
|
|
|
367
371
|
})),
|
|
368
372
|
h("div", { slot: "footer", class: "siteheader-menu-footer" },
|
|
369
373
|
h("slot", { name: "menu-footer-cta" }),
|
|
370
|
-
this.gotData && this.loginDialog && !this.hideLogin && (h("pn-marketweb-siteheader-login", { emitEvents: false, siteUrl: this.siteDefinition.url, loginDialog: this.loginDialog, endpoint: this.endpoint, fullname: this.userFullname, loggedin: this.userLoggedin, i18n: this.i18n, showProfileSelection: this.showProfileSelection, environment: this.environment })),
|
|
374
|
+
this.gotData && this.loginDialog && !this.hideLogin && (h("pn-marketweb-siteheader-login", { emitEvents: false, siteUrl: this.siteDefinition.url, loginDialog: this.loginDialog, endpoint: this.endpoint, fullname: this.userFullname, loggedin: this.userLoggedin, i18n: this.i18n, showProfileSelection: this.showProfileSelection, showUnifiedLogin: this.showUnifiedLogin, environment: this.environment })),
|
|
371
375
|
this.gotData && this.languageOptions && this.languageOptions.length && !this.hideLanguageSelector && (h("pn-language-selector", { value: this.language }, this.languageOptions.map(language => (h("pn-language-selector-option", { name: language.nativeName, code: language.twoLetterISOLanguageName, selected: language.isCurrent, url: this.getLanguageVersionUrl(language) }))))),
|
|
372
376
|
!this.hideSiteSelector && (h("pn-site-selector", { language: this.language },
|
|
373
377
|
this.gotData && ((_e = this.siteSelector) === null || _e === void 0 ? void 0 : _e.currentSiteTitle) && (h("pn-site-selector-item", { heading: this.siteSelector.currentSiteTitle, description: this.siteSelector.currentSiteDescription })),
|
|
@@ -639,6 +643,24 @@ export class PnMarketwebSiteheader {
|
|
|
639
643
|
"reflect": true,
|
|
640
644
|
"defaultValue": "false"
|
|
641
645
|
},
|
|
646
|
+
"showUnifiedLogin": {
|
|
647
|
+
"type": "boolean",
|
|
648
|
+
"mutable": false,
|
|
649
|
+
"complexType": {
|
|
650
|
+
"original": "boolean",
|
|
651
|
+
"resolved": "boolean",
|
|
652
|
+
"references": {}
|
|
653
|
+
},
|
|
654
|
+
"required": false,
|
|
655
|
+
"optional": false,
|
|
656
|
+
"docs": {
|
|
657
|
+
"tags": [],
|
|
658
|
+
"text": "if this is selected we will show the unified-login button aswell as a new look for dropdown menu"
|
|
659
|
+
},
|
|
660
|
+
"attribute": "show-unified-login",
|
|
661
|
+
"reflect": false,
|
|
662
|
+
"defaultValue": "false"
|
|
663
|
+
},
|
|
642
664
|
"siteDomainInUrls": {
|
|
643
665
|
"type": "boolean",
|
|
644
666
|
"mutable": false,
|
|
@@ -1,62 +1,74 @@
|
|
|
1
1
|
export const translations = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
sv: {
|
|
3
|
+
searchlabel: 'Sök',
|
|
4
|
+
searchplaceholder: 'Vad letar du efter?',
|
|
5
|
+
searchbuttontext: 'Sök',
|
|
6
|
+
menuHomeButton: 'Hem',
|
|
7
|
+
menuGoBackButton: 'Gå tillbaka',
|
|
8
|
+
mainMenuButton: 'Meny',
|
|
9
|
+
menuStartButton: 'Start',
|
|
10
|
+
profileSelectionFlyoutHeading: 'Inloggad som',
|
|
11
|
+
unifiedLoginButton: 'Logga in',
|
|
12
|
+
unifiedMyPagesButton: 'Mina sidor',
|
|
11
13
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
en: {
|
|
15
|
+
searchlabel: 'Search',
|
|
16
|
+
searchplaceholder: 'Search',
|
|
17
|
+
searchbuttontext: 'Search',
|
|
18
|
+
menuHomeButton: 'Home',
|
|
19
|
+
menuGoBackButton: 'Go back',
|
|
20
|
+
mainMenuButton: 'Menu',
|
|
21
|
+
menuStartButton: 'Start',
|
|
22
|
+
profileSelectionFlyoutHeading: 'Logged in as',
|
|
23
|
+
unifiedLoginButton: 'Log in',
|
|
24
|
+
unifiedMyPagesButton: 'My pages',
|
|
21
25
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
da: {
|
|
27
|
+
searchlabel: 'Søg',
|
|
28
|
+
searchplaceholder: 'Søg',
|
|
29
|
+
searchbuttontext: 'Søg',
|
|
30
|
+
menuHomeButton: 'Hjem',
|
|
31
|
+
menuGoBackButton: 'Gå tilbage',
|
|
32
|
+
mainMenuButton: 'Menu',
|
|
33
|
+
menuStartButton: 'Start',
|
|
34
|
+
profileSelectionFlyoutHeading: 'Logget ind som',
|
|
35
|
+
unifiedLoginButton: 'Log ind',
|
|
36
|
+
unifiedMyPagesButton: 'Mine sider',
|
|
31
37
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
no: {
|
|
39
|
+
searchlabel: 'Søk',
|
|
40
|
+
searchplaceholder: 'Søk',
|
|
41
|
+
searchbuttontext: 'Søk',
|
|
42
|
+
menuHomeButton: 'Hjem',
|
|
43
|
+
menuGoBackButton: 'Gå tilbake',
|
|
44
|
+
mainMenuButton: 'Meny',
|
|
45
|
+
menuStartButton: 'Start',
|
|
46
|
+
profileSelectionFlyoutHeading: 'Logget på som',
|
|
47
|
+
unifiedLoginButton: 'Logg inn',
|
|
48
|
+
unifiedMyPagesButton: 'Sidene mine',
|
|
41
49
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
fi: {
|
|
51
|
+
searchlabel: 'Hae',
|
|
52
|
+
searchplaceholder: 'Hae',
|
|
53
|
+
searchbuttontext: 'Hae',
|
|
54
|
+
menuHomeButton: 'Koti',
|
|
55
|
+
menuGoBackButton: 'Mene takaisin',
|
|
56
|
+
mainMenuButton: 'Valikko',
|
|
57
|
+
menuStartButton: 'Alkaa',
|
|
58
|
+
profileSelectionFlyoutHeading: 'Kirjautunut sisään nimellä',
|
|
59
|
+
unifiedLoginButton: 'Kirjaudu sisään',
|
|
60
|
+
unifiedMyPagesButton: 'Minun sivujani',
|
|
61
|
+
},
|
|
62
|
+
de: {
|
|
63
|
+
searchlabel: 'Suche',
|
|
64
|
+
searchplaceholder: 'Wonach suchen Sie?',
|
|
65
|
+
searchbuttontext: 'Suche',
|
|
66
|
+
menuHomeButton: 'Start',
|
|
67
|
+
menuGoBackButton: 'Geh zurück',
|
|
68
|
+
mainMenuButton: 'Menü',
|
|
69
|
+
menuStartButton: 'Start',
|
|
70
|
+
profileSelectionFlyoutHeading: 'Eingeloggt als',
|
|
71
|
+
unifiedLoginButton: 'Anmeldung',
|
|
72
|
+
unifiedMyPagesButton: 'Meine Seiten',
|
|
51
73
|
},
|
|
52
|
-
'de': {
|
|
53
|
-
"searchlabel": "Suche",
|
|
54
|
-
"searchplaceholder": "Wonach suchen Sie?",
|
|
55
|
-
"searchbuttontext": "Suche",
|
|
56
|
-
"menuHomeButton": "Start",
|
|
57
|
-
"menuGoBackButton": "Geh zurück",
|
|
58
|
-
"mainMenuButton": "Menü",
|
|
59
|
-
"menuStartButton": "Start",
|
|
60
|
-
"profileSelectionFlyoutHeading": "Eingeloggt als",
|
|
61
|
-
}
|
|
62
74
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const getLoginUrl = currentDomain => {
|
|
2
|
+
/* Step 1
|
|
3
|
+
If a user is on on a domain with these patterns / direct urls
|
|
4
|
+
|
|
5
|
+
[market]-[environments].postnord.com
|
|
6
|
+
market = ['se','dk', 'no', 'fi','com','de','tpl'];
|
|
7
|
+
environments = ['integration', 'preproduction', 'production'];
|
|
8
|
+
Or matches
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
wwwurls = ['www.postnord.se','www.postnord.dk', 'www.postnord.no', 'www.postnord.fi', 'www.postnord.com', 'www.postnord.de', 'www.tpl.postnord.com']
|
|
12
|
+
|
|
13
|
+
Step 2.
|
|
14
|
+
If the above is not matches,
|
|
15
|
+
check if the domain is a portal AT domain
|
|
16
|
+
|
|
17
|
+
portalAtDomains = ['devportal.postnord.com', 'atportal.postnord.com']
|
|
18
|
+
Then use the atportal endpoints to log in (this should have nothing to do with the market domains
|
|
19
|
+
Step 3.
|
|
20
|
+
If non of the above matches, then use the production portal endpoint to log in
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
*/
|
|
24
|
+
let loginUrl = null;
|
|
25
|
+
// const market = ['se', 'dk', 'no', 'fi', 'com', 'de', 'tpl'];
|
|
26
|
+
// const environments = ['integration', 'preproduction', 'production'];
|
|
27
|
+
// const wwwurls = ['www.postnord.se', 'www.postnord.dk', 'www.postnord.no', 'www.postnord.fi', 'www.postnord.com', 'www.postnord.de', 'www.tpl.postnord.com'];
|
|
28
|
+
const portalAtDomains = ['devportal.postnord.com', 'atportal.postnord.com'];
|
|
29
|
+
const marketRegex = '(?:se|dk|no|fi|com|de|tpl)-(?:integration|preproduction|production).(?:postnord.com)';
|
|
30
|
+
const wwwRegex = '(?:www(?:.tpl)?.postnord.(?:se|dk|no|fi|com|de))';
|
|
31
|
+
/* if (
|
|
32
|
+
(market.some(market => currentDomain.includes(market)) && environments.some(environment => currentDomain.includes(environment))) ||
|
|
33
|
+
wwwurls.some(domain => currentDomain.includes(domain))
|
|
34
|
+
) */
|
|
35
|
+
if (currentDomain.match(marketRegex) || currentDomain.match(wwwRegex)) {
|
|
36
|
+
loginUrl = `${currentDomain}/login?returnUrl=`;
|
|
37
|
+
}
|
|
38
|
+
else if (portalAtDomains.some(atdomain => currentDomain.includes(atdomain))) {
|
|
39
|
+
loginUrl = 'https://atportal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
//production portal endpoint
|
|
43
|
+
loginUrl = 'https://portal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';
|
|
44
|
+
}
|
|
45
|
+
return loginUrl;
|
|
46
|
+
};
|
|
@@ -47,7 +47,6 @@ export class PnProxioFindPrice {
|
|
|
47
47
|
try {
|
|
48
48
|
//for keeping small value preselected
|
|
49
49
|
this.sizecategory = sizeCategories.filter(x => x.value === "S")[0];
|
|
50
|
-
console.log(this.sizecategory);
|
|
51
50
|
this.filterItems();
|
|
52
51
|
}
|
|
53
52
|
catch (e) {
|
|
@@ -73,7 +72,6 @@ export class PnProxioFindPrice {
|
|
|
73
72
|
this.data = data;
|
|
74
73
|
}
|
|
75
74
|
setState() {
|
|
76
|
-
this.market = "dk";
|
|
77
75
|
if (this.market) {
|
|
78
76
|
state.market = markets[this.market];
|
|
79
77
|
}
|
|
@@ -86,13 +84,11 @@ export class PnProxioFindPrice {
|
|
|
86
84
|
console.log('Data has not yet been loaded');
|
|
87
85
|
return;
|
|
88
86
|
}
|
|
89
|
-
console.log("data ", this.data);
|
|
90
87
|
const sizeItemData = this.data.proxioProducts.filter(item => {
|
|
91
88
|
return item.proxioProduct.productWeightGroupList.some(weightGroup => {
|
|
92
89
|
return weightGroup.item3.includes(this.sizecategory.value);
|
|
93
90
|
});
|
|
94
91
|
});
|
|
95
|
-
console.log("sizeItemData ", sizeItemData);
|
|
96
92
|
if (!this.weight) {
|
|
97
93
|
return;
|
|
98
94
|
}
|
|
@@ -102,7 +98,6 @@ export class PnProxioFindPrice {
|
|
|
102
98
|
return weightGroup.item1 === comparisonWeight;
|
|
103
99
|
});
|
|
104
100
|
});
|
|
105
|
-
console.log("weightFilteredData ", weightFilteredData);
|
|
106
101
|
if (weightFilteredData.length === 0 && this.weightvalue !== 0) {
|
|
107
102
|
weightFilteredData = sizeItemData.filter(item => {
|
|
108
103
|
return item.proxioProduct.productWeightGroupList.some(weightGroup => {
|
|
@@ -188,6 +188,12 @@ export const PnMarketwebSiteheaderSearch: {
|
|
|
188
188
|
new (): PnMarketwebSiteheaderSearch;
|
|
189
189
|
};
|
|
190
190
|
|
|
191
|
+
interface PnMarketwebSiteheaderUnifiedLogin extends Components.PnMarketwebSiteheaderUnifiedLogin, HTMLElement {}
|
|
192
|
+
export const PnMarketwebSiteheaderUnifiedLogin: {
|
|
193
|
+
prototype: PnMarketwebSiteheaderUnifiedLogin;
|
|
194
|
+
new (): PnMarketwebSiteheaderUnifiedLogin;
|
|
195
|
+
};
|
|
196
|
+
|
|
191
197
|
interface PnParcelTracker extends Components.PnParcelTracker, HTMLElement {}
|
|
192
198
|
export const PnParcelTracker: {
|
|
193
199
|
prototype: PnParcelTracker;
|