@things-factory/pdf 10.1.259 → 10.1.260
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/pages/issued-document/issued-document-list.d.ts +9 -11
- package/dist-client/pages/issued-document/issued-document-list.js +69 -114
- package/dist-client/pages/issued-document/issued-document-list.js.map +1 -1
- package/dist-client/pages/pdf-template/pdf-template-list-page.d.ts +1 -0
- package/dist-client/pages/pdf-template/pdf-template-list-page.js +15 -11
- package/dist-client/pages/pdf-template/pdf-template-list-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import '@material/web/icon/icon.js';
|
|
2
2
|
import '@operato/data-grist/ox-grist.js';
|
|
3
|
-
import '@operato/
|
|
4
|
-
import '@operato/input/ox-select.js';
|
|
5
|
-
import '@operato/popup/ox-popup-list.js';
|
|
3
|
+
import '@operato/data-grist/ox-filters-form.js';
|
|
6
4
|
import { FetchOption } from '@operato/data-grist';
|
|
7
5
|
import { PageView } from '@operato/shell';
|
|
8
6
|
declare const IssuedDocumentList_base: (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
|
|
@@ -18,10 +16,6 @@ export declare class IssuedDocumentList extends IssuedDocumentList_base {
|
|
|
18
16
|
static styles: import("lit").CSSResult[];
|
|
19
17
|
private gristConfig;
|
|
20
18
|
private kindsRead;
|
|
21
|
-
private kind;
|
|
22
|
-
private states;
|
|
23
|
-
private from;
|
|
24
|
-
private to;
|
|
25
19
|
private selected;
|
|
26
20
|
private reason;
|
|
27
21
|
private revoking;
|
|
@@ -37,19 +31,23 @@ export declare class IssuedDocumentList extends IssuedDocumentList_base {
|
|
|
37
31
|
action: () => Promise<void | null>;
|
|
38
32
|
}[];
|
|
39
33
|
search: {
|
|
40
|
-
handler: (search: string) =>
|
|
34
|
+
handler: (search: string) => string;
|
|
41
35
|
value: string;
|
|
42
36
|
};
|
|
37
|
+
filter: {
|
|
38
|
+
handler: () => void;
|
|
39
|
+
};
|
|
43
40
|
};
|
|
44
41
|
render(): import("lit-html").TemplateResult<1>;
|
|
45
|
-
|
|
42
|
+
willUpdate(): void;
|
|
43
|
+
private configOf;
|
|
46
44
|
pageUpdated(changes: any): Promise<void>;
|
|
47
45
|
private conditions;
|
|
48
|
-
fetchHandler({ page, limit }: FetchOption): Promise<{
|
|
46
|
+
fetchHandler({ page, limit, ...asked }: FetchOption): Promise<{
|
|
49
47
|
total: any;
|
|
50
48
|
records: any;
|
|
51
49
|
}>;
|
|
52
|
-
countHandler({ signal }: FetchOption): Promise<{
|
|
50
|
+
countHandler({ signal, ...asked }: FetchOption): Promise<{
|
|
53
51
|
state: {
|
|
54
52
|
[k: string]: any;
|
|
55
53
|
};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import '@material/web/icon/icon.js';
|
|
3
3
|
import '@operato/data-grist/ox-grist.js';
|
|
4
|
-
import '@operato/
|
|
5
|
-
import '@operato/input/ox-select.js';
|
|
6
|
-
import '@operato/popup/ox-popup-list.js';
|
|
4
|
+
import '@operato/data-grist/ox-filters-form.js';
|
|
7
5
|
import gql from 'graphql-tag';
|
|
8
6
|
import { css, html, nothing } from 'lit';
|
|
9
7
|
import { customElement, query, state } from 'lit/decorators.js';
|
|
10
|
-
import { DataGrist } from '@operato/data-grist';
|
|
8
|
+
import { DataGrist, isFilterCondition } from '@operato/data-grist';
|
|
11
9
|
import { client, MutationController, QueryController } from '@operato/graphql';
|
|
12
10
|
import { i18next, localize } from '@operato/i18n';
|
|
13
11
|
import { notify } from '@operato/layout';
|
|
14
12
|
import { PageView } from '@operato/shell';
|
|
15
|
-
import { CommonGristStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles';
|
|
13
|
+
import { CommonGristStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles';
|
|
16
14
|
import { downloadIssuedFile, issueDocument, issuedDocumentKindWord as kindWord, openPdfView } from '../../issue-document';
|
|
15
|
+
/** A filter the grid holds with nothing chosen - an empty select, no chips, both days open. */
|
|
17
16
|
const FIELDS = 'id kind number subjectName purpose submittedTo state revokedAt revokeReason createdAt creator { id name } file { id fullpath name }';
|
|
18
17
|
/**
|
|
19
18
|
* 발급 대장 (ADR-0176 decision 2) - the documents issued, newest first: kind, number, whom or what each is about, what
|
|
@@ -28,12 +27,11 @@ let IssuedDocumentList = class IssuedDocumentList extends localize(i18next)(Page
|
|
|
28
27
|
this.mine = false;
|
|
29
28
|
/* The kinds this person may read, and the ones they issue here (ADR-0190). */
|
|
30
29
|
this.kindsRead = new QueryController(this, gql `query { issuedDocumentKinds { kind asOf issuable refId } }`);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.to = '';
|
|
30
|
+
/*
|
|
31
|
+
* The kind, 발급 · 취소 and the days issued on are the grid's own filters, in its headroom: the grid keeps them, the
|
|
32
|
+
* search and the page in the address, so a shared link, coming back and reloading read the same list
|
|
33
|
+
* (FOOTER-BUTTON-REVIEW G09), and a change of them reads page 1 again.
|
|
34
|
+
*/
|
|
37
35
|
this.selected = null;
|
|
38
36
|
this.reason = '';
|
|
39
37
|
this.revoking = new MutationController(this, gql `
|
|
@@ -48,6 +46,7 @@ let IssuedDocumentList = class IssuedDocumentList extends localize(i18next)(Page
|
|
|
48
46
|
WorkSurfacePageStyles,
|
|
49
47
|
ScrollbarStyles,
|
|
50
48
|
CommonGristStyles,
|
|
49
|
+
CommonHeaderStyles,
|
|
51
50
|
css `
|
|
52
51
|
:host {
|
|
53
52
|
display: flex;
|
|
@@ -56,13 +55,6 @@ let IssuedDocumentList = class IssuedDocumentList extends localize(i18next)(Page
|
|
|
56
55
|
ox-grist {
|
|
57
56
|
flex: 1;
|
|
58
57
|
}
|
|
59
|
-
.filters {
|
|
60
|
-
display: flex;
|
|
61
|
-
flex-wrap: wrap;
|
|
62
|
-
gap: var(--spacing-medium, 8px) var(--spacing-large, 12px);
|
|
63
|
-
align-items: center;
|
|
64
|
-
padding: var(--spacing-medium, 8px) var(--spacing-large, 12px);
|
|
65
|
-
}
|
|
66
58
|
.revoke {
|
|
67
59
|
display: flex;
|
|
68
60
|
flex-wrap: wrap;
|
|
@@ -82,27 +74,6 @@ let IssuedDocumentList = class IssuedDocumentList extends localize(i18next)(Page
|
|
|
82
74
|
padding: var(--input-padding);
|
|
83
75
|
font: var(--input-font);
|
|
84
76
|
}
|
|
85
|
-
.filters input[type='date'] {
|
|
86
|
-
background-color: var(--input-field-background, var(--md-sys-color-surface-container-highest));
|
|
87
|
-
color: var(--input-field-color, var(--md-sys-color-on-surface));
|
|
88
|
-
border: var(--border-dim-color);
|
|
89
|
-
border-radius: var(--border-radius);
|
|
90
|
-
padding: var(--input-padding);
|
|
91
|
-
font: var(--input-font);
|
|
92
|
-
}
|
|
93
|
-
.filters label {
|
|
94
|
-
display: flex;
|
|
95
|
-
align-items: center;
|
|
96
|
-
gap: var(--spacing-medium, 8px);
|
|
97
|
-
font: var(--label-font);
|
|
98
|
-
white-space: nowrap;
|
|
99
|
-
}
|
|
100
|
-
.filters ox-input-select-buttons {
|
|
101
|
-
flex: none;
|
|
102
|
-
}
|
|
103
|
-
ox-select {
|
|
104
|
-
min-width: 200px;
|
|
105
|
-
}
|
|
106
77
|
`
|
|
107
78
|
]; }
|
|
108
79
|
get kinds() {
|
|
@@ -123,49 +94,26 @@ let IssuedDocumentList = class IssuedDocumentList extends localize(i18next)(Page
|
|
|
123
94
|
icon: 'workspace_premium',
|
|
124
95
|
action: async () => (await issueDocument({ kind: one.kind, refId: one.refId ?? undefined, withAsOf: one.asOf })) && this.grist.fetch()
|
|
125
96
|
})),
|
|
126
|
-
search: { handler: (search) => (
|
|
97
|
+
search: { handler: (search) => (this.grist.searchText = search), value: this.grist?.searchText || '' },
|
|
98
|
+
filter: { handler: () => this.grist.toggleHeadroom() }
|
|
127
99
|
};
|
|
128
100
|
}
|
|
129
101
|
render() {
|
|
130
102
|
const row = this.selected;
|
|
131
103
|
return html `
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
<ox-popup-list align-left nowrap with-search>
|
|
146
|
-
<div option value="">${i18next.t('text.all')}</div>
|
|
147
|
-
${this.kinds.map(kind => html `<div option value=${kind}>${kindWord(kind)}</div>`)}
|
|
148
|
-
</ox-popup-list>
|
|
149
|
-
</ox-select>
|
|
150
|
-
</label>`
|
|
151
|
-
: nothing}
|
|
152
|
-
<label
|
|
153
|
-
>${i18next.t('field.state')}
|
|
154
|
-
<ox-input-select-buttons
|
|
155
|
-
multiple
|
|
156
|
-
.options=${['published', 'revoked'].map(value => ({ value, display: i18next.t(`text.issued-document-${value}`), count: this.grist?.counts?.state?.[value] ?? 0 }))}
|
|
157
|
-
.value=${this.states}
|
|
158
|
-
@change=${(e) => ((this.states = e.target.value ?? []), this.grist.fetch())}
|
|
159
|
-
></ox-input-select-buttons>
|
|
160
|
-
</label>
|
|
161
|
-
<label
|
|
162
|
-
>${i18next.t('field.issued-document-issued-on')}
|
|
163
|
-
<input type="date" .value=${this.from} @change=${(e) => ((this.from = e.target.value), this.grist.fetch())} />
|
|
164
|
-
~
|
|
165
|
-
<input type="date" .value=${this.to} @change=${(e) => ((this.to = e.target.value), this.grist.fetch())} />
|
|
166
|
-
</label>
|
|
167
|
-
</div>
|
|
168
|
-
<ox-grist .mode=${'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} .countHandler=${this.countHandler.bind(this)} @counts-change=${() => this.requestUpdate()} @select-record-change=${(e) => this.select(e.detail?.records)}></ox-grist>
|
|
104
|
+
<ox-grist
|
|
105
|
+
.mode=${'GRID'}
|
|
106
|
+
search-mode="term"
|
|
107
|
+
.config=${this.gristConfig}
|
|
108
|
+
.fetchHandler=${this.fetchHandler.bind(this)}
|
|
109
|
+
.countHandler=${this.countHandler.bind(this)}
|
|
110
|
+
?url-params-sensitive=${this.active}
|
|
111
|
+
@select-record-change=${(e) => this.select(e.detail?.records)}
|
|
112
|
+
>
|
|
113
|
+
<div slot="headroom" class="header">
|
|
114
|
+
<div class="filters"><ox-filters-form without-search></ox-filters-form></div>
|
|
115
|
+
</div>
|
|
116
|
+
</ox-grist>
|
|
169
117
|
${row && row.state === 'published'
|
|
170
118
|
? html `<div class="revoke">
|
|
171
119
|
${i18next.t('text.issued-document-revoke', { number: row.number })}
|
|
@@ -175,8 +123,13 @@ let IssuedDocumentList = class IssuedDocumentList extends localize(i18next)(Page
|
|
|
175
123
|
: nothing}
|
|
176
124
|
`;
|
|
177
125
|
}
|
|
178
|
-
|
|
179
|
-
|
|
126
|
+
/* The kinds this person reads are the kind filter's choices: the grid is configured once they are known. */
|
|
127
|
+
willUpdate() {
|
|
128
|
+
if (!this.gristConfig && (this.kindsRead.data || this.kindsRead.error))
|
|
129
|
+
this.gristConfig = this.configOf(this.kinds);
|
|
130
|
+
}
|
|
131
|
+
configOf(kinds) {
|
|
132
|
+
return {
|
|
180
133
|
columns: [
|
|
181
134
|
{ type: 'gutter', gutterName: 'sequence' },
|
|
182
135
|
{ type: 'gutter', gutterName: 'row-selector', multiple: false },
|
|
@@ -200,18 +153,40 @@ let IssuedDocumentList = class IssuedDocumentList extends localize(i18next)(Page
|
|
|
200
153
|
}
|
|
201
154
|
},
|
|
202
155
|
{ type: 'string', name: 'number', header: i18next.t('field.issued-document-number'), width: 140 },
|
|
203
|
-
{
|
|
156
|
+
{
|
|
157
|
+
type: 'string',
|
|
158
|
+
name: 'kind',
|
|
159
|
+
header: i18next.t('field.issued-document-kind'),
|
|
160
|
+
record: { renderer: (value) => kindWord(value) },
|
|
161
|
+
width: 140,
|
|
162
|
+
/* Only one who reads more than one kind has a kind to choose. */
|
|
163
|
+
filter: {
|
|
164
|
+
operator: 'eq',
|
|
165
|
+
type: 'select',
|
|
166
|
+
hidden: kinds.length < 2,
|
|
167
|
+
options: [{ value: '', display: i18next.t('text.all') }, ...kinds.map(kind => ({ value: kind, display: kindWord(kind) }))]
|
|
168
|
+
}
|
|
169
|
+
},
|
|
204
170
|
{ type: 'string', name: 'subjectName', header: i18next.t('field.issued-document-subject'), width: 160 },
|
|
205
171
|
{ type: 'string', name: 'purpose', header: i18next.t('field.issued-document-purpose'), width: 160 },
|
|
206
172
|
{ type: 'string', name: 'submittedTo', header: i18next.t('field.issued-document-submitted-to'), width: 160 },
|
|
207
|
-
{
|
|
173
|
+
{
|
|
174
|
+
type: 'datetime',
|
|
175
|
+
name: 'createdAt',
|
|
176
|
+
header: i18next.t('field.issued-document-issued-at'),
|
|
177
|
+
width: 160,
|
|
178
|
+
/* The days issued on, 'YYYY-MM-DD', either end open. */
|
|
179
|
+
filter: { operator: 'between', type: 'date' }
|
|
180
|
+
},
|
|
208
181
|
{ type: 'resource-object', name: 'creator', header: i18next.t('field.issued-document-issuer'), width: 110 },
|
|
209
182
|
{
|
|
210
183
|
type: 'string',
|
|
211
184
|
name: 'state',
|
|
212
185
|
header: i18next.t('field.state'),
|
|
213
186
|
record: { renderer: (value, _c, record) => (value === 'revoked' ? `${i18next.t('text.issued-document-revoked')} · ${record.revokeReason ?? ''}` : i18next.t('text.issued-document-published')) },
|
|
214
|
-
width: 200
|
|
187
|
+
width: 200,
|
|
188
|
+
/* 발급 · 취소 - none chosen is both; each chip with how many it holds under the other conditions. */
|
|
189
|
+
filter: { operator: 'in', type: 'select-buttons', options: ['published', 'revoked'].map(value => ({ value, display: i18next.t(`text.issued-document-${value}`) })) }
|
|
215
190
|
}
|
|
216
191
|
],
|
|
217
192
|
rows: { appendable: false, selectable: { multiple: false } }
|
|
@@ -221,21 +196,17 @@ let IssuedDocumentList = class IssuedDocumentList extends localize(i18next)(Page
|
|
|
221
196
|
if (this.active && changes.active && this.grist)
|
|
222
197
|
this.grist.fetch();
|
|
223
198
|
}
|
|
224
|
-
/*
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
filters.push({ name: 'q', operator: 'search', value: this.grist.searchText });
|
|
233
|
-
return filters;
|
|
199
|
+
/*
|
|
200
|
+
* The grid's filters as the ledger's door takes them: the kind, the days issued on ([from, to], either end open) and
|
|
201
|
+
* the state as they are, a filter with nothing chosen left out, and the search term as the door's `q`.
|
|
202
|
+
*/
|
|
203
|
+
conditions(filters = [], search) {
|
|
204
|
+
const term = search?.trim();
|
|
205
|
+
/* Every condition by the grid's rule - an operator without a value too (data-grist isFilterCondition). */
|
|
206
|
+
return [...filters.filter(isFilterCondition), ...(term ? [{ name: 'q', operator: 'search', value: term }] : [])];
|
|
234
207
|
}
|
|
235
|
-
async fetchHandler({ page = 1, limit = 100 }) {
|
|
236
|
-
const filters = this.conditions();
|
|
237
|
-
if (this.states.length)
|
|
238
|
-
filters.push({ name: 'state', operator: 'in', value: this.states });
|
|
208
|
+
async fetchHandler({ page = 1, limit = 100, ...asked }) {
|
|
209
|
+
const filters = this.conditions(asked.filters, asked.search);
|
|
239
210
|
const response = await client.query({
|
|
240
211
|
query: gql(this.mine
|
|
241
212
|
? `query ($filters: [Filter!], $pagination: Pagination) { list: readableIssuedDocuments(filters: $filters, pagination: $pagination, mine: true) { items { ${FIELDS} } total } }`
|
|
@@ -247,8 +218,8 @@ let IssuedDocumentList = class IssuedDocumentList extends localize(i18next)(Page
|
|
|
247
218
|
return { total: response.data?.list?.total ?? 0, records: response.data?.list?.items ?? [] };
|
|
248
219
|
}
|
|
249
220
|
/* The state chips' numbers: the list's door totals each state under the other conditions, in one request. */
|
|
250
|
-
async countHandler({ signal }) {
|
|
251
|
-
const filters = this.conditions();
|
|
221
|
+
async countHandler({ signal, ...asked }) {
|
|
222
|
+
const filters = this.conditions(asked.filters, asked.search).filter(one => one.name !== 'state');
|
|
252
223
|
const list = this.mine ? 'readableIssuedDocuments' : 'issuedDocuments';
|
|
253
224
|
const states = ['published', 'revoked'];
|
|
254
225
|
const response = await client.query({
|
|
@@ -281,22 +252,6 @@ __decorate([
|
|
|
281
252
|
state(),
|
|
282
253
|
__metadata("design:type", Object)
|
|
283
254
|
], IssuedDocumentList.prototype, "gristConfig", void 0);
|
|
284
|
-
__decorate([
|
|
285
|
-
state(),
|
|
286
|
-
__metadata("design:type", Object)
|
|
287
|
-
], IssuedDocumentList.prototype, "kind", void 0);
|
|
288
|
-
__decorate([
|
|
289
|
-
state(),
|
|
290
|
-
__metadata("design:type", Array)
|
|
291
|
-
], IssuedDocumentList.prototype, "states", void 0);
|
|
292
|
-
__decorate([
|
|
293
|
-
state(),
|
|
294
|
-
__metadata("design:type", Object)
|
|
295
|
-
], IssuedDocumentList.prototype, "from", void 0);
|
|
296
|
-
__decorate([
|
|
297
|
-
state(),
|
|
298
|
-
__metadata("design:type", Object)
|
|
299
|
-
], IssuedDocumentList.prototype, "to", void 0);
|
|
300
255
|
__decorate([
|
|
301
256
|
state(),
|
|
302
257
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issued-document-list.js","sourceRoot":"","sources":["../../../client/pages/issued-document/issued-document-list.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,iCAAiC,CAAA;AACxC,OAAO,2CAA2C,CAAA;AAClD,OAAO,6BAA6B,CAAA;AACpC,OAAO,iCAAiC,CAAA;AAExC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE/D,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE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3FjC,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CA+Q9B;;AAED,qGAAqG;AAE9F,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,kBAAkB;IAArD;;QACK,SAAI,GAAG,IAAI,CAAA;IACvB,CAAC;CAAA,CAAA;AAFY,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CAEhC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist/ox-grist.js'\nimport '@operato/input/ox-input-select-buttons.js'\nimport '@operato/input/ox-select.js'\nimport '@operato/popup/ox-popup-list.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, nothing } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\n\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client, MutationController, QueryController } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify } from '@operato/layout'\nimport { PageView } from '@operato/shell'\nimport { CommonGristStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\n\nimport { downloadIssuedFile, issueDocument, issuedDocumentKindWord as kindWord, openPdfView } from '../../issue-document'\n\nconst FIELDS = 'id kind number subjectName purpose submittedTo state revokedAt revokeReason createdAt creator { id name } file { id fullpath name }'\n\n/**\n * 발급 대장 (ADR-0176 decision 2) - the documents issued, newest first: kind, number, whom or what each is about, what\n * for and to whom, who issued it and when, and whether it was revoked. Each person sees the kinds their own rules let\n * them read (the server asks each kind's module) - an employee their own certificates - and issues here what is about\n * the company or about themselves. A file is saved as it was issued; a mistaken one is revoked with a reason.\n */\n@customElement('issued-document-list')\nexport class IssuedDocumentList extends localize(i18next)(PageView) {\n /** 내 증명서: one's own - about oneself or issued by oneself - and the documents one issues here. Else the whole ledger. */\n protected mine = false\n\n static styles = [\n WorkSurfacePageStyles,\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n }\n ox-grist {\n flex: 1;\n }\n .filters {\n display: flex;\n flex-wrap: wrap;\n gap: var(--spacing-medium, 8px) var(--spacing-large, 12px);\n align-items: center;\n padding: var(--spacing-medium, 8px) var(--spacing-large, 12px);\n }\n .revoke {\n display: flex;\n flex-wrap: wrap;\n gap: var(--spacing-medium, 8px);\n align-items: center;\n padding: var(--spacing-medium, 8px) var(--spacing-large, 12px);\n border-top: var(--border-dim-color);\n font: var(--label-font);\n }\n .revoke input {\n flex: 1;\n min-width: 200px;\n background-color: var(--input-field-background, var(--md-sys-color-surface-container-highest));\n color: var(--input-field-color, var(--md-sys-color-on-surface));\n border: var(--border-dim-color);\n border-radius: var(--border-radius);\n padding: var(--input-padding);\n font: var(--input-font);\n }\n .filters input[type='date'] {\n background-color: var(--input-field-background, var(--md-sys-color-surface-container-highest));\n color: var(--input-field-color, var(--md-sys-color-on-surface));\n border: var(--border-dim-color);\n border-radius: var(--border-radius);\n padding: var(--input-padding);\n font: var(--input-font);\n }\n .filters label {\n display: flex;\n align-items: center;\n gap: var(--spacing-medium, 8px);\n font: var(--label-font);\n white-space: nowrap;\n }\n .filters ox-input-select-buttons {\n flex: none;\n }\n ox-select {\n min-width: 200px;\n }\n `\n ]\n\n @state() private gristConfig: any\n /* The kinds this person may read, and the ones they issue here (ADR-0190). */\n private kindsRead = new QueryController<{ issuedDocumentKinds: { kind: string; asOf: boolean; issuable: boolean; refId?: string | null }[] }>(\n this,\n gql`query { issuedDocumentKinds { kind asOf issuable refId } }`\n )\n @state() private kind = ''\n /* 발급 · 취소 - none chosen is both. */\n @state() private states: string[] = []\n /* The days issued on, 'YYYY-MM-DD', either end open. */\n @state() private from = ''\n @state() private to = ''\n @state() private selected: any = null\n @state() private reason = ''\n private revoking = new MutationController(\n this,\n gql`\n mutation ($id: String!, $reason: String!) {\n revokeIssuedDocument(id: $id, reason: $reason) {\n id\n }\n }\n `\n )\n\n @query('ox-grist') private grist!: DataGrist\n\n private get kinds(): string[] {\n return (this.kindsRead.data?.issuedDocumentKinds ?? []).map(one => one.kind)\n }\n\n private get issuable() {\n return (this.kindsRead.data?.issuedDocumentKinds ?? []).filter(one => one.issuable)\n }\n\n private get busy() {\n return this.revoking.pending\n }\n\n get context() {\n return {\n title: i18next.t(this.mine ? 'title.my-issued-documents' : 'title.issued-document-list'),\n /* Issued in 내 증명서: a document about oneself (one's 재직증명서), and one about the company itself (a 주주명부). */\n actions: (this.mine ? this.issuable : []).map(one => ({\n title: i18next.t('button.issue-kind', { kind: kindWord(one.kind) }),\n icon: 'workspace_premium',\n action: async () => (await issueDocument({ kind: one.kind, refId: one.refId ?? undefined, withAsOf: one.asOf })) && this.grist.fetch()\n })),\n search: { handler: (search: string) => ((this.grist.searchText = search), this.grist.fetch()), value: this.grist?.searchText }\n }\n }\n\n render() {\n const row = this.selected\n return html`\n <div class=\"filters\">\n ${this.kinds.length > 1\n ? html`<label\n >${i18next.t('field.issued-document-kind')}\n <ox-select\n .value=${this.kind}\n @change=${(e: CustomEvent) => {\n const next = String(e.detail ?? '')\n if (next !== this.kind) (this.kind = next), this.grist.fetch()\n }}\n >\n <span slot=\"label\">${this.kind ? kindWord(this.kind) : i18next.t('text.all')}</span>\n <ox-popup-list align-left nowrap with-search>\n <div option value=\"\">${i18next.t('text.all')}</div>\n ${this.kinds.map(kind => html`<div option value=${kind}>${kindWord(kind)}</div>`)}\n </ox-popup-list>\n </ox-select>\n </label>`\n : nothing}\n <label\n >${i18next.t('field.state')}\n <ox-input-select-buttons\n multiple\n .options=${['published', 'revoked'].map(value => ({ value, display: i18next.t(`text.issued-document-${value}`), count: this.grist?.counts?.state?.[value] ?? 0 }))}\n .value=${this.states}\n @change=${(e: CustomEvent) => ((this.states = (e.target as any).value ?? []), this.grist.fetch())}\n ></ox-input-select-buttons>\n </label>\n <label\n >${i18next.t('field.issued-document-issued-on')}\n <input type=\"date\" .value=${this.from} @change=${(e: any) => ((this.from = e.target.value), this.grist.fetch())} />\n ~\n <input type=\"date\" .value=${this.to} @change=${(e: any) => ((this.to = e.target.value), this.grist.fetch())} />\n </label>\n </div>\n <ox-grist .mode=${'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} .countHandler=${this.countHandler.bind(this)} @counts-change=${() => this.requestUpdate()} @select-record-change=${(e: any) => this.select(e.detail?.records)}></ox-grist>\n ${row && row.state === 'published'\n ? html`<div class=\"revoke\">\n ${i18next.t('text.issued-document-revoke', { number: row.number })}\n <input .value=${this.reason} placeholder=${i18next.t('field.issued-document-revoke-reason')} ?disabled=${this.busy} @input=${(e: any) => (this.reason = e.target.value)} />\n <button danger ?disabled=${this.busy || !this.reason.trim()} @click=${() => this.revoke()}>${i18next.t('button.issued-document-revoke')}</button>\n </div>`\n : nothing}\n `\n }\n\n async pageInitialized() {\n this.gristConfig = {\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: false },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'download',\n title: i18next.t('button.issued-document-open'),\n handlers: {\n click: (_c: any, _d: any, _col: any, record: any) =>\n record?.file?.fullpath && downloadIssuedFile(record.file).catch((error: any) => notify({ level: 'error', message: error?.message ?? String(error) }))\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'visibility',\n title: i18next.t('button.pdf-preview'),\n handlers: {\n /* The issued file itself, as it went out - its number and seal - opened in place under its own name. */\n click: (_c: any, _d: any, _col: any, record: any) => record?.file?.fullpath && openPdfView(record.file.fullpath, `${kindWord(record.kind)} · ${record.number}`)\n }\n },\n { type: 'string', name: 'number', header: i18next.t('field.issued-document-number'), width: 140 },\n { type: 'string', name: 'kind', header: i18next.t('field.issued-document-kind'), record: { renderer: (value: string) => kindWord(value) }, width: 140 },\n { type: 'string', name: 'subjectName', header: i18next.t('field.issued-document-subject'), width: 160 },\n { type: 'string', name: 'purpose', header: i18next.t('field.issued-document-purpose'), width: 160 },\n { type: 'string', name: 'submittedTo', header: i18next.t('field.issued-document-submitted-to'), width: 160 },\n { type: 'datetime', name: 'createdAt', header: i18next.t('field.issued-document-issued-at'), width: 160 },\n { type: 'resource-object', name: 'creator', header: i18next.t('field.issued-document-issuer'), width: 110 },\n {\n type: 'string',\n name: 'state',\n header: i18next.t('field.state'),\n record: { renderer: (value: string, _c: any, record: any) => (value === 'revoked' ? `${i18next.t('text.issued-document-revoked')} · ${record.revokeReason ?? ''}` : i18next.t('text.issued-document-published')) },\n width: 200\n }\n ],\n rows: { appendable: false, selectable: { multiple: false } }\n }\n }\n\n async pageUpdated(changes: any) {\n if ((this as any).active && changes.active && this.grist) this.grist.fetch()\n }\n\n /* The list's conditions other than the state: the kind, the days issued on and the search. */\n private conditions(): any[] {\n const filters: any[] = []\n if (this.kind) filters.push({ name: 'kind', operator: 'eq', value: this.kind })\n if (this.from || this.to) filters.push({ name: 'createdAt', operator: 'between', value: [this.from, this.to] })\n if (this.grist?.searchText) filters.push({ name: 'q', operator: 'search', value: this.grist.searchText })\n return filters\n }\n\n async fetchHandler({ page = 1, limit = 100 }: FetchOption) {\n const filters = this.conditions()\n if (this.states.length) filters.push({ name: 'state', operator: 'in', value: this.states })\n const response = await client.query({\n query: gql(\n this.mine\n ? `query ($filters: [Filter!], $pagination: Pagination) { list: readableIssuedDocuments(filters: $filters, pagination: $pagination, mine: true) { items { ${FIELDS} } total } }`\n : `query ($filters: [Filter!], $pagination: Pagination) { list: issuedDocuments(filters: $filters, pagination: $pagination) { items { ${FIELDS} } total } }`\n ),\n variables: { filters, pagination: { page, limit } },\n fetchPolicy: 'no-cache'\n })\n this.select([])\n return { total: response.data?.list?.total ?? 0, records: response.data?.list?.items ?? [] }\n }\n\n /* The state chips' numbers: the list's door totals each state under the other conditions, in one request. */\n async countHandler({ signal }: FetchOption) {\n const filters = this.conditions()\n const list = this.mine ? 'readableIssuedDocuments' : 'issuedDocuments'\n const states = ['published', 'revoked']\n const response = await client.query({\n query: gql(\n `query (${states.map((_, at) => `$f${at}: [Filter!]`).join(', ')}) { ${states\n .map((_, at) => `c${at}: ${list}(filters: $f${at}, pagination: { page: 1, limit: 1 }${this.mine ? ', mine: true' : ''}) { total }`)\n .join(' ')} }`\n ),\n variables: Object.fromEntries(states.map((state, at) => [`f${at}`, [...filters, { name: 'state', operator: 'in', value: [state] }]])),\n fetchPolicy: 'no-cache',\n context: { fetchOptions: { signal }, queryDeduplication: false }\n })\n if (response.errors?.length) throw response.errors[0]\n return { state: Object.fromEntries(states.map((state, at) => [state, response.data?.[`c${at}`]?.total ?? 0])) }\n }\n\n private select(records: any[] | undefined) {\n const row = records?.[0] ?? null\n if (row?.id !== this.selected?.id) this.reason = ''\n this.selected = row\n }\n\n private async revoke() {\n const { id, number } = this.selected\n if (!(await this.revoking.run({ id, reason: this.reason }))) return\n notify({ message: i18next.t('text.issued-document-revoked-done', { number }) })\n this.grist.fetch()\n }\n}\n\n/** 내 정보 › 내 증명서 - the ledger's rows that are one's own, and the documents one issues for oneself. */\n@customElement('my-issued-document-list')\nexport class MyIssuedDocumentList extends IssuedDocumentList {\n protected mine = true\n}\n"]}
|
|
1
|
+
{"version":3,"file":"issued-document-list.js","sourceRoot":"","sources":["../../../client/pages/issued-document/issued-document-list.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,iCAAiC,CAAA;AACxC,OAAO,wCAAwC,CAAA;AAE/C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE/D,OAAO,EAAE,SAAS,EAAe,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAC/E,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC9E,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,E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;AAE9F,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,kBAAkB;IAArD;;QACK,SAAI,GAAG,IAAI,CAAA;IACvB,CAAC;CAAA,CAAA;AAFY,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CAEhC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist/ox-grist.js'\nimport '@operato/data-grist/ox-filters-form.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, nothing } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\n\nimport { DataGrist, FetchOption, isFilterCondition } from '@operato/data-grist'\nimport { client, MutationController, QueryController } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify } from '@operato/layout'\nimport { PageView } from '@operato/shell'\nimport { CommonGristStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\n\nimport { downloadIssuedFile, issueDocument, issuedDocumentKindWord as kindWord, openPdfView } from '../../issue-document'\n\n/** A filter the grid holds with nothing chosen - an empty select, no chips, both days open. */\n\nconst FIELDS = 'id kind number subjectName purpose submittedTo state revokedAt revokeReason createdAt creator { id name } file { id fullpath name }'\n\n/**\n * 발급 대장 (ADR-0176 decision 2) - the documents issued, newest first: kind, number, whom or what each is about, what\n * for and to whom, who issued it and when, and whether it was revoked. Each person sees the kinds their own rules let\n * them read (the server asks each kind's module) - an employee their own certificates - and issues here what is about\n * the company or about themselves. A file is saved as it was issued; a mistaken one is revoked with a reason.\n */\n@customElement('issued-document-list')\nexport class IssuedDocumentList extends localize(i18next)(PageView) {\n /** 내 증명서: one's own - about oneself or issued by oneself - and the documents one issues here. Else the whole ledger. */\n protected mine = false\n\n static styles = [\n WorkSurfacePageStyles,\n ScrollbarStyles,\n CommonGristStyles,\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n }\n ox-grist {\n flex: 1;\n }\n .revoke {\n display: flex;\n flex-wrap: wrap;\n gap: var(--spacing-medium, 8px);\n align-items: center;\n padding: var(--spacing-medium, 8px) var(--spacing-large, 12px);\n border-top: var(--border-dim-color);\n font: var(--label-font);\n }\n .revoke input {\n flex: 1;\n min-width: 200px;\n background-color: var(--input-field-background, var(--md-sys-color-surface-container-highest));\n color: var(--input-field-color, var(--md-sys-color-on-surface));\n border: var(--border-dim-color);\n border-radius: var(--border-radius);\n padding: var(--input-padding);\n font: var(--input-font);\n }\n `\n ]\n\n @state() private gristConfig: any\n /* The kinds this person may read, and the ones they issue here (ADR-0190). */\n private kindsRead = new QueryController<{ issuedDocumentKinds: { kind: string; asOf: boolean; issuable: boolean; refId?: string | null }[] }>(\n this,\n gql`query { issuedDocumentKinds { kind asOf issuable refId } }`\n )\n /*\n * The kind, 발급 · 취소 and the days issued on are the grid's own filters, in its headroom: the grid keeps them, the\n * search and the page in the address, so a shared link, coming back and reloading read the same list\n * (FOOTER-BUTTON-REVIEW G09), and a change of them reads page 1 again.\n */\n @state() private selected: any = null\n @state() private reason = ''\n private revoking = new MutationController(\n this,\n gql`\n mutation ($id: String!, $reason: String!) {\n revokeIssuedDocument(id: $id, reason: $reason) {\n id\n }\n }\n `\n )\n\n @query('ox-grist') private grist!: DataGrist\n\n private get kinds(): string[] {\n return (this.kindsRead.data?.issuedDocumentKinds ?? []).map(one => one.kind)\n }\n\n private get issuable() {\n return (this.kindsRead.data?.issuedDocumentKinds ?? []).filter(one => one.issuable)\n }\n\n private get busy() {\n return this.revoking.pending\n }\n\n get context() {\n return {\n title: i18next.t(this.mine ? 'title.my-issued-documents' : 'title.issued-document-list'),\n /* Issued in 내 증명서: a document about oneself (one's 재직증명서), and one about the company itself (a 주주명부). */\n actions: (this.mine ? this.issuable : []).map(one => ({\n title: i18next.t('button.issue-kind', { kind: kindWord(one.kind) }),\n icon: 'workspace_premium',\n action: async () => (await issueDocument({ kind: one.kind, refId: one.refId ?? undefined, withAsOf: one.asOf })) && this.grist.fetch()\n })),\n search: { handler: (search: string) => (this.grist.searchText = search), value: this.grist?.searchText || '' },\n filter: { handler: () => this.grist.toggleHeadroom() }\n }\n }\n\n render() {\n const row = this.selected\n return html`\n <ox-grist\n .mode=${'GRID'}\n search-mode=\"term\"\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .countHandler=${this.countHandler.bind(this)}\n ?url-params-sensitive=${(this as any).active}\n @select-record-change=${(e: any) => this.select(e.detail?.records)}\n >\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\"><ox-filters-form without-search></ox-filters-form></div>\n </div>\n </ox-grist>\n ${row && row.state === 'published'\n ? html`<div class=\"revoke\">\n ${i18next.t('text.issued-document-revoke', { number: row.number })}\n <input .value=${this.reason} placeholder=${i18next.t('field.issued-document-revoke-reason')} ?disabled=${this.busy} @input=${(e: any) => (this.reason = e.target.value)} />\n <button danger ?disabled=${this.busy || !this.reason.trim()} @click=${() => this.revoke()}>${i18next.t('button.issued-document-revoke')}</button>\n </div>`\n : nothing}\n `\n }\n\n /* The kinds this person reads are the kind filter's choices: the grid is configured once they are known. */\n willUpdate() {\n if (!this.gristConfig && (this.kindsRead.data || this.kindsRead.error)) this.gristConfig = this.configOf(this.kinds)\n }\n\n private configOf(kinds: string[]) {\n return {\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: false },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'download',\n title: i18next.t('button.issued-document-open'),\n handlers: {\n click: (_c: any, _d: any, _col: any, record: any) =>\n record?.file?.fullpath && downloadIssuedFile(record.file).catch((error: any) => notify({ level: 'error', message: error?.message ?? String(error) }))\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'visibility',\n title: i18next.t('button.pdf-preview'),\n handlers: {\n /* The issued file itself, as it went out - its number and seal - opened in place under its own name. */\n click: (_c: any, _d: any, _col: any, record: any) => record?.file?.fullpath && openPdfView(record.file.fullpath, `${kindWord(record.kind)} · ${record.number}`)\n }\n },\n { type: 'string', name: 'number', header: i18next.t('field.issued-document-number'), width: 140 },\n {\n type: 'string',\n name: 'kind',\n header: i18next.t('field.issued-document-kind'),\n record: { renderer: (value: string) => kindWord(value) },\n width: 140,\n /* Only one who reads more than one kind has a kind to choose. */\n filter: {\n operator: 'eq',\n type: 'select',\n hidden: kinds.length < 2,\n options: [{ value: '', display: i18next.t('text.all') }, ...kinds.map(kind => ({ value: kind, display: kindWord(kind) }))]\n }\n },\n { type: 'string', name: 'subjectName', header: i18next.t('field.issued-document-subject'), width: 160 },\n { type: 'string', name: 'purpose', header: i18next.t('field.issued-document-purpose'), width: 160 },\n { type: 'string', name: 'submittedTo', header: i18next.t('field.issued-document-submitted-to'), width: 160 },\n {\n type: 'datetime',\n name: 'createdAt',\n header: i18next.t('field.issued-document-issued-at'),\n width: 160,\n /* The days issued on, 'YYYY-MM-DD', either end open. */\n filter: { operator: 'between', type: 'date' }\n },\n { type: 'resource-object', name: 'creator', header: i18next.t('field.issued-document-issuer'), width: 110 },\n {\n type: 'string',\n name: 'state',\n header: i18next.t('field.state'),\n record: { renderer: (value: string, _c: any, record: any) => (value === 'revoked' ? `${i18next.t('text.issued-document-revoked')} · ${record.revokeReason ?? ''}` : i18next.t('text.issued-document-published')) },\n width: 200,\n /* 발급 · 취소 - none chosen is both; each chip with how many it holds under the other conditions. */\n filter: { operator: 'in', type: 'select-buttons', options: ['published', 'revoked'].map(value => ({ value, display: i18next.t(`text.issued-document-${value}`) })) }\n }\n ],\n rows: { appendable: false, selectable: { multiple: false } }\n }\n }\n\n async pageUpdated(changes: any) {\n if ((this as any).active && changes.active && this.grist) this.grist.fetch()\n }\n\n /*\n * The grid's filters as the ledger's door takes them: the kind, the days issued on ([from, to], either end open) and\n * the state as they are, a filter with nothing chosen left out, and the search term as the door's `q`.\n */\n private conditions(filters: any[] = [], search?: string): any[] {\n const term = search?.trim()\n /* Every condition by the grid's rule - an operator without a value too (data-grist isFilterCondition). */\n return [...filters.filter(isFilterCondition), ...(term ? [{ name: 'q', operator: 'search', value: term }] : [])]\n }\n\n async fetchHandler({ page = 1, limit = 100, ...asked }: FetchOption) {\n const filters = this.conditions(asked.filters, asked.search)\n const response = await client.query({\n query: gql(\n this.mine\n ? `query ($filters: [Filter!], $pagination: Pagination) { list: readableIssuedDocuments(filters: $filters, pagination: $pagination, mine: true) { items { ${FIELDS} } total } }`\n : `query ($filters: [Filter!], $pagination: Pagination) { list: issuedDocuments(filters: $filters, pagination: $pagination) { items { ${FIELDS} } total } }`\n ),\n variables: { filters, pagination: { page, limit } },\n fetchPolicy: 'no-cache'\n })\n this.select([])\n return { total: response.data?.list?.total ?? 0, records: response.data?.list?.items ?? [] }\n }\n\n /* The state chips' numbers: the list's door totals each state under the other conditions, in one request. */\n async countHandler({ signal, ...asked }: FetchOption) {\n const filters = this.conditions(asked.filters, asked.search).filter(one => one.name !== 'state')\n const list = this.mine ? 'readableIssuedDocuments' : 'issuedDocuments'\n const states = ['published', 'revoked']\n const response = await client.query({\n query: gql(\n `query (${states.map((_, at) => `$f${at}: [Filter!]`).join(', ')}) { ${states\n .map((_, at) => `c${at}: ${list}(filters: $f${at}, pagination: { page: 1, limit: 1 }${this.mine ? ', mine: true' : ''}) { total }`)\n .join(' ')} }`\n ),\n variables: Object.fromEntries(states.map((state, at) => [`f${at}`, [...filters, { name: 'state', operator: 'in', value: [state] }]])),\n fetchPolicy: 'no-cache',\n context: { fetchOptions: { signal }, queryDeduplication: false }\n })\n if (response.errors?.length) throw response.errors[0]\n return { state: Object.fromEntries(states.map((state, at) => [state, response.data?.[`c${at}`]?.total ?? 0])) }\n }\n\n private select(records: any[] | undefined) {\n const row = records?.[0] ?? null\n if (row?.id !== this.selected?.id) this.reason = ''\n this.selected = row\n }\n\n private async revoke() {\n const { id, number } = this.selected\n if (!(await this.revoking.run({ id, reason: this.reason }))) return\n notify({ message: i18next.t('text.issued-document-revoked-done', { number }) })\n this.grist.fetch()\n }\n}\n\n/** 내 정보 › 내 증명서 - the ledger's rows that are one's own, and the documents one issues for oneself. */\n@customElement('my-issued-document-list')\nexport class MyIssuedDocumentList extends IssuedDocumentList {\n protected mine = true\n}\n"]}
|
|
@@ -47,21 +47,16 @@ let PDFTemplateListPage = class PDFTemplateListPage extends localize(i18next)(Sc
|
|
|
47
47
|
search: { handler: (search) => {
|
|
48
48
|
this.grist.searchText = search;
|
|
49
49
|
},
|
|
50
|
-
value: this.grist
|
|
50
|
+
value: this.grist?.searchText || '' },
|
|
51
51
|
filter: { handler: () => {
|
|
52
52
|
this.grist.toggleHeadroom();
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
help: 'pdf/pdf-template',
|
|
56
|
+
/* A template starts in the creator form on the header (+); the grid edits and deletes the kept ones. */
|
|
56
57
|
actions: [
|
|
57
|
-
{ title: i18next.t('button.
|
|
58
|
-
|
|
59
|
-
...CommonButtonStyles.save
|
|
60
|
-
},
|
|
61
|
-
{ title: i18next.t('button.delete'),
|
|
62
|
-
action: this._deletePDFTemplate.bind(this),
|
|
63
|
-
...CommonButtonStyles.delete
|
|
64
|
-
}
|
|
58
|
+
{ id: 'delete', title: i18next.t('button.delete'), action: this._deletePDFTemplate.bind(this), ...CommonButtonStyles.delete },
|
|
59
|
+
{ id: 'save', title: i18next.t('button.save'), action: this._updatePDFTemplate.bind(this), ...CommonButtonStyles.save }
|
|
65
60
|
],
|
|
66
61
|
exportable: { name: i18next.t('title.pdf-template list'),
|
|
67
62
|
data: this.exportHandler.bind(this)
|
|
@@ -72,7 +67,7 @@ let PDFTemplateListPage = class PDFTemplateListPage extends localize(i18next)(Sc
|
|
|
72
67
|
render() {
|
|
73
68
|
const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID');
|
|
74
69
|
return html `
|
|
75
|
-
<ox-grist class="page-fill" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
70
|
+
<ox-grist class="page-fill" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)} ?url-params-sensitive=${this.active}>
|
|
76
71
|
<div slot="headroom" class="header">
|
|
77
72
|
<div class="filters">
|
|
78
73
|
<ox-filters-form autofocus without-search></ox-filters-form>
|
|
@@ -233,6 +228,7 @@ let PDFTemplateListPage = class PDFTemplateListPage extends localize(i18next)(Sc
|
|
|
233
228
|
}
|
|
234
229
|
],
|
|
235
230
|
rows: { appendable: false,
|
|
231
|
+
pasteAppendable: false,
|
|
236
232
|
selectable: { multiple: true
|
|
237
233
|
}
|
|
238
234
|
},
|
|
@@ -279,12 +275,16 @@ let PDFTemplateListPage = class PDFTemplateListPage extends localize(i18next)(Sc
|
|
|
279
275
|
};
|
|
280
276
|
}
|
|
281
277
|
async _deletePDFTemplate() {
|
|
278
|
+
if (!this.grist.selected.some(record => record.id)) {
|
|
279
|
+
notify({ level: 'info', message: i18next.t('text.select-rows-to-delete') });
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
282
|
if (await OxPrompt.open({ title: i18next.t('text.are_you_sure'),
|
|
283
283
|
text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
|
|
284
284
|
confirmButton: { text: i18next.t('button.confirm') },
|
|
285
285
|
cancelButton: { text: i18next.t('button.cancel') }
|
|
286
286
|
})) {
|
|
287
|
-
const ids = this.grist.selected.map(record => record.id);
|
|
287
|
+
const ids = this.grist.selected.map(record => record.id).filter(Boolean);
|
|
288
288
|
if (ids && ids.length > 0) {
|
|
289
289
|
const response = await client.mutate({ mutation: gql `
|
|
290
290
|
mutation ($ids: [String!]!) { deletePDFTemplates(ids: $ids)
|
|
@@ -303,6 +303,10 @@ let PDFTemplateListPage = class PDFTemplateListPage extends localize(i18next)(Sc
|
|
|
303
303
|
}
|
|
304
304
|
async _updatePDFTemplate() {
|
|
305
305
|
let patches = this.grist.dirtyRecords;
|
|
306
|
+
if (!patches?.length) {
|
|
307
|
+
notify({ level: 'info', message: i18next.t('text.nothing-to-save') });
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
306
310
|
if (patches && patches.length) {
|
|
307
311
|
patches = patches.map(patch => {
|
|
308
312
|
let patchField = patch.id ? { id: patch.id } : {};
|