@things-factory/menu-ui 8.0.0 → 9.0.0-beta.3
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/dist-client/apptools/favorite-tool.d.ts +28 -0
- package/dist-client/apptools/favorite-tool.js +139 -0
- package/dist-client/apptools/favorite-tool.js.map +1 -0
- package/dist-client/bootstrap.d.ts +4 -0
- package/dist-client/bootstrap.js +52 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/components/child-menus-selector.d.ts +1 -0
- package/dist-client/components/child-menus-selector.js +146 -0
- package/dist-client/components/child-menus-selector.js.map +1 -0
- package/dist-client/components/role-select-popup.d.ts +1 -0
- package/dist-client/components/role-select-popup.js +180 -0
- package/dist-client/components/role-select-popup.js.map +1 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/menu-list-page.d.ts +2 -0
- package/dist-client/pages/menu-list-page.js +204 -0
- package/dist-client/pages/menu-list-page.js.map +1 -0
- package/dist-client/pages/menu-management-detail.d.ts +2 -0
- package/dist-client/pages/menu-management-detail.js +376 -0
- package/dist-client/pages/menu-management-detail.js.map +1 -0
- package/dist-client/pages/menu-management.d.ts +3 -0
- package/dist-client/pages/menu-management.js +280 -0
- package/dist-client/pages/menu-management.js.map +1 -0
- package/dist-client/pages/role-menus-management.d.ts +4 -0
- package/dist-client/pages/role-menus-management.js +215 -0
- package/dist-client/pages/role-menus-management.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +14 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-client/viewparts/menu-bar.d.ts +12 -0
- package/dist-client/viewparts/menu-bar.js +108 -0
- package/dist-client/viewparts/menu-bar.js.map +1 -0
- package/dist-client/viewparts/menu-tile-list.d.ts +13 -0
- package/dist-client/viewparts/menu-tile-list.js +234 -0
- package/dist-client/viewparts/menu-tile-list.js.map +1 -0
- package/dist-client/viewparts/menu-tree-bar.d.ts +28 -0
- package/dist-client/viewparts/menu-tree-bar.js +307 -0
- package/dist-client/viewparts/menu-tree-bar.js.map +1 -0
- package/package.json +21 -18
- package/things-factory.config.js +5 -14
- package/client/apptools/favorite-tool.js +0 -130
- package/client/bootstrap.js +0 -57
- package/client/components/child-menus-selector.js +0 -150
- package/client/components/role-select-popup.js +0 -179
- package/client/pages/menu-list-page.js +0 -200
- package/client/pages/menu-management-detail.js +0 -384
- package/client/pages/menu-management.js +0 -294
- package/client/pages/role-menus-management.js +0 -215
- package/client/route.js +0 -15
- package/client/viewparts/menu-bar.js +0 -114
- package/client/viewparts/menu-tile-list.js +0 -222
- package/client/viewparts/menu-tree-bar.js +0 -295
- package/server/index.ts +0 -0
- /package/{client/index.js → dist-client/index.d.ts} +0 -0
- /package/{client → dist-client}/themes/menu-theme.css +0 -0
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import '@operato/oops'
|
|
3
|
-
|
|
4
|
-
import { css, html, LitElement } from 'lit'
|
|
5
|
-
|
|
6
|
-
export default class MenuTileList extends LitElement {
|
|
7
|
-
static get styles() {
|
|
8
|
-
return [
|
|
9
|
-
css`
|
|
10
|
-
:host {
|
|
11
|
-
display: block;
|
|
12
|
-
box-sizing: border-box;
|
|
13
|
-
|
|
14
|
-
position: relative;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
ul {
|
|
18
|
-
display: grid;
|
|
19
|
-
grid-template-columns: 1fr 1fr;
|
|
20
|
-
grid-auto-rows: 110px;
|
|
21
|
-
list-style: none;
|
|
22
|
-
padding: 0;
|
|
23
|
-
margin: 0;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
ul > li {
|
|
27
|
-
margin: var(--menu-tile-list-item-margin);
|
|
28
|
-
padding: 10px;
|
|
29
|
-
|
|
30
|
-
position: relative;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
md-icon {
|
|
34
|
-
cursor: pointer;
|
|
35
|
-
position: absolute;
|
|
36
|
-
right: 8px;
|
|
37
|
-
top: 8px;
|
|
38
|
-
|
|
39
|
-
color: var(--menu-tile-list-favorite-color);
|
|
40
|
-
font-size: 1em;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
md-icon[selected] {
|
|
44
|
-
color: white;
|
|
45
|
-
text-shadow: 1px 1px 1px var(--menu-tile-list-favorite-color);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
li.text a {
|
|
49
|
-
color: #fff;
|
|
50
|
-
text-decoration: none;
|
|
51
|
-
|
|
52
|
-
font-size: 1.4em;
|
|
53
|
-
line-height: 1.3;
|
|
54
|
-
word-wrap: break-word;
|
|
55
|
-
word-break: keep-all;
|
|
56
|
-
|
|
57
|
-
margin: 0px;
|
|
58
|
-
display: block;
|
|
59
|
-
width: 100%;
|
|
60
|
-
height: 100%;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
li.text:nth-child(7n + 1) {
|
|
64
|
-
background-color: #4397de;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
li.text:nth-child(7n + 2) {
|
|
68
|
-
background-color: #33b8d0;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
li.text:nth-child(7n + 3) {
|
|
72
|
-
background-color: #4ab75f;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
li.text:nth-child(7n + 4) {
|
|
76
|
-
background-color: #93796f;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
li.text:nth-child(7n + 5) {
|
|
80
|
-
background-color: #f1ac42;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
li.text:nth-child(7n + 6) {
|
|
84
|
-
background-color: #ea6361;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
li.text:nth-child(7n + 7) {
|
|
88
|
-
background-color: #7386c3;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
ox-oops-note {
|
|
92
|
-
display: block;
|
|
93
|
-
position: absolute;
|
|
94
|
-
left: 50%;
|
|
95
|
-
top: 50%;
|
|
96
|
-
transform: translate(-50%, -50%);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
ox-oops-spinner {
|
|
100
|
-
display: none;
|
|
101
|
-
position: absolute;
|
|
102
|
-
left: 50%;
|
|
103
|
-
top: 50%;
|
|
104
|
-
transform: translate(-50%, -50%);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
ox-oops-spinner[show] {
|
|
108
|
-
display: block;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
@media (min-width: 600px) {
|
|
112
|
-
ul {
|
|
113
|
-
grid-template-columns: 1fr 1fr 1fr;
|
|
114
|
-
grid-auto-rows: 120px;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
@media (min-width: 1200px) {
|
|
118
|
-
ul {
|
|
119
|
-
grid-template-columns: 1fr 1fr 1fr 1fr;
|
|
120
|
-
grid-auto-rows: 130px;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
@media (min-width: 1800px) {
|
|
124
|
-
ul {
|
|
125
|
-
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
|
126
|
-
grid-auto-rows: 140px;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
@media (min-width: 2400px) {
|
|
130
|
-
ul {
|
|
131
|
-
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
|
132
|
-
grid-auto-rows: 150px;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
`
|
|
136
|
-
]
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
static get properties() {
|
|
140
|
-
return {
|
|
141
|
-
menuId: String,
|
|
142
|
-
menus: Array,
|
|
143
|
-
routingTypes: Object,
|
|
144
|
-
favorites: Array,
|
|
145
|
-
showSpinner: Boolean
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
render() {
|
|
150
|
-
var topmenus = this.menus || []
|
|
151
|
-
var menuId = this.menuId
|
|
152
|
-
|
|
153
|
-
if (menuId !== 0 && !menuId) {
|
|
154
|
-
/* favorite menus */
|
|
155
|
-
var submenus = topmenus.reduce((allmenu, topmenu) => {
|
|
156
|
-
let menus = (topmenu && topmenu.children) || []
|
|
157
|
-
menus.forEach(menu => {
|
|
158
|
-
if (this.favorites.includes(this._getFullRouting(menu))) {
|
|
159
|
-
allmenu.push(menu)
|
|
160
|
-
}
|
|
161
|
-
})
|
|
162
|
-
return allmenu
|
|
163
|
-
}, [])
|
|
164
|
-
} else {
|
|
165
|
-
var menu = topmenus[menuId]
|
|
166
|
-
var submenus = (menu && menu.children) || []
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
return html`
|
|
170
|
-
<ul>
|
|
171
|
-
${submenus.map(subMenu => {
|
|
172
|
-
const routing = this._getFullRouting(subMenu)
|
|
173
|
-
|
|
174
|
-
return html`
|
|
175
|
-
<li
|
|
176
|
-
class="${subMenu.class} text"
|
|
177
|
-
style="grid-row: span ${subMenu.routingType.toUpperCase() === 'STATIC' ? 1 : 2}"
|
|
178
|
-
>
|
|
179
|
-
<a href=${routing}>${subMenu.name}</a>
|
|
180
|
-
|
|
181
|
-
<md-icon ?selected=${(this.favorites || []).includes(routing)}
|
|
182
|
-
>${this.favorites || [].includes(routing) ? 'star' : 'star_border'}</md-icon
|
|
183
|
-
>
|
|
184
|
-
</li>
|
|
185
|
-
`
|
|
186
|
-
})}
|
|
187
|
-
</ul>
|
|
188
|
-
|
|
189
|
-
${submenus.length == 0 && !this.showSpinner
|
|
190
|
-
? typeof menuId == 'number'
|
|
191
|
-
? html`
|
|
192
|
-
<ox-oops-note
|
|
193
|
-
icon="apps"
|
|
194
|
-
title="No Menu Found"
|
|
195
|
-
description="Seems like you are not authorised to view this menu"
|
|
196
|
-
></ox-oops-note>
|
|
197
|
-
`
|
|
198
|
-
: html`
|
|
199
|
-
<ox-oops-note
|
|
200
|
-
icon="star_border"
|
|
201
|
-
title="No Favourite Found"
|
|
202
|
-
description="Click ☆ icon to add new favourite menu"
|
|
203
|
-
></ox-oops-note>
|
|
204
|
-
`
|
|
205
|
-
: html``}
|
|
206
|
-
|
|
207
|
-
<ox-oops-spinner ?show=${this.showSpinner}></ox-oops-spinner>
|
|
208
|
-
`
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
_getFullRouting(menu) {
|
|
212
|
-
var { routingType, titleField, name, resourceUrl } = menu
|
|
213
|
-
if (routingType.toUpperCase() === 'STATIC') {
|
|
214
|
-
return resourceUrl
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
var { page } = this.routingTypes[routingType]
|
|
218
|
-
return titleField ? `${page}/${menu[titleField]}` : `${page}/${name}`
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
window.customElements.define('menu-tile-list', MenuTileList)
|
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
|
|
3
|
-
import gql from 'graphql-tag'
|
|
4
|
-
import { css, html, LitElement } from 'lit'
|
|
5
|
-
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
6
|
-
|
|
7
|
-
import { client, store } from '@things-factory/shell'
|
|
8
|
-
import { ScrollbarStyles } from '@operato/styles'
|
|
9
|
-
|
|
10
|
-
export default class MenuTreeBar extends connect(store)(LitElement) {
|
|
11
|
-
static get styles() {
|
|
12
|
-
return [
|
|
13
|
-
ScrollbarStyles,
|
|
14
|
-
css`
|
|
15
|
-
:host {
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
min-width: 200px;
|
|
19
|
-
}
|
|
20
|
-
[domain] {
|
|
21
|
-
background: var(--menu-domain-background-color);
|
|
22
|
-
background: linear-gradient(180deg, var(--md-sys-color-secondary) 0%, var(--md-sys-color-primary) 120%);
|
|
23
|
-
padding: var(--menu-domain-padding);
|
|
24
|
-
border-bottom: 1px solid var(--md-sys-color-primary);
|
|
25
|
-
}
|
|
26
|
-
[domain] md-icon {
|
|
27
|
-
margin-right: -8px;
|
|
28
|
-
font-size: 12px;
|
|
29
|
-
color: var(--menu-domain-icon-color);
|
|
30
|
-
}
|
|
31
|
-
[domain] * {
|
|
32
|
-
vertical-align: middle;
|
|
33
|
-
}
|
|
34
|
-
[domain] span {
|
|
35
|
-
padding-left: 7px;
|
|
36
|
-
font: var(--menu-domain-font);
|
|
37
|
-
color: var(--menu-domain-color);
|
|
38
|
-
}
|
|
39
|
-
[domain] select {
|
|
40
|
-
background-color: transparent;
|
|
41
|
-
width: -webkit-fill-available;
|
|
42
|
-
max-width: 175px;
|
|
43
|
-
border: none;
|
|
44
|
-
|
|
45
|
-
font: var(--menu-domain-font);
|
|
46
|
-
color: var(--menu-domain-color);
|
|
47
|
-
}
|
|
48
|
-
select:focus {
|
|
49
|
-
outline: 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
ul {
|
|
53
|
-
list-style: none;
|
|
54
|
-
margin: 0;
|
|
55
|
-
padding: 0;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
ul[toplevel] {
|
|
59
|
-
overflow: auto;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
li {
|
|
63
|
-
border-bottom: var(--menu-tree-toplevel-border-bottom);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
[grouplevel] li {
|
|
67
|
-
border-bottom: var(--menu-tree-grouplevel-border-bottom);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
li span,
|
|
71
|
-
li a {
|
|
72
|
-
display: block;
|
|
73
|
-
text-decoration: none;
|
|
74
|
-
position: relative;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
[menutype] {
|
|
78
|
-
position: absolute;
|
|
79
|
-
font-size: 1.2em;
|
|
80
|
-
right: 0;
|
|
81
|
-
bottom: 50%;
|
|
82
|
-
transform: translate(-5px, 50%);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
[favorite] {
|
|
86
|
-
color: var(--menu-tree-favorite-color, tomato);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
[groupmenu] > span {
|
|
90
|
-
padding: 9px 9px 7px 10px;
|
|
91
|
-
font: var(--menu-tree-toplevel-font);
|
|
92
|
-
color: var(--menu-tree-toplevel-color);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
a {
|
|
96
|
-
background-color: rgba(0, 0, 0, 0.4);
|
|
97
|
-
padding: 7px 7px 6px 15px;
|
|
98
|
-
font: var(--menu-tree-grouplevel-font);
|
|
99
|
-
color: var(--menu-tree-grouplevel-color);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
[groupmenu] > span::before {
|
|
103
|
-
content: '';
|
|
104
|
-
display: inline-block;
|
|
105
|
-
width: var(--menu-tree-toplevel-icon-size);
|
|
106
|
-
height: var(--menu-tree-toplevel-icon-size);
|
|
107
|
-
border: var(--menu-tree-toplevel-icon-border);
|
|
108
|
-
border-radius: 50%;
|
|
109
|
-
margin-right: 5px;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
a span::before {
|
|
113
|
-
content: '-';
|
|
114
|
-
margin-right: 4px;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
[expanded] > span {
|
|
118
|
-
font-weight: bold;
|
|
119
|
-
color: var(--menu-tree-focus-color);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
[grouplevel] {
|
|
123
|
-
overflow-y: hidden;
|
|
124
|
-
max-height: 0;
|
|
125
|
-
|
|
126
|
-
transition-property: all;
|
|
127
|
-
transition-duration: 0.7s;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
[expanded] > [grouplevel] {
|
|
131
|
-
overflow-y: auto;
|
|
132
|
-
max-height: 500px;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
li[active] a {
|
|
136
|
-
color: var(--menu-tree-focus-color);
|
|
137
|
-
font-weight: bold;
|
|
138
|
-
border-left: var(--menu-tree-grouplevel-active-border-left);
|
|
139
|
-
background-color: rgba(0, 0, 0, 0.6);
|
|
140
|
-
padding-left: 12px;
|
|
141
|
-
}
|
|
142
|
-
`
|
|
143
|
-
]
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
static get properties() {
|
|
147
|
-
return {
|
|
148
|
-
menuId: String,
|
|
149
|
-
menus: Array,
|
|
150
|
-
favorites: Array,
|
|
151
|
-
routingTypes: Object,
|
|
152
|
-
page: Object,
|
|
153
|
-
user: Object,
|
|
154
|
-
contextPath: String,
|
|
155
|
-
domains: Array,
|
|
156
|
-
domain: Object
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
render() {
|
|
161
|
-
var domains = this.domains || []
|
|
162
|
-
var domain = this.domain || {}
|
|
163
|
-
const currentRouting = decodeURIComponent(
|
|
164
|
-
location.pathname.substr(this.contextPath ? this.contextPath.length + 1 : 1)
|
|
165
|
-
)
|
|
166
|
-
|
|
167
|
-
return html`
|
|
168
|
-
<div domain>
|
|
169
|
-
<md-icon>beenhere</md-icon>
|
|
170
|
-
${domains.length <= 1
|
|
171
|
-
? html` <span>${domain.name}</span> `
|
|
172
|
-
: html`
|
|
173
|
-
<select
|
|
174
|
-
.value=${domain.subdomain}
|
|
175
|
-
@change=${e => (window.location.pathname = `/auth/checkin/${e.target.value}`)}
|
|
176
|
-
>
|
|
177
|
-
${domains.map(
|
|
178
|
-
d => html`
|
|
179
|
-
<option .value=${d.subdomain} ?selected=${d.subdomain == domain.subdomain}>${d.name}</option>
|
|
180
|
-
`
|
|
181
|
-
)}
|
|
182
|
-
</select>
|
|
183
|
-
`}
|
|
184
|
-
</div>
|
|
185
|
-
|
|
186
|
-
<ul toplevel>
|
|
187
|
-
${(this.menus || []).map(
|
|
188
|
-
menu => html`
|
|
189
|
-
<li groupmenu>
|
|
190
|
-
<span
|
|
191
|
-
@click=${e => {
|
|
192
|
-
e.target.parentElement.toggleAttribute('expanded')
|
|
193
|
-
this.renderRoot
|
|
194
|
-
.querySelectorAll('[expanded]')
|
|
195
|
-
.forEach(element => element !== e.target.parentElement && element.removeAttribute('expanded'))
|
|
196
|
-
}}
|
|
197
|
-
>${menu.name}</span
|
|
198
|
-
>
|
|
199
|
-
|
|
200
|
-
<ul grouplevel>
|
|
201
|
-
${menu.children.map(subMenu => {
|
|
202
|
-
const routing = this._getFullRouting(subMenu)
|
|
203
|
-
const favorite = this.favorites.includes(routing)
|
|
204
|
-
const { icon } = this.routingTypes[subMenu.routingType] || {}
|
|
205
|
-
const typeIcon = icon ? icon : favorite ? 'star' : null
|
|
206
|
-
|
|
207
|
-
return html`
|
|
208
|
-
<li ?active=${routing === currentRouting}>
|
|
209
|
-
<a href=${routing}>
|
|
210
|
-
<span>${subMenu.name}</span>
|
|
211
|
-
${typeIcon ? html` <md-icon menutype ?favorite=${favorite}>${typeIcon}</md-icon> ` : html``}</a
|
|
212
|
-
>
|
|
213
|
-
</li>
|
|
214
|
-
`
|
|
215
|
-
})}
|
|
216
|
-
</ul>
|
|
217
|
-
</li>
|
|
218
|
-
`
|
|
219
|
-
)}
|
|
220
|
-
</ul>
|
|
221
|
-
`
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
async updated(changes) {
|
|
225
|
-
if (changes.has('user')) {
|
|
226
|
-
this.menus = await this.getMenus()
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
await this.updateComplete
|
|
230
|
-
|
|
231
|
-
var active = this.shadowRoot.querySelector('[active]')
|
|
232
|
-
if (active) {
|
|
233
|
-
active.parentElement.parentElement.setAttribute('expanded', '')
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
stateChanged(state) {
|
|
238
|
-
this.contextPath = state.app.contextPath
|
|
239
|
-
this.routingTypes = state.menu.routingTypes
|
|
240
|
-
this.menuId = state.route.resourceId
|
|
241
|
-
this.page = state.route.page
|
|
242
|
-
this.user = state.auth.user
|
|
243
|
-
this.domains = state.app.domains
|
|
244
|
-
this.domain = state.app.domain
|
|
245
|
-
this.getMenus =
|
|
246
|
-
state.menu.provider && typeof state.menu.provider === 'function' ? state.menu.provider : this.getMenus
|
|
247
|
-
this.favorites = state.favorite.favorites
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
_getFullRouting(menu) {
|
|
251
|
-
var { routingType, resourceUrl, titleField, name, resourceType, resourceId } = menu
|
|
252
|
-
if (routingType.toUpperCase() === 'STATIC') {
|
|
253
|
-
if (resourceType?.toUpperCase() === 'BOARD') {
|
|
254
|
-
return `${resourceUrl || 'board-viewer'}/${resourceId}?title=${name}`
|
|
255
|
-
}
|
|
256
|
-
return resourceUrl
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
var { page } = this.routingTypes[routingType]
|
|
260
|
-
return titleField ? `${page}/${menu[titleField]}` : `${page}/${name}`
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
_onClickRefresh(e) {
|
|
264
|
-
this.dispatchEvent(new CustomEvent('refresh'))
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
async getMenus() {
|
|
268
|
-
const response = await client.query({
|
|
269
|
-
query: gql`
|
|
270
|
-
query {
|
|
271
|
-
userMenus {
|
|
272
|
-
id
|
|
273
|
-
name
|
|
274
|
-
children {
|
|
275
|
-
id
|
|
276
|
-
name
|
|
277
|
-
routingType
|
|
278
|
-
idField
|
|
279
|
-
titleField
|
|
280
|
-
resourceType
|
|
281
|
-
resourceId
|
|
282
|
-
resourceName
|
|
283
|
-
resourceUrl
|
|
284
|
-
template
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
`
|
|
289
|
-
})
|
|
290
|
-
|
|
291
|
-
return response.data.userMenus
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
window.customElements.define('menu-tree-bar', MenuTreeBar)
|
package/server/index.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|