@dssp/dkpi 1.0.0-alpha.21 → 1.0.0-alpha.23
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/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist-client/bootstrap.d.ts +0 -8
- package/dist-client/bootstrap.js +0 -257
- package/dist-client/bootstrap.js.map +0 -1
- package/dist-client/entries/public/home.d.ts +0 -8
- package/dist-client/entries/public/home.js +0 -97
- package/dist-client/entries/public/home.js.map +0 -1
- package/dist-client/icons/menu-icons.d.ts +0 -5
- package/dist-client/icons/menu-icons.js +0 -84
- package/dist-client/icons/menu-icons.js.map +0 -1
- package/dist-client/index.d.ts +0 -0
- package/dist-client/index.js +0 -2
- package/dist-client/index.js.map +0 -1
- package/dist-client/menu.d.ts +0 -23
- package/dist-client/menu.js +0 -59
- package/dist-client/menu.js.map +0 -1
- package/dist-client/pages/sv-project-completed-list.d.ts +0 -18
- package/dist-client/pages/sv-project-completed-list.js +0 -293
- package/dist-client/pages/sv-project-completed-list.js.map +0 -1
- package/dist-client/pages/sv-project-list.d.ts +0 -144
- package/dist-client/pages/sv-project-list.js +0 -339
- package/dist-client/pages/sv-project-list.js.map +0 -1
- package/dist-client/pages/sv-user-management.d.ts +0 -5
- package/dist-client/pages/sv-user-management.js +0 -219
- package/dist-client/pages/sv-user-management.js.map +0 -1
- package/dist-client/route.d.ts +0 -1
- package/dist-client/route.js +0 -16
- package/dist-client/route.js.map +0 -1
- package/dist-client/themes/dark.css +0 -51
- package/dist-client/themes/light.css +0 -51
- package/dist-client/tsconfig.tsbuildinfo +0 -1
- package/dist-client/viewparts/menu-tools.d.ts +0 -54
- package/dist-client/viewparts/menu-tools.js +0 -508
- package/dist-client/viewparts/menu-tools.js.map +0 -1
- package/dist-client/viewparts/user-circle.d.ts +0 -5
- package/dist-client/viewparts/user-circle.js +0 -26
- package/dist-client/viewparts/user-circle.js.map +0 -1
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import '@material/web/icon/icon.js';
|
|
3
|
-
import { PageView } from '@operato/shell';
|
|
4
|
-
import { css, html } from 'lit';
|
|
5
|
-
import { customElement, state } from 'lit/decorators.js';
|
|
6
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
7
|
-
import { client } from '@operato/graphql';
|
|
8
|
-
import gql from 'graphql-tag';
|
|
9
|
-
export var ProjectState;
|
|
10
|
-
(function (ProjectState) {
|
|
11
|
-
ProjectState["ONGOING"] = "10";
|
|
12
|
-
ProjectState["COMPLETED"] = "20";
|
|
13
|
-
})(ProjectState || (ProjectState = {}));
|
|
14
|
-
export var BuildingInspectionStatus;
|
|
15
|
-
(function (BuildingInspectionStatus) {
|
|
16
|
-
BuildingInspectionStatus["WAIT"] = "WAIT";
|
|
17
|
-
BuildingInspectionStatus["OVERALL_WAIT"] = "OVERALL_WAIT";
|
|
18
|
-
BuildingInspectionStatus["REQUEST"] = "REQUEST";
|
|
19
|
-
BuildingInspectionStatus["OVERALL_REQUEST"] = "OVERALL_REQUEST";
|
|
20
|
-
BuildingInspectionStatus["PASS"] = "PASS";
|
|
21
|
-
BuildingInspectionStatus["FAIL"] = "FAIL";
|
|
22
|
-
})(BuildingInspectionStatus || (BuildingInspectionStatus = {}));
|
|
23
|
-
export const BUILDING_INSPECTION_STATUS = {
|
|
24
|
-
[BuildingInspectionStatus.WAIT]: '검측 대기',
|
|
25
|
-
[BuildingInspectionStatus.OVERALL_WAIT]: '검측 대기',
|
|
26
|
-
[BuildingInspectionStatus.REQUEST]: '검측 요청',
|
|
27
|
-
[BuildingInspectionStatus.OVERALL_REQUEST]: '검측 요청',
|
|
28
|
-
[BuildingInspectionStatus.PASS]: '합격',
|
|
29
|
-
[BuildingInspectionStatus.FAIL]: '불합격'
|
|
30
|
-
};
|
|
31
|
-
export var ProjectType;
|
|
32
|
-
(function (ProjectType) {
|
|
33
|
-
ProjectType["DSSP"] = "DSSP";
|
|
34
|
-
ProjectType["DCSP"] = "DCSP";
|
|
35
|
-
ProjectType["DKPI"] = "DKPI";
|
|
36
|
-
})(ProjectType || (ProjectType = {}));
|
|
37
|
-
let SvProjectListPage = class SvProjectListPage extends ScopedElementsMixin(PageView) {
|
|
38
|
-
constructor() {
|
|
39
|
-
super(...arguments);
|
|
40
|
-
this.projectName = '';
|
|
41
|
-
this.projectList = [];
|
|
42
|
-
this.projectCount = 0;
|
|
43
|
-
}
|
|
44
|
-
get context() {
|
|
45
|
-
return {
|
|
46
|
-
title: '진행중 프로젝트'
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
render() {
|
|
50
|
-
var _a;
|
|
51
|
-
return html `
|
|
52
|
-
<div header>
|
|
53
|
-
<md-filled-text-field
|
|
54
|
-
name="projectName"
|
|
55
|
-
type="search"
|
|
56
|
-
label="프로젝트명"
|
|
57
|
-
.value=${this.projectName}
|
|
58
|
-
@input=${this._onInputChange}
|
|
59
|
-
@keypress=${this._onKeypress}
|
|
60
|
-
>
|
|
61
|
-
<md-icon slot="leading-icon">search</md-icon>
|
|
62
|
-
</md-filled-text-field>
|
|
63
|
-
|
|
64
|
-
<strong>총 ${this.projectCount}개</strong>
|
|
65
|
-
</div>
|
|
66
|
-
|
|
67
|
-
<div body>
|
|
68
|
-
${(_a = this.projectList) === null || _a === void 0 ? void 0 : _a.map((project) => {
|
|
69
|
-
var _a, _b, _c, _d;
|
|
70
|
-
return html `
|
|
71
|
-
<div project-container>
|
|
72
|
-
<a href=${`kpi-dashboard?projectId=${project.id}`}>
|
|
73
|
-
<img
|
|
74
|
-
?no-image=${!((_a = project.mainPhoto) === null || _a === void 0 ? void 0 : _a.fullpath)}
|
|
75
|
-
project-img
|
|
76
|
-
src=${((_b = project.mainPhoto) === null || _b === void 0 ? void 0 : _b.fullpath) || '/assets/images/no-image.png'}
|
|
77
|
-
/>
|
|
78
|
-
|
|
79
|
-
<span project-info>
|
|
80
|
-
<div name>${project.name}</div>
|
|
81
|
-
<div content>${project.buildingComplex.address}</div>
|
|
82
|
-
<div content>면적: ${((_d = (_c = project.buildingComplex) === null || _c === void 0 ? void 0 : _c.area) === null || _d === void 0 ? void 0 : _d.toLocaleString()) || ''}㎡</div>
|
|
83
|
-
<div content>착공~준공: ${project.startDate} ~ ${project.endDate}</div>
|
|
84
|
-
<div content>발주처: <strong>${project.buildingComplex.clientCompany}</strong></div>
|
|
85
|
-
</span>
|
|
86
|
-
|
|
87
|
-
<span project-state>
|
|
88
|
-
<div progress>
|
|
89
|
-
<md-linear-progress buffer="100" max="100" value=${project.totalProgress || 0}> </md-linear-progress>
|
|
90
|
-
<span>전체</span>
|
|
91
|
-
<span>${project.totalProgress || 0}%</span>
|
|
92
|
-
</div>
|
|
93
|
-
<div progress>
|
|
94
|
-
<md-linear-progress buffer="100" max="100" value=${project.weeklyProgress || 0}> </md-linear-progress>
|
|
95
|
-
<span>주간</span>
|
|
96
|
-
<span>${project.weeklyProgress || 0}%</span>
|
|
97
|
-
</div>
|
|
98
|
-
<div progress>
|
|
99
|
-
<md-linear-progress buffer="100" max="100" value=${project.kpi || 0}> </md-linear-progress>
|
|
100
|
-
<span>KPI</span>
|
|
101
|
-
<span>${project.kpi || 0}%</span>
|
|
102
|
-
</div>
|
|
103
|
-
<div progress>
|
|
104
|
-
<md-linear-progress buffer="100" max="100" value=${project.inspPassRate || 0}> </md-linear-progress>
|
|
105
|
-
<span>Inspection Passing Rate</span>
|
|
106
|
-
<span>${project.inspPassRate || 0}%</span>
|
|
107
|
-
</div>
|
|
108
|
-
<div progress>
|
|
109
|
-
<md-linear-progress buffer="100" max="100" value=${project.robotProgressRate || 0}> </md-linear-progress>
|
|
110
|
-
<span>Robot Progress</span>
|
|
111
|
-
<span>${project.robotProgressRate || 0}%</span>
|
|
112
|
-
</div>
|
|
113
|
-
<div progress>
|
|
114
|
-
<md-linear-progress buffer="100" max="100" value=${project.structuralSafetyRate || 0}> </md-linear-progress>
|
|
115
|
-
<span>Structural safety</span>
|
|
116
|
-
<span>${project.structuralSafetyRate || 0}%</span>
|
|
117
|
-
</div>
|
|
118
|
-
</span>
|
|
119
|
-
</a>
|
|
120
|
-
</div>
|
|
121
|
-
`;
|
|
122
|
-
})}
|
|
123
|
-
</div>
|
|
124
|
-
`;
|
|
125
|
-
}
|
|
126
|
-
async pageUpdated(changes, lifecycle) {
|
|
127
|
-
if (this.active) {
|
|
128
|
-
this.getProjectList();
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
async getProjectList() {
|
|
132
|
-
var _a, _b;
|
|
133
|
-
const response = await client.query({
|
|
134
|
-
query: gql `
|
|
135
|
-
query Projects($filters: [Filter!]) {
|
|
136
|
-
projects(filters: $filters) {
|
|
137
|
-
items {
|
|
138
|
-
id
|
|
139
|
-
name
|
|
140
|
-
startDate
|
|
141
|
-
endDate
|
|
142
|
-
mainPhoto {
|
|
143
|
-
fullpath
|
|
144
|
-
}
|
|
145
|
-
totalProgress
|
|
146
|
-
weeklyProgress
|
|
147
|
-
kpi
|
|
148
|
-
inspPassRate
|
|
149
|
-
robotProgressRate
|
|
150
|
-
structuralSafetyRate
|
|
151
|
-
buildingComplex {
|
|
152
|
-
address
|
|
153
|
-
area
|
|
154
|
-
clientCompany
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
total
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
`,
|
|
161
|
-
variables: {
|
|
162
|
-
filters: [
|
|
163
|
-
{
|
|
164
|
-
name: 'name',
|
|
165
|
-
operator: 'search',
|
|
166
|
-
value: `%${this.projectName}%`
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
name: 'state',
|
|
170
|
-
operator: 'eq',
|
|
171
|
-
value: ProjectState.ONGOING
|
|
172
|
-
}
|
|
173
|
-
],
|
|
174
|
-
sortings: [{ name: 'createdAt', desc: true }]
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
this.projectList = ((_a = response.data.projects) === null || _a === void 0 ? void 0 : _a.items) || [];
|
|
178
|
-
this.projectCount = ((_b = response.data.projects) === null || _b === void 0 ? void 0 : _b.total) || 0;
|
|
179
|
-
}
|
|
180
|
-
// Input 요소의 값이 변경될 때 호출되는 콜백 함수
|
|
181
|
-
_onInputChange(event) {
|
|
182
|
-
const target = event.target;
|
|
183
|
-
this[target.name] = target.value;
|
|
184
|
-
}
|
|
185
|
-
// 검색창에서 엔터입력시 검색
|
|
186
|
-
_onKeypress(event) {
|
|
187
|
-
if (event.code === 'Enter') {
|
|
188
|
-
this.getProjectList();
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
SvProjectListPage.styles = [
|
|
193
|
-
css `
|
|
194
|
-
:host {
|
|
195
|
-
display: flex;
|
|
196
|
-
flex-direction: column;
|
|
197
|
-
overflow-y: auto;
|
|
198
|
-
|
|
199
|
-
width: 100%;
|
|
200
|
-
height: 100%;
|
|
201
|
-
background-color: var(--md-sys-color-background, #f6f6f6);
|
|
202
|
-
|
|
203
|
-
--grid-record-emphasized-background-color: red;
|
|
204
|
-
--grid-record-emphasized-color: yellow;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
div[header] {
|
|
208
|
-
display: flex;
|
|
209
|
-
align-items: center;
|
|
210
|
-
background-color: #2ea4df1a;
|
|
211
|
-
border: 1px solid #2ea4df33;
|
|
212
|
-
margin: var(--spacing-large, 12px);
|
|
213
|
-
margin-bottom: var(--spacing-small, 5px);
|
|
214
|
-
padding: var(--spacing-medium, 8px) var(--spacing-large, 12px);
|
|
215
|
-
border-radius: var(--md-sys-shape-corner-small, 5px);
|
|
216
|
-
|
|
217
|
-
md-filled-text-field[type='search'] {
|
|
218
|
-
--md-filled-text-field-container-shape: 0px;
|
|
219
|
-
--md-sys-color-primary: #2e79be;
|
|
220
|
-
--md-sys-color-surface-container-highest: transparent;
|
|
221
|
-
--md-filled-text-field-label-text-color: #999999;
|
|
222
|
-
}
|
|
223
|
-
strong {
|
|
224
|
-
flex: 1;
|
|
225
|
-
padding-right: var(--spacing-medium, 8px);
|
|
226
|
-
text-align: right;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
md-elevated-button[add-project] {
|
|
230
|
-
font-weight: bold;
|
|
231
|
-
font-size: 16px;
|
|
232
|
-
margin-left: 17px;
|
|
233
|
-
padding: 13px 20px;
|
|
234
|
-
|
|
235
|
-
--md-sys-color-surface-container-low: #24be7b;
|
|
236
|
-
--md-sys-color-primary: #ffffff;
|
|
237
|
-
--md-elevated-button-container-shape: 7px;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
div[body] {
|
|
242
|
-
div[project-container] {
|
|
243
|
-
height: 140px;
|
|
244
|
-
margin: var(--spacing-large, 12px);
|
|
245
|
-
background-color: var(--md-sys-color-on-primary);
|
|
246
|
-
border: 1px solid #cccccc80;
|
|
247
|
-
border-radius: var(--md-sys-shape-corner-small, 5px);
|
|
248
|
-
overflow: hidden;
|
|
249
|
-
|
|
250
|
-
& > a {
|
|
251
|
-
display: flex;
|
|
252
|
-
gap: 0 var(--spacing-large, 12px);
|
|
253
|
-
width: 100%;
|
|
254
|
-
height: 100%;
|
|
255
|
-
text-decoration: none;
|
|
256
|
-
color: #000;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
img[project-img] {
|
|
260
|
-
width: 240px;
|
|
261
|
-
background-color: #cccccc80;
|
|
262
|
-
}
|
|
263
|
-
img[project-img][no-image] {
|
|
264
|
-
object-fit: contain;
|
|
265
|
-
opacity: 0.5;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
span[project-info] {
|
|
269
|
-
flex: 0.55;
|
|
270
|
-
padding: var(--spacing-small, 4px);
|
|
271
|
-
font-size: 14px;
|
|
272
|
-
|
|
273
|
-
white-space: nowrap;
|
|
274
|
-
overflow: hidden;
|
|
275
|
-
text-overflow: ellipsis;
|
|
276
|
-
|
|
277
|
-
div[name] {
|
|
278
|
-
color: #2e79be;
|
|
279
|
-
font-weight: bold;
|
|
280
|
-
font-size: 18px;
|
|
281
|
-
margin: var(--spacing-small, 4px);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
span[project-state] {
|
|
286
|
-
flex: 0.45;
|
|
287
|
-
padding: var(--spacing-medium, 8px);
|
|
288
|
-
|
|
289
|
-
& > div {
|
|
290
|
-
margin: var(--spacing-tiny, 2px);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
div[progress] {
|
|
294
|
-
position: relative;
|
|
295
|
-
|
|
296
|
-
md-linear-progress {
|
|
297
|
-
--md-linear-progress-track-height: 18px;
|
|
298
|
-
--md-linear-progress-active-indicator-height: 18px;
|
|
299
|
-
--md-linear-progress-track-shape: 5px;
|
|
300
|
-
--md-sys-color-primary: #0595e526;
|
|
301
|
-
--md-sys-color-surface-container-highest: #0595e52a;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
span {
|
|
305
|
-
position: absolute;
|
|
306
|
-
top: 0;
|
|
307
|
-
left: var(--spacing-large, 12px);
|
|
308
|
-
font-size: 12px;
|
|
309
|
-
font-weight: bold;
|
|
310
|
-
color: #2e79be;
|
|
311
|
-
|
|
312
|
-
&:last-child {
|
|
313
|
-
left: unset;
|
|
314
|
-
right: var(--spacing-large, 12px);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
`
|
|
322
|
-
];
|
|
323
|
-
__decorate([
|
|
324
|
-
state(),
|
|
325
|
-
__metadata("design:type", String)
|
|
326
|
-
], SvProjectListPage.prototype, "projectName", void 0);
|
|
327
|
-
__decorate([
|
|
328
|
-
state(),
|
|
329
|
-
__metadata("design:type", Array)
|
|
330
|
-
], SvProjectListPage.prototype, "projectList", void 0);
|
|
331
|
-
__decorate([
|
|
332
|
-
state(),
|
|
333
|
-
__metadata("design:type", Number)
|
|
334
|
-
], SvProjectListPage.prototype, "projectCount", void 0);
|
|
335
|
-
SvProjectListPage = __decorate([
|
|
336
|
-
customElement('sv-project-list')
|
|
337
|
-
], SvProjectListPage);
|
|
338
|
-
export { SvProjectListPage };
|
|
339
|
-
//# sourceMappingURL=sv-project-list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sv-project-list.js","sourceRoot":"","sources":["../../client/pages/sv-project-list.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,GAAG,MAAM,aAAa,CAAA;AAI7B,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,8BAAgB,CAAA;IAChB,gCAAkB,CAAA;AACpB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AACD,MAAM,CAAN,IAAY,wBAOX;AAPD,WAAY,wBAAwB;IAClC,yCAAa,CAAA;IACb,yDAA6B,CAAA;IAC7B,+CAAmB,CAAA;IACnB,+DAAmC,CAAA;IACnC,yCAAa,CAAA;IACb,yCAAa,CAAA;AACf,CAAC,EAPW,wBAAwB,KAAxB,wBAAwB,QAOnC;AACD,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,OAAO;IACxC,CAAC,wBAAwB,CAAC,YAAY,CAAC,EAAE,OAAO;IAChD,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,OAAO;IAC3C,CAAC,wBAAwB,CAAC,eAAe,CAAC,EAAE,OAAO;IACnD,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE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I,EAAE,CAAA;QACtD,IAAI,CAAC,YAAY,GAAG,CAAA,MAAA,QAAQ,CAAC,IAAI,CAAC,QAAQ,0CAAE,KAAK,KAAI,CAAC,CAAA;IACxD,CAAC;IAED,gCAAgC;IACxB,cAAc,CAAC,KAAiB;QACtC,MAAM,MAAM,GAAG,KAAK,CAAC,MAA0B,CAAA;QAC/C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAA;IAClC,CAAC;IAED,iBAAiB;IACT,WAAW,CAAC,KAAoB;QACtC,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC3B,IAAI,CAAC,cAAc,EAAE,CAAA;QACvB,CAAC;IACH,CAAC;;AA7RM,wBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgIF;CACF,AAlIY,CAkIZ;AAQgB;IAAhB,KAAK,EAAE;;sDAAiC;AACxB;IAAhB,KAAK,EAAE;;sDAAoC;AAC3B;IAAhB,KAAK,EAAE;;uDAAiC;AA7I9B,iBAAiB;IAD7B,aAAa,CAAC,iBAAiB,CAAC;GACpB,iBAAiB,CA+R7B","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { client } from '@operato/graphql'\nimport gql from 'graphql-tag'\nimport { Attachment } from '@things-factory/attachment-base'\nimport type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\n\nexport enum ProjectState {\n 'ONGOING' = '10',\n 'COMPLETED' = '20'\n}\nexport enum BuildingInspectionStatus {\n WAIT = 'WAIT',\n OVERALL_WAIT = 'OVERALL_WAIT',\n REQUEST = 'REQUEST',\n OVERALL_REQUEST = 'OVERALL_REQUEST',\n PASS = 'PASS',\n FAIL = 'FAIL'\n}\nexport const BUILDING_INSPECTION_STATUS = {\n [BuildingInspectionStatus.WAIT]: '검측 대기',\n [BuildingInspectionStatus.OVERALL_WAIT]: '검측 대기',\n [BuildingInspectionStatus.REQUEST]: '검측 요청',\n [BuildingInspectionStatus.OVERALL_REQUEST]: '검측 요청',\n [BuildingInspectionStatus.PASS]: '합격',\n [BuildingInspectionStatus.FAIL]: '불합격'\n}\n\nexport enum ProjectType {\n DSSP = 'DSSP',\n DCSP = 'DCSP',\n DKPI = 'DKPI'\n}\n\nexport interface Project {\n id?: string\n name: string\n startDate?: string\n endDate?: string\n mainPhoto?: Attachment\n mainPhotoUpload?: FileUpload\n totalProgress?: number\n weeklyProgress?: number\n kpi?: number\n inspPassRate?: number\n robotProgressRate?: number\n structuralSafetyRate?: number\n robotCount?: number\n scheduleTable?: Attachment\n buildingComplex: BuildingComplex\n projectType?: ProjectType\n}\nexport interface BuildingComplex {\n id?: string\n address?: string\n latitude?: number\n longitude?: number\n area?: number\n constructionCompany?: string\n clientCompany?: string\n designCompany?: string\n supervisoryCompany?: string\n drawing?: Attachment\n drawingUpload?: FileUpload\n constructionType?: string\n constructionCost?: number\n etc?: string\n householdCount?: number\n buildingCount?: number\n notice?: string\n planXScale?: number\n planYScale?: number\n overallConstructorEmails?: string[]\n taskConstructorEmails?: string[]\n overallSupervisoryEmails?: string[]\n taskSupervisoryEmails?: string[]\n buildings?: Building[]\n}\nexport interface Building {\n id?: string\n name: string | undefined\n floorCount: number | undefined\n hasBasement?: boolean\n basementFloorCount?: number\n drawing?: Attachment\n drawingUpload?: FileUpload\n buildingLevels?: BuildingLevel[]\n}\n\nexport interface BuildingLevel {\n id?: string\n floor?: number\n floorDisplayName?: string\n mainDrawing?: Attachment\n mainDrawingImage?: string\n mainDrawingThumbnail?: string\n mainDrawingUpload?: FileUpload\n elevationDrawing?: Attachment\n elevationDrawingThumbnail?: string\n elevationDrawingUpload?: FileUpload\n rebarDistributionDrawing?: Attachment\n rebarDistributionDrawingThumbnail?: string\n rebarDistributionDrawingUpload?: FileUpload\n etcDrawings?: Attachment[]\n etcDrawingsUpload?: FileUpload[]\n building?: Building\n buildingInspections?: BuildingInspection[]\n}\n\nexport interface BuildingInspection {\n id?: string\n attatchments?: Attachment[]\n // buildingInspectionAttachments?: BuildingInspectionAttachment[]\n status?: BuildingInspectionStatus\n requestDate?: Date\n buildingLevel?: BuildingLevel\n checklist?: Checklist\n createdAt?: Date\n updatedAt?: Date\n deletedAt?: Date\n}\n\nexport interface Checklist {\n id: string\n name?: string\n documentNo?: string\n constructionType?: string\n constructionDetailType?: string\n location?: string\n constructionInspectorDate?: Date\n supervisorInspectorDate?: Date\n overallConstructorSignature?: string\n taskConstructorSignature?: string\n overallSupervisorySignature?: string\n taskSupervisorySignature?: string\n inspectionParts?: string[]\n // checklistItems?: ChecklistItem[]\n}\n\n@customElement('sv-project-list')\nexport class SvProjectListPage extends ScopedElementsMixin(PageView) {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n\n width: 100%;\n height: 100%;\n background-color: var(--md-sys-color-background, #f6f6f6);\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n div[header] {\n display: flex;\n align-items: center;\n background-color: #2ea4df1a;\n border: 1px solid #2ea4df33;\n margin: var(--spacing-large, 12px);\n margin-bottom: var(--spacing-small, 5px);\n padding: var(--spacing-medium, 8px) var(--spacing-large, 12px);\n border-radius: var(--md-sys-shape-corner-small, 5px);\n\n md-filled-text-field[type='search'] {\n --md-filled-text-field-container-shape: 0px;\n --md-sys-color-primary: #2e79be;\n --md-sys-color-surface-container-highest: transparent;\n --md-filled-text-field-label-text-color: #999999;\n }\n strong {\n flex: 1;\n padding-right: var(--spacing-medium, 8px);\n text-align: right;\n }\n\n md-elevated-button[add-project] {\n font-weight: bold;\n font-size: 16px;\n margin-left: 17px;\n padding: 13px 20px;\n\n --md-sys-color-surface-container-low: #24be7b;\n --md-sys-color-primary: #ffffff;\n --md-elevated-button-container-shape: 7px;\n }\n }\n\n div[body] {\n div[project-container] {\n height: 140px;\n margin: var(--spacing-large, 12px);\n background-color: var(--md-sys-color-on-primary);\n border: 1px solid #cccccc80;\n border-radius: var(--md-sys-shape-corner-small, 5px);\n overflow: hidden;\n\n & > a {\n display: flex;\n gap: 0 var(--spacing-large, 12px);\n width: 100%;\n height: 100%;\n text-decoration: none;\n color: #000;\n }\n\n img[project-img] {\n width: 240px;\n background-color: #cccccc80;\n }\n img[project-img][no-image] {\n object-fit: contain;\n opacity: 0.5;\n }\n\n span[project-info] {\n flex: 0.55;\n padding: var(--spacing-small, 4px);\n font-size: 14px;\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n div[name] {\n color: #2e79be;\n font-weight: bold;\n font-size: 18px;\n margin: var(--spacing-small, 4px);\n }\n }\n\n span[project-state] {\n flex: 0.45;\n padding: var(--spacing-medium, 8px);\n\n & > div {\n margin: var(--spacing-tiny, 2px);\n }\n\n div[progress] {\n position: relative;\n\n md-linear-progress {\n --md-linear-progress-track-height: 18px;\n --md-linear-progress-active-indicator-height: 18px;\n --md-linear-progress-track-shape: 5px;\n --md-sys-color-primary: #0595e526;\n --md-sys-color-surface-container-highest: #0595e52a;\n }\n\n span {\n position: absolute;\n top: 0;\n left: var(--spacing-large, 12px);\n font-size: 12px;\n font-weight: bold;\n color: #2e79be;\n\n &:last-child {\n left: unset;\n right: var(--spacing-large, 12px);\n }\n }\n }\n }\n }\n }\n `\n ]\n\n get context() {\n return {\n title: '진행중 프로젝트'\n }\n }\n\n @state() private projectName: string = ''\n @state() private projectList: Project[] = []\n @state() private projectCount: number = 0\n\n render() {\n return html`\n <div header>\n <md-filled-text-field\n name=\"projectName\"\n type=\"search\"\n label=\"프로젝트명\"\n .value=${this.projectName}\n @input=${this._onInputChange}\n @keypress=${this._onKeypress}\n >\n <md-icon slot=\"leading-icon\">search</md-icon>\n </md-filled-text-field>\n\n <strong>총 ${this.projectCount}개</strong>\n </div>\n\n <div body>\n ${this.projectList?.map((project: Project) => {\n return html`\n <div project-container>\n <a href=${`kpi-dashboard?projectId=${project.id}`}>\n <img\n ?no-image=${!project.mainPhoto?.fullpath}\n project-img\n src=${project.mainPhoto?.fullpath || '/assets/images/no-image.png'}\n />\n\n <span project-info>\n <div name>${project.name}</div>\n <div content>${project.buildingComplex.address}</div>\n <div content>면적: ${project.buildingComplex?.area?.toLocaleString() || ''}㎡</div>\n <div content>착공~준공: ${project.startDate} ~ ${project.endDate}</div>\n <div content>발주처: <strong>${project.buildingComplex.clientCompany}</strong></div>\n </span>\n\n <span project-state>\n <div progress>\n <md-linear-progress buffer=\"100\" max=\"100\" value=${project.totalProgress || 0}> </md-linear-progress>\n <span>전체</span>\n <span>${project.totalProgress || 0}%</span>\n </div>\n <div progress>\n <md-linear-progress buffer=\"100\" max=\"100\" value=${project.weeklyProgress || 0}> </md-linear-progress>\n <span>주간</span>\n <span>${project.weeklyProgress || 0}%</span>\n </div>\n <div progress>\n <md-linear-progress buffer=\"100\" max=\"100\" value=${project.kpi || 0}> </md-linear-progress>\n <span>KPI</span>\n <span>${project.kpi || 0}%</span>\n </div>\n <div progress>\n <md-linear-progress buffer=\"100\" max=\"100\" value=${project.inspPassRate || 0}> </md-linear-progress>\n <span>Inspection Passing Rate</span>\n <span>${project.inspPassRate || 0}%</span>\n </div>\n <div progress>\n <md-linear-progress buffer=\"100\" max=\"100\" value=${project.robotProgressRate || 0}> </md-linear-progress>\n <span>Robot Progress</span>\n <span>${project.robotProgressRate || 0}%</span>\n </div>\n <div progress>\n <md-linear-progress buffer=\"100\" max=\"100\" value=${project.structuralSafetyRate || 0}> </md-linear-progress>\n <span>Structural safety</span>\n <span>${project.structuralSafetyRate || 0}%</span>\n </div>\n </span>\n </a>\n </div>\n `\n })}\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n this.getProjectList()\n }\n }\n\n async getProjectList() {\n const response = await client.query({\n query: gql`\n query Projects($filters: [Filter!]) {\n projects(filters: $filters) {\n items {\n id\n name\n startDate\n endDate\n mainPhoto {\n fullpath\n }\n totalProgress\n weeklyProgress\n kpi\n inspPassRate\n robotProgressRate\n structuralSafetyRate\n buildingComplex {\n address\n area\n clientCompany\n }\n }\n total\n }\n }\n `,\n variables: {\n filters: [\n {\n name: 'name',\n operator: 'search',\n value: `%${this.projectName}%`\n },\n {\n name: 'state',\n operator: 'eq',\n value: ProjectState.ONGOING\n }\n ],\n sortings: [{ name: 'createdAt', desc: true }]\n }\n })\n\n this.projectList = response.data.projects?.items || []\n this.projectCount = response.data.projects?.total || 0\n }\n\n // Input 요소의 값이 변경될 때 호출되는 콜백 함수\n private _onInputChange(event: InputEvent) {\n const target = event.target as HTMLInputElement\n this[target.name] = target.value\n }\n\n // 검색창에서 엔터입력시 검색\n private _onKeypress(event: KeyboardEvent) {\n if (event.code === 'Enter') {\n this.getProjectList()\n }\n }\n}\n"]}
|
|
@@ -1,5 +0,0 @@
|
|
|
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';
|
|
@@ -1,219 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAGtD,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,QAAQ;IAAvC;;QAmB6B,gBAAW,GAAU,EAAE,CAAA;QAEtB,eAAU,GAAW,EAAE,CAAA;QACtB,uBAAkB,GAAY,KAAK,CAAA;QACnC,kBAAa,GAAY,KAAK,CAAA;IAkL7D,CAAC;IA9KC,IAAI,OAAO;QACT,OAAO;YACL,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC;YACxC,IAAI,EAAE,YAAY;SACnB,CAAA;IACH,CAAC;IA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AE,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.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function route(page: string): "project-list" | "project-completed-list" | "users" | "/dashboard" | undefined;
|
package/dist-client/route.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
case 'project-list':
|
|
9
|
-
import('./pages/sv-project-list');
|
|
10
|
-
return page;
|
|
11
|
-
case 'project-completed-list':
|
|
12
|
-
import('./pages/sv-project-completed-list');
|
|
13
|
-
return page;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=route.js.map
|
package/dist-client/route.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;QAEb,KAAK,cAAc;YACjB,MAAM,CAAC,yBAAyB,CAAC,CAAA;YACjC,OAAO,IAAI,CAAA;QAEb,KAAK,wBAAwB;YAC3B,MAAM,CAAC,mCAAmC,CAAC,CAAA;YAC3C,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 case 'project-list':\n import('./pages/sv-project-list')\n return page\n\n case 'project-completed-list':\n import('./pages/sv-project-completed-list')\n return page\n }\n}\n"]}
|