@things-factory/operato-board 6.1.80 → 6.1.82
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/apptools/{favorite-tool.js → favorite-tool.ts} +21 -25
- package/client/board-list/{board-importer.js → board-importer.ts} +14 -10
- package/client/{bootstrap.js → bootstrap.ts} +4 -3
- package/client/graphql/{board.js → board.ts} +1 -1
- package/client/graphql/{favorite-board.js → favorite-board.ts} +1 -1
- package/client/graphql/{group.js → group.ts} +2 -2
- package/client/graphql/{play-group.js → play-group.ts} +3 -3
- package/client/themes/grist-theme.css +2 -0
- package/client/viewparts/{board-info.js → board-info.ts} +121 -127
- package/client/viewparts/{group-info.js → group-info.ts} +116 -121
- package/client/viewparts/{menu-tools.js → menu-tools.ts} +69 -78
- package/client/viewparts/play-group-info.ts +249 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -32
- package/{things-factory.config.js → things-factory.config.ts} +0 -4
- package/client/viewparts/play-group-info.js +0 -254
- /package/client/actions/{permissions.js → permissions.ts} +0 -0
- /package/client/graphql/{index.js → index.ts} +0 -0
- /package/client/{index.js → index.ts} +0 -0
- /package/client/reducers/{permissions.js → permissions.ts} +0 -0
- /package/client/{route.js → route.ts} +0 -0
|
@@ -1,135 +1,132 @@
|
|
|
1
1
|
import '@material/mwc-icon'
|
|
2
2
|
|
|
3
3
|
import { css, html, LitElement } from 'lit'
|
|
4
|
+
import { customElement, property, state } from 'lit/decorators.js'
|
|
4
5
|
|
|
5
6
|
import { i18next } from '@things-factory/i18n-base'
|
|
6
7
|
|
|
7
8
|
import { fetchGroup } from '../graphql'
|
|
8
9
|
|
|
10
|
+
@customElement('group-info')
|
|
9
11
|
export class GroupInfo extends LitElement {
|
|
10
|
-
static
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
static styles = [
|
|
13
|
+
css`
|
|
14
|
+
:host {
|
|
15
|
+
display: block;
|
|
16
|
+
background-color: var(--main-section-background-color);
|
|
17
|
+
height: 100%;
|
|
18
|
+
min-width: 350px;
|
|
19
|
+
overflow: auto;
|
|
20
|
+
position: relative;
|
|
21
|
+
|
|
22
|
+
--form-grid-gap: 2px 0;
|
|
23
|
+
--input-field-padding: var(--padding-default);
|
|
24
|
+
--legend-padding: var(--padding-default) 0 var(--padding-narrow) 0;
|
|
25
|
+
--mdc-button-horizontal-padding: var(--padding-default);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
form {
|
|
29
|
+
display: grid;
|
|
30
|
+
grid-template-columns: repeat(12, 1fr);
|
|
31
|
+
grid-gap: var(--form-grid-gap);
|
|
32
|
+
grid-auto-rows: minmax(24px, auto);
|
|
33
|
+
padding: var(--padding-wide);
|
|
34
|
+
align-items: center;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[buttons] {
|
|
38
|
+
grid-column: span 12;
|
|
39
|
+
padding: var(--padding-default) 0;
|
|
40
|
+
text-align: right;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[buttons] * {
|
|
44
|
+
margin: 0 0 0 var(--margin-narrow);
|
|
45
|
+
}
|
|
46
|
+
[danger] {
|
|
47
|
+
float: left;
|
|
48
|
+
margin: 0 var(--margin-narrow) 0 0;
|
|
49
|
+
--mdc-theme-primary: var(--status-danger-color);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
fieldset {
|
|
53
|
+
display: contents;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
legend {
|
|
57
|
+
grid-column: span 12;
|
|
58
|
+
padding: var(--legend-padding);
|
|
59
|
+
font: var(--legend-font);
|
|
60
|
+
color: var(--legend-text-color);
|
|
61
|
+
text-transform: capitalize;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
label {
|
|
65
|
+
grid-column: span 12;
|
|
66
|
+
text-transform: capitalize;
|
|
67
|
+
color: var(--label-color);
|
|
68
|
+
font: var(--label-font);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
span {
|
|
72
|
+
grid-column: span 12;
|
|
73
|
+
border-bottom: var(--border-dark-color);
|
|
74
|
+
margin-bottom: var(--margin-default);
|
|
75
|
+
padding-bottom: var(--padding-narrow);
|
|
76
|
+
font: var(--input-field-font);
|
|
77
|
+
}
|
|
78
|
+
span mwc-icon {
|
|
79
|
+
vertical-align: middle;
|
|
80
|
+
font-size: var(--fontsize-large);
|
|
81
|
+
color: var(--primary-color);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
input,
|
|
85
|
+
table,
|
|
86
|
+
select,
|
|
87
|
+
textarea,
|
|
88
|
+
[custom-input] {
|
|
89
|
+
grid-column: span 12;
|
|
90
|
+
|
|
91
|
+
border: var(--input-field-border);
|
|
92
|
+
border-radius: var(--input-field-border-radius);
|
|
93
|
+
margin-bottom: var(--margin-default);
|
|
94
|
+
padding: var(--input-field-padding);
|
|
95
|
+
font: var(--input-field-font);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
input[type='checkbox'],
|
|
99
|
+
input[type='radio'] {
|
|
100
|
+
place-self: center;
|
|
101
|
+
margin: 0;
|
|
102
|
+
grid-column: 1;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
input[type='checkbox'] + label,
|
|
106
|
+
input[type='radio'] + label {
|
|
107
|
+
text-align: left;
|
|
108
|
+
grid-column: span 11 / auto;
|
|
109
|
+
|
|
110
|
+
font: var(--form-sublabel-font);
|
|
111
|
+
color: var(--form-sublabel-color);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
input:focus {
|
|
115
|
+
outline: none;
|
|
116
|
+
border: 1px solid var(--focus-background-color);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@media screen and (max-width: 460px) {
|
|
20
120
|
:host {
|
|
21
|
-
|
|
22
|
-
background-color: var(--main-section-background-color);
|
|
23
|
-
height: 100%;
|
|
24
|
-
min-width: 350px;
|
|
25
|
-
overflow: auto;
|
|
26
|
-
position: relative;
|
|
27
|
-
|
|
28
|
-
--form-grid-gap: 2px 0;
|
|
29
|
-
--input-field-padding: var(--padding-default);
|
|
30
|
-
--legend-padding: var(--padding-default) 0 var(--padding-narrow) 0;
|
|
31
|
-
--mdc-button-horizontal-padding: var(--padding-default);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
form {
|
|
35
|
-
display: grid;
|
|
36
|
-
grid-template-columns: repeat(12, 1fr);
|
|
37
|
-
grid-gap: var(--form-grid-gap);
|
|
38
|
-
grid-auto-rows: minmax(24px, auto);
|
|
39
|
-
padding: var(--padding-wide);
|
|
40
|
-
align-items: center;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
[buttons] {
|
|
44
|
-
grid-column: span 12;
|
|
45
|
-
padding: var(--padding-default) 0;
|
|
46
|
-
text-align: right;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
[buttons] * {
|
|
50
|
-
margin: 0 0 0 var(--margin-narrow);
|
|
51
|
-
}
|
|
52
|
-
[danger] {
|
|
53
|
-
float: left;
|
|
54
|
-
margin: 0 var(--margin-narrow) 0 0;
|
|
55
|
-
--mdc-theme-primary: var(--status-danger-color);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
fieldset {
|
|
59
|
-
display: contents;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
legend {
|
|
63
|
-
grid-column: span 12;
|
|
64
|
-
padding: var(--legend-padding);
|
|
65
|
-
font: var(--legend-font);
|
|
66
|
-
color: var(--legend-text-color);
|
|
67
|
-
text-transform: capitalize;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
label {
|
|
71
|
-
grid-column: span 12;
|
|
72
|
-
text-transform: capitalize;
|
|
73
|
-
color: var(--label-color);
|
|
74
|
-
font: var(--label-font);
|
|
121
|
+
width: 100vw;
|
|
75
122
|
}
|
|
123
|
+
}
|
|
124
|
+
`
|
|
125
|
+
]
|
|
76
126
|
|
|
77
|
-
|
|
78
|
-
grid-column: span 12;
|
|
79
|
-
border-bottom: var(--border-dark-color);
|
|
80
|
-
margin-bottom: var(--margin-default);
|
|
81
|
-
padding-bottom: var(--padding-narrow);
|
|
82
|
-
font: var(--input-field-font);
|
|
83
|
-
}
|
|
84
|
-
span mwc-icon {
|
|
85
|
-
vertical-align: middle;
|
|
86
|
-
font-size: var(--fontsize-large);
|
|
87
|
-
color: var(--primary-color);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
input,
|
|
91
|
-
table,
|
|
92
|
-
select,
|
|
93
|
-
textarea,
|
|
94
|
-
[custom-input] {
|
|
95
|
-
grid-column: span 12;
|
|
96
|
-
|
|
97
|
-
border: var(--input-field-border);
|
|
98
|
-
border-radius: var(--input-field-border-radius);
|
|
99
|
-
margin-bottom: var(--margin-default);
|
|
100
|
-
padding: var(--input-field-padding);
|
|
101
|
-
font: var(--input-field-font);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
input[type='checkbox'],
|
|
105
|
-
input[type='radio'] {
|
|
106
|
-
place-self: center;
|
|
107
|
-
margin: 0;
|
|
108
|
-
grid-column: 1;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
input[type='checkbox'] + label,
|
|
112
|
-
input[type='radio'] + label {
|
|
113
|
-
text-align: left;
|
|
114
|
-
grid-column: span 11 / auto;
|
|
115
|
-
|
|
116
|
-
font: var(--form-sublabel-font);
|
|
117
|
-
color: var(--form-sublabel-color);
|
|
118
|
-
}
|
|
127
|
+
@property({ type: String }) groupId?: string
|
|
119
128
|
|
|
120
|
-
|
|
121
|
-
outline: none;
|
|
122
|
-
border: 1px solid var(--focus-background-color);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
@media screen and (max-width: 460px) {
|
|
126
|
-
:host {
|
|
127
|
-
width: 100vw;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
`
|
|
131
|
-
]
|
|
132
|
-
}
|
|
129
|
+
@state() group: any
|
|
133
130
|
|
|
134
131
|
render() {
|
|
135
132
|
var group = this.group || { name: '', description: '' }
|
|
@@ -248,5 +245,3 @@ export class GroupInfo extends LitElement {
|
|
|
248
245
|
history.back()
|
|
249
246
|
}
|
|
250
247
|
}
|
|
251
|
-
|
|
252
|
-
customElements.define('group-info', GroupInfo)
|
|
@@ -2,86 +2,79 @@ import '@material/mwc-icon'
|
|
|
2
2
|
import '@operato/i18n/ox-i18n.js'
|
|
3
3
|
|
|
4
4
|
import { css, html, LitElement } from 'lit'
|
|
5
|
+
import { customElement, property } from 'lit/decorators.js'
|
|
5
6
|
import { connect } from 'pwa-helpers'
|
|
6
7
|
|
|
7
|
-
import { store } from '@
|
|
8
|
+
import { store } from '@operato/shell'
|
|
8
9
|
|
|
10
|
+
@customElement('menu-tools')
|
|
9
11
|
export class MenuTools extends connect(store)(LitElement) {
|
|
10
|
-
static
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
vertical-align: bottom;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
div {
|
|
80
|
-
font-size: 0.6em;
|
|
81
|
-
}
|
|
82
|
-
`
|
|
83
|
-
]
|
|
84
|
-
}
|
|
12
|
+
static styles = [
|
|
13
|
+
css`
|
|
14
|
+
:host {
|
|
15
|
+
display: flex;
|
|
16
|
+
background-color: var(--menu-tools-background-color);
|
|
17
|
+
|
|
18
|
+
/* for narrow mode */
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host([width='WIDE']) {
|
|
24
|
+
/* for wide mode */
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
width: initial;
|
|
27
|
+
height: 100%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
ul {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: row;
|
|
33
|
+
|
|
34
|
+
margin: auto;
|
|
35
|
+
padding: 0;
|
|
36
|
+
list-style: none;
|
|
37
|
+
height: 100%;
|
|
38
|
+
overflow: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([width='WIDE']) ul {
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([width='WIDE']) li {
|
|
46
|
+
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
|
47
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
a {
|
|
51
|
+
display: block;
|
|
52
|
+
padding: 5px 0px;
|
|
53
|
+
text-align: center;
|
|
54
|
+
text-decoration: none;
|
|
55
|
+
color: var(--menu-tools-color);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
a[active] {
|
|
59
|
+
color: var(--menu-tools-active-color);
|
|
60
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
mwc-icon {
|
|
64
|
+
padding: 5px 15px 0px 15px;
|
|
65
|
+
vertical-align: bottom;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
div {
|
|
69
|
+
font-size: 0.6em;
|
|
70
|
+
}
|
|
71
|
+
`
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
@property({ type: String }) page?: string
|
|
75
|
+
@property({ type: String, reflect: true }) width?: string
|
|
76
|
+
@property({ type: Boolean }) editable?: boolean
|
|
77
|
+
@property({ type: Object }) context: any
|
|
85
78
|
|
|
86
79
|
render() {
|
|
87
80
|
return this.context && this.context['board_topmenu']
|
|
@@ -140,5 +133,3 @@ export class MenuTools extends connect(store)(LitElement) {
|
|
|
140
133
|
this.editable = state.permissions?.boardPermissions?.includes('Modeller')
|
|
141
134
|
}
|
|
142
135
|
}
|
|
143
|
-
|
|
144
|
-
window.customElements.define('menu-tools', MenuTools)
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import '@material/mwc-icon'
|
|
2
|
+
|
|
3
|
+
import { css, html, LitElement } from 'lit'
|
|
4
|
+
import { customElement, property, state } from 'lit/decorators.js'
|
|
5
|
+
|
|
6
|
+
import { i18next } from '@operato/i18n'
|
|
7
|
+
|
|
8
|
+
import { fetchPlayGroup } from '../graphql'
|
|
9
|
+
|
|
10
|
+
@customElement('play-group-info')
|
|
11
|
+
export class PlayGroupInfo extends LitElement {
|
|
12
|
+
static styles = [
|
|
13
|
+
css`
|
|
14
|
+
:host {
|
|
15
|
+
display: block;
|
|
16
|
+
background-color: var(--main-section-background-color);
|
|
17
|
+
height: 100%;
|
|
18
|
+
min-width: 350px;
|
|
19
|
+
overflow: auto;
|
|
20
|
+
position: relative;
|
|
21
|
+
|
|
22
|
+
--form-grid-gap: 2px 0;
|
|
23
|
+
--input-field-padding: var(--padding-default);
|
|
24
|
+
--legend-padding: var(--padding-default) 0 var(--padding-narrow) 0;
|
|
25
|
+
--mdc-button-horizontal-padding: var(--padding-default);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
form {
|
|
29
|
+
display: grid;
|
|
30
|
+
grid-template-columns: repeat(12, 1fr);
|
|
31
|
+
grid-gap: var(--form-grid-gap);
|
|
32
|
+
grid-auto-rows: minmax(24px, auto);
|
|
33
|
+
padding: var(--padding-wide);
|
|
34
|
+
align-items: center;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[buttons] {
|
|
38
|
+
grid-column: span 12;
|
|
39
|
+
padding: var(--padding-default) 0;
|
|
40
|
+
text-align: right;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[buttons] * {
|
|
44
|
+
margin: 0 0 0 var(--margin-narrow);
|
|
45
|
+
}
|
|
46
|
+
[danger] {
|
|
47
|
+
float: left;
|
|
48
|
+
margin: 0 var(--margin-narrow) 0 0;
|
|
49
|
+
--mdc-theme-primary: var(--status-danger-color);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
fieldset {
|
|
53
|
+
display: contents;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
legend {
|
|
57
|
+
grid-column: span 12;
|
|
58
|
+
padding: var(--legend-padding);
|
|
59
|
+
font: var(--legend-font);
|
|
60
|
+
color: var(--legend-text-color);
|
|
61
|
+
text-transform: capitalize;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
label {
|
|
65
|
+
grid-column: span 12;
|
|
66
|
+
text-transform: capitalize;
|
|
67
|
+
color: var(--label-color);
|
|
68
|
+
font: var(--label-font);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
span {
|
|
72
|
+
grid-column: span 12;
|
|
73
|
+
border-bottom: var(--border-dark-color);
|
|
74
|
+
margin-bottom: var(--margin-default);
|
|
75
|
+
padding-bottom: var(--padding-narrow);
|
|
76
|
+
font: var(--input-field-font);
|
|
77
|
+
}
|
|
78
|
+
span mwc-icon {
|
|
79
|
+
vertical-align: middle;
|
|
80
|
+
font-size: var(--fontsize-large);
|
|
81
|
+
color: var(--primary-color);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
input,
|
|
85
|
+
table,
|
|
86
|
+
select,
|
|
87
|
+
textarea,
|
|
88
|
+
[custom-input] {
|
|
89
|
+
grid-column: span 12;
|
|
90
|
+
|
|
91
|
+
border: var(--input-field-border);
|
|
92
|
+
border-radius: var(--input-field-border-radius);
|
|
93
|
+
margin-bottom: var(--margin-default);
|
|
94
|
+
padding: var(--input-field-padding);
|
|
95
|
+
font: var(--input-field-font);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
input[type='checkbox'],
|
|
99
|
+
input[type='radio'] {
|
|
100
|
+
place-self: center;
|
|
101
|
+
margin: 0;
|
|
102
|
+
grid-column: 1;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
input[type='checkbox'] + label,
|
|
106
|
+
input[type='radio'] + label {
|
|
107
|
+
text-align: left;
|
|
108
|
+
grid-column: span 11 / auto;
|
|
109
|
+
|
|
110
|
+
font: var(--form-sublabel-font);
|
|
111
|
+
color: var(--form-sublabel-color);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
input:focus {
|
|
115
|
+
outline: none;
|
|
116
|
+
border: 1px solid var(--focus-background-color);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@media screen and (max-width: 460px) {
|
|
120
|
+
:host {
|
|
121
|
+
width: 100vw;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
`
|
|
125
|
+
]
|
|
126
|
+
|
|
127
|
+
@property({ type: String }) playGroupId?: string
|
|
128
|
+
|
|
129
|
+
@state() playGroup: any
|
|
130
|
+
|
|
131
|
+
render() {
|
|
132
|
+
var playGroup = this.playGroup || { name: '', description: '' }
|
|
133
|
+
|
|
134
|
+
return html`
|
|
135
|
+
<form>
|
|
136
|
+
<fieldset>
|
|
137
|
+
<legend>playgroup information</legend>
|
|
138
|
+
<label>${i18next.t('label.name')}</label>
|
|
139
|
+
<input type="text" .value=${playGroup.name} @change=${e => (this.playGroup.name = e.target.value)} />
|
|
140
|
+
|
|
141
|
+
<label>${i18next.t('label.description')}</label>
|
|
142
|
+
<input
|
|
143
|
+
type="text"
|
|
144
|
+
.value=${playGroup.description}
|
|
145
|
+
@change=${e => (this.playGroup.description = e.target.value)}
|
|
146
|
+
/>
|
|
147
|
+
|
|
148
|
+
<label>${i18next.t('label.creator')}</label>
|
|
149
|
+
<span>
|
|
150
|
+
<mwc-icon>person</mwc-icon> ${playGroup.creator && playGroup.creator.name}
|
|
151
|
+
<mwc-icon>schedule</mwc-icon> ${new Date(Number(playGroup.createdAt)).toLocaleString()}
|
|
152
|
+
</span>
|
|
153
|
+
|
|
154
|
+
<label>${i18next.t('label.updater')}</label>
|
|
155
|
+
<span>
|
|
156
|
+
<mwc-icon>person</mwc-icon> ${playGroup.updater && playGroup.updater.name}
|
|
157
|
+
<mwc-icon>schedule</mwc-icon> ${new Date(Number(playGroup.updatedAt)).toLocaleString()}
|
|
158
|
+
</span>
|
|
159
|
+
|
|
160
|
+
<div buttons>
|
|
161
|
+
${this.playGroupId
|
|
162
|
+
? html`
|
|
163
|
+
<mwc-button
|
|
164
|
+
dense
|
|
165
|
+
raised
|
|
166
|
+
danger
|
|
167
|
+
label=${String(i18next.t('button.delete'))}
|
|
168
|
+
@click=${this.deletePlayGroup.bind(this)}
|
|
169
|
+
icon="delete_outline"
|
|
170
|
+
></mwc-button>
|
|
171
|
+
<mwc-button
|
|
172
|
+
dense
|
|
173
|
+
raised
|
|
174
|
+
label=${String(i18next.t('button.save'))}
|
|
175
|
+
@click=${this.updateGroup.bind(this)}
|
|
176
|
+
icon="done"
|
|
177
|
+
></mwc-button>
|
|
178
|
+
`
|
|
179
|
+
: html`
|
|
180
|
+
<mwc-button
|
|
181
|
+
dense
|
|
182
|
+
raised
|
|
183
|
+
label=${String(i18next.t('button.create'))}
|
|
184
|
+
@click=${this.createPlayGroup.bind(this)}
|
|
185
|
+
icon="create_new_folder"
|
|
186
|
+
></mwc-button>
|
|
187
|
+
`}
|
|
188
|
+
</div>
|
|
189
|
+
</fieldset>
|
|
190
|
+
</form>
|
|
191
|
+
`
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
updated(changes) {
|
|
195
|
+
if (changes.has('playGroupId')) {
|
|
196
|
+
this.refresh()
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
firstUpdated() {
|
|
201
|
+
setTimeout(() => {
|
|
202
|
+
;(this.renderRoot.querySelector('input[type=text]') as any).focus()
|
|
203
|
+
}, 100)
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
async refresh() {
|
|
207
|
+
if (!this.playGroupId) {
|
|
208
|
+
/* model이 없으므로, 기본 모델을 제공함. */
|
|
209
|
+
this.playGroup = { name: '', description: '' }
|
|
210
|
+
} else {
|
|
211
|
+
var response = await fetchPlayGroup(this.playGroupId)
|
|
212
|
+
this.playGroup = response.playGroup
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
async createPlayGroup() {
|
|
217
|
+
this.dispatchEvent(
|
|
218
|
+
new CustomEvent('create-play-group', {
|
|
219
|
+
detail: this.playGroup
|
|
220
|
+
})
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
this.close()
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
async updateGroup() {
|
|
227
|
+
this.dispatchEvent(
|
|
228
|
+
new CustomEvent('update-play-group', {
|
|
229
|
+
detail: this.playGroup
|
|
230
|
+
})
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
this.close()
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
async deletePlayGroup() {
|
|
237
|
+
this.dispatchEvent(
|
|
238
|
+
new CustomEvent('delete-play-group', {
|
|
239
|
+
detail: this.playGroup
|
|
240
|
+
})
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
this.close()
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
close() {
|
|
247
|
+
history.back()
|
|
248
|
+
}
|
|
249
|
+
}
|