@dssp/dcsp 1.0.0-alpha.1 → 1.0.0-alpha.14
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/_index.html +6 -6
- package/assets/manifest.json +2 -2
- package/config/config.development.js +2 -1
- package/config/config.production.js +2 -1
- package/dist-client/bootstrap.js +50 -1
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/entries/public/home.js.map +1 -1
- package/dist-client/pages/sv-user-management.js.map +1 -1
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/viewparts/menu-tools.js.map +1 -1
- package/dist-client/viewparts/user-circle.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +52 -52
- package/schema.graphql +3157 -306
- package/views/auth-page.html +6 -6
- package/views/public/home.html +3 -3
package/_index.html
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="google" content="notranslate" />
|
|
6
|
-
<title>Construction
|
|
6
|
+
<title>Construction Supervision Platform</title>
|
|
7
7
|
<meta name="generator" content="Things Factory Starter Kit" />
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
|
9
|
-
<meta name="description" content="
|
|
9
|
+
<meta name="description" content="Driving the Digitalization of Site Supervision" />
|
|
10
10
|
|
|
11
11
|
<base href="/" />
|
|
12
12
|
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
|
|
21
21
|
<!-- Add to homescreen for Chrome on Android. Fallback for manifest.json -->
|
|
22
22
|
<meta name="mobile-web-app-capable" content="yes" />
|
|
23
|
-
<meta name="application-name" content="Construction
|
|
24
|
-
<meta name="application-description" content="
|
|
23
|
+
<meta name="application-name" content="Construction Supervision Platform" />
|
|
24
|
+
<meta name="application-description" content="Driving the Digitalization of Site Supervision" />
|
|
25
25
|
<meta name="application-copyright" content="Copyright © hatiolab.com. All Rights Reserved." />
|
|
26
26
|
<link rel="application-icon" href="/assets/manifest/icon-96x96.png" />
|
|
27
27
|
|
|
28
28
|
<!-- Add to homescreen for Safari on iOS -->
|
|
29
29
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
30
30
|
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
|
|
31
|
-
<meta name="apple-mobile-web-app-title" content="Construction
|
|
31
|
+
<meta name="apple-mobile-web-app-title" content="Construction Supervision Platform" />
|
|
32
32
|
|
|
33
33
|
<!-- Homescreen icons -->
|
|
34
34
|
<link rel="apple-touch-icon" href="/assets/manifest/icon-48x48.png" />
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<meta name="twitter:card" content="summary" />
|
|
47
47
|
<meta name="twitter:site" content="@username" />
|
|
48
48
|
<meta property="og:type" content="website" />
|
|
49
|
-
<meta property="og:site_name" content="Construction
|
|
49
|
+
<meta property="og:site_name" content="Construction Supervision Platform, Driving the Digitalization of Site Supervision" />
|
|
50
50
|
<meta property="og:image" content="/assets/manifest/image-metaog.png" />
|
|
51
51
|
|
|
52
52
|
<!-- Performance tip: hint to the browser to start the handshake for the fonts site -->
|
package/assets/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "Construction
|
|
2
|
+
"name": "Construction Supervision Platform",
|
|
3
3
|
"short_name": "dcsp",
|
|
4
|
-
"description": "Construction
|
|
4
|
+
"description": "Construction Supervision Platform, Driving the Digitalization of Site Supervision",
|
|
5
5
|
"icons": [
|
|
6
6
|
{
|
|
7
7
|
"src": "manifest/icon-192x192.png",
|
package/dist-client/bootstrap.js
CHANGED
|
@@ -63,7 +63,7 @@ export default async function bootstrap() {
|
|
|
63
63
|
type: APPEND_APP_TOOL,
|
|
64
64
|
tool: {
|
|
65
65
|
name: 'app-brand',
|
|
66
|
-
template: html ` <span style="font-size: 1.2em;">
|
|
66
|
+
template: html ` <span style="font-size: 1.2em;">CSP</span> `,
|
|
67
67
|
position: TOOL_POSITION.FRONT
|
|
68
68
|
}
|
|
69
69
|
});
|
|
@@ -179,6 +179,55 @@ export default async function bootstrap() {
|
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
+
if (await hasPrivilege({
|
|
183
|
+
privilege: 'mutation',
|
|
184
|
+
category: 'scenario',
|
|
185
|
+
domainOwnerGranted: true,
|
|
186
|
+
superUserGranted: true
|
|
187
|
+
})) {
|
|
188
|
+
store.dispatch({
|
|
189
|
+
type: ADD_MORENDA,
|
|
190
|
+
morenda: {
|
|
191
|
+
icon: html ` <md-icon>device_hub</md-icon> `,
|
|
192
|
+
name: html ` <ox-i18n msgid="text.connection"></ox-i18n> `,
|
|
193
|
+
action: () => {
|
|
194
|
+
navigate('connection');
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
store.dispatch({
|
|
199
|
+
type: ADD_MORENDA,
|
|
200
|
+
morenda: {
|
|
201
|
+
icon: html ` <md-icon>format_list_numbered</md-icon> `,
|
|
202
|
+
name: html ` <ox-i18n msgid="text.scenario"></ox-i18n> `,
|
|
203
|
+
action: () => {
|
|
204
|
+
navigate('scenario');
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
store.dispatch({
|
|
209
|
+
type: ADD_MORENDA,
|
|
210
|
+
morenda: {
|
|
211
|
+
icon: html ` <md-icon>hub</md-icon> `,
|
|
212
|
+
name: html ` <ox-i18n msgid="text.integration analysis"></ox-i18n> (beta)`,
|
|
213
|
+
action: () => {
|
|
214
|
+
navigate('integration-analysis');
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
if (await hasPrivilege({ privilege: 'mutation', category: 'state-register', domainOwnerGranted: true })) {
|
|
220
|
+
store.dispatch({
|
|
221
|
+
type: ADD_MORENDA,
|
|
222
|
+
morenda: {
|
|
223
|
+
icon: html ` <md-icon>app_registration</md-icon> `,
|
|
224
|
+
name: html ` <ox-i18n msgid="title.state-register"></ox-i18n> `,
|
|
225
|
+
action: () => {
|
|
226
|
+
navigate('state-register-page');
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
182
231
|
store.dispatch({
|
|
183
232
|
type: ADD_SETTING,
|
|
184
233
|
setting: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,0CAA0C,CAAA,CAAC,kCAAkC;AACpF,OAAO,wCAAwC,CAAA,CAAC,gCAAgC;AAEhF,OAAO,4BAA4B,CAAA;AACnC,OAAO,0BAA0B,CAAA;AACjC,OAAO,8BAA8B,CAAA;AACrC,OAAO,yBAAyB,CAAA;AAChC,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEhD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACjI,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAA;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AAEtE,OAAO,CAAC,GAAG,CACT;;;;;;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C7B,CAAC;aACF;SACF,CAAC,CAAA;KACH;IAED,IAAI,MAAM,YAAY,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,EAAE;QACjG,KAAK,CAAC,QAAQ,CAAC;YACb,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE;gBACP,IAAI,EAAE,IAAI,CAAA,gCAAgC;gBAC1C,IAAI,EAAE,IAAI,CAAA,mDAAmD;gBAC7D,MAAM,EAAE,GAAG,EAAE;oBACX,QAAQ,CAAC,qBAAqB,CAAC,CAAA;gBACjC,CAAC;aACF;SACF,CAAC,CAAA;KACH;IAED,KAAK,CAAC,QAAQ,CAAC;QACb,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE;YACP,GAAG,EAAE,EAAE;YACP,QAAQ,EAAE,IAAI,CAAA,qDAAqD;SACpE;KACF,CAAC,CAAA;IAEF,KAAK,CAAC,QAAQ,CAAC;QACb,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE;YACP,GAAG,EAAE,EAAE;YACP,QAAQ,EAAE,IAAI,CAAA,yDAAyD;SACxE;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import '@things-factory/notification/dist-client' /* for notification-setting-let */\nimport '@things-factory/setting-ui/dist-client' /* for theme-mode-setting-let */\n\nimport '@material/web/icon/icon.js'\nimport '@operato/i18n/ox-i18n.js'\nimport '@things-factory/notification'\nimport './viewparts/user-circle'\nimport './viewparts/menu-tools'\n\nimport { html } from 'lit-html'\n\nimport { registerDefaultGroups } from '@operato/board'\nimport { navigate, store } from '@operato/shell'\n\nimport { appendViewpart, updateViewpart, toggleOverlay, TOOL_POSITION, VIEWPART_POSITION, VIEWPART_LEVEL } from '@operato/layout'\nimport { APPEND_APP_TOOL } from '@things-factory/apptool-base/client'\nimport { setupAppToolPart } from '@things-factory/apptool-ui/dist-client'\nimport { setupContextUIPart } from '@things-factory/context-ui/dist-client'\nimport { hasPrivilege } from '@things-factory/auth-base/dist-client'\nimport { setAuthManagementMenus } from '@things-factory/auth-ui/dist-client'\nimport { ADD_MORENDA } from '@things-factory/more-base/client'\nimport { ADD_SETTING } from '@things-factory/setting-base/dist-client'\n\nconsole.log(\n `%c\n▄▄▄ ▄▄ ▄▄▄ ▄▄▄ \n▓ ▓ ▓ ▓ ▓ ▀ ▓ ▓ \n▓ ▓ ▓ ▀▀▄▄ ▓▀▀ \n▓ ▓ ▓ ▓ ▄ ▓ ▓ \n▀▀▀ ▀▀ ▀▀▀ ▀ \n`,\n 'background: #222; color: #bada55'\n)\n\nexport default async function bootstrap() {\n /* set board-modeller group and default templates */\n registerDefaultGroups()\n\n await setupAppToolPart({\n toolbar: true,\n busybar: true,\n mdibar: false\n })\n\n await setupContextUIPart({\n titlebar: 'header',\n contextToolbar: 'page-footer'\n })\n\n /* append top-menu to layout */\n var state = store.getState() as any\n var width = state.layout?.width || 'WIDE'\n\n appendViewpart({\n name: 'dcsp-topmenu',\n viewpart: {\n show: true,\n template: html` <menu-tools></menu-tools> `\n },\n position: width == 'WIDE' ? VIEWPART_POSITION.NAVBAR : VIEWPART_POSITION.FOOTERBAR\n })\n\n store.subscribe(async () => {\n var state = store.getState() as any\n\n if (state.layout.width == width) {\n return\n }\n\n width = state.layout.width\n\n updateViewpart('dcsp-topmenu', {\n position: width == 'WIDE' ? VIEWPART_POSITION.NAVBAR : VIEWPART_POSITION.FOOTERBAR,\n level: VIEWPART_LEVEL.TOPMOST\n })\n })\n\n /* setting app-tools */\n store.dispatch({\n type: APPEND_APP_TOOL,\n tool: {\n name: 'app-brand',\n template: html` <span style=\"font-size: 1.2em;\">CSL</span> `,\n position: TOOL_POSITION.FRONT\n }\n })\n\n store.dispatch({\n type: APPEND_APP_TOOL,\n tool: {\n name: 'notification-badge',\n template: html`\n <notification-badge\n @click=${e => {\n toggleOverlay('notification', {\n backdrop: true\n })\n }}\n >\n </notification-badge>\n `,\n position: TOOL_POSITION.REAR\n }\n })\n\n appendViewpart({\n name: 'notification',\n viewpart: {\n show: false,\n hovering: 'edge',\n template: html` <notification-list style=\"min-width: 300px;\"></notification-list> `\n },\n position: VIEWPART_POSITION.ASIDEBAR\n })\n\n /* add setting morenda */\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>settings</md-icon> `,\n name: html` <ox-i18n msgid=\"label.setting\"></ox-i18n> `,\n action: () => {\n navigate('setting')\n }\n }\n })\n\n /* set auth management menus into more-panel */\n setAuthManagementMenus()\n\n if (\n await hasPrivilege({\n privilege: 'mutation',\n category: 'user',\n domainOwnerGranted: true,\n superUserGranted: true\n })\n ) {\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>vpn_key</md-icon> `,\n name: html` <ox-i18n msgid=\"text.oauth2-clients\"></ox-i18n> `,\n action: () => {\n navigate('oauth2-clients')\n }\n }\n })\n }\n\n if (\n await hasPrivilege({\n privilege: 'mutation',\n category: 'board',\n domainOwnerGranted: true,\n superUserGranted: true\n })\n ) {\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>font_download</md-icon> `,\n name: html` <ox-i18n msgid=\"menu.fonts\"></ox-i18n> `,\n action: () => {\n navigate('font-list')\n }\n }\n })\n\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>dvr</md-icon> `,\n name: html` <ox-i18n msgid=\"menu.board-list\"></ox-i18n> `,\n action: () => {\n navigate('board-list')\n }\n }\n })\n }\n\n if (\n await hasPrivilege({\n privilege: 'query',\n category: 'attachment',\n domainOwnerGranted: true,\n superUserGranted: true\n })\n ) {\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>attachment</md-icon> `,\n name: html` <ox-i18n msgid=\"menu.attachments\"></ox-i18n> `,\n action: () => {\n navigate('attachment-list')\n }\n }\n })\n }\n\n if (await hasPrivilege({ privilege: 'mutation', category: 'scenario', domainOwnerGranted: true })) {\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>dashboard</md-icon> `,\n name: html` <ox-i18n msgid=\"menu.board-template\"></ox-i18n> `,\n action: () => {\n navigate('board-template-list')\n }\n }\n })\n }\n\n store.dispatch({\n type: ADD_SETTING,\n setting: {\n seq: 10,\n template: html` <theme-mode-setting-let></theme-mode-setting-let> `\n }\n })\n\n store.dispatch({\n type: ADD_SETTING,\n setting: {\n seq: 20,\n template: html` <notification-setting-let></notification-setting-let> `\n }\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,0CAA0C,CAAA,CAAC,kCAAkC;AACpF,OAAO,wCAAwC,CAAA,CAAC,gCAAgC;AAEhF,OAAO,4BAA4B,CAAA;AACnC,OAAO,0BAA0B,CAAA;AACjC,OAAO,8BAA8B,CAAA;AACrC,OAAO,yBAAyB,CAAA;AAChC,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEhD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACjI,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAA;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,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b,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE;gBACP,IAAI,EAAE,IAAI,CAAA,0BAA0B;gBACpC,IAAI,EAAE,IAAI,CAAA,oEAAoE;gBAC9E,MAAM,EAAE,GAAG,EAAE;oBACX,QAAQ,CAAC,sBAAsB,CAAC,CAAA;gBAClC,CAAC;aACF;SACF,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,MAAM,YAAY,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QACxG,KAAK,CAAC,QAAQ,CAAC;YACb,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE;gBACP,IAAI,EAAE,IAAI,CAAA,uCAAuC;gBACjD,IAAI,EAAE,IAAI,CAAA,oDAAoD;gBAC9D,MAAM,EAAE,GAAG,EAAE;oBACX,QAAQ,CAAC,qBAAqB,CAAC,CAAA;gBACjC,CAAC;aACF;SACF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC;QACb,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE;YACP,GAAG,EAAE,EAAE;YACP,QAAQ,EAAE,IAAI,CAAA,qDAAqD;SACpE;KACF,CAAC,CAAA;IAEF,KAAK,CAAC,QAAQ,CAAC;QACb,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE;YACP,GAAG,EAAE,EAAE;YACP,QAAQ,EAAE,IAAI,CAAA,yDAAyD;SACxE;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import '@things-factory/notification/dist-client' /* for notification-setting-let */\nimport '@things-factory/setting-ui/dist-client' /* for theme-mode-setting-let */\n\nimport '@material/web/icon/icon.js'\nimport '@operato/i18n/ox-i18n.js'\nimport '@things-factory/notification'\nimport './viewparts/user-circle'\nimport './viewparts/menu-tools'\n\nimport { html } from 'lit-html'\n\nimport { registerDefaultGroups } from '@operato/board'\nimport { navigate, store } from '@operato/shell'\n\nimport { appendViewpart, updateViewpart, toggleOverlay, TOOL_POSITION, VIEWPART_POSITION, VIEWPART_LEVEL } from '@operato/layout'\nimport { APPEND_APP_TOOL } from '@things-factory/apptool-base/client'\nimport { setupAppToolPart } from '@things-factory/apptool-ui/dist-client'\nimport { setupContextUIPart } from '@things-factory/context-ui/dist-client'\nimport { hasPrivilege } from '@things-factory/auth-base/dist-client'\nimport { setAuthManagementMenus } from '@things-factory/auth-ui/dist-client'\nimport { ADD_MORENDA } from '@things-factory/more-base/client'\nimport { ADD_SETTING } from '@things-factory/setting-base/dist-client'\n\nconsole.log(\n `%c\n▄▄▄ ▄▄ ▄▄▄ ▄▄▄ \n▓ ▓ ▓ ▓ ▓ ▀ ▓ ▓ \n▓ ▓ ▓ ▀▀▄▄ ▓▀▀ \n▓ ▓ ▓ ▓ ▄ ▓ ▓ \n▀▀▀ ▀▀ ▀▀▀ ▀ \n`,\n 'background: #222; color: #bada55'\n)\n\nexport default async function bootstrap() {\n /* set board-modeller group and default templates */\n registerDefaultGroups()\n\n await setupAppToolPart({\n toolbar: true,\n busybar: true,\n mdibar: false\n })\n\n await setupContextUIPart({\n titlebar: 'header',\n contextToolbar: 'page-footer'\n })\n\n /* append top-menu to layout */\n var state = store.getState() as any\n var width = state.layout?.width || 'WIDE'\n\n appendViewpart({\n name: 'dcsp-topmenu',\n viewpart: {\n show: true,\n template: html` <menu-tools></menu-tools> `\n },\n position: width == 'WIDE' ? VIEWPART_POSITION.NAVBAR : VIEWPART_POSITION.FOOTERBAR\n })\n\n store.subscribe(async () => {\n var state = store.getState() as any\n\n if (state.layout.width == width) {\n return\n }\n\n width = state.layout.width\n\n updateViewpart('dcsp-topmenu', {\n position: width == 'WIDE' ? VIEWPART_POSITION.NAVBAR : VIEWPART_POSITION.FOOTERBAR,\n level: VIEWPART_LEVEL.TOPMOST\n })\n })\n\n /* setting app-tools */\n store.dispatch({\n type: APPEND_APP_TOOL,\n tool: {\n name: 'app-brand',\n template: html` <span style=\"font-size: 1.2em;\">CSP</span> `,\n position: TOOL_POSITION.FRONT\n }\n })\n\n store.dispatch({\n type: APPEND_APP_TOOL,\n tool: {\n name: 'notification-badge',\n template: html`\n <notification-badge\n @click=${e => {\n toggleOverlay('notification', {\n backdrop: true\n })\n }}\n >\n </notification-badge>\n `,\n position: TOOL_POSITION.REAR\n }\n })\n\n appendViewpart({\n name: 'notification',\n viewpart: {\n show: false,\n hovering: 'edge',\n template: html` <notification-list style=\"min-width: 300px;\"></notification-list> `\n },\n position: VIEWPART_POSITION.ASIDEBAR\n })\n\n /* add setting morenda */\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>settings</md-icon> `,\n name: html` <ox-i18n msgid=\"label.setting\"></ox-i18n> `,\n action: () => {\n navigate('setting')\n }\n }\n })\n\n /* set auth management menus into more-panel */\n setAuthManagementMenus()\n\n if (\n await hasPrivilege({\n privilege: 'mutation',\n category: 'user',\n domainOwnerGranted: true,\n superUserGranted: true\n })\n ) {\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>vpn_key</md-icon> `,\n name: html` <ox-i18n msgid=\"text.oauth2-clients\"></ox-i18n> `,\n action: () => {\n navigate('oauth2-clients')\n }\n }\n })\n }\n\n if (\n await hasPrivilege({\n privilege: 'mutation',\n category: 'board',\n domainOwnerGranted: true,\n superUserGranted: true\n })\n ) {\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>font_download</md-icon> `,\n name: html` <ox-i18n msgid=\"menu.fonts\"></ox-i18n> `,\n action: () => {\n navigate('font-list')\n }\n }\n })\n\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>dvr</md-icon> `,\n name: html` <ox-i18n msgid=\"menu.board-list\"></ox-i18n> `,\n action: () => {\n navigate('board-list')\n }\n }\n })\n }\n\n if (\n await hasPrivilege({\n privilege: 'query',\n category: 'attachment',\n domainOwnerGranted: true,\n superUserGranted: true\n })\n ) {\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>attachment</md-icon> `,\n name: html` <ox-i18n msgid=\"menu.attachments\"></ox-i18n> `,\n action: () => {\n navigate('attachment-list')\n }\n }\n })\n }\n\n if (await hasPrivilege({ privilege: 'mutation', category: 'scenario', domainOwnerGranted: true })) {\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>dashboard</md-icon> `,\n name: html` <ox-i18n msgid=\"menu.board-template\"></ox-i18n> `,\n action: () => {\n navigate('board-template-list')\n }\n }\n })\n }\n if (\n await hasPrivilege({\n privilege: 'mutation',\n category: 'scenario',\n domainOwnerGranted: true,\n superUserGranted: true\n })\n ) {\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>device_hub</md-icon> `,\n name: html` <ox-i18n msgid=\"text.connection\"></ox-i18n> `,\n action: () => {\n navigate('connection')\n }\n }\n })\n\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>format_list_numbered</md-icon> `,\n name: html` <ox-i18n msgid=\"text.scenario\"></ox-i18n> `,\n action: () => {\n navigate('scenario')\n }\n }\n })\n\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>hub</md-icon> `,\n name: html` <ox-i18n msgid=\"text.integration analysis\"></ox-i18n> (beta)`,\n action: () => {\n navigate('integration-analysis')\n }\n }\n })\n }\n\n if (await hasPrivilege({ privilege: 'mutation', category: 'state-register', domainOwnerGranted: true })) {\n store.dispatch({\n type: ADD_MORENDA,\n morenda: {\n icon: html` <md-icon>app_registration</md-icon> `,\n name: html` <ox-i18n msgid=\"title.state-register\"></ox-i18n> `,\n action: () => {\n navigate('state-register-page')\n }\n }\n })\n }\n\n store.dispatch({\n type: ADD_SETTING,\n setting: {\n seq: 10,\n template: html` <theme-mode-setting-let></theme-mode-setting-let> `\n }\n })\n\n store.dispatch({\n type: ADD_SETTING,\n setting: {\n seq: 20,\n template: html` <notification-setting-let></notification-setting-let> `\n }\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"home.js","sourceRoot":"","sources":["../../../client/entries/public/home.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAG1C,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IA+DtC,MAAM;QACJ,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,eAAe,CAAA;QAEjD,OAAO,IAAI,CAAA;;kBAEG,KAAK;UACb,WAAW;;;;;;+BAMU,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,cAAc,CAAC;KACtE,CAAA;IACH,CAAC;IAED,IAAI,eAAe;QACjB,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;
|
|
1
|
+
{"version":3,"file":"home.js","sourceRoot":"","sources":["../../../client/entries/public/home.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAG1C,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IA+DtC,MAAM;QACJ,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,eAAe,CAAA;QAEjD,OAAO,IAAI,CAAA;;kBAEG,KAAK;UACb,WAAW;;;;;;+BAMU,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,cAAc,CAAC;KACtE,CAAA;IACH,CAAC;IAED,IAAI,eAAe;QACjB,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC3B,IAAI,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,8BAA8B,CAAoB,CAAA;YACxF,IAAI,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,+BAA+B,CAAoB,CAAA;YAC1F,IAAI,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAC,sCAAsC,CAAoB,CAAA;YAEvG,IAAI,CAAC,gBAAgB,GAAG;gBACtB,IAAI,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI;gBACpB,KAAK,EAAE,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,KAAI,gBAAgB;gBAC7C,WAAW,EAAE,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,OAAO,KAAI,sBAAsB;aAChE,CAAA;QACH,CAAC;QAED,OAAO,IAAI,CAAC,gBAAgB,CAAA;IAC9B,CAAC;;AA5FM,eAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwDF;CACF,AA1DY,CA0DZ;AA3DU,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CA8FpB","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('home-page')\nexport class HomePage extends LitElement {\n static styles = [\n css`\n :host {\n background-color: var(--md-sys-color-background);\n\n display: block;\n position: relative;\n\n max-width: 100vw;\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n }\n\n [signin] {\n position: absolute;\n right: 20px;\n top: 20px;\n font-size: 2em;\n color: white;\n }\n\n [message] {\n background-color: rgba(50, 66, 97, 0.8);\n padding: 60px 50px 0 50px;\n color: #fff;\n text-align: center;\n font-size: 20px;\n }\n\n [message] strong {\n display: block;\n font-size: 2.5rem;\n }\n\n video {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 100vw;\n height: 100vh;\n object-fit: cover;\n transform: translate(-50%, -50%);\n }\n\n @media screen and (max-width: 480px) {\n [message] {\n padding: 60px 30px 0 30px;\n color: #fff;\n text-align: center;\n font-size: 15px;\n }\n\n [message] strong {\n font-size: 1.6rem;\n }\n }\n `\n ]\n\n private _applicationMeta\n\n render() {\n var { title, description } = this.applicationMeta\n\n return html`\n <div message>\n <strong>${title}</strong>\n ${description}\n <video autoplay muted playsinline loop>\n <source src=\"/assets/videos/intro.mp4\" type=\"video/mp4\" />\n </video>\n </div>\n\n <md-icon signin @click=${e => (window.location.href = '/auth/signin')}>login</md-icon>\n `\n }\n\n get applicationMeta() {\n if (!this._applicationMeta) {\n var iconLink = document.querySelector('link[rel=\"application-icon\"]') as HTMLLinkElement\n var titleMeta = document.querySelector('meta[name=\"application-name\"]') as HTMLMetaElement\n var descriptionMeta = document.querySelector('meta[name=\"application-description\"]') as HTMLMetaElement\n\n this._applicationMeta = {\n icon: iconLink?.href,\n title: titleMeta?.content || 'Things Factory',\n description: descriptionMeta?.content || 'Reimagining Software'\n }\n }\n\n return this._applicationMeta\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sv-user-management.js","sourceRoot":"","sources":["../../client/pages/sv-user-management.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,8BAA8B,CAAA;AACrC,OAAO,yEAAyE,CAAA;AAChF,OAAO,iEAAiE,CAAA;AACxE,OAAO,4DAA4D,CAAA;AAEnE,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,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,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,QAAQ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;AAvMM,uBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;KAcF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;qDAAwB;AAClD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CAAW;AACtC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAwB;AACnD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;4DAAoC;AAChE;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;uDAA+B;AAE3D;IAAC,KAAK,CAAC,YAAY,CAAC;;yDAAsD;AAzBtE,gBAAgB;IADrB,aAAa,CAAC,oBAAoB,CAAC;GAC9B,gBAAgB,CAyMrB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@things-factory/component-ui'\nimport '@things-factory/auth-ui/dist-client/components/ownership-transfer-popup'\nimport '@things-factory/auth-ui/dist-client/components/user-role-editor'\nimport '@things-factory/auth-ui/dist-client/components/create-user'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { PageView } from '@operato/shell'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\n\n@customElement('sv-user-management')\nclass SVUserManagement extends PageView {\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\n @media screen and (max-width: 600px) {\n :host {\n padding: var(--padding-narrow);\n }\n }\n `\n ]\n\n @property({ type: Array }) domainUsers: any[] = []\n @property({ type: Object }) owner: any\n @property({ type: String }) currentTab: string = ''\n @property({ type: Boolean }) passwordResettable: boolean = false\n @property({ type: Boolean }) userCreatable: boolean = false\n\n @query('#user-list') userListElement!: HTMLElement & { close: () => void }\n\n get context() {\n return {\n title: i18next.t('text.user management'),\n help: 'auth/users'\n }\n }\n\n render() {\n const groupingUser = (this.domainUsers || []).reduce(\n (groupingUser, user) => {\n const userType = user.userType\n if (!groupingUser[userType]) {\n groupingUser[userType] = []\n }\n user.activated = user.status === 'activated'\n groupingUser[userType].push(user)\n\n return groupingUser\n },\n {\n admin: [],\n user: [],\n application: [],\n appliance: []\n }\n )\n\n const USER_TYPES = {\n USER: i18next.t('label.user'),\n APPLICATION: i18next.t('label.application'),\n APPLIANCE: i18next.t('text.appliance')\n }\n\n const userSet = {\n [USER_TYPES.USER]: [...groupingUser.user, ...groupingUser.admin],\n [USER_TYPES.APPLICATION]: groupingUser.application,\n [USER_TYPES.APPLIANCE]: groupingUser.appliance\n }\n\n return html`\n ${this.userCreatable\n ? html`<create-user\n @create-user=${async event => {\n const user = event.detail\n user.userType = 'user'\n\n await this.createUser(user)\n }}\n ></create-user>`\n : ''}\n <quick-find-list\n id=\"user-list\"\n .data=${userSet}\n @tabChanged=${e => (this.currentTab = e.detail.currentTabKey)}\n .headerRenderer=${user => {\n return html`\n ${!user.activated\n ? html`\n <md-icon>do_disturb</md-icon>\n ${user.name}\n `\n : html` ${user.owner ? html` <md-icon>supervisor_account</md-icon> ` : ''} ${user.name} `}\n `\n }}\n .contentRenderer=${user =>\n html` <user-role-editor\n .user=${user}\n .domainOwner=${this.owner}\n .activate=${user.activated}\n @userUpdated=${this.refreshUsers.bind(this)}\n @ownershipTransferred=${this.refreshUsers.bind(this)}\n .passwordResettable=${this.passwordResettable}\n ></user-role-editor>`}\n ></quick-find-list>\n `\n }\n\n async pageUpdated(changes, lifecycle, before) {\n if (this.active) {\n this.refreshUsers()\n this.checkPasswordResettable()\n this.checkUserCreatable()\n }\n }\n\n async refreshUsers() {\n const domainUsersResp = await client.query({\n query: gql`\n query {\n users {\n items {\n id\n name\n email\n userType\n status\n owner\n }\n }\n }\n `,\n context: gqlContext()\n })\n\n if (!domainUsersResp.errors?.length) {\n this.domainUsers = domainUsersResp.data.users.items || []\n this.owner = this.domainUsers.filter(user => user.owner)[0] || {}\n this.userListElement?.close()\n }\n }\n\n async checkPasswordResettable() {\n const response = await client.query({\n query: gql`\n query {\n checkResettablePasswordToDefault\n }\n `\n })\n\n if (!response.errors) {\n this.passwordResettable = response.data.checkResettablePasswordToDefault\n }\n }\n\n async checkUserCreatable() {\n const response = await client.query({\n query: gql`\n query {\n checkDefaultPassword\n }\n `\n })\n\n if (!response.errors) {\n this.userCreatable = response.data.checkDefaultPassword\n }\n }\n\n async createUser(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_user', { x: i18next.t('button.create') }),\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 createUser($user: NewUser!) {\n createUser(user: $user) {\n name\n }\n }\n `,\n variables: { user },\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 await this.refreshUsers()\n }\n }\n }\n\n showToast(message) {\n document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }))\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sv-user-management.js","sourceRoot":"","sources":["../../client/pages/sv-user-management.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,8BAA8B,CAAA;AACrC,OAAO,yEAAyE,CAAA;AAChF,OAAO,iEAAiE,CAAA;AACxE,OAAO,4DAA4D,CAAA;AAEnE,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,MAAM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AAS,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;;AAvMM,uBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;KAcF;CACF,AAhBY,CAgBZ;AAE0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;qDAAwB;AACtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CAAW;AACV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAwB;AACtB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;4DAAoC;AACnC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;uDAA+B;AAEtC;IAApB,KAAK,CAAC,YAAY,CAAC;;yDAAsD;AAzBtE,gBAAgB;IADrB,aAAa,CAAC,oBAAoB,CAAC;GAC9B,gBAAgB,CAyMrB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@things-factory/component-ui'\nimport '@things-factory/auth-ui/dist-client/components/ownership-transfer-popup'\nimport '@things-factory/auth-ui/dist-client/components/user-role-editor'\nimport '@things-factory/auth-ui/dist-client/components/create-user'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { client, gqlContext } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { PageView } from '@operato/shell'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\n\n@customElement('sv-user-management')\nclass SVUserManagement extends PageView {\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\n @media screen and (max-width: 600px) {\n :host {\n padding: var(--padding-narrow);\n }\n }\n `\n ]\n\n @property({ type: Array }) domainUsers: any[] = []\n @property({ type: Object }) owner: any\n @property({ type: String }) currentTab: string = ''\n @property({ type: Boolean }) passwordResettable: boolean = false\n @property({ type: Boolean }) userCreatable: boolean = false\n\n @query('#user-list') userListElement!: HTMLElement & { close: () => void }\n\n get context() {\n return {\n title: i18next.t('text.user management'),\n help: 'auth/users'\n }\n }\n\n render() {\n const groupingUser = (this.domainUsers || []).reduce(\n (groupingUser, user) => {\n const userType = user.userType\n if (!groupingUser[userType]) {\n groupingUser[userType] = []\n }\n user.activated = user.status === 'activated'\n groupingUser[userType].push(user)\n\n return groupingUser\n },\n {\n admin: [],\n user: [],\n application: [],\n appliance: []\n }\n )\n\n const USER_TYPES = {\n USER: i18next.t('label.user'),\n APPLICATION: i18next.t('label.application'),\n APPLIANCE: i18next.t('text.appliance')\n }\n\n const userSet = {\n [USER_TYPES.USER]: [...groupingUser.user, ...groupingUser.admin],\n [USER_TYPES.APPLICATION]: groupingUser.application,\n [USER_TYPES.APPLIANCE]: groupingUser.appliance\n }\n\n return html`\n ${this.userCreatable\n ? html`<create-user\n @create-user=${async event => {\n const user = event.detail\n user.userType = 'user'\n\n await this.createUser(user)\n }}\n ></create-user>`\n : ''}\n <quick-find-list\n id=\"user-list\"\n .data=${userSet}\n @tabChanged=${e => (this.currentTab = e.detail.currentTabKey)}\n .headerRenderer=${user => {\n return html`\n ${!user.activated\n ? html`\n <md-icon>do_disturb</md-icon>\n ${user.name}\n `\n : html` ${user.owner ? html` <md-icon>supervisor_account</md-icon> ` : ''} ${user.name} `}\n `\n }}\n .contentRenderer=${user =>\n html` <user-role-editor\n .user=${user}\n .domainOwner=${this.owner}\n .activate=${user.activated}\n @userUpdated=${this.refreshUsers.bind(this)}\n @ownershipTransferred=${this.refreshUsers.bind(this)}\n .passwordResettable=${this.passwordResettable}\n ></user-role-editor>`}\n ></quick-find-list>\n `\n }\n\n async pageUpdated(changes, lifecycle, before) {\n if (this.active) {\n this.refreshUsers()\n this.checkPasswordResettable()\n this.checkUserCreatable()\n }\n }\n\n async refreshUsers() {\n const domainUsersResp = await client.query({\n query: gql`\n query {\n users {\n items {\n id\n name\n email\n userType\n status\n owner\n }\n }\n }\n `,\n context: gqlContext()\n })\n\n if (!domainUsersResp.errors?.length) {\n this.domainUsers = domainUsersResp.data.users.items || []\n this.owner = this.domainUsers.filter(user => user.owner)[0] || {}\n this.userListElement?.close()\n }\n }\n\n async checkPasswordResettable() {\n const response = await client.query({\n query: gql`\n query {\n checkResettablePasswordToDefault\n }\n `\n })\n\n if (!response.errors) {\n this.passwordResettable = response.data.checkResettablePasswordToDefault\n }\n }\n\n async checkUserCreatable() {\n const response = await client.query({\n query: gql`\n query {\n checkDefaultPassword\n }\n `\n })\n\n if (!response.errors) {\n this.userCreatable = response.data.checkDefaultPassword\n }\n }\n\n async createUser(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_user', { x: i18next.t('button.create') }),\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 createUser($user: NewUser!) {\n createUser(user: $user) {\n name\n }\n }\n `,\n variables: { user },\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 await this.refreshUsers()\n }\n }\n }\n\n showToast(message) {\n document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }))\n }\n}\n"]}
|
package/dist-client/route.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../client/route.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAY;IACxC,QAAQ,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../client/route.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAY;IACxC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,EAAE;YACL,OAAO,YAAY,CAAA;QAErB,KAAK,OAAO;YACV,MAAM,CAAC,4BAA4B,CAAC,CAAA;YACpC,OAAO,IAAI,CAAA;IACf,CAAC;AACH,CAAC","sourcesContent":["export default function route(page: string) {\n switch (page) {\n case '':\n return '/dashboard'\n\n case 'users':\n import('./pages/sv-user-management')\n return page\n }\n}\n"]}
|