@things-factory/meta-ui 6.0.0-alpha.12 → 6.0.0-alpha.19
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.js +25 -27
- package/package.json +4 -4
package/client/bootstrap.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import '@operato/i18n/ox-i18n.js'
|
|
2
|
+
|
|
1
3
|
import { html } from 'lit-html'
|
|
2
4
|
|
|
3
5
|
import { auth } from '@things-factory/auth-base'
|
|
@@ -16,20 +18,19 @@ export default function bootstrap() {
|
|
|
16
18
|
metaUI
|
|
17
19
|
})
|
|
18
20
|
|
|
19
|
-
|
|
20
21
|
auth.on('profile', async ({ credential, domains, domain }) => {
|
|
21
22
|
// 1. 용어 다운로드
|
|
22
|
-
let locale = MetaApi.currentLocale()
|
|
23
|
-
if (locale == 'ko') locale = 'ko-KR'
|
|
23
|
+
let locale = MetaApi.currentLocale()
|
|
24
|
+
if (locale == 'ko') locale = 'ko-KR'
|
|
24
25
|
|
|
25
|
-
await TermsUtil.downloadTerminologies(locale)
|
|
26
|
+
await TermsUtil.downloadTerminologies(locale)
|
|
26
27
|
|
|
27
28
|
// 2. 메뉴 정보를 서버로 부터 받아서 적용
|
|
28
29
|
// 메뉴 정보를 서버로 부터 받아서 적용
|
|
29
|
-
let menuRoutes = await MetaApi.myDynamicMenus()
|
|
30
|
-
let realMenus = menuRoutes.menus
|
|
30
|
+
let menuRoutes = await MetaApi.myDynamicMenus()
|
|
31
|
+
let realMenus = menuRoutes.menus
|
|
31
32
|
|
|
32
|
-
await updateMenuTemplate(realMenus)
|
|
33
|
+
await updateMenuTemplate(realMenus)
|
|
33
34
|
|
|
34
35
|
// 3. 동적 메뉴 관리 화면 추가
|
|
35
36
|
store.dispatch({
|
|
@@ -43,7 +44,7 @@ export default function bootstrap() {
|
|
|
43
44
|
}
|
|
44
45
|
})
|
|
45
46
|
|
|
46
|
-
// 4. 용어 관리 화면 추가
|
|
47
|
+
// 4. 용어 관리 화면 추가
|
|
47
48
|
store.dispatch({
|
|
48
49
|
type: ADD_MORENDA,
|
|
49
50
|
morenda: {
|
|
@@ -56,12 +57,12 @@ export default function bootstrap() {
|
|
|
56
57
|
})
|
|
57
58
|
|
|
58
59
|
// 5. 모든 routes 정보 추출
|
|
59
|
-
let allRoutes = menuRoutes.routes
|
|
60
|
+
let allRoutes = menuRoutes.routes
|
|
60
61
|
|
|
61
62
|
// 6. store의 모듈 정보 조회 & 마지막 application 모듈 정보를 추출
|
|
62
|
-
let modules = store.getState().app.modules
|
|
63
|
-
let allModules = Object.assign([], modules)
|
|
64
|
-
let appModule = allModules[allModules.length - 1]
|
|
63
|
+
let modules = store.getState().app.modules
|
|
64
|
+
let allModules = Object.assign([], modules)
|
|
65
|
+
let appModule = allModules[allModules.length - 1]
|
|
65
66
|
|
|
66
67
|
// 7. 최종 애플리케이션 모듈의 routes 정보 교체
|
|
67
68
|
appModule.routes = allRoutes.filter(r => {
|
|
@@ -75,20 +76,20 @@ export default function bootstrap() {
|
|
|
75
76
|
|
|
76
77
|
// 9. meta-ui의 routes 정보 교체
|
|
77
78
|
let metaUiRoutes = allRoutes.filter(r => {
|
|
78
|
-
let isMetaUiRoute = r.template && r.template.startsWith('@things-factory/meta-ui')
|
|
79
|
+
let isMetaUiRoute = r.template && r.template.startsWith('@things-factory/meta-ui')
|
|
79
80
|
if (isMetaUiRoute) {
|
|
80
81
|
r.template = r.template.replace('@things-factory/meta-ui/client', '.')
|
|
81
82
|
}
|
|
82
83
|
|
|
83
|
-
return isMetaUiRoute
|
|
84
|
+
return isMetaUiRoute
|
|
84
85
|
})
|
|
85
86
|
|
|
86
87
|
this.routes.forEach(r => {
|
|
87
88
|
metaUiRoutes.push({ page: r.page, tagname: r.tagname })
|
|
88
|
-
})
|
|
89
|
+
})
|
|
89
90
|
|
|
90
|
-
metaUiModule.routes = metaUiRoutes
|
|
91
|
-
metaUiModule.route = metaUiRoute
|
|
91
|
+
metaUiModule.routes = metaUiRoutes
|
|
92
|
+
metaUiModule.route = metaUiRoute
|
|
92
93
|
|
|
93
94
|
// 10. store에 모듈 업데이트
|
|
94
95
|
store.dispatch({
|
|
@@ -104,33 +105,30 @@ export default function bootstrap() {
|
|
|
104
105
|
/**
|
|
105
106
|
* @description MetaUI 라우팅 처리 로직
|
|
106
107
|
***********************************
|
|
107
|
-
* @param {*} page
|
|
108
|
-
* @returns
|
|
108
|
+
* @param {*} page
|
|
109
|
+
* @returns
|
|
109
110
|
*/
|
|
110
111
|
function metaUiRoute(page) {
|
|
111
112
|
if (page == 'dynamic-menu') {
|
|
112
113
|
import('./pages/menu/dynamic-menu')
|
|
113
114
|
return page
|
|
114
|
-
|
|
115
115
|
} else if (page == 'config-terminology') {
|
|
116
116
|
import('./pages/terms/config-terminology')
|
|
117
117
|
return page
|
|
118
|
-
|
|
119
118
|
} else if (page == 'loading-page') {
|
|
120
119
|
import('./pages/loading-page')
|
|
121
120
|
return page
|
|
122
|
-
|
|
123
121
|
} else {
|
|
124
|
-
let storage = store.getState()
|
|
122
|
+
let storage = store.getState()
|
|
125
123
|
|
|
126
124
|
if (storage && storage.app && storage.app.modules) {
|
|
127
|
-
let modules = storage.app.modules
|
|
125
|
+
let modules = storage.app.modules
|
|
128
126
|
let metaUiMod = modules.find(m => {
|
|
129
127
|
return m.name == '@things-factory/meta-ui'
|
|
130
128
|
})
|
|
131
129
|
|
|
132
130
|
if (metaUiMod && metaUiMod.routes) {
|
|
133
|
-
let metaUiRoutes = metaUiMod.routes
|
|
131
|
+
let metaUiRoutes = metaUiMod.routes
|
|
134
132
|
let metaRoute = metaUiRoutes.find(mapping => mapping.page == page)
|
|
135
133
|
|
|
136
134
|
if (metaRoute) {
|
|
@@ -140,6 +138,6 @@ function metaUiRoute(page) {
|
|
|
140
138
|
}
|
|
141
139
|
}
|
|
142
140
|
|
|
143
|
-
return ''
|
|
141
|
+
return ''
|
|
144
142
|
}
|
|
145
|
-
}
|
|
143
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/meta-ui",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.19",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@things-factory/menu-base": "^6.0.0-alpha.
|
|
27
|
+
"@things-factory/menu-base": "^6.0.0-alpha.13",
|
|
28
28
|
"@things-factory/operato-license-checker": "^3.1.0",
|
|
29
|
-
"@things-factory/shell": "^6.0.0-alpha.
|
|
29
|
+
"@things-factory/shell": "^6.0.0-alpha.13"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "b4a7e60e4ffbb2e5186ed031157cf183c69d352a"
|
|
32
32
|
}
|