@things-factory/code-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.
@@ -11,7 +11,7 @@ import { client, gqlContext, buildArgs } from '@operato/graphql'
11
11
  import { CommonGristStyles, ScrollbarStyles } from '@operato/styles'
12
12
  import { isMobileDevice } from '@operato/utils'
13
13
 
14
- import { CustomAlert } from '@things-factory/shell'
14
+ import { OxPrompt } from '@operato/popup/ox-prompt.js'
15
15
 
16
16
  export class CodeManagementDetail extends localize(i18next)(LitElement) {
17
17
  static get styles() {
@@ -99,7 +99,7 @@ export class CodeManagementDetail extends localize(i18next)(LitElement) {
99
99
  async firstUpdated() {
100
100
  this.config = {
101
101
  rows: { selectable: { multiple: true } },
102
- pagination: { pages : [100, 200, 500] },
102
+ pagination: { pages: [100, 200, 500] },
103
103
  columns: [
104
104
  { type: 'gutter', gutterName: 'dirty' },
105
105
  { type: 'gutter', gutterName: 'sequence' },
@@ -224,33 +224,34 @@ export class CodeManagementDetail extends localize(i18next)(LitElement) {
224
224
  return this.showToast(i18next.t('text.there_is_nothing_to_delete'))
225
225
  }
226
226
 
227
- const anwer = await CustomAlert({
228
- type: 'warning',
229
- title: i18next.t('button.delete'),
230
- text: i18next.t('text.are_you_sure'),
231
- confirmButton: { text: i18next.t('button.delete') },
232
- cancelButton: { text: i18next.t('button.cancel') }
233
- })
227
+ if (
228
+ await OxPrompt.open({
229
+ type: 'warning',
230
+ title: i18next.t('button.delete'),
231
+ text: i18next.t('text.are_you_sure'),
232
+ confirmButton: { text: i18next.t('button.delete') },
233
+ cancelButton: { text: i18next.t('button.cancel') }
234
+ })
235
+ ) {
236
+ const response = await client.query({
237
+ query: gql`
238
+ mutation {
239
+ deleteCommonCodeDetails(${buildArgs({ ids })})
240
+ }
241
+ `,
242
+ context: gqlContext()
243
+ })
234
244
 
235
- if (!anwer.value) return
245
+ if (!response.errors) {
246
+ OxPrompt.open({
247
+ type: 'success',
248
+ title: i18next.t('text.completed'),
249
+ text: i18next.t('text.data_deleted_successfully'),
250
+ confirmButton: { text: i18next.t('button.confirm') }
251
+ })
236
252
 
237
- const response = await client.query({
238
- query: gql`
239
- mutation {
240
- deleteCommonCodeDetails(${buildArgs({ ids })})
241
- }
242
- `,
243
- context: gqlContext()
244
- })
245
-
246
- if (!response.errors) {
247
- CustomAlert({
248
- type: 'success',
249
- title: i18next.t('text.completed'),
250
- text: i18next.t('text.data_deleted_successfully'),
251
- confirmButton: { text: i18next.t('button.confirm') }
252
- })
253
- this.dataGrist.fetch()
253
+ this.dataGrist.fetch()
254
+ }
254
255
  }
255
256
  }
256
257
 
@@ -14,7 +14,7 @@ import { PageView } from '@operato/shell'
14
14
  import { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'
15
15
  import { isMobileDevice } from '@operato/utils'
16
16
 
17
- import { CustomAlert } from '@things-factory/shell'
17
+ import { OxPrompt } from '@operato/popup/ox-prompt.js'
18
18
 
19
19
  class CodeManagement extends localize(i18next)(PageView) {
20
20
  static get properties() {
@@ -113,7 +113,7 @@ class CodeManagement extends localize(i18next)(PageView) {
113
113
  pageInitialized() {
114
114
  this.config = {
115
115
  rows: { selectable: { multiple: true } },
116
- pagination: { pages : [50, 100, 200] },
116
+ pagination: { pages: [50, 100, 200] },
117
117
  columns: [
118
118
  { type: 'gutter', gutterName: 'dirty' },
119
119
  { type: 'gutter', gutterName: 'sequence' },
@@ -230,33 +230,34 @@ class CodeManagement extends localize(i18next)(PageView) {
230
230
  return this.showToast(i18next.t('text.there_is_nothing_to_delete'))
231
231
  }
232
232
 
233
- const anwer = await CustomAlert({
234
- type: 'warning',
235
- title: i18next.t('button.delete'),
236
- text: i18next.t('text.are_you_sure'),
237
- confirmButton: { text: i18next.t('button.delete') },
238
- cancelButton: { text: i18next.t('button.cancel') }
239
- })
240
-
241
- if (!anwer.value) return
233
+ if (
234
+ await OxPrompt.open({
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
+ const response = await client.query({
243
+ query: gql`
244
+ mutation {
245
+ deleteCommonCodes(${buildArgs({ ids })})
246
+ }
247
+ `,
248
+ context: gqlContext()
249
+ })
242
250
 
243
- const response = await client.query({
244
- query: gql`
245
- mutation {
246
- deleteCommonCodes(${buildArgs({ ids })})
247
- }
248
- `,
249
- context: gqlContext()
250
- })
251
+ if (!response.errors) {
252
+ OxPrompt.open({
253
+ type: 'success',
254
+ title: i18next.t('text.completed'),
255
+ text: i18next.t('text.data_deleted_successfully'),
256
+ confirmButton: { text: i18next.t('button.confirm') }
257
+ })
251
258
 
252
- if (!response.errors) {
253
- CustomAlert({
254
- type: 'success',
255
- title: i18next.t('text.completed'),
256
- text: i18next.t('text.data_deleted_successfully'),
257
- confirmButton: { text: i18next.t('button.confirm') }
258
- })
259
- this.dataGrist.fetch()
259
+ this.dataGrist.fetch()
260
+ }
260
261
  }
261
262
  }
262
263
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/code-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,
@@ -30,10 +30,10 @@
30
30
  "@operato/layout": "^1.0.1",
31
31
  "@operato/shell": "^1.0.23",
32
32
  "@operato/styles": "^1.0.23",
33
- "@things-factory/code-base": "^6.2.6",
33
+ "@things-factory/code-base": "^6.2.9",
34
34
  "@things-factory/form-ui": "^6.2.0",
35
35
  "@things-factory/i18n-base": "^6.2.6",
36
36
  "@things-factory/shell": "^6.2.6"
37
37
  },
38
- "gitHead": "d8a4f36c559797233b24fa20097bfb2d081229e8"
38
+ "gitHead": "693195e55200a1160edb9837ea5498b746f82577"
39
39
  }