@things-factory/auth-ui 7.0.0-alpha.9 → 7.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/client/auth-style-sign.ts +45 -33
- package/client/bootstrap.ts +6 -10
- package/client/components/abstract-auth-page.ts +48 -24
- package/client/components/abstract-password-reset.ts +13 -9
- package/client/components/abstract-sign.ts +105 -0
- package/client/components/change-password.ts +4 -4
- package/client/components/contact-us.ts +20 -26
- package/client/components/create-domain-popup.ts +16 -12
- package/client/components/create-role.ts +14 -16
- package/client/components/create-user.ts +15 -14
- package/client/components/credential-manager.ts +64 -0
- package/client/components/delete-user-popup.ts +4 -3
- package/client/components/domain-switch.ts +18 -15
- package/client/components/invite-customer.ts +6 -10
- package/client/components/invite-user.ts +5 -8
- package/client/components/my-login-history.ts +2 -2
- package/client/components/ownership-transfer-popup.ts +7 -7
- package/client/components/partner-info-card.ts +6 -6
- package/client/components/partner-role-editor.ts +15 -23
- package/client/components/profile-component.ts +71 -15
- package/client/components/role-edit-form.ts +3 -3
- package/client/components/role-privilege-editor.ts +19 -29
- package/client/components/role-selector.ts +7 -7
- package/client/components/user-role-editor.ts +43 -50
- package/client/entries/auth/activate.ts +20 -21
- package/client/entries/auth/checkin.ts +29 -31
- package/client/entries/auth/forgot-password.ts +15 -9
- package/client/entries/auth/result.ts +21 -18
- package/client/entries/auth/signin.ts +4 -0
- package/client/entries/auth/signup.ts +31 -14
- package/client/entries/oauth2/oauth2-decision-error-page.ts +2 -2
- package/client/entries/oauth2/oauth2-decision-page.ts +56 -55
- package/client/entries/public/home.ts +52 -28
- package/client/index.ts +93 -66
- package/client/pages/app-binding/app-binding.ts +48 -30
- package/client/pages/app-binding/app-bindings.ts +26 -7
- package/client/pages/appliance/appliance.ts +85 -26
- package/client/pages/appliance/home.ts +28 -6
- package/client/pages/appliance/register.ts +7 -7
- package/client/pages/application/application.ts +108 -76
- package/client/pages/application/applications.ts +29 -15
- package/client/pages/application/register.ts +8 -8
- package/client/pages/attribute/attribute-set-item-list.ts +13 -19
- package/client/pages/attribute/attribute-set-management.ts +14 -20
- package/client/pages/auth-provider/auth-provider-management.ts +10 -16
- package/client/pages/domain/domain-management.ts +4 -9
- package/client/pages/partner/partner-management.ts +2 -2
- package/client/pages/profile.ts +1 -1
- package/client/pages/role/role-management.ts +14 -12
- package/client/pages/user/user-management.ts +7 -5
- package/client/themes/auth-theme.css +7 -10
- package/dist-client/auth-style-sign.js +45 -33
- package/dist-client/auth-style-sign.js.map +1 -1
- package/dist-client/bootstrap.d.ts +1 -1
- package/dist-client/bootstrap.js +5 -5
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/components/abstract-auth-page.d.ts +5 -4
- package/dist-client/components/abstract-auth-page.js +46 -24
- package/dist-client/components/abstract-auth-page.js.map +1 -1
- package/dist-client/components/abstract-password-reset.d.ts +3 -2
- package/dist-client/components/abstract-password-reset.js +12 -9
- package/dist-client/components/abstract-password-reset.js.map +1 -1
- package/dist-client/components/abstract-sign.d.ts +3 -0
- package/dist-client/components/abstract-sign.js +86 -0
- package/dist-client/components/abstract-sign.js.map +1 -1
- package/dist-client/components/change-password.js +4 -4
- package/dist-client/components/change-password.js.map +1 -1
- package/dist-client/components/contact-us.d.ts +4 -4
- package/dist-client/components/contact-us.js +19 -26
- package/dist-client/components/contact-us.js.map +1 -1
- package/dist-client/components/create-domain-popup.d.ts +1 -1
- package/dist-client/components/create-domain-popup.js +16 -12
- package/dist-client/components/create-domain-popup.js.map +1 -1
- package/dist-client/components/create-role.d.ts +1 -1
- package/dist-client/components/create-role.js +14 -16
- package/dist-client/components/create-role.js.map +1 -1
- package/dist-client/components/create-user.d.ts +2 -1
- package/dist-client/components/create-user.js +14 -14
- package/dist-client/components/create-user.js.map +1 -1
- package/dist-client/components/credential-manager.d.ts +11 -0
- package/dist-client/components/credential-manager.js +64 -0
- package/dist-client/components/credential-manager.js.map +1 -0
- package/dist-client/components/delete-user-popup.js +4 -3
- package/dist-client/components/delete-user-popup.js.map +1 -1
- package/dist-client/components/domain-switch.d.ts +2 -0
- package/dist-client/components/domain-switch.js +20 -15
- package/dist-client/components/domain-switch.js.map +1 -1
- package/dist-client/components/invite-customer.d.ts +1 -1
- package/dist-client/components/invite-customer.js +6 -9
- package/dist-client/components/invite-customer.js.map +1 -1
- package/dist-client/components/invite-user.js +5 -8
- package/dist-client/components/invite-user.js.map +1 -1
- package/dist-client/components/my-login-history.js +2 -2
- package/dist-client/components/my-login-history.js.map +1 -1
- package/dist-client/components/ownership-transfer-popup.d.ts +1 -1
- package/dist-client/components/ownership-transfer-popup.js +7 -7
- package/dist-client/components/ownership-transfer-popup.js.map +1 -1
- package/dist-client/components/partner-info-card.js +6 -6
- package/dist-client/components/partner-info-card.js.map +1 -1
- package/dist-client/components/partner-role-editor.d.ts +2 -2
- package/dist-client/components/partner-role-editor.js +15 -23
- package/dist-client/components/partner-role-editor.js.map +1 -1
- package/dist-client/components/profile-component.d.ts +7 -0
- package/dist-client/components/profile-component.js +70 -15
- package/dist-client/components/profile-component.js.map +1 -1
- package/dist-client/components/role-edit-form.js +3 -3
- package/dist-client/components/role-edit-form.js.map +1 -1
- package/dist-client/components/role-privilege-editor.js +19 -29
- package/dist-client/components/role-privilege-editor.js.map +1 -1
- package/dist-client/components/role-selector.js +7 -7
- package/dist-client/components/role-selector.js.map +1 -1
- package/dist-client/components/user-role-editor.d.ts +2 -0
- package/dist-client/components/user-role-editor.js +42 -49
- package/dist-client/components/user-role-editor.js.map +1 -1
- package/dist-client/entries/auth/activate.d.ts +5 -4
- package/dist-client/entries/auth/activate.js +19 -21
- package/dist-client/entries/auth/activate.js.map +1 -1
- package/dist-client/entries/auth/checkin.d.ts +5 -5
- package/dist-client/entries/auth/checkin.js +27 -28
- package/dist-client/entries/auth/checkin.js.map +1 -1
- package/dist-client/entries/auth/forgot-password.d.ts +2 -1
- package/dist-client/entries/auth/forgot-password.js +15 -9
- package/dist-client/entries/auth/forgot-password.js.map +1 -1
- package/dist-client/entries/auth/reset-password.js.map +1 -1
- package/dist-client/entries/auth/result.d.ts +5 -5
- package/dist-client/entries/auth/result.js +20 -18
- package/dist-client/entries/auth/result.js.map +1 -1
- package/dist-client/entries/auth/signin.d.ts +1 -0
- package/dist-client/entries/auth/signin.js +3 -0
- package/dist-client/entries/auth/signin.js.map +1 -1
- package/dist-client/entries/auth/signup.js +31 -14
- package/dist-client/entries/auth/signup.js.map +1 -1
- package/dist-client/entries/auth/unlock-user.js.map +1 -1
- package/dist-client/entries/oauth2/oauth2-decision-error-page.d.ts +1 -1
- package/dist-client/entries/oauth2/oauth2-decision-error-page.js +2 -2
- package/dist-client/entries/oauth2/oauth2-decision-error-page.js.map +1 -1
- package/dist-client/entries/oauth2/oauth2-decision-page.d.ts +1 -1
- package/dist-client/entries/oauth2/oauth2-decision-page.js +55 -54
- package/dist-client/entries/oauth2/oauth2-decision-page.js.map +1 -1
- package/dist-client/entries/public/home.d.ts +6 -5
- package/dist-client/entries/public/home.js +52 -28
- package/dist-client/entries/public/home.js.map +1 -1
- package/dist-client/index.d.ts +11 -2
- package/dist-client/index.js +74 -66
- package/dist-client/index.js.map +1 -1
- package/dist-client/pages/app-binding/app-binding.d.ts +1 -1
- package/dist-client/pages/app-binding/app-binding.js +47 -30
- package/dist-client/pages/app-binding/app-binding.js.map +1 -1
- package/dist-client/pages/app-binding/app-bindings.d.ts +2 -1
- package/dist-client/pages/app-binding/app-bindings.js +25 -7
- package/dist-client/pages/app-binding/app-bindings.js.map +1 -1
- package/dist-client/pages/appliance/appliance.d.ts +1 -1
- package/dist-client/pages/appliance/appliance.js +84 -26
- package/dist-client/pages/appliance/appliance.js.map +1 -1
- package/dist-client/pages/appliance/home.d.ts +2 -1
- package/dist-client/pages/appliance/home.js +27 -6
- package/dist-client/pages/appliance/home.js.map +1 -1
- package/dist-client/pages/appliance/register.js +7 -7
- package/dist-client/pages/appliance/register.js.map +1 -1
- package/dist-client/pages/application/application.d.ts +1 -1
- package/dist-client/pages/application/application.js +107 -76
- package/dist-client/pages/application/application.js.map +1 -1
- package/dist-client/pages/application/applications.d.ts +2 -1
- package/dist-client/pages/application/applications.js +28 -15
- package/dist-client/pages/application/applications.js.map +1 -1
- package/dist-client/pages/application/register.js +8 -8
- package/dist-client/pages/application/register.js.map +1 -1
- package/dist-client/pages/attribute/attribute-set-item-list.d.ts +1 -1
- package/dist-client/pages/attribute/attribute-set-item-list.js +11 -18
- package/dist-client/pages/attribute/attribute-set-item-list.js.map +1 -1
- package/dist-client/pages/attribute/attribute-set-management.d.ts +11 -2
- package/dist-client/pages/attribute/attribute-set-management.js +7 -11
- package/dist-client/pages/attribute/attribute-set-management.js.map +1 -1
- package/dist-client/pages/auth-provider/auth-provider-management.d.ts +11 -2
- package/dist-client/pages/auth-provider/auth-provider-management.js +8 -11
- package/dist-client/pages/auth-provider/auth-provider-management.js.map +1 -1
- package/dist-client/pages/domain/domain-management.d.ts +1 -0
- package/dist-client/pages/domain/domain-management.js +3 -7
- package/dist-client/pages/domain/domain-management.js.map +1 -1
- package/dist-client/pages/partner/partner-management.js +2 -2
- package/dist-client/pages/partner/partner-management.js.map +1 -1
- package/dist-client/pages/profile.js +1 -1
- package/dist-client/pages/profile.js.map +1 -1
- package/dist-client/pages/role/role-management.js +13 -10
- package/dist-client/pages/role/role-management.js.map +1 -1
- package/dist-client/pages/user/user-management.d.ts +1 -0
- package/dist-client/pages/user/user-management.js +6 -5
- package/dist-client/pages/user/user-management.js.map +1 -1
- package/dist-client/route.js.map +1 -1
- package/dist-client/themes/auth-theme.css +7 -10
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/utils/password-rule.js.map +1 -1
- package/dist-server/index.d.ts +0 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -18
- package/translations/en.json +2 -0
- package/translations/ja.json +2 -0
- package/translations/ko.json +2 -1
- package/translations/ms.json +2 -0
- package/translations/zh.json +2 -0
- package/views/auth-page.html +5 -3
- package/views/oauth2-page.html +3 -2
|
@@ -4,20 +4,23 @@ import './change-password'
|
|
|
4
4
|
import './delete-user-popup'
|
|
5
5
|
import './my-login-history'
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import base64url from 'base64url'
|
|
8
|
+
import { css, html, LitElement, nothing } from 'lit'
|
|
8
9
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
10
|
+
import { startRegistration } from '@simplewebauthn/browser'
|
|
9
11
|
|
|
10
12
|
import { i18next, localize } from '@operato/i18n'
|
|
11
13
|
import { notify, openPopup } from '@operato/layout'
|
|
12
14
|
import { auth, getLanguages } from '@things-factory/auth-base/dist-client'
|
|
13
15
|
|
|
16
|
+
const isAvailableWebauthn = 'PublicKeyCredential' in window
|
|
14
17
|
@customElement('profile-component')
|
|
15
18
|
export class ProfileComponent extends localize(i18next)(LitElement) {
|
|
16
19
|
static styles = [
|
|
17
20
|
css`
|
|
18
21
|
:host {
|
|
19
22
|
display: block;
|
|
20
|
-
background-color: var(--
|
|
23
|
+
background-color: var(--md-sys-color-background);
|
|
21
24
|
padding: 15px 0;
|
|
22
25
|
}
|
|
23
26
|
.wrap {
|
|
@@ -36,12 +39,12 @@ export class ProfileComponent extends localize(i18next)(LitElement) {
|
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
input {
|
|
39
|
-
margin: var(--
|
|
40
|
-
border:
|
|
41
|
-
padding:
|
|
42
|
+
margin: var(--spacing-small) 0;
|
|
43
|
+
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
44
|
+
padding: 9px;
|
|
42
45
|
border-radius: var(--border-radius);
|
|
43
|
-
font: var(--input-font);
|
|
44
|
-
width: var(--
|
|
46
|
+
font: var(--auth-input-field-font);
|
|
47
|
+
width: var(--auth-input-field-width);
|
|
45
48
|
}
|
|
46
49
|
input:focus {
|
|
47
50
|
border: 1px solid var(--focus-background-color);
|
|
@@ -51,7 +54,7 @@ export class ProfileComponent extends localize(i18next)(LitElement) {
|
|
|
51
54
|
background: url(/assets/images/icon-profile.png) center top no-repeat;
|
|
52
55
|
margin: var(--profile-icon-margin);
|
|
53
56
|
padding: 180px 20px 20px 20px;
|
|
54
|
-
color: var(--
|
|
57
|
+
color: var(--md-sys-color-secondary);
|
|
55
58
|
font: var(--header-bar-title);
|
|
56
59
|
text-align: center;
|
|
57
60
|
}
|
|
@@ -67,7 +70,7 @@ export class ProfileComponent extends localize(i18next)(LitElement) {
|
|
|
67
70
|
|
|
68
71
|
label {
|
|
69
72
|
font: bold 14px var(--theme-font);
|
|
70
|
-
color: var(--
|
|
73
|
+
color: var(--md-sys-color-primary);
|
|
71
74
|
text-transform: capitalize;
|
|
72
75
|
grid-column: 1;
|
|
73
76
|
}
|
|
@@ -79,15 +82,11 @@ export class ProfileComponent extends localize(i18next)(LitElement) {
|
|
|
79
82
|
ox-i18n-selector {
|
|
80
83
|
--i18n-selector-field-width: var(--auth-input-field-width);
|
|
81
84
|
--i18n-selector-field-margin: var(--change-password-field-margin);
|
|
82
|
-
--i18n-selector-field-padding: var(--
|
|
85
|
+
--i18n-selector-field-padding: var(--spacing-medium);
|
|
83
86
|
--i18n-selector-field-border-radius: var(--border-radius);
|
|
84
87
|
margin: var(--change-password-field-margin);
|
|
85
88
|
}
|
|
86
89
|
|
|
87
|
-
[danger] {
|
|
88
|
-
--mdc-theme-primary: var(--mdc-danger-button-primary-color);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
90
|
footer {
|
|
92
91
|
padding: 20px;
|
|
93
92
|
text-align: center;
|
|
@@ -96,16 +95,18 @@ export class ProfileComponent extends localize(i18next)(LitElement) {
|
|
|
96
95
|
footer p {
|
|
97
96
|
font-size: 14px;
|
|
98
97
|
margin-bottom: 5px;
|
|
98
|
+
color: var(--md-sys-color-on-background);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
footer a {
|
|
102
|
-
color: var(--
|
|
102
|
+
color: var(--md-sys-color-primary);
|
|
103
103
|
text-decoration: none;
|
|
104
104
|
font-weight: bold;
|
|
105
105
|
}
|
|
106
106
|
`
|
|
107
107
|
]
|
|
108
108
|
|
|
109
|
+
@property({ type: String }) userId?: string
|
|
109
110
|
@property({ type: String }) email?: string
|
|
110
111
|
@property({ type: String }) name?: string
|
|
111
112
|
|
|
@@ -126,9 +127,11 @@ export class ProfileComponent extends localize(i18next)(LitElement) {
|
|
|
126
127
|
|
|
127
128
|
setCredential(credential) {
|
|
128
129
|
if (credential) {
|
|
130
|
+
this.userId = credential.id
|
|
129
131
|
this.name = credential.name
|
|
130
132
|
this.email = credential.email
|
|
131
133
|
} else {
|
|
134
|
+
this.userId = ''
|
|
132
135
|
this.name = ''
|
|
133
136
|
this.email = ''
|
|
134
137
|
}
|
|
@@ -160,6 +163,14 @@ export class ProfileComponent extends localize(i18next)(LitElement) {
|
|
|
160
163
|
|
|
161
164
|
<change-password id="change-password"></change-password>
|
|
162
165
|
|
|
166
|
+
${isAvailableWebauthn
|
|
167
|
+
? html`
|
|
168
|
+
<md-text-button @click=${() => this.registerUser()}
|
|
169
|
+
>${i18next.t('button.security-key registration')}</md-text-button
|
|
170
|
+
>
|
|
171
|
+
`
|
|
172
|
+
: nothing}
|
|
173
|
+
|
|
163
174
|
<footer>
|
|
164
175
|
<p>
|
|
165
176
|
${i18next.t('text.click login history')}
|
|
@@ -233,4 +244,49 @@ export class ProfileComponent extends localize(i18next)(LitElement) {
|
|
|
233
244
|
title: i18next.t('label.delete account')
|
|
234
245
|
})
|
|
235
246
|
}
|
|
247
|
+
|
|
248
|
+
async registerUser() {
|
|
249
|
+
try {
|
|
250
|
+
const options = await fetch('/auth/register-webauthn/challenge').then(res => res.json())
|
|
251
|
+
const attResp = await startRegistration(options)
|
|
252
|
+
const verification = await fetch('/auth/verify-registration', {
|
|
253
|
+
method: 'POST',
|
|
254
|
+
headers: {
|
|
255
|
+
'Content-Type': 'application/json'
|
|
256
|
+
},
|
|
257
|
+
body: JSON.stringify(attResp)
|
|
258
|
+
}).then(res => res.json())
|
|
259
|
+
|
|
260
|
+
if (verification.verified) {
|
|
261
|
+
notify({
|
|
262
|
+
level: 'info',
|
|
263
|
+
message: i18next.t('text.user credential registered successfully')
|
|
264
|
+
})
|
|
265
|
+
} else {
|
|
266
|
+
console.error(await verification.text())
|
|
267
|
+
|
|
268
|
+
notify({
|
|
269
|
+
level: 'error',
|
|
270
|
+
message: i18next.t('error.user credential registeration not allowed')
|
|
271
|
+
})
|
|
272
|
+
}
|
|
273
|
+
} catch (error) {
|
|
274
|
+
notify({
|
|
275
|
+
level: 'error',
|
|
276
|
+
message: i18next.t('error.user credential registeration failed')
|
|
277
|
+
})
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
get applicationMeta() {
|
|
282
|
+
var iconLink: HTMLLinkElement | null = document.querySelector('link[rel="application-icon"]')
|
|
283
|
+
var titleMeta: HTMLMetaElement | null = document.querySelector('meta[name="application-name"]')
|
|
284
|
+
var descriptionMeta: HTMLMetaElement | null = document.querySelector('meta[name="application-description"]')
|
|
285
|
+
|
|
286
|
+
return {
|
|
287
|
+
icon: iconLink?.href || '',
|
|
288
|
+
title: titleMeta?.content || 'Things Factory',
|
|
289
|
+
description: descriptionMeta?.content || 'Reimagining Software'
|
|
290
|
+
}
|
|
291
|
+
}
|
|
236
292
|
}
|
|
@@ -17,10 +17,10 @@ class RoleEditForm extends localize(i18next)(LitElement) {
|
|
|
17
17
|
[field] {
|
|
18
18
|
display: flex;
|
|
19
19
|
flex-direction: column;
|
|
20
|
-
padding-bottom: var(--
|
|
20
|
+
padding-bottom: var(--spacing-medium);
|
|
21
21
|
}
|
|
22
22
|
input {
|
|
23
|
-
border: var(--border-
|
|
23
|
+
border: var(--border-dim-color);
|
|
24
24
|
border-radius: var(--border-radius);
|
|
25
25
|
margin: var(--input-margin);
|
|
26
26
|
padding: var(--input-padding);
|
|
@@ -31,7 +31,7 @@ class RoleEditForm extends localize(i18next)(LitElement) {
|
|
|
31
31
|
display: flex;
|
|
32
32
|
flex-direction: column;
|
|
33
33
|
font: var(--label-font);
|
|
34
|
-
color: var(--
|
|
34
|
+
color: var(--md-sys-color-on-primary);
|
|
35
35
|
text-transform: var(--label-text-transform);
|
|
36
36
|
}
|
|
37
37
|
@media screen and (max-width: 480px) {
|
|
@@ -5,30 +5,32 @@ import { customElement, property } from 'lit/decorators.js'
|
|
|
5
5
|
import { client, gqlContext } from '@operato/graphql'
|
|
6
6
|
import { i18next, localize } from '@operato/i18n'
|
|
7
7
|
import { OxPrompt } from '@operato/popup/ox-prompt.js'
|
|
8
|
+
import { ButtonContainerStyles } from '@operato/styles'
|
|
8
9
|
|
|
9
10
|
@customElement('role-privilege-editor')
|
|
10
11
|
class RolePrivilegeEditor extends localize(i18next)(LitElement) {
|
|
11
12
|
static styles = [
|
|
13
|
+
ButtonContainerStyles,
|
|
12
14
|
css`
|
|
13
15
|
:host {
|
|
14
16
|
display: flex;
|
|
15
17
|
flex-direction: column;
|
|
16
18
|
|
|
17
|
-
border: 1px solid var(--
|
|
19
|
+
border: 1px solid var(--md-sys-color-primary);
|
|
18
20
|
font: normal 15px var(--theme-font);
|
|
19
|
-
color: var(--
|
|
21
|
+
color: var(--md-sys-color-secondary);
|
|
20
22
|
}
|
|
21
23
|
div {
|
|
22
|
-
margin: var(--
|
|
24
|
+
margin: var(--spacing-medium);
|
|
23
25
|
}
|
|
24
26
|
ul {
|
|
25
27
|
flex: 1;
|
|
26
|
-
background-color: var(--
|
|
28
|
+
background-color: var(--md-sys-color-surface-variant);
|
|
27
29
|
overflow: auto;
|
|
28
30
|
display: grid;
|
|
29
31
|
grid-template-columns: 1fr 1fr;
|
|
30
32
|
margin: 0;
|
|
31
|
-
padding: var(--
|
|
33
|
+
padding: var(--spacing-medium);
|
|
32
34
|
list-style: none;
|
|
33
35
|
border: 1px dashed rgba(0, 0, 0, 0.1);
|
|
34
36
|
border-width: 1px 0;
|
|
@@ -39,32 +41,23 @@ class RolePrivilegeEditor extends localize(i18next)(LitElement) {
|
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
li {
|
|
42
|
-
padding: var(--
|
|
44
|
+
padding: var(--spacing-small);
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
#checkAll,
|
|
46
48
|
[for='checkAll'] {
|
|
47
|
-
margin-bottom: var(--
|
|
48
|
-
padding-bottom: var(--
|
|
49
|
+
margin-bottom: var(--spacing-medium);
|
|
50
|
+
padding-bottom: var(--spacing-small);
|
|
49
51
|
font-weight: bold;
|
|
50
52
|
}
|
|
51
53
|
|
|
52
|
-
|
|
53
|
-
margin: 0;
|
|
54
|
-
padding: 5px;
|
|
55
|
-
background-color: rgba(var(--primary-color-rgb), 0.2);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
mwc-button {
|
|
54
|
+
md-elevated-button {
|
|
59
55
|
margin: 5px;
|
|
60
|
-
background-color: var(--
|
|
56
|
+
background-color: var(--md-sys-color-surface-variant);
|
|
61
57
|
}
|
|
62
58
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
[outlined] {
|
|
67
|
-
background-color: var(--theme-white-color);
|
|
59
|
+
md-outlined-button {
|
|
60
|
+
background-color: var(--md-sys-color-surface-variant);
|
|
68
61
|
}
|
|
69
62
|
|
|
70
63
|
@media screen and (max-width: 480px) {
|
|
@@ -106,14 +99,11 @@ class RolePrivilegeEditor extends localize(i18next)(LitElement) {
|
|
|
106
99
|
)}
|
|
107
100
|
</ul>
|
|
108
101
|
|
|
109
|
-
<div
|
|
110
|
-
<
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
danger
|
|
115
|
-
label=${String(i18next.t('button.delete role'))}
|
|
116
|
-
></mwc-button>
|
|
102
|
+
<div class="button-container">
|
|
103
|
+
<md-elevated-button @click=${e => this.onSave()}>${String(i18next.t('button.save'))}</md-elevated-button>
|
|
104
|
+
<md-elevated-button @click=${e => this.onDeleteRole()} danger
|
|
105
|
+
>${String(i18next.t('button.delete role'))}</md-elevated-button
|
|
106
|
+
>
|
|
117
107
|
</div>
|
|
118
108
|
`
|
|
119
109
|
}
|
|
@@ -12,7 +12,7 @@ export class RoleSelector extends LitElement {
|
|
|
12
12
|
color: var(--subtitle-text-color);
|
|
13
13
|
}
|
|
14
14
|
div {
|
|
15
|
-
margin: 0 var(--
|
|
15
|
+
margin: 0 var(--spacing-medium) var(--spacing-medium) var(--spacing-medium);
|
|
16
16
|
}
|
|
17
17
|
ul {
|
|
18
18
|
flex: 1;
|
|
@@ -21,7 +21,7 @@ export class RoleSelector extends LitElement {
|
|
|
21
21
|
column-gap: 20px;
|
|
22
22
|
overflow: auto;
|
|
23
23
|
margin: 0;
|
|
24
|
-
padding: var(--
|
|
24
|
+
padding: var(--spacing-medium);
|
|
25
25
|
list-style: none;
|
|
26
26
|
border: 1px dashed rgba(0, 0, 0, 0.1);
|
|
27
27
|
border-width: 1px 0;
|
|
@@ -30,18 +30,18 @@ export class RoleSelector extends LitElement {
|
|
|
30
30
|
display: inline;
|
|
31
31
|
}
|
|
32
32
|
label {
|
|
33
|
-
padding-left: var(--
|
|
33
|
+
padding-left: var(--spacing-small);
|
|
34
34
|
text-transform: capitalize;
|
|
35
35
|
font: var(--label-font);
|
|
36
|
-
color: var(--label-color);
|
|
36
|
+
color: var(--label-color, var(--md-sys-color-on-surface));
|
|
37
37
|
}
|
|
38
38
|
li {
|
|
39
|
-
padding: var(--
|
|
39
|
+
padding: var(--spacing-small);
|
|
40
40
|
}
|
|
41
41
|
#checkAll,
|
|
42
42
|
[for='checkAll'] {
|
|
43
|
-
margin-bottom: var(--
|
|
44
|
-
padding-bottom: var(--
|
|
43
|
+
margin-bottom: var(--spacing-medium);
|
|
44
|
+
padding-bottom: var(--spacing-small);
|
|
45
45
|
font-weight: bold;
|
|
46
46
|
}
|
|
47
47
|
`
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import '@material/web/button/elevated-button.js'
|
|
3
|
+
|
|
1
4
|
import './ownership-transfer-popup'
|
|
2
5
|
import './role-selector'
|
|
3
6
|
|
|
@@ -11,20 +14,22 @@ import { i18next } from '@operato/i18n'
|
|
|
11
14
|
import { openPopup } from '@operato/layout'
|
|
12
15
|
import { store } from '@operato/shell'
|
|
13
16
|
import { OxPrompt } from '@operato/popup/ox-prompt.js'
|
|
14
|
-
|
|
17
|
+
import { ButtonContainerStyles } from '@operato/styles'
|
|
15
18
|
import { RoleSelector } from './role-selector'
|
|
19
|
+
import { InheritedValueType } from '@operato/data-grist'
|
|
16
20
|
|
|
17
21
|
@customElement('user-role-editor')
|
|
18
22
|
class UserRoleEditor extends connect(store)(LitElement) {
|
|
19
23
|
static styles = [
|
|
24
|
+
ButtonContainerStyles,
|
|
20
25
|
css`
|
|
21
26
|
:host {
|
|
22
27
|
display: flex;
|
|
23
28
|
flex-direction: column;
|
|
24
29
|
|
|
25
|
-
border: 1px solid var(--
|
|
30
|
+
border: 1px solid var(--md-sys-color-primary);
|
|
26
31
|
font: normal 15px var(--theme-font);
|
|
27
|
-
color: var(--
|
|
32
|
+
color: var(--md-sys-color-secondary);
|
|
28
33
|
}
|
|
29
34
|
ul {
|
|
30
35
|
flex: 1;
|
|
@@ -34,7 +39,7 @@ class UserRoleEditor extends connect(store)(LitElement) {
|
|
|
34
39
|
|
|
35
40
|
overflow: auto;
|
|
36
41
|
margin: 0;
|
|
37
|
-
padding: var(--
|
|
42
|
+
padding: var(--spacing-medium);
|
|
38
43
|
list-style: none;
|
|
39
44
|
border: 1px dashed rgba(0, 0, 0, 0.1);
|
|
40
45
|
border-width: 1px 0;
|
|
@@ -42,19 +47,19 @@ class UserRoleEditor extends connect(store)(LitElement) {
|
|
|
42
47
|
input[readonly] {
|
|
43
48
|
border: none;
|
|
44
49
|
background-color: transparent;
|
|
45
|
-
color: var(--
|
|
50
|
+
color: var(--md-sys-color-secondary);
|
|
46
51
|
font: var(--input-font);
|
|
47
52
|
}
|
|
48
53
|
li {
|
|
49
|
-
padding: var(--
|
|
54
|
+
padding: var(--spacing-small);
|
|
50
55
|
}
|
|
51
56
|
[detail] {
|
|
52
|
-
background-color:
|
|
57
|
+
background-color: var(--md-sys-color-surface);
|
|
53
58
|
}
|
|
54
|
-
[detail]
|
|
59
|
+
[detail] md-icon {
|
|
60
|
+
--md-icon-size: var(--fontsize-default);
|
|
55
61
|
vertical-align: middle;
|
|
56
|
-
|
|
57
|
-
color: var(--primary-color);
|
|
62
|
+
color: var(--md-sys-color-primary);
|
|
58
63
|
}
|
|
59
64
|
[detail] li {
|
|
60
65
|
display: flex;
|
|
@@ -63,21 +68,12 @@ class UserRoleEditor extends connect(store)(LitElement) {
|
|
|
63
68
|
flex: 1;
|
|
64
69
|
}
|
|
65
70
|
|
|
66
|
-
|
|
67
|
-
margin: 0;
|
|
68
|
-
padding: 5px;
|
|
69
|
-
background-color: rgba(var(--primary-color-rgb), 0.2);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
mwc-button {
|
|
71
|
+
md-elevated-button {
|
|
73
72
|
margin: 5px;
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
[outlined] {
|
|
80
|
-
background-color: var(--theme-white-color);
|
|
75
|
+
md-outlined-button {
|
|
76
|
+
background-color: var(--md-sys-color-surface-variant);
|
|
81
77
|
}
|
|
82
78
|
|
|
83
79
|
@media screen and (max-width: 480px) {
|
|
@@ -117,7 +113,7 @@ class UserRoleEditor extends connect(store)(LitElement) {
|
|
|
117
113
|
? html`
|
|
118
114
|
<li>
|
|
119
115
|
<span>
|
|
120
|
-
<
|
|
116
|
+
<md-icon>email</md-icon>
|
|
121
117
|
${user.email}
|
|
122
118
|
</span>
|
|
123
119
|
</li>
|
|
@@ -141,10 +137,9 @@ class UserRoleEditor extends connect(store)(LitElement) {
|
|
|
141
137
|
`
|
|
142
138
|
: ''}
|
|
143
139
|
|
|
144
|
-
<div
|
|
140
|
+
<div class="button-container">
|
|
145
141
|
${this.isRoleEditable()
|
|
146
|
-
? html` <
|
|
147
|
-
raised
|
|
142
|
+
? html` <md-elevated-button
|
|
148
143
|
@click=${() => {
|
|
149
144
|
const { availableRoles, selectedRoles } = Array.from(
|
|
150
145
|
this.renderRoot.querySelectorAll('role-selector') as NodeListOf<RoleSelector>
|
|
@@ -169,46 +164,41 @@ class UserRoleEditor extends connect(store)(LitElement) {
|
|
|
169
164
|
)
|
|
170
165
|
this.onSave(user, availableRoles, selectedRoles)
|
|
171
166
|
}}
|
|
172
|
-
|
|
173
|
-
|
|
167
|
+
>${String(i18next.t('button.save'))}</md-elevated-button
|
|
168
|
+
>`
|
|
174
169
|
: ''}
|
|
175
170
|
${user.userType === 'user'
|
|
176
171
|
? html`
|
|
177
172
|
${this.isTransferable(user)
|
|
178
173
|
? html`
|
|
179
|
-
<
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
@click=${() => this.onTransfer(user)}
|
|
183
|
-
label=${String(i18next.t('button.transfer owner'))}
|
|
184
|
-
></mwc-button>
|
|
174
|
+
<md-elevated-button danger @click=${() => this.onTransfer(user)}
|
|
175
|
+
>${String(i18next.t('button.transfer owner'))}</md-elevated-button
|
|
176
|
+
>
|
|
185
177
|
`
|
|
186
178
|
: ''}
|
|
187
179
|
${this.isPasswordResettable(user)
|
|
188
|
-
? html`<
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
@click="${() => this.onResetPassword(user)}"
|
|
192
|
-
label=${String(i18next.t('title.reset password'))}
|
|
193
|
-
></mwc-button>`
|
|
180
|
+
? html`<md-elevated-button danger @click=${() => this.onResetPassword(user)}
|
|
181
|
+
>${String(i18next.t('title.reset password'))}</md-elevated-button
|
|
182
|
+
>`
|
|
194
183
|
: ''}
|
|
195
184
|
`
|
|
196
185
|
: ''}
|
|
197
186
|
${this.isRemovable(user)
|
|
198
187
|
? html`
|
|
199
|
-
<
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
label=${String(i18next.t('button.delete user'))}
|
|
203
|
-
@click=${() => this.onDelete(user)}
|
|
204
|
-
></mwc-button>
|
|
188
|
+
<md-elevated-button danger @click=${() => this.onDelete(user)}
|
|
189
|
+
>${String(i18next.t('button.delete user'))}</md-elevated-button
|
|
190
|
+
>
|
|
205
191
|
`
|
|
206
192
|
: ''}
|
|
207
193
|
${this.isActivatable(user)
|
|
208
|
-
? html`<
|
|
194
|
+
? html`<md-elevated-button danger @click=${() => this.onActivate(user)}
|
|
195
|
+
>${String(i18next.t('button.activate'))}</md-elevated-button
|
|
196
|
+
>`
|
|
209
197
|
: ''}
|
|
210
198
|
${this.isInactivatable(user)
|
|
211
|
-
? html`<
|
|
199
|
+
? html`<md-elevated-button danger @click=${() => this.onInactivate(user)}
|
|
200
|
+
>${String(i18next.t('button.deactivate'))}</md-elevated-button
|
|
201
|
+
>`
|
|
212
202
|
: ''}
|
|
213
203
|
</div>
|
|
214
204
|
`
|
|
@@ -286,8 +276,8 @@ class UserRoleEditor extends connect(store)(LitElement) {
|
|
|
286
276
|
async fetchAvailableRoles() {
|
|
287
277
|
const response = await client.query({
|
|
288
278
|
query: gql`
|
|
289
|
-
query {
|
|
290
|
-
roles {
|
|
279
|
+
query roles($inherited: InheritedValueType) {
|
|
280
|
+
roles(inherited: $inherited) {
|
|
291
281
|
items {
|
|
292
282
|
id
|
|
293
283
|
domain {
|
|
@@ -311,6 +301,9 @@ class UserRoleEditor extends connect(store)(LitElement) {
|
|
|
311
301
|
}
|
|
312
302
|
}
|
|
313
303
|
`,
|
|
304
|
+
variables: {
|
|
305
|
+
inherited: InheritedValueType.Include
|
|
306
|
+
},
|
|
314
307
|
context: gqlContext()
|
|
315
308
|
})
|
|
316
309
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import '@material/
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import '@material/web/button/elevated-button.js'
|
|
3
|
+
|
|
2
4
|
import '@operato/i18n/ox-i18n.js'
|
|
3
5
|
import '@operato/layout/ox-snack-bar.js'
|
|
4
6
|
import '@operato/lottie-player'
|
|
@@ -18,7 +20,8 @@ export class AuthActivate extends localize(i18next)(LitElement) {
|
|
|
18
20
|
width: 100vw;
|
|
19
21
|
height: 100vh;
|
|
20
22
|
height: 100dvh;
|
|
21
|
-
background-color: var(--
|
|
23
|
+
background-color: var(--md-sys-color-primary);
|
|
24
|
+
color: var(--md-sys-color-on-primary);
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
.wrap {
|
|
@@ -36,7 +39,7 @@ export class AuthActivate extends localize(i18next)(LitElement) {
|
|
|
36
39
|
.auth-brand img {
|
|
37
40
|
margin: 15% auto 5px auto;
|
|
38
41
|
width: 100px;
|
|
39
|
-
border: 3px solid var(--
|
|
42
|
+
border: 3px solid var(--md-sys-color-on-primary);
|
|
40
43
|
border-radius: 25px;
|
|
41
44
|
box-shadow: var(--box-shadow);
|
|
42
45
|
}
|
|
@@ -51,14 +54,14 @@ export class AuthActivate extends localize(i18next)(LitElement) {
|
|
|
51
54
|
margin: 50px 0 0 0;
|
|
52
55
|
padding: 0;
|
|
53
56
|
font-size: 24px;
|
|
54
|
-
color: var(--auth-title-color);
|
|
57
|
+
color: var(--auth-title-color, var(--md-sys-color-on-primary));
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
p {
|
|
58
61
|
margin: 0;
|
|
59
62
|
padding: var(--auth-description-padding);
|
|
60
63
|
font: var(--auth-description-font);
|
|
61
|
-
color: var(--auth-description-color);
|
|
64
|
+
color: var(--auth-description-color, var(--md-sys-color-on-secondary));
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
#button-area {
|
|
@@ -66,11 +69,9 @@ export class AuthActivate extends localize(i18next)(LitElement) {
|
|
|
66
69
|
padding-top: 10px;
|
|
67
70
|
}
|
|
68
71
|
|
|
69
|
-
|
|
70
|
-
--
|
|
71
|
-
--
|
|
72
|
-
--mdc-button-horizontal-padding: var(--padding-default);
|
|
73
|
-
--mdc-button-ink-color: var(--primary-color);
|
|
72
|
+
md-elevated-button {
|
|
73
|
+
--md-elevated-button-horizontal-padding: var(--spacing-medium);
|
|
74
|
+
--md-elevated-button-ink-color: var(--md-sys-color-primary);
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
contact-us {
|
|
@@ -162,20 +163,18 @@ export class AuthActivate extends localize(i18next)(LitElement) {
|
|
|
162
163
|
</form>
|
|
163
164
|
|
|
164
165
|
<div id="button-area">
|
|
165
|
-
<
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
></mwc-button>
|
|
171
|
-
<mwc-button
|
|
172
|
-
raised
|
|
173
|
-
icon="home"
|
|
174
|
-
label=${i18next.t('button.go to home')}
|
|
166
|
+
<md-elevated-button @click=${e => this.requestResend(e)}>
|
|
167
|
+
<md-icon slot="icon">mail_outline</md-icon>
|
|
168
|
+
${i18next.t('label.send activation email')}
|
|
169
|
+
</md-elevated-button>
|
|
170
|
+
<md-elevated-button
|
|
175
171
|
@click=${e => {
|
|
176
172
|
window.location.replace('/auth/signin')
|
|
177
173
|
}}
|
|
178
|
-
|
|
174
|
+
>
|
|
175
|
+
<md-icon slot="icon">home</md-icon>
|
|
176
|
+
${i18next.t('button.go to home')}
|
|
177
|
+
</md-elevated-button>
|
|
179
178
|
</div>
|
|
180
179
|
<contact-us></contact-us>
|
|
181
180
|
|