@dssp/dkpi 1.0.0-alpha.10

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 (76) hide show
  1. package/.dockerignore +31 -0
  2. package/CHANGELOG.md +8 -0
  3. package/Dockerfile +16 -0
  4. package/_index.html +70 -0
  5. package/assets/favicon.ico +0 -0
  6. package/assets/helps/index.md +1 -0
  7. package/assets/images/hatiolab-logo.png +0 -0
  8. package/assets/images/spinner.png +0 -0
  9. package/assets/images/user.png +0 -0
  10. package/assets/manifest/apple-1024.png +0 -0
  11. package/assets/manifest/apple-120.png +0 -0
  12. package/assets/manifest/apple-152.png +0 -0
  13. package/assets/manifest/apple-167.png +0 -0
  14. package/assets/manifest/apple-180.png +0 -0
  15. package/assets/manifest/apple-touch-icon.png +0 -0
  16. package/assets/manifest/badge-128x128.png +0 -0
  17. package/assets/manifest/chrome-splashscreen-icon-384x384.png +0 -0
  18. package/assets/manifest/chrome-touch-icon-192x192.png +0 -0
  19. package/assets/manifest/icon-128x128.png +0 -0
  20. package/assets/manifest/icon-192x192.png +0 -0
  21. package/assets/manifest/icon-512x512.png +0 -0
  22. package/assets/manifest/icon-72x72.png +0 -0
  23. package/assets/manifest/icon-96x96.png +0 -0
  24. package/assets/manifest/image-metaog.png +0 -0
  25. package/assets/manifest/maskable_icon.png +0 -0
  26. package/assets/manifest/ms-icon-144x144.png +0 -0
  27. package/assets/manifest/ms-touch-icon-144x144-precomposed.png +0 -0
  28. package/assets/manifest.json +27 -0
  29. package/assets/videos/intro.mp4 +0 -0
  30. package/config/config.development.js +49 -0
  31. package/config/config.production.js +83 -0
  32. package/dist-client/bootstrap.d.ts +8 -0
  33. package/dist-client/bootstrap.js +244 -0
  34. package/dist-client/bootstrap.js.map +1 -0
  35. package/dist-client/entries/public/home.d.ts +8 -0
  36. package/dist-client/entries/public/home.js +97 -0
  37. package/dist-client/entries/public/home.js.map +1 -0
  38. package/dist-client/icons/menu-icons.d.ts +5 -0
  39. package/dist-client/icons/menu-icons.js +84 -0
  40. package/dist-client/icons/menu-icons.js.map +1 -0
  41. package/dist-client/index.d.ts +0 -0
  42. package/dist-client/index.js +2 -0
  43. package/dist-client/index.js.map +1 -0
  44. package/dist-client/menu.d.ts +23 -0
  45. package/dist-client/menu.js +59 -0
  46. package/dist-client/menu.js.map +1 -0
  47. package/dist-client/pages/sv-user-management.d.ts +5 -0
  48. package/dist-client/pages/sv-user-management.js +219 -0
  49. package/dist-client/pages/sv-user-management.js.map +1 -0
  50. package/dist-client/route.d.ts +1 -0
  51. package/dist-client/route.js +10 -0
  52. package/dist-client/route.js.map +1 -0
  53. package/dist-client/themes/dark.css +51 -0
  54. package/dist-client/themes/light.css +51 -0
  55. package/dist-client/tsconfig.tsbuildinfo +1 -0
  56. package/dist-client/viewparts/menu-tools.d.ts +27 -0
  57. package/dist-client/viewparts/menu-tools.js +289 -0
  58. package/dist-client/viewparts/menu-tools.js.map +1 -0
  59. package/dist-client/viewparts/user-circle.d.ts +5 -0
  60. package/dist-client/viewparts/user-circle.js +26 -0
  61. package/dist-client/viewparts/user-circle.js.map +1 -0
  62. package/dist-server/index.d.ts +0 -0
  63. package/dist-server/index.js +1 -0
  64. package/dist-server/index.js.map +1 -0
  65. package/dist-server/tsconfig.tsbuildinfo +1 -0
  66. package/openapi/unstable.yaml +41 -0
  67. package/package.json +97 -0
  68. package/schema.graphql +11572 -0
  69. package/things-factory.config.js +8 -0
  70. package/translations/en.json +3 -0
  71. package/translations/ja.json +3 -0
  72. package/translations/ko.json +3 -0
  73. package/translations/ms.json +3 -0
  74. package/translations/zh.json +3 -0
  75. package/views/auth-page.html +82 -0
  76. package/views/public/home.html +72 -0
@@ -0,0 +1,97 @@
1
+ import { __decorate } from "tslib";
2
+ import '@material/web/icon/icon.js';
3
+ import { css, html, LitElement } from 'lit';
4
+ import { customElement } from 'lit/decorators.js';
5
+ let HomePage = class HomePage extends LitElement {
6
+ render() {
7
+ var { title, description } = this.applicationMeta;
8
+ return html `
9
+ <div message>
10
+ <strong>${title}</strong>
11
+ ${description}
12
+ <video autoplay muted playsinline loop>
13
+ <source src="/assets/videos/intro.mp4" type="video/mp4" />
14
+ </video>
15
+ </div>
16
+
17
+ <md-icon signin @click=${e => (window.location.href = '/auth/signin')}>login</md-icon>
18
+ `;
19
+ }
20
+ get applicationMeta() {
21
+ if (!this._applicationMeta) {
22
+ var iconLink = document.querySelector('link[rel="application-icon"]');
23
+ var titleMeta = document.querySelector('meta[name="application-name"]');
24
+ var descriptionMeta = document.querySelector('meta[name="application-description"]');
25
+ this._applicationMeta = {
26
+ icon: iconLink === null || iconLink === void 0 ? void 0 : iconLink.href,
27
+ title: (titleMeta === null || titleMeta === void 0 ? void 0 : titleMeta.content) || 'Things Factory',
28
+ description: (descriptionMeta === null || descriptionMeta === void 0 ? void 0 : descriptionMeta.content) || 'Reimagining Software'
29
+ };
30
+ }
31
+ return this._applicationMeta;
32
+ }
33
+ };
34
+ HomePage.styles = [
35
+ css `
36
+ :host {
37
+ background-color: var(--md-sys-color-background);
38
+
39
+ display: block;
40
+ position: relative;
41
+
42
+ max-width: 100vw;
43
+ width: 100vw;
44
+ height: 100vh;
45
+ height: 100dvh;
46
+ }
47
+
48
+ [signin] {
49
+ position: absolute;
50
+ right: 20px;
51
+ top: 20px;
52
+ font-size: 2em;
53
+ color: white;
54
+ }
55
+
56
+ [message] {
57
+ background-color: rgba(50, 66, 97, 0.8);
58
+ padding: 60px 50px 0 50px;
59
+ color: #fff;
60
+ text-align: center;
61
+ font-size: 20px;
62
+ }
63
+
64
+ [message] strong {
65
+ display: block;
66
+ font-size: 2.5rem;
67
+ }
68
+
69
+ video {
70
+ position: absolute;
71
+ top: 50%;
72
+ left: 50%;
73
+ width: 100vw;
74
+ height: 100vh;
75
+ object-fit: cover;
76
+ transform: translate(-50%, -50%);
77
+ }
78
+
79
+ @media screen and (max-width: 480px) {
80
+ [message] {
81
+ padding: 60px 30px 0 30px;
82
+ color: #fff;
83
+ text-align: center;
84
+ font-size: 15px;
85
+ }
86
+
87
+ [message] strong {
88
+ font-size: 1.6rem;
89
+ }
90
+ }
91
+ `
92
+ ];
93
+ HomePage = __decorate([
94
+ customElement('home-page')
95
+ ], HomePage);
96
+ export { HomePage };
97
+ //# sourceMappingURL=home.js.map
@@ -0,0 +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,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"]}
@@ -0,0 +1,5 @@
1
+ export declare const ICONS_HOME: string[];
2
+ export declare const ICONS_KPIS: string[];
3
+ export declare const ICONS_STATUS: string[];
4
+ export declare const ICONS_INTEGRATION: string[];
5
+ export declare const ICONS_SETTING: string[];
@@ -0,0 +1,84 @@
1
+ const ICON_HOME = `
2
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 40 40">
3
+ <defs>
4
+ <style>
5
+ .menu-svg {
6
+ fill: #fff;
7
+ stroke: {{strokecolor}};
8
+ stroke-width: 0px;
9
+ }
10
+ </style>
11
+ </defs>
12
+
13
+ <path class="menu-svg" d="M31,36.5c-.2,0-.4,0-.6,0-.2,0-.3-.2-.5-.3l-8.3-8.3c-.2-.2-.3-.3-.3-.5,0-.2,0-.4,0-.6s0-.4,0-.6c0-.2.2-.3.3-.5l3.1-3.1c.2-.2.3-.3.5-.3.2,0,.4,0,.6,0s.4,0,.6,0c.2,0,.3.2.5.3l8.3,8.3c.2.2.3.3.3.5,0,.2,0,.4,0,.6s0,.4,0,.6c0,.2-.2.3-.3.5l-3.1,3.1c-.2.2-.3.3-.5.3-.2,0-.4,0-.6,0ZM31,33.6l1.8-1.8-6.9-6.9-1.8,1.8,6.9,6.9ZM8.9,36.5c-.2,0-.4,0-.6-.1-.2,0-.3-.2-.5-.3l-3.1-3.1c-.2-.2-.3-.3-.3-.5,0-.2-.1-.4-.1-.6s0-.4.1-.6c0-.2.2-.3.3-.5l8.6-8.6h3.5l1.3-1.3-6.9-6.9h-2.4l-4.6-4.6,4.1-4.1,4.6,4.6v2.4l6.9,6.9,4.9-4.9-2.4-2.4,2.1-2.1h-4.2l-.9-.9,5.3-5.3.9.9v4.2l2.1-2.1,6.2,6.2c.4.4.8.9,1,1.5.2.5.3,1.1.3,1.7s0,1-.3,1.5c-.2.5-.5.9-.8,1.4l-3.5-3.5-2.3,2.3-1.8-1.8-8,8v3.5l-8.6,8.6c-.2.2-.3.3-.5.3-.2,0-.4.1-.6.1ZM8.9,33.6l7.6-7.6v-1.8h-1.8l-7.6,7.6,1.8,1.8ZM8.9,33.6l-1.8-1.8.9.9.9.9ZM31,33.6l1.8-1.8-1.8,1.8Z"/>
14
+ </svg>
15
+ `;
16
+ const ICON_KPIS = `
17
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 40 40">
18
+ <defs>
19
+ <style>
20
+ .menu-svg {
21
+ fill: #fff;
22
+ stroke: {{strokecolor}};
23
+ stroke-width: 0px;
24
+ }
25
+ </style>
26
+ </defs>
27
+
28
+ <path class="menu-svg" d="M27.9,15.1h2.7v-2.8h-2.7v2.8ZM27.9,21.4h2.7v-2.8h-2.7v2.8ZM27.9,27.7h2.7v-2.8h-2.7v2.8ZM26.9,33.3v-2.4h6.9V9h-14.2v2.8l-2.3-1.7v-3.5h18.7v26.7s-9.1,0-9.1,0ZM4,33.3v-14.5l9.9-7.3,9.9,7.3v14.5h-8.1v-7.5h-3.5v7.5H4ZM6.3,31h3.6v-7.5h8v7.5h3.6v-11l-7.7-5.5-7.7,5.5v11h0ZM18,31v-7.5h-8v7.5-7.5h8v7.5Z"/>
29
+ </svg>
30
+ `;
31
+ const ICON_STATUS = `
32
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 40 40">
33
+ <defs>
34
+ <style>
35
+ .menu-svg {
36
+ fill: #fff;
37
+ stroke: {{strokecolor}};
38
+ stroke-width: 0px;
39
+ }
40
+ </style>
41
+ </defs>
42
+
43
+ <path class="menu-svg" d="M7.4,33.9c-.8,0-1.5-.3-2.1-.8-.6-.6-.8-1.3-.8-2.1V9c0-.8.3-1.5.8-2.1.6-.6,1.3-.8,2.1-.8h25.2c.8,0,1.5.3,2.1.8s.8,1.3.8,2.1v21.9c0,.8-.3,1.5-.8,2.1s-1.3.8-2.1.8H7.4ZM7.4,31.4h25.2c0,0,.3,0,.4-.2,0,0,.2-.2.2-.4V9c0,0,0-.3-.2-.4,0,0-.2-.2-.4-.2H7.4c0,0-.3,0-.4.2,0,0-.2.2-.2.4v21.9c0,0,0,.3.2.4,0,0,.2.2.4.2h0ZM8.9,27.7h7.3v-2.4h-7.3v2.4ZM24.2,24.3l7.5-7.5-1.8-1.8-5.7,5.8-2.4-2.4-1.7,1.8s4.1,4.1,4.1,4.1ZM8.9,21.2h7.3v-2.4h-7.3v2.4ZM8.9,14.6h7.3v-2.4h-7.3s0,2.4,0,2.4ZM6.9,31.4V8.5v22.9Z"/>
44
+ </svg>
45
+ `;
46
+ const ICON_INTEGRATION = `
47
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 40 40">
48
+ <defs>
49
+ <style>
50
+ .menu-svg {
51
+ fill: #fff;
52
+ stroke: {{strokecolor}};
53
+ stroke-width: 0px;
54
+ }
55
+ </style>
56
+ </defs>
57
+
58
+ <path class="menu-svg" d="M9.1,35.5c-.8,0-1.5-.3-2.1-.8-.6-.6-.8-1.2-.8-2.1V10.9c0-.8.3-1.5.8-2.1.6-.6,1.2-.8,2.1-.8h2.3v-3.5h2.5v3.5h12.3v-3.5h2.4v3.5h2.3c.8,0,1.5.3,2.1.8.6.6.8,1.2.8,2.1v21.7c0,.8-.3,1.5-.8,2.1s-1.2.8-2.1.8c0,0-21.8,0-21.8,0ZM9.1,33.1h21.7c0,0,.3,0,.4-.2,0,0,.2-.2.2-.4v-15.2H8.5v15.2c0,0,0,.3.2.4,0,0,.2.2.4.2ZM8.5,14.9h22.7v-4c0,0,0-.3-.2-.4,0,0-.2-.2-.4-.2H9.1c0,0-.3,0-.4.2,0,0-.2.2-.2.4,0,0,0,4,0,4ZM8.5,14.9v-4.5,4.5ZM12.2,22.9v-2.4h15.4v2.4s-15.4,0-15.4,0ZM12.2,29.4v-2.4h10.5v2.4h-10.5Z"/>
59
+ </svg>
60
+ `;
61
+ const ICON_SETTING = `
62
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 40 40">
63
+ <defs>
64
+ <style>
65
+ .menu-svg {
66
+ fill: #fff;
67
+ stroke: {{strokecolor}};
68
+ stroke-width: 0px;
69
+ }
70
+ </style>
71
+ </defs>
72
+
73
+ <path class="menu-svg" d="M13.1,24.2h2v-5.7h-2v1.9h-2.4v2h2.4v1.9h0ZM16.7,22.3h12.8v-2h-12.8v2ZM25,18.1h2v-1.9h2.4v-2h-2.4v-1.9h-2v5.7h0ZM10.6,16.2h12.8v-2h-12.8v2ZM14.3,34v-3.3h-6.9c-.8,0-1.5-.3-2.1-.8s-.8-1.3-.8-2.1V8.9c0-.8.3-1.6.8-2.1.6-.5,1.3-.8,2.1-.8h25.2c.8,0,1.5.3,2.1.8s.8,1.3.8,2.1v18.8c0,.8-.3,1.6-.8,2.1-.6.5-1.3.8-2.1.8h-6.9v3.3h-11.5,0ZM7.5,28.2h25.2c0,0,.3,0,.4-.2,0,0,.2-.2.2-.4V8.9c0,0,0-.3-.2-.4,0,0-.2-.2-.4-.2H7.5c0,0-.3,0-.4.2,0,0-.2.2-.2.4v18.8c0,0,0,.3.2.4,0,0,.2.2.4.2h0ZM6.9,28.2V8.4v19.8Z"/>
74
+ </svg>
75
+ `;
76
+ function icons(template) {
77
+ return ['#ffffff', '#64A3D9'].map(color => 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(template.replace(/{{strokecolor}}/g, color)));
78
+ }
79
+ export const ICONS_HOME = icons(ICON_HOME);
80
+ export const ICONS_KPIS = icons(ICON_KPIS);
81
+ export const ICONS_STATUS = icons(ICON_STATUS);
82
+ export const ICONS_INTEGRATION = icons(ICON_INTEGRATION);
83
+ export const ICONS_SETTING = icons(ICON_SETTING);
84
+ //# sourceMappingURL=menu-icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-icons.js","sourceRoot":"","sources":["../../client/icons/menu-icons.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG;;;;;;;;;;;;;;CAcjB,CAAA;AAED,MAAM,SAAS,GAAG;;;;;;;;;;;;;;CAcjB,CAAA;AAED,MAAM,WAAW,GAAG;;;;;;;;;;;;;;CAcnB,CAAA;AAED,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;CAcxB,CAAA;AAED,MAAM,YAAY,GAAG;;;;;;;;;;;;;;CAcpB,CAAA;AAED,SAAS,KAAK,CAAC,QAAQ;IACrB,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,GAAG,CAC/B,KAAK,CAAC,EAAE,CAAC,0CAA0C,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC,CACxG,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,CAAA;AAC1C,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,CAAA;AAC1C,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,CAAA;AAC9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAA;AACxD,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC,CAAA","sourcesContent":["const ICON_HOME = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 40 40\">\n <defs>\n <style>\n .menu-svg {\n fill: #fff;\n\t\t\t\tstroke: {{strokecolor}};\n stroke-width: 0px;\n }\n </style>\n </defs>\n \n <path class=\"menu-svg\" d=\"M31,36.5c-.2,0-.4,0-.6,0-.2,0-.3-.2-.5-.3l-8.3-8.3c-.2-.2-.3-.3-.3-.5,0-.2,0-.4,0-.6s0-.4,0-.6c0-.2.2-.3.3-.5l3.1-3.1c.2-.2.3-.3.5-.3.2,0,.4,0,.6,0s.4,0,.6,0c.2,0,.3.2.5.3l8.3,8.3c.2.2.3.3.3.5,0,.2,0,.4,0,.6s0,.4,0,.6c0,.2-.2.3-.3.5l-3.1,3.1c-.2.2-.3.3-.5.3-.2,0-.4,0-.6,0ZM31,33.6l1.8-1.8-6.9-6.9-1.8,1.8,6.9,6.9ZM8.9,36.5c-.2,0-.4,0-.6-.1-.2,0-.3-.2-.5-.3l-3.1-3.1c-.2-.2-.3-.3-.3-.5,0-.2-.1-.4-.1-.6s0-.4.1-.6c0-.2.2-.3.3-.5l8.6-8.6h3.5l1.3-1.3-6.9-6.9h-2.4l-4.6-4.6,4.1-4.1,4.6,4.6v2.4l6.9,6.9,4.9-4.9-2.4-2.4,2.1-2.1h-4.2l-.9-.9,5.3-5.3.9.9v4.2l2.1-2.1,6.2,6.2c.4.4.8.9,1,1.5.2.5.3,1.1.3,1.7s0,1-.3,1.5c-.2.5-.5.9-.8,1.4l-3.5-3.5-2.3,2.3-1.8-1.8-8,8v3.5l-8.6,8.6c-.2.2-.3.3-.5.3-.2,0-.4.1-.6.1ZM8.9,33.6l7.6-7.6v-1.8h-1.8l-7.6,7.6,1.8,1.8ZM8.9,33.6l-1.8-1.8.9.9.9.9ZM31,33.6l1.8-1.8-1.8,1.8Z\"/>\n</svg>\n`\n\nconst ICON_KPIS = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 40 40\">\n <defs>\n <style>\n .menu-svg {\n fill: #fff;\n\t\t\t\tstroke: {{strokecolor}};\n stroke-width: 0px;\n }\n </style>\n </defs>\n \n <path class=\"menu-svg\" d=\"M27.9,15.1h2.7v-2.8h-2.7v2.8ZM27.9,21.4h2.7v-2.8h-2.7v2.8ZM27.9,27.7h2.7v-2.8h-2.7v2.8ZM26.9,33.3v-2.4h6.9V9h-14.2v2.8l-2.3-1.7v-3.5h18.7v26.7s-9.1,0-9.1,0ZM4,33.3v-14.5l9.9-7.3,9.9,7.3v14.5h-8.1v-7.5h-3.5v7.5H4ZM6.3,31h3.6v-7.5h8v7.5h3.6v-11l-7.7-5.5-7.7,5.5v11h0ZM18,31v-7.5h-8v7.5-7.5h8v7.5Z\"/>\n</svg>\n`\n\nconst ICON_STATUS = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 40 40\">\n <defs>\n <style>\n .menu-svg {\n fill: #fff;\n\t\t\t\tstroke: {{strokecolor}};\n stroke-width: 0px;\n }\n </style>\n </defs>\n\n <path class=\"menu-svg\" d=\"M7.4,33.9c-.8,0-1.5-.3-2.1-.8-.6-.6-.8-1.3-.8-2.1V9c0-.8.3-1.5.8-2.1.6-.6,1.3-.8,2.1-.8h25.2c.8,0,1.5.3,2.1.8s.8,1.3.8,2.1v21.9c0,.8-.3,1.5-.8,2.1s-1.3.8-2.1.8H7.4ZM7.4,31.4h25.2c0,0,.3,0,.4-.2,0,0,.2-.2.2-.4V9c0,0,0-.3-.2-.4,0,0-.2-.2-.4-.2H7.4c0,0-.3,0-.4.2,0,0-.2.2-.2.4v21.9c0,0,0,.3.2.4,0,0,.2.2.4.2h0ZM8.9,27.7h7.3v-2.4h-7.3v2.4ZM24.2,24.3l7.5-7.5-1.8-1.8-5.7,5.8-2.4-2.4-1.7,1.8s4.1,4.1,4.1,4.1ZM8.9,21.2h7.3v-2.4h-7.3v2.4ZM8.9,14.6h7.3v-2.4h-7.3s0,2.4,0,2.4ZM6.9,31.4V8.5v22.9Z\"/>\n</svg>\n`\n\nconst ICON_INTEGRATION = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 40 40\">\n <defs>\n <style>\n .menu-svg {\n fill: #fff;\n\t\t\t\tstroke: {{strokecolor}};\n stroke-width: 0px;\n }\n </style>\n </defs>\n \n <path class=\"menu-svg\" d=\"M9.1,35.5c-.8,0-1.5-.3-2.1-.8-.6-.6-.8-1.2-.8-2.1V10.9c0-.8.3-1.5.8-2.1.6-.6,1.2-.8,2.1-.8h2.3v-3.5h2.5v3.5h12.3v-3.5h2.4v3.5h2.3c.8,0,1.5.3,2.1.8.6.6.8,1.2.8,2.1v21.7c0,.8-.3,1.5-.8,2.1s-1.2.8-2.1.8c0,0-21.8,0-21.8,0ZM9.1,33.1h21.7c0,0,.3,0,.4-.2,0,0,.2-.2.2-.4v-15.2H8.5v15.2c0,0,0,.3.2.4,0,0,.2.2.4.2ZM8.5,14.9h22.7v-4c0,0,0-.3-.2-.4,0,0-.2-.2-.4-.2H9.1c0,0-.3,0-.4.2,0,0-.2.2-.2.4,0,0,0,4,0,4ZM8.5,14.9v-4.5,4.5ZM12.2,22.9v-2.4h15.4v2.4s-15.4,0-15.4,0ZM12.2,29.4v-2.4h10.5v2.4h-10.5Z\"/>\n</svg>\n`\n\nconst ICON_SETTING = `\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 40 40\">\n <defs>\n <style>\n .menu-svg {\n fill: #fff;\n\t\t\t\tstroke: {{strokecolor}};\n stroke-width: 0px;\n }\n </style>\n </defs>\n \n <path class=\"menu-svg\" d=\"M13.1,24.2h2v-5.7h-2v1.9h-2.4v2h2.4v1.9h0ZM16.7,22.3h12.8v-2h-12.8v2ZM25,18.1h2v-1.9h2.4v-2h-2.4v-1.9h-2v5.7h0ZM10.6,16.2h12.8v-2h-12.8v2ZM14.3,34v-3.3h-6.9c-.8,0-1.5-.3-2.1-.8s-.8-1.3-.8-2.1V8.9c0-.8.3-1.6.8-2.1.6-.5,1.3-.8,2.1-.8h25.2c.8,0,1.5.3,2.1.8s.8,1.3.8,2.1v18.8c0,.8-.3,1.6-.8,2.1-.6.5-1.3.8-2.1.8h-6.9v3.3h-11.5,0ZM7.5,28.2h25.2c0,0,.3,0,.4-.2,0,0,.2-.2.2-.4V8.9c0,0,0-.3-.2-.4,0,0-.2-.2-.4-.2H7.5c0,0-.3,0-.4.2,0,0-.2.2-.2.4v18.8c0,0,0,.3.2.4,0,0,.2.2.4.2h0ZM6.9,28.2V8.4v19.8Z\"/>\n</svg>\n`\n\nfunction icons(template) {\n return ['#ffffff', '#64A3D9'].map(\n color => 'data:image/svg+xml;charset=UTF-8;base64,' + btoa(template.replace(/{{strokecolor}}/g, color))\n )\n}\n\nexport const ICONS_HOME = icons(ICON_HOME)\nexport const ICONS_KPIS = icons(ICON_KPIS)\nexport const ICONS_STATUS = icons(ICON_STATUS)\nexport const ICONS_INTEGRATION = icons(ICON_INTEGRATION)\nexport const ICONS_SETTING = icons(ICON_SETTING)\n"]}
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../client/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -0,0 +1,23 @@
1
+ export declare function getMenuTemplate(owner: boolean | undefined, dataSets: any[]): (false | {
2
+ name: string;
3
+ type: string;
4
+ icon?: undefined;
5
+ path?: undefined;
6
+ menus?: undefined;
7
+ } | {
8
+ name: string;
9
+ icon: string;
10
+ path: string;
11
+ type?: undefined;
12
+ menus?: undefined;
13
+ } | {
14
+ name: string;
15
+ icon: string;
16
+ path: string;
17
+ menus: {
18
+ name: any;
19
+ icon: string;
20
+ path: string;
21
+ }[];
22
+ type?: undefined;
23
+ })[];
@@ -0,0 +1,59 @@
1
+ import i18next from 'i18next';
2
+ export function getMenuTemplate(owner = false, dataSets) {
3
+ return [
4
+ owner && {
5
+ name: 'DATASET',
6
+ type: 'group'
7
+ },
8
+ owner && {
9
+ name: i18next.t('title.data-set list'),
10
+ icon: 'dataset',
11
+ path: 'data-set-list'
12
+ },
13
+ owner && {
14
+ name: i18next.t('title.data-key-set list'),
15
+ icon: 'dataset_linked',
16
+ path: 'data-key-set-list'
17
+ },
18
+ {
19
+ name: 'DATA ENTRY',
20
+ type: 'group'
21
+ },
22
+ {
23
+ icon: 'edit_square',
24
+ name: i18next.t('title.data-entry list'),
25
+ path: 'data-entry-list'
26
+ },
27
+ {
28
+ name: 'DATA REPORT',
29
+ type: 'group'
30
+ },
31
+ owner && {
32
+ name: i18next.t('title.data-sample list'),
33
+ icon: 'rule',
34
+ path: 'data-sample-list',
35
+ menus: dataSets.map(item => {
36
+ return {
37
+ name: item.name,
38
+ icon: 'checklist_rtl',
39
+ path: `data-sample-search/${item.id}`
40
+ };
41
+ }) || []
42
+ },
43
+ owner && {
44
+ name: i18next.t('title.data-summary list'),
45
+ icon: 'functions',
46
+ path: 'data-summary-list',
47
+ menus: dataSets
48
+ .filter(item => item.active && item.summaryPeriod)
49
+ .map(item => {
50
+ return {
51
+ name: item.name,
52
+ icon: 'checklist',
53
+ path: `data-summary-period/${item.id}`
54
+ };
55
+ }) || []
56
+ }
57
+ ].filter(Boolean);
58
+ }
59
+ //# sourceMappingURL=menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu.js","sourceRoot":"","sources":["../client/menu.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,MAAM,UAAU,eAAe,CAAC,QAAiB,KAAK,EAAE,QAAe;IACrE,OAAO;QACL,KAAK,IAAI;YACP,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,OAAO;SACd;QACD,KAAK,IAAI;YACP,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC;YACtC,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,eAAe;SACtB;QACD,KAAK,IAAI;YACP,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,yBAAyB,CAAC;YAC1C,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,mBAAmB;SAC1B;QACD;YACE,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,OAAO;SACd;QACD;YACE,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC;YACxC,IAAI,EAAE,iBAAiB;SACxB;QACD;YACE,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,OAAO;SACd;QACD,KAAK,IAAI;YACP,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC;YACzC,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,kBAAkB;YACxB,KAAK,EACH,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;gBAClB,OAAO;oBACL,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,IAAI,EAAE,eAAe;oBACrB,IAAI,EAAE,sBAAsB,IAAI,CAAC,EAAE,EAAE;iBACtC,CAAA;YACH,CAAC,CAAC,IAAI,EAAE;SACX;QACD,KAAK,IAAI;YACP,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,yBAAyB,CAAC;YAC1C,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,mBAAmB;YACzB,KAAK,EACH,QAAQ;iBACL,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,aAAa,CAAC;iBACjD,GAAG,CAAC,IAAI,CAAC,EAAE;gBACV,OAAO;oBACL,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,uBAAuB,IAAI,CAAC,EAAE,EAAE;iBACvC,CAAA;YACH,CAAC,CAAC,IAAI,EAAE;SACb;KACF,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AACnB,CAAC","sourcesContent":["import i18next from 'i18next'\n\nexport function getMenuTemplate(owner: boolean = false, dataSets: any[]) {\n return [\n owner && {\n name: 'DATASET',\n type: 'group'\n },\n owner && {\n name: i18next.t('title.data-set list'),\n icon: 'dataset',\n path: 'data-set-list'\n },\n owner && {\n name: i18next.t('title.data-key-set list'),\n icon: 'dataset_linked',\n path: 'data-key-set-list'\n },\n {\n name: 'DATA ENTRY',\n type: 'group'\n },\n {\n icon: 'edit_square',\n name: i18next.t('title.data-entry list'),\n path: 'data-entry-list'\n },\n {\n name: 'DATA REPORT',\n type: 'group'\n },\n owner && {\n name: i18next.t('title.data-sample list'),\n icon: 'rule',\n path: 'data-sample-list',\n menus:\n dataSets.map(item => {\n return {\n name: item.name,\n icon: 'checklist_rtl',\n path: `data-sample-search/${item.id}`\n }\n }) || []\n },\n owner && {\n name: i18next.t('title.data-summary list'),\n icon: 'functions',\n path: 'data-summary-list',\n menus:\n dataSets\n .filter(item => item.active && item.summaryPeriod)\n .map(item => {\n return {\n name: item.name,\n icon: 'checklist',\n path: `data-summary-period/${item.id}`\n }\n }) || []\n }\n ].filter(Boolean)\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import '@material/web/icon/icon.js';
2
+ import '@things-factory/component-ui';
3
+ import '@things-factory/auth-ui/dist-client/components/ownership-transfer-popup';
4
+ import '@things-factory/auth-ui/dist-client/components/user-role-editor';
5
+ import '@things-factory/auth-ui/dist-client/components/create-user';
@@ -0,0 +1,219 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@material/web/icon/icon.js';
3
+ import '@things-factory/component-ui';
4
+ import '@things-factory/auth-ui/dist-client/components/ownership-transfer-popup';
5
+ import '@things-factory/auth-ui/dist-client/components/user-role-editor';
6
+ import '@things-factory/auth-ui/dist-client/components/create-user';
7
+ import gql from 'graphql-tag';
8
+ import { css, html } from 'lit';
9
+ import { customElement, property, query } from 'lit/decorators.js';
10
+ import { client, gqlContext } from '@operato/graphql';
11
+ import { i18next } from '@operato/i18n';
12
+ import { PageView } from '@operato/shell';
13
+ import { OxPrompt } from '@operato/popup/ox-prompt.js';
14
+ let SVUserManagement = class SVUserManagement extends PageView {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.domainUsers = [];
18
+ this.currentTab = '';
19
+ this.passwordResettable = false;
20
+ this.userCreatable = false;
21
+ }
22
+ get context() {
23
+ return {
24
+ title: i18next.t('text.user management'),
25
+ help: 'auth/users'
26
+ };
27
+ }
28
+ render() {
29
+ const groupingUser = (this.domainUsers || []).reduce((groupingUser, user) => {
30
+ const userType = user.userType;
31
+ if (!groupingUser[userType]) {
32
+ groupingUser[userType] = [];
33
+ }
34
+ user.activated = user.status === 'activated';
35
+ groupingUser[userType].push(user);
36
+ return groupingUser;
37
+ }, {
38
+ admin: [],
39
+ user: [],
40
+ application: [],
41
+ appliance: []
42
+ });
43
+ const USER_TYPES = {
44
+ USER: i18next.t('label.user'),
45
+ APPLICATION: i18next.t('label.application'),
46
+ APPLIANCE: i18next.t('text.appliance')
47
+ };
48
+ const userSet = {
49
+ [USER_TYPES.USER]: [...groupingUser.user, ...groupingUser.admin],
50
+ [USER_TYPES.APPLICATION]: groupingUser.application,
51
+ [USER_TYPES.APPLIANCE]: groupingUser.appliance
52
+ };
53
+ return html `
54
+ ${this.userCreatable
55
+ ? html `<create-user
56
+ @create-user=${async (event) => {
57
+ const user = event.detail;
58
+ user.userType = 'user';
59
+ await this.createUser(user);
60
+ }}
61
+ ></create-user>`
62
+ : ''}
63
+ <quick-find-list
64
+ id="user-list"
65
+ .data=${userSet}
66
+ @tabChanged=${e => (this.currentTab = e.detail.currentTabKey)}
67
+ .headerRenderer=${user => {
68
+ return html `
69
+ ${!user.activated
70
+ ? html `
71
+ <md-icon>do_disturb</md-icon>
72
+ ${user.name}
73
+ `
74
+ : html ` ${user.owner ? html ` <md-icon>supervisor_account</md-icon> ` : ''} ${user.name} `}
75
+ `;
76
+ }}
77
+ .contentRenderer=${user => html ` <user-role-editor
78
+ .user=${user}
79
+ .domainOwner=${this.owner}
80
+ .activate=${user.activated}
81
+ @userUpdated=${this.refreshUsers.bind(this)}
82
+ @ownershipTransferred=${this.refreshUsers.bind(this)}
83
+ .passwordResettable=${this.passwordResettable}
84
+ ></user-role-editor>`}
85
+ ></quick-find-list>
86
+ `;
87
+ }
88
+ async pageUpdated(changes, lifecycle, before) {
89
+ if (this.active) {
90
+ this.refreshUsers();
91
+ this.checkPasswordResettable();
92
+ this.checkUserCreatable();
93
+ }
94
+ }
95
+ async refreshUsers() {
96
+ var _a, _b;
97
+ const domainUsersResp = await client.query({
98
+ query: gql `
99
+ query {
100
+ users {
101
+ items {
102
+ id
103
+ name
104
+ email
105
+ userType
106
+ status
107
+ owner
108
+ }
109
+ }
110
+ }
111
+ `,
112
+ context: gqlContext()
113
+ });
114
+ if (!((_a = domainUsersResp.errors) === null || _a === void 0 ? void 0 : _a.length)) {
115
+ this.domainUsers = domainUsersResp.data.users.items || [];
116
+ this.owner = this.domainUsers.filter(user => user.owner)[0] || {};
117
+ (_b = this.userListElement) === null || _b === void 0 ? void 0 : _b.close();
118
+ }
119
+ }
120
+ async checkPasswordResettable() {
121
+ const response = await client.query({
122
+ query: gql `
123
+ query {
124
+ checkResettablePasswordToDefault
125
+ }
126
+ `
127
+ });
128
+ if (!response.errors) {
129
+ this.passwordResettable = response.data.checkResettablePasswordToDefault;
130
+ }
131
+ }
132
+ async checkUserCreatable() {
133
+ const response = await client.query({
134
+ query: gql `
135
+ query {
136
+ checkDefaultPassword
137
+ }
138
+ `
139
+ });
140
+ if (!response.errors) {
141
+ this.userCreatable = response.data.checkDefaultPassword;
142
+ }
143
+ }
144
+ async createUser(user) {
145
+ if (await OxPrompt.open({
146
+ title: i18next.t('text.are_you_sure'),
147
+ text: i18next.t('text.are_you_sure_to_x_user', { x: i18next.t('button.create') }),
148
+ confirmButton: { text: i18next.t('button.confirm') },
149
+ cancelButton: { text: i18next.t('button.cancel') }
150
+ })) {
151
+ const response = await client.mutate({
152
+ mutation: gql `
153
+ mutation createUser($user: NewUser!) {
154
+ createUser(user: $user) {
155
+ name
156
+ }
157
+ }
158
+ `,
159
+ variables: { user },
160
+ context: gqlContext()
161
+ });
162
+ if (!response.errors) {
163
+ await OxPrompt.open({
164
+ title: i18next.t('text.completed'),
165
+ confirmButton: { text: i18next.t('button.confirm') }
166
+ });
167
+ await this.refreshUsers();
168
+ }
169
+ }
170
+ }
171
+ showToast(message) {
172
+ document.dispatchEvent(new CustomEvent('notify', { detail: { message, option: { timer: 1000 } } }));
173
+ }
174
+ };
175
+ SVUserManagement.styles = [
176
+ css `
177
+ :host {
178
+ display: flex;
179
+ flex-direction: column;
180
+ background-color: var(--main-section-background-color);
181
+ padding: var(--padding-wide);
182
+ overflow: auto;
183
+ }
184
+
185
+ @media screen and (max-width: 600px) {
186
+ :host {
187
+ padding: var(--padding-narrow);
188
+ }
189
+ }
190
+ `
191
+ ];
192
+ __decorate([
193
+ property({ type: Array }),
194
+ __metadata("design:type", Array)
195
+ ], SVUserManagement.prototype, "domainUsers", void 0);
196
+ __decorate([
197
+ property({ type: Object }),
198
+ __metadata("design:type", Object)
199
+ ], SVUserManagement.prototype, "owner", void 0);
200
+ __decorate([
201
+ property({ type: String }),
202
+ __metadata("design:type", String)
203
+ ], SVUserManagement.prototype, "currentTab", void 0);
204
+ __decorate([
205
+ property({ type: Boolean }),
206
+ __metadata("design:type", Boolean)
207
+ ], SVUserManagement.prototype, "passwordResettable", void 0);
208
+ __decorate([
209
+ property({ type: Boolean }),
210
+ __metadata("design:type", Boolean)
211
+ ], SVUserManagement.prototype, "userCreatable", void 0);
212
+ __decorate([
213
+ query('#user-list'),
214
+ __metadata("design:type", Object)
215
+ ], SVUserManagement.prototype, "userListElement", void 0);
216
+ SVUserManagement = __decorate([
217
+ customElement('sv-user-management')
218
+ ], SVUserManagement);
219
+ //# sourceMappingURL=sv-user-management.js.map
@@ -0,0 +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,EAA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IAAI,CAAC,YAAY,EAAE,CAAA;YAC3B,CAAC;QACH,CAAC;IACH,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;;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"]}
@@ -0,0 +1 @@
1
+ export default function route(page: string): "/dashboard" | "users" | undefined;
@@ -0,0 +1,10 @@
1
+ export default function route(page) {
2
+ switch (page) {
3
+ case '':
4
+ return '/dashboard';
5
+ case 'users':
6
+ import('./pages/sv-user-management');
7
+ return page;
8
+ }
9
+ }
10
+ //# sourceMappingURL=route.js.map
@@ -0,0 +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,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"]}
@@ -0,0 +1,51 @@
1
+ .dark {
2
+ --md-sys-color-primary: rgb(174 198 255);
3
+ --md-sys-color-surface-tint: rgb(174 198 255);
4
+ --md-sys-color-on-primary: rgb(17 47 96);
5
+ --md-sys-color-primary-container: rgb(44 70 120);
6
+ --md-sys-color-on-primary-container: rgb(216 226 255);
7
+ --md-sys-color-secondary: rgb(191 198 220);
8
+ --md-sys-color-on-secondary: rgb(41 48 65);
9
+ --md-sys-color-secondary-container: rgb(63 71 89);
10
+ --md-sys-color-on-secondary-container: rgb(219 226 249);
11
+ --md-sys-color-tertiary: rgb(222 188 223);
12
+ --md-sys-color-on-tertiary: rgb(64 40 67);
13
+ --md-sys-color-tertiary-container: rgb(88 62 91);
14
+ --md-sys-color-on-tertiary-container: rgb(252 215 251);
15
+ --md-sys-color-error: rgb(255 180 171);
16
+ --md-sys-color-on-error: rgb(105 0 5);
17
+ --md-sys-color-error-container: rgb(147 0 10);
18
+ --md-sys-color-on-error-container: rgb(255 218 214);
19
+ --md-sys-color-background: rgb(17 19 24);
20
+ --md-sys-color-on-background: rgb(226 226 233);
21
+ --md-sys-color-surface: rgb(17 19 24);
22
+ --md-sys-color-on-surface: rgb(226 226 233);
23
+ --md-sys-color-surface-variant: rgb(68 71 79);
24
+ --md-sys-color-on-surface-variant: rgb(197 198 208);
25
+ --md-sys-color-outline: rgb(142 144 153);
26
+ --md-sys-color-outline-variant: rgb(68 71 79);
27
+ --md-sys-color-shadow: rgb(0 0 0);
28
+ --md-sys-color-scrim: rgb(0 0 0);
29
+ --md-sys-color-inverse-surface: rgb(226 226 233);
30
+ --md-sys-color-inverse-on-surface: rgb(47 48 54);
31
+ --md-sys-color-inverse-primary: rgb(68 94 145);
32
+ --md-sys-color-primary-fixed: rgb(216 226 255);
33
+ --md-sys-color-on-primary-fixed: rgb(0 26 66);
34
+ --md-sys-color-primary-fixed-dim: rgb(174 198 255);
35
+ --md-sys-color-on-primary-fixed-variant: rgb(44 70 120);
36
+ --md-sys-color-secondary-fixed: rgb(219 226 249);
37
+ --md-sys-color-on-secondary-fixed: rgb(20 27 44);
38
+ --md-sys-color-secondary-fixed-dim: rgb(191 198 220);
39
+ --md-sys-color-on-secondary-fixed-variant: rgb(63 71 89);
40
+ --md-sys-color-tertiary-fixed: rgb(252 215 251);
41
+ --md-sys-color-on-tertiary-fixed: rgb(41 19 45);
42
+ --md-sys-color-tertiary-fixed-dim: rgb(222 188 223);
43
+ --md-sys-color-on-tertiary-fixed-variant: rgb(88 62 91);
44
+ --md-sys-color-surface-dim: rgb(17 19 24);
45
+ --md-sys-color-surface-bright: rgb(55 57 62);
46
+ --md-sys-color-surface-container-lowest: rgb(12 14 19);
47
+ --md-sys-color-surface-container-low: rgb(26 27 32);
48
+ --md-sys-color-surface-container: rgb(30 31 37);
49
+ --md-sys-color-surface-container-high: rgb(40 42 47);
50
+ --md-sys-color-surface-container-highest: rgb(51 53 58);
51
+ }