@things-factory/reference-app 7.0.1-alpha.2 → 7.0.1-alpha.20
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/_index.html +1 -0
- package/client/bootstrap.js +1 -24
- package/client/pages/operation/operation-master.js +4 -5
- package/client/pages/pending-job-page.js +10 -9
- package/client/pages/product/product-master.js +5 -8
- package/client/themes/app-theme.css +3 -0
- package/client/themes/grist-theme.css +2 -2
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +36 -35
- package/schema.graphql +86 -24
- package/views/auth-page.html +1 -0
- package/views/public/home.html +1 -0
package/_index.html
CHANGED
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
<!-- Performance tip: hint to the browser to start the handshake for the fonts site -->
|
|
53
53
|
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin />
|
|
54
54
|
<link href="/node_modules/@material-design-icons/font/index.css" rel="stylesheet" />
|
|
55
|
+
<link href="/node_modules/material-symbols/index.css" rel="stylesheet" />
|
|
55
56
|
|
|
56
57
|
<!-- Add any global styles for body, document, etc. -->
|
|
57
58
|
<style>
|
package/client/bootstrap.js
CHANGED
|
@@ -77,27 +77,6 @@ export default async function bootstrap() {
|
|
|
77
77
|
})
|
|
78
78
|
updateMenuTemplate(getMenuTemplate())
|
|
79
79
|
|
|
80
|
-
/* add top-menu app-tool */
|
|
81
|
-
// store.dispatch({
|
|
82
|
-
// type: APPEND_APP_TOOL,
|
|
83
|
-
// replace: 'title-bar',
|
|
84
|
-
// tool: {
|
|
85
|
-
// name: 'top-menu-bar',
|
|
86
|
-
// template: html` <top-menu-bar></top-menu-bar> `,
|
|
87
|
-
// position: TOOL_POSITION.CENTER
|
|
88
|
-
// }
|
|
89
|
-
// })
|
|
90
|
-
|
|
91
|
-
/* add top-menu app-tool */
|
|
92
|
-
// store.dispatch({
|
|
93
|
-
// type: APPEND_APP_TOOL,
|
|
94
|
-
// tool: {
|
|
95
|
-
// name: 'domain-switch',
|
|
96
|
-
// template: html` <domain-switch rounded-corner dark></domain-switch> `,
|
|
97
|
-
// position: TOOL_POSITION.REAR
|
|
98
|
-
// }
|
|
99
|
-
// })
|
|
100
|
-
|
|
101
80
|
/* add setting morenda */
|
|
102
81
|
store.dispatch({
|
|
103
82
|
type: ADD_MORENDA,
|
|
@@ -111,9 +90,7 @@ export default async function bootstrap() {
|
|
|
111
90
|
})
|
|
112
91
|
|
|
113
92
|
/* add addon-menu management page morenda */
|
|
114
|
-
if (
|
|
115
|
-
await hasPrivilege({ privilege: 'mutation', category: 'menu', domainOwnerGranted: true, superUserGranted: true })
|
|
116
|
-
) {
|
|
93
|
+
if (await hasPrivilege({ privilege: 'mutation', category: 'menu', domainOwnerGranted: true, superUserGranted: true })) {
|
|
117
94
|
store.dispatch({
|
|
118
95
|
type: ADD_MORENDA,
|
|
119
96
|
morenda: {
|
|
@@ -11,7 +11,7 @@ import { i18next, localize } from '@operato/i18n'
|
|
|
11
11
|
import { openPopup } from '@operato/layout'
|
|
12
12
|
import { CommonButtonStyles, CommonGristStyles } from '@operato/styles'
|
|
13
13
|
import { isMobileDevice } from '@operato/utils'
|
|
14
|
-
import { CustomAlert, PageView } from '@
|
|
14
|
+
import { CustomAlert, PageView } from '@operato/shell'
|
|
15
15
|
|
|
16
16
|
import { createOperation, deleteOperations, fetchOperations, saveOperations } from './operation-api'
|
|
17
17
|
|
|
@@ -46,6 +46,7 @@ class OperationMaster extends localize(i18next)(PageView) {
|
|
|
46
46
|
constructor() {
|
|
47
47
|
super()
|
|
48
48
|
this.mode = isMobileDevice() ? 'CARD' : 'GRID'
|
|
49
|
+
this.importHandler = this.defaultImportHandler
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
render() {
|
|
@@ -292,7 +293,7 @@ class OperationMaster extends localize(i18next)(PageView) {
|
|
|
292
293
|
}
|
|
293
294
|
}
|
|
294
295
|
|
|
295
|
-
async
|
|
296
|
+
async defaultImportHandler(patches) {
|
|
296
297
|
const response = await saveOperations(patches)
|
|
297
298
|
|
|
298
299
|
if (!response.errors) {
|
|
@@ -417,9 +418,7 @@ class OperationMaster extends localize(i18next)(PageView) {
|
|
|
417
418
|
...this._columns
|
|
418
419
|
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
|
419
420
|
.reduce((record, column) => {
|
|
420
|
-
record[column.imex.key] = column.imex.key
|
|
421
|
-
.split('.')
|
|
422
|
-
.reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
|
421
|
+
record[column.imex.key] = column.imex.key.split('.').reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
|
423
422
|
return record
|
|
424
423
|
}, {})
|
|
425
424
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '@material/mwc-linear-progress'
|
|
2
2
|
import '@operato/help/ox-help-icon.js'
|
|
3
|
+
import '@operato/oops/ox-oops-progress.js'
|
|
3
4
|
|
|
4
5
|
import gql from 'graphql-tag'
|
|
5
6
|
import { css, html } from 'lit'
|
|
@@ -48,19 +49,19 @@ class PendingJobPage extends connect(store)(PageView) {
|
|
|
48
49
|
|
|
49
50
|
return html`
|
|
50
51
|
<p>
|
|
51
|
-
오래걸리는 서버작업을 수행할 때는 진행과정을 표현해주는 것이 사용자 경험에 도움을 준다. 이를 위해 Things Factory
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
오래걸리는 서버작업을 수행할 때는 진행과정을 표현해주는 것이 사용자 경험에 도움을 준다. 이를 위해 Things Factory 프레임워크에서는 ox-oops-progress<ox-help-icon
|
|
53
|
+
topic="components/ox-oops-progress"
|
|
54
|
+
></ox-help-icon>
|
|
55
|
+
라는 컴포넌트를 제공한다.
|
|
54
56
|
</p>
|
|
55
57
|
<p>
|
|
56
|
-
아래 'Start' 버튼을 클릭하면, 서버에 작업을 요청하고 그 진행율이 화면에 표현된다. 진행중에는 버튼은 'Stop'
|
|
57
|
-
|
|
58
|
-
주의할 점은, 'Stop' 버튼으로 서버의 작업을 변경하는 것은 아니고, 진행율 구독만을 정지한다는 것이다. 서버
|
|
58
|
+
아래 'Start' 버튼을 클릭하면, 서버에 작업을 요청하고 그 진행율이 화면에 표현된다. 진행중에는 버튼은 'Stop' 버튼으로 변경되면, 진행중에 버튼을 누르면 진행율 표현이
|
|
59
|
+
멈추게 된다. 진행이 완료되면, 'Start' 버튼으로 변경된다. 주의할 점은, 'Stop' 버튼으로 서버의 작업을 변경하는 것은 아니고, 진행율 구독만을 정지한다는 것이다. 서버
|
|
59
60
|
작업까지 정지하고자하면, 별도의 mutation을 구현해서 Stop시에 호출해주어야 한다.
|
|
60
61
|
</p>
|
|
61
62
|
|
|
62
63
|
<section>
|
|
63
|
-
<oops-progress
|
|
64
|
+
<ox-oops-progress
|
|
64
65
|
@progress=${e => {
|
|
65
66
|
this.progress = e.detail
|
|
66
67
|
}}
|
|
@@ -73,14 +74,14 @@ class PendingJobPage extends connect(store)(PageView) {
|
|
|
73
74
|
<mwc-linear-progress .progress=${progress / 100}></mwc-linear-progress>
|
|
74
75
|
<span>Progress : ${progress} % (${message})</span>
|
|
75
76
|
</div>
|
|
76
|
-
</oops-progress>
|
|
77
|
+
</ox-oops-progress>
|
|
77
78
|
<div id="result"></div>
|
|
78
79
|
</section>
|
|
79
80
|
`
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
get oopsProgress() {
|
|
83
|
-
return this.shadowRoot.querySelector('oops-progress')
|
|
84
|
+
return this.shadowRoot.querySelector('ox-oops-progress')
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
updated(changes) {
|
|
@@ -38,6 +38,7 @@ class ProductMaster extends localize(i18next)(PageView) {
|
|
|
38
38
|
constructor() {
|
|
39
39
|
super()
|
|
40
40
|
this.mode = isMobileDevice() ? 'LIST' : 'GRID'
|
|
41
|
+
this.importHandler = this.defaultImportHandler
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
static get properties() {
|
|
@@ -725,7 +726,7 @@ class ProductMaster extends localize(i18next)(PageView) {
|
|
|
725
726
|
}
|
|
726
727
|
}
|
|
727
728
|
|
|
728
|
-
async
|
|
729
|
+
async defaultImportHandler(patches) {
|
|
729
730
|
const response = await saveProducts(patches)
|
|
730
731
|
|
|
731
732
|
if (!response.errors) {
|
|
@@ -842,9 +843,7 @@ class ProductMaster extends localize(i18next)(PageView) {
|
|
|
842
843
|
...this._columns
|
|
843
844
|
.filter(column => column.type !== 'gutter' && !!column.imex)
|
|
844
845
|
.reduce((record, column) => {
|
|
845
|
-
record[column.imex.key] = column.imex.key
|
|
846
|
-
.split('.')
|
|
847
|
-
.reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
|
846
|
+
record[column.imex.key] = column.imex.key.split('.').reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
|
848
847
|
return record
|
|
849
848
|
}, {})
|
|
850
849
|
}
|
|
@@ -866,15 +865,13 @@ class ProductMaster extends localize(i18next)(PageView) {
|
|
|
866
865
|
if (!errors.find(err => err.type == 'type')) errors.push({ type: 'type', value: 'Product type is required' })
|
|
867
866
|
}
|
|
868
867
|
if (_.isEmpty(itm.packingType) || '') {
|
|
869
|
-
if (!errors.find(err => err.type == 'packingType'))
|
|
870
|
-
errors.push({ type: 'packingType', value: 'Packing type is required' })
|
|
868
|
+
if (!errors.find(err => err.type == 'packingType')) errors.push({ type: 'packingType', value: 'Packing type is required' })
|
|
871
869
|
}
|
|
872
870
|
if (_.isEmpty(itm.uom) || '') {
|
|
873
871
|
if (!errors.find(err => err.type == 'uom')) errors.push({ type: 'uom', value: 'UOM is required' })
|
|
874
872
|
}
|
|
875
873
|
if (!_.isNumber(itm.uomValue) || _.isNaN(itm.uomValue) || '' || itm?.uomValue < 0) {
|
|
876
|
-
if (!errors.find(err => err.type == 'uomValue'))
|
|
877
|
-
errors.push({ type: 'uomValue', value: 'UOM Value is required' })
|
|
874
|
+
if (!errors.find(err => err.type == 'uomValue')) errors.push({ type: 'uomValue', value: 'UOM Value is required' })
|
|
878
875
|
}
|
|
879
876
|
return itm
|
|
880
877
|
})
|
|
@@ -82,6 +82,9 @@ body {
|
|
|
82
82
|
--mdc-button-outline-width: 1px;
|
|
83
83
|
--mdc-button-horizontal-padding: 16px;
|
|
84
84
|
|
|
85
|
+
--md-fab-container-color: var(--primary-color);
|
|
86
|
+
--md-fab-icon-color: var(--focus-color);
|
|
87
|
+
|
|
85
88
|
/* button style */
|
|
86
89
|
--button-background-color: #fafbfc;
|
|
87
90
|
--button-background-focus-color: var(--primary-color);
|
|
@@ -155,7 +155,7 @@ body {
|
|
|
155
155
|
--record-view-font: normal 15px/32px var(--theme-font);
|
|
156
156
|
--record-view-footer-height: 50px;
|
|
157
157
|
--record-view-footer-button-height: var(--record-view-footer-height);
|
|
158
|
-
--record-view-footer-iconbutton-size:
|
|
158
|
+
--record-view-footer-iconbutton-size: 28px;
|
|
159
159
|
--record-view-footer-iconbutton-margin: -2px;
|
|
160
160
|
--record-view-footer-iconbutton-display: block;
|
|
161
161
|
--ox-grist-padding: 0;
|
|
@@ -168,7 +168,7 @@ body {
|
|
|
168
168
|
|
|
169
169
|
--record-view-footer-height: 50px;
|
|
170
170
|
--record-view-footer-button-height: var(--record-view-footer-height);
|
|
171
|
-
--record-view-footer-iconbutton-size:
|
|
171
|
+
--record-view-footer-iconbutton-size: 28px;
|
|
172
172
|
--record-view-footer-iconbutton-margin: -2px;
|
|
173
173
|
--record-view-footer-iconbutton-display: block;
|
|
174
174
|
}
|