@things-factory/compliance 10.1.255 → 10.1.257
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-client/components/compliance-case-form.d.ts +11 -6
- package/dist-client/components/compliance-case-form.js +67 -88
- package/dist-client/components/compliance-case-form.js.map +1 -1
- package/dist-client/components/compliance-case-sheet.d.ts +14 -12
- package/dist-client/components/compliance-case-sheet.js +92 -133
- package/dist-client/components/compliance-case-sheet.js.map +1 -1
- package/dist-client/components/compliance-my-inventions.d.ts +3 -4
- package/dist-client/components/compliance-my-inventions.js +10 -30
- package/dist-client/components/compliance-my-inventions.js.map +1 -1
- package/dist-client/components/compliance-my-privacy-requests.d.ts +6 -6
- package/dist-client/components/compliance-my-privacy-requests.js +30 -66
- package/dist-client/components/compliance-my-privacy-requests.js.map +1 -1
- package/dist-client/components/compliance-my-reports.d.ts +3 -4
- package/dist-client/components/compliance-my-reports.js +19 -40
- package/dist-client/components/compliance-my-reports.js.map +1 -1
- package/dist-client/components/invention-report-form.d.ts +5 -4
- package/dist-client/components/invention-report-form.js +24 -45
- package/dist-client/components/invention-report-form.js.map +1 -1
- package/dist-client/components/my-trainings.d.ts +3 -5
- package/dist-client/components/my-trainings.js +20 -49
- package/dist-client/components/my-trainings.js.map +1 -1
- package/dist-client/components/seal-use-form.d.ts +9 -6
- package/dist-client/components/seal-use-form.js +60 -81
- package/dist-client/components/seal-use-form.js.map +1 -1
- package/dist-client/components/training-attendance-form.d.ts +6 -4
- package/dist-client/components/training-attendance-form.js +30 -50
- package/dist-client/components/training-attendance-form.js.map +1 -1
- package/dist-client/pages/regulation-detail.d.ts +17 -5
- package/dist-client/pages/regulation-detail.js +202 -133
- package/dist-client/pages/regulation-detail.js.map +1 -1
- package/dist-client/pages/regulations.d.ts +7 -5
- package/dist-client/pages/regulations.js +79 -68
- package/dist-client/pages/regulations.js.map +1 -1
- package/dist-client/regulation/regulation-fragments.js +5 -0
- package/dist-client/regulation/regulation-fragments.js.map +1 -1
- package/dist-client/regulation/regulation-guide.js +2 -1
- package/dist-client/regulation/regulation-guide.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/words.js +2 -2
- package/dist-client/words.js.map +1 -1
- package/dist-server/index.d.ts +1 -0
- package/dist-server/index.js +1 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/service/compliance-case/compliance-case-query.js +1 -1
- package/dist-server/service/compliance-case/compliance-case-query.js.map +1 -1
- package/dist-server/service/compliance-case/compliance-case-rules.d.ts +1 -3
- package/dist-server/service/compliance-case/compliance-case-rules.js +2 -4
- package/dist-server/service/compliance-case/compliance-case-rules.js.map +1 -1
- package/dist-server/service/compliance-case/compliance-case-service.d.ts +3 -3
- package/dist-server/service/compliance-case/compliance-case-service.js +4 -6
- package/dist-server/service/compliance-case/compliance-case-service.js.map +1 -1
- package/dist-server/service/compliance-case/compliance-case-type.js +1 -1
- package/dist-server/service/compliance-case/compliance-case-type.js.map +1 -1
- package/dist-server/service/compliance-case/compliance-case.js +1 -1
- package/dist-server/service/compliance-case/compliance-case.js.map +1 -1
- package/dist-server/service/index.d.ts +1 -1
- package/dist-server/service/index.js +2 -1
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/regulation/regulation-mutation.d.ts +1 -0
- package/dist-server/service/regulation/regulation-mutation.js +14 -0
- package/dist-server/service/regulation/regulation-mutation.js.map +1 -1
- package/dist-server/service/regulation/regulation-read.js +11 -2
- package/dist-server/service/regulation/regulation-read.js.map +1 -1
- package/dist-server/service/regulation/regulation-rules.d.ts +25 -6
- package/dist-server/service/regulation/regulation-rules.js +85 -29
- package/dist-server/service/regulation/regulation-rules.js.map +1 -1
- package/dist-server/service/regulation/regulation-service.d.ts +12 -0
- package/dist-server/service/regulation/regulation-service.js +48 -7
- package/dist-server/service/regulation/regulation-service.js.map +1 -1
- package/dist-server/service/regulation/regulation-type.d.ts +4 -0
- package/dist-server/service/regulation/regulation-type.js +16 -0
- package/dist-server/service/regulation/regulation-type.js.map +1 -1
- package/dist-server/service/regulation/regulation.d.ts +3 -1
- package/dist-server/service/regulation/regulation.js +12 -2
- package/dist-server/service/regulation/regulation.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/dist-server/work-doors.d.ts +1 -0
- package/dist-server/work-doors.js +15 -0
- package/dist-server/work-doors.js.map +1 -0
- package/package.json +17 -17
- package/translations/en.json +46 -14
- package/translations/es.json +46 -14
- package/translations/ja.json +46 -14
- package/translations/ko.json +46 -14
- package/translations/ms.json +46 -14
- package/translations/zh.json +46 -14
|
@@ -7,7 +7,8 @@ import '@operato/popup/ox-popup-actions.js';
|
|
|
7
7
|
import gql from 'graphql-tag';
|
|
8
8
|
import { css, html, LitElement, nothing } from 'lit';
|
|
9
9
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
10
|
-
import {
|
|
10
|
+
import { MutationController, QueryController, uploadContext } from '@operato/graphql';
|
|
11
|
+
import { DraftController } from '@operato/shell';
|
|
11
12
|
import { i18next, localize } from '@operato/i18n';
|
|
12
13
|
import { notify, openPopup } from '@operato/layout';
|
|
13
14
|
import { CommonPopupStyles, FormFieldStyles, PopupBodyStyles, PopupFieldStyles } from '@operato/styles';
|
|
@@ -39,15 +40,50 @@ let ComplianceCaseSheet = class ComplianceCaseSheet extends localize(i18next)(Li
|
|
|
39
40
|
constructor() {
|
|
40
41
|
super(...arguments);
|
|
41
42
|
this.caseId = '';
|
|
42
|
-
|
|
43
|
-
this.
|
|
44
|
-
|
|
45
|
-
this.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
/* The words typed to find an investigator. */
|
|
44
|
+
this.searched = '';
|
|
45
|
+
/* The case, read for the case the sheet opens (ADR-0190). */
|
|
46
|
+
this.record = new QueryController(this, gql `
|
|
47
|
+
query ($id: String!) {
|
|
48
|
+
complianceCase(id: $id) {
|
|
49
|
+
id kind status receivedOn investigationDueOn occurredOn description
|
|
50
|
+
investigationStartedOn protectionMeasures victimOpinion finding actionOnAccused resultNotice resultToldOn closedOn
|
|
51
|
+
reporter { id name } victim { id name } accused { id name } investigators { id name email }
|
|
52
|
+
attachments { id name fullpath }
|
|
53
|
+
entries { id writtenOn body creator { id name } attachments { id name fullpath } }
|
|
54
|
+
corrections { id field before after createdAt creator { id name } }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`, { variables: () => (this.caseId ? { id: this.caseId } : undefined) });
|
|
58
|
+
/* What is typed over the handling read, and the investigation entry being written. */
|
|
59
|
+
this.handling = new DraftController(this, {
|
|
60
|
+
read: () => {
|
|
61
|
+
const one = this.one;
|
|
62
|
+
if (!one)
|
|
63
|
+
return undefined;
|
|
64
|
+
return {
|
|
65
|
+
...Object.fromEntries(HANDLING.map(field => [field, one[field] ?? ''])),
|
|
66
|
+
investigators: (one.investigators ?? []).map((person) => ({ id: person.id, name: person.name, note: person.email }))
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
key: () => this.caseId
|
|
70
|
+
});
|
|
71
|
+
this.entry = new DraftController(this, { read: () => ({ writtenOn: today(), body: '', files: [] }), key: () => this.caseId });
|
|
72
|
+
/* Each save reads the case again; its refusal is said in the sheet. */
|
|
73
|
+
this.saves = {
|
|
74
|
+
handle: this.saving(gql `mutation ($patch: ComplianceCaseHandling!) { handleComplianceCase(patch: $patch) { id } }`),
|
|
75
|
+
entry: this.saving(gql `
|
|
76
|
+
mutation ($caseId: String!, $writtenOn: String!, $body: String!, $attach: [Upload!]) {
|
|
77
|
+
addComplianceCaseEntry(caseId: $caseId, writtenOn: $writtenOn, body: $body, attach: $attach) { id }
|
|
78
|
+
}
|
|
79
|
+
`)
|
|
80
|
+
};
|
|
81
|
+
/* The users the words find (ADR-0190). */
|
|
82
|
+
this.choices = new QueryController(this, gql `
|
|
83
|
+
query ($text: String!) {
|
|
84
|
+
complianceCaseInvestigatorChoices(text: $text) { id name note }
|
|
85
|
+
}
|
|
86
|
+
`, { variables: () => (this.searched.trim() ? { text: this.searched } : undefined), keepPrevious: true });
|
|
51
87
|
}
|
|
52
88
|
static { this.styles = [
|
|
53
89
|
CommonPopupStyles,
|
|
@@ -118,9 +154,25 @@ let ComplianceCaseSheet = class ComplianceCaseSheet extends localize(i18next)(Li
|
|
|
118
154
|
}
|
|
119
155
|
`
|
|
120
156
|
]; }
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
157
|
+
saving(mutation) {
|
|
158
|
+
return new MutationController(this, mutation, { refetch: () => [this.record], showsError: true });
|
|
159
|
+
}
|
|
160
|
+
get one() {
|
|
161
|
+
return this.record.data?.complianceCase ?? null;
|
|
162
|
+
}
|
|
163
|
+
get investigators() {
|
|
164
|
+
return this.handling.value('investigators') ?? [];
|
|
165
|
+
}
|
|
166
|
+
get working() {
|
|
167
|
+
return Object.values(this.saves).some(save => save.pending);
|
|
168
|
+
}
|
|
169
|
+
/** What went wrong last: the read, or a save. */
|
|
170
|
+
get message() {
|
|
171
|
+
const failed = this.record.error ?? this.saves.handle.error ?? this.saves.entry.error;
|
|
172
|
+
return failed ? failureOf(failed) : '';
|
|
173
|
+
}
|
|
174
|
+
get found() {
|
|
175
|
+
return this.searched.trim() ? (this.choices.data?.complianceCaseInvestigatorChoices ?? []) : [];
|
|
124
176
|
}
|
|
125
177
|
render() {
|
|
126
178
|
const one = this.one;
|
|
@@ -140,7 +192,7 @@ let ComplianceCaseSheet = class ComplianceCaseSheet extends localize(i18next)(Li
|
|
|
140
192
|
<div class="field">
|
|
141
193
|
<span>${i18next.t('field.compliance-case-investigators')}</span>
|
|
142
194
|
<div class="chips">
|
|
143
|
-
${this.investigators.map(person => html `<button type="button" ?disabled=${closed} aria-label=${i18next.t('button.compliance-case-remove')} @click=${() =>
|
|
195
|
+
${this.investigators.map(person => html `<button type="button" ?disabled=${closed} aria-label=${i18next.t('button.compliance-case-remove')} @click=${() => this.handling.set('investigators', this.investigators.filter(other => other.id !== person.id))}>
|
|
144
196
|
${person.name}<md-icon>close</md-icon>
|
|
145
197
|
</button>`)}
|
|
146
198
|
</div>
|
|
@@ -150,18 +202,18 @@ let ComplianceCaseSheet = class ComplianceCaseSheet extends localize(i18next)(Li
|
|
|
150
202
|
<div class="found">
|
|
151
203
|
${this.found
|
|
152
204
|
.filter(person => !this.investigators.some(other => other.id === person.id))
|
|
153
|
-
.map(person => html `<button type="button" @click=${() => (
|
|
205
|
+
.map(person => html `<button type="button" @click=${() => (this.handling.set('investigators', [...this.investigators, person]), (this.searched = ''))}>${person.note ? `${person.name} · ${person.note}` : person.name}</button>`)}
|
|
154
206
|
</div>`}
|
|
155
207
|
</div>
|
|
156
208
|
|
|
157
209
|
${HANDLING.map(field => DAYS.includes(field)
|
|
158
210
|
? html `<label class="field">
|
|
159
211
|
<span>${i18next.t(`field.compliance-case-${kebab(field)}`)}</span>
|
|
160
|
-
<input type="date" ?disabled=${closed} .value=${this.
|
|
212
|
+
<input type="date" ?disabled=${closed} .value=${this.handling.value(field) ?? ''} @input=${(e) => this.handling.set(field, e.target.value)} />
|
|
161
213
|
</label>`
|
|
162
214
|
: html `<label class="field">
|
|
163
215
|
<span>${i18next.t(`field.compliance-case-${kebab(field)}`)}</span>
|
|
164
|
-
<textarea ?disabled=${closed} .value=${this.
|
|
216
|
+
<textarea ?disabled=${closed} .value=${this.handling.value(field) ?? ''} @input=${(e) => this.handling.set(field, e.target.value)}></textarea>
|
|
165
217
|
</label>`)}
|
|
166
218
|
|
|
167
219
|
<h4>${i18next.t('field.compliance-case-entries')}</h4>
|
|
@@ -177,15 +229,15 @@ let ComplianceCaseSheet = class ComplianceCaseSheet extends localize(i18next)(Li
|
|
|
177
229
|
? nothing
|
|
178
230
|
: html `<label class="field">
|
|
179
231
|
<span>${i18next.t('field.compliance-case-entry-written-on')}</span>
|
|
180
|
-
<input type="date" .value=${this.
|
|
232
|
+
<input type="date" .value=${this.entry.value('writtenOn') ?? ''} @input=${(e) => this.entry.set('writtenOn', e.target.value)} />
|
|
181
233
|
</label>
|
|
182
234
|
<label class="field">
|
|
183
235
|
<span>${i18next.t('field.compliance-case-entry-body')}</span>
|
|
184
|
-
<textarea .value=${this.
|
|
236
|
+
<textarea .value=${this.entry.value('body') ?? ''} @input=${(e) => this.entry.set('body', e.target.value)}></textarea>
|
|
185
237
|
</label>
|
|
186
238
|
<div class="field">
|
|
187
|
-
<ox-input-file multiple icon="attach_file" @change=${(e) =>
|
|
188
|
-
<md-text-button ?disabled=${this.working || !this.
|
|
239
|
+
<ox-input-file multiple icon="attach_file" @change=${(e) => this.entry.set('files', [...(e.detail ?? [])])}></ox-input-file>
|
|
240
|
+
<md-text-button ?disabled=${this.working || !(this.entry.value('body') ?? '').trim()} @click=${() => this.addEntry()}>${i18next.t('button.compliance-case-add-entry')}</md-text-button>
|
|
189
241
|
</div>`}
|
|
190
242
|
${(one.corrections ?? []).length
|
|
191
243
|
? html `<h4>${i18next.t('field.compliance-case-corrections')}</h4>
|
|
@@ -202,90 +254,29 @@ let ComplianceCaseSheet = class ComplianceCaseSheet extends localize(i18next)(Li
|
|
|
202
254
|
</ox-popup-actions>
|
|
203
255
|
`;
|
|
204
256
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
const response = await client.query({
|
|
208
|
-
query: gql `
|
|
209
|
-
query ($id: String!) {
|
|
210
|
-
complianceCase(id: $id) {
|
|
211
|
-
id kind status receivedOn investigationDueOn occurredOn description
|
|
212
|
-
investigationStartedOn protectionMeasures victimOpinion finding actionOnAccused resultNotice resultToldOn closedOn
|
|
213
|
-
reporter { id name } victim { id name } accused { id name } investigators { id name email }
|
|
214
|
-
attachments { id name fullpath }
|
|
215
|
-
entries { id writtenOn body creator { id name } attachments { id name fullpath } }
|
|
216
|
-
corrections { id field before after createdAt creator { id name } }
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
`,
|
|
220
|
-
variables: { id: this.caseId },
|
|
221
|
-
fetchPolicy: 'network-only'
|
|
222
|
-
});
|
|
223
|
-
if (response.errors?.length)
|
|
224
|
-
throw response;
|
|
225
|
-
const one = response.data.complianceCase;
|
|
226
|
-
this.one = one;
|
|
227
|
-
this.form = Object.fromEntries(HANDLING.map(field => [field, one[field] ?? '']));
|
|
228
|
-
this.investigators = (one.investigators ?? []).map((person) => ({ id: person.id, name: person.name, note: person.email }));
|
|
229
|
-
}
|
|
230
|
-
catch (error) {
|
|
231
|
-
this.message = failureOf(error);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
async find(text) {
|
|
235
|
-
const response = await client.query({
|
|
236
|
-
query: gql `
|
|
237
|
-
query ($text: String!) {
|
|
238
|
-
complianceCaseInvestigatorChoices(text: $text) { id name note }
|
|
239
|
-
}
|
|
240
|
-
`,
|
|
241
|
-
variables: { text },
|
|
242
|
-
fetchPolicy: 'no-cache'
|
|
243
|
-
});
|
|
244
|
-
this.found = response.data?.complianceCaseInvestigatorChoices ?? [];
|
|
257
|
+
find(text) {
|
|
258
|
+
this.searched = text;
|
|
245
259
|
}
|
|
260
|
+
/** Only what was changed goes, as a correction of what was read. */
|
|
246
261
|
async save() {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
262
|
+
const one = this.one;
|
|
263
|
+
const changed = HANDLING.filter(field => (this.handling.value(field) ?? '') !== (one[field] ?? ''));
|
|
264
|
+
const before = (one.investigators ?? []).map((person) => person.id).sort().join();
|
|
265
|
+
const after = this.investigators.map(person => person.id).sort().join();
|
|
266
|
+
const patch = { id: one.id, ...Object.fromEntries(changed.map(field => [field, this.handling.value(field) || null])) };
|
|
267
|
+
if (before !== after)
|
|
268
|
+
patch.investigatorIds = this.investigators.map(person => person.id);
|
|
269
|
+
const saved = await this.handling.submit(() => this.saves.handle.run({ patch }));
|
|
270
|
+
if (saved)
|
|
271
|
+
notify({ message: i18next.t('text.compliance-case-saved') });
|
|
256
272
|
}
|
|
257
273
|
async addEntry() {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
`,
|
|
265
|
-
variables: { caseId: this.one.id, writtenOn: this.entryOn, body: this.entryBody, attach: this.entryFiles },
|
|
266
|
-
...(this.entryFiles.length ? { context: uploadContext(() => { }) } : {})
|
|
267
|
-
});
|
|
268
|
-
this.entryBody = '';
|
|
269
|
-
this.entryFiles = [];
|
|
270
|
-
return response;
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
async call(work) {
|
|
274
|
-
this.message = '';
|
|
275
|
-
this.working = true;
|
|
276
|
-
try {
|
|
277
|
-
const response = await work();
|
|
278
|
-
if (response.errors?.length)
|
|
279
|
-
throw response;
|
|
274
|
+
const writtenOn = this.entry.value('writtenOn');
|
|
275
|
+
const body = this.entry.value('body');
|
|
276
|
+
const files = this.entry.value('files') ?? [];
|
|
277
|
+
const added = await this.entry.submit(() => this.saves.entry.run({ caseId: this.one.id, writtenOn, body, attach: files }, { context: files.length ? uploadContext(() => { }) : undefined }));
|
|
278
|
+
if (added)
|
|
280
279
|
notify({ message: i18next.t('text.compliance-case-saved') });
|
|
281
|
-
await this.read();
|
|
282
|
-
}
|
|
283
|
-
catch (error) {
|
|
284
|
-
this.message = failureOf(error);
|
|
285
|
-
}
|
|
286
|
-
finally {
|
|
287
|
-
this.working = false;
|
|
288
|
-
}
|
|
289
280
|
}
|
|
290
281
|
};
|
|
291
282
|
__decorate([
|
|
@@ -295,39 +286,7 @@ __decorate([
|
|
|
295
286
|
__decorate([
|
|
296
287
|
state(),
|
|
297
288
|
__metadata("design:type", Object)
|
|
298
|
-
], ComplianceCaseSheet.prototype, "
|
|
299
|
-
__decorate([
|
|
300
|
-
state(),
|
|
301
|
-
__metadata("design:type", Object)
|
|
302
|
-
], ComplianceCaseSheet.prototype, "form", void 0);
|
|
303
|
-
__decorate([
|
|
304
|
-
state(),
|
|
305
|
-
__metadata("design:type", Array)
|
|
306
|
-
], ComplianceCaseSheet.prototype, "investigators", void 0);
|
|
307
|
-
__decorate([
|
|
308
|
-
state(),
|
|
309
|
-
__metadata("design:type", Array)
|
|
310
|
-
], ComplianceCaseSheet.prototype, "found", void 0);
|
|
311
|
-
__decorate([
|
|
312
|
-
state(),
|
|
313
|
-
__metadata("design:type", Object)
|
|
314
|
-
], ComplianceCaseSheet.prototype, "entryOn", void 0);
|
|
315
|
-
__decorate([
|
|
316
|
-
state(),
|
|
317
|
-
__metadata("design:type", Object)
|
|
318
|
-
], ComplianceCaseSheet.prototype, "entryBody", void 0);
|
|
319
|
-
__decorate([
|
|
320
|
-
state(),
|
|
321
|
-
__metadata("design:type", Array)
|
|
322
|
-
], ComplianceCaseSheet.prototype, "entryFiles", void 0);
|
|
323
|
-
__decorate([
|
|
324
|
-
state(),
|
|
325
|
-
__metadata("design:type", Object)
|
|
326
|
-
], ComplianceCaseSheet.prototype, "working", void 0);
|
|
327
|
-
__decorate([
|
|
328
|
-
state(),
|
|
329
|
-
__metadata("design:type", Object)
|
|
330
|
-
], ComplianceCaseSheet.prototype, "message", void 0);
|
|
289
|
+
], ComplianceCaseSheet.prototype, "searched", void 0);
|
|
331
290
|
ComplianceCaseSheet = __decorate([
|
|
332
291
|
customElement('compliance-case-sheet')
|
|
333
292
|
], ComplianceCaseSheet);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compliance-case-sheet.js","sourceRoot":"","sources":["../../client/components/compliance-case-sheet.ts"],"names":[],"mappings":";AAAA,OAAO,uCAAuC,CAAA;AAC9C,OAAO,qCAAqC,CAAA;AAC5C,OAAO,4BAA4B,CAAA;AACnC,OAAO,iCAAiC,CAAA;AACxC,OAAO,oCAAoC,CAAA;AAE3C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,E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,CAAC;IAEO,KAAK,CAAC,IAAI,CAAC,IAAwB;QACzC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QACnB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,EAAE,CAAA;YAC7B,IAAI,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAE,MAAM,QAAQ,CAAA;YAC3C,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,4BAA4B,CAAC,EAAE,CAAC,CAAA;YAC5D,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;QACnB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;QACjC,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACtB,CAAC;IACH,CAAC;;AA7L2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mDAAY;AAEtB;IAAhB,KAAK,EAAE;;gDAAwB;AACf;IAAhB,KAAK,EAAE;;iDAA0C;AACjC;IAAhB,KAAK,EAAE;;0DAAqC;AAC5B;IAAhB,KAAK,EAAE;;kDAA6B;AACpB;IAAhB,KAAK,EAAE;;oDAA0B;AACjB;IAAhB,KAAK,EAAE;;sDAAuB;AACd;IAAhB,KAAK,EAAE;;uDAAgC;AACvB;IAAhB,KAAK,EAAE;;oDAAwB;AACf;IAAhB,KAAK,EAAE;;oDAAqB;AAjFlB,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CAqQ/B","sourcesContent":["import '@material/web/button/filled-button.js'\nimport '@material/web/button/text-button.js'\nimport '@material/web/icon/icon.js'\nimport '@operato/input/ox-input-file.js'\nimport '@operato/popup/ox-popup-actions.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { client, uploadContext } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { CommonPopupStyles, FormFieldStyles, PopupBodyStyles, PopupFieldStyles } from '@operato/styles'\n\nimport { failureOf, wordOf } from '../words.js'\n\n/** Opens one case's sheet; resolves when it closes. */\nexport function openComplianceCaseSheet(id: string): Promise<void> {\n return new Promise(resolve => {\n const popup: any = openPopup(html`<compliance-case-sheet .caseId=${id} @close=${() => popup.close()}></compliance-case-sheet>`, {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.compliance-case-sheet')\n })\n popup.onclosed = () => resolve()\n })\n}\n\nconst HANDLING = ['investigationStartedOn', 'protectionMeasures', 'victimOpinion', 'finding', 'actionOnAccused', 'resultNotice', 'resultToldOn', 'closedOn']\nconst DAYS = ['investigationStartedOn', 'resultToldOn', 'closedOn']\nconst kebab = (name: string) => name.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase()\nconst today = () => {\n const now = new Date()\n return new Date(now.getTime() - now.getTimezoneOffset() * 60000).toISOString().slice(0, 10)\n}\n\ntype Person = { id: string; name: string; note?: string }\n\n/**\n * 사건 처리 (ADR-0187 decision 21) - one case whole, for its handlers and investigators: the report, who investigates\n * it, the investigation record, the protection of the victim with their view, the finding, what was done to those\n * reported against, the result told and the closing. A value changed keeps a correction; nothing is deleted.\n */\n@customElement('compliance-case-sheet')\nexport class ComplianceCaseSheet extends localize(i18next)(LitElement) {\n static styles = [\n CommonPopupStyles,\n PopupBodyStyles,\n FormFieldStyles,\n PopupFieldStyles,\n css`\n [invalid] {\n color: var(--ui-crit, var(--md-sys-color-error));\n font-size: var(--ui-t-small, 11.5px);\n }\n [invalid]:empty {\n display: none;\n }\n dl {\n display: grid;\n grid-template-columns: max-content 1fr;\n gap: 2px var(--spacing-large, 12px);\n margin: 0;\n }\n dt {\n color: var(--ui-muted);\n }\n dd {\n margin: 0;\n white-space: pre-wrap;\n }\n h4 {\n margin: var(--spacing-medium, 8px) 0 0;\n }\n ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n li {\n padding: var(--spacing-small, 4px) 0;\n border-top: 1px solid var(--ui-line-soft, var(--md-sys-color-outline-variant));\n white-space: pre-wrap;\n }\n .muted {\n color: var(--ui-muted);\n }\n .chips,\n .found {\n display: flex;\n flex-wrap: wrap;\n gap: var(--spacing-small, 4px);\n }\n .chips button,\n .found button {\n display: inline-flex;\n align-items: center;\n gap: 2px;\n padding: 2px var(--spacing-medium, 8px);\n border: 1px solid var(--ui-line-soft, var(--md-sys-color-outline-variant));\n border-radius: 999px;\n background: none;\n color: inherit;\n font: inherit;\n cursor: pointer;\n }\n .chips md-icon {\n --md-icon-size: 14px;\n }\n textarea {\n min-height: 64px;\n }\n `\n ]\n\n @property({ type: String }) caseId = ''\n\n @state() private one: any = null\n @state() private form: Record<string, string> = {}\n @state() private investigators: Person[] = []\n @state() private found: Person[] = []\n @state() private entryOn = today()\n @state() private entryBody = ''\n @state() private entryFiles: File[] = []\n @state() private working = false\n @state() private message = ''\n\n connectedCallback() {\n super.connectedCallback()\n this.read()\n }\n\n render() {\n const one = this.one\n if (!one) return html`<div class=\"body\"><span invalid>${this.message}</span></div>`\n const closed = !!one.closedOn\n const fact = (field: string, value: any) => (value ? html`<dt>${i18next.t(`field.compliance-case-${field}`)}</dt><dd>${value}</dd>` : nothing)\n return html`\n <div class=\"body\">\n <dl>\n ${fact('kind', wordOf('compliance-case-kind', one.kind))} ${fact('status', wordOf('compliance-case-status', one.status))} ${fact('received-on', one.receivedOn)}\n ${fact('investigation-due-on', one.investigationDueOn)} ${fact('reporter', one.reporter?.name)} ${fact('victim', one.victim?.name)}\n ${fact('accused', (one.accused ?? []).map((person: any) => person.name).join(', '))} ${fact('occurred-on', one.occurredOn)} ${fact('description', one.description)}\n ${fact('attachments', (one.attachments ?? []).length ? html`${one.attachments.map((file: any) => html`<a href=${file.fullpath} target=\"_blank\">${file.name}</a> `)}` : '')}\n </dl>\n\n <div class=\"field\">\n <span>${i18next.t('field.compliance-case-investigators')}</span>\n <div class=\"chips\">\n ${this.investigators.map(\n person =>\n html`<button type=\"button\" ?disabled=${closed} aria-label=${i18next.t('button.compliance-case-remove')} @click=${() => (this.investigators = this.investigators.filter(other => other.id !== person.id))}>\n ${person.name}<md-icon>close</md-icon>\n </button>`\n )}\n </div>\n ${closed\n ? nothing\n : html`<input placeholder=${i18next.t('text.compliance-case-find-person')} @input=${(e: any) => this.find(e.target.value)} />\n <div class=\"found\">\n ${this.found\n .filter(person => !this.investigators.some(other => other.id === person.id))\n .map(person => html`<button type=\"button\" @click=${() => ((this.investigators = [...this.investigators, person]), (this.found = []))}>${person.note ? `${person.name} · ${person.note}` : person.name}</button>`)}\n </div>`}\n </div>\n\n ${HANDLING.map(field =>\n DAYS.includes(field)\n ? html`<label class=\"field\">\n <span>${i18next.t(`field.compliance-case-${kebab(field)}`)}</span>\n <input type=\"date\" ?disabled=${closed} .value=${this.form[field] ?? ''} @input=${(e: any) => (this.form = { ...this.form, [field]: e.target.value })} />\n </label>`\n : html`<label class=\"field\">\n <span>${i18next.t(`field.compliance-case-${kebab(field)}`)}</span>\n <textarea ?disabled=${closed} .value=${this.form[field] ?? ''} @input=${(e: any) => (this.form = { ...this.form, [field]: e.target.value })}></textarea>\n </label>`\n )}\n\n <h4>${i18next.t('field.compliance-case-entries')}</h4>\n ${(one.entries ?? []).length\n ? html`<ul>\n ${one.entries.map(\n (entry: any) => html`<li>\n <span class=\"muted\">${entry.writtenOn} · ${entry.creator?.name ?? ''}</span><br />${entry.body}\n ${(entry.attachments ?? []).map((file: any) => html` <a href=${file.fullpath} target=\"_blank\">${file.name}</a>`)}\n </li>`\n )}\n </ul>`\n : html`<span class=\"muted\">${i18next.t('text.compliance-case-entries-empty')}</span>`}\n ${closed\n ? nothing\n : html`<label class=\"field\">\n <span>${i18next.t('field.compliance-case-entry-written-on')}</span>\n <input type=\"date\" .value=${this.entryOn} @input=${(e: any) => (this.entryOn = e.target.value)} />\n </label>\n <label class=\"field\">\n <span>${i18next.t('field.compliance-case-entry-body')}</span>\n <textarea .value=${this.entryBody} @input=${(e: any) => (this.entryBody = e.target.value)}></textarea>\n </label>\n <div class=\"field\">\n <ox-input-file multiple icon=\"attach_file\" @change=${(e: CustomEvent) => (this.entryFiles = [...((e.detail as File[]) ?? [])])}></ox-input-file>\n <md-text-button ?disabled=${this.working || !this.entryBody.trim()} @click=${() => this.addEntry()}>${i18next.t('button.compliance-case-add-entry')}</md-text-button>\n </div>`}\n ${(one.corrections ?? []).length\n ? html`<h4>${i18next.t('field.compliance-case-corrections')}</h4>\n <ul>\n ${one.corrections.map(\n (row: any) =>\n html`<li class=\"muted\">${new Date(row.createdAt).toLocaleString()} · ${row.creator?.name ?? ''} · ${i18next.t(`field.compliance-case-${kebab(row.field === 'investigatorIds' ? 'investigators' : row.field)}`)}: ${row.before ?? ''} → ${row.after ?? ''}</li>`\n )}\n </ul>`\n : nothing}\n <span invalid>${this.message}</span>\n </div>\n\n <ox-popup-actions>\n <md-text-button slot=\"cancel\" @click=${() => this.dispatchEvent(new CustomEvent('close'))}>${i18next.t('button.close')}</md-text-button>\n ${closed ? nothing : html`<md-filled-button slot=\"confirm\" ?disabled=${this.working} @click=${() => this.save()}>${i18next.t('button.save')}</md-filled-button>`}\n </ox-popup-actions>\n `\n }\n\n private async read() {\n try {\n const response = await client.query({\n query: gql`\n query ($id: String!) {\n complianceCase(id: $id) {\n id kind status receivedOn investigationDueOn occurredOn description\n investigationStartedOn protectionMeasures victimOpinion finding actionOnAccused resultNotice resultToldOn closedOn\n reporter { id name } victim { id name } accused { id name } investigators { id name email }\n attachments { id name fullpath }\n entries { id writtenOn body creator { id name } attachments { id name fullpath } }\n corrections { id field before after createdAt creator { id name } }\n }\n }\n `,\n variables: { id: this.caseId },\n fetchPolicy: 'network-only'\n })\n if (response.errors?.length) throw response\n const one = response.data.complianceCase\n this.one = one\n this.form = Object.fromEntries(HANDLING.map(field => [field, one[field] ?? '']))\n this.investigators = (one.investigators ?? []).map((person: any) => ({ id: person.id, name: person.name, note: person.email }))\n } catch (error) {\n this.message = failureOf(error)\n }\n }\n\n private async find(text: string) {\n const response = await client.query({\n query: gql`\n query ($text: String!) {\n complianceCaseInvestigatorChoices(text: $text) { id name note }\n }\n `,\n variables: { text },\n fetchPolicy: 'no-cache'\n })\n this.found = response.data?.complianceCaseInvestigatorChoices ?? []\n }\n\n private async save() {\n await this.call(async () => {\n const changed = HANDLING.filter(field => (this.form[field] ?? '') !== (this.one[field] ?? ''))\n const before = (this.one.investigators ?? []).map((person: any) => person.id).sort().join()\n const after = this.investigators.map(person => person.id).sort().join()\n const patch: any = { id: this.one.id, ...Object.fromEntries(changed.map(field => [field, this.form[field] || null])) }\n if (before !== after) patch.investigatorIds = this.investigators.map(person => person.id)\n return await client.mutate({ mutation: gql`mutation ($patch: ComplianceCaseHandling!) { handleComplianceCase(patch: $patch) { id } }`, variables: { patch } })\n })\n }\n\n private async addEntry() {\n await this.call(async () => {\n const response = await client.mutate({\n mutation: gql`\n mutation ($caseId: String!, $writtenOn: String!, $body: String!, $attach: [Upload!]) {\n addComplianceCaseEntry(caseId: $caseId, writtenOn: $writtenOn, body: $body, attach: $attach) { id }\n }\n `,\n variables: { caseId: this.one.id, writtenOn: this.entryOn, body: this.entryBody, attach: this.entryFiles },\n ...(this.entryFiles.length ? { context: uploadContext(() => {}) } : {})\n })\n this.entryBody = ''\n this.entryFiles = []\n return response\n })\n }\n\n private async call(work: () => Promise<any>) {\n this.message = ''\n this.working = true\n try {\n const response = await work()\n if (response.errors?.length) throw response\n notify({ message: i18next.t('text.compliance-case-saved') })\n await this.read()\n } catch (error) {\n this.message = failureOf(error)\n } finally {\n this.working = false\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compliance-case-sheet.js","sourceRoot":"","sources":["../../client/components/compliance-case-sheet.ts"],"names":[],"mappings":";AAAA,OAAO,uCAAuC,CAAA;AA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,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;QAC7C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CACzC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAC/I,CAAA;QACD,IAAI,KAAK;YAAE,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,4BAA4B,CAAC,EAAE,CAAC,CAAA;IACzE,CAAC;;AAtM2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mDAAY;AAGtB;IAAhB,KAAK,EAAE;;qDAAsB;AA1EnB,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CA8Q/B","sourcesContent":["import '@material/web/button/filled-button.js'\nimport '@material/web/button/text-button.js'\nimport '@material/web/icon/icon.js'\nimport '@operato/input/ox-input-file.js'\nimport '@operato/popup/ox-popup-actions.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { MutationController, QueryController, uploadContext } from '@operato/graphql'\nimport { DraftController } from '@operato/shell'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { CommonPopupStyles, FormFieldStyles, PopupBodyStyles, PopupFieldStyles } from '@operato/styles'\n\nimport { failureOf, wordOf } from '../words.js'\n\n/** Opens one case's sheet; resolves when it closes. */\nexport function openComplianceCaseSheet(id: string): Promise<void> {\n return new Promise(resolve => {\n const popup: any = openPopup(html`<compliance-case-sheet .caseId=${id} @close=${() => popup.close()}></compliance-case-sheet>`, {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.compliance-case-sheet')\n })\n popup.onclosed = () => resolve()\n })\n}\n\nconst HANDLING = ['investigationStartedOn', 'protectionMeasures', 'victimOpinion', 'finding', 'actionOnAccused', 'resultNotice', 'resultToldOn', 'closedOn']\nconst DAYS = ['investigationStartedOn', 'resultToldOn', 'closedOn']\nconst kebab = (name: string) => name.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase()\nconst today = () => {\n const now = new Date()\n return new Date(now.getTime() - now.getTimezoneOffset() * 60000).toISOString().slice(0, 10)\n}\n\ntype Person = { id: string; name: string; note?: string }\ntype Handling = Record<string, any> & { investigators: Person[] }\ntype Entry = { writtenOn: string; body: string; files: File[] }\n\n/**\n * 사건 처리 (ADR-0187 decision 21) - one case whole, for its handlers and investigators: the report, who investigates\n * it, the investigation record, the protection of the victim with their view, the finding, what was done to those\n * reported against, the result told and the closing. A value changed keeps a correction; nothing is deleted.\n */\n@customElement('compliance-case-sheet')\nexport class ComplianceCaseSheet extends localize(i18next)(LitElement) {\n static styles = [\n CommonPopupStyles,\n PopupBodyStyles,\n FormFieldStyles,\n PopupFieldStyles,\n css`\n [invalid] {\n color: var(--ui-crit, var(--md-sys-color-error));\n font-size: var(--ui-t-small, 11.5px);\n }\n [invalid]:empty {\n display: none;\n }\n dl {\n display: grid;\n grid-template-columns: max-content 1fr;\n gap: 2px var(--spacing-large, 12px);\n margin: 0;\n }\n dt {\n color: var(--ui-muted);\n }\n dd {\n margin: 0;\n white-space: pre-wrap;\n }\n h4 {\n margin: var(--spacing-medium, 8px) 0 0;\n }\n ul {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n li {\n padding: var(--spacing-small, 4px) 0;\n border-top: 1px solid var(--ui-line-soft, var(--md-sys-color-outline-variant));\n white-space: pre-wrap;\n }\n .muted {\n color: var(--ui-muted);\n }\n .chips,\n .found {\n display: flex;\n flex-wrap: wrap;\n gap: var(--spacing-small, 4px);\n }\n .chips button,\n .found button {\n display: inline-flex;\n align-items: center;\n gap: 2px;\n padding: 2px var(--spacing-medium, 8px);\n border: 1px solid var(--ui-line-soft, var(--md-sys-color-outline-variant));\n border-radius: 999px;\n background: none;\n color: inherit;\n font: inherit;\n cursor: pointer;\n }\n .chips md-icon {\n --md-icon-size: 14px;\n }\n textarea {\n min-height: 64px;\n }\n `\n ]\n\n @property({ type: String }) caseId = ''\n\n /* The words typed to find an investigator. */\n @state() private searched = ''\n\n /* The case, read for the case the sheet opens (ADR-0190). */\n private record = new QueryController(\n this,\n gql`\n query ($id: String!) {\n complianceCase(id: $id) {\n id kind status receivedOn investigationDueOn occurredOn description\n investigationStartedOn protectionMeasures victimOpinion finding actionOnAccused resultNotice resultToldOn closedOn\n reporter { id name } victim { id name } accused { id name } investigators { id name email }\n attachments { id name fullpath }\n entries { id writtenOn body creator { id name } attachments { id name fullpath } }\n corrections { id field before after createdAt creator { id name } }\n }\n }\n `,\n { variables: () => (this.caseId ? { id: this.caseId } : undefined) }\n )\n\n /* What is typed over the handling read, and the investigation entry being written. */\n private handling = new DraftController<Handling>(this, {\n read: () => {\n const one = this.one\n if (!one) return undefined\n return {\n ...Object.fromEntries(HANDLING.map(field => [field, one[field] ?? ''])),\n investigators: (one.investigators ?? []).map((person: any) => ({ id: person.id, name: person.name, note: person.email }))\n } as Handling\n },\n key: () => this.caseId\n })\n private entry = new DraftController<Entry>(this, { read: () => ({ writtenOn: today(), body: '', files: [] }), key: () => this.caseId })\n\n /* Each save reads the case again; its refusal is said in the sheet. */\n private saves = {\n handle: this.saving(gql`mutation ($patch: ComplianceCaseHandling!) { handleComplianceCase(patch: $patch) { id } }`),\n entry: this.saving(gql`\n mutation ($caseId: String!, $writtenOn: String!, $body: String!, $attach: [Upload!]) {\n addComplianceCaseEntry(caseId: $caseId, writtenOn: $writtenOn, body: $body, attach: $attach) { id }\n }\n `)\n }\n\n private saving(mutation: any) {\n return new MutationController(this, mutation, { refetch: () => [this.record], showsError: true })\n }\n\n private get one(): any {\n return this.record.data?.complianceCase ?? null\n }\n\n private get investigators(): Person[] {\n return this.handling.value('investigators') ?? []\n }\n\n private get working() {\n return Object.values(this.saves).some(save => save.pending)\n }\n\n /** What went wrong last: the read, or a save. */\n private get message() {\n const failed = this.record.error ?? this.saves.handle.error ?? this.saves.entry.error\n return failed ? failureOf(failed) : ''\n }\n\n /* The users the words find (ADR-0190). */\n private choices = new QueryController(\n this,\n gql`\n query ($text: String!) {\n complianceCaseInvestigatorChoices(text: $text) { id name note }\n }\n `,\n { variables: () => (this.searched.trim() ? { text: this.searched } : undefined), keepPrevious: true }\n )\n\n private get found(): Person[] {\n return this.searched.trim() ? (this.choices.data?.complianceCaseInvestigatorChoices ?? []) : []\n }\n\n render() {\n const one = this.one\n if (!one) return html`<div class=\"body\"><span invalid>${this.message}</span></div>`\n const closed = !!one.closedOn\n const fact = (field: string, value: any) => (value ? html`<dt>${i18next.t(`field.compliance-case-${field}`)}</dt><dd>${value}</dd>` : nothing)\n return html`\n <div class=\"body\">\n <dl>\n ${fact('kind', wordOf('compliance-case-kind', one.kind))} ${fact('status', wordOf('compliance-case-status', one.status))} ${fact('received-on', one.receivedOn)}\n ${fact('investigation-due-on', one.investigationDueOn)} ${fact('reporter', one.reporter?.name)} ${fact('victim', one.victim?.name)}\n ${fact('accused', (one.accused ?? []).map((person: any) => person.name).join(', '))} ${fact('occurred-on', one.occurredOn)} ${fact('description', one.description)}\n ${fact('attachments', (one.attachments ?? []).length ? html`${one.attachments.map((file: any) => html`<a href=${file.fullpath} target=\"_blank\">${file.name}</a> `)}` : '')}\n </dl>\n\n <div class=\"field\">\n <span>${i18next.t('field.compliance-case-investigators')}</span>\n <div class=\"chips\">\n ${this.investigators.map(\n person =>\n html`<button type=\"button\" ?disabled=${closed} aria-label=${i18next.t('button.compliance-case-remove')} @click=${() => this.handling.set('investigators', this.investigators.filter(other => other.id !== person.id))}>\n ${person.name}<md-icon>close</md-icon>\n </button>`\n )}\n </div>\n ${closed\n ? nothing\n : html`<input placeholder=${i18next.t('text.compliance-case-find-person')} @input=${(e: any) => this.find(e.target.value)} />\n <div class=\"found\">\n ${this.found\n .filter(person => !this.investigators.some(other => other.id === person.id))\n .map(person => html`<button type=\"button\" @click=${() => (this.handling.set('investigators', [...this.investigators, person]), (this.searched = ''))}>${person.note ? `${person.name} · ${person.note}` : person.name}</button>`)}\n </div>`}\n </div>\n\n ${HANDLING.map(field =>\n DAYS.includes(field)\n ? html`<label class=\"field\">\n <span>${i18next.t(`field.compliance-case-${kebab(field)}`)}</span>\n <input type=\"date\" ?disabled=${closed} .value=${this.handling.value(field) ?? ''} @input=${(e: any) => this.handling.set(field, e.target.value)} />\n </label>`\n : html`<label class=\"field\">\n <span>${i18next.t(`field.compliance-case-${kebab(field)}`)}</span>\n <textarea ?disabled=${closed} .value=${this.handling.value(field) ?? ''} @input=${(e: any) => this.handling.set(field, e.target.value)}></textarea>\n </label>`\n )}\n\n <h4>${i18next.t('field.compliance-case-entries')}</h4>\n ${(one.entries ?? []).length\n ? html`<ul>\n ${one.entries.map(\n (entry: any) => html`<li>\n <span class=\"muted\">${entry.writtenOn} · ${entry.creator?.name ?? ''}</span><br />${entry.body}\n ${(entry.attachments ?? []).map((file: any) => html` <a href=${file.fullpath} target=\"_blank\">${file.name}</a>`)}\n </li>`\n )}\n </ul>`\n : html`<span class=\"muted\">${i18next.t('text.compliance-case-entries-empty')}</span>`}\n ${closed\n ? nothing\n : html`<label class=\"field\">\n <span>${i18next.t('field.compliance-case-entry-written-on')}</span>\n <input type=\"date\" .value=${this.entry.value('writtenOn') ?? ''} @input=${(e: any) => this.entry.set('writtenOn', e.target.value)} />\n </label>\n <label class=\"field\">\n <span>${i18next.t('field.compliance-case-entry-body')}</span>\n <textarea .value=${this.entry.value('body') ?? ''} @input=${(e: any) => this.entry.set('body', e.target.value)}></textarea>\n </label>\n <div class=\"field\">\n <ox-input-file multiple icon=\"attach_file\" @change=${(e: CustomEvent) => this.entry.set('files', [...((e.detail as File[]) ?? [])])}></ox-input-file>\n <md-text-button ?disabled=${this.working || !(this.entry.value('body') ?? '').trim()} @click=${() => this.addEntry()}>${i18next.t('button.compliance-case-add-entry')}</md-text-button>\n </div>`}\n ${(one.corrections ?? []).length\n ? html`<h4>${i18next.t('field.compliance-case-corrections')}</h4>\n <ul>\n ${one.corrections.map(\n (row: any) =>\n html`<li class=\"muted\">${new Date(row.createdAt).toLocaleString()} · ${row.creator?.name ?? ''} · ${i18next.t(`field.compliance-case-${kebab(row.field === 'investigatorIds' ? 'investigators' : row.field)}`)}: ${row.before ?? ''} → ${row.after ?? ''}</li>`\n )}\n </ul>`\n : nothing}\n <span invalid>${this.message}</span>\n </div>\n\n <ox-popup-actions>\n <md-text-button slot=\"cancel\" @click=${() => this.dispatchEvent(new CustomEvent('close'))}>${i18next.t('button.close')}</md-text-button>\n ${closed ? nothing : html`<md-filled-button slot=\"confirm\" ?disabled=${this.working} @click=${() => this.save()}>${i18next.t('button.save')}</md-filled-button>`}\n </ox-popup-actions>\n `\n }\n\n private find(text: string) {\n this.searched = text\n }\n\n /** Only what was changed goes, as a correction of what was read. */\n private async save() {\n const one = this.one\n const changed = HANDLING.filter(field => (this.handling.value(field) ?? '') !== (one[field] ?? ''))\n const before = (one.investigators ?? []).map((person: any) => person.id).sort().join()\n const after = this.investigators.map(person => person.id).sort().join()\n const patch: any = { id: one.id, ...Object.fromEntries(changed.map(field => [field, this.handling.value(field) || null])) }\n if (before !== after) patch.investigatorIds = this.investigators.map(person => person.id)\n const saved = await this.handling.submit(() => this.saves.handle.run({ patch }))\n if (saved) notify({ message: i18next.t('text.compliance-case-saved') })\n }\n\n private async addEntry() {\n const writtenOn = this.entry.value('writtenOn')\n const body = this.entry.value('body')\n const files = this.entry.value('files') ?? []\n const added = await this.entry.submit(() =>\n this.saves.entry.run({ caseId: this.one.id, writtenOn, body, attach: files }, { context: files.length ? uploadContext(() => {}) : undefined })\n )\n if (added) notify({ message: i18next.t('text.compliance-case-saved') })\n }\n}\n"]}
|
|
@@ -7,10 +7,9 @@ declare const ComplianceMyInventions_base: (new (...args: any[]) => LitElement)
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class ComplianceMyInventions extends ComplianceMyInventions_base {
|
|
9
9
|
static styles: import("lit").CSSResult;
|
|
10
|
-
private
|
|
11
|
-
private
|
|
12
|
-
|
|
13
|
-
private read;
|
|
10
|
+
private mine;
|
|
11
|
+
private get rows();
|
|
12
|
+
private get failure();
|
|
14
13
|
render(): import("lit-html").TemplateResult<1>;
|
|
15
14
|
private report;
|
|
16
15
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { __decorate
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
2
|
import '@material/web/button/filled-button.js';
|
|
3
3
|
import gql from 'graphql-tag';
|
|
4
4
|
import { css, html, LitElement } from 'lit';
|
|
5
|
-
import { customElement
|
|
6
|
-
import {
|
|
5
|
+
import { customElement } from 'lit/decorators.js';
|
|
6
|
+
import { QueryController } from '@operato/graphql';
|
|
7
7
|
import { i18next, localize } from '@operato/i18n';
|
|
8
8
|
import { LegalRecordFiles } from '../legal-record/legal-record-files.js';
|
|
9
9
|
import { failureOf, wordOf } from '../words.js';
|
|
@@ -15,8 +15,8 @@ import { openInventionReportForm } from './invention-report-form.js';
|
|
|
15
15
|
let ComplianceMyInventions = class ComplianceMyInventions extends localize(i18next)(LitElement) {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
|
-
|
|
19
|
-
this.
|
|
18
|
+
/* The inventions the person is one of the inventors of (ADR-0190). */
|
|
19
|
+
this.mine = new QueryController(this, gql `query { myInventions { id title reportedOn decisionDueOn decision decisionToldOn inventors { id name } } }`);
|
|
20
20
|
}
|
|
21
21
|
static { this.styles = css `
|
|
22
22
|
:host {
|
|
@@ -64,23 +64,11 @@ let ComplianceMyInventions = class ComplianceMyInventions extends localize(i18ne
|
|
|
64
64
|
color: var(--md-sys-color-error);
|
|
65
65
|
}
|
|
66
66
|
`; }
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
this.read();
|
|
67
|
+
get rows() {
|
|
68
|
+
return this.mine.data?.myInventions ?? [];
|
|
70
69
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const response = await client.query({
|
|
74
|
-
query: gql `query { myInventions { id title reportedOn decisionDueOn decision decisionToldOn inventors { id name } } }`,
|
|
75
|
-
fetchPolicy: 'network-only'
|
|
76
|
-
});
|
|
77
|
-
if (response.errors?.length)
|
|
78
|
-
throw response;
|
|
79
|
-
this.rows = response.data.myInventions;
|
|
80
|
-
}
|
|
81
|
-
catch (error) {
|
|
82
|
-
this.failure = failureOf(error);
|
|
83
|
-
}
|
|
70
|
+
get failure() {
|
|
71
|
+
return this.mine.error ? failureOf(this.mine.error) : '';
|
|
84
72
|
}
|
|
85
73
|
render() {
|
|
86
74
|
return html `
|
|
@@ -115,17 +103,9 @@ let ComplianceMyInventions = class ComplianceMyInventions extends localize(i18ne
|
|
|
115
103
|
}
|
|
116
104
|
async report() {
|
|
117
105
|
if (await openInventionReportForm())
|
|
118
|
-
this.
|
|
106
|
+
this.mine.refetch();
|
|
119
107
|
}
|
|
120
108
|
};
|
|
121
|
-
__decorate([
|
|
122
|
-
state(),
|
|
123
|
-
__metadata("design:type", Array)
|
|
124
|
-
], ComplianceMyInventions.prototype, "rows", void 0);
|
|
125
|
-
__decorate([
|
|
126
|
-
state(),
|
|
127
|
-
__metadata("design:type", Object)
|
|
128
|
-
], ComplianceMyInventions.prototype, "failure", void 0);
|
|
129
109
|
ComplianceMyInventions = __decorate([
|
|
130
110
|
customElement('compliance-my-inventions')
|
|
131
111
|
], ComplianceMyInventions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compliance-my-inventions.js","sourceRoot":"","sources":["../../client/components/compliance-my-inventions.ts"],"names":[],"mappings":";AAAA,OAAO,uCAAuC,CAAA;AAE9C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"compliance-my-inventions.js","sourceRoot":"","sources":["../../client/components/compliance-my-inventions.ts"],"names":[],"mappings":";AAAA,OAAO,uCAAuC,CAAA;AAE9C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAEpE;;;GAGG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAAlE;;QAgDL,sEAAsE;QAC9D,SAAI,GAAG,IAAI,eAAe,CAChC,IAAI,EACJ,GAAG,CAAA,4GAA4G,CAChH,CAAA;IA+CH,CAAC;aAlGQ,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6ClB,AA7CY,CA6CZ;IAQD,IAAY,IAAI;QAC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AC,cAAc,IAAI,EAAE,EAAE;gBAC/E,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,6BAA6B,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,aAAa,EAAE,CAAC;;2CAE/C,GAAG,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,2BAA2B,CAAC;oBACzJ,CACP;mBACM;YACX,CAAC,CAAC,IAAI,CAAA,mBAAmB,OAAO,CAAC,CAAC,CAAC,2BAA2B,CAAC,MAAM;KACxE,CAAA;IACH,CAAC;IAEO,KAAK,CAAC,MAAM;QAClB,IAAI,MAAM,uBAAuB,EAAE;YAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAA;IAC1D,CAAC;;AAlGU,sBAAsB;IADlC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,sBAAsB,CAmGlC","sourcesContent":["import '@material/web/button/filled-button.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { QueryController } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\n\nimport { LegalRecordFiles } from '../legal-record/legal-record-files.js'\nimport { failureOf, wordOf } from '../words.js'\nimport { openInventionReportForm } from './invention-report-form.js'\n\n/**\n * 직무발명 신고 - an employee's own entry (ADR-0187 decisions 10, 24): the inventions one is an inventor of, the day the\n * company is to tell its decision by and what it told, and the way to report another. Nothing of anyone else's.\n */\n@customElement('compliance-my-inventions')\nexport class ComplianceMyInventions extends localize(i18next)(LitElement) {\n static styles = css`\n :host {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-medium, 8px);\n }\n header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--spacing-medium, 8px);\n }\n header p,\n .none {\n margin: 0;\n color: var(--ui-muted, var(--md-sys-color-on-surface-variant));\n }\n table {\n width: 100%;\n border-collapse: collapse;\n }\n th,\n td {\n padding: 6px 4px;\n text-align: left;\n border-bottom: 1px solid var(--ui-line-soft, var(--md-sys-color-outline-variant));\n }\n th {\n color: var(--ui-muted, var(--md-sys-color-on-surface-variant));\n font-weight: normal;\n }\n td.day {\n white-space: nowrap;\n }\n button[quiet] {\n border: none;\n background: none;\n padding: 0;\n color: var(--md-sys-color-primary);\n font: inherit;\n cursor: pointer;\n }\n .failure {\n color: var(--md-sys-color-error);\n }\n `\n\n /* The inventions the person is one of the inventors of (ADR-0190). */\n private mine = new QueryController(\n this,\n gql`query { myInventions { id title reportedOn decisionDueOn decision decisionToldOn inventors { id name } } }`\n )\n\n private get rows(): any[] {\n return this.mine.data?.myInventions ?? []\n }\n\n private get failure() {\n return this.mine.error ? failureOf(this.mine.error) : ''\n }\n\n render() {\n return html`\n <header>\n <p>${i18next.t('text.invention-mine-guide')}</p>\n <md-filled-button @click=${() => this.report()}>${i18next.t('button.invention-report')}</md-filled-button>\n </header>\n ${this.failure ? html`<p class=\"failure\">${this.failure}</p>` : ''}\n ${this.rows.length\n ? html`<table>\n <tr>\n <th>${i18next.t('field.invention-title')}</th>\n <th>${i18next.t('field.invention-inventors')}</th>\n <th>${i18next.t('field.invention-reported-on')}</th>\n <th>${i18next.t('field.invention-decision')}</th>\n <th>${i18next.t('field.invention-files')}</th>\n </tr>\n ${this.rows.map(\n one => html`<tr>\n <td>${one.title}</td>\n <td>${(one.inventors ?? []).map((person: any) => person.name).join(', ')}</td>\n <td class=\"day\">${one.reportedOn}</td>\n <td class=\"day\">\n ${one.decision\n ? `${wordOf('invention-decision', one.decision)} · ${one.decisionToldOn ?? ''}`\n : i18next.t('text.invention-decision-due', { day: one.decisionDueOn })}\n </td>\n <td><button quiet @click=${() => LegalRecordFiles.open('inventionFiles', 'attachInventionFiles', one.id, one.title)}>${i18next.t('button.legal-record-files')}</button></td>\n </tr>`\n )}\n </table>`\n : html`<p class=\"none\">${i18next.t('text.invention-mine-empty')}</p>`}\n `\n }\n\n private async report() {\n if (await openInventionReportForm()) this.mine.refetch()\n }\n}\n"]}
|
|
@@ -12,8 +12,9 @@ export declare class CompliancePrivacyRequestForm extends CompliancePrivacyReque
|
|
|
12
12
|
static styles: import("lit").CSSResult[];
|
|
13
13
|
private kind;
|
|
14
14
|
private details;
|
|
15
|
-
private
|
|
16
|
-
private
|
|
15
|
+
private raising;
|
|
16
|
+
private get working();
|
|
17
|
+
private get message();
|
|
17
18
|
render(): import("lit-html").TemplateResult<1>;
|
|
18
19
|
private raise;
|
|
19
20
|
}
|
|
@@ -24,11 +25,10 @@ declare const ComplianceMyPrivacyRequests_base: (new (...args: any[]) => LitElem
|
|
|
24
25
|
*/
|
|
25
26
|
export declare class ComplianceMyPrivacyRequests extends ComplianceMyPrivacyRequests_base {
|
|
26
27
|
static styles: import("lit").CSSResult;
|
|
27
|
-
private
|
|
28
|
-
private
|
|
29
|
-
|
|
28
|
+
private mine;
|
|
29
|
+
private get requests();
|
|
30
|
+
private get message();
|
|
30
31
|
render(): import("lit-html").TemplateResult<1>;
|
|
31
|
-
private read;
|
|
32
32
|
private raise;
|
|
33
33
|
}
|
|
34
34
|
export {};
|