@things-factory/auth-ui 6.2.70 → 6.2.78

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.
Files changed (33) hide show
  1. package/client/components/invite-user.ts +1 -1
  2. package/client/components/ownership-transfer-popup.ts +1 -1
  3. package/client/components/user-role-editor.ts +2 -2
  4. package/client/pages/app-binding/app-binding.ts +1 -1
  5. package/client/pages/appliance/appliance.ts +1 -1
  6. package/client/pages/application/application.ts +2 -0
  7. package/client/pages/attribute/attribute-set-management.ts +19 -33
  8. package/client/pages/auth-provider/auth-provider-management.ts +21 -27
  9. package/client/pages/domain/domain-management.ts +22 -37
  10. package/dist-client/components/invite-user.js +1 -1
  11. package/dist-client/components/invite-user.js.map +1 -1
  12. package/dist-client/components/ownership-transfer-popup.js +1 -1
  13. package/dist-client/components/ownership-transfer-popup.js.map +1 -1
  14. package/dist-client/components/user-role-editor.js +2 -2
  15. package/dist-client/components/user-role-editor.js.map +1 -1
  16. package/dist-client/pages/app-binding/app-binding.js +1 -1
  17. package/dist-client/pages/app-binding/app-binding.js.map +1 -1
  18. package/dist-client/pages/appliance/appliance.js +1 -1
  19. package/dist-client/pages/appliance/appliance.js.map +1 -1
  20. package/dist-client/pages/application/application.js +2 -0
  21. package/dist-client/pages/application/application.js.map +1 -1
  22. package/dist-client/pages/attribute/attribute-set-management.d.ts +3 -8
  23. package/dist-client/pages/attribute/attribute-set-management.js +27 -37
  24. package/dist-client/pages/attribute/attribute-set-management.js.map +1 -1
  25. package/dist-client/pages/auth-provider/auth-provider-management.d.ts +3 -8
  26. package/dist-client/pages/auth-provider/auth-provider-management.js +29 -31
  27. package/dist-client/pages/auth-provider/auth-provider-management.js.map +1 -1
  28. package/dist-client/pages/domain/domain-management.d.ts +4 -10
  29. package/dist-client/pages/domain/domain-management.js +25 -36
  30. package/dist-client/pages/domain/domain-management.js.map +1 -1
  31. package/dist-client/tsconfig.tsbuildinfo +1 -1
  32. package/dist-server/tsconfig.tsbuildinfo +1 -1
  33. package/package.json +4 -4
@@ -78,7 +78,7 @@ class InviteUser extends localize(i18next)(LitElement) {
78
78
  async inviteUser(email) {
79
79
  const response = await client.mutate({
80
80
  mutation: gql`
81
- mutation inviteUser($email: String!) {
81
+ mutation inviteUser($email: EmailAddress!) {
82
82
  inviteUser(email: $email)
83
83
  }
84
84
  `,
@@ -75,7 +75,7 @@ class OwnershipTransferPopup extends localize(i18next)(LitElement) {
75
75
  ) {
76
76
  const response = await client.mutate({
77
77
  mutation: gql`
78
- mutation transferOwner($email: String!) {
78
+ mutation transferOwner($email: EmailAddress!) {
79
79
  transferOwner(email: $email)
80
80
  }
81
81
  `,
@@ -258,7 +258,7 @@ class UserRoleEditor extends connect(store)(LitElement) {
258
258
  async fetchRolesOnUser(email) {
259
259
  const response = await client.query({
260
260
  query: gql`
261
- query ($email: String!) {
261
+ query ($email: EmailAddress!) {
262
262
  user(email: $email) {
263
263
  id
264
264
  name
@@ -421,7 +421,7 @@ class UserRoleEditor extends connect(store)(LitElement) {
421
421
  ) {
422
422
  const response = await client.mutate({
423
423
  mutation: gql`
424
- mutation deleteDomaineUser($email: String!) {
424
+ mutation deleteDomaineUser($email: EmailAddress!) {
425
425
  deleteDomainUser(email: $email)
426
426
  }
427
427
  `,
@@ -123,7 +123,7 @@ class AppBinding extends connect(store)(PageView) {
123
123
  [button-in-field] {
124
124
  border-radius: 0 var(--button-border-radius) var(--button-border-radius) 0;
125
125
  position: absolute;
126
- top: 11px;
126
+ top: 12px;
127
127
  right: 0;
128
128
  max-height: 36px;
129
129
  }
@@ -111,7 +111,7 @@ class Appliance extends connect(store)(PageView) {
111
111
  [button-in-field] {
112
112
  border-radius: 0 var(--button-border-radius) var(--button-border-radius) 0;
113
113
  position: absolute;
114
- top: 11px;
114
+ top: 12px;
115
115
  right: 0;
116
116
  max-height: 36px;
117
117
  }
@@ -22,6 +22,8 @@ class Application extends connect(store)(PageView) {
22
22
  padding: var(--padding-wide);
23
23
  }
24
24
  h2 {
25
+ display: flex;
26
+ align-items: center;
25
27
  margin: var(--title-margin);
26
28
  font: var(--title-font);
27
29
  color: var(--title-text-color);
@@ -1,4 +1,5 @@
1
1
  import '@operato/data-grist'
2
+ import '@operato/context/ox-context-page-toolbar.js'
2
3
  import './attribute-set-item-list.js'
3
4
 
4
5
  import gql from 'graphql-tag'
@@ -11,7 +12,7 @@ import { client } from '@operato/graphql'
11
12
  import { i18next, localize } from '@operato/i18n'
12
13
  import { notify, openPopup } from '@operato/layout'
13
14
  import { PageView, store } from '@operato/shell'
14
- import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
15
+ import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
15
16
  import { isMobileDevice, sleep } from '@operato/utils'
16
17
  import { OxPopup } from '@operato/popup'
17
18
 
@@ -19,15 +20,20 @@ import { OxPopup } from '@operato/popup'
19
20
  export class AttributeSetManagementPage extends connect(store)(localize(i18next)(PageView)) {
20
21
  static styles = [
21
22
  ScrollbarStyles,
22
- CommonGristStyles,
23
+ CommonHeaderStyles,
23
24
  css`
24
25
  :host {
25
26
  display: flex;
26
27
 
27
28
  width: 100%;
28
29
 
29
- --grid-record-emphasized-background-color: red;
30
- --grid-record-emphasized-color: yellow;
30
+ --grid-record-emphasized-background-color: #8b0000;
31
+ --grid-record-emphasized-color: #ff6b6b;
32
+ }
33
+
34
+ ox-grist {
35
+ overflow-y: auto;
36
+ flex: 1;
31
37
  }
32
38
  `
33
39
  ]
@@ -36,7 +42,6 @@ export class AttributeSetManagementPage extends connect(store)(localize(i18next)
36
42
  @state() mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'
37
43
 
38
44
  @query('ox-grist') private grist!: DataGrist
39
- @query('#sorter-control') private sortersControl!: OxPopup
40
45
 
41
46
  get context() {
42
47
  return {
@@ -57,14 +62,15 @@ export class AttributeSetManagementPage extends connect(store)(localize(i18next)
57
62
  {
58
63
  title: i18next.t('button.save'),
59
64
  action: this.updateAttributeSet.bind(this),
60
- ...CommonButtonStyles.save
65
+ icon: 'save'
61
66
  },
62
67
  {
63
68
  title: i18next.t('button.delete'),
64
69
  action: this.deleteAttributeSet.bind(this),
65
- ...CommonButtonStyles.delete
70
+ icon: 'delete'
66
71
  }
67
- ]
72
+ ],
73
+ toolbar: false
68
74
  }
69
75
  }
70
76
 
@@ -78,33 +84,13 @@ export class AttributeSetManagementPage extends connect(store)(localize(i18next)
78
84
  .fetchHandler=${this.fetchHandler.bind(this)}
79
85
  ?url-params-sensitive=${this.active}
80
86
  >
81
- <div slot="headroom">
82
- <div id="filters">
83
- <ox-filters-form autofocus without-search></ox-filters-form>
87
+ <div slot="headroom" class="header">
88
+ <div class="title">
89
+ <mwc-icon>summarize</mwc-icon>
90
+ ${i18next.t('title.attributes')}
84
91
  </div>
85
92
 
86
- <div id="sorters">
87
- Sort
88
- <mwc-icon
89
- @click=${e => {
90
- const target = e.currentTarget
91
- this.sortersControl.open({
92
- right: 0,
93
- top: target.offsetTop + target.offsetHeight
94
- })
95
- }}
96
- >expand_more</mwc-icon
97
- >
98
- <ox-popup id="sorter-control">
99
- <ox-sorters-control> </ox-sorters-control>
100
- </ox-popup>
101
- </div>
102
-
103
- <div id="modes">
104
- <mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</mwc-icon>
105
- <mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</mwc-icon>
106
- <mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</mwc-icon>
107
- </div>
93
+ <ox-context-page-toolbar class="actions" .context=${this.context}> </ox-context-page-toolbar>
108
94
  </div>
109
95
  </ox-grist>
110
96
  `
@@ -1,4 +1,5 @@
1
1
  import '@operato/data-grist'
2
+ import '@operato/context/ox-context-page-toolbar.js'
2
3
 
3
4
  import gql from 'graphql-tag'
4
5
  import { css, html } from 'lit'
@@ -10,7 +11,7 @@ import { client } from '@operato/graphql'
10
11
  import { i18next, localize } from '@operato/i18n'
11
12
  import { notify, openPopup } from '@operato/layout'
12
13
  import { PageView, store } from '@operato/shell'
13
- import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
14
+ import { CommonButtonStyles, CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
14
15
  import { isMobileDevice, sleep } from '@operato/utils'
15
16
  import { OxPopup } from '@operato/popup'
16
17
  import { OxPrompt } from '@operato/popup/ox-prompt.js'
@@ -19,15 +20,20 @@ import { OxPrompt } from '@operato/popup/ox-prompt.js'
19
20
  export class AuthProviderManagementPage extends connect(store)(localize(i18next)(PageView)) {
20
21
  static styles = [
21
22
  ScrollbarStyles,
22
- CommonGristStyles,
23
+ CommonHeaderStyles,
23
24
  css`
24
25
  :host {
25
26
  display: flex;
26
27
 
27
28
  width: 100%;
28
29
 
29
- --grid-record-emphasized-background-color: red;
30
- --grid-record-emphasized-color: yellow;
30
+ --grid-record-emphasized-background-color: #8b0000;
31
+ --grid-record-emphasized-color: #ff6b6b;
32
+ }
33
+
34
+ ox-grist {
35
+ overflow-y: auto;
36
+ flex: 1;
31
37
  }
32
38
  `
33
39
  ]
@@ -37,7 +43,6 @@ export class AuthProviderManagementPage extends connect(store)(localize(i18next)
37
43
  @state() authProviderTypes: { type: string; description?: string; help?: string; parameterSpec?: any[] }[] = []
38
44
 
39
45
  @query('ox-grist') private grist!: DataGrist
40
- @query('#sorter-control') private sortersControl!: OxPopup
41
46
 
42
47
  get context() {
43
48
  return {
@@ -58,14 +63,15 @@ export class AuthProviderManagementPage extends connect(store)(localize(i18next)
58
63
  {
59
64
  title: i18next.t('button.save'),
60
65
  action: this.updateAuthProvider.bind(this),
61
- ...CommonButtonStyles.save
66
+ icon: 'save'
62
67
  },
63
68
  {
64
69
  title: i18next.t('button.delete'),
65
70
  action: this.deleteAuthProvider.bind(this),
66
- ...CommonButtonStyles.delete
71
+ icon: 'delete'
67
72
  }
68
- ]
73
+ ],
74
+ toolbar: false
69
75
  }
70
76
  }
71
77
 
@@ -79,27 +85,15 @@ export class AuthProviderManagementPage extends connect(store)(localize(i18next)
79
85
  .fetchHandler=${this.fetchHandler.bind(this)}
80
86
  ?url-params-sensitive=${this.active}
81
87
  >
82
- <div slot="headroom">
83
- <div id="filters">
84
- <ox-filters-form autofocus without-search></ox-filters-form>
88
+ <div slot="headroom" class="header">
89
+ <div class="title">
90
+ <mwc-icon>summarize</mwc-icon>
91
+ ${i18next.t('title.auth-provider')}
85
92
  </div>
86
93
 
87
- <div id="sorters">
88
- Sort
89
- <mwc-icon
90
- @click=${e => {
91
- const target = e.currentTarget
92
- this.sortersControl.open({
93
- right: 0,
94
- top: target.offsetTop + target.offsetHeight
95
- })
96
- }}
97
- >expand_more</mwc-icon
98
- >
99
- <ox-popup id="sorter-control">
100
- <ox-sorters-control> </ox-sorters-control>
101
- </ox-popup>
102
- </div>
94
+ <ox-filters-form autofocus without-search class="filters"></ox-filters-form>
95
+
96
+ <ox-context-page-toolbar class="actions" .context=${this.context}> </ox-context-page-toolbar>
103
97
  </div>
104
98
  </ox-grist>
105
99
  `
@@ -1,6 +1,6 @@
1
1
  import '@operato/data-grist/ox-grist.js'
2
2
  import '@operato/data-grist/ox-filters-form.js'
3
- import '@operato/data-grist/ox-sorters-control.js'
3
+ import '@operato/context/ox-context-page-toolbar.js'
4
4
  import '@operato/attribute/ox-attribute-view.js'
5
5
  import '../../components/create-domain-popup'
6
6
 
@@ -15,7 +15,7 @@ import { client } from '@operato/graphql'
15
15
  import { i18next, localize } from '@operato/i18n'
16
16
  import { openPopup } from '@operato/layout'
17
17
  import { PageView, store } from '@operato/shell'
18
- import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
18
+ import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
19
19
  import { isMobileDevice } from '@operato/utils'
20
20
 
21
21
  const DEFAULT_TZ = Intl.DateTimeFormat().resolvedOptions().timeZone
@@ -24,7 +24,7 @@ const TIMEZONE_OPTIONS = ['', DEFAULT_TZ, ...moment.tz.names().filter(tz => tz !
24
24
  @customElement('domain-management')
25
25
  export class DomainManagement extends connect(store)(localize(i18next)(PageView)) {
26
26
  static styles = [
27
- CommonGristStyles,
27
+ CommonHeaderStyles,
28
28
  ScrollbarStyles,
29
29
  css`
30
30
  :host {
@@ -33,6 +33,11 @@ export class DomainManagement extends connect(store)(localize(i18next)(PageView)
33
33
 
34
34
  overflow: hidden;
35
35
  }
36
+
37
+ ox-grist {
38
+ overflow-y: auto;
39
+ flex: 1;
40
+ }
36
41
  `
37
42
  ]
38
43
 
@@ -40,7 +45,7 @@ export class DomainManagement extends connect(store)(localize(i18next)(PageView)
40
45
  @property({ type: Object }) config: any
41
46
  @property({ type: String }) mode: 'CARD' | 'LIST' | 'GRID' = isMobileDevice() ? 'CARD' : 'GRID'
42
47
 
43
- @query('ox-grist') grist!: DataGrist
48
+ @query('ox-grist') private grist!: DataGrist
44
49
 
45
50
  get context() {
46
51
  return {
@@ -57,51 +62,31 @@ export class DomainManagement extends connect(store)(localize(i18next)(PageView)
57
62
  }
58
63
  },
59
64
  actions: [
65
+ {
66
+ title: i18next.t('button.add'),
67
+ action: this.onCreateDomain.bind(this),
68
+ icon: 'add'
69
+ },
60
70
  {
61
71
  title: i18next.t('button.save'),
62
72
  action: this.onUpdateDomains.bind(this),
63
- ...CommonButtonStyles.save
73
+ icon: 'save'
64
74
  }
65
- ]
75
+ ],
76
+ toolbar: false
66
77
  }
67
78
  }
68
79
 
69
80
  render() {
70
81
  return html`
71
82
  <ox-grist .mode=${this.mode} .config=${this.config} .fetchHandler=${this.fetchHandler.bind(this)}>
72
- <div slot="headroom">
73
- <div id="filters">
74
- <ox-filters-form autofocus without-search></ox-filters-form>
83
+ <div slot="headroom" class="header">
84
+ <div class="title">
85
+ <mwc-icon>summarize</mwc-icon>
86
+ ${i18next.t('text.domain management')}
75
87
  </div>
76
88
 
77
- <div id="sorters">
78
- Sort
79
- <mwc-icon
80
- @click=${(e: MouseEvent) => {
81
- const target = e.currentTarget as HTMLElement
82
- ;(this.renderRoot.querySelector('#sorter-control') as any).open({
83
- right: 0,
84
- top: target.offsetTop + target.offsetHeight
85
- })
86
- }}
87
- >expand_more</mwc-icon
88
- >
89
- <ox-popup id="sorter-control">
90
- <ox-sorters-control> </ox-sorters-control>
91
- </ox-popup>
92
- </div>
93
-
94
- <div id="modes">
95
- <mwc-icon @click=${() => (this.mode = 'GRID')} ?active=${this.mode == 'GRID'}>grid_on</mwc-icon>
96
- <mwc-icon @click=${() => (this.mode = 'LIST')} ?active=${this.mode == 'LIST'}
97
- >format_list_bulleted</mwc-icon
98
- >
99
- <mwc-icon @click=${() => (this.mode = 'CARD')} ?active=${this.mode == 'CARD'}>apps</mwc-icon>
100
- </div>
101
-
102
- <div id="add">
103
- <button><mwc-icon @click=${this.onCreateDomain.bind(this)}>add</mwc-icon></button>
104
- </div>
89
+ <ox-context-page-toolbar class="actions" .context=${this.context}></ox-context-page-toolbar>
105
90
  </div>
106
91
  </ox-grist>
107
92
  `
@@ -45,7 +45,7 @@ let InviteUser = class InviteUser extends localize(i18next)(LitElement) {
45
45
  async inviteUser(email) {
46
46
  const response = await client.mutate({
47
47
  mutation: gql `
48
- mutation inviteUser($email: String!) {
48
+ mutation inviteUser($email: EmailAddress!) {
49
49
  inviteUser(email: $email)
50
50
  }
51
51
  `,
@@ -1 +1 @@
1
- {"version":3,"file":"invite-user.js","sourceRoot":"","sources":["../../client/components/invite-user.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE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E;gBACxB,MAAM,EAAE;oBACN,KAAK,EAAE,OAAO;oBACd,OAAO,EAAE,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;iBACxC;aACF,CAAC,CACH,CAAA;SACF;IACH,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,KAAK;QACpB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,GAAG,CAAA;;;;OAIZ;YACD,SAAS,EAAE,EAAE,KAAK,EAAE;YACpB,OAAO,EAAE,UAAU,EAAE;SACtB,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpB,MAAM,QAAQ,CAAC,IAAI,CAAC;gBAClB,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC;gBAClC,aAAa,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,EAAE;aACrD,CAAC,CAAA;YAEF,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAA;SAC3B;IACH,CAAC;;AApFM,iBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;GAmBlB,CAAA;AAED;IAAC,KAAK,CAAC,mBAAmB,CAAC;8BAAc,gBAAgB;8CAAA;AAtBrD,UAAU;IADf,aAAa,CAAC,aAAa,CAAC;GACvB,UAAU,CAsFf","sourcesContent":["import './user-role-editor'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, query } from 'lit/decorators.js'\n\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\n\n@customElement('invite-user')\nclass InviteUser extends localize(i18next)(LitElement) {\n static styles = css`\n :host {\n display: grid;\n }\n\n input {\n flex: 1;\n\n border: var(--border-dark-color);\n border-radius: var(--border-radius);\n margin: var(--input-margin);\n padding: var(--input-padding);\n min-width: 250px;\n font: var(--input-font);\n }\n\n mwc-button {\n margin: var(--input-margin);\n }\n `\n\n @query('input[name=email]') emailInput!: HTMLInputElement\n\n render() {\n return html`\n <input name=\"email\" type=\"email\" required name=\"invite-email\" autocapitalize=\"off\" />\n <mwc-button\n @click=${this.invite.bind(this)}\n outlined\n icon=\"group_add\"\n label=${String(i18next.t('label.invite user'))}\n ></mwc-button>\n `\n }\n\n async invite() {\n try {\n if (!this.emailInput.checkValidity()) {\n throw new Error(i18next.t('error.not valid pattern of type', { type: 'e-mail' }))\n }\n\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.do_you_want_to_invite_x', { x: i18next.t(`label.user`) }),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n await this.inviteUser(this.emailInput.value)\n\n this.dispatchEvent(new CustomEvent('invitationCompleted'))\n }\n } catch (e: any) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level: 'error',\n message: 'message' in e ? e.message : e\n }\n })\n )\n }\n }\n\n async inviteUser(email) {\n const response = await client.mutate({\n mutation: gql`\n mutation inviteUser($email: String!) {\n inviteUser(email: $email)\n }\n `,\n variables: { email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n await OxPrompt.open({\n title: i18next.t('text.completed'),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n\n this.emailInput.value = ''\n }\n }\n}\n"]}
1
+ {"version":3,"file":"invite-user.js","sourceRoot":"","sources":["../../client/components/invite-user.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,MAAM,EAAE,UAAU,E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QAAQ,CAAC,aAAa,CACpB,IAAI,WAAW,CAAC,QAAQ,EAAE;gBACxB,MAAM,EAAE;oBACN,KAAK,EAAE,OAAO;oBACd,OAAO,EAAE,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;iBACxC;aACF,CAAC,CACH,CAAA;SACF;IACH,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,KAAK;QACpB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,GAAG,CAAA;;;;OAIZ;YACD,SAAS,EAAE,EAAE,KAAK,EAAE;YACpB,OAAO,EAAE,UAAU,EAAE;SACtB,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpB,MAAM,QAAQ,CAAC,IAAI,CAAC;gBAClB,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC;gBAClC,aAAa,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,EAAE;aACrD,CAAC,CAAA;YAEF,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAA;SAC3B;IACH,CAAC;;AApFM,iBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;GAmBlB,CAAA;AAED;IAAC,KAAK,CAAC,mBAAmB,CAAC;8BAAc,gBAAgB;8CAAA;AAtBrD,UAAU;IADf,aAAa,CAAC,aAAa,CAAC;GACvB,UAAU,CAsFf","sourcesContent":["import './user-role-editor'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, query } from 'lit/decorators.js'\n\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\n\n@customElement('invite-user')\nclass InviteUser extends localize(i18next)(LitElement) {\n static styles = css`\n :host {\n display: grid;\n }\n\n input {\n flex: 1;\n\n border: var(--border-dark-color);\n border-radius: var(--border-radius);\n margin: var(--input-margin);\n padding: var(--input-padding);\n min-width: 250px;\n font: var(--input-font);\n }\n\n mwc-button {\n margin: var(--input-margin);\n }\n `\n\n @query('input[name=email]') emailInput!: HTMLInputElement\n\n render() {\n return html`\n <input name=\"email\" type=\"email\" required name=\"invite-email\" autocapitalize=\"off\" />\n <mwc-button\n @click=${this.invite.bind(this)}\n outlined\n icon=\"group_add\"\n label=${String(i18next.t('label.invite user'))}\n ></mwc-button>\n `\n }\n\n async invite() {\n try {\n if (!this.emailInput.checkValidity()) {\n throw new Error(i18next.t('error.not valid pattern of type', { type: 'e-mail' }))\n }\n\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.do_you_want_to_invite_x', { x: i18next.t(`label.user`) }),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n await this.inviteUser(this.emailInput.value)\n\n this.dispatchEvent(new CustomEvent('invitationCompleted'))\n }\n } catch (e: any) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level: 'error',\n message: 'message' in e ? e.message : e\n }\n })\n )\n }\n }\n\n async inviteUser(email) {\n const response = await client.mutate({\n mutation: gql`\n mutation inviteUser($email: EmailAddress!) {\n inviteUser(email: $email)\n }\n `,\n variables: { email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n await OxPrompt.open({\n title: i18next.t('text.completed'),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n\n this.emailInput.value = ''\n }\n }\n}\n"]}
@@ -32,7 +32,7 @@ let OwnershipTransferPopup = class OwnershipTransferPopup extends localize(i18ne
32
32
  })) {
33
33
  const response = await client.mutate({
34
34
  mutation: gql `
35
- mutation transferOwner($email: String!) {
35
+ mutation transferOwner($email: EmailAddress!) {
36
36
  transferOwner(email: $email)
37
37
  }
38
38
  `,
@@ -1 +1 @@
1
- {"version":3,"file":"ownership-transfer-popup.js","sourceRo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C,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAU;AAErC;IAAC,KAAK,CAAC,mBAAmB,CAAC;8BAAc,gBAAgB;0DAAA;AAnCrD,sBAAsB;IAD3B,aAAa,CAAC,0BAA0B,CAAC;GACpC,sBAAsB,CAkG3B","sourcesContent":["import '@material/mwc-button'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\n\n@customElement('ownership-transfer-popup')\nclass OwnershipTransferPopup extends localize(i18next)(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n background-color: var(--main-section-background-color);\n padding: var(--padding-wide);\n overflow: auto;\n }\n .container {\n display: flex;\n flex-direction: column;\n flex: 1;\n }\n input {\n border: var(--border-dark-color);\n border-radius: var(--border-radius);\n margin: var(--input-margin);\n padding: var(--input-padding);\n min-width: 250px;\n font: var(--input-font);\n }\n .input-container {\n margin: auto;\n display: flex;\n }\n .input-container mwc-button {\n margin: auto 0px auto var(--padding-wide);\n }\n `\n ]\n\n @property({ type: Object }) user: any\n\n @query('input[name=email]') emailInput!: HTMLInputElement\n\n render() {\n return html`\n <div class=\"container\">\n <div>${i18next.t('text.please enter the email of the user you want to transfer owner')}</div>\n <div class=\"input-container\">\n <input name=\"email\" />\n <mwc-button raised @click=${this.transferOwnership}>${i18next.t('button.confirm')}</mwc-button>\n </div>\n </div>\n `\n }\n\n async transferOwnership() {\n if (!this.doubleCheckEmail()) {\n this.showToast(i18next.t('text.email is not matched'))\n\n return\n }\n\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.are_you_sure_to_transfer_owner'),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const response = await client.mutate({\n mutation: gql`\n mutation transferOwner($email: String!) {\n transferOwner(email: $email)\n }\n `,\n variables: { email: this.user.email },\n context: gqlContext()\n })\n\n if (!response.errors?.length) {\n await OxPrompt.open({\n type: 'success',\n title: i18next.t('text.completed'),\n text: i18next.t('text.owner_transfer_completed'),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n\n history.back()\n\n this.dispatchEvent(new CustomEvent('ownershipTransferred', { bubbles: true, composed: true }))\n }\n } else {\n history.back()\n }\n }\n\n doubleCheckEmail() {\n return this.emailInput.value === this.user.email\n }\n\n showToast(message) {\n document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }))\n }\n}\n"]}
1
+ {"version":3,"file":"ownership-transfer-popup.js","sourceRoot":"","sources":["../../client/components/ownership-transfer-popup.ts"],"names":[],"mappings":";AAAA,OAAO,sBAAsB,CAAA;AAE7B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAGtD,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAqChE,MAAM;QACJ,OAAO,IAAI,CAAA;;eAEA,OAAO,CAAC,CAAC,CAAC,oEAAoE,CAAC;;;sCAGxD,IAAI,CAAC,iBAAiB,IAAI,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC;;;KAGtF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,iBAAiB;;QACrB,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAA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;SACf;IACH,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,CAAA;IAClD,CAAC;IAED,SAAS,CAAC,OAAO;QACf,QAAQ,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;IACrG,CAAC;;AAhGM,6BAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4BF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAU;AAErC;IAAC,KAAK,CAAC,mBAAmB,CAAC;8BAAc,gBAAgB;0DAAA;AAnCrD,sBAAsB;IAD3B,aAAa,CAAC,0BAA0B,CAAC;GACpC,sBAAsB,CAkG3B","sourcesContent":["import '@material/mwc-button'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\n\n@customElement('ownership-transfer-popup')\nclass OwnershipTransferPopup extends localize(i18next)(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n background-color: var(--main-section-background-color);\n padding: var(--padding-wide);\n overflow: auto;\n }\n .container {\n display: flex;\n flex-direction: column;\n flex: 1;\n }\n input {\n border: var(--border-dark-color);\n border-radius: var(--border-radius);\n margin: var(--input-margin);\n padding: var(--input-padding);\n min-width: 250px;\n font: var(--input-font);\n }\n .input-container {\n margin: auto;\n display: flex;\n }\n .input-container mwc-button {\n margin: auto 0px auto var(--padding-wide);\n }\n `\n ]\n\n @property({ type: Object }) user: any\n\n @query('input[name=email]') emailInput!: HTMLInputElement\n\n render() {\n return html`\n <div class=\"container\">\n <div>${i18next.t('text.please enter the email of the user you want to transfer owner')}</div>\n <div class=\"input-container\">\n <input name=\"email\" />\n <mwc-button raised @click=${this.transferOwnership}>${i18next.t('button.confirm')}</mwc-button>\n </div>\n </div>\n `\n }\n\n async transferOwnership() {\n if (!this.doubleCheckEmail()) {\n this.showToast(i18next.t('text.email is not matched'))\n\n return\n }\n\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.are_you_sure_to_transfer_owner'),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const response = await client.mutate({\n mutation: gql`\n mutation transferOwner($email: EmailAddress!) {\n transferOwner(email: $email)\n }\n `,\n variables: { email: this.user.email },\n context: gqlContext()\n })\n\n if (!response.errors?.length) {\n await OxPrompt.open({\n type: 'success',\n title: i18next.t('text.completed'),\n text: i18next.t('text.owner_transfer_completed'),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n\n history.back()\n\n this.dispatchEvent(new CustomEvent('ownershipTransferred', { bubbles: true, composed: true }))\n }\n } else {\n history.back()\n }\n }\n\n doubleCheckEmail() {\n return this.emailInput.value === this.user.email\n }\n\n showToast(message) {\n document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }))\n }\n}\n"]}
@@ -160,7 +160,7 @@ let UserRoleEditor = class UserRoleEditor extends connect(store)(LitElement) {
160
160
  var _a;
161
161
  const response = await client.query({
162
162
  query: gql `
163
- query ($email: String!) {
163
+ query ($email: EmailAddress!) {
164
164
  user(email: $email) {
165
165
  id
166
166
  name
@@ -309,7 +309,7 @@ let UserRoleEditor = class UserRoleEditor extends connect(store)(LitElement) {
309
309
  })) {
310
310
  const response = await client.mutate({
311
311
  mutation: gql `
312
- mutation deleteDomaineUser($email: String!) {
312
+ mutation deleteDomaineUser($email: EmailAddress!) {
313
313
  deleteDomainUser(email: $email)
314
314
  }
315
315
  `,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,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;IACrG,CAAC;IAED,YAAY,CAAC,KAAK;;QAChB,IAAI,CAAC,EAAE,GAAG,CAAA,MAAA,KAAK,CAAC,IAAI,0CAAE,IAAI,KAAI,EAAE,CAAA;QAChC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,KAAK,CAAA;QAC1C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,KAAK,CAAA;IACxE,CAAC;;AAteM,qBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoEF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CAAe;AAC1C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;gDAA0B;AACtD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mDAAiB;AAE5C;IAAC,KAAK,EAAE;;mDAAwB;AAChC;IAAC,KAAK,EAAE;;oDAAuB;AAC/B;IAAC,KAAK,EAAE;;iDAAsB;AAC9B;IAAC,KAAK,EAAE;;oDAA8B;AACtC;IAAC,KAAK,EAAE;;qDAA+B;AAjFnC,cAAc;IADnB,aAAa,CAAC,kBAAkB,CAAC;GAC5B,cAAc,CAwenB","sourcesContent":["import './ownership-transfer-popup'\nimport './role-selector'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { store } from '@operato/shell'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\n\nimport { RoleSelector } from './role-selector'\n\n@customElement('user-role-editor')\nclass UserRoleEditor extends connect(store)(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n border: 1px solid var(--primary-color);\n font: normal 15px var(--theme-font);\n color: var(--secondary-color);\n }\n ul {\n flex: 1;\n display: grid;\n grid-template-columns: 1fr 1fr;\n column-gap: 20px;\n\n overflow: auto;\n margin: 0;\n padding: var(--padding-default);\n list-style: none;\n border: 1px dashed rgba(0, 0, 0, 0.1);\n border-width: 1px 0;\n }\n input[readonly] {\n border: none;\n background-color: transparent;\n color: var(--secondary-color);\n font: var(--input-font);\n }\n li {\n padding: var(--padding-narrow);\n }\n [detail] {\n background-color: rgba(var(--primary-color-rgb), 0.05);\n }\n [detail] mwc-icon {\n vertical-align: middle;\n --mdc-icon-size: var(--fontsize-default);\n color: var(--primary-color);\n }\n [detail] li {\n display: flex;\n }\n [detail] li input {\n flex: 1;\n }\n\n [buttons] {\n margin: 0;\n padding: 5px;\n background-color: rgba(var(--primary-color-rgb), 0.2);\n }\n\n mwc-button {\n margin: 5px;\n }\n\n [danger] {\n --mdc-theme-primary: var(--mdc-danger-button-primary-color);\n }\n [outlined] {\n background-color: var(--theme-white-color);\n }\n\n @media screen and (max-width: 480px) {\n ul {\n grid-template-columns: 1fr;\n }\n }\n `\n ]\n\n @property({ type: Object }) user: any = {}\n @property({ type: Boolean }) activate: boolean = false\n @property({ type: Object }) domainOwner: any\n\n @state() domainRoles: any[] = []\n @state() grantedRoles: any = {}\n @state() userRoles: any[] = []\n @state() isSuperOwner: boolean = false\n @state() isDomainOwner: boolean = false\n\n private me: any\n\n render() {\n const user = this.user || {}\n const domainRoles = this.domainRoles || []\n const grantedRoles = this.grantedRoles || {}\n let currentDomainName = 'roles'\n if (domainRoles?.length) {\n currentDomainName = domainRoles[0].domain.name\n }\n\n return html`\n ${this.activate\n ? html`\n <ul detail>\n ${user.userType === 'user'\n ? html`\n <li>\n <span>\n <mwc-icon>email</mwc-icon>\n ${user.email}\n </span>\n </li>\n `\n : ''}\n </ul>\n\n <role-selector .user=${this.user} .roles=${domainRoles} .userRoles=${this.userRoles}></role-selector>\n\n ${Object.keys(grantedRoles).map(\n partnerName => html`\n <role-selector\n .roleCategory=${partnerName}\n .user=${this.user}\n .roles=${this.grantedRoles[partnerName]}\n .userRoles=${this.userRoles}\n >\n </role-selector>\n `\n )}\n `\n : ''}\n\n <div buttons>\n ${this.isRoleEditable()\n ? html` <mwc-button\n raised\n @click=${() => {\n const { availableRoles, selectedRoles } = Array.from(\n this.renderRoot.querySelectorAll('role-selector') as NodeListOf<RoleSelector>\n ).reduce(\n (roles, roleSelector) => {\n roles.availableRoles = roles.availableRoles.concat(\n roleSelector.roles.map(r => {\n delete r.domain\n return r\n })\n )\n roles.selectedRoles = roles.selectedRoles.concat(\n roleSelector.selectedRoles().map(r => {\n //@ts-ignore\n delete r.domain\n return r\n })\n )\n return roles\n },\n { availableRoles: [], selectedRoles: [] } as { availableRoles: any[]; selectedRoles: any[] }\n )\n this.onSave(user, availableRoles, selectedRoles)\n }}\n label=${String(i18next.t('button.save'))}\n ></mwc-button>`\n : ''}\n ${user.userType === 'user'\n ? html`\n ${this.isTransferable(user)\n ? html`\n <mwc-button\n raised\n danger\n @click=${() => this.onTransfer(user)}\n label=${String(i18next.t('button.transfer owner'))}\n ></mwc-button>\n `\n : ''}\n ${this.isPasswordResettable(user)\n ? html`<mwc-button\n raised\n danger\n @click=\"${() => this.onResetPassword(user)}\"\n label=${String(i18next.t('title.reset password'))}\n ></mwc-button>`\n : ''}\n `\n : ''}\n ${this.isRemovable(user)\n ? html`\n <mwc-button\n raised\n danger\n label=${String(i18next.t('button.delete user'))}\n @click=${() => this.onDelete(user)}\n ></mwc-button>\n `\n : ''}\n ${this.isActivatable(user)\n ? html`<mwc-button raised danger @click=\"${() => this.onActivate(user)}\" label=\"activate\"></mwc-button>`\n : ''}\n ${this.isInactivatable(user)\n ? html`<mwc-button raised danger @click=\"${() => this.onInactivate(user)}\" label=\"inactivate\"></mwc-button>`\n : ''}\n </div>\n `\n }\n\n isRemovable(user) {\n return this.isDomainOwner && user.email !== this.me.email && !user.owner\n }\n\n isTransferable(user) {\n return (this.isSuperOwner || this.isDomainOwner) && !user.owner\n }\n\n isRoleEditable() {\n return this.activate && (this.domainRoles?.length || Object.keys(this.grantedRoles || {}).length)\n }\n\n isPasswordResettable(user) {\n return (this.isSuperOwner || this.isDomainOwner) && user.email !== this.me.email\n }\n\n isActivatable(user) {\n return (this.isSuperOwner || this.isDomainOwner) && !this.activate\n }\n\n isInactivatable(user) {\n return (\n (this.isSuperOwner || this.isDomainOwner) &&\n user.id !== this.domainOwner.id &&\n user.userType !== 'admin' &&\n this.activate\n )\n }\n\n async updated(changedProps) {\n if (changedProps.has('user')) {\n this.fetchAvailableRoles()\n\n if (this.user?.email) {\n this.userRoles = await this.fetchRolesOnUser(this.user.email)\n } else {\n this.userRoles = []\n }\n }\n }\n\n async fetchRolesOnUser(email) {\n const response = await client.query({\n query: gql`\n query ($email: String!) {\n user(email: $email) {\n id\n name\n email\n roles {\n id\n name\n description\n domain {\n id\n }\n }\n }\n }\n `,\n variables: { email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n return response.data.user?.roles || []\n }\n }\n\n async fetchAvailableRoles() {\n const response = await client.query({\n query: gql`\n query {\n roles {\n items {\n id\n domain {\n name\n }\n name\n description\n }\n total\n }\n grantedRoles {\n id\n role {\n id\n name\n description\n domain {\n name\n }\n }\n }\n }\n `,\n context: gqlContext()\n })\n\n if (!response.errors?.length) {\n this.domainRoles = response.data.roles.items || []\n this.grantedRoles = response.data.grantedRoles.reduce((grantedRoles, grantedRole) => {\n const { role } = grantedRole\n const { domain } = role\n if (grantedRoles[domain.name]) {\n grantedRoles[domain.name].push(role)\n } else {\n grantedRoles[domain.name] = [role]\n }\n\n return grantedRoles\n }, {})\n } else {\n this.domainRoles = []\n this.grantedRoles = []\n }\n }\n\n async onSave(user, availableRoles, selectedRoles) {\n if (user?.id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($userId: String!, $availableRoles: [ObjectRef!]!, $selectedRoles: [ObjectRef!]!) {\n updateUserRoles(userId: $userId, availableRoles: $availableRoles, selectedRoles: $selectedRoles) {\n id\n name\n roles {\n id\n description\n }\n }\n }\n `,\n variables: { userId: user.id, availableRoles, selectedRoles },\n context: gqlContext()\n })\n\n if (!response.errors) {\n this.showToast(i18next.t('text.data_updated_successfully'))\n this.dispatchUserUpdated()\n }\n }\n }\n\n async onActivate(user) {\n const response = await client.mutate({\n mutation: gql`\n mutation activateUser($userId: String!) {\n activateUser(userId: $userId)\n }\n `,\n variables: { userId: user.id },\n context: gqlContext()\n })\n\n if (!response.errors) {\n this.showToast(i18next.t('text.user activated successfully'))\n\n this.dispatchUserUpdated()\n }\n }\n\n async onInactivate(user) {\n const response = await client.mutate({\n mutation: gql`\n mutation inactivateUser($userId: String!) {\n inactivateUser(userId: $userId)\n }\n `,\n variables: { userId: user.id },\n context: gqlContext()\n })\n\n if (!response.errors) {\n this.showToast(i18next.t('text.user activated successfully'))\n\n this.dispatchUserUpdated()\n }\n }\n\n async onDelete(user) {\n if (user.owner) {\n await OxPrompt.open({\n type: 'warning',\n title: i18next.t('text.cannot_delete'),\n text: i18next.t('text.x_cannot_delete', {\n x: i18next.t('label.domain-owner')\n }),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n\n return\n }\n\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.are_you_sure_to_x_user', {\n x: i18next.t('button.delete')\n }),\n confirmButton: { text: i18next.t('button.delete') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const response = await client.mutate({\n mutation: gql`\n mutation deleteDomaineUser($email: String!) {\n deleteDomainUser(email: $email)\n }\n `,\n variables: { email: user.email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n await OxPrompt.open({\n type: 'success',\n title: i18next.t('text.completed'),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n\n this.dispatchUserUpdated()\n }\n }\n }\n\n async onTransfer(user) {\n openPopup(\n html`\n <ownership-transfer-popup\n .user=${user}\n @ownershipTransferred=\"${this.dispatchOwnershipTransferred.bind(this)}\"\n ></ownership-transfer-popup>\n `,\n {\n size: 'small',\n title: `${i18next.t('title.owner_transfer')}`\n }\n )\n }\n\n async onResetPassword(user) {\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.are_you_sure_to_x', { x: i18next.t('title.reset password') }),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const response = await client.mutate({\n mutation: gql`\n mutation resetPasswordToDefault($userId: String!) {\n resetPasswordToDefault(userId: $userId)\n }\n `,\n variables: { userId: user.id },\n context: gqlContext()\n })\n\n if (!response.errors) {\n await OxPrompt.open({\n type: 'success',\n title: i18next.t('text.completed'),\n text: i18next.t('text.password reset succeed'),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n }\n }\n }\n\n dispatchUserUpdated() {\n this.dispatchEvent(new CustomEvent('userUpdated'))\n }\n\n dispatchOwnershipTransferred() {\n this.dispatchEvent(new CustomEvent('ownershipTransferred'))\n }\n\n showToast(message) {\n document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }))\n }\n\n stateChanged(state) {\n this.me = state.auth?.user || {}\n this.isSuperOwner = this.me.super || false\n this.isDomainOwner = this.me.email === this.domainOwner.email || false\n }\n}\n"]}
1
+ {"version":3,"file":"user-role-editor.js","sourceRoot":"","sources":["../../client/components/user-role-editor.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,iBAAiB,CAAA;AAExB,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,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,MAAA,KAAK,CAAC,IAAI,0CAAE,IAAI,KAAI,EAAE,CAAA;QAChC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,KAAK,CAAA;QAC1C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,KAAK,CAAA;IACxE,CAAC;;AAteM,qBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoEF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CAAe;AAC1C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;gDAA0B;AACtD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mDAAiB;AAE5C;IAAC,KAAK,EAAE;;mDAAwB;AAChC;IAAC,KAAK,EAAE;;oDAAuB;AAC/B;IAAC,KAAK,EAAE;;iDAAsB;AAC9B;IAAC,KAAK,EAAE;;oDAA8B;AACtC;IAAC,KAAK,EAAE;;qDAA+B;AAjFnC,cAAc;IADnB,aAAa,CAAC,kBAAkB,CAAC;GAC5B,cAAc,CAwenB","sourcesContent":["import './ownership-transfer-popup'\nimport './role-selector'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin'\n\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\nimport { store } from '@operato/shell'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\n\nimport { RoleSelector } from './role-selector'\n\n@customElement('user-role-editor')\nclass UserRoleEditor extends connect(store)(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n border: 1px solid var(--primary-color);\n font: normal 15px var(--theme-font);\n color: var(--secondary-color);\n }\n ul {\n flex: 1;\n display: grid;\n grid-template-columns: 1fr 1fr;\n column-gap: 20px;\n\n overflow: auto;\n margin: 0;\n padding: var(--padding-default);\n list-style: none;\n border: 1px dashed rgba(0, 0, 0, 0.1);\n border-width: 1px 0;\n }\n input[readonly] {\n border: none;\n background-color: transparent;\n color: var(--secondary-color);\n font: var(--input-font);\n }\n li {\n padding: var(--padding-narrow);\n }\n [detail] {\n background-color: rgba(var(--primary-color-rgb), 0.05);\n }\n [detail] mwc-icon {\n vertical-align: middle;\n --mdc-icon-size: var(--fontsize-default);\n color: var(--primary-color);\n }\n [detail] li {\n display: flex;\n }\n [detail] li input {\n flex: 1;\n }\n\n [buttons] {\n margin: 0;\n padding: 5px;\n background-color: rgba(var(--primary-color-rgb), 0.2);\n }\n\n mwc-button {\n margin: 5px;\n }\n\n [danger] {\n --mdc-theme-primary: var(--mdc-danger-button-primary-color);\n }\n [outlined] {\n background-color: var(--theme-white-color);\n }\n\n @media screen and (max-width: 480px) {\n ul {\n grid-template-columns: 1fr;\n }\n }\n `\n ]\n\n @property({ type: Object }) user: any = {}\n @property({ type: Boolean }) activate: boolean = false\n @property({ type: Object }) domainOwner: any\n\n @state() domainRoles: any[] = []\n @state() grantedRoles: any = {}\n @state() userRoles: any[] = []\n @state() isSuperOwner: boolean = false\n @state() isDomainOwner: boolean = false\n\n private me: any\n\n render() {\n const user = this.user || {}\n const domainRoles = this.domainRoles || []\n const grantedRoles = this.grantedRoles || {}\n let currentDomainName = 'roles'\n if (domainRoles?.length) {\n currentDomainName = domainRoles[0].domain.name\n }\n\n return html`\n ${this.activate\n ? html`\n <ul detail>\n ${user.userType === 'user'\n ? html`\n <li>\n <span>\n <mwc-icon>email</mwc-icon>\n ${user.email}\n </span>\n </li>\n `\n : ''}\n </ul>\n\n <role-selector .user=${this.user} .roles=${domainRoles} .userRoles=${this.userRoles}></role-selector>\n\n ${Object.keys(grantedRoles).map(\n partnerName => html`\n <role-selector\n .roleCategory=${partnerName}\n .user=${this.user}\n .roles=${this.grantedRoles[partnerName]}\n .userRoles=${this.userRoles}\n >\n </role-selector>\n `\n )}\n `\n : ''}\n\n <div buttons>\n ${this.isRoleEditable()\n ? html` <mwc-button\n raised\n @click=${() => {\n const { availableRoles, selectedRoles } = Array.from(\n this.renderRoot.querySelectorAll('role-selector') as NodeListOf<RoleSelector>\n ).reduce(\n (roles, roleSelector) => {\n roles.availableRoles = roles.availableRoles.concat(\n roleSelector.roles.map(r => {\n delete r.domain\n return r\n })\n )\n roles.selectedRoles = roles.selectedRoles.concat(\n roleSelector.selectedRoles().map(r => {\n //@ts-ignore\n delete r.domain\n return r\n })\n )\n return roles\n },\n { availableRoles: [], selectedRoles: [] } as { availableRoles: any[]; selectedRoles: any[] }\n )\n this.onSave(user, availableRoles, selectedRoles)\n }}\n label=${String(i18next.t('button.save'))}\n ></mwc-button>`\n : ''}\n ${user.userType === 'user'\n ? html`\n ${this.isTransferable(user)\n ? html`\n <mwc-button\n raised\n danger\n @click=${() => this.onTransfer(user)}\n label=${String(i18next.t('button.transfer owner'))}\n ></mwc-button>\n `\n : ''}\n ${this.isPasswordResettable(user)\n ? html`<mwc-button\n raised\n danger\n @click=\"${() => this.onResetPassword(user)}\"\n label=${String(i18next.t('title.reset password'))}\n ></mwc-button>`\n : ''}\n `\n : ''}\n ${this.isRemovable(user)\n ? html`\n <mwc-button\n raised\n danger\n label=${String(i18next.t('button.delete user'))}\n @click=${() => this.onDelete(user)}\n ></mwc-button>\n `\n : ''}\n ${this.isActivatable(user)\n ? html`<mwc-button raised danger @click=\"${() => this.onActivate(user)}\" label=\"activate\"></mwc-button>`\n : ''}\n ${this.isInactivatable(user)\n ? html`<mwc-button raised danger @click=\"${() => this.onInactivate(user)}\" label=\"inactivate\"></mwc-button>`\n : ''}\n </div>\n `\n }\n\n isRemovable(user) {\n return this.isDomainOwner && user.email !== this.me.email && !user.owner\n }\n\n isTransferable(user) {\n return (this.isSuperOwner || this.isDomainOwner) && !user.owner\n }\n\n isRoleEditable() {\n return this.activate && (this.domainRoles?.length || Object.keys(this.grantedRoles || {}).length)\n }\n\n isPasswordResettable(user) {\n return (this.isSuperOwner || this.isDomainOwner) && user.email !== this.me.email\n }\n\n isActivatable(user) {\n return (this.isSuperOwner || this.isDomainOwner) && !this.activate\n }\n\n isInactivatable(user) {\n return (\n (this.isSuperOwner || this.isDomainOwner) &&\n user.id !== this.domainOwner.id &&\n user.userType !== 'admin' &&\n this.activate\n )\n }\n\n async updated(changedProps) {\n if (changedProps.has('user')) {\n this.fetchAvailableRoles()\n\n if (this.user?.email) {\n this.userRoles = await this.fetchRolesOnUser(this.user.email)\n } else {\n this.userRoles = []\n }\n }\n }\n\n async fetchRolesOnUser(email) {\n const response = await client.query({\n query: gql`\n query ($email: EmailAddress!) {\n user(email: $email) {\n id\n name\n email\n roles {\n id\n name\n description\n domain {\n id\n }\n }\n }\n }\n `,\n variables: { email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n return response.data.user?.roles || []\n }\n }\n\n async fetchAvailableRoles() {\n const response = await client.query({\n query: gql`\n query {\n roles {\n items {\n id\n domain {\n name\n }\n name\n description\n }\n total\n }\n grantedRoles {\n id\n role {\n id\n name\n description\n domain {\n name\n }\n }\n }\n }\n `,\n context: gqlContext()\n })\n\n if (!response.errors?.length) {\n this.domainRoles = response.data.roles.items || []\n this.grantedRoles = response.data.grantedRoles.reduce((grantedRoles, grantedRole) => {\n const { role } = grantedRole\n const { domain } = role\n if (grantedRoles[domain.name]) {\n grantedRoles[domain.name].push(role)\n } else {\n grantedRoles[domain.name] = [role]\n }\n\n return grantedRoles\n }, {})\n } else {\n this.domainRoles = []\n this.grantedRoles = []\n }\n }\n\n async onSave(user, availableRoles, selectedRoles) {\n if (user?.id) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($userId: String!, $availableRoles: [ObjectRef!]!, $selectedRoles: [ObjectRef!]!) {\n updateUserRoles(userId: $userId, availableRoles: $availableRoles, selectedRoles: $selectedRoles) {\n id\n name\n roles {\n id\n description\n }\n }\n }\n `,\n variables: { userId: user.id, availableRoles, selectedRoles },\n context: gqlContext()\n })\n\n if (!response.errors) {\n this.showToast(i18next.t('text.data_updated_successfully'))\n this.dispatchUserUpdated()\n }\n }\n }\n\n async onActivate(user) {\n const response = await client.mutate({\n mutation: gql`\n mutation activateUser($userId: String!) {\n activateUser(userId: $userId)\n }\n `,\n variables: { userId: user.id },\n context: gqlContext()\n })\n\n if (!response.errors) {\n this.showToast(i18next.t('text.user activated successfully'))\n\n this.dispatchUserUpdated()\n }\n }\n\n async onInactivate(user) {\n const response = await client.mutate({\n mutation: gql`\n mutation inactivateUser($userId: String!) {\n inactivateUser(userId: $userId)\n }\n `,\n variables: { userId: user.id },\n context: gqlContext()\n })\n\n if (!response.errors) {\n this.showToast(i18next.t('text.user activated successfully'))\n\n this.dispatchUserUpdated()\n }\n }\n\n async onDelete(user) {\n if (user.owner) {\n await OxPrompt.open({\n type: 'warning',\n title: i18next.t('text.cannot_delete'),\n text: i18next.t('text.x_cannot_delete', {\n x: i18next.t('label.domain-owner')\n }),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n\n return\n }\n\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.are_you_sure_to_x_user', {\n x: i18next.t('button.delete')\n }),\n confirmButton: { text: i18next.t('button.delete') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const response = await client.mutate({\n mutation: gql`\n mutation deleteDomaineUser($email: EmailAddress!) {\n deleteDomainUser(email: $email)\n }\n `,\n variables: { email: user.email },\n context: gqlContext()\n })\n\n if (!response.errors) {\n await OxPrompt.open({\n type: 'success',\n title: i18next.t('text.completed'),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n\n this.dispatchUserUpdated()\n }\n }\n }\n\n async onTransfer(user) {\n openPopup(\n html`\n <ownership-transfer-popup\n .user=${user}\n @ownershipTransferred=\"${this.dispatchOwnershipTransferred.bind(this)}\"\n ></ownership-transfer-popup>\n `,\n {\n size: 'small',\n title: `${i18next.t('title.owner_transfer')}`\n }\n )\n }\n\n async onResetPassword(user) {\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.are_you_sure_to_x', { x: i18next.t('title.reset password') }),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const response = await client.mutate({\n mutation: gql`\n mutation resetPasswordToDefault($userId: String!) {\n resetPasswordToDefault(userId: $userId)\n }\n `,\n variables: { userId: user.id },\n context: gqlContext()\n })\n\n if (!response.errors) {\n await OxPrompt.open({\n type: 'success',\n title: i18next.t('text.completed'),\n text: i18next.t('text.password reset succeed'),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n }\n }\n }\n\n dispatchUserUpdated() {\n this.dispatchEvent(new CustomEvent('userUpdated'))\n }\n\n dispatchOwnershipTransferred() {\n this.dispatchEvent(new CustomEvent('ownershipTransferred'))\n }\n\n showToast(message) {\n document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }))\n }\n\n stateChanged(state) {\n this.me = state.auth?.user || {}\n this.isSuperOwner = this.me.super || false\n this.isDomainOwner = this.me.email === this.domainOwner.email || false\n }\n}\n"]}
@@ -359,7 +359,7 @@ AppBinding.styles = [
359
359
  [button-in-field] {
360
360
  border-radius: 0 var(--button-border-radius) var(--button-border-radius) 0;
361
361
  position: absolute;
362
- top: 11px;
362
+ top: 12px;
363
363
  right: 0;
364
364
  max-height: 36px;
365
365
  }