@things-factory/meta-ui 7.0.1-alpha.51 → 7.0.1-alpha.52
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/bootstrap.ts +2 -6
- package/client/index.ts +0 -20
- package/client/load-components.ts +17 -0
- package/client/pages/entity/main-menu-selector.js +0 -4
- package/client/pages/personalize/personal-column-selector.js +0 -4
- package/dist-client/actions/main.d.ts +0 -1
- package/dist-client/actions/main.js +0 -1
- package/dist-client/actions/main.js.map +1 -1
- package/dist-client/bootstrap.d.ts +1 -0
- package/dist-client/bootstrap.js +2 -5
- package/dist-client/bootstrap.js.map +1 -1
- package/dist-client/index.d.ts +0 -16
- package/dist-client/index.js +0 -17
- package/dist-client/index.js.map +1 -1
- package/dist-client/load-components.d.ts +15 -0
- package/dist-client/load-components.js +17 -0
- package/dist-client/load-components.js.map +1 -0
- package/dist-client/pages/entity/main-menu-selector.js +0 -4
- package/dist-client/pages/entity/main-menu-selector.js.map +1 -1
- package/dist-client/pages/personalize/personal-column-selector.js +0 -4
- package/dist-client/pages/personalize/personal-column-selector.js.map +1 -1
- package/dist-client/reducers/main.js +0 -3
- package/dist-client/reducers/main.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/dynamic-menu/dynamic-menu-query.js +50 -16
- package/dist-server/service/dynamic-menu/dynamic-menu-query.js.map +1 -1
- package/dist-server/service/dynamic-menu/dynamic-menu-type.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/server/service/dynamic-menu/dynamic-menu-query.ts +145 -115
- package/server/service/dynamic-menu/dynamic-menu-type.ts +11 -16
- package/client/actions/main.js +0 -127
- package/client/pages/menu/dynamic-menu-setting-let.ts +0 -82
- package/client/reducers/main.js +0 -79
- package/client/viewparts/dynamic-menu-part.ts +0 -119
- package/server/controllers/index.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/meta-ui",
|
|
3
|
-
"version": "7.0.1-alpha.
|
|
3
|
+
"version": "7.0.1-alpha.52",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"@things-factory/auth-base": "^7.0.1-alpha.47",
|
|
42
42
|
"@things-factory/env": "^7.0.1-alpha.43",
|
|
43
43
|
"@things-factory/id-rule-base": "^7.0.1-alpha.47",
|
|
44
|
-
"@things-factory/menu-base": "^7.0.1-alpha.
|
|
45
|
-
"@things-factory/resource-base": "^7.0.1-alpha.
|
|
44
|
+
"@things-factory/menu-base": "^7.0.1-alpha.52",
|
|
45
|
+
"@things-factory/resource-base": "^7.0.1-alpha.52",
|
|
46
46
|
"@things-factory/shell": "^7.0.1-alpha.47",
|
|
47
|
-
"@things-factory/worklist": "^7.0.1-alpha.
|
|
47
|
+
"@things-factory/worklist": "^7.0.1-alpha.52"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "5a1b7d0f19f4d523e0d1d9eb5d600d54006b6ab5"
|
|
50
50
|
}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
|
|
2
1
|
import { Resolver, FieldResolver, Root, Query, Args, Ctx, Arg } from 'type-graphql'
|
|
3
2
|
import { ListParam, getRepository, getQueryBuilderFromListParams } from '@things-factory/shell'
|
|
4
3
|
import { Menu } from '@things-factory/menu-base'
|
|
5
4
|
import { DynamicMenuList, ExportMenuInfo } from './dynamic-menu-type'
|
|
6
5
|
|
|
7
|
-
import { Entity, EntityColumn} from '@things-factory/resource-base'
|
|
8
|
-
import { Terminology } from '@things-factory/i18n-base'
|
|
6
|
+
import { Entity, EntityColumn } from '@things-factory/resource-base'
|
|
9
7
|
|
|
10
8
|
import crypto from 'crypto'
|
|
11
9
|
const { camelCase, startCase, snakeCase, kebabCase, upperFirst } = require('lodash')
|
|
12
10
|
|
|
13
|
-
|
|
14
11
|
@Resolver(Menu)
|
|
15
12
|
export class DynamicMenuQuery {
|
|
16
|
-
|
|
17
13
|
@Query(returns => ExportMenuInfo, { description: 'To fetch a export menu data' })
|
|
18
14
|
async exportMenuInfo(@Arg('id') id: string, @Ctx() context: any): Promise<ExportMenuInfo> {
|
|
19
15
|
const { domain } = context.state
|
|
20
16
|
|
|
21
|
-
// 메뉴
|
|
22
|
-
const menu:Menu = await getRepository(Menu).findOneBy({id:id, domain:{id:domain.id}})
|
|
23
|
-
const parentMenu:Menu = await getRepository(Menu).findOneBy({id:menu.parentId, domain:{id:domain.id}})
|
|
17
|
+
// 메뉴
|
|
18
|
+
const menu: Menu = await getRepository(Menu).findOneBy({ id: id, domain: { id: domain.id } })
|
|
19
|
+
const parentMenu: Menu = await getRepository(Menu).findOneBy({ id: menu.parentId, domain: { id: domain.id } })
|
|
24
20
|
|
|
25
|
-
// entity
|
|
26
|
-
let entityName = upperFirst(camelCase(menu.routing))
|
|
27
|
-
const entity:Entity = await getRepository(Entity).findOneBy({domain:{id: domain.id}, name: entityName})
|
|
21
|
+
// entity
|
|
22
|
+
let entityName = upperFirst(camelCase(menu.routing))
|
|
23
|
+
const entity: Entity = await getRepository(Entity).findOneBy({ domain: { id: domain.id }, name: entityName })
|
|
28
24
|
|
|
29
|
-
// entity Columns
|
|
30
|
-
const entityColumns:EntityColumn[] = await getRepository(EntityColumn).findBy({domain:{id: domain.id}, entity:{id:entity.id}})
|
|
25
|
+
// entity Columns
|
|
26
|
+
const entityColumns: EntityColumn[] = await getRepository(EntityColumn).findBy({ domain: { id: domain.id }, entity: { id: entity.id } })
|
|
31
27
|
|
|
32
|
-
let entityMeta = getRepository(entityName).metadata
|
|
28
|
+
let entityMeta = getRepository(entityName).metadata
|
|
33
29
|
|
|
34
|
-
const indices = entityMeta.indices.map(x=>{
|
|
30
|
+
const indices = entityMeta.indices.map(x => {
|
|
35
31
|
return {
|
|
36
|
-
name:x.name,
|
|
37
|
-
isUnique:x.isUnique,
|
|
38
|
-
columns: x.columns.map(y=> {
|
|
32
|
+
name: x.name,
|
|
33
|
+
isUnique: x.isUnique,
|
|
34
|
+
columns: x.columns.map(y => {
|
|
35
|
+
return y.databaseName.toUpperCase()
|
|
36
|
+
})
|
|
39
37
|
}
|
|
40
38
|
})
|
|
41
39
|
|
|
42
|
-
const columns = entityMeta.columns
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
const columns = entityMeta.columns
|
|
41
|
+
.map(x => {
|
|
42
|
+
return {
|
|
43
|
+
name: x.databaseName,
|
|
44
|
+
isNullable: x.isNullable,
|
|
45
|
+
length: x.type == 'numeric' ? [x.precision, x.scale].join(',') : x.length,
|
|
46
|
+
type: x.type.toString(),
|
|
47
|
+
default: typeof x.default === 'function' ? undefined : x.default
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
.filter(x => ['data_revision_no', 'deleted_at'].includes(x.name) == false)
|
|
51
51
|
|
|
52
52
|
return {
|
|
53
53
|
id,
|
|
@@ -57,35 +57,35 @@ export class DynamicMenuQuery {
|
|
|
57
57
|
indices,
|
|
58
58
|
columns,
|
|
59
59
|
parentMenu
|
|
60
|
-
}
|
|
60
|
+
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
@Query(returns => DynamicMenuList, { description: 'To fetch multiple dynamicMenus' })
|
|
64
64
|
async dynamicMenus(@Args() params: ListParam, @Ctx() context: any): Promise<DynamicMenuList> {
|
|
65
65
|
const { domain } = context.state
|
|
66
66
|
|
|
67
|
-
let templateCodeIdx = params.filters?.findIndex(x=> x.name == 'templateCode')
|
|
68
|
-
let templateCode = undefined
|
|
67
|
+
let templateCodeIdx = params.filters?.findIndex(x => x.name == 'templateCode')
|
|
68
|
+
let templateCode = undefined
|
|
69
69
|
|
|
70
|
-
if(templateCodeIdx > -1){
|
|
71
|
-
templateCode = params.filters[templateCodeIdx].value
|
|
72
|
-
params.filters = params.filters.filter(x=> x.name != 'templateCode')
|
|
70
|
+
if (templateCodeIdx > -1) {
|
|
71
|
+
templateCode = params.filters[templateCodeIdx].value
|
|
72
|
+
params.filters = params.filters.filter(x => x.name != 'templateCode')
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
let templateTextIdx = params.filters?.findIndex(x=> x.name == 'templateText')
|
|
76
|
-
let templateText = undefined
|
|
75
|
+
let templateTextIdx = params.filters?.findIndex(x => x.name == 'templateText')
|
|
76
|
+
let templateText = undefined
|
|
77
77
|
|
|
78
|
-
if(templateTextIdx > -1){
|
|
79
|
-
templateText = params.filters[templateTextIdx].value
|
|
80
|
-
params.filters = params.filters.filter(x=> x.name != 'templateText')
|
|
78
|
+
if (templateTextIdx > -1) {
|
|
79
|
+
templateText = params.filters[templateTextIdx].value
|
|
80
|
+
params.filters = params.filters.filter(x => x.name != 'templateText')
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
if(templateText){
|
|
84
|
-
params.pagination.limit = 0
|
|
85
|
-
params.pagination.page = 0
|
|
83
|
+
if (templateText) {
|
|
84
|
+
params.pagination.limit = 0
|
|
85
|
+
params.pagination.page = 0
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
let groupSearch = params.filters?.findIndex(x=> x.name == 'parentId' && x.operator == 'is_null') > -1 ? true : false
|
|
88
|
+
let groupSearch = params.filters?.findIndex(x => x.name == 'parentId' && x.operator == 'is_null') > -1 ? true : false
|
|
89
89
|
|
|
90
90
|
const queryBuilder = getQueryBuilderFromListParams({
|
|
91
91
|
domain,
|
|
@@ -94,115 +94,145 @@ export class DynamicMenuQuery {
|
|
|
94
94
|
searchables: ['name', 'description', 'routing']
|
|
95
95
|
})
|
|
96
96
|
|
|
97
|
-
let [items, total] = await queryBuilder.getManyAndCount()
|
|
98
|
-
let result: DynamicMenuList = {items: items, total: total}
|
|
97
|
+
let [items, total] = await queryBuilder.getManyAndCount()
|
|
98
|
+
let result: DynamicMenuList = { items: items, total: total }
|
|
99
99
|
|
|
100
|
-
let self = this
|
|
100
|
+
let self = this
|
|
101
101
|
|
|
102
|
-
if(templateText){
|
|
103
|
-
if(groupSearch === true){
|
|
104
|
-
for(let idx = 0
|
|
105
|
-
result.items[idx].children = await getRepository(Menu).findBy({parent: { id: result.items[idx].id }})
|
|
102
|
+
if (templateText) {
|
|
103
|
+
if (groupSearch === true) {
|
|
104
|
+
for (let idx = 0; idx < result.items.length; idx++) {
|
|
105
|
+
result.items[idx].children = await getRepository(Menu).findBy({ parent: { id: result.items[idx].id } })
|
|
106
106
|
}
|
|
107
|
-
}
|
|
107
|
+
}
|
|
108
108
|
|
|
109
|
-
items = items.filter(function(item:Menu){
|
|
110
|
-
return self.checkTemplateByContainsText(templateCode, templateText, groupSearch === true ? item.children : item.template)
|
|
109
|
+
items = items.filter(function (item: Menu) {
|
|
110
|
+
return self.checkTemplateByContainsText(templateCode, templateText, groupSearch === true ? item.children : item.template)
|
|
111
111
|
})
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
return {
|
|
115
115
|
items,
|
|
116
116
|
total
|
|
117
|
-
}
|
|
117
|
+
}
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
checkTemplate(code: string, text:string, template: string){
|
|
121
|
-
if(!template) return false
|
|
122
|
-
|
|
123
|
-
let templateString: any = ''
|
|
124
|
-
let templateJsonStr = this.dec(template)
|
|
125
|
-
let templateJson = JSON.parse(templateJsonStr)
|
|
126
|
-
|
|
127
|
-
if(code === 'col-name'){
|
|
128
|
-
templateString = templateJson['grid_column'].map(x=>{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
120
|
+
checkTemplate(code: string, text: string, template: string) {
|
|
121
|
+
if (!template) return false
|
|
122
|
+
|
|
123
|
+
let templateString: any = ''
|
|
124
|
+
let templateJsonStr = this.dec(template)
|
|
125
|
+
let templateJson = JSON.parse(templateJsonStr)
|
|
126
|
+
|
|
127
|
+
if (code === 'col-name') {
|
|
128
|
+
templateString = templateJson['grid_column'].map(x => {
|
|
129
|
+
return x.name
|
|
130
|
+
})
|
|
131
|
+
} else if (code === 'object-custom') {
|
|
132
|
+
templateString = JSON.stringify(
|
|
133
|
+
templateJson['grid_column']
|
|
134
|
+
.filter(x => ['meta-object-selector', 'object', 'resource-object'].includes(x.type) && x.object_opt && !x.object_opt.menu)
|
|
135
|
+
.map(x => {
|
|
136
|
+
return x.object_opt
|
|
137
|
+
})
|
|
138
|
+
)
|
|
139
|
+
} else if (code === 'object-menu') {
|
|
140
|
+
templateString = JSON.stringify(
|
|
141
|
+
templateJson['grid_column']
|
|
142
|
+
.filter(x => ['meta-object-selector', 'object', 'resource-object'].includes(x.type) && x.object_opt && x.object_opt.menu)
|
|
143
|
+
.map(x => {
|
|
144
|
+
return x.object_opt.menu
|
|
145
|
+
})
|
|
146
|
+
)
|
|
147
|
+
} else if (code === 'code-custom') {
|
|
148
|
+
templateString = JSON.stringify(
|
|
149
|
+
templateJson['grid_column']
|
|
150
|
+
.filter(x => ['meta-code-selector', 'resource-code-selector'].includes(x.type) && x.object_opt && !x.object_opt.menu)
|
|
151
|
+
.map(x => {
|
|
152
|
+
return x.object_opt
|
|
153
|
+
})
|
|
154
|
+
)
|
|
155
|
+
} else if (code === 'code-menu') {
|
|
156
|
+
templateString = JSON.stringify(
|
|
157
|
+
templateJson['grid_column']
|
|
158
|
+
.filter(x => ['meta-code-selector', 'resource-code-selector'].includes(x.type) && x.object_opt && x.object_opt.menu)
|
|
159
|
+
.map(x => {
|
|
160
|
+
return x.object_opt.menu
|
|
161
|
+
})
|
|
162
|
+
)
|
|
163
|
+
} else if (code === 'selector-entity') {
|
|
164
|
+
templateString = JSON.stringify(
|
|
165
|
+
templateJson['grid_column']
|
|
166
|
+
.filter(x => x.type == 'select' && x.select_opt && x.select_opt.type == 'entity')
|
|
167
|
+
.map(x => {
|
|
168
|
+
return x.select_opt
|
|
169
|
+
})
|
|
170
|
+
)
|
|
171
|
+
} else if (code === 'selector-code') {
|
|
172
|
+
templateString = JSON.stringify(
|
|
173
|
+
templateJson['grid_column']
|
|
174
|
+
.filter(x => x.type == 'select' && x.select_opt && x.select_opt.type == 'code')
|
|
175
|
+
.map(x => {
|
|
176
|
+
return x.select_opt.name
|
|
177
|
+
})
|
|
178
|
+
)
|
|
179
|
+
} else if (code === 'selector-scenario') {
|
|
180
|
+
templateString = JSON.stringify(
|
|
181
|
+
templateJson['grid_column']
|
|
182
|
+
.filter(x => x.type == 'select' && x.select_opt && x.select_opt.type == 'scenario')
|
|
183
|
+
.map(x => {
|
|
184
|
+
return x.select_opt.name
|
|
185
|
+
})
|
|
186
|
+
)
|
|
157
187
|
} else {
|
|
158
|
-
templateString = templateJsonStr
|
|
188
|
+
templateString = templateJsonStr
|
|
159
189
|
}
|
|
160
190
|
|
|
161
|
-
return templateString.includes(text)
|
|
191
|
+
return templateString.includes(text)
|
|
162
192
|
}
|
|
163
193
|
|
|
164
|
-
checkTemplateByContainsText(code: string, text:string, template: any){
|
|
165
|
-
if(Array.isArray(template)){
|
|
166
|
-
for(let idx = 0; idx < template.length
|
|
167
|
-
let contains = this.checkTemplate(code,text, template[idx].template)
|
|
194
|
+
checkTemplateByContainsText(code: string, text: string, template: any) {
|
|
195
|
+
if (Array.isArray(template)) {
|
|
196
|
+
for (let idx = 0; idx < template.length; idx++) {
|
|
197
|
+
let contains = this.checkTemplate(code, text, template[idx].template)
|
|
168
198
|
|
|
169
|
-
if(contains == true){
|
|
170
|
-
return true
|
|
199
|
+
if (contains == true) {
|
|
200
|
+
return true
|
|
171
201
|
}
|
|
172
202
|
}
|
|
173
203
|
|
|
174
|
-
return false
|
|
204
|
+
return false
|
|
175
205
|
} else {
|
|
176
|
-
return this.checkTemplate(code,text,template)
|
|
206
|
+
return this.checkTemplate(code, text, template)
|
|
177
207
|
}
|
|
178
208
|
}
|
|
179
209
|
|
|
180
210
|
dec(template: string): string {
|
|
181
|
-
let decResults = []
|
|
182
|
-
let encTemps = template.split('h1z0q9i9x7q6')
|
|
183
|
-
let filters = ['aes-256-ecb', 'aes-256-cbc', 'aes-256-cfb', 'aes-256-cfb8', 'aes-256-cfb1', 'aes-256-ofb', 'aes-256-ctr', 'aes256']
|
|
184
|
-
let salt = encTemps[0]
|
|
185
|
-
let hexKey = Buffer.from(salt, 'hex')
|
|
186
|
-
let ivBase = salt.substring(0, 16)
|
|
187
|
-
let iv = ['', ivBase, ivBase, ivBase, ivBase, ivBase, ivBase, ivBase]
|
|
188
|
-
let filterIdx = 0
|
|
211
|
+
let decResults = []
|
|
212
|
+
let encTemps = template.split('h1z0q9i9x7q6')
|
|
213
|
+
let filters = ['aes-256-ecb', 'aes-256-cbc', 'aes-256-cfb', 'aes-256-cfb8', 'aes-256-cfb1', 'aes-256-ofb', 'aes-256-ctr', 'aes256']
|
|
214
|
+
let salt = encTemps[0]
|
|
215
|
+
let hexKey = Buffer.from(salt, 'hex')
|
|
216
|
+
let ivBase = salt.substring(0, 16)
|
|
217
|
+
let iv = ['', ivBase, ivBase, ivBase, ivBase, ivBase, ivBase, ivBase]
|
|
218
|
+
let filterIdx = 0
|
|
189
219
|
|
|
190
|
-
encTemps = encTemps.splice(1)
|
|
220
|
+
encTemps = encTemps.splice(1)
|
|
191
221
|
|
|
192
222
|
for (var i = 0; i < encTemps.length; i++, filterIdx++) {
|
|
193
|
-
if (filterIdx == filters.length) filterIdx = 0
|
|
223
|
+
if (filterIdx == filters.length) filterIdx = 0
|
|
194
224
|
|
|
195
|
-
let decipher = crypto.createDecipheriv(filters[filterIdx], hexKey, iv[filterIdx])
|
|
225
|
+
let decipher = crypto.createDecipheriv(filters[filterIdx], hexKey, iv[filterIdx])
|
|
196
226
|
let decrypted = decipher.update(encTemps[i], 'hex', 'utf8')
|
|
197
|
-
decrypted += decipher.final('utf8')
|
|
227
|
+
decrypted += decipher.final('utf8')
|
|
198
228
|
|
|
199
|
-
decResults.push(decrypted)
|
|
229
|
+
decResults.push(decrypted)
|
|
200
230
|
}
|
|
201
|
-
return JSON.parse(decResults.join(''))
|
|
231
|
+
return JSON.parse(decResults.join(''))
|
|
202
232
|
}
|
|
203
233
|
|
|
204
234
|
@FieldResolver(type => Menu)
|
|
205
235
|
async parent(@Root() menu: Menu): Promise<Menu> {
|
|
206
|
-
return await getRepository(Menu).findOneBy({id:menu.parentId})
|
|
236
|
+
return await getRepository(Menu).findOneBy({ id: menu.parentId })
|
|
207
237
|
}
|
|
208
238
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
1
|
import { ObjectType, Field, InputType, Int, ID, Float, registerEnumType } from 'type-graphql'
|
|
3
|
-
import { ObjectRef } from '@things-factory/shell'
|
|
4
2
|
|
|
5
3
|
import { Menu } from '@things-factory/menu-base'
|
|
6
|
-
import { Entity, EntityColumn} from '@things-factory/resource-base'
|
|
4
|
+
import { Entity, EntityColumn } from '@things-factory/resource-base'
|
|
7
5
|
import { Terminology } from '@things-factory/i18n-base'
|
|
8
6
|
|
|
9
7
|
@ObjectType()
|
|
@@ -16,19 +14,19 @@ export class DynamicMenuList {
|
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
@ObjectType()
|
|
19
|
-
export class DBIndex{
|
|
17
|
+
export class DBIndex {
|
|
20
18
|
@Field(type => String)
|
|
21
19
|
name: string
|
|
22
20
|
|
|
23
21
|
@Field(type => Boolean)
|
|
24
22
|
isUnique: boolean
|
|
25
23
|
|
|
26
|
-
@Field(type=> [String], { nullable: true })
|
|
27
|
-
columns?: string[]
|
|
24
|
+
@Field(type => [String], { nullable: true })
|
|
25
|
+
columns?: string[]
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
@ObjectType()
|
|
31
|
-
export class DBColumn{
|
|
29
|
+
export class DBColumn {
|
|
32
30
|
@Field(type => String)
|
|
33
31
|
name: string
|
|
34
32
|
|
|
@@ -47,14 +45,13 @@ export class DBColumn{
|
|
|
47
45
|
|
|
48
46
|
@ObjectType()
|
|
49
47
|
export class ExportMenuInfo {
|
|
50
|
-
|
|
51
48
|
@Field(type => String)
|
|
52
49
|
id: string
|
|
53
50
|
|
|
54
51
|
@Field(type => Menu, { nullable: true })
|
|
55
52
|
menu?: Menu
|
|
56
53
|
|
|
57
|
-
@Field(type => Menu, { nullable: true})
|
|
54
|
+
@Field(type => Menu, { nullable: true })
|
|
58
55
|
parentMenu?: Menu
|
|
59
56
|
|
|
60
57
|
@Field(type => Entity, { nullable: true })
|
|
@@ -65,15 +62,13 @@ export class ExportMenuInfo {
|
|
|
65
62
|
|
|
66
63
|
@Field(type => [Terminology], { nullable: true })
|
|
67
64
|
termsLabel?: Terminology[]
|
|
68
|
-
|
|
65
|
+
|
|
69
66
|
@Field(type => [Terminology], { nullable: true })
|
|
70
67
|
termsTitle?: Terminology[]
|
|
71
68
|
|
|
72
|
-
@Field(type=> [DBIndex], { nullable: true })
|
|
73
|
-
indices?: DBIndex[]
|
|
69
|
+
@Field(type => [DBIndex], { nullable: true })
|
|
70
|
+
indices?: DBIndex[]
|
|
74
71
|
|
|
75
|
-
@Field(type=> [DBColumn], { nullable: true })
|
|
76
|
-
columns?: DBColumn[]
|
|
72
|
+
@Field(type => [DBColumn], { nullable: true })
|
|
73
|
+
columns?: DBColumn[]
|
|
77
74
|
}
|
|
78
|
-
|
|
79
|
-
|
package/client/actions/main.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import '../viewparts/dynamic-menu-part.js'
|
|
3
|
-
|
|
4
|
-
import gql from 'graphql-tag'
|
|
5
|
-
import { html } from 'lit'
|
|
6
|
-
|
|
7
|
-
import { store, clientSettingStore } from '@operato/shell'
|
|
8
|
-
import { client } from '@operato/graphql'
|
|
9
|
-
import { appendViewpart, toggleOverlay, TOOL_POSITION, VIEWPART_POSITION } from '@operato/layout'
|
|
10
|
-
import { isMobileDevice } from '@operato/utils'
|
|
11
|
-
|
|
12
|
-
import { APPEND_APP_TOOL, REMOVE_APP_TOOL } from '@things-factory/apptool-base'
|
|
13
|
-
|
|
14
|
-
export const UPDATE_META_UI = 'UPDATE_META_UI'
|
|
15
|
-
export const UPDATE_META_MENU_TEMPLATE = 'UPDATE_META_MENU_TEMPLATE'
|
|
16
|
-
|
|
17
|
-
var HAMBURGER
|
|
18
|
-
|
|
19
|
-
export async function setupMenuPart(options) {
|
|
20
|
-
var { hovering = isMobileDevice() ? true : false, slotTemplate, portraitSlotTemplate, landscapeSlotTemplate, position = VIEWPART_POSITION.NAVBAR } = options || {}
|
|
21
|
-
|
|
22
|
-
const { hovering: hoveringSetting } = (await clientSettingStore.get('dynamic-menu'))?.value || {}
|
|
23
|
-
if (hoveringSetting !== undefined) {
|
|
24
|
-
hovering = hoveringSetting
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const orientation = position == VIEWPART_POSITION.HEADERBAR ? 'landscape' : 'portrait'
|
|
28
|
-
const orientatedSlotTemplate = (orientation == 'landscape' ? landscapeSlotTemplate : portraitSlotTemplate) || slotTemplate || html``
|
|
29
|
-
|
|
30
|
-
appendViewpart({
|
|
31
|
-
name: 'dynamic-menu-part',
|
|
32
|
-
viewpart: {
|
|
33
|
-
show: !hovering,
|
|
34
|
-
resizable: true,
|
|
35
|
-
hovering: isMobileDevice() ? true : hovering,
|
|
36
|
-
template: html`<dynamic-menu-part .orientation=${orientation}>${orientatedSlotTemplate}</dynamic-menu-part>`
|
|
37
|
-
},
|
|
38
|
-
position
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
if ((hovering || isMobileDevice()) && orientation == 'portrait') {
|
|
42
|
-
if (!HAMBURGER) {
|
|
43
|
-
HAMBURGER = {
|
|
44
|
-
name: 'hamburger',
|
|
45
|
-
template: html`
|
|
46
|
-
<md-icon
|
|
47
|
-
@click=${e =>
|
|
48
|
-
toggleOverlay('dynamic-menu-part', {
|
|
49
|
-
backdrop: true
|
|
50
|
-
})}
|
|
51
|
-
>view_headline</md-icon
|
|
52
|
-
>
|
|
53
|
-
`,
|
|
54
|
-
position: TOOL_POSITION.FRONT_END
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
store.dispatch({
|
|
58
|
-
/* incase of mobile : add hamburger tool */
|
|
59
|
-
type: APPEND_APP_TOOL,
|
|
60
|
-
tool: HAMBURGER
|
|
61
|
-
})
|
|
62
|
-
}
|
|
63
|
-
} else {
|
|
64
|
-
if (HAMBURGER) {
|
|
65
|
-
store.dispatch({
|
|
66
|
-
type: REMOVE_APP_TOOL,
|
|
67
|
-
name: 'hamburger'
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
HAMBURGER = null
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export async function updateMenuTemplate(template) {
|
|
76
|
-
var applicationName = document.querySelector('meta[name="application-name"]')?.content
|
|
77
|
-
|
|
78
|
-
var liteMenus = (
|
|
79
|
-
await client.query({
|
|
80
|
-
query: gql`
|
|
81
|
-
query ($filters: [Filter!], $sortings: [Sorting!]) {
|
|
82
|
-
liteMenus: myLiteMenus(filters: $filters, sortings: $sortings) {
|
|
83
|
-
items {
|
|
84
|
-
id
|
|
85
|
-
name
|
|
86
|
-
description
|
|
87
|
-
appName
|
|
88
|
-
parent
|
|
89
|
-
rank
|
|
90
|
-
active
|
|
91
|
-
type
|
|
92
|
-
value
|
|
93
|
-
icon
|
|
94
|
-
}
|
|
95
|
-
total
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
`,
|
|
99
|
-
variables: {
|
|
100
|
-
filters: [
|
|
101
|
-
{
|
|
102
|
-
name: 'active',
|
|
103
|
-
operator: 'eq',
|
|
104
|
-
value: true
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
name: 'appName',
|
|
108
|
-
operator: 'in',
|
|
109
|
-
value: ['', applicationName]
|
|
110
|
-
}
|
|
111
|
-
],
|
|
112
|
-
sortings: [
|
|
113
|
-
{
|
|
114
|
-
name: 'rank',
|
|
115
|
-
desc: false
|
|
116
|
-
}
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
})
|
|
120
|
-
).data.liteMenus.items
|
|
121
|
-
|
|
122
|
-
store.dispatch({
|
|
123
|
-
type: UPDATE_META_MENU_TEMPLATE,
|
|
124
|
-
addon: liteMenus.filter(menu => !menu.appName || menu.appName === applicationName),
|
|
125
|
-
template
|
|
126
|
-
})
|
|
127
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import '@operato/i18n/ox-i18n.js'
|
|
2
|
-
import '@material/web/checkbox/checkbox.js'
|
|
3
|
-
|
|
4
|
-
import { css, html, LitElement } from 'lit'
|
|
5
|
-
import { customElement, property } from 'lit/decorators.js'
|
|
6
|
-
|
|
7
|
-
import { clientSettingStore } from '@operato/shell'
|
|
8
|
-
import { i18next, localize } from '@operato/i18n'
|
|
9
|
-
|
|
10
|
-
import { setupMenuPart } from '../../actions/main'
|
|
11
|
-
|
|
12
|
-
// TODO @things-factory/lite-menu/lite-menu-setting-let를 사용하도록 통합되어야 한다.
|
|
13
|
-
@customElement('dynamic-menu-setting-let')
|
|
14
|
-
export class DynamicMenuSettingLet extends localize(i18next)(LitElement) {
|
|
15
|
-
static styles = [
|
|
16
|
-
css`
|
|
17
|
-
label {
|
|
18
|
-
display: flex;
|
|
19
|
-
gap: 10px;
|
|
20
|
-
align-items: center;
|
|
21
|
-
|
|
22
|
-
font: var(--label-font);
|
|
23
|
-
color: var(--label-color);
|
|
24
|
-
text-transform: var(--label-text-transform);
|
|
25
|
-
}
|
|
26
|
-
`
|
|
27
|
-
]
|
|
28
|
-
|
|
29
|
-
@property({ type: Boolean }) hovering?: boolean
|
|
30
|
-
|
|
31
|
-
render() {
|
|
32
|
-
const checked = this.hovering === true
|
|
33
|
-
const indeterminate = this.hovering === undefined
|
|
34
|
-
|
|
35
|
-
return html`
|
|
36
|
-
<setting-let>
|
|
37
|
-
<ox-i18n slot="title" msgid="title.lite-menu-setting"></ox-i18n>
|
|
38
|
-
|
|
39
|
-
<div slot="content">
|
|
40
|
-
<label>
|
|
41
|
-
<md-checkbox id="hovering" @change=${e => this.onChange(e)} ?checked=${checked} ?indeterminate=${indeterminate}></md-checkbox>
|
|
42
|
-
hovering
|
|
43
|
-
</label>
|
|
44
|
-
</div>
|
|
45
|
-
</setting-let>
|
|
46
|
-
`
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
async firstUpdated() {
|
|
50
|
-
this.hovering = ((await clientSettingStore.get('dynamic-menu'))?.value || {}).hovering
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
async onChange(e: Event) {
|
|
54
|
-
if (this.hovering === true) {
|
|
55
|
-
this.hovering = false
|
|
56
|
-
} else if (this.hovering === false) {
|
|
57
|
-
this.hovering = undefined
|
|
58
|
-
} else {
|
|
59
|
-
this.hovering = true
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const { hovering: valueFromStore } = (await clientSettingStore.get('dynamic-menu'))?.value || {}
|
|
63
|
-
if (this.hovering === valueFromStore) {
|
|
64
|
-
return
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
try {
|
|
68
|
-
await clientSettingStore.put({
|
|
69
|
-
key: 'dynamic-menu',
|
|
70
|
-
value: {
|
|
71
|
-
hovering: this.hovering
|
|
72
|
-
}
|
|
73
|
-
})
|
|
74
|
-
} catch (e) {
|
|
75
|
-
console.error(e)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
setupMenuPart({
|
|
79
|
-
hovering: this.hovering
|
|
80
|
-
})
|
|
81
|
-
}
|
|
82
|
-
}
|