@things-factory/operato-codelingua 6.1.66 → 7.0.8

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 (123) hide show
  1. package/README.md +66 -21
  2. package/_index.html +22 -13
  3. package/assets/images/hatiolab-logo.png +0 -0
  4. package/assets/images/user.png +0 -0
  5. package/assets/manifest.json +5 -5
  6. package/client/bootstrap.ts +199 -1
  7. package/client/icons/menu-icons.ts +91 -0
  8. package/client/pages/git-project/git-project-list-page.ts +334 -0
  9. package/client/route.ts +5 -7
  10. package/client/themes/dark.css +51 -0
  11. package/client/themes/light.css +51 -0
  12. package/client/viewparts/menu-tools.ts +170 -0
  13. package/client/viewparts/user-circle.ts +24 -0
  14. package/config/config.development.js +1 -5
  15. package/config/config.production.js +1 -5
  16. package/db.sqlite +0 -0
  17. package/dist-client/bootstrap.d.ts +7 -0
  18. package/dist-client/bootstrap.js +172 -0
  19. package/dist-client/bootstrap.js.map +1 -0
  20. package/dist-client/icons/menu-icons.d.ts +5 -0
  21. package/dist-client/icons/menu-icons.js +84 -0
  22. package/dist-client/icons/menu-icons.js.map +1 -0
  23. package/dist-client/index.d.ts +0 -0
  24. package/dist-client/index.js +2 -0
  25. package/dist-client/index.js.map +1 -0
  26. package/dist-client/pages/git-project/git-project-list-page.d.ts +53 -0
  27. package/dist-client/pages/git-project/git-project-list-page.js +318 -0
  28. package/dist-client/pages/git-project/git-project-list-page.js.map +1 -0
  29. package/dist-client/route.d.ts +1 -0
  30. package/dist-client/route.js +8 -0
  31. package/dist-client/route.js.map +1 -0
  32. package/dist-client/themes/dark.css +51 -0
  33. package/dist-client/themes/light.css +51 -0
  34. package/dist-client/tsconfig.tsbuildinfo +1 -0
  35. package/dist-client/viewparts/menu-tools.d.ts +17 -0
  36. package/dist-client/viewparts/menu-tools.js +172 -0
  37. package/dist-client/viewparts/menu-tools.js.map +1 -0
  38. package/dist-client/viewparts/user-circle.d.ts +5 -0
  39. package/dist-client/viewparts/user-circle.js +26 -0
  40. package/dist-client/viewparts/user-circle.js.map +1 -0
  41. package/dist-server/controllers/github-controller.d.ts +2 -0
  42. package/dist-server/controllers/github-controller.js +78 -0
  43. package/dist-server/controllers/github-controller.js.map +1 -0
  44. package/dist-server/controllers/index.d.ts +0 -0
  45. package/dist-server/index.d.ts +4 -0
  46. package/dist-server/index.js +3 -0
  47. package/dist-server/index.js.map +1 -1
  48. package/dist-server/middlewares/index.d.ts +1 -0
  49. package/dist-server/middlewares/index.js +7 -0
  50. package/dist-server/middlewares/index.js.map +1 -0
  51. package/dist-server/migrations/index.d.ts +1 -0
  52. package/dist-server/migrations/index.js +12 -0
  53. package/dist-server/migrations/index.js.map +1 -0
  54. package/dist-server/routers/github-webhook-router.d.ts +1 -0
  55. package/dist-server/routers/github-webhook-router.js +16 -0
  56. package/dist-server/routers/github-webhook-router.js.map +1 -0
  57. package/dist-server/routes.d.ts +1 -0
  58. package/dist-server/routes.js +4 -1
  59. package/dist-server/routes.js.map +1 -1
  60. package/dist-server/service/git-project/git-project-mutation.d.ts +10 -0
  61. package/dist-server/service/git-project/git-project-mutation.js +127 -0
  62. package/dist-server/service/git-project/git-project-mutation.js.map +1 -0
  63. package/dist-server/service/git-project/git-project-query.d.ts +11 -0
  64. package/dist-server/service/git-project/git-project-query.js +79 -0
  65. package/dist-server/service/git-project/git-project-query.js.map +1 -0
  66. package/dist-server/service/git-project/git-project-type.d.ts +20 -0
  67. package/dist-server/service/git-project/git-project-type.js +77 -0
  68. package/dist-server/service/git-project/git-project-type.js.map +1 -0
  69. package/dist-server/service/git-project/git-project.d.ts +22 -0
  70. package/dist-server/service/git-project/git-project.js +95 -0
  71. package/dist-server/service/git-project/git-project.js.map +1 -0
  72. package/dist-server/service/git-project/index.d.ts +6 -0
  73. package/dist-server/service/git-project/index.js +10 -0
  74. package/dist-server/service/git-project/index.js.map +1 -0
  75. package/dist-server/service/index.d.ts +5 -0
  76. package/dist-server/service/index.js +8 -3
  77. package/dist-server/service/index.js.map +1 -1
  78. package/dist-server/tsconfig.tsbuildinfo +1 -1
  79. package/helps/operato-codelingua/git-project.md +160 -0
  80. package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +22 -12
  81. package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +40 -0
  82. package/logs/application-2024-07-07-17.log +156 -0
  83. package/logs/application-2024-07-07-20.log +81 -0
  84. package/logs/application-2024-07-08-00.log +81 -0
  85. package/logs/application-2024-07-08-01.log +83 -0
  86. package/logs/application-2024-07-08-02.log +81 -0
  87. package/logs/application-2024-07-08-19.log +81 -0
  88. package/logs/connections-2024-07-07-17.log +41 -0
  89. package/logs/connections-2024-07-07-20.log +41 -0
  90. package/logs/connections-2024-07-08-00.log +41 -0
  91. package/logs/connections-2024-07-08-01.log +41 -0
  92. package/logs/connections-2024-07-08-02.log +41 -0
  93. package/logs/connections-2024-07-08-19.log +41 -0
  94. package/package.json +57 -18
  95. package/schema.graphql +4259 -0
  96. package/server/controllers/github-controller.ts +73 -0
  97. package/server/index.ts +4 -0
  98. package/server/middlewares/index.ts +3 -0
  99. package/server/migrations/index.ts +9 -0
  100. package/server/routers/github-webhook-router.ts +21 -0
  101. package/server/routes.ts +3 -1
  102. package/server/service/git-project/git-project-mutation.ts +136 -0
  103. package/server/service/git-project/git-project-query.ts +48 -0
  104. package/server/service/git-project/git-project-type.ts +55 -0
  105. package/server/service/git-project/git-project.ts +84 -0
  106. package/server/service/git-project/index.ts +7 -0
  107. package/server/service/index.ts +8 -0
  108. package/things-factory.config.js +8 -0
  109. package/translations/en.json +3 -1
  110. package/translations/ja.json +3 -1
  111. package/translations/ko.json +3 -1
  112. package/translations/ms.json +3 -1
  113. package/translations/zh.json +3 -1
  114. package/views/auth-page.html +14 -10
  115. package/views/public/home.html +14 -11
  116. package/client/pages/main.ts +0 -33
  117. package/client/themes/app-theme.css +0 -142
  118. package/config.development.js +0 -7
  119. package/logs/application-2023-06-25-11.log +0 -12
  120. package/logs/application-2023-06-25-12.log +0 -34
  121. package/logs/application-2023-06-25-13.log +0 -8
  122. package/schema.gql +0 -841
  123. package/things-factory.config.ts +0 -13
@@ -0,0 +1,334 @@
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: 'string',
121
+ name: 'name',
122
+ header: i18next.t('field.name'),
123
+ record: {
124
+ editable: true
125
+ },
126
+ filter: 'search',
127
+ sortable: true,
128
+ width: 150
129
+ },
130
+ {
131
+ type: 'string',
132
+ name: 'description',
133
+ header: i18next.t('field.description'),
134
+ record: {
135
+ editable: true
136
+ },
137
+ filter: 'search',
138
+ width: 200
139
+ },
140
+ {
141
+ type: 'checkbox',
142
+ name: 'active',
143
+ label: true,
144
+ header: i18next.t('field.active'),
145
+ record: {
146
+ editable: true
147
+ },
148
+ filter: true,
149
+ sortable: true,
150
+ width: 60
151
+ },
152
+ {
153
+ type: 'resource-object',
154
+ name: 'updater',
155
+ header: i18next.t('field.updater'),
156
+ record: {
157
+ editable: false
158
+ },
159
+ sortable: true,
160
+ width: 120
161
+ },
162
+ {
163
+ type: 'datetime',
164
+ name: 'updatedAt',
165
+ header: i18next.t('field.updated_at'),
166
+ record: {
167
+ editable: false
168
+ },
169
+ sortable: true,
170
+ width: 180
171
+ }
172
+ ],
173
+ rows: {
174
+ appendable: false,
175
+ selectable: {
176
+ multiple: true
177
+ }
178
+ },
179
+ sorters: [
180
+ {
181
+ name: 'name'
182
+ }
183
+ ]
184
+ }
185
+ }
186
+
187
+ async pageUpdated(changes: any, lifecycle: any) {
188
+ if (this.active) {
189
+ // do something here when this page just became as active
190
+ }
191
+ }
192
+
193
+ async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {
194
+ const response = await client.query({
195
+ query: gql`
196
+ query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
197
+ responses: gitProjects(filters: $filters, pagination: $pagination, sortings: $sortings) {
198
+ items {
199
+ id
200
+ name
201
+ description
202
+ active
203
+ updater {
204
+ id
205
+ name
206
+ }
207
+ updatedAt
208
+ }
209
+ total
210
+ }
211
+ }
212
+ `,
213
+ variables: {
214
+ filters,
215
+ pagination: { page, limit },
216
+ sortings
217
+ }
218
+ })
219
+
220
+ return {
221
+ total: response.data.responses.total || 0,
222
+ records: response.data.responses.items || []
223
+ }
224
+ }
225
+
226
+ async _deleteGitProject() {
227
+ if (
228
+ await OxPrompt.open({
229
+ title: i18next.t('text.are_you_sure'),
230
+ text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),
231
+ confirmButton: { text: i18next.t('button.confirm') },
232
+ cancelButton: { text: i18next.t('button.cancel') }
233
+ })
234
+ ) {
235
+ const ids = this.grist.selected.map(record => record.id)
236
+ if (ids && ids.length > 0) {
237
+ const response = await client.mutate({
238
+ mutation: gql`
239
+ mutation ($ids: [String!]!) {
240
+ deleteGitProjects(ids: $ids)
241
+ }
242
+ `,
243
+ variables: {
244
+ ids
245
+ }
246
+ })
247
+
248
+ if (!response.errors) {
249
+ this.grist.fetch()
250
+ notify({
251
+ message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })
252
+ })
253
+ }
254
+ }
255
+ }
256
+ }
257
+
258
+ async _updateGitProject() {
259
+ let patches = this.grist.dirtyRecords
260
+ if (patches && patches.length) {
261
+ patches = patches.map(patch => {
262
+ let patchField: any = patch.id ? { id: patch.id } : {}
263
+ const dirtyFields = patch.__dirtyfields__
264
+ for (let key in dirtyFields) {
265
+ patchField[key] = dirtyFields[key].after
266
+ }
267
+ patchField.cuFlag = patch.__dirty__
268
+
269
+ return patchField
270
+ })
271
+
272
+ const response = await client.mutate({
273
+ mutation: gql`
274
+ mutation ($patches: [GitProjectPatch!]!) {
275
+ updateMultipleGitProject(patches: $patches) {
276
+ name
277
+ }
278
+ }
279
+ `,
280
+ variables: {
281
+ patches
282
+ }
283
+ })
284
+
285
+ if (!response.errors) {
286
+ this.grist.fetch()
287
+ }
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
+
309
+ if (!response.errors) {
310
+ this.grist.fetch()
311
+ document.dispatchEvent(
312
+ new CustomEvent('notify', {
313
+ detail: {
314
+ message: i18next.t('text.data_created_successfully')
315
+ }
316
+ })
317
+ )
318
+ }
319
+
320
+ return true
321
+ } catch (ex) {
322
+ console.error(ex)
323
+ document.dispatchEvent(
324
+ new CustomEvent('notify', {
325
+ detail: {
326
+ type: 'error',
327
+ message: i18next.t('text.error')
328
+ }
329
+ })
330
+ )
331
+ return false
332
+ }
333
+ }
334
+ }
package/client/route.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  export default function route(page: string) {
2
2
  switch (page) {
3
- case '':
4
- return '/operato-codelingua-main'
5
-
6
- case 'operato-codelingua-main':
7
- import('./pages/main')
8
- return page
3
+
4
+ case 'git-project-list':
5
+ import('./pages/git-project/git-project-list-page')
6
+ return page
7
+ }
9
8
  }
10
- }
@@ -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
+ }
@@ -0,0 +1,170 @@
1
+ import { css, html, LitElement } from 'lit'
2
+ import { customElement, property, query } from 'lit/decorators.js'
3
+
4
+ import { connect } from 'pwa-helpers'
5
+
6
+ import { store } from '@operato/shell'
7
+
8
+ import { ICONS_PROGRESS, ICONS_COMPLETED, ICONS_STATUS, ICONS_OPERATING, ICONS_SETTING } from '../icons/menu-icons'
9
+
10
+ @customElement('menu-tools')
11
+ export class MenuTools extends connect(store)(LitElement) {
12
+ static styles = [
13
+ css`
14
+ :host {
15
+ display: flex;
16
+ background-color: var(--secondary-color);
17
+
18
+ /* for narrow mode */
19
+ flex-direction: column;
20
+ width: 100%;
21
+ --menu-tools-color: rgba(255, 255, 255, 0.9);
22
+ --menu-tools-active-color: rgba(107, 178, 249, 1);
23
+ }
24
+
25
+ :host([width='WIDE']) {
26
+ /* for wide mode */
27
+ flex-direction: row;
28
+ width: initial;
29
+ height: 100%;
30
+ }
31
+
32
+ ul {
33
+ display: flex;
34
+ flex-direction: row;
35
+
36
+ margin: auto;
37
+ padding: 0;
38
+ list-style: none;
39
+ height: 100%;
40
+ overflow: none;
41
+ }
42
+
43
+ :host([width='NARROW']) ul {
44
+ width: 100%;
45
+ justify-content: space-around;
46
+ }
47
+
48
+ :host([width='WIDE']) ul {
49
+ flex-direction: column;
50
+ }
51
+ :host([width='NARROW']) li {
52
+ flex: 1;
53
+ }
54
+
55
+ :host([width='WIDE']) li {
56
+ border-top: 1px solid rgba(255, 255, 255, 0.1);
57
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
58
+ }
59
+
60
+ a {
61
+ display: flex;
62
+ flex-direction: column;
63
+ padding: 5px 0px;
64
+ opacity: 0.7;
65
+ align-items: center;
66
+ text-align: center;
67
+ text-decoration: none;
68
+ text-transform: capitalize;
69
+ color: var(--menu-tools-color);
70
+ border-left: 2px solid transparent;
71
+ }
72
+
73
+ a[active] {
74
+ opacity: 1;
75
+ color: var(--menu-tools-active-color);
76
+ font-weight: bold;
77
+ background-color: rgba(0, 0, 0, 0.15);
78
+ border-left: 2px solid var(--menu-tools-active-color);
79
+ }
80
+
81
+ :host([width='NARROW']) a {
82
+ padding: 0px 0px 5px 0px;
83
+ opacity: 0.8;
84
+ color: var(--menu-tools-color);
85
+ border-left: none;
86
+ border-top: 2px solid transparent;
87
+ }
88
+
89
+ :host([width='NARROW']) a[active] {
90
+ opacity: 1;
91
+ color: var(--menu-tools-active-color);
92
+ font-weight: bold;
93
+ background-color: rgba(0, 0, 0, 0.15);
94
+ border-left: none;
95
+ border-top: 2px solid var(--menu-tools-active-color);
96
+ }
97
+
98
+ img {
99
+ display: block;
100
+ width: 35px;
101
+ padding: 5px 10px 0px 10px;
102
+ }
103
+
104
+ :host([width='NARROW']) img {
105
+ padding: 0;
106
+ }
107
+
108
+ div {
109
+ font-size: 0.6em;
110
+ }
111
+ `
112
+ ]
113
+
114
+ @property({ type: String }) page?: string
115
+ @property({ type: String, reflect: true }) width?: string
116
+
117
+ private menus: { name: string; path: string; icons: string[] }[] = []
118
+
119
+ render() {
120
+ this.menus = [
121
+ {
122
+ name: '진행중',
123
+ path: 'git-project-list',
124
+ icons: ICONS_PROGRESS
125
+ },
126
+ {
127
+ name: '완료',
128
+ path: 'project-completed-list',
129
+ icons: ICONS_COMPLETED
130
+ },
131
+ {
132
+ name: '현황',
133
+ path: 'dssp-status',
134
+ icons: ICONS_STATUS
135
+ },
136
+ {
137
+ name: '공정표',
138
+ path: 'project-schedule-list',
139
+ icons: ICONS_OPERATING
140
+ },
141
+ {
142
+ name: '셋팅',
143
+ path: 'project-setting-list',
144
+ icons: ICONS_SETTING
145
+ }
146
+ ]
147
+
148
+ var page = this.page || ''
149
+
150
+ return html`
151
+ <ul>
152
+ ${this.menus.map(
153
+ menu => html`
154
+ <li>
155
+ <a href=${menu.path} ?active=${!!~page.indexOf(menu.path)}>
156
+ <img src=${!!~page.indexOf(menu.path) ? menu.icons[1] : menu.icons[0]} />
157
+ <div>${menu.name}</div>
158
+ </a>
159
+ </li>
160
+ `
161
+ )}
162
+ </ul>
163
+ `
164
+ }
165
+
166
+ stateChanged(state) {
167
+ this.page = state.route.page
168
+ this.width = state.layout.width
169
+ }
170
+ }
@@ -0,0 +1,24 @@
1
+ import { LitElement, html, css } from 'lit'
2
+ import { customElement } from 'lit/decorators.js'
3
+
4
+ const userIcon = new URL('../../assets/images/user.png', import.meta.url).href
5
+
6
+ @customElement('user-circle')
7
+ export class UserCircle extends LitElement {
8
+ static styles = [
9
+ css`
10
+ img {
11
+ display: block;
12
+ width: 36px;
13
+ height: 36px;
14
+ border-radius: 50%;
15
+
16
+ object-fit: cover;
17
+ }
18
+ `
19
+ ]
20
+
21
+ render() {
22
+ return html` <img src=${userIcon} class="user" /> `
23
+ }
24
+ }
@@ -1,7 +1,3 @@
1
1
  module.exports = {
2
- subdomain: 'system',
3
- openai: {
4
- organization: 'org-XXXXXXXXXXXXXXXX',
5
- apiKey: 'sk-YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY'
6
- }
2
+ subdomain: 'system'
7
3
  }
@@ -1,9 +1,5 @@
1
1
  module.exports = {
2
- subdomain: 'system',
3
- openai: {
4
- organization: 'org-XXXXXXXXXXXXXXXX',
5
- apiKey: 'sk-YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY'
6
- },
2
+ subdomain: "system",
7
3
  email: {
8
4
  host: 'smtp.office365.com', // your sender-email smtp host
9
5
  port: 587, // smtp server port
package/db.sqlite CHANGED
Binary file
@@ -0,0 +1,7 @@
1
+ import '@things-factory/notification';
2
+ import '@things-factory/board-ui';
3
+ import '@things-factory/setting-ui/dist-client';
4
+ import '@operato/i18n/ox-i18n.js';
5
+ import './viewparts/user-circle';
6
+ import './viewparts/menu-tools';
7
+ export default function bootstrap(): Promise<void>;