@things-factory/meta-ui 7.0.1-alpha.61 → 7.0.1-alpha.63

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 (40) hide show
  1. package/client/bootstrap.ts +0 -1
  2. package/client/pages/personalize/{personal-column-selector.js → personal-column-selector.ts} +111 -114
  3. package/client/utils/meta-api.js +12 -4
  4. package/client/utils/meta-ui-util.js +172 -42
  5. package/client/utils/service-util.js +93 -21
  6. package/dist-client/bootstrap.d.ts +0 -1
  7. package/dist-client/bootstrap.js +0 -1
  8. package/dist-client/bootstrap.js.map +1 -1
  9. package/dist-client/pages/personalize/personal-column-selector.d.ts +18 -26
  10. package/dist-client/pages/personalize/personal-column-selector.js +127 -124
  11. package/dist-client/pages/personalize/personal-column-selector.js.map +1 -1
  12. package/dist-client/tsconfig.tsbuildinfo +1 -1
  13. package/dist-client/utils/meta-api.d.ts +3 -3
  14. package/dist-client/utils/meta-api.js +3 -3
  15. package/dist-client/utils/meta-api.js.map +1 -1
  16. package/dist-client/utils/meta-ui-util.js +120 -30
  17. package/dist-client/utils/meta-ui-util.js.map +1 -1
  18. package/dist-client/utils/service-util.d.ts +1 -1
  19. package/dist-client/utils/service-util.js +58 -15
  20. package/dist-client/utils/service-util.js.map +1 -1
  21. package/dist-server/service/button-role/button-role-query.js +1 -1
  22. package/dist-server/service/button-role/button-role-query.js.map +1 -1
  23. package/dist-server/service/grid-personalize/grid-personalize-mutation.js +25 -1
  24. package/dist-server/service/grid-personalize/grid-personalize-mutation.js.map +1 -1
  25. package/dist-server/service/grid-personalize/grid-personalize-query.js +13 -12
  26. package/dist-server/service/grid-personalize/grid-personalize-query.js.map +1 -1
  27. package/dist-server/service/grid-personalize/grid-personalize-type.js +4 -4
  28. package/dist-server/service/grid-personalize/grid-personalize-type.js.map +1 -1
  29. package/dist-server/service/grid-personalize/grid-personalize.js +3 -3
  30. package/dist-server/service/grid-personalize/grid-personalize.js.map +1 -1
  31. package/dist-server/service/menu-button-auth/menu-button-auth-query.js +3 -3
  32. package/dist-server/service/menu-button-auth/menu-button-auth-query.js.map +1 -1
  33. package/dist-server/tsconfig.tsbuildinfo +1 -1
  34. package/package.json +3 -2
  35. package/server/service/button-role/button-role-query.ts +9 -4
  36. package/server/service/grid-personalize/grid-personalize-mutation.ts +37 -8
  37. package/server/service/grid-personalize/grid-personalize-query.ts +11 -12
  38. package/server/service/grid-personalize/grid-personalize-type.ts +5 -7
  39. package/server/service/grid-personalize/grid-personalize.ts +10 -7
  40. package/server/service/menu-button-auth/menu-button-auth-query.ts +31 -29
@@ -1,12 +1,21 @@
1
1
  import '@material/web/icon/icon.js'
2
2
  import '@operato/data-grist/ox-record-creator.js'
3
+ import '@things-factory/personalization/dist-client/grid-preference-editor.js'
3
4
 
4
- import moment from '@operato/moment-timezone-es'
5
+ import gql from 'graphql-tag'
5
6
  import { css, html, render, nothing } from 'lit'
6
7
 
8
+ import { client } from '@operato/graphql'
7
9
  import { getEditor, getRenderer } from '@operato/data-grist'
8
10
  import { getValueGenerators } from '@operato/time-calculator'
9
- import { ScrollbarStyles, CommonGristStyles, CommonButtonStyles, ButtonContainerStyles, CommonHeaderStyles } from '@operato/styles'
11
+ import moment from '@operato/moment-timezone-es'
12
+ import {
13
+ ScrollbarStyles,
14
+ CommonGristStyles,
15
+ CommonButtonStyles,
16
+ ButtonContainerStyles,
17
+ CommonHeaderStyles
18
+ } from '@operato/styles'
10
19
 
11
20
  import { MetaCrypto } from './meta-crypto'
12
21
  import { TermsUtil } from './terms-util'
@@ -36,7 +45,9 @@ export class MetaUiUtil {
36
45
  }
37
46
 
38
47
  if (!menu.template) {
39
- throw new Error(TermsUtil.tText('value_is_not_exist', { value: `${TermsUtil.tMenu('menu')} ${TermsUtil.tLabel('model')}` }))
48
+ throw new Error(
49
+ TermsUtil.tText('value_is_not_exist', { value: `${TermsUtil.tMenu('menu')} ${TermsUtil.tLabel('model')}` })
50
+ )
40
51
  }
41
52
 
42
53
  this.menuId = menuId
@@ -63,6 +74,25 @@ export class MetaUiUtil {
63
74
  // return undefined;
64
75
  // }
65
76
 
77
+ // const response = await client.query({
78
+ // query: gql`
79
+ // query ($routing: String) {
80
+ // menus(routing: $routing) {
81
+ // id
82
+ // template
83
+ // }
84
+
85
+ // myGridPersonalize(menuId: $menuId) {
86
+ // id
87
+ // template
88
+ // }
89
+ // }
90
+ // `,
91
+ // variables: {
92
+ // routing: menuRouting
93
+ // }
94
+ // })
95
+
66
96
  let filters = [{ name: 'routing', operator: 'eq', value: menuRouting }]
67
97
  let data = await ServiceUtil.searchByPagination('menus', filters, null, 0, 0, 'id,template')
68
98
  return data
@@ -93,10 +123,12 @@ export class MetaUiUtil {
93
123
  if (!menu) {
94
124
  throw new Error(TermsUtil.tText('value_is_not_exist', { value: `${TermsUtil.tMenu('menu')} ${menuRouting}` }))
95
125
  } else if (!menu.template) {
96
- throw new Error(TermsUtil.tText('value_is_not_exist', { value: `${TermsUtil.tMenu('menu')} ${TermsUtil.tLabel('model')}` }))
126
+ throw new Error(
127
+ TermsUtil.tText('value_is_not_exist', { value: `${TermsUtil.tMenu('menu')} ${TermsUtil.tLabel('model')}` })
128
+ )
97
129
  }
98
130
 
99
- this.menuId = menu.id
131
+ pageView.menuId = menu.id
100
132
  return JSON.parse(MetaCrypto.dec(menu.template))
101
133
  }
102
134
 
@@ -470,7 +502,8 @@ export class MetaUiUtil {
470
502
  let defaultName = defaultSet[0]
471
503
 
472
504
  if (defaultValueGenerators.includes(defaultName)) {
473
- column.record.defaultValue = defaultSet.length == 1 ? { name: defaultName } : { name: defaultName, params: { calc: defaultSet[1] } }
505
+ column.record.defaultValue =
506
+ defaultSet.length == 1 ? { name: defaultName } : { name: defaultName, params: { calc: defaultSet[1] } }
474
507
  } else {
475
508
  column.record.defaultValue = type === 'number' ? Number(default_value) : default_value
476
509
  }
@@ -492,7 +525,9 @@ export class MetaUiUtil {
492
525
  } else {
493
526
  if (select_opt.type === 'code') {
494
527
  // 공통 코드
495
- column.record.options = await ServiceUtil.getCodeSelectorData(select_opt.values ? select_opt.values : select_opt.name)
528
+ column.record.options = await ServiceUtil.getCodeSelectorData(
529
+ select_opt.values ? select_opt.values : select_opt.name
530
+ )
496
531
  } else if (select_opt.type === 'scenario') {
497
532
  // 시나리오
498
533
  column.record.options = await ServiceUtil.getCodeByScenario(select_opt.name, select_opt.args)
@@ -583,7 +618,9 @@ export class MetaUiUtil {
583
618
  * @returns {Object}
584
619
  */
585
620
  static getGridListSet(pageView) {
586
- let gridList = { fields: [ValueUtil.getParams(pageView.menuInfo, 'name'), ValueUtil.getParams(pageView.menuInfo, 'desc')] }
621
+ let gridList = {
622
+ fields: [ValueUtil.getParams(pageView.menuInfo, 'name'), ValueUtil.getParams(pageView.menuInfo, 'desc')]
623
+ }
587
624
 
588
625
  // 기본 리스트 설정과 메타에서 가져온 설정 merge
589
626
  if (pageView.gridConfig.list) {
@@ -601,7 +638,9 @@ export class MetaUiUtil {
601
638
  */
602
639
  static getGridRowSet(pageView) {
603
640
  // 기본 옵션, 메타와 상관없이 그리드 로우 멀티 셀렉트는 false, click 이벤트는 없다.
604
- let { multiple_select = false, click = undefined } = ValueUtil.isEmpty(pageView.gridConfig.row) ? {} : pageView.gridConfig.row
641
+ let { multiple_select = false, click = undefined } = ValueUtil.isEmpty(pageView.gridConfig.row)
642
+ ? {}
643
+ : pageView.gridConfig.row
605
644
 
606
645
  let retObject = {
607
646
  selectable: { multiple: multiple_select },
@@ -677,7 +716,10 @@ export class MetaUiUtil {
677
716
  title: 'data_history_list',
678
717
  type: 'popup',
679
718
  tagname: logicTxt == 'history_copy' ? 'history-copy-list-popup' : 'history-json-list-popup',
680
- location: logicTxt == 'history_copy' ? 'pages/hgistory/history-copy-list-popup.js' : 'pages/hgistory/history-json-list-popup.js',
719
+ location:
720
+ logicTxt == 'history_copy'
721
+ ? 'pages/hgistory/history-copy-list-popup.js'
722
+ : 'pages/hgistory/history-json-list-popup.js',
681
723
  menu: pageView.currentRouting,
682
724
  size: 'large',
683
725
  popup_field: 'open_param',
@@ -729,7 +771,9 @@ export class MetaUiUtil {
729
771
 
730
772
  // CARD, LIST인 경우 컬럼 정보를 표시하기 위한 컬럼들 추출
731
773
  let mobileDisplayColumns =
732
- UiUtil.isMobileEnv() && pageView.etcConfig && pageView.etcConfig.mobile_display_columns ? pageView.etcConfig.mobile_display_columns.split(',') : []
774
+ UiUtil.isMobileEnv() && pageView.etcConfig && pageView.etcConfig.mobile_display_columns
775
+ ? pageView.etcConfig.mobile_display_columns.split(',')
776
+ : []
733
777
 
734
778
  let defaultValueGenerators = Object.keys(getValueGenerators())
735
779
  let columns = []
@@ -775,7 +819,8 @@ export class MetaUiUtil {
775
819
  let defaultName = defaultSet[0]
776
820
 
777
821
  if (defaultValueGenerators.includes(defaultName)) {
778
- column.record.defaultValue = defaultSet.length == 1 ? { name: defaultName } : { name: defaultName, params: { calc: defaultSet[1] } }
822
+ column.record.defaultValue =
823
+ defaultSet.length == 1 ? { name: defaultName } : { name: defaultName, params: { calc: defaultSet[1] } }
779
824
  } else {
780
825
  column.record.defaultValue = type === 'number' ? Number(default_value) : default_value
781
826
  }
@@ -834,7 +879,9 @@ export class MetaUiUtil {
834
879
  } else {
835
880
  // 공통 코드
836
881
  if (select_opt.type === 'code') {
837
- column.record.options = await ServiceUtil.getCodeSelectorData(select_opt.values ? select_opt.values : select_opt.name)
882
+ column.record.options = await ServiceUtil.getCodeSelectorData(
883
+ select_opt.values ? select_opt.values : select_opt.name
884
+ )
838
885
  // 시나리오
839
886
  } else if (select_opt.type === 'scenario') {
840
887
  column.record.options = await ServiceUtil.getCodeByScenario(select_opt.name, select_opt.args)
@@ -896,7 +943,7 @@ export class MetaUiUtil {
896
943
  }
897
944
 
898
945
  // 개인 그리드 컬럼 설정 가져오기
899
- let personal = await MetaApi.findMenuGridPersnalTemplate(this.menuId)
946
+ let personal = await MetaApi.getMyMenuGridPersnal(this.menuId)
900
947
  let { template = {} } = personal
901
948
  if (!template.master) {
902
949
  // 설정이 없으면 그대로 리턴
@@ -1003,10 +1050,22 @@ export class MetaUiUtil {
1003
1050
  let defValue = col.filter.value
1004
1051
  let dateKeywords = ['today', 'year', 'month', 'date', 'hour', 'min', 'sec']
1005
1052
 
1006
- if (defValue && typeof defValue == 'string' && dateKeywords.filter(x => defValue.startsWith(x)).length > 0) {
1053
+ if (
1054
+ defValue &&
1055
+ typeof defValue == 'string' &&
1056
+ dateKeywords.filter(x => defValue.startsWith(x)).length > 0
1057
+ ) {
1007
1058
  let defRes = []
1008
1059
  let dateFormat = { date: 'YYYY-MM-DD', datetime: 'YYYY-MM-DD HH:mm:ss' }
1009
- let durationType = { today: 'day', year: 'year', month: 'month', date: 'day', hour: 'hour', min: 'minute', sec: 'second' }
1060
+ let durationType = {
1061
+ today: 'day',
1062
+ year: 'year',
1063
+ month: 'month',
1064
+ date: 'day',
1065
+ hour: 'hour',
1066
+ min: 'minute',
1067
+ sec: 'second'
1068
+ }
1010
1069
  let defDates = defValue.split(',')
1011
1070
 
1012
1071
  defDates.forEach(x => {
@@ -1018,12 +1077,19 @@ export class MetaUiUtil {
1018
1077
  let wordSplits = x.split('-')
1019
1078
  let key = wordSplits[0]
1020
1079
  let value = wordSplits[1]
1021
- defRes.push(todayMoment.subtract(value, durationType[key]).startOf(durationType[key]).format(dateFormat[col.type]))
1080
+ defRes.push(
1081
+ todayMoment
1082
+ .subtract(value, durationType[key])
1083
+ .startOf(durationType[key])
1084
+ .format(dateFormat[col.type])
1085
+ )
1022
1086
  } else if (x.includes('+')) {
1023
1087
  let wordSplits = x.split('+')
1024
1088
  let key = wordSplits[0]
1025
1089
  let value = wordSplits[1]
1026
- defRes.push(todayMoment.add(value, durationType[key]).startOf(durationType[key]).format(dateFormat[col.type]))
1090
+ defRes.push(
1091
+ todayMoment.add(value, durationType[key]).startOf(durationType[key]).format(dateFormat[col.type])
1092
+ )
1027
1093
  }
1028
1094
  })
1029
1095
 
@@ -1085,7 +1151,14 @@ export class MetaUiUtil {
1085
1151
  : buttonConfig
1086
1152
  .filter(b => b.name != 'export' && b.name != 'import' && b.name != 'add')
1087
1153
  .map(btn => {
1088
- let { name = undefined, label = undefined, style = undefined, type = 'basic', action = undefined, logic = undefined } = btn
1154
+ let {
1155
+ name = undefined,
1156
+ label = undefined,
1157
+ style = undefined,
1158
+ type = 'basic',
1159
+ action = undefined,
1160
+ logic = undefined
1161
+ } = btn
1089
1162
 
1090
1163
  if (ValueUtil.isEmpty(name)) {
1091
1164
  return { title: '-1' }
@@ -1129,7 +1202,14 @@ export class MetaUiUtil {
1129
1202
  : buttonConfig
1130
1203
  .filter(b => b.name != 'add')
1131
1204
  .map(b => {
1132
- let { name = undefined, label = undefined, style = undefined, type = 'basic', action = undefined, logic = undefined } = b
1205
+ let {
1206
+ name = undefined,
1207
+ label = undefined,
1208
+ style = undefined,
1209
+ type = 'basic',
1210
+ action = undefined,
1211
+ logic = undefined
1212
+ } = b
1133
1213
 
1134
1214
  if (ValueUtil.isEmpty(label)) label = name
1135
1215
  if (ValueUtil.isEmpty(style)) style = name
@@ -1233,7 +1313,8 @@ export class MetaUiUtil {
1233
1313
  .map(x => {
1234
1314
  if (Object.keys(action.param_field).includes(x)) {
1235
1315
  let data = record[x]
1236
- passParams[action.param_field[x]] = Array.isArray(data) === false && typeof data === 'object' && data.id ? { id: data.id } : data
1316
+ passParams[action.param_field[x]] =
1317
+ Array.isArray(data) === false && typeof data === 'object' && data.id ? { id: data.id } : data
1237
1318
  }
1238
1319
  })
1239
1320
  }
@@ -1417,7 +1498,8 @@ export class MetaUiUtil {
1417
1498
  .map(x => {
1418
1499
  if (Object.keys(logic.param_field).includes(x)) {
1419
1500
  let data = record[x]
1420
- recordParams[logic.param_field[x]] = Array.isArray(data) === false && typeof data === 'object' && data.id ? { id: data.id } : data
1501
+ recordParams[logic.param_field[x]] =
1502
+ Array.isArray(data) === false && typeof data === 'object' && data.id ? { id: data.id } : data
1421
1503
  }
1422
1504
  })
1423
1505
  return recordParams
@@ -1557,7 +1639,9 @@ export class MetaUiUtil {
1557
1639
 
1558
1640
  // closeCallback
1559
1641
  let closeCallback =
1560
- action.after && typeof action.after === 'string' && action.after === 'fetch' && pageView && pageView.fetch ? pageView.fetch.bind(pageView) : undefined
1642
+ action.after && typeof action.after === 'string' && action.after === 'fetch' && pageView && pageView.fetch
1643
+ ? pageView.fetch.bind(pageView)
1644
+ : undefined
1561
1645
 
1562
1646
  // 팝업 오픈
1563
1647
  UiUtil.openDynamicPopup(title, action, record, closeCallback)
@@ -1651,7 +1735,8 @@ export class MetaUiUtil {
1651
1735
  .map(x => {
1652
1736
  if (Object.keys(after.param_field).includes(x)) {
1653
1737
  let data = record[x]
1654
- recordParams[after.param_field[x]] = Array.isArray(data) === false && typeof data === 'object' && data.id ? { id: data.id } : data
1738
+ recordParams[after.param_field[x]] =
1739
+ Array.isArray(data) === false && typeof data === 'object' && data.id ? { id: data.id } : data
1655
1740
  }
1656
1741
  })
1657
1742
  return recordParams
@@ -2670,8 +2755,8 @@ export class MetaUiUtil {
2670
2755
  fields += ['meta-object-selector', 'object', 'resource-object'].includes(c.type)
2671
2756
  ? `${c.name}\n{${MetaUiUtil.getObjctColumnSelectFields(c)}}`
2672
2757
  : c.type == 'board'
2673
- ? `${c.name}\n{${'\nid\nname\nthumbnail'}}`
2674
- : c.name
2758
+ ? `${c.name}\n{${'\nid\nname\nthumbnail'}}`
2759
+ : c.name
2675
2760
  })
2676
2761
 
2677
2762
  return fields
@@ -2686,7 +2771,11 @@ export class MetaUiUtil {
2686
2771
  static getObjctColumnSelectFields(gridCol) {
2687
2772
  let colStr = ''
2688
2773
 
2689
- if (ValueUtil.isNotEmpty(gridCol.record) && ValueUtil.isNotEmpty(gridCol.record.options) && ValueUtil.isNotEmpty(gridCol.record.options.select)) {
2774
+ if (
2775
+ ValueUtil.isNotEmpty(gridCol.record) &&
2776
+ ValueUtil.isNotEmpty(gridCol.record.options) &&
2777
+ ValueUtil.isNotEmpty(gridCol.record.options.select)
2778
+ ) {
2690
2779
  // 설정에 정의가 되어 있으면
2691
2780
  gridCol.record.options.select.forEach(x => {
2692
2781
  if (x.name && x.name !== '') {
@@ -2721,7 +2810,13 @@ export class MetaUiUtil {
2721
2810
  let gristElementId = pageView.gristId ? pageView.gristId : 'ox-grist'
2722
2811
  let gridMode = pageView.gridMode
2723
2812
  return html`
2724
- <ox-grist id=${gristElementId} .config=${gristConfigSet} .mode=${gridMode} auto-fetch .fetchHandler=${pageView.fetchHandler.bind(pageView)}>
2813
+ <ox-grist
2814
+ id=${gristElementId}
2815
+ .config=${gristConfigSet}
2816
+ .mode=${gridMode}
2817
+ auto-fetch
2818
+ .fetchHandler=${pageView.fetchHandler.bind(pageView)}
2819
+ >
2725
2820
  ${MetaUiUtil.getGridDetailHtml(pageView)}
2726
2821
  </ox-grist>
2727
2822
  `
@@ -2846,7 +2941,13 @@ export class MetaUiUtil {
2846
2941
  ><span>${mandatory ? '*' : ''}${column.header_txt}</span>
2847
2942
  ${editable ? html`<md-icon>edit</md-icon>` : ''}
2848
2943
  </label>
2849
- <ox-grid-field .rowIndex=${rowIndex} .column=${column} .record=${record} .value=${record[column.name]} ?dirty=${!!dirtyFields[column.name]}></ox-grid-field>
2944
+ <ox-grid-field
2945
+ .rowIndex=${rowIndex}
2946
+ .column=${column}
2947
+ .record=${record}
2948
+ .value=${record[column.name]}
2949
+ ?dirty=${!!dirtyFields[column.name]}
2950
+ ></ox-grid-field>
2850
2951
  `
2851
2952
  })}
2852
2953
  </div>
@@ -2874,7 +2975,11 @@ export class MetaUiUtil {
2874
2975
  let key = tab.name
2875
2976
 
2876
2977
  return html`
2877
- <div class="tab" ?activate="${key === pageView.currentTabKey}" @click="${() => (pageView.currentTabKey = key)}">
2978
+ <div
2979
+ class="tab"
2980
+ ?activate="${key === pageView.currentTabKey}"
2981
+ @click="${() => (pageView.currentTabKey = key)}"
2982
+ >
2878
2983
  ${tab.icon ? html`<md-icon>${tab.icon}</md-icon>` : html``}
2879
2984
  <span>${label}</span>
2880
2985
  </div>
@@ -2889,7 +2994,9 @@ export class MetaUiUtil {
2889
2994
  displayStyle = 'display:flex'
2890
2995
  }
2891
2996
 
2892
- return html` <div class="tab-contents" style="${displayStyle}">${MetaUiUtil.getBasicTabContent(pageView, tab)}</div> `
2997
+ return html`
2998
+ <div class="tab-contents" style="${displayStyle}">${MetaUiUtil.getBasicTabContent(pageView, tab)}</div>
2999
+ `
2893
3000
  })}
2894
3001
  </div>
2895
3002
  `
@@ -2926,7 +3033,9 @@ export class MetaUiUtil {
2926
3033
  </div>
2927
3034
  `}
2928
3035
  <div id="container" class="container" style="${layoutContainerStyle}">
2929
- <div class="container_detail">${MetaApi.getBasicGristHtml(pageView)} ${MetaUiUtil.getButtonContainer(pageView)}</div>
3036
+ <div class="container_detail">
3037
+ ${MetaApi.getBasicGristHtml(pageView)} ${MetaUiUtil.getButtonContainer(pageView)}
3038
+ </div>
2930
3039
  <div class="container_detail">
2931
3040
  ${pageView.is_activity === true
2932
3041
  ? html`${pageView.is_readonly === true
@@ -2948,8 +3057,17 @@ export class MetaUiUtil {
2948
3057
  >
2949
3058
  </meta-tab-element>`}`
2950
3059
  : html`${pageView.is_readonly === true
2951
- ? html`<meta-tab-element id="detail" route_name="${currentRouting}" is_readonly="true" is_detail="true"></meta-tab-element>`
2952
- : html`<meta-tab-element id="detail" route_name="${currentRouting}" is_detail="true"></meta-tab-element>`}`}
3060
+ ? html`<meta-tab-element
3061
+ id="detail"
3062
+ route_name="${currentRouting}"
3063
+ is_readonly="true"
3064
+ is_detail="true"
3065
+ ></meta-tab-element>`
3066
+ : html`<meta-tab-element
3067
+ id="detail"
3068
+ route_name="${currentRouting}"
3069
+ is_detail="true"
3070
+ ></meta-tab-element>`}`}
2953
3071
  </div>
2954
3072
  </div>
2955
3073
  `
@@ -3075,8 +3193,8 @@ export class MetaUiUtil {
3075
3193
  ${detailInfo.tagname == '' || detailInfo.tagname == 'meta-tab-element'
3076
3194
  ? html``
3077
3195
  : detailInfo.display
3078
- ? html`<h2 id="detail_title"><md-icon>list_alt</md-icon>${TermsUtil.tTitle(`${detailInfo.display}`)}</h2>`
3079
- : html``}
3196
+ ? html`<h2 id="detail_title"><md-icon>list_alt</md-icon>${TermsUtil.tTitle(`${detailInfo.display}`)}</h2>`
3197
+ : html``}
3080
3198
  ${pageView.detailElement}
3081
3199
  </div>
3082
3200
  </div>
@@ -3237,9 +3355,15 @@ export class MetaUiUtil {
3237
3355
  <md-icon
3238
3356
  slot="setting"
3239
3357
  @click=${e => {
3240
- let element = MetaApi.createCustomElement('personal-column-selector', 'personal-column-selector')
3241
- element.configGrist = e.currentTarget.closest('ox-grist')
3242
- element.menuId = pageView.menuId
3358
+ const href = document.location.href
3359
+ const baseTag = document.querySelector('base')
3360
+ const baseUrl = baseTag ? baseTag.href : href
3361
+ const relativePath = href.replace(baseUrl, '')
3362
+ const route = relativePath.split('/').filter(x => !!x)[0]
3363
+
3364
+ let element = MetaApi.createCustomElement('grid-preference-editor', 'grid-preference-editor')
3365
+ element.target = e.currentTarget.closest('ox-grist')
3366
+ element.route = route
3243
3367
 
3244
3368
  MetaApi.openPopupByElement(TermsUtil.tTitle('grid-column-personalize'), 'midium', element, false)
3245
3369
  }}
@@ -3264,13 +3388,19 @@ export class MetaUiUtil {
3264
3388
  return html`
3265
3389
  <div id="modes">
3266
3390
  ${pageView.gridViewOptions.includes('GRID')
3267
- ? html`<md-icon @click="${() => (pageView.gridMode = 'GRID')}" ?active="${pageView.gridMode == 'GRID'}">grid_on</md-icon>`
3391
+ ? html`<md-icon @click="${() => (pageView.gridMode = 'GRID')}" ?active="${pageView.gridMode == 'GRID'}"
3392
+ >grid_on</md-icon
3393
+ >`
3268
3394
  : ``}
3269
3395
  ${pageView.gridViewOptions.includes('LIST')
3270
- ? html`<md-icon @click="${() => (pageView.gridMode = 'LIST')}" ?active="${pageView.gridMode == 'LIST'}">format_list_bulleted</md-icon>`
3396
+ ? html`<md-icon @click="${() => (pageView.gridMode = 'LIST')}" ?active="${pageView.gridMode == 'LIST'}"
3397
+ >format_list_bulleted</md-icon
3398
+ >`
3271
3399
  : ``}
3272
3400
  ${pageView.gridViewOptions.includes('CARD')
3273
- ? html`<md-icon @click="${() => (pageView.gridMode = 'CARD')}" ?active="${pageView.gridMode == 'CARD'}">apps</md-icon>`
3401
+ ? html`<md-icon @click="${() => (pageView.gridMode = 'CARD')}" ?active="${pageView.gridMode == 'CARD'}"
3402
+ >apps</md-icon
3403
+ >`
3274
3404
  : ``}
3275
3405
  </div>
3276
3406
  `
@@ -72,7 +72,13 @@ export class ServiceUtil {
72
72
  */
73
73
  static async getCodeByScenario(scenarioName, variables) {
74
74
  let response = await ServiceUtil.callScenario(null, scenarioName, variables, false)
75
- if (response && response.data && response.data.runScenario && response.data.runScenario.result && response.data.runScenario.result.result) {
75
+ if (
76
+ response &&
77
+ response.data &&
78
+ response.data.runScenario &&
79
+ response.data.runScenario.result &&
80
+ response.data.runScenario.result.result
81
+ ) {
76
82
  let codes = response.data.runScenario.result.result
77
83
  codes.unshift({ value: '', display: '' })
78
84
  return codes.map(x => {
@@ -187,15 +193,25 @@ export class ServiceUtil {
187
193
  **********************************************************
188
194
  * @returns {Object} 그리드 개인화 오브젝트
189
195
  */
190
- static async searchMenuGridPersnalTemplate(menuId) {
191
- let filters = [{ name: 'menu.id', operator: 'eq', value: menuId }]
192
- let selectFields = 'id,template'
193
- let result = await ServiceUtil.searchByPagination('gridPersonalizeTemplates', filters, [], 0, 0, selectFields)
196
+ static async getMyMenuGridPersnal(menuId) {
197
+ try {
198
+ const response = await client.query({
199
+ query: gql`
200
+ query myGridPersonalize($menuId: String!) {
201
+ myGridPersonalize(menuId: $menuId) {
202
+ id
203
+ template
204
+ }
205
+ }
206
+ `,
207
+ variables: {
208
+ menuId
209
+ }
210
+ })
194
211
 
195
- if (result.total == 0) {
196
- return {}
197
- } else {
198
- return { id: result.records[0].id, template: JSON.parse(result.records[0].template) }
212
+ return response.data.myGridPersonalize
213
+ } catch (e) {
214
+ ServiceUtil.showGraphqlException(e)
199
215
  }
200
216
  }
201
217
 
@@ -235,7 +251,14 @@ export class ServiceUtil {
235
251
  let mainMenus = menuData
236
252
  .map(item => {
237
253
  if (item.menuType == 'GROUP' || item.menuType == 'MENU') {
238
- let pMenu = { id: item.id, parent: true, name: TermsUtil.tMenu(item.name), icon: item.iconPath, type: item.menuType == 'GROUP' ? 'group' : '', menus: [] }
254
+ let pMenu = {
255
+ id: item.id,
256
+ parent: true,
257
+ name: TermsUtil.tMenu(item.name),
258
+ icon: item.iconPath,
259
+ type: item.menuType == 'GROUP' ? 'group' : '',
260
+ menus: []
261
+ }
239
262
 
240
263
  if (item.routing) {
241
264
  pMenu.path = item.routing
@@ -433,7 +456,10 @@ export class ServiceUtil {
433
456
  static async exportableData(isElement, exportTitle, grist) {
434
457
  // 1. 헤더 설정
435
458
  var headerSetting = grist._config.columns
436
- .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined && column.hidden !== true)
459
+ .filter(
460
+ column =>
461
+ column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined && column.hidden !== true
462
+ )
437
463
  .map(column => {
438
464
  return column.imex
439
465
  })
@@ -443,9 +469,17 @@ export class ServiceUtil {
443
469
  var data = records.map(item => {
444
470
  return {
445
471
  ...grist._config.columns
446
- .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined && column.hidden !== true)
472
+ .filter(
473
+ column =>
474
+ column.type !== 'gutter' &&
475
+ column.record !== undefined &&
476
+ column.imex !== undefined &&
477
+ column.hidden !== true
478
+ )
447
479
  .reduce((record, column) => {
448
- record[column.imex.key] = column.imex.key.split('.').reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
480
+ record[column.imex.key] = column.imex.key
481
+ .split('.')
482
+ .reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
449
483
  return record
450
484
  }, {})
451
485
  }
@@ -804,16 +838,38 @@ export class ServiceUtil {
804
838
  for (let key in mandatoryColumns) {
805
839
  if (record[key] === undefined || record[key] == '') {
806
840
  console.log(record)
807
- UiUtil.showAlertPopup('text.check-mandatory', TermsUtil.tText('check-mandatory-field', { x: mandatoryColumns[key] }), 'info', 'confirm')
841
+ UiUtil.showAlertPopup(
842
+ 'text.check-mandatory',
843
+ TermsUtil.tText('check-mandatory-field', { x: mandatoryColumns[key] }),
844
+ 'info',
845
+ 'confirm'
846
+ )
808
847
  return
809
848
  }
810
849
  }
811
850
 
812
851
  // 레코드 정보에서 저장 가능 유형으로 변환
813
852
  for (let key in record) {
814
- if (!['creator', 'updater', 'createdAt', 'updatedAt', '__dirty__', '__dirtyfields__', '__origin__', '__seq__', '__selected__'].includes(key)) {
853
+ if (
854
+ ![
855
+ 'creator',
856
+ 'updater',
857
+ 'createdAt',
858
+ 'updatedAt',
859
+ '__dirty__',
860
+ '__dirtyfields__',
861
+ '__origin__',
862
+ '__seq__',
863
+ '__selected__'
864
+ ].includes(key)
865
+ ) {
815
866
  // code-input 타입은 오브젝트 값을 가지지만 id 만 가져가지 않는다. 예외 처리
816
- if (codeInputColumns.includes(key) == false && record[key] && typeof record[key] === 'object' && isObjectOrigin == false) {
867
+ if (
868
+ codeInputColumns.includes(key) == false &&
869
+ record[key] &&
870
+ typeof record[key] === 'object' &&
871
+ isObjectOrigin == false
872
+ ) {
817
873
  patchData[key] = { id: record[key].id }
818
874
  } else {
819
875
  patchData[key] = record[key]
@@ -1015,11 +1071,15 @@ export class ServiceUtil {
1015
1071
  ? ValueUtil.isNotEmpty(filterParam)
1016
1072
  ? filterParam[action.id_field]
1017
1073
  : Array.isArray(dataParams)
1018
- ? dataParams[0][action.id_field]
1019
- : dataParams[action.id_field]
1074
+ ? dataParams[0][action.id_field]
1075
+ : dataParams[action.id_field]
1020
1076
  : null
1021
1077
  // 6. Mutation 호출
1022
- let response = await ServiceUtil.callMutation(action, idValue, ValueUtil.isEmpty(mutationParams) ? dataParams : mutationParams)
1078
+ let response = await ServiceUtil.callMutation(
1079
+ action,
1080
+ idValue,
1081
+ ValueUtil.isEmpty(mutationParams) ? dataParams : mutationParams
1082
+ )
1023
1083
 
1024
1084
  if (!response.errors) {
1025
1085
  UiUtil.showToast('info', TermsUtil.tText('success to process'))
@@ -1210,7 +1270,13 @@ export class ServiceUtil {
1210
1270
  let confirm = true
1211
1271
 
1212
1272
  if (buttonName && useMessage === true) {
1213
- const anwer = await UiUtil.showAlertPopup('button.' + buttonName, 'text.are_you_sure', 'question', 'confirm', 'cancel')
1273
+ const anwer = await UiUtil.showAlertPopup(
1274
+ 'button.' + buttonName,
1275
+ 'text.are_you_sure',
1276
+ 'question',
1277
+ 'confirm',
1278
+ 'cancel'
1279
+ )
1214
1280
  confirm = anwer.value
1215
1281
  }
1216
1282
 
@@ -1253,7 +1319,13 @@ export class ServiceUtil {
1253
1319
  * @returns {Boolean} 에러가 없으면 true 그렇지 않으면 false
1254
1320
  */
1255
1321
  static checkClientError(response) {
1256
- if (response && response.data && response.data.runScenario && response.data.runScenario.result && response.data.runScenario.result.error) {
1322
+ if (
1323
+ response &&
1324
+ response.data &&
1325
+ response.data.runScenario &&
1326
+ response.data.runScenario.result &&
1327
+ response.data.runScenario.result.error
1328
+ ) {
1257
1329
  let scenarioError = response.data.runScenario.result.error
1258
1330
  UiUtil.showAlertPopup(scenarioError.title, scenarioError.message, 'error', 'confirm')
1259
1331
  return false
@@ -1,6 +1,5 @@
1
1
  import '@material/web/icon/icon.js';
2
2
  import './load-components';
3
- import './pages/personalize/personal-column-selector';
4
3
  import './pages/history/history-copy-list-popup';
5
4
  import './pages/history/history-json-list-popup';
6
5
  import './pages/activity/meta-activity-writer-element';
@@ -24,7 +24,6 @@ import { FilterGristMetaObjectSelect } from './component/filter/filter-grist-met
24
24
  /** Filter Form Component */
25
25
  import { FilterFormMetaCodeSelect } from './component/filter/filter-form-meta-code-select';
26
26
  import { FilterFormMetaObjectSelect } from './component/filter/filter-form-meta-object-select';
27
- import './pages/personalize/personal-column-selector';
28
27
  import './pages/history/history-copy-list-popup';
29
28
  import './pages/history/history-json-list-popup';
30
29
  import './pages/activity/meta-activity-writer-element';