@genesislcap/foundation-login 13.8.0 → 14.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.
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { AuthInfo
|
|
1
|
+
import { AuthInfo } from '@genesislcap/foundation-comms';
|
|
2
2
|
import { BaseRoute } from '../base';
|
|
3
3
|
import { IDP } from '../types';
|
|
4
4
|
export declare class LoginForm extends BaseRoute {
|
|
5
5
|
idps: IDP[];
|
|
6
6
|
selectedIDP: string;
|
|
7
7
|
ssoToggled: boolean;
|
|
8
|
-
showConnectionIndicator: boolean;
|
|
9
|
-
connectActionText: string;
|
|
10
|
-
status: ConnectionStatus;
|
|
11
|
-
submitDisabled: boolean;
|
|
12
|
-
private sub;
|
|
13
8
|
connectedCallback(): Promise<void>;
|
|
14
|
-
disconnectedCallback(): Promise<void>;
|
|
15
9
|
enter(): Promise<void>;
|
|
16
10
|
toggleConnection(): Promise<boolean | undefined>;
|
|
17
11
|
private attemptLoginWhenConnected;
|
|
@@ -26,6 +20,8 @@ export declare class LoginForm extends BaseRoute {
|
|
|
26
20
|
onHostSubmit(): Promise<void>;
|
|
27
21
|
onLoginSubmit(): Promise<void>;
|
|
28
22
|
login(credentials: AuthInfo): Promise<void>;
|
|
23
|
+
get connectActionText(): "Disconnect" | "Connect";
|
|
29
24
|
get submitConnectDisabled(): boolean;
|
|
25
|
+
get submitDisabled(): boolean;
|
|
30
26
|
}
|
|
31
27
|
//# sourceMappingURL=login-form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-form.d.ts","sourceRoot":"","sources":["../../../../src/routes/login-form/login-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"login-form.d.ts","sourceRoot":"","sources":["../../../../src/routes/login-form/login-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAKpE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,GAAG,EAAe,MAAM,UAAU,CAAC;AAI5C,qBAKa,SAAU,SAAQ,SAAS;IAC1B,IAAI,EAAE,GAAG,EAAE,CAAM;IACjB,WAAW,EAAE,MAAM,CAAM;IACzB,UAAU,EAAE,OAAO,CAAS;IAElC,iBAAiB;IAajB,KAAK;IAeL,gBAAgB,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAStD,OAAO,CAAC,yBAAyB;IA8BjC,OAAO,CAAC,iBAAiB;IAczB,iBAAiB;IAgBjB,IACI,eAAe,WAElB;IAED,OAAO,CAAC,SAAS,CASf;IAEF,cAAc,MAAO,WAAW,KAAG,IAAI,CAIrC;IAEF,UAAU;IAgBV,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,cAAc;IAQhB,YAAY;IAIZ,aAAa;IAOb,KAAK,CAAC,WAAW,EAAE,QAAQ;IAqCjC,IACI,iBAAiB,6BAEpB;IAED,IAAI,qBAAqB,YAExB;IAED,IAAI,cAAc,YAEjB;CACF"}
|
|
@@ -13,8 +13,6 @@ let LoginForm = class LoginForm extends BaseRoute {
|
|
|
13
13
|
this.idps = [];
|
|
14
14
|
this.selectedIDP = '';
|
|
15
15
|
this.ssoToggled = false;
|
|
16
|
-
this.showConnectionIndicator = false;
|
|
17
|
-
this.submitDisabled = true;
|
|
18
16
|
this.fetchIDPs = () => __awaiter(this, void 0, void 0, function* () {
|
|
19
17
|
var _a, _b;
|
|
20
18
|
const ipdsEndpoint = `${(_b = (_a = this.config.sso) === null || _a === void 0 ? void 0 : _a.identityProvidersPath) !== null && _b !== void 0 ? _b : 'sso/list'}`;
|
|
@@ -48,21 +46,6 @@ let LoginForm = class LoginForm extends BaseRoute {
|
|
|
48
46
|
}
|
|
49
47
|
this.convertHostUrl();
|
|
50
48
|
yield this.autofill();
|
|
51
|
-
this.sub = this.connect._status.subscribe((status) => {
|
|
52
|
-
this.status = status;
|
|
53
|
-
this.connectActionText = status === 'connected' ? 'Disconnect' : 'Connect';
|
|
54
|
-
this.submitDisabled = !this.connect.httpMode() && status !== 'connected';
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
disconnectedCallback() {
|
|
59
|
-
const _super = Object.create(null, {
|
|
60
|
-
disconnectedCallback: { get: () => super.disconnectedCallback }
|
|
61
|
-
});
|
|
62
|
-
var _a;
|
|
63
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
_super.disconnectedCallback.call(this);
|
|
65
|
-
(_a = this.sub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
66
49
|
});
|
|
67
50
|
}
|
|
68
51
|
enter() {
|
|
@@ -93,8 +76,8 @@ let LoginForm = class LoginForm extends BaseRoute {
|
|
|
93
76
|
});
|
|
94
77
|
}
|
|
95
78
|
attemptLoginWhenConnected() {
|
|
96
|
-
this.connect.
|
|
97
|
-
if (
|
|
79
|
+
this.connect.isConnectedSubject.subscribe((isConnected) => {
|
|
80
|
+
if (isConnected) {
|
|
98
81
|
/**
|
|
99
82
|
* Login preference flow taken from @genesislcap/foundation-login.
|
|
100
83
|
* We should sit down with Jose and team to cross check this. Reference code is bit hard to follow in places.
|
|
@@ -232,9 +215,15 @@ let LoginForm = class LoginForm extends BaseRoute {
|
|
|
232
215
|
}
|
|
233
216
|
});
|
|
234
217
|
}
|
|
218
|
+
get connectActionText() {
|
|
219
|
+
return this.connect.isConnected ? 'Disconnect' : 'Connect';
|
|
220
|
+
}
|
|
235
221
|
get submitConnectDisabled() {
|
|
236
222
|
return !this.host;
|
|
237
223
|
}
|
|
224
|
+
get submitDisabled() {
|
|
225
|
+
return !this.connect.httpMode() && (this.connect.isWorking || !this.connect.isConnected);
|
|
226
|
+
}
|
|
238
227
|
};
|
|
239
228
|
__decorate([
|
|
240
229
|
observable
|
|
@@ -245,21 +234,12 @@ __decorate([
|
|
|
245
234
|
__decorate([
|
|
246
235
|
observable
|
|
247
236
|
], LoginForm.prototype, "ssoToggled", void 0);
|
|
248
|
-
__decorate([
|
|
249
|
-
observable
|
|
250
|
-
], LoginForm.prototype, "showConnectionIndicator", void 0);
|
|
251
|
-
__decorate([
|
|
252
|
-
observable
|
|
253
|
-
], LoginForm.prototype, "connectActionText", void 0);
|
|
254
|
-
__decorate([
|
|
255
|
-
observable
|
|
256
|
-
], LoginForm.prototype, "status", void 0);
|
|
257
|
-
__decorate([
|
|
258
|
-
observable
|
|
259
|
-
], LoginForm.prototype, "submitDisabled", void 0);
|
|
260
237
|
__decorate([
|
|
261
238
|
volatile
|
|
262
239
|
], LoginForm.prototype, "selectedIDPName", null);
|
|
240
|
+
__decorate([
|
|
241
|
+
volatile
|
|
242
|
+
], LoginForm.prototype, "connectActionText", null);
|
|
263
243
|
LoginForm = __decorate([
|
|
264
244
|
customElement({
|
|
265
245
|
name: 'foundation-login-form',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sync } from '@genesislcap/foundation-utils';
|
|
2
2
|
import { html, repeat, when } from '@microsoft/fast-element';
|
|
3
|
-
import { organisationField, passwordField, showPasswordsCheckbox,
|
|
3
|
+
import { organisationField, passwordField, showPasswordsCheckbox, usernameField, submitButton, } from '../base';
|
|
4
4
|
const regularLogin = html `
|
|
5
5
|
${when((login) => !login.ssoToggled, html `
|
|
6
6
|
${organisationField()} ${usernameField()} ${passwordField()}
|
|
@@ -108,7 +108,7 @@ export const LoginFormTemplate = html `
|
|
|
108
108
|
type="text"
|
|
109
109
|
name="host"
|
|
110
110
|
:value=${sync((x) => x.host)}
|
|
111
|
-
?disabled=${(x) => x.
|
|
111
|
+
?disabled=${(x) => x.connect.isConnected}
|
|
112
112
|
data-test-id="connect-host"
|
|
113
113
|
required
|
|
114
114
|
>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-login",
|
|
3
3
|
"description": "Genesis Foundation Login",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "14.0.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": "^
|
|
55
|
+
"@genesislcap/foundation-testing": "^14.0.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,21 +95,20 @@
|
|
|
95
95
|
"webpack-merge": "^5.7.3"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@genesislcap/foundation-comms": "^
|
|
99
|
-
"@genesislcap/foundation-ui": "^
|
|
100
|
-
"@genesislcap/foundation-utils": "^
|
|
101
|
-
"@genesislcap/foundation-zero": "^
|
|
98
|
+
"@genesislcap/foundation-comms": "^14.0.0",
|
|
99
|
+
"@genesislcap/foundation-ui": "^14.0.0",
|
|
100
|
+
"@genesislcap/foundation-utils": "^14.0.0",
|
|
101
|
+
"@genesislcap/foundation-zero": "^14.0.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",
|
|
105
105
|
"@microsoft/fast-router": "^0.4.2",
|
|
106
106
|
"@microsoft/fast-web-utilities": "^5.0.2",
|
|
107
|
-
"rxjs": "^7.5.4",
|
|
108
107
|
"tslib": "^2.3.1"
|
|
109
108
|
},
|
|
110
109
|
"repository": "https://github.com/genesislcap/foundation-ui.git",
|
|
111
110
|
"publishConfig": {
|
|
112
111
|
"access": "public"
|
|
113
112
|
},
|
|
114
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "2ad7754109cc1e59fb1623f29fee3df6c14b43e2"
|
|
115
114
|
}
|