@things-factory/operato-codelingua 8.0.0-beta.1 → 8.0.0-beta.4

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