@genesislcap/foundation-login 13.6.0 → 13.8.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/dist/dts/main/config.d.ts +12 -2
- package/dist/dts/main/config.d.ts.map +1 -1
- package/dist/dts/routes/base.d.ts.map +1 -1
- package/dist/esm/main/config.js +2 -0
- package/dist/esm/routes/base.js +12 -31
- package/dist/foundation-login.api.json +1 -1
- package/dist/foundation-login.d.ts +12 -2
- package/package.json +7 -7
|
@@ -66,10 +66,20 @@ export type FieldConfig = {
|
|
|
66
66
|
*/
|
|
67
67
|
value?: any;
|
|
68
68
|
/**
|
|
69
|
-
* @
|
|
70
|
-
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* We expect fields to be required by default, but you can override to make them optional. Organisation for example.
|
|
71
71
|
*/
|
|
72
72
|
required?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* @remarks
|
|
75
|
+
* A regular expression the control's value should match. Please note the email field has its own built in pattern.
|
|
76
|
+
*/
|
|
77
|
+
pattern?: string;
|
|
78
|
+
/**
|
|
79
|
+
* @remarks
|
|
80
|
+
* Used in conjunction with the pattern to explain the conditions.
|
|
81
|
+
*/
|
|
82
|
+
title?: string;
|
|
73
83
|
};
|
|
74
84
|
/**
|
|
75
85
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/main/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAO,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAoB,MAAM,4BAA4B,CAAC;AAIzE;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAuB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,WAAW,QAAe,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,eAAe,QAAmB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,cAAc,QAAW,CAAC;AAEvC;;GAEG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;;;OAKG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;;;;OAOG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B;;;;;OAKG;IACH,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC;IACtB;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAmChC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,mEAAoC,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,QAO3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/routes/base.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,OAAO,EAEP,iBAAiB,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/routes/base.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,OAAO,EAEP,iBAAiB,EAEjB,OAAO,EACP,cAAc,EACd,OAAO,EACR,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAEL,OAAO,EAGP,WAAW,EAIZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGvD,OAAO,EAAsB,cAAc,EAAW,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGlG;;GAEG;AACH,eAAO,MAAM,eAAe,OAAQ,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,WAAY,YAAW,UAAU;IAC3D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AM,aACZ,OAAO,2DA0BlB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,mFAqB7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,mFAgBzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,mFAiBtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,gCAAiC,MAAM,2DAYhE,CAAC;AAOF;;GAEG;AACH,eAAO,MAAM,cAAc,8BAA+B,KAAK,GAAG,cAAc,2DAe/E,CAAC;AAEF;;;;GAIG;AACH,qBA2Ba,iBAAkB,SAAQ,iBAAiB;IACtD,iBAAiB;CAIlB;AAED;;GAEG;AACH,qBAoBa,WAAY,SAAQ,iBAAiB;CAAG;AAErD;;GAEG;AACH,eAAO,MAAM,UAAU,kCAAmC,OAAO,2DAUhE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,gCAChB,MAAM,eACD,MAAM,aACR,OAAO,2DAWlB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,mFAQjC,CAAC;AAEF;;;;GAIG;AACH,qBA0Ba,cAAe,SAAQ,WAAW;IACjC,UAAU,EAAE,MAAM,CAAM;IAC9B,OAAO,EAAE,MAAM,CAAM;IACwB,QAAQ,EAAE,OAAO,CAAS;IAC7E,eAAe;CAGhB;AAED;;GAEG;AACH,qBAuBa,mBAAoB,SAAQ,WAAW;IACK,YAAY,EAAE,OAAO,CAAS;CACtF"}
|
package/dist/esm/main/config.js
CHANGED
package/dist/esm/routes/base.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter, __decorate } from "tslib";
|
|
2
|
-
import { Auth, Connect, CredentialManager, MessageBuilder, Session, } from '@genesislcap/foundation-comms';
|
|
2
|
+
import { Auth, Connect, CredentialManager, credentialSeparator, MessageBuilder, Session, } from '@genesislcap/foundation-comms';
|
|
3
3
|
import { sync } from '@genesislcap/foundation-utils';
|
|
4
4
|
import { SecondaryRapidColorHEX } from '@genesislcap/foundation-zero';
|
|
5
5
|
import { attr, css, customElement, FASTElement, html, observable, when, } from '@microsoft/fast-element';
|
|
@@ -102,7 +102,7 @@ export class BaseRoute extends ConfigHostElement {
|
|
|
102
102
|
}, delay);
|
|
103
103
|
}
|
|
104
104
|
autofill() {
|
|
105
|
-
var _a, _b, _c
|
|
105
|
+
var _a, _b, _c;
|
|
106
106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
107
|
let credentialData;
|
|
108
108
|
try {
|
|
@@ -113,41 +113,20 @@ export class BaseRoute extends ConfigHostElement {
|
|
|
113
113
|
*/
|
|
114
114
|
const containerData = yield this.credentialManager.getCredentialsFromContainer();
|
|
115
115
|
const cookieData = yield this.credentialManager.getCredentialsFromCookie();
|
|
116
|
-
|
|
116
|
+
const [normalisedData, canRemoveCookie] = this.credentialManager.normaliseLegacyCredentialData(containerData, cookieData);
|
|
117
|
+
if (cookieData && canRemoveCookie) {
|
|
117
118
|
/**
|
|
118
|
-
* Upgrade path: They have chosen a profile from the container, yet also have a cookie...
|
|
119
|
+
* Upgrade path: They have chosen a profile from the container, yet also have a cookie... it's safe to remove the cookie.
|
|
119
120
|
*/
|
|
120
121
|
this.credentialManager.removeCookie();
|
|
121
122
|
}
|
|
122
|
-
|
|
123
|
-
* They have chosen a profile from the container
|
|
124
|
-
*/
|
|
125
|
-
if (containerData) {
|
|
126
|
-
credentialData = containerData;
|
|
127
|
-
}
|
|
128
|
-
else if (cookieData) {
|
|
129
|
-
/**
|
|
130
|
-
* They have NOT chosen a profile from the container (or it wasn't supported) yet have a cookie available.
|
|
131
|
-
*
|
|
132
|
-
* Possible legacy cookie during upgrade, so we will need to reformat to CredentialData shape.
|
|
133
|
-
*/
|
|
134
|
-
const legacyCookie = cookieData;
|
|
135
|
-
const name = (_a = cookieData.name) !== null && _a !== void 0 ? _a : legacyCookie.username;
|
|
136
|
-
const password = cookieData.password;
|
|
137
|
-
const organisation = legacyCookie.organisation;
|
|
138
|
-
const id = ((_b = cookieData.id) !== null && _b !== void 0 ? _b : organisation) ? `${name}:${organisation}` : name;
|
|
139
|
-
credentialData = {
|
|
140
|
-
name,
|
|
141
|
-
password,
|
|
142
|
-
id,
|
|
143
|
-
};
|
|
144
|
-
}
|
|
123
|
+
credentialData = normalisedData;
|
|
145
124
|
if (credentialData) {
|
|
146
|
-
this.username = (
|
|
147
|
-
this.password = (
|
|
125
|
+
this.username = (_a = credentialData.name) !== null && _a !== void 0 ? _a : '';
|
|
126
|
+
this.password = (_b = credentialData.password) !== null && _b !== void 0 ? _b : '';
|
|
148
127
|
if (this.config.fields.organisation) {
|
|
149
|
-
const combinedCompIdUsername = (
|
|
150
|
-
const valueParts = combinedCompIdUsername.split(
|
|
128
|
+
const combinedCompIdUsername = (_c = credentialData.id) !== null && _c !== void 0 ? _c : '';
|
|
129
|
+
const valueParts = combinedCompIdUsername.split(credentialSeparator);
|
|
151
130
|
const orgIdx = valueParts.length === 2 ? 1 : 0;
|
|
152
131
|
const proposedOrganisation = valueParts[orgIdx];
|
|
153
132
|
if (proposedOrganisation !== this.username) {
|
|
@@ -293,6 +272,8 @@ export const usernameField = () => html `
|
|
|
293
272
|
:value="${sync((x) => x.username)}"
|
|
294
273
|
?autofocus="${(x) => !x.config.fields.organisation}"
|
|
295
274
|
class="${(x) => (!x.config.logo && !x.config.fields.organisation ? 'no-top-margin' : '')}"
|
|
275
|
+
pattern="${(x) => x.config.fields.username.pattern}"
|
|
276
|
+
title="${(x) => x.config.fields.username.title}"
|
|
296
277
|
required
|
|
297
278
|
>
|
|
298
279
|
<span class="form-title">${(x) => { var _a; return (_a = x.config.fields.username.label) !== null && _a !== void 0 ? _a : 'Username'; }}</span>
|
|
@@ -487,7 +487,7 @@
|
|
|
487
487
|
},
|
|
488
488
|
{
|
|
489
489
|
"kind": "Content",
|
|
490
|
-
"text": "{\n label: string;\n value?: any;\n required?: boolean;\n}"
|
|
490
|
+
"text": "{\n label: string;\n value?: any;\n required?: boolean;\n pattern?: string;\n title?: string;\n}"
|
|
491
491
|
},
|
|
492
492
|
{
|
|
493
493
|
"kind": "Content",
|
|
@@ -239,10 +239,20 @@ export declare type FieldConfig = {
|
|
|
239
239
|
*/
|
|
240
240
|
value?: any;
|
|
241
241
|
/**
|
|
242
|
-
* @
|
|
243
|
-
*
|
|
242
|
+
* @remarks
|
|
243
|
+
* We expect fields to be required by default, but you can override to make them optional. Organisation for example.
|
|
244
244
|
*/
|
|
245
245
|
required?: boolean;
|
|
246
|
+
/**
|
|
247
|
+
* @remarks
|
|
248
|
+
* A regular expression the control's value should match. Please note the email field has its own built in pattern.
|
|
249
|
+
*/
|
|
250
|
+
pattern?: string;
|
|
251
|
+
/**
|
|
252
|
+
* @remarks
|
|
253
|
+
* Used in conjunction with the pattern to explain the conditions.
|
|
254
|
+
*/
|
|
255
|
+
title?: string;
|
|
246
256
|
};
|
|
247
257
|
|
|
248
258
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-login",
|
|
3
3
|
"description": "Genesis Foundation Login",
|
|
4
|
-
"version": "13.
|
|
4
|
+
"version": "13.8.0",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/foundation-login.d.ts",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"test:unit:watch": "watchlist src test -- npm run test:unit"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@genesislcap/foundation-testing": "^13.
|
|
55
|
+
"@genesislcap/foundation-testing": "^13.8.0",
|
|
56
56
|
"@microsoft/api-documenter": "^7.19.13",
|
|
57
57
|
"@microsoft/api-extractor": "^7.31.1",
|
|
58
58
|
"@module-federation/dashboard-plugin": "2.3.0",
|
|
@@ -95,10 +95,10 @@
|
|
|
95
95
|
"webpack-merge": "^5.7.3"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@genesislcap/foundation-comms": "^13.
|
|
99
|
-
"@genesislcap/foundation-ui": "^13.
|
|
100
|
-
"@genesislcap/foundation-utils": "^13.
|
|
101
|
-
"@genesislcap/foundation-zero": "^13.
|
|
98
|
+
"@genesislcap/foundation-comms": "^13.8.0",
|
|
99
|
+
"@genesislcap/foundation-ui": "^13.8.0",
|
|
100
|
+
"@genesislcap/foundation-utils": "^13.8.0",
|
|
101
|
+
"@genesislcap/foundation-zero": "^13.8.0",
|
|
102
102
|
"@microsoft/fast-components": "^2.21.3",
|
|
103
103
|
"@microsoft/fast-element": "^1.7.0",
|
|
104
104
|
"@microsoft/fast-foundation": "^2.33.2",
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"publishConfig": {
|
|
112
112
|
"access": "public"
|
|
113
113
|
},
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "f4a6a702c9b7f181eb9eaecc9a928026cfaa573d"
|
|
115
115
|
}
|