@things-factory/meta-ui 7.0.1-alpha.1 → 7.0.1-alpha.11
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/client/actions/main.js +14 -20
- package/client/bootstrap.ts +13 -6
- package/client/component/grist/renderer/grist-renderer-meta-object-selector.js +18 -13
- package/client/pages/entity/config-entity.js +180 -112
- package/client/pages/entity/main-menu-selector.js +85 -84
- package/client/pages/history/history-copy-list-popup.js +33 -45
- package/client/pages/history/history-json-list-popup.js +38 -50
- package/client/pages/menu/dynamic-menu-template.js +1 -1
- package/client/pages/menu/dynamic-menu.js +137 -121
- package/client/pages/menu/export-menu-popup.js +210 -218
- package/client/pages/personalize/personal-column-selector.js +112 -122
- package/client/utils/meta-ui-util.js +0 -4
- package/client/utils/service-util.js +4 -4
- package/client/utils/terms-util.js +41 -42
- package/client/utils/ui-util.js +2 -5
- package/client/viewparts/dynamic-menu-part.js +7 -28
- package/dist-client/actions/main.js +6 -5
- package/dist-client/actions/main.js.map +1 -1
- package/dist-client/bootstrap.d.ts +4 -1
- package/dist-client/bootstrap.js +12 -6
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/component/grist/renderer/grist-renderer-code-input.d.ts +1 -1
- package/dist-client/component/grist/renderer/grist-renderer-meta-code-selector.d.ts +1 -1
- package/dist-client/component/grist/renderer/grist-renderer-meta-object-selector.d.ts +1 -1
- package/dist-client/component/grist/renderer/grist-renderer-meta-object-selector.js +9 -3
- package/dist-client/component/grist/renderer/grist-renderer-meta-object-selector.js.map +1 -1
- package/dist-client/component/popup/code-input-editor-popup.d.ts +1 -1
- package/dist-client/component/popup/meta-object-selector-popup.d.ts +1 -1
- package/dist-client/component/popup/record-based-code-editor-popup.d.ts +1 -1
- package/dist-client/mixin/meta-basic-grist-mixin.d.ts +1 -1
- package/dist-client/pages/activity/meta-activity-viewer-element.d.ts +1 -1
- package/dist-client/pages/activity/meta-activity-writer-element.d.ts +1 -1
- package/dist-client/pages/button-role/button-role-detail.d.ts +1 -1
- package/dist-client/pages/entity/config-entity.js +131 -62
- package/dist-client/pages/entity/config-entity.js.map +1 -1
- package/dist-client/pages/entity/main-menu-selector.d.ts +1 -1
- package/dist-client/pages/entity/main-menu-selector.js +74 -73
- package/dist-client/pages/entity/main-menu-selector.js.map +1 -1
- package/dist-client/pages/history/history-copy-list-popup.d.ts +1 -1
- package/dist-client/pages/history/history-copy-list-popup.js +14 -26
- package/dist-client/pages/history/history-copy-list-popup.js.map +1 -1
- package/dist-client/pages/history/history-json-list-popup.d.ts +5 -5
- package/dist-client/pages/history/history-json-list-popup.js +19 -31
- package/dist-client/pages/history/history-json-list-popup.js.map +1 -1
- package/dist-client/pages/menu/dynamic-menu-setting-let.d.ts +1 -1
- package/dist-client/pages/menu/dynamic-menu-template.js +1 -1
- package/dist-client/pages/menu/dynamic-menu-template.js.map +1 -1
- package/dist-client/pages/menu/dynamic-menu.js +68 -48
- package/dist-client/pages/menu/dynamic-menu.js.map +1 -1
- package/dist-client/pages/menu/export-menu-popup.d.ts +5 -5
- package/dist-client/pages/menu/export-menu-popup.js +50 -54
- package/dist-client/pages/menu/export-menu-popup.js.map +1 -1
- package/dist-client/pages/meta-grist-element.d.ts +1 -1
- package/dist-client/pages/meta-grist-page.d.ts +1 -1
- package/dist-client/pages/personalize/personal-column-selector.d.ts +1 -1
- package/dist-client/pages/personalize/personal-column-selector.js +76 -84
- package/dist-client/pages/personalize/personal-column-selector.js.map +1 -1
- package/dist-client/pages/work-code/work-code-detail-popup.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/utils/meta-ui-util.js +0 -3
- package/dist-client/utils/meta-ui-util.js.map +1 -1
- package/dist-client/utils/service-util.js +4 -4
- package/dist-client/utils/service-util.js.map +1 -1
- package/dist-client/utils/terms-util.d.ts +13 -13
- package/dist-client/utils/terms-util.js +10 -12
- package/dist-client/utils/terms-util.js.map +1 -1
- package/dist-client/utils/ui-util.js +1 -4
- package/dist-client/utils/ui-util.js.map +1 -1
- package/dist-client/viewparts/dynamic-menu-part.d.ts +1 -1
- package/dist-client/viewparts/dynamic-menu-part.js +7 -26
- package/dist-client/viewparts/dynamic-menu-part.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
- package/client/viewparts/dynamic-menu-landscape-styles.js +0 -149
- package/client/viewparts/dynamic-menu-landscape.js +0 -106
- package/client/viewparts/dynamic-menu-portrait-styles.js +0 -130
- package/client/viewparts/dynamic-menu-portrait.js +0 -90
- package/client/viewparts/dynamic-top-menu-bar.js +0 -148
- package/dist-client/viewparts/dynamic-menu-landscape-styles.d.ts +0 -1
- package/dist-client/viewparts/dynamic-menu-landscape-styles.js +0 -149
- package/dist-client/viewparts/dynamic-menu-landscape-styles.js.map +0 -1
- package/dist-client/viewparts/dynamic-menu-landscape.d.ts +0 -21
- package/dist-client/viewparts/dynamic-menu-landscape.js +0 -87
- package/dist-client/viewparts/dynamic-menu-landscape.js.map +0 -1
- package/dist-client/viewparts/dynamic-menu-portrait-styles.d.ts +0 -1
- package/dist-client/viewparts/dynamic-menu-portrait-styles.js +0 -130
- package/dist-client/viewparts/dynamic-menu-portrait-styles.js.map +0 -1
- package/dist-client/viewparts/dynamic-menu-portrait.d.ts +0 -13
- package/dist-client/viewparts/dynamic-menu-portrait.js +0 -74
- package/dist-client/viewparts/dynamic-menu-portrait.js.map +0 -1
- package/dist-client/viewparts/dynamic-top-menu-bar.d.ts +0 -27
- package/dist-client/viewparts/dynamic-top-menu-bar.js +0 -133
- package/dist-client/viewparts/dynamic-top-menu-bar.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html } from 'lit
|
|
1
|
+
import { html } from 'lit'
|
|
2
2
|
import gql from 'graphql-tag'
|
|
3
3
|
|
|
4
4
|
import { client, gqlContext } from '@operato/graphql'
|
|
@@ -98,15 +98,15 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
98
98
|
* @returns {Array}
|
|
99
99
|
*/
|
|
100
100
|
async fetchEntities({ page, limit, sorters = [{ name: 'bundle' }, { name: 'name' }] }) {
|
|
101
|
-
// 선택된 엔티티 ID 초기화
|
|
101
|
+
// 선택된 엔티티 ID 초기화
|
|
102
102
|
this.entityId = null
|
|
103
103
|
this.selectedEntity = null
|
|
104
104
|
|
|
105
|
-
if(this.detailGrist && this.detailGrist.data) {
|
|
106
|
-
this.detailGrist.data = {}
|
|
105
|
+
if (this.detailGrist && this.detailGrist.data) {
|
|
106
|
+
this.detailGrist.data = {}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
let filters = [...await this.searchForm.getQueryFilters()]
|
|
109
|
+
let filters = [...(await this.searchForm.getQueryFilters())]
|
|
110
110
|
let selectFields = `
|
|
111
111
|
id
|
|
112
112
|
bundle
|
|
@@ -126,13 +126,15 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
126
126
|
* @returns {Array}
|
|
127
127
|
*/
|
|
128
128
|
async fetchEntityColumns({ page, limit, sorters = [{ name: 'rank' }] }) {
|
|
129
|
-
if(this.entityId) {
|
|
130
|
-
let filters = [
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
if (this.entityId) {
|
|
130
|
+
let filters = [
|
|
131
|
+
{
|
|
132
|
+
name: 'entityId',
|
|
133
|
+
operator: 'eq',
|
|
134
|
+
value: this.entityId
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
|
|
136
138
|
let selectFields = `
|
|
137
139
|
id
|
|
138
140
|
name
|
|
@@ -175,7 +177,7 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
175
177
|
async openMainMenuSelectorPopup() {
|
|
176
178
|
let menuSelector = MetaApi.createCustomElement('main-menu-selector', 'main-menu-selector')
|
|
177
179
|
menuSelector.selectCallback = this.createMenuTo.bind(this)
|
|
178
|
-
await MetaApi.openPopupByElement(TermsUtil.tButton('create-menu'), 'large', menuSelector, true)
|
|
180
|
+
await MetaApi.openPopupByElement(TermsUtil.tButton('create-menu'), 'large', menuSelector, true)
|
|
179
181
|
}
|
|
180
182
|
|
|
181
183
|
/*********************************************************************/
|
|
@@ -189,8 +191,8 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
189
191
|
async saveMasters() {
|
|
190
192
|
let patches = MetaApi.patchesForUpdateMultiple(this.masterGrist)
|
|
191
193
|
if (ValueUtil.isNotEmpty(patches)) {
|
|
192
|
-
patches.forEach(x=>{
|
|
193
|
-
if(!x.tableName || x.tableName.length == 0){
|
|
194
|
+
patches.forEach(x => {
|
|
195
|
+
if (!x.tableName || x.tableName.length == 0) {
|
|
194
196
|
x.tableName = x.name
|
|
195
197
|
}
|
|
196
198
|
})
|
|
@@ -220,13 +222,13 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
220
222
|
let idx = 0
|
|
221
223
|
patches.forEach(patch => {
|
|
222
224
|
idx += 10
|
|
223
|
-
patch.entity = { id
|
|
224
|
-
patch.nullable =
|
|
225
|
-
patch.rank =
|
|
225
|
+
patch.entity = { id: this.entityId }
|
|
226
|
+
patch.nullable = patch.nullable === undefined || patch.nullable == null ? false : patch.nullable
|
|
227
|
+
patch.rank = !patch.rank || patch.rank == 0 ? idx : patch.rank
|
|
226
228
|
patch.gridRank = patch.gridRank ? patch.gridRank : 0
|
|
227
229
|
patch.term = patch.term ? patch.term : patch.name
|
|
228
230
|
patch.colType = !patch.colType ? 'string' : patch.colType
|
|
229
|
-
patch.colSize =
|
|
231
|
+
patch.colSize = patch.colType == 'string' && !patch.colSize ? 50 : patch.colSize
|
|
230
232
|
})
|
|
231
233
|
|
|
232
234
|
let result = await MetaApi.updateMultiple('updateMultipleEntityColumn', patches)
|
|
@@ -246,14 +248,14 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
246
248
|
}
|
|
247
249
|
|
|
248
250
|
/**
|
|
249
|
-
* @description 엔티티 / 서비스 자동 생성
|
|
251
|
+
* @description 엔티티 / 서비스 자동 생성
|
|
250
252
|
************************************
|
|
251
253
|
*/
|
|
252
254
|
async createService() {
|
|
253
255
|
const answer = await MetaApi.showAlertPopup('button.create-service', 'text.are_you_sure', 'question', 'confirm', 'cancel')
|
|
254
256
|
if (answer.value) {
|
|
255
257
|
let ids = MetaApi.getSelectedIdList(this.masterGrist, true)
|
|
256
|
-
if(ids) {
|
|
258
|
+
if (ids) {
|
|
257
259
|
let selectedId = ids[0]
|
|
258
260
|
const res = await client.query({
|
|
259
261
|
query: gql`
|
|
@@ -265,7 +267,7 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
265
267
|
context: gqlContext()
|
|
266
268
|
})
|
|
267
269
|
|
|
268
|
-
if(res && res.data && res.data.toolCreateService) {
|
|
270
|
+
if (res && res.data && res.data.toolCreateService) {
|
|
269
271
|
MetaApi.showToast('info', TermsUtil.tText('success to process'))
|
|
270
272
|
}
|
|
271
273
|
}
|
|
@@ -277,11 +279,11 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
277
279
|
************************************
|
|
278
280
|
*/
|
|
279
281
|
async createMenu() {
|
|
280
|
-
if(this.entityId) {
|
|
282
|
+
if (this.entityId) {
|
|
281
283
|
// 메인 메뉴를 선택하는 팝업을 실행하여 어떤 메뉴 하위에 엔티티 메뉴를 생성할 지 결정
|
|
282
284
|
const answer = await MetaApi.showAlertPopup('button.create-menu', 'text.are_you_sure', 'question', 'confirm', 'cancel')
|
|
283
285
|
if (answer.value) {
|
|
284
|
-
if(MetaApi.getSelectedIdList(this.masterGrist, true)) {
|
|
286
|
+
if (MetaApi.getSelectedIdList(this.masterGrist, true)) {
|
|
285
287
|
await this.openMainMenuSelectorPopup()
|
|
286
288
|
}
|
|
287
289
|
}
|
|
@@ -298,19 +300,19 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
298
300
|
async createMenuTo(mainMenuId) {
|
|
299
301
|
const res = await client.query({
|
|
300
302
|
query: gql`
|
|
301
|
-
mutation($id: String!, $parent_menu_id: String!) {
|
|
302
|
-
toolCreateMenu(id: $id, parent_menu_id: $parent_menu_id)
|
|
303
|
+
mutation ($id: String!, $parent_menu_id: String!) {
|
|
304
|
+
toolCreateMenu(id: $id, parent_menu_id: $parent_menu_id)
|
|
303
305
|
}
|
|
304
306
|
`,
|
|
305
307
|
variables: { id: this.entityId, parent_menu_id: mainMenuId },
|
|
306
308
|
context: gqlContext()
|
|
307
309
|
})
|
|
308
310
|
|
|
309
|
-
if(res && res.data && res.data.toolCreateMenu) {
|
|
311
|
+
if (res && res.data && res.data.toolCreateMenu) {
|
|
310
312
|
MetaApi.showToast('info', TermsUtil.tText('success to process'))
|
|
311
|
-
return { success
|
|
313
|
+
return { success: true }
|
|
312
314
|
} else {
|
|
313
|
-
return { success
|
|
315
|
+
return { success: false }
|
|
314
316
|
}
|
|
315
317
|
}
|
|
316
318
|
|
|
@@ -321,9 +323,7 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
321
323
|
async createUnregisteredTerms() {
|
|
322
324
|
try {
|
|
323
325
|
if (this.entityId) {
|
|
324
|
-
const terms = this.detailGrist.data.records
|
|
325
|
-
.filter(record => TermsUtil.tLabel(record.term) === record.term)
|
|
326
|
-
.map(r => `label.${r.term}`)
|
|
326
|
+
const terms = this.detailGrist.data.records.filter(record => TermsUtil.tLabel(record.term) === record.term).map(r => `label.${r.term}`)
|
|
327
327
|
const bundle = this.selectedEntity.bundle
|
|
328
328
|
|
|
329
329
|
if (terms.length) {
|
|
@@ -364,9 +364,7 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
364
364
|
...this.detailGrist._config.columns
|
|
365
365
|
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
|
366
366
|
.reduce((record, column) => {
|
|
367
|
-
record[column.imex.key] = column.imex.key
|
|
368
|
-
.split('.')
|
|
369
|
-
.reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
|
367
|
+
record[column.imex.key] = column.imex.key.split('.').reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
|
370
368
|
return record
|
|
371
369
|
}, {})
|
|
372
370
|
}
|
|
@@ -394,12 +392,12 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
394
392
|
fileUpload.setAttribute('accept', fileTypes)
|
|
395
393
|
fileUpload.hidden = true
|
|
396
394
|
|
|
397
|
-
fileUpload.addEventListener('change',
|
|
398
|
-
//임포트 대상 엑셀 파일 읽기
|
|
395
|
+
fileUpload.addEventListener('change', event => {
|
|
396
|
+
//임포트 대상 엑셀 파일 읽기
|
|
399
397
|
const fileObj = event.currentTarget.files[0]
|
|
400
398
|
const extension = fileObj.name.split('.').pop()
|
|
401
399
|
const reader = new FileReader()
|
|
402
|
-
|
|
400
|
+
|
|
403
401
|
// Ready The Event For When A File Gets Selected
|
|
404
402
|
reader.onload = function (e) {
|
|
405
403
|
const data = e.target.result
|
|
@@ -420,61 +418,66 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
420
418
|
}
|
|
421
419
|
|
|
422
420
|
/**
|
|
423
|
-
* @description 엔티티 컬럼 엑셀 임포트 처리
|
|
421
|
+
* @description 엔티티 컬럼 엑셀 임포트 처리
|
|
424
422
|
**************************************
|
|
425
423
|
*/
|
|
426
424
|
importEntityColumns(records) {
|
|
427
425
|
let importList = records.header ? records.data : records
|
|
428
426
|
|
|
429
427
|
if (importList && importList.length > 0) {
|
|
430
|
-
importList.forEach(i => {
|
|
428
|
+
importList.forEach(i => {
|
|
429
|
+
i.__selected__ = true
|
|
430
|
+
})
|
|
431
431
|
let cols = this.importConfig.columns.filter(column => !!column.imex)
|
|
432
432
|
setTimeout(() => {
|
|
433
433
|
MetaApi.openPopupByElement(
|
|
434
|
-
TermsUtil.tTitle('import'),
|
|
434
|
+
TermsUtil.tTitle('import'),
|
|
435
435
|
'large',
|
|
436
|
-
html`
|
|
437
|
-
|
|
438
|
-
.records=${importList}
|
|
436
|
+
html` <import-pop-up
|
|
437
|
+
.records=${importList}
|
|
439
438
|
.config=${{
|
|
440
439
|
rows: importList,
|
|
441
|
-
columns: [
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
440
|
+
columns: [
|
|
441
|
+
{
|
|
442
|
+
type: 'gutter',
|
|
443
|
+
gutterName: 'sequence'
|
|
444
|
+
},
|
|
445
|
+
...cols
|
|
446
|
+
]
|
|
447
|
+
}}
|
|
448
|
+
.importHandler="${this.importHandler.bind(this)}"
|
|
449
|
+
>
|
|
450
|
+
</import-pop-up>`
|
|
451
|
+
)
|
|
448
452
|
}, 500)
|
|
449
453
|
}
|
|
450
454
|
}
|
|
451
455
|
|
|
452
456
|
/**
|
|
453
|
-
* @description 엔티티 컬럼 엑셀 임포트 처리
|
|
457
|
+
* @description 엔티티 컬럼 엑셀 임포트 처리
|
|
454
458
|
**************************************
|
|
455
459
|
*/
|
|
456
460
|
async importHandler(patches) {
|
|
457
|
-
if(!patches || patches.length == 0) {
|
|
461
|
+
if (!patches || patches.length == 0) {
|
|
458
462
|
MetaApi.showToast('info', 'text.no_data')
|
|
459
463
|
history.back()
|
|
460
|
-
|
|
461
464
|
} else {
|
|
462
465
|
let idx = 0
|
|
463
466
|
patches.forEach(patch => {
|
|
464
467
|
idx += 10
|
|
465
|
-
patch.colSize = ValueUtil.isNotEmpty(patch.colSize) ? ValueUtil.toInteger(patch.colSize) :
|
|
468
|
+
patch.colSize = ValueUtil.isNotEmpty(patch.colSize) ? ValueUtil.toInteger(patch.colSize) : patch.colType == 'string' ? 50 : 0
|
|
466
469
|
patch.rank = ValueUtil.toInteger(patch.rank, 0)
|
|
467
470
|
patch.uniqRank = ValueUtil.toInteger(patch.uniqRank, 0)
|
|
468
471
|
patch.searchRank = ValueUtil.toInteger(patch.searchRank, 0)
|
|
469
472
|
patch.gridRank = ValueUtil.toInteger(patch.gridRank, 0)
|
|
470
473
|
patch.gridWidth = ValueUtil.toInteger(patch.gridWidth, 0)
|
|
471
|
-
patch.entity = { id
|
|
474
|
+
patch.entity = { id: this.entityId }
|
|
472
475
|
patch.nullable = ValueUtil.toBoolean(patch.nullable)
|
|
473
476
|
patch.term = patch.term ? patch.term : patch.name
|
|
474
477
|
patch.colType = !patch.colType ? 'string' : patch.colType
|
|
475
478
|
delete patch['string']
|
|
476
479
|
})
|
|
477
|
-
|
|
480
|
+
|
|
478
481
|
let result = await MetaApi.updateMultiple('updateMultipleEntityColumn', patches)
|
|
479
482
|
if (result) {
|
|
480
483
|
this.detailGrist.fetch()
|
|
@@ -487,8 +490,8 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
487
490
|
* @description 체크 컬럼
|
|
488
491
|
************************
|
|
489
492
|
*/
|
|
490
|
-
|
|
491
|
-
if(this.entityId) {
|
|
493
|
+
async checkEntityColumns() {
|
|
494
|
+
if (this.entityId) {
|
|
492
495
|
let records = this.detailGrist.data.records
|
|
493
496
|
let lastIdx = records && records.length ? records.length * 10 : 0
|
|
494
497
|
let idExist = false
|
|
@@ -497,47 +500,109 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
497
500
|
let updatedAtExist = false
|
|
498
501
|
let creatorIdExist = false
|
|
499
502
|
let updaterIdExist = false
|
|
500
|
-
|
|
501
|
-
if(records && records.length > 0) {
|
|
502
|
-
idExist =
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
503
|
+
|
|
504
|
+
if (records && records.length > 0) {
|
|
505
|
+
idExist =
|
|
506
|
+
records.findIndex(i => {
|
|
507
|
+
return i.name == 'id'
|
|
508
|
+
}) >= 0
|
|
509
|
+
domainIdExist =
|
|
510
|
+
records.findIndex(i => {
|
|
511
|
+
return i.name == 'domain_id'
|
|
512
|
+
}) >= 0
|
|
513
|
+
createdAtExist =
|
|
514
|
+
records.findIndex(i => {
|
|
515
|
+
return i.name == 'created_at'
|
|
516
|
+
}) >= 0
|
|
517
|
+
updatedAtExist =
|
|
518
|
+
records.findIndex(i => {
|
|
519
|
+
return i.name == 'updated_at'
|
|
520
|
+
}) >= 0
|
|
521
|
+
creatorIdExist =
|
|
522
|
+
records.findIndex(i => {
|
|
523
|
+
return i.name == 'creator_id'
|
|
524
|
+
}) >= 0
|
|
525
|
+
updaterIdExist =
|
|
526
|
+
records.findIndex(i => {
|
|
527
|
+
return i.name == 'updater_id'
|
|
528
|
+
}) >= 0
|
|
508
529
|
}
|
|
509
|
-
|
|
530
|
+
|
|
510
531
|
let defaultList = []
|
|
511
|
-
if(!idExist) {
|
|
532
|
+
if (!idExist) {
|
|
512
533
|
lastIdx += 10
|
|
513
|
-
defaultList.push({ entity: { id
|
|
534
|
+
defaultList.push({ entity: { id: this.entityId }, name: 'id', colType: 'string', colSize: 0, nullable: false, term: 'id', rank: lastIdx, cuFlag: '+' })
|
|
514
535
|
}
|
|
515
536
|
|
|
516
|
-
if(!domainIdExist) {
|
|
537
|
+
if (!domainIdExist) {
|
|
517
538
|
lastIdx += 10
|
|
518
|
-
defaultList.push({ entity: { id
|
|
539
|
+
defaultList.push({ entity: { id: this.entityId }, name: 'domain_id', colType: 'string', colSize: 0, nullable: false, term: 'domain', rank: lastIdx, cuFlag: '+' })
|
|
519
540
|
}
|
|
520
|
-
|
|
521
|
-
if(!createdAtExist) {
|
|
541
|
+
|
|
542
|
+
if (!createdAtExist) {
|
|
522
543
|
lastIdx += 10
|
|
523
|
-
defaultList.push({
|
|
544
|
+
defaultList.push({
|
|
545
|
+
entity: { id: this.entityId },
|
|
546
|
+
name: 'created_at',
|
|
547
|
+
colType: 'timestamp',
|
|
548
|
+
colSize: 0,
|
|
549
|
+
nullable: true,
|
|
550
|
+
term: 'created_at',
|
|
551
|
+
rank: lastIdx,
|
|
552
|
+
gridRank: 0,
|
|
553
|
+
gridWidth: 140,
|
|
554
|
+
cuFlag: '+'
|
|
555
|
+
})
|
|
524
556
|
}
|
|
525
|
-
|
|
526
|
-
if(!updatedAtExist) {
|
|
557
|
+
|
|
558
|
+
if (!updatedAtExist) {
|
|
527
559
|
lastIdx += 10
|
|
528
|
-
defaultList.push({
|
|
560
|
+
defaultList.push({
|
|
561
|
+
entity: { id: this.entityId },
|
|
562
|
+
name: 'updated_at',
|
|
563
|
+
colType: 'timestamp',
|
|
564
|
+
colSize: 0,
|
|
565
|
+
nullable: true,
|
|
566
|
+
term: 'updated_at',
|
|
567
|
+
rank: lastIdx,
|
|
568
|
+
gridRank: lastIdx,
|
|
569
|
+
gridWidth: 140,
|
|
570
|
+
cuFlag: '+'
|
|
571
|
+
})
|
|
529
572
|
}
|
|
530
|
-
|
|
531
|
-
if(!creatorIdExist) {
|
|
573
|
+
|
|
574
|
+
if (!creatorIdExist) {
|
|
532
575
|
lastIdx += 10
|
|
533
|
-
defaultList.push({
|
|
576
|
+
defaultList.push({
|
|
577
|
+
entity: { id: this.entityId },
|
|
578
|
+
name: 'creator_id',
|
|
579
|
+
colType: 'string',
|
|
580
|
+
colSize: 40,
|
|
581
|
+
nullable: true,
|
|
582
|
+
term: 'creator',
|
|
583
|
+
rank: lastIdx,
|
|
584
|
+
gridRank: 0,
|
|
585
|
+
gridWidth: 100,
|
|
586
|
+
cuFlag: '+'
|
|
587
|
+
})
|
|
534
588
|
}
|
|
535
|
-
|
|
536
|
-
if(!updaterIdExist) {
|
|
589
|
+
|
|
590
|
+
if (!updaterIdExist) {
|
|
537
591
|
lastIdx += 10
|
|
538
|
-
defaultList.push({
|
|
592
|
+
defaultList.push({
|
|
593
|
+
entity: { id: this.entityId },
|
|
594
|
+
name: 'updater_id',
|
|
595
|
+
colType: 'string',
|
|
596
|
+
colSize: 40,
|
|
597
|
+
nullable: true,
|
|
598
|
+
term: 'updater',
|
|
599
|
+
rank: lastIdx,
|
|
600
|
+
gridRank: 0,
|
|
601
|
+
gridWidth: 100,
|
|
602
|
+
cuFlag: '+'
|
|
603
|
+
})
|
|
539
604
|
}
|
|
540
|
-
|
|
605
|
+
|
|
541
606
|
let result = await MetaApi.updateMultiple('updateMultipleEntityColumn', defaultList)
|
|
542
607
|
if (result) {
|
|
543
608
|
this.detailGrist.fetch()
|
|
@@ -554,7 +619,7 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
554
619
|
***************************************
|
|
555
620
|
*/
|
|
556
621
|
async pageInitialized() {
|
|
557
|
-
// 조회 필드
|
|
622
|
+
// 조회 필드
|
|
558
623
|
this.searchFields = [
|
|
559
624
|
// name, type, label, operator, optionValues
|
|
560
625
|
MetaApi.getGristSearchColumnConfig('name', 'string', 'name', 'i_like'),
|
|
@@ -563,21 +628,24 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
563
628
|
await MetaApi.getGristSearchCodeColumnConfig('bundle', 'select', 'bundle', 'eq', 'BUNDLE')
|
|
564
629
|
]
|
|
565
630
|
|
|
566
|
-
// 엔티티 마스터 그리드 설정
|
|
631
|
+
// 엔티티 마스터 그리드 설정
|
|
567
632
|
this.masterConfig = {
|
|
568
633
|
rows: MetaApi.getGristSelectableConfig(false),
|
|
569
634
|
pagination: { pages: [1000] },
|
|
570
635
|
appendable: true,
|
|
571
636
|
columns: [
|
|
572
637
|
...MetaApi.getGristGuttersConfig(true, false),
|
|
573
|
-
{
|
|
638
|
+
{
|
|
639
|
+
type: 'gutter',
|
|
640
|
+
gutterName: 'button',
|
|
641
|
+
icon: 'edit',
|
|
574
642
|
handlers: {
|
|
575
643
|
click: (_columns, _data, _column, record, _rowIndex) => {
|
|
576
644
|
if (record.id) {
|
|
577
645
|
this.searchEntityColumns(record)
|
|
578
646
|
}
|
|
579
647
|
}
|
|
580
|
-
}
|
|
648
|
+
}
|
|
581
649
|
},
|
|
582
650
|
// type, name, align, editable, sortable, width
|
|
583
651
|
MetaApi.getGristColumnConfig('string', 'name', 'left', true, false, 175),
|
|
@@ -592,7 +660,7 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
592
660
|
]
|
|
593
661
|
}
|
|
594
662
|
|
|
595
|
-
// 엔티티 컬럼 그리드 설정
|
|
663
|
+
// 엔티티 컬럼 그리드 설정
|
|
596
664
|
this.detailConfig = {
|
|
597
665
|
rows: MetaApi.getGristSelectableConfig(true),
|
|
598
666
|
pagination: { pages: [1000] },
|
|
@@ -635,7 +703,7 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
635
703
|
MetaApi.getGristColumnConfig2('string', 'defVal', 'id_rule', 'left', true, false, 100)
|
|
636
704
|
]
|
|
637
705
|
}
|
|
638
|
-
|
|
706
|
+
|
|
639
707
|
this.importConfig = {
|
|
640
708
|
rows: MetaApi.getGristSelectableConfig(true),
|
|
641
709
|
pagination: { pages: [1000] },
|
|
@@ -688,24 +756,25 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
688
756
|
return html`
|
|
689
757
|
<div slot="headroom">
|
|
690
758
|
<div id="filters">
|
|
691
|
-
<ox-filters-form-base
|
|
692
|
-
.filters=${this.searchFields || []}
|
|
693
|
-
@filters-change=${e => {
|
|
759
|
+
<ox-filters-form-base
|
|
760
|
+
.filters=${this.searchFields || []}
|
|
761
|
+
@filters-change=${e => {
|
|
762
|
+
this.masterGrist?.fetch()
|
|
763
|
+
}}
|
|
694
764
|
></ox-filters-form-base>
|
|
695
765
|
</div>
|
|
696
766
|
</div>
|
|
697
767
|
|
|
698
|
-
<div class=
|
|
768
|
+
<div class="container" style="grid-template-columns: 37% 63%">
|
|
699
769
|
<div class="container_detail">
|
|
700
|
-
<h2>
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
.config=${this.masterConfig}
|
|
706
|
-
.mode=${MetaApi.isMobileEnv() ? 'LIST' : 'GRID'}
|
|
770
|
+
<h2><mwc-icon>list_alt</mwc-icon>${TermsUtil.tTitle('entity')}</h2>
|
|
771
|
+
<ox-grist
|
|
772
|
+
id="master-grist"
|
|
773
|
+
.config=${this.masterConfig}
|
|
774
|
+
.mode=${MetaApi.isMobileEnv() ? 'LIST' : 'GRID'}
|
|
707
775
|
auto-fetch
|
|
708
|
-
.fetchHandler=${this.fetchEntities.bind(this)}
|
|
776
|
+
.fetchHandler=${this.fetchEntities.bind(this)}
|
|
777
|
+
>
|
|
709
778
|
</ox-grist>
|
|
710
779
|
<div id="button-container" class="button-container">
|
|
711
780
|
<mwc-button raised label="${TermsUtil.tButton('create-service')}" @click=${e => this.createService()}></mwc-button>
|
|
@@ -716,15 +785,14 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
716
785
|
</div>
|
|
717
786
|
|
|
718
787
|
<div class="container_detail">
|
|
719
|
-
<h2>
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
.config=${this.detailConfig}
|
|
725
|
-
.mode=${MetaApi.isMobileEnv() ? 'LIST' : 'GRID'}
|
|
788
|
+
<h2><mwc-icon>list_alt</mwc-icon>${TermsUtil.tTitle('entity-column')}</h2>
|
|
789
|
+
<ox-grist
|
|
790
|
+
id="detail-grist"
|
|
791
|
+
.config=${this.detailConfig}
|
|
792
|
+
.mode=${MetaApi.isMobileEnv() ? 'LIST' : 'GRID'}
|
|
726
793
|
explcit-fetch
|
|
727
|
-
.fetchHandler=${this.fetchEntityColumns.bind(this)}
|
|
794
|
+
.fetchHandler=${this.fetchEntityColumns.bind(this)}
|
|
795
|
+
>
|
|
728
796
|
</ox-grist>
|
|
729
797
|
<div id="button-container" class="button-container">
|
|
730
798
|
<mwc-button raised label="${TermsUtil.tButton('export')}" @click=${e => this.exportEntityColumns()}></mwc-button>
|
|
@@ -740,4 +808,4 @@ class ConfigEntity extends localize(i18next)(PageView) {
|
|
|
740
808
|
}
|
|
741
809
|
}
|
|
742
810
|
|
|
743
|
-
customElements.define('config-entity', ConfigEntity)
|
|
811
|
+
customElements.define('config-entity', ConfigEntity)
|