@things-factory/calendar 10.1.203 → 10.1.205
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/calendar/calendar-list-page.d.ts +1 -9
- package/dist-client/pages/calendar/calendar-list-page.js +2 -27
- package/dist-client/pages/calendar/calendar-list-page.js.map +1 -1
- package/dist-client/pages/event/event-list-page.d.ts +5 -28
- package/dist-client/pages/event/event-list-page.js +65 -177
- package/dist-client/pages/event/event-list-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +0 -3
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/index.d.ts +1 -0
- package/dist-server/index.js +5 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/role-tasks.d.ts +2 -0
- package/dist-server/role-tasks.js +16 -0
- package/dist-server/role-tasks.js.map +1 -0
- package/dist-server/service/attendee/attendee-query.d.ts +7 -4
- package/dist-server/service/attendee/attendee-query.js +34 -25
- package/dist-server/service/attendee/attendee-query.js.map +1 -1
- package/dist-server/service/attendee/attendee-service.d.ts +41 -0
- package/dist-server/service/attendee/attendee-service.js +90 -0
- package/dist-server/service/attendee/attendee-service.js.map +1 -0
- package/dist-server/service/attendee/attendee-type.d.ts +3 -15
- package/dist-server/service/attendee/attendee-type.js +12 -53
- package/dist-server/service/attendee/attendee-type.js.map +1 -1
- package/dist-server/service/attendee/attendee.d.ts +24 -7
- package/dist-server/service/attendee/attendee.js +99 -23
- package/dist-server/service/attendee/attendee.js.map +1 -1
- package/dist-server/service/attendee/index.d.ts +1 -2
- package/dist-server/service/attendee/index.js +1 -2
- package/dist-server/service/attendee/index.js.map +1 -1
- package/dist-server/service/calendar/calendar-mutation.d.ts +1 -3
- package/dist-server/service/calendar/calendar-mutation.js +21 -94
- package/dist-server/service/calendar/calendar-mutation.js.map +1 -1
- package/dist-server/service/calendar/calendar-query.d.ts +1 -1
- package/dist-server/service/calendar/calendar-query.js +15 -17
- package/dist-server/service/calendar/calendar-query.js.map +1 -1
- package/dist-server/service/calendar/calendar-service.d.ts +10 -0
- package/dist-server/service/calendar/calendar-service.js +58 -0
- package/dist-server/service/calendar/calendar-service.js.map +1 -0
- package/dist-server/service/calendar/calendar-type.d.ts +1 -4
- package/dist-server/service/calendar/calendar-type.js +13 -25
- package/dist-server/service/calendar/calendar-type.js.map +1 -1
- package/dist-server/service/calendar/calendar.d.ts +7 -8
- package/dist-server/service/calendar/calendar.js +23 -33
- package/dist-server/service/calendar/calendar.js.map +1 -1
- package/dist-server/service/event/event-mutation.d.ts +6 -4
- package/dist-server/service/event/event-mutation.js +60 -83
- package/dist-server/service/event/event-mutation.js.map +1 -1
- package/dist-server/service/event/event-query.d.ts +11 -1
- package/dist-server/service/event/event-query.js +106 -13
- package/dist-server/service/event/event-query.js.map +1 -1
- package/dist-server/service/event/event-rules.d.ts +10 -0
- package/dist-server/service/event/event-rules.js +38 -0
- package/dist-server/service/event/event-rules.js.map +1 -0
- package/dist-server/service/event/event-service.d.ts +42 -0
- package/dist-server/service/event/event-service.js +159 -0
- package/dist-server/service/event/event-service.js.map +1 -0
- package/dist-server/service/event/event-type.d.ts +10 -11
- package/dist-server/service/event/event-type.js +32 -36
- package/dist-server/service/event/event-type.js.map +1 -1
- package/dist-server/service/event/event.d.ts +25 -11
- package/dist-server/service/event/event.js +89 -36
- package/dist-server/service/event/event.js.map +1 -1
- package/dist-server/service/event-series/event-series-mutation.d.ts +11 -0
- package/dist-server/service/event-series/event-series-mutation.js +100 -0
- package/dist-server/service/event-series/event-series-mutation.js.map +1 -0
- package/dist-server/service/event-series/event-series-query.d.ts +16 -0
- package/dist-server/service/event-series/event-series-query.js +109 -0
- package/dist-server/service/event-series/event-series-query.js.map +1 -0
- package/dist-server/service/event-series/event-series-service.d.ts +40 -0
- package/dist-server/service/event-series/event-series-service.js +253 -0
- package/dist-server/service/event-series/event-series-service.js.map +1 -0
- package/dist-server/service/event-series/event-series-type.d.ts +41 -0
- package/dist-server/service/event-series/event-series-type.js +155 -0
- package/dist-server/service/event-series/event-series-type.js.map +1 -0
- package/dist-server/service/event-series/event-series.d.ts +32 -0
- package/dist-server/service/event-series/event-series.js +134 -0
- package/dist-server/service/event-series/event-series.js.map +1 -0
- package/dist-server/service/event-series/index.d.ts +6 -0
- package/dist-server/service/event-series/index.js +10 -0
- package/dist-server/service/event-series/index.js.map +1 -0
- package/dist-server/service/event-series/recurrence.d.ts +19 -0
- package/dist-server/service/event-series/recurrence.js +95 -0
- package/dist-server/service/event-series/recurrence.js.map +1 -0
- package/dist-server/service/index.d.ts +15 -4
- package/dist-server/service/index.js +29 -11
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -5
- package/tests/open-doors.test.ts +18 -21
- package/things-factory.config.js +0 -4
- package/translations/en.json +44 -1
- package/translations/es.json +44 -1
- package/translations/ja.json +44 -1
- package/translations/ko.json +44 -1
- package/translations/ms.json +44 -1
- package/translations/zh.json +44 -1
- package/concept.md +0 -31
- package/dist-client/pages/attendee/attendee-importer.d.ts +0 -23
- package/dist-client/pages/attendee/attendee-importer.js +0 -93
- package/dist-client/pages/attendee/attendee-importer.js.map +0 -1
- package/dist-client/pages/attendee/attendee-list-page.d.ts +0 -56
- package/dist-client/pages/attendee/attendee-list-page.js +0 -263
- package/dist-client/pages/attendee/attendee-list-page.js.map +0 -1
- package/dist-client/pages/calendar/calendar-importer.d.ts +0 -23
- package/dist-client/pages/calendar/calendar-importer.js +0 -93
- package/dist-client/pages/calendar/calendar-importer.js.map +0 -1
- package/dist-client/pages/event/event-importer.d.ts +0 -23
- package/dist-client/pages/event/event-importer.js +0 -93
- package/dist-client/pages/event/event-importer.js.map +0 -1
- package/dist-server/service/attendee/attendee-mutation.d.ts +0 -10
- package/dist-server/service/attendee/attendee-mutation.js +0 -140
- package/dist-server/service/attendee/attendee-mutation.js.map +0 -1
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import '@operato/data-grist';
|
|
3
|
-
import { CommonButtonStyles, CommonGristStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles';
|
|
4
|
-
import { PageView } from '@operato/shell';
|
|
5
|
-
import { css, html } from 'lit';
|
|
6
|
-
import { customElement, property, query } from 'lit/decorators.js';
|
|
7
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
8
|
-
import { DataGrist } from '@operato/data-grist';
|
|
9
|
-
import { client } from '@operato/graphql';
|
|
10
|
-
import { i18next, localize } from '@operato/i18n';
|
|
11
|
-
import { notify, openPopup } from '@operato/layout';
|
|
12
|
-
import { isMobileDevice } from '@operato/utils';
|
|
13
|
-
import gql from 'graphql-tag';
|
|
14
|
-
import { AttendeeImporter } from './attendee-importer';
|
|
15
|
-
let AttendeeListPage = class AttendeeListPage extends localize(i18next)(ScopedElementsMixin(PageView)) {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.mode = isMobileDevice() ? 'CARD' : 'GRID';
|
|
19
|
-
}
|
|
20
|
-
static { this.styles = [
|
|
21
|
-
/* The work surface frame for a list screen (ADR-0060 decision 8). */
|
|
22
|
-
WorkSurfacePageStyles,
|
|
23
|
-
ScrollbarStyles,
|
|
24
|
-
CommonGristStyles,
|
|
25
|
-
CommonHeaderStyles,
|
|
26
|
-
css `
|
|
27
|
-
:host {
|
|
28
|
-
--grid-record-emphasized-background-color: #8b0000;
|
|
29
|
-
--grid-record-emphasized-color: #ff6b6b;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
ox-filters-form { flex: 1;
|
|
33
|
-
}
|
|
34
|
-
`
|
|
35
|
-
]; }
|
|
36
|
-
static get scopedElements() {
|
|
37
|
-
return { 'attendee-importer': AttendeeImporter
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
get context() {
|
|
41
|
-
return { title: i18next.t('title.attendee list'),
|
|
42
|
-
search: { handler: (search) => {
|
|
43
|
-
this.grist.searchText = search;
|
|
44
|
-
},
|
|
45
|
-
value: this.grist?.searchText || '',
|
|
46
|
-
autofocus: true },
|
|
47
|
-
filter: { handler: () => {
|
|
48
|
-
this.grist.toggleHeadroom();
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
help: 'calendar/attendee',
|
|
52
|
-
actions: [
|
|
53
|
-
{ title: i18next.t('button.save'),
|
|
54
|
-
action: this._updateAttendee.bind(this),
|
|
55
|
-
...CommonButtonStyles.save
|
|
56
|
-
},
|
|
57
|
-
{ title: i18next.t('button.delete'),
|
|
58
|
-
action: this._deleteAttendee.bind(this),
|
|
59
|
-
...CommonButtonStyles.delete
|
|
60
|
-
}
|
|
61
|
-
],
|
|
62
|
-
exportable: { name: i18next.t('title.attendee list'),
|
|
63
|
-
data: this.exportHandler.bind(this)
|
|
64
|
-
},
|
|
65
|
-
importable: { handler: this.importHandler.bind(this)
|
|
66
|
-
} };
|
|
67
|
-
}
|
|
68
|
-
render() {
|
|
69
|
-
const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID');
|
|
70
|
-
return html `
|
|
71
|
-
<ox-grist class="page-fill" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
72
|
-
<div slot="headroom" class="header">
|
|
73
|
-
<div class="filters">
|
|
74
|
-
<ox-filters-form without-search autofocus></ox-filters-form>
|
|
75
|
-
|
|
76
|
-
<div id="modes">
|
|
77
|
-
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
78
|
-
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
79
|
-
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
</ox-grist>
|
|
84
|
-
`;
|
|
85
|
-
}
|
|
86
|
-
async pageInitialized(lifecycle) {
|
|
87
|
-
this.gristConfig = { list: { fields: ['name', 'description'],
|
|
88
|
-
details: ['active', 'updatedAt']
|
|
89
|
-
},
|
|
90
|
-
columns: [
|
|
91
|
-
{ type: 'gutter', gutterName: 'sequence' },
|
|
92
|
-
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
93
|
-
{ type: 'string',
|
|
94
|
-
name: 'name',
|
|
95
|
-
header: i18next.t('field.name'),
|
|
96
|
-
record: { editable: true
|
|
97
|
-
},
|
|
98
|
-
filter: 'search',
|
|
99
|
-
sortable: true,
|
|
100
|
-
width: 150
|
|
101
|
-
},
|
|
102
|
-
{ type: 'string',
|
|
103
|
-
name: 'description',
|
|
104
|
-
header: i18next.t('field.description'),
|
|
105
|
-
record: { editable: true
|
|
106
|
-
},
|
|
107
|
-
filter: 'search',
|
|
108
|
-
width: 200
|
|
109
|
-
},
|
|
110
|
-
{ type: 'checkbox',
|
|
111
|
-
name: 'active',
|
|
112
|
-
label: true,
|
|
113
|
-
header: i18next.t('field.active'),
|
|
114
|
-
record: { editable: true
|
|
115
|
-
},
|
|
116
|
-
filter: true,
|
|
117
|
-
sortable: true,
|
|
118
|
-
width: 60
|
|
119
|
-
},
|
|
120
|
-
{ type: 'resource-object',
|
|
121
|
-
name: 'updater',
|
|
122
|
-
header: i18next.t('field.updater'),
|
|
123
|
-
record: { editable: false
|
|
124
|
-
},
|
|
125
|
-
sortable: true,
|
|
126
|
-
width: 120
|
|
127
|
-
},
|
|
128
|
-
{ type: 'datetime',
|
|
129
|
-
name: 'updatedAt',
|
|
130
|
-
header: i18next.t('field.updated_at'),
|
|
131
|
-
record: { editable: false
|
|
132
|
-
},
|
|
133
|
-
sortable: true,
|
|
134
|
-
width: 180
|
|
135
|
-
}
|
|
136
|
-
],
|
|
137
|
-
rows: { selectable: { multiple: true
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
sorters: [
|
|
141
|
-
{ name: 'name'
|
|
142
|
-
}
|
|
143
|
-
]
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
async pageUpdated(changes, lifecycle) {
|
|
147
|
-
if (this.active) { // do something here when this page just became as active
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }) {
|
|
151
|
-
const response = await client.query({ query: gql `
|
|
152
|
-
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: attendees(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id
|
|
153
|
-
name
|
|
154
|
-
description
|
|
155
|
-
active
|
|
156
|
-
updater { id
|
|
157
|
-
name
|
|
158
|
-
}
|
|
159
|
-
updatedAt
|
|
160
|
-
}
|
|
161
|
-
total
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
`,
|
|
165
|
-
variables: { filters,
|
|
166
|
-
pagination: { page, limit },
|
|
167
|
-
sortings
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
return { total: response.data.responses.total || 0,
|
|
171
|
-
records: response.data.responses.items || []
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
async _deleteAttendee() {
|
|
175
|
-
if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) {
|
|
176
|
-
const ids = this.grist.selected.map(record => record.id);
|
|
177
|
-
if (ids && ids.length > 0) {
|
|
178
|
-
const response = await client.mutate({ mutation: gql `
|
|
179
|
-
mutation ($ids: [String!]!) { deleteAttendees(ids: $ids)
|
|
180
|
-
}
|
|
181
|
-
`,
|
|
182
|
-
variables: { ids
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
if (!response.errors) {
|
|
186
|
-
this.grist.fetch();
|
|
187
|
-
notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
async _updateAttendee() {
|
|
194
|
-
let patches = this.grist.dirtyRecords;
|
|
195
|
-
if (patches && patches.length) {
|
|
196
|
-
patches = patches.map(patch => {
|
|
197
|
-
let patchField = patch.id ? { id: patch.id } : {};
|
|
198
|
-
const dirtyFields = patch.__dirtyfields__;
|
|
199
|
-
for (let key in dirtyFields) {
|
|
200
|
-
patchField[key] = dirtyFields[key].after;
|
|
201
|
-
}
|
|
202
|
-
patchField.cuFlag = patch.__dirty__;
|
|
203
|
-
return patchField;
|
|
204
|
-
});
|
|
205
|
-
const response = await client.mutate({ mutation: gql `
|
|
206
|
-
mutation ($patches: [AttendeePatch!]!) { updateMultipleAttendee(patches: $patches) { name
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
`,
|
|
210
|
-
variables: { patches
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
if (!response.errors) {
|
|
214
|
-
this.grist.fetch();
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
async exportHandler() {
|
|
219
|
-
const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records;
|
|
220
|
-
const targetFieldSet = new Set(['id', 'name', 'description', 'active']);
|
|
221
|
-
return exportTargets.map(attendee => {
|
|
222
|
-
let tempObj = {};
|
|
223
|
-
for (const field of targetFieldSet) {
|
|
224
|
-
tempObj[field] = attendee[field];
|
|
225
|
-
}
|
|
226
|
-
return tempObj;
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
async importHandler(records) {
|
|
230
|
-
const popup = openPopup(html `
|
|
231
|
-
<attendee-importer
|
|
232
|
-
.attendees=${records}
|
|
233
|
-
@imported=${() => {
|
|
234
|
-
history.back();
|
|
235
|
-
this.grist.fetch();
|
|
236
|
-
}}
|
|
237
|
-
></attendee-importer>
|
|
238
|
-
`, { backdrop: true,
|
|
239
|
-
size: 'large',
|
|
240
|
-
title: i18next.t('title.import attendee')
|
|
241
|
-
});
|
|
242
|
-
popup.onclosed = () => {
|
|
243
|
-
this.grist.fetch();
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
__decorate([
|
|
248
|
-
property({ type: Object }),
|
|
249
|
-
__metadata("design:type", Object)
|
|
250
|
-
], AttendeeListPage.prototype, "gristConfig", void 0);
|
|
251
|
-
__decorate([
|
|
252
|
-
property({ type: String }),
|
|
253
|
-
__metadata("design:type", String)
|
|
254
|
-
], AttendeeListPage.prototype, "mode", void 0);
|
|
255
|
-
__decorate([
|
|
256
|
-
query('ox-grist'),
|
|
257
|
-
__metadata("design:type", DataGrist)
|
|
258
|
-
], AttendeeListPage.prototype, "grist", void 0);
|
|
259
|
-
AttendeeListPage = __decorate([
|
|
260
|
-
customElement('attendee-list-page')
|
|
261
|
-
], AttendeeListPage);
|
|
262
|
-
export { AttendeeListPage };
|
|
263
|
-
//# sourceMappingURL=attendee-list-page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attendee-list-page.js","sourceRoot":"","sources":["../../../client/pages/attendee/attendee-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACnI,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAgB,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,M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AAE;YAAS,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QACpD,CAAC,CAAA;IACD,CAAC;;AAlN4B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAiB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CAAoE;AAEpE;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;+CAAA;AAxBjC,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAwO5B","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonGristStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { ColumnConfig, DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { isMobileDevice } from '@operato/utils'\n\nimport gql from 'graphql-tag'\n\nimport { AttendeeImporter } from './attendee-importer'\n\n@customElement('attendee-list-page')\nexport class AttendeeListPage extends localize(i18next)(ScopedElementsMixin(PageView)) { static styles = [\n /* The work surface frame for a list screen (ADR-0060 decision 8). */\n WorkSurfacePageStyles,\n ScrollbarStyles,\n CommonGristStyles,\n CommonHeaderStyles,\n css`\n :host {\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n ox-filters-form { flex: 1;\n }\n `\n ]\n\n static get scopedElements() { return { 'attendee-importer': AttendeeImporter\n }\n }\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() { return { title: i18next.t('title.attendee list'),\n search: { handler: (search: string) => { this.grist.searchText = search\n },\n value: this.grist?.searchText || '',\n autofocus: true\n },\n filter: { handler: () => { this.grist.toggleHeadroom()\n }\n },\n help: 'calendar/attendee',\n actions: [\n { title: i18next.t('button.save'),\n action: this._updateAttendee.bind(this),\n ...CommonButtonStyles.save\n },\n { title: i18next.t('button.delete'),\n action: this._deleteAttendee.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: { name: i18next.t('title.attendee list'),\n data: this.exportHandler.bind(this)\n },\n importable: { handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() { const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist class=\"page-fill\" .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <ox-filters-form without-search autofocus></ox-filters-form>\n\n <div id=\"modes\">\n <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>\n <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>\n <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>\n </div>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) { this.gristConfig = { list: { fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: { editable: true\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n { type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: { editable: true\n },\n filter: 'search',\n width: 200\n },\n { type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: { editable: true\n },\n filter: true,\n sortable: true,\n width: 60\n },\n { type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: { editable: false\n },\n sortable: true,\n width: 120\n },\n { type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: { editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: { selectable: { multiple: true\n }\n },\n sorters: [\n { name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) { if (this.active) { // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) { const response = await client.query({ query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) { responses: attendees(filters: $filters, pagination: $pagination, sortings: $sortings) { items { id\n name\n description\n active\n updater { id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: { filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return { total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteAttendee() { if (confirm(i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }))) { const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) { const response = await client.mutate({ mutation: gql`\n mutation ($ids: [String!]!) { deleteAttendees(ids: $ids)\n }\n `,\n variables: { ids\n }\n })\n\n if (!response.errors) { this.grist.fetch()\n notify({ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateAttendee() { let patches = this.grist.dirtyRecords\n if (patches && patches.length) { patches = patches.map(patch => { let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) { patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({ mutation: gql`\n mutation ($patches: [AttendeePatch!]!) { updateMultipleAttendee(patches: $patches) { name\n }\n }\n `,\n variables: { patches\n }\n })\n\n if (!response.errors) { this.grist.fetch()\n }\n }\n }\n\n async exportHandler() { const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set(['id', 'name', 'description', 'active'])\n\n return exportTargets.map(attendee => { let tempObj = {}\n for (const field of targetFieldSet) { tempObj[field] = attendee[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) { const popup = openPopup(\n html`\n <attendee-importer\n .attendees=${records}\n @imported=${() => { history.back()\n this.grist.fetch()\n }}\n ></attendee-importer>\n `,\n { backdrop: true,\n size: 'large',\n title: i18next.t('title.import attendee')\n }\n )\n\n popup.onclosed = () => { this.grist.fetch()\n }\n }\n}\n"]}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js';
|
|
2
|
-
import '@operato/data-grist';
|
|
3
|
-
import { LitElement } from 'lit';
|
|
4
|
-
export declare class CalendarImporter extends LitElement {
|
|
5
|
-
static styles: import("lit").CSSResult[];
|
|
6
|
-
calendars: any[];
|
|
7
|
-
columns: {
|
|
8
|
-
list: {
|
|
9
|
-
fields: string[];
|
|
10
|
-
};
|
|
11
|
-
pagination: {
|
|
12
|
-
infinite: boolean;
|
|
13
|
-
};
|
|
14
|
-
columns: {
|
|
15
|
-
type: string;
|
|
16
|
-
name: string;
|
|
17
|
-
header: string;
|
|
18
|
-
width: number;
|
|
19
|
-
}[];
|
|
20
|
-
};
|
|
21
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
22
|
-
save(): Promise<void>;
|
|
23
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import '@material/web/icon/icon.js';
|
|
3
|
-
import '@operato/data-grist';
|
|
4
|
-
import gql from 'graphql-tag';
|
|
5
|
-
import { css, html, LitElement } from 'lit';
|
|
6
|
-
import { property } from 'lit/decorators.js';
|
|
7
|
-
import { client } from '@operato/graphql';
|
|
8
|
-
import { i18next } from '@operato/i18n';
|
|
9
|
-
import { isMobileDevice } from '@operato/utils';
|
|
10
|
-
import { CommonHeaderStyles } from '@operato/styles';
|
|
11
|
-
export class CalendarImporter extends LitElement {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
14
|
-
this.calendars = [];
|
|
15
|
-
this.columns = {
|
|
16
|
-
list: { fields: ['name', 'description'] },
|
|
17
|
-
pagination: { infinite: true },
|
|
18
|
-
columns: [
|
|
19
|
-
{
|
|
20
|
-
type: 'string',
|
|
21
|
-
name: 'name',
|
|
22
|
-
header: i18next.t('field.name'),
|
|
23
|
-
width: 150
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'string',
|
|
27
|
-
name: 'description',
|
|
28
|
-
header: i18next.t('field.description'),
|
|
29
|
-
width: 200
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
type: 'checkbox',
|
|
33
|
-
name: 'active',
|
|
34
|
-
header: i18next.t('field.active'),
|
|
35
|
-
width: 60
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
static { this.styles = [
|
|
41
|
-
CommonHeaderStyles,
|
|
42
|
-
css `
|
|
43
|
-
:host {
|
|
44
|
-
display: flex;
|
|
45
|
-
flex-direction: column;
|
|
46
|
-
|
|
47
|
-
background-color: var(--md-sys-color-surface);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
ox-grist {
|
|
51
|
-
flex: 1;
|
|
52
|
-
}
|
|
53
|
-
`
|
|
54
|
-
]; }
|
|
55
|
-
render() {
|
|
56
|
-
return html `
|
|
57
|
-
<ox-grist
|
|
58
|
-
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
59
|
-
.config=${this.columns}
|
|
60
|
-
.data=${{
|
|
61
|
-
records: this.calendars
|
|
62
|
-
}}
|
|
63
|
-
></ox-grist>
|
|
64
|
-
|
|
65
|
-
<div class="footer">
|
|
66
|
-
<div filler></div>
|
|
67
|
-
<button @click=${this.save.bind(this)} done><md-icon>save</md-icon>${i18next.t('button.save')}</button>
|
|
68
|
-
</div>
|
|
69
|
-
`;
|
|
70
|
-
}
|
|
71
|
-
async save() {
|
|
72
|
-
const response = await client.mutate({
|
|
73
|
-
mutation: gql `
|
|
74
|
-
mutation importCalendars($calendars: [CalendarPatch!]!) {
|
|
75
|
-
importCalendars(calendars: $calendars)
|
|
76
|
-
}
|
|
77
|
-
`,
|
|
78
|
-
variables: { calendars: this.calendars }
|
|
79
|
-
});
|
|
80
|
-
if (response.errors?.length)
|
|
81
|
-
return;
|
|
82
|
-
this.dispatchEvent(new CustomEvent('imported'));
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
__decorate([
|
|
86
|
-
property({ type: Array }),
|
|
87
|
-
__metadata("design:type", Array)
|
|
88
|
-
], CalendarImporter.prototype, "calendars", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
property({ type: Object }),
|
|
91
|
-
__metadata("design:type", Object)
|
|
92
|
-
], CalendarImporter.prototype, "columns", void 0);
|
|
93
|
-
//# sourceMappingURL=calendar-importer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-importer.js","sourceRoot":"","sources":["../../../client/pages/calendar/calendar-importer.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAAhD;;QAiB6B,cAAS,GAAU,EAAE,CAAA;QACpB,YAAO,GAA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MAAM;YAAE,OAAM;QAEnC,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC,CAAA;IACjD,CAAC;;AAxD0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;mDAAsB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDAuB1B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { isMobileDevice } from '@operato/utils'\nimport { CommonHeaderStyles } from '@operato/styles'\n\nexport class CalendarImporter extends LitElement {\n static styles = [\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: var(--md-sys-color-surface);\n }\n\n ox-grist {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Array }) calendars: any[] = []\n @property({ type: Object }) columns = {\n list: { fields: ['name', 'description'] },\n pagination: { infinite: true },\n columns: [\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n header: i18next.t('field.active'),\n width: 60\n }\n ]\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.columns}\n .data=${{\n records: this.calendars\n }}\n ></ox-grist>\n\n <div class=\"footer\">\n <div filler></div>\n <button @click=${this.save.bind(this)} done><md-icon>save</md-icon>${i18next.t('button.save')}</button>\n </div>\n `\n }\n\n async save() {\n const response = await client.mutate({\n mutation: gql`\n mutation importCalendars($calendars: [CalendarPatch!]!) {\n importCalendars(calendars: $calendars)\n }\n `,\n variables: { calendars: this.calendars }\n })\n\n if (response.errors?.length) return\n\n this.dispatchEvent(new CustomEvent('imported'))\n }\n}\n"]}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js';
|
|
2
|
-
import '@operato/data-grist';
|
|
3
|
-
import { LitElement } from 'lit';
|
|
4
|
-
export declare class EventImporter extends LitElement {
|
|
5
|
-
static styles: import("lit").CSSResult[];
|
|
6
|
-
events: any[];
|
|
7
|
-
columns: {
|
|
8
|
-
list: {
|
|
9
|
-
fields: string[];
|
|
10
|
-
};
|
|
11
|
-
pagination: {
|
|
12
|
-
infinite: boolean;
|
|
13
|
-
};
|
|
14
|
-
columns: {
|
|
15
|
-
type: string;
|
|
16
|
-
name: string;
|
|
17
|
-
header: string;
|
|
18
|
-
width: number;
|
|
19
|
-
}[];
|
|
20
|
-
};
|
|
21
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
22
|
-
save(): Promise<void>;
|
|
23
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import '@material/web/icon/icon.js';
|
|
3
|
-
import '@operato/data-grist';
|
|
4
|
-
import gql from 'graphql-tag';
|
|
5
|
-
import { css, html, LitElement } from 'lit';
|
|
6
|
-
import { property } from 'lit/decorators.js';
|
|
7
|
-
import { client } from '@operato/graphql';
|
|
8
|
-
import { i18next } from '@operato/i18n';
|
|
9
|
-
import { isMobileDevice } from '@operato/utils';
|
|
10
|
-
import { CommonHeaderStyles } from '@operato/styles';
|
|
11
|
-
export class EventImporter extends LitElement {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
14
|
-
this.events = [];
|
|
15
|
-
this.columns = {
|
|
16
|
-
list: { fields: ['name', 'description'] },
|
|
17
|
-
pagination: { infinite: true },
|
|
18
|
-
columns: [
|
|
19
|
-
{
|
|
20
|
-
type: 'string',
|
|
21
|
-
name: 'name',
|
|
22
|
-
header: i18next.t('field.name'),
|
|
23
|
-
width: 150
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'string',
|
|
27
|
-
name: 'description',
|
|
28
|
-
header: i18next.t('field.description'),
|
|
29
|
-
width: 200
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
type: 'checkbox',
|
|
33
|
-
name: 'active',
|
|
34
|
-
header: i18next.t('field.active'),
|
|
35
|
-
width: 60
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
static { this.styles = [
|
|
41
|
-
CommonHeaderStyles,
|
|
42
|
-
css `
|
|
43
|
-
:host {
|
|
44
|
-
display: flex;
|
|
45
|
-
flex-direction: column;
|
|
46
|
-
|
|
47
|
-
background-color: var(--md-sys-color-surface);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
ox-grist {
|
|
51
|
-
flex: 1;
|
|
52
|
-
}
|
|
53
|
-
`
|
|
54
|
-
]; }
|
|
55
|
-
render() {
|
|
56
|
-
return html `
|
|
57
|
-
<ox-grist
|
|
58
|
-
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
59
|
-
.config=${this.columns}
|
|
60
|
-
.data=${{
|
|
61
|
-
records: this.events
|
|
62
|
-
}}
|
|
63
|
-
></ox-grist>
|
|
64
|
-
|
|
65
|
-
<div class="footer">
|
|
66
|
-
<div filler></div>
|
|
67
|
-
<button @click=${this.save.bind(this)} done><md-icon>save</md-icon>${i18next.t('button.save')}</button>
|
|
68
|
-
</div>
|
|
69
|
-
`;
|
|
70
|
-
}
|
|
71
|
-
async save() {
|
|
72
|
-
const response = await client.mutate({
|
|
73
|
-
mutation: gql `
|
|
74
|
-
mutation importEvents($events: [EventPatch!]!) {
|
|
75
|
-
importEvents(events: $events)
|
|
76
|
-
}
|
|
77
|
-
`,
|
|
78
|
-
variables: { events: this.events }
|
|
79
|
-
});
|
|
80
|
-
if (response.errors?.length)
|
|
81
|
-
return;
|
|
82
|
-
this.dispatchEvent(new CustomEvent('imported'));
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
__decorate([
|
|
86
|
-
property({ type: Array }),
|
|
87
|
-
__metadata("design:type", Array)
|
|
88
|
-
], EventImporter.prototype, "events", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
property({ type: Object }),
|
|
91
|
-
__metadata("design:type", Object)
|
|
92
|
-
], EventImporter.prototype, "columns", void 0);
|
|
93
|
-
//# sourceMappingURL=event-importer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-importer.js","sourceRoot":"","sources":["../../../client/pages/event/event-importer.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD,MAAM,OAAO,aAAc,SAAQ,UAAU;IAA7C;;QAiB6B,WAAM,GAAU,EAAE,CAAA;QACjB,YAAO,GAAG;YACpC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE;YACzC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC9B,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;oBAC/B,KAAK,EAAE,GAAG;iBACX;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,aAAa;oBACnB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC;oBACtC,KAAK,EAAE,GAAG;iBACX;gBACD;oBACE,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC;oBACjC,KAAK,EAAE,EAAE;iBACV;aACF;SACF,CAAA;IAiCH,CAAC;aAzEQ,WAAM,GAAG;QACd,kBAAkB;QAClB,GAAG,CAAA;;;;;;;;;;;KAWF;KACF,AAdY,CAcZ;IA4BD,MAAM;QACJ,OAAO,IAAI,CAAA;;gBAEC,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;kBAChC,IAAI,CAAC,OAAO;gBACd;YACN,OAAO,EAAE,IAAI,CAAC,MAAM;SACrB;;;;;yBAKgB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,gCAAgC,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC;;KAEhG,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,GAAG,CAAA;;;;OAIZ;YACD,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;SACnC,CAAC,CAAA;QAEF,IAAI,QAAQ,CAAC,MAAM,EAAE,MAAM;YAAE,OAAM;QAEnC,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC,CAAA;IACjD,CAAC;;AAxD0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;6CAAmB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CAuB1B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { isMobileDevice } from '@operato/utils'\nimport { CommonHeaderStyles } from '@operato/styles'\n\nexport class EventImporter extends LitElement {\n static styles = [\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: var(--md-sys-color-surface);\n }\n\n ox-grist {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Array }) events: any[] = []\n @property({ type: Object }) columns = {\n list: { fields: ['name', 'description'] },\n pagination: { infinite: true },\n columns: [\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n header: i18next.t('field.active'),\n width: 60\n }\n ]\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.columns}\n .data=${{\n records: this.events\n }}\n ></ox-grist>\n\n <div class=\"footer\">\n <div filler></div>\n <button @click=${this.save.bind(this)} done><md-icon>save</md-icon>${i18next.t('button.save')}</button>\n </div>\n `\n }\n\n async save() {\n const response = await client.mutate({\n mutation: gql`\n mutation importEvents($events: [EventPatch!]!) {\n importEvents(events: $events)\n }\n `,\n variables: { events: this.events }\n })\n\n if (response.errors?.length) return\n\n this.dispatchEvent(new CustomEvent('imported'))\n }\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Attendee } from './attendee';
|
|
2
|
-
import { NewAttendee, AttendeePatch } from './attendee-type';
|
|
3
|
-
export declare class AttendeeMutation {
|
|
4
|
-
createAttendee(attendee: NewAttendee, context: ResolverContext): Promise<Attendee>;
|
|
5
|
-
updateAttendee(id: string, patch: AttendeePatch, context: ResolverContext): Promise<Attendee>;
|
|
6
|
-
updateMultipleAttendee(patches: AttendeePatch[], context: ResolverContext): Promise<Attendee[]>;
|
|
7
|
-
deleteAttendee(id: string, context: ResolverContext): Promise<boolean>;
|
|
8
|
-
deleteAttendees(ids: string[], context: ResolverContext): Promise<boolean>;
|
|
9
|
-
importAttendees(attendees: AttendeePatch[], context: ResolverContext): Promise<boolean>;
|
|
10
|
-
}
|