@things-factory/menu-ui 6.2.6 → 6.2.9

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, CustomAlert } from '@things-factory/shell'
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
- CustomAlert({
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
- const answer = await CustomAlert({
312
- type: 'warning',
313
- title: i18next.t('button.delete'),
314
- text: i18next.t('text.are_you_sure'),
315
- confirmButton: { text: i18next.t('button.delete') },
316
- cancelButton: { text: i18next.t('button.cancel') }
317
- })
318
-
319
- if (!answer.value) return
320
-
321
- const response = await client.query({
322
- query: gql`
323
- mutation {
324
- deleteMenus(${gqlBuilder.buildArgs({ ids })})
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
- if (!response.errors) this.dataGrist.fetch()
330
+ if (!response.errors) {
331
+ this.dataGrist.fetch()
332
+ }
333
+ }
330
334
  } else {
331
- CustomAlert({
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, CustomAlert, PageView } from '@things-factory/shell'
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
- CustomAlert({
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
- const anwer = await CustomAlert({
235
- type: 'warning',
236
- title: i18next.t('button.delete'),
237
- text: i18next.t('text.are_you_sure'),
238
- confirmButton: { text: i18next.t('button.delete') },
239
- cancelButton: { text: i18next.t('button.cancel') }
240
- })
241
-
242
- if (!anwer.value) return
243
-
244
- const response = await client.query({
245
- query: gql`
246
- mutation {
247
- deleteMenus(${gqlBuilder.buildArgs({ ids })})
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
- if (!response.errors) this.dataGrist.fetch()
253
+ if (!response.errors) {
254
+ this.dataGrist.fetch()
255
+ }
256
+ }
253
257
  } else {
254
- CustomAlert({
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.6",
3
+ "version": "6.2.9",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -29,10 +29,10 @@
29
29
  "@operato/layout": "^1.0.1",
30
30
  "@things-factory/apptool-base": "^6.2.6",
31
31
  "@things-factory/component-ui": "^6.2.0",
32
- "@things-factory/fav-base": "^6.2.6",
32
+ "@things-factory/fav-base": "^6.2.9",
33
33
  "@things-factory/form-ui": "^6.2.0",
34
34
  "@things-factory/i18n-base": "^6.2.6",
35
- "@things-factory/menu-base": "^6.2.6"
35
+ "@things-factory/menu-base": "^6.2.9"
36
36
  },
37
- "gitHead": "d8a4f36c559797233b24fa20097bfb2d081229e8"
37
+ "gitHead": "693195e55200a1160edb9837ea5498b746f82577"
38
38
  }