@things-factory/operato-codelingua 9.0.0-beta.27 → 9.0.0-beta.29
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/bootstrap.d.ts +8 -0
- package/dist-client/bootstrap.js +261 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/icons/menu-icons.d.ts +5 -0
- package/dist-client/icons/menu-icons.js +84 -0
- package/dist-client/icons/menu-icons.js.map +1 -0
- package/dist-client/index.d.ts +0 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/git-project/git-project-list-page.d.ts +55 -0
- package/dist-client/pages/git-project/git-project-list-page.js +406 -0
- package/dist-client/pages/git-project/git-project-list-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +8 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/themes/dark.css +51 -0
- package/dist-client/themes/light.css +51 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-client/viewparts/menu-tools.d.ts +17 -0
- package/dist-client/viewparts/menu-tools.js +172 -0
- package/dist-client/viewparts/menu-tools.js.map +1 -0
- package/dist-client/viewparts/user-circle.d.ts +5 -0
- package/dist-client/viewparts/user-circle.js +26 -0
- package/dist-client/viewparts/user-circle.js.map +1 -0
- package/dist-server/controllers/github-controller.d.ts +3 -0
- package/dist-server/controllers/github-controller.js +85 -0
- package/dist-server/controllers/github-controller.js.map +1 -0
- package/dist-server/controllers/index.d.ts +0 -0
- package/dist-server/controllers/index.js +1 -0
- package/dist-server/controllers/index.js.map +1 -0
- package/dist-server/index.d.ts +4 -0
- package/dist-server/index.js +9 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/middlewares/index.d.ts +1 -0
- package/dist-server/middlewares/index.js +7 -0
- package/dist-server/middlewares/index.js.map +1 -0
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/routers/github-webhook-router.d.ts +1 -0
- package/dist-server/routers/github-webhook-router.js +37 -0
- package/dist-server/routers/github-webhook-router.js.map +1 -0
- package/dist-server/routes.d.ts +1 -0
- package/dist-server/routes.js +28 -0
- package/dist-server/routes.js.map +1 -0
- package/dist-server/service/git-project/git-project-mutation.d.ts +12 -0
- package/dist-server/service/git-project/git-project-mutation.js +170 -0
- package/dist-server/service/git-project/git-project-mutation.js.map +1 -0
- package/dist-server/service/git-project/git-project-query.d.ts +11 -0
- package/dist-server/service/git-project/git-project-query.js +79 -0
- package/dist-server/service/git-project/git-project-query.js.map +1 -0
- package/dist-server/service/git-project/git-project-type.d.ts +27 -0
- package/dist-server/service/git-project/git-project-type.js +105 -0
- package/dist-server/service/git-project/git-project-type.js.map +1 -0
- package/dist-server/service/git-project/git-project.d.ts +34 -0
- package/dist-server/service/git-project/git-project.js +126 -0
- package/dist-server/service/git-project/git-project.js.map +1 -0
- package/dist-server/service/git-project/index.d.ts +6 -0
- package/dist-server/service/git-project/index.js +10 -0
- package/dist-server/service/git-project/index.js.map +1 -0
- package/dist-server/service/index.d.ts +5 -0
- package/dist-server/service/index.js +19 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +29 -29
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import '@material/web/icon/icon.js';
|
|
3
|
+
import '@material/web/button/elevated-button.js';
|
|
4
|
+
import '@operato/data-grist/ox-grist.js';
|
|
5
|
+
import '@operato/data-grist/ox-filters-form.js';
|
|
6
|
+
import '@operato/data-grist/ox-record-creator.js';
|
|
7
|
+
import { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles';
|
|
8
|
+
import { PageView, store } from '@operato/shell';
|
|
9
|
+
import { css, html } from 'lit';
|
|
10
|
+
import { customElement, property, query } from 'lit/decorators.js';
|
|
11
|
+
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
12
|
+
import { DataGrist } from '@operato/data-grist';
|
|
13
|
+
import { client } from '@operato/graphql';
|
|
14
|
+
import { i18next, localize } from '@operato/i18n';
|
|
15
|
+
import { notify } from '@operato/layout';
|
|
16
|
+
import { OxPrompt } from '@operato/popup';
|
|
17
|
+
import { isMobileDevice } from '@operato/utils';
|
|
18
|
+
import { connect } from 'pwa-helpers/connect-mixin';
|
|
19
|
+
import gql from 'graphql-tag';
|
|
20
|
+
let GitProjectListPage = class GitProjectListPage extends connect(store)(localize(i18next)(ScopedElementsMixin(PageView))) {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.mode = isMobileDevice() ? 'CARD' : 'GRID';
|
|
24
|
+
}
|
|
25
|
+
get context() {
|
|
26
|
+
return {
|
|
27
|
+
title: i18next.t('title.git-project list'),
|
|
28
|
+
search: {
|
|
29
|
+
handler: (search) => {
|
|
30
|
+
this.grist.searchText = search;
|
|
31
|
+
},
|
|
32
|
+
value: this.grist.searchText
|
|
33
|
+
},
|
|
34
|
+
filter: {
|
|
35
|
+
handler: () => {
|
|
36
|
+
this.grist.toggleHeadroom();
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
help: 'operato-codelingua/git-project',
|
|
40
|
+
actions: [
|
|
41
|
+
Object.assign({ title: i18next.t('button.save'), action: this._updateGitProject.bind(this) }, CommonButtonStyles.save),
|
|
42
|
+
Object.assign({ title: i18next.t('button.delete'), action: this._deleteGitProject.bind(this) }, CommonButtonStyles.delete)
|
|
43
|
+
]
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
render() {
|
|
47
|
+
const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID');
|
|
48
|
+
return html `
|
|
49
|
+
<ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>
|
|
50
|
+
<div slot="headroom" class="header">
|
|
51
|
+
<div class="filters">
|
|
52
|
+
<ox-filters-form autofocus without-search></ox-filters-form>
|
|
53
|
+
|
|
54
|
+
<div id="modes">
|
|
55
|
+
<md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>
|
|
56
|
+
<md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>
|
|
57
|
+
<md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<ox-record-creator id="add" .callback=${this.creationCallback.bind(this)}>
|
|
61
|
+
<button>
|
|
62
|
+
<md-icon>add</md-icon>
|
|
63
|
+
</button>
|
|
64
|
+
</ox-record-creator>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</ox-grist>
|
|
68
|
+
`;
|
|
69
|
+
}
|
|
70
|
+
async pageInitialized(lifecycle) {
|
|
71
|
+
this.gristConfig = {
|
|
72
|
+
list: {
|
|
73
|
+
fields: ['name', 'description'],
|
|
74
|
+
details: ['active', 'updatedAt']
|
|
75
|
+
},
|
|
76
|
+
columns: [
|
|
77
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
78
|
+
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
79
|
+
{
|
|
80
|
+
type: 'gutter',
|
|
81
|
+
gutterName: 'button',
|
|
82
|
+
name: 'state',
|
|
83
|
+
icon: record => (!record || !record.apiKey ? '' : record.state == 'REGISTERED' ? 'link' : 'link_off'),
|
|
84
|
+
handlers: {
|
|
85
|
+
click: (columns, data, column, record, rowIndex) => {
|
|
86
|
+
if (!record || !record.name || record.__dirty__ == '+') {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (record.state == 'REGISTERED') {
|
|
90
|
+
this.unregister(record);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
this.register(record);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
type: 'string',
|
|
100
|
+
name: 'name',
|
|
101
|
+
header: i18next.t('field.name'),
|
|
102
|
+
record: {
|
|
103
|
+
editable: true
|
|
104
|
+
},
|
|
105
|
+
filter: 'search',
|
|
106
|
+
sortable: true,
|
|
107
|
+
width: 150
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
type: 'string',
|
|
111
|
+
name: 'description',
|
|
112
|
+
header: i18next.t('field.description'),
|
|
113
|
+
record: {
|
|
114
|
+
editable: true
|
|
115
|
+
},
|
|
116
|
+
filter: 'search',
|
|
117
|
+
width: 200
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
type: 'string',
|
|
121
|
+
name: 'repositoryUrl',
|
|
122
|
+
header: i18next.t('field.repository-url'),
|
|
123
|
+
record: {
|
|
124
|
+
editable: true
|
|
125
|
+
},
|
|
126
|
+
width: 200
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
type: 'string',
|
|
130
|
+
name: 'apiKey',
|
|
131
|
+
header: i18next.t('field.api-key'),
|
|
132
|
+
record: {
|
|
133
|
+
editable: true
|
|
134
|
+
},
|
|
135
|
+
width: 200
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
type: 'select',
|
|
139
|
+
name: 'language',
|
|
140
|
+
header: i18next.t('field.programming-language'),
|
|
141
|
+
record: {
|
|
142
|
+
options: ['', 'java', 'javascript', 'typescript', 'python', 'c', 'cpp'],
|
|
143
|
+
editable: true
|
|
144
|
+
},
|
|
145
|
+
width: 200
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: 'checkbox',
|
|
149
|
+
name: 'active',
|
|
150
|
+
label: true,
|
|
151
|
+
header: i18next.t('field.active'),
|
|
152
|
+
record: {
|
|
153
|
+
editable: true
|
|
154
|
+
},
|
|
155
|
+
filter: true,
|
|
156
|
+
sortable: true,
|
|
157
|
+
width: 60
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
type: 'resource-object',
|
|
161
|
+
name: 'updater',
|
|
162
|
+
header: i18next.t('field.updater'),
|
|
163
|
+
record: {
|
|
164
|
+
editable: false
|
|
165
|
+
},
|
|
166
|
+
sortable: true,
|
|
167
|
+
width: 120
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
type: 'datetime',
|
|
171
|
+
name: 'updatedAt',
|
|
172
|
+
header: i18next.t('field.updated_at'),
|
|
173
|
+
record: {
|
|
174
|
+
editable: false
|
|
175
|
+
},
|
|
176
|
+
sortable: true,
|
|
177
|
+
width: 180
|
|
178
|
+
}
|
|
179
|
+
],
|
|
180
|
+
rows: {
|
|
181
|
+
appendable: false,
|
|
182
|
+
selectable: {
|
|
183
|
+
multiple: true
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
sorters: [
|
|
187
|
+
{
|
|
188
|
+
name: 'name'
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
async pageUpdated(changes, lifecycle) {
|
|
194
|
+
if (this.active) {
|
|
195
|
+
// do something here when this page just became as active
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }) {
|
|
199
|
+
const response = await client.query({
|
|
200
|
+
query: gql `
|
|
201
|
+
query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
202
|
+
responses: gitProjects(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
203
|
+
items {
|
|
204
|
+
id
|
|
205
|
+
name
|
|
206
|
+
description
|
|
207
|
+
repositoryUrl
|
|
208
|
+
apiKey
|
|
209
|
+
language
|
|
210
|
+
state
|
|
211
|
+
active
|
|
212
|
+
params
|
|
213
|
+
updater {
|
|
214
|
+
id
|
|
215
|
+
name
|
|
216
|
+
}
|
|
217
|
+
updatedAt
|
|
218
|
+
}
|
|
219
|
+
total
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
`,
|
|
223
|
+
variables: {
|
|
224
|
+
filters,
|
|
225
|
+
pagination: { page, limit },
|
|
226
|
+
sortings
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
return {
|
|
230
|
+
total: response.data.responses.total || 0,
|
|
231
|
+
records: response.data.responses.items || []
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
async _deleteGitProject() {
|
|
235
|
+
if (await OxPrompt.open({
|
|
236
|
+
title: i18next.t('text.are_you_sure'),
|
|
237
|
+
text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
|
|
238
|
+
confirmButton: { text: i18next.t('button.confirm') },
|
|
239
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
240
|
+
})) {
|
|
241
|
+
const ids = this.grist.selected.map(record => record.id);
|
|
242
|
+
if (ids && ids.length > 0) {
|
|
243
|
+
const response = await client.mutate({
|
|
244
|
+
mutation: gql `
|
|
245
|
+
mutation ($ids: [String!]!) {
|
|
246
|
+
deleteGitProjects(ids: $ids)
|
|
247
|
+
}
|
|
248
|
+
`,
|
|
249
|
+
variables: {
|
|
250
|
+
ids
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
if (!response.errors) {
|
|
254
|
+
this.grist.fetch();
|
|
255
|
+
notify({
|
|
256
|
+
message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
async _updateGitProject() {
|
|
263
|
+
let patches = this.grist.dirtyRecords;
|
|
264
|
+
if (patches && patches.length) {
|
|
265
|
+
patches = patches.map(patch => {
|
|
266
|
+
let patchField = patch.id ? { id: patch.id } : {};
|
|
267
|
+
const dirtyFields = patch.__dirtyfields__;
|
|
268
|
+
for (let key in dirtyFields) {
|
|
269
|
+
patchField[key] = dirtyFields[key].after;
|
|
270
|
+
}
|
|
271
|
+
patchField.cuFlag = patch.__dirty__;
|
|
272
|
+
return patchField;
|
|
273
|
+
});
|
|
274
|
+
const response = await client.mutate({
|
|
275
|
+
mutation: gql `
|
|
276
|
+
mutation ($patches: [GitProjectPatch!]!) {
|
|
277
|
+
updateMultipleGitProject(patches: $patches) {
|
|
278
|
+
name
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
`,
|
|
282
|
+
variables: {
|
|
283
|
+
patches
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
if (!response.errors) {
|
|
287
|
+
this.grist.fetch();
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
async creationCallback(gitProject) {
|
|
292
|
+
try {
|
|
293
|
+
const response = await client.query({
|
|
294
|
+
query: gql `
|
|
295
|
+
mutation ($gitProject: NewGitProject!) {
|
|
296
|
+
createGitProject(gitProject: $gitProject) {
|
|
297
|
+
id
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
`,
|
|
301
|
+
variables: {
|
|
302
|
+
gitProject
|
|
303
|
+
},
|
|
304
|
+
context: {
|
|
305
|
+
hasUpload: true
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
if (!response.errors) {
|
|
309
|
+
this.grist.fetch();
|
|
310
|
+
document.dispatchEvent(new CustomEvent('notify', {
|
|
311
|
+
detail: {
|
|
312
|
+
message: i18next.t('text.data_created_successfully')
|
|
313
|
+
}
|
|
314
|
+
}));
|
|
315
|
+
}
|
|
316
|
+
return true;
|
|
317
|
+
}
|
|
318
|
+
catch (ex) {
|
|
319
|
+
console.error(ex);
|
|
320
|
+
document.dispatchEvent(new CustomEvent('notify', {
|
|
321
|
+
detail: {
|
|
322
|
+
type: 'error',
|
|
323
|
+
message: i18next.t('text.error')
|
|
324
|
+
}
|
|
325
|
+
}));
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
async register(record) {
|
|
330
|
+
var response = await client.mutate({
|
|
331
|
+
mutation: gql `
|
|
332
|
+
mutation ($id: String!) {
|
|
333
|
+
registerGithubWebhook(id: $id)
|
|
334
|
+
}
|
|
335
|
+
`,
|
|
336
|
+
variables: {
|
|
337
|
+
id: record.id
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
var result = response.data.registerGithubWebhook;
|
|
341
|
+
notify({
|
|
342
|
+
level: 'info',
|
|
343
|
+
message: `${result ? 'success' : 'fail'} to register : ${record.name}`
|
|
344
|
+
});
|
|
345
|
+
this.grist.fetch();
|
|
346
|
+
}
|
|
347
|
+
async unregister(record) {
|
|
348
|
+
var response = await client.mutate({
|
|
349
|
+
mutation: gql `
|
|
350
|
+
mutation ($id: String!) {
|
|
351
|
+
unregisterGithubWebhook(id: $id)
|
|
352
|
+
}
|
|
353
|
+
`,
|
|
354
|
+
variables: {
|
|
355
|
+
id: record.id
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
const result = response.data.unregisterGithubWebhook;
|
|
359
|
+
notify({
|
|
360
|
+
level: 'info',
|
|
361
|
+
message: `${result ? 'success' : 'fail'} to unregister : ${record.name}`
|
|
362
|
+
});
|
|
363
|
+
this.grist.fetch();
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
GitProjectListPage.styles = [
|
|
367
|
+
ScrollbarStyles,
|
|
368
|
+
CommonGristStyles,
|
|
369
|
+
CommonHeaderStyles,
|
|
370
|
+
css `
|
|
371
|
+
:host {
|
|
372
|
+
display: flex;
|
|
373
|
+
|
|
374
|
+
width: 100%;
|
|
375
|
+
|
|
376
|
+
--grid-record-emphasized-background-color: #8b0000;
|
|
377
|
+
--grid-record-emphasized-color: #ff6b6b;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
ox-grist {
|
|
381
|
+
overflow-y: auto;
|
|
382
|
+
flex: 1;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
ox-filters-form {
|
|
386
|
+
flex: 1;
|
|
387
|
+
}
|
|
388
|
+
`
|
|
389
|
+
];
|
|
390
|
+
__decorate([
|
|
391
|
+
property({ type: Object }),
|
|
392
|
+
__metadata("design:type", Object)
|
|
393
|
+
], GitProjectListPage.prototype, "gristConfig", void 0);
|
|
394
|
+
__decorate([
|
|
395
|
+
property({ type: String }),
|
|
396
|
+
__metadata("design:type", String)
|
|
397
|
+
], GitProjectListPage.prototype, "mode", void 0);
|
|
398
|
+
__decorate([
|
|
399
|
+
query('ox-grist'),
|
|
400
|
+
__metadata("design:type", DataGrist)
|
|
401
|
+
], GitProjectListPage.prototype, "grist", void 0);
|
|
402
|
+
GitProjectListPage = __decorate([
|
|
403
|
+
customElement('git-project-list-page')
|
|
404
|
+
], GitProjectListPage);
|
|
405
|
+
export { GitProjectListPage };
|
|
406
|
+
//# sourceMappingURL=git-project-list-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-project-list-page.js","sourceRoot":"","sources":["../../../client/pages/git-project/git-project-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,yCAAyC,CAAA;AAChD,OAAO,iCAAiC,CAAA;AACxC,OAAO,wCAAwC,CAAA;AAC/C,OAAO,0CAA0C,CAAA;AAEjD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC5G,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAChD,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,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,iB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AA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;iDAAA;AA7BjC,kBAAkB;IAD9B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,kBAAkB,CAoZ9B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/button/elevated-button.js'\nimport '@operato/data-grist/ox-grist.js'\nimport '@operato/data-grist/ox-filters-form.js'\nimport '@operato/data-grist/ox-record-creator.js'\n\nimport { CommonButtonStyles, CommonHeaderStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView, store } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify } from '@operato/layout'\nimport { OxPrompt } from '@operato/popup'\nimport { isMobileDevice } from '@operato/utils'\n\nimport { connect } from 'pwa-helpers/connect-mixin'\nimport gql from 'graphql-tag'\n\n@customElement('git-project-list-page')\nexport class GitProjectListPage extends connect(store)(localize(i18next)(ScopedElementsMixin(PageView))) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: #8b0000;\n --grid-record-emphasized-color: #ff6b6b;\n }\n\n ox-grist {\n overflow-y: auto;\n flex: 1;\n }\n\n ox-filters-form {\n flex: 1;\n }\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() {\n return {\n title: i18next.t('title.git-project list'),\n search: {\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist.searchText\n },\n filter: {\n handler: () => {\n this.grist.toggleHeadroom()\n }\n },\n help: 'operato-codelingua/git-project',\n actions: [\n {\n title: i18next.t('button.save'),\n action: this._updateGitProject.bind(this),\n ...CommonButtonStyles.save\n },\n {\n title: i18next.t('button.delete'),\n action: this._deleteGitProject.bind(this),\n ...CommonButtonStyles.delete\n }\n ]\n }\n }\n\n render() {\n const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" class=\"header\">\n <div class=\"filters\">\n <ox-filters-form autofocus without-search></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\n <ox-record-creator id=\"add\" .callback=${this.creationCallback.bind(this)}>\n <button>\n <md-icon>add</md-icon>\n </button>\n </ox-record-creator>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n list: {\n fields: ['name', 'description'],\n details: ['active', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'gutter',\n gutterName: 'button',\n name: 'state',\n icon: record => (!record || !record.apiKey ? '' : record.state == 'REGISTERED' ? 'link' : 'link_off'),\n handlers: {\n click: (columns, data, column, record, rowIndex) => {\n if (!record || !record.name || record.__dirty__ == '+') {\n return\n }\n if (record.state == 'REGISTERED') {\n this.unregister(record)\n } else {\n this.register(record)\n }\n }\n }\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'string',\n name: 'repositoryUrl',\n header: i18next.t('field.repository-url'),\n record: {\n editable: true\n },\n width: 200\n },\n {\n type: 'string',\n name: 'apiKey',\n header: i18next.t('field.api-key'),\n record: {\n editable: true\n },\n width: 200\n },\n {\n type: 'select',\n name: 'language',\n header: i18next.t('field.programming-language'),\n record: {\n options: ['', 'java', 'javascript', 'typescript', 'python', 'c', 'cpp'],\n editable: true\n },\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n label: true,\n header: i18next.t('field.active'),\n record: {\n editable: true\n },\n filter: true,\n sortable: true,\n width: 60\n },\n {\n type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: {\n editable: false\n },\n sortable: true,\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: {\n editable: false\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n appendable: false,\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n // do something here when this page just became as active\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: gitProjects(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n repositoryUrl\n apiKey\n language\n state\n active\n params\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteGitProject() {\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteGitProjects(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({\n message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateGitProject() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [GitProjectPatch!]!) {\n updateMultipleGitProject(patches: $patches) {\n name\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n }\n }\n }\n\n async creationCallback(gitProject) {\n try {\n const response = await client.query({\n query: gql`\n mutation ($gitProject: NewGitProject!) {\n createGitProject(gitProject: $gitProject) {\n id\n }\n }\n `,\n variables: {\n gitProject\n },\n context: {\n hasUpload: true\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n message: i18next.t('text.data_created_successfully')\n }\n })\n )\n }\n\n return true\n } catch (ex) {\n console.error(ex)\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n type: 'error',\n message: i18next.t('text.error')\n }\n })\n )\n return false\n }\n }\n\n async register(record) {\n var response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n registerGithubWebhook(id: $id)\n }\n `,\n variables: {\n id: record.id\n }\n })\n\n var result = response.data.registerGithubWebhook\n notify({\n level: 'info',\n message: `${result ? 'success' : 'fail'} to register : ${record.name}`\n })\n\n this.grist.fetch()\n }\n\n async unregister(record) {\n var response = await client.mutate({\n mutation: gql`\n mutation ($id: String!) {\n unregisterGithubWebhook(id: $id)\n }\n `,\n variables: {\n id: record.id\n }\n })\n\n const result = response.data.unregisterGithubWebhook\n notify({\n level: 'info',\n message: `${result ? 'success' : 'fail'} to unregister : ${record.name}`\n })\n\n this.grist.fetch()\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function route(page: string): "git-project-list" | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../client/route.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAY;IACxC,QAAQ,IAAI,EAAE,CAAC;QAEX,KAAK,kBAAkB;YACrB,MAAM,CAAC,2CAA2C,CAAC,CAAA;YACnD,OAAO,IAAI,CAAA;IACf,CAAC;AACH,CAAC","sourcesContent":["export default function route(page: string) {\n switch (page) {\n \n case 'git-project-list':\n import('./pages/git-project/git-project-list-page')\n return page\n }\n }\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
.dark {
|
|
2
|
+
--md-sys-color-primary: rgb(219 198 110);
|
|
3
|
+
--md-sys-color-surface-tint: rgb(219 198 110);
|
|
4
|
+
--md-sys-color-on-primary: rgb(58 48 0);
|
|
5
|
+
--md-sys-color-primary-container: rgb(83 70 0);
|
|
6
|
+
--md-sys-color-on-primary-container: rgb(248 226 135);
|
|
7
|
+
--md-sys-color-secondary: rgb(209 198 161);
|
|
8
|
+
--md-sys-color-on-secondary: rgb(54 48 22);
|
|
9
|
+
--md-sys-color-secondary-container: rgb(78 71 42);
|
|
10
|
+
--md-sys-color-on-secondary-container: rgb(238 226 188);
|
|
11
|
+
--md-sys-color-tertiary: rgb(169 208 179);
|
|
12
|
+
--md-sys-color-on-tertiary: rgb(20 55 35);
|
|
13
|
+
--md-sys-color-tertiary-container: rgb(44 78 56);
|
|
14
|
+
--md-sys-color-on-tertiary-container: rgb(197 236 206);
|
|
15
|
+
--md-sys-color-error: rgb(255 180 171);
|
|
16
|
+
--md-sys-color-on-error: rgb(105 0 5);
|
|
17
|
+
--md-sys-color-error-container: rgb(147 0 10);
|
|
18
|
+
--md-sys-color-on-error-container: rgb(255 218 214);
|
|
19
|
+
--md-sys-color-background: rgb(21 19 11);
|
|
20
|
+
--md-sys-color-on-background: rgb(232 226 212);
|
|
21
|
+
--md-sys-color-surface: rgb(21 19 11);
|
|
22
|
+
--md-sys-color-on-surface: rgb(232 226 212);
|
|
23
|
+
--md-sys-color-surface-variant: rgb(75 71 57);
|
|
24
|
+
--md-sys-color-on-surface-variant: rgb(205 198 180);
|
|
25
|
+
--md-sys-color-outline: rgb(150 144 128);
|
|
26
|
+
--md-sys-color-outline-variant: rgb(75 71 57);
|
|
27
|
+
--md-sys-color-shadow: rgb(0 0 0);
|
|
28
|
+
--md-sys-color-scrim: rgb(0 0 0);
|
|
29
|
+
--md-sys-color-inverse-surface: rgb(232 226 212);
|
|
30
|
+
--md-sys-color-inverse-on-surface: rgb(51 48 39);
|
|
31
|
+
--md-sys-color-inverse-primary: rgb(109 94 15);
|
|
32
|
+
--md-sys-color-primary-fixed: rgb(248 226 135);
|
|
33
|
+
--md-sys-color-on-primary-fixed: rgb(34 27 0);
|
|
34
|
+
--md-sys-color-primary-fixed-dim: rgb(219 198 110);
|
|
35
|
+
--md-sys-color-on-primary-fixed-variant: rgb(83 70 0);
|
|
36
|
+
--md-sys-color-secondary-fixed: rgb(238 226 188);
|
|
37
|
+
--md-sys-color-on-secondary-fixed: rgb(33 27 4);
|
|
38
|
+
--md-sys-color-secondary-fixed-dim: rgb(209 198 161);
|
|
39
|
+
--md-sys-color-on-secondary-fixed-variant: rgb(78 71 42);
|
|
40
|
+
--md-sys-color-tertiary-fixed: rgb(197 236 206);
|
|
41
|
+
--md-sys-color-on-tertiary-fixed: rgb(0 33 15);
|
|
42
|
+
--md-sys-color-tertiary-fixed-dim: rgb(169 208 179);
|
|
43
|
+
--md-sys-color-on-tertiary-fixed-variant: rgb(44 78 56);
|
|
44
|
+
--md-sys-color-surface-dim: rgb(21 19 11);
|
|
45
|
+
--md-sys-color-surface-bright: rgb(60 57 48);
|
|
46
|
+
--md-sys-color-surface-container-lowest: rgb(16 14 7);
|
|
47
|
+
--md-sys-color-surface-container-low: rgb(30 27 19);
|
|
48
|
+
--md-sys-color-surface-container: rgb(34 32 23);
|
|
49
|
+
--md-sys-color-surface-container-high: rgb(45 42 33);
|
|
50
|
+
--md-sys-color-surface-container-highest: rgb(56 53 43);
|
|
51
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
.light {
|
|
2
|
+
--md-sys-color-primary: rgb(109 94 15);
|
|
3
|
+
--md-sys-color-surface-tint: rgb(109 94 15);
|
|
4
|
+
--md-sys-color-on-primary: rgb(255 255 255);
|
|
5
|
+
--md-sys-color-primary-container: rgb(248 226 135);
|
|
6
|
+
--md-sys-color-on-primary-container: rgb(34 27 0);
|
|
7
|
+
--md-sys-color-secondary: rgb(102 94 64);
|
|
8
|
+
--md-sys-color-on-secondary: rgb(255 255 255);
|
|
9
|
+
--md-sys-color-secondary-container: rgb(238 226 188);
|
|
10
|
+
--md-sys-color-on-secondary-container: rgb(33 27 4);
|
|
11
|
+
--md-sys-color-tertiary: rgb(67 102 78);
|
|
12
|
+
--md-sys-color-on-tertiary: rgb(255 255 255);
|
|
13
|
+
--md-sys-color-tertiary-container: rgb(197 236 206);
|
|
14
|
+
--md-sys-color-on-tertiary-container: rgb(0 33 15);
|
|
15
|
+
--md-sys-color-error: rgb(186 26 26);
|
|
16
|
+
--md-sys-color-on-error: rgb(255 255 255);
|
|
17
|
+
--md-sys-color-error-container: rgb(255 218 214);
|
|
18
|
+
--md-sys-color-on-error-container: rgb(65 0 2);
|
|
19
|
+
--md-sys-color-background: rgb(255 249 238);
|
|
20
|
+
--md-sys-color-on-background: rgb(30 27 19);
|
|
21
|
+
--md-sys-color-surface: rgb(255 249 238);
|
|
22
|
+
--md-sys-color-on-surface: rgb(30 27 19);
|
|
23
|
+
--md-sys-color-surface-variant: rgb(234 226 208);
|
|
24
|
+
--md-sys-color-on-surface-variant: rgb(75 71 57);
|
|
25
|
+
--md-sys-color-outline: rgb(124 119 103);
|
|
26
|
+
--md-sys-color-outline-variant: rgb(205 198 180);
|
|
27
|
+
--md-sys-color-shadow: rgb(0 0 0);
|
|
28
|
+
--md-sys-color-scrim: rgb(0 0 0);
|
|
29
|
+
--md-sys-color-inverse-surface: rgb(51 48 39);
|
|
30
|
+
--md-sys-color-inverse-on-surface: rgb(247 240 226);
|
|
31
|
+
--md-sys-color-inverse-primary: rgb(219 198 110);
|
|
32
|
+
--md-sys-color-primary-fixed: rgb(248 226 135);
|
|
33
|
+
--md-sys-color-on-primary-fixed: rgb(34 27 0);
|
|
34
|
+
--md-sys-color-primary-fixed-dim: rgb(219 198 110);
|
|
35
|
+
--md-sys-color-on-primary-fixed-variant: rgb(83 70 0);
|
|
36
|
+
--md-sys-color-secondary-fixed: rgb(238 226 188);
|
|
37
|
+
--md-sys-color-on-secondary-fixed: rgb(33 27 4);
|
|
38
|
+
--md-sys-color-secondary-fixed-dim: rgb(209 198 161);
|
|
39
|
+
--md-sys-color-on-secondary-fixed-variant: rgb(78 71 42);
|
|
40
|
+
--md-sys-color-tertiary-fixed: rgb(197 236 206);
|
|
41
|
+
--md-sys-color-on-tertiary-fixed: rgb(0 33 15);
|
|
42
|
+
--md-sys-color-tertiary-fixed-dim: rgb(169 208 179);
|
|
43
|
+
--md-sys-color-on-tertiary-fixed-variant: rgb(44 78 56);
|
|
44
|
+
--md-sys-color-surface-dim: rgb(224 217 204);
|
|
45
|
+
--md-sys-color-surface-bright: rgb(255 249 238);
|
|
46
|
+
--md-sys-color-surface-container-lowest: rgb(255 255 255);
|
|
47
|
+
--md-sys-color-surface-container-low: rgb(250 243 229);
|
|
48
|
+
--md-sys-color-surface-container: rgb(244 237 223);
|
|
49
|
+
--md-sys-color-surface-container-high: rgb(238 232 218);
|
|
50
|
+
--md-sys-color-surface-container-highest: rgb(232 226 212);
|
|
51
|
+
}
|