@things-factory/menu-ui 6.2.6 → 6.2.8
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.
|
@@ -6,10 +6,12 @@ import { css, html, LitElement } from 'lit'
|
|
|
6
6
|
|
|
7
7
|
import { getEditor, getRenderer } from '@operato/data-grist'
|
|
8
8
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
9
|
-
import { client
|
|
9
|
+
import { client } from '@things-factory/shell'
|
|
10
10
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
11
11
|
import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
|
|
12
12
|
|
|
13
|
+
import { OxPrompt } from '@operato/popup/ox-prompt.js'
|
|
14
|
+
|
|
13
15
|
class MenuManagementDetail extends localize(i18next)(LitElement) {
|
|
14
16
|
static get styles() {
|
|
15
17
|
return [
|
|
@@ -298,7 +300,7 @@ class MenuManagementDetail extends localize(i18next)(LitElement) {
|
|
|
298
300
|
|
|
299
301
|
if (!response.errors) this.dataGrist.fetch()
|
|
300
302
|
} else {
|
|
301
|
-
|
|
303
|
+
OxPrompt.open({
|
|
302
304
|
title: i18next.t('text.nothing_changed'),
|
|
303
305
|
text: i18next.t('text.there_is_nothing_to_save')
|
|
304
306
|
})
|
|
@@ -308,27 +310,29 @@ class MenuManagementDetail extends localize(i18next)(LitElement) {
|
|
|
308
310
|
async delete() {
|
|
309
311
|
const ids = this.dataGrist.selected.map(record => record.id)
|
|
310
312
|
if (ids && ids.length > 0) {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
})
|
|
313
|
+
if (
|
|
314
|
+
await OxPrompt.open({
|
|
315
|
+
type: 'warning',
|
|
316
|
+
title: i18next.t('button.delete'),
|
|
317
|
+
text: i18next.t('text.are_you_sure'),
|
|
318
|
+
confirmButton: { text: i18next.t('button.delete') },
|
|
319
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
320
|
+
})
|
|
321
|
+
) {
|
|
322
|
+
const response = await client.query({
|
|
323
|
+
query: gql`
|
|
324
|
+
mutation {
|
|
325
|
+
deleteMenus(${gqlBuilder.buildArgs({ ids })})
|
|
326
|
+
}
|
|
327
|
+
`
|
|
328
|
+
})
|
|
328
329
|
|
|
329
|
-
|
|
330
|
+
if (!response.errors) {
|
|
331
|
+
this.dataGrist.fetch()
|
|
332
|
+
}
|
|
333
|
+
}
|
|
330
334
|
} else {
|
|
331
|
-
|
|
335
|
+
OxPrompt.open({
|
|
332
336
|
title: i18next.t('text.nothing_selected'),
|
|
333
337
|
text: i18next.t('text.there_is_nothing_to_delete')
|
|
334
338
|
})
|
|
@@ -7,10 +7,12 @@ import { css, html } from 'lit'
|
|
|
7
7
|
|
|
8
8
|
import { openPopup } from '@operato/layout'
|
|
9
9
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
10
|
-
import { client,
|
|
10
|
+
import { client, PageView } from '@things-factory/shell'
|
|
11
11
|
import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
|
|
12
12
|
import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
|
|
13
13
|
|
|
14
|
+
import { OxPrompt } from '@operato/popup/ox-prompt.js'
|
|
15
|
+
|
|
14
16
|
class MenuManagement extends localize(i18next)(PageView) {
|
|
15
17
|
static get properties() {
|
|
16
18
|
return {
|
|
@@ -221,7 +223,7 @@ class MenuManagement extends localize(i18next)(PageView) {
|
|
|
221
223
|
|
|
222
224
|
if (!response.errors) this.dataGrist.fetch()
|
|
223
225
|
} else {
|
|
224
|
-
|
|
226
|
+
OxPrompt.open({
|
|
225
227
|
title: i18next.t('text.nothing_changed'),
|
|
226
228
|
text: i18next.t('text.there_is_nothing_to_save')
|
|
227
229
|
})
|
|
@@ -231,27 +233,29 @@ class MenuManagement extends localize(i18next)(PageView) {
|
|
|
231
233
|
async delete() {
|
|
232
234
|
const ids = this.dataGrist.selected.map(record => record.id)
|
|
233
235
|
if (ids && ids.length > 0) {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
})
|
|
236
|
+
if (
|
|
237
|
+
await OxPrompt.open({
|
|
238
|
+
type: 'warning',
|
|
239
|
+
title: i18next.t('button.delete'),
|
|
240
|
+
text: i18next.t('text.are_you_sure'),
|
|
241
|
+
confirmButton: { text: i18next.t('button.delete') },
|
|
242
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
243
|
+
})
|
|
244
|
+
) {
|
|
245
|
+
const response = await client.query({
|
|
246
|
+
query: gql`
|
|
247
|
+
mutation {
|
|
248
|
+
deleteMenus(${gqlBuilder.buildArgs({ ids })})
|
|
249
|
+
}
|
|
250
|
+
`
|
|
251
|
+
})
|
|
251
252
|
|
|
252
|
-
|
|
253
|
+
if (!response.errors) {
|
|
254
|
+
this.dataGrist.fetch()
|
|
255
|
+
}
|
|
256
|
+
}
|
|
253
257
|
} else {
|
|
254
|
-
|
|
258
|
+
OxPrompt.open({
|
|
255
259
|
title: i18next.t('text.nothing_selected'),
|
|
256
260
|
text: i18next.t('text.there_is_nothing_to_delete')
|
|
257
261
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/menu-ui",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.8",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"@things-factory/i18n-base": "^6.2.6",
|
|
35
35
|
"@things-factory/menu-base": "^6.2.6"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "1687e2d45b0451ade0aeb1043f0fe107d097426e"
|
|
38
38
|
}
|