quasar-factory-lib 0.0.59 → 0.0.60

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/package.json CHANGED
@@ -97,6 +97,6 @@
97
97
  "release": "standard-version"
98
98
  },
99
99
  "type": "module",
100
- "version": "0.0.59",
100
+ "version": "0.0.60",
101
101
  "author": ""
102
102
  }
@@ -0,0 +1,137 @@
1
+ <template>
2
+ <div>
3
+ <q-dialog
4
+ v-model="alert"
5
+ persistent
6
+ transition-show="slide-up"
7
+ transition-hide="slide-down"
8
+ >
9
+ <q-card style="width: 100%; max-width: 560px; min-width: 250px;" data-cy="errors-details">
10
+ <q-bar>
11
+ <q-space />
12
+ <q-btn dense flat icon="close" @click="onCloseDialogLabelsError" data-cy="close-error-details">
13
+ </q-btn>
14
+ </q-bar>
15
+ <q-card-section class="q-pt-md">
16
+ <q-list bordered style="width: 100%">
17
+ <q-item
18
+ class="border-bottom-darkGrey"
19
+ v-for="(item, i) in labelsErrors"
20
+ :key="i"
21
+ v-bind="item"
22
+ >
23
+ <q-item-section top>
24
+ <q-item-label>
25
+ <span class="text-grey-8">
26
+ <span
27
+ class="text-weight-medium q-pr-xs text-color-almostBlack"
28
+ >{{ item.label }}</span
29
+ >
30
+ <q-icon
31
+ v-show="!item.spinner"
32
+ :color="
33
+ item.icon === 'check_circle'
34
+ ? 'green'
35
+ : 'red'
36
+ "
37
+ size="xs"
38
+ :name="item.icon" />
39
+ <q-spinner-oval data-cy="spinner"
40
+ v-show="item.spinner"
41
+ color="blue"
42
+ size="sm"
43
+ /></span>
44
+ </q-item-label>
45
+ <q-item-label
46
+ class="q-pt-sm "
47
+ v-show="item.icon === 'cancel'"
48
+ caption
49
+ >
50
+ {{ item.error }}
51
+ </q-item-label>
52
+ <q-item-label
53
+ class="q-pt-sm q-mt-x"
54
+ v-show="item.icon === 'cancel'"
55
+ >
56
+ <span class="float-left">
57
+ <q-btn
58
+ flat
59
+ size="sm"
60
+ class="text-blue"
61
+ data-cy="retry"
62
+ @click="retryReadLabelAxios(item.label)"
63
+ >
64
+ {{ $t("global.retry") }}
65
+ </q-btn>
66
+ </span>
67
+
68
+ <span class="float-right">
69
+ <q-btn
70
+ flat
71
+ round
72
+ size="sm"
73
+ color="secondary"
74
+ icon="delete"
75
+ data-cy="deleteLabelFromErrorsList"
76
+ @click="deleteLabelFromErrorMessage(i)"
77
+ />
78
+ </span>
79
+ </q-item-label>
80
+ </q-item-section>
81
+
82
+ <q-separator />
83
+ </q-item>
84
+ </q-list>
85
+ </q-card-section>
86
+ </q-card>
87
+ </q-dialog>
88
+ </div>
89
+ </template>
90
+
91
+ <style>
92
+ </style>
93
+
94
+ <script lang="ts">
95
+ import { defineComponent } from 'vue'
96
+
97
+ export default defineComponent({
98
+ name: 'AlertWithLabelsError',
99
+ data () {
100
+ return {
101
+ alert: false,
102
+ labelsErrors: []
103
+ }
104
+ },
105
+ emit: ['retryReadLabelAxios', 'onCloseDialogLabelsError'],
106
+ methods: {
107
+ deleteLabelFromErrorMessage (index: number): void {
108
+ this.labelsErrors.splice(index, 1)
109
+ if (this.labelsErrors.length === 0) {
110
+ this.onCloseDialogLabelsError()
111
+ }
112
+ },
113
+ retryReadLabelAxios (label: string): void {
114
+ this.$emit('retryReadLabelAxios', label)
115
+ },
116
+ onCloseDialogLabelsError (): void {
117
+ this.alert = false
118
+ this.labelsErrors = []
119
+ this.$emit('onCloseDialogLabelsError')
120
+ },
121
+ setLabelsSpinner (labelCode: string, value: boolean): void {
122
+ for (let i = 0; i < this.labelsErrors.length; i++) {
123
+ if (this.labelsErrors[i].label === labelCode) {
124
+ this.labelsErrors[i].spinner = value
125
+ }
126
+ }
127
+ },
128
+ setIconCircleCheck (labelCode: string): void {
129
+ for (let i = 0; i < this.labelsErrors.length; i++) {
130
+ if (this.labelsErrors[i].label === labelCode) {
131
+ this.labelsErrors[i].icon = 'check_circle'
132
+ }
133
+ }
134
+ }
135
+ }
136
+ })
137
+ </script>
@@ -0,0 +1,18 @@
1
+ import type { App, Plugin } from 'vue'
2
+
3
+ import AlertWithLabelsError from './AlertWithLabelsError.vue'
4
+
5
+ import { registerComponent } from '@/utils/plugins'
6
+
7
+ /** export button specific types */
8
+ // export type * from './types'
9
+
10
+ /** export button plugin */
11
+ export default {
12
+ install (app: App) {
13
+ registerComponent(app, 'AlertWithLabelsError', AlertWithLabelsError)
14
+ }
15
+ } as Plugin
16
+
17
+ /** export button components */
18
+ export { AlertWithLabelsError as AlertWithLabelsError }
@@ -4,4 +4,5 @@ export * from './Confirm'
4
4
  export * from './TaskNavBar'
5
5
  export * from './ConfirmedTask'
6
6
  export * from './TableRowsCounter'
7
- export * from './NavBarSkeleton'
7
+ export * from './NavBarSkeleton'
8
+ export * from './AlertWithLabelsError'
@@ -5,5 +5,6 @@ import TaskNavBar from './TaskNavBar'
5
5
  import ConfirmedTask from './ConfirmedTask'
6
6
  import TableRowsCounter from './TableRowsCounter'
7
7
  import NavBarSkeleton from './NavBarSkeleton'
8
- export { MyTable, AlertDialog, ConfirmDialog, TaskNavBar, ConfirmedTask, TableRowsCounter, NavBarSkeleton }
8
+ import AlertWithLabelsError from './AlertWithLabelsError'
9
+ export { MyTable, AlertDialog, ConfirmDialog, TaskNavBar, ConfirmedTask, TableRowsCounter, NavBarSkeleton, AlertWithLabelsError }
9
10
 
package/src/css/app.css CHANGED
@@ -59,5 +59,9 @@
59
59
  font-size: 30px;
60
60
  }
61
61
 
62
+ .border-bottom-darkGrey{
63
+ border-bottom: 0.7px solid var(--dark-gray);
64
+ }
65
+
62
66
  /* const labelTextColor = 'color: #597765 !important;'
63
67
  const labelTextColorBold = 'color: #597765 !important; font-weight: bold;' */
@@ -23,7 +23,8 @@ const en = {
23
23
  hello: 'Hello'
24
24
  },
25
25
  global: {
26
- total: 'Total'
26
+ total: 'Total',
27
+ retry: 'Retray'
27
28
  },
28
29
  taskConfirmed: {
29
30
  repeatTask: 'Do you want to continue the task?',
@@ -23,7 +23,8 @@ const es = {
23
23
  hello: 'Hola'
24
24
  },
25
25
  global: {
26
- total: 'Total'
26
+ total: 'Total',
27
+ retry: 'Reintentar'
27
28
  },
28
29
  taskConfirmed: {
29
30
  repeatTask: '¿Quieres continuar la tarea?',
package/src/index.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import '@quasar/extras/material-icons/material-icons.css'
2
2
  import { Quasar } from 'quasar'
3
3
  import { App, Plugin } from 'vue'
4
- import { MyTable, AlertDialog, ConfirmDialog, TaskNavBar, ConfirmedTask, TableRowsCounter, NavBarSkeleton} from './components/plugins.ts'
4
+ import { MyTable, AlertDialog, ConfirmDialog, TaskNavBar, ConfirmedTask, TableRowsCounter, NavBarSkeleton, AlertWithLabelsError} from './components/plugins.ts'
5
5
  import { registerPlugin, setVueInstance } from './utils/plugins.ts'
6
6
  import TranslateKeys from './i18n/translateKeys.ts'
7
7
  import { createPinia } from 'pinia'
8
- export { MyTable, AlertDialog, ConfirmDialog, TaskNavBar, ConfirmedTask, TableRowsCounter, NavBarSkeleton } from './components/index.ts'
8
+ export { MyTable, AlertDialog, ConfirmDialog, TaskNavBar, ConfirmedTask, TableRowsCounter, NavBarSkeleton, AlertWithLabelsError } from './components/index.ts'
9
9
 
10
10
  export type { TranslateKeys }
11
11
  // import plugins from "./components/plugins";
@@ -28,6 +28,7 @@ const plugin: Plugin = {
28
28
  registerPlugin(app, ConfirmedTask)
29
29
  registerPlugin(app, TableRowsCounter)
30
30
  registerPlugin(app, NavBarSkeleton)
31
+ registerPlugin(app, AlertWithLabelsError)
31
32
  app.use(i18n)
32
33
  app.use(pinia)
33
34
  i18n.global.locale = 'en'
@@ -4,6 +4,7 @@
4
4
  view="hHh lpR fFf"
5
5
  >
6
6
  <q-header
7
+ v-if="!showSkeleton"
7
8
  class="bg-light-peach text-black"
8
9
  >
9
10
  <div class="header-container text-black">
@@ -23,6 +24,15 @@
23
24
  ]"/>
24
25
  </div>
25
26
  </q-header>
27
+ <NavBarSkeleton
28
+ v-if="showSkeleton"
29
+ :small-device="smallDevice"
30
+ />
31
+ <AlertLabelsWithError
32
+ ref="AlertLabelsWithError"
33
+ @retry-read-label-axios="retryReadLabel"
34
+ @on-close-dialog-labels-error="onCloseDialogLabelsError"
35
+ />
26
36
  <q-page-container>
27
37
  <q-page>
28
38
  <Table
@@ -50,11 +60,11 @@
50
60
  <q-btn class="full-width" color="accent" icon="arrow_forward" />
51
61
  </q-page-sticky>
52
62
  </q-page>
53
- <SideBar
63
+ <!-- <SideBar
54
64
  ref="sideBar"
55
65
  @toggle-right-drawer="toggleRightDrawer"
56
66
  @onclick-show-select-visible-columns="toogleColumnsSelectorVisibility"
57
- :buttonsList="buttonsList" />
67
+ :buttonsList="buttonsList" /> -->
58
68
  </q-page-container>
59
69
  </q-layout>
60
70
  </div>
@@ -64,17 +74,21 @@
64
74
  <script lang="ts">
65
75
  import TaskNavBar from '../components/TaskNavBar/TaskNavBar.vue'
66
76
  import Table from '../components/Table/Table.vue'
67
- import SideBar from '../components/TaskNavBar/SideBar.vue'
77
+ // import SideBar from '../components/TaskNavBar/SideBar.vue'
78
+ import NavBarSkeleton from '../components/NavBarSkeleton/NavBarSkeleton.vue'
68
79
  import TableRowsCounter from'../components/TableRowsCounter/TableRowsCounter.vue'
80
+ import AlertLabelsWithError from '../components/AlertWithLabelsError/AlertWithLabelsError.vue'
69
81
  import setTableHeight from '../components/Table/utils/setTableHeight'
70
82
  import infiniteScroll from '../components/Table/utils/infiniteScroll'
71
83
  import { tableStore } from '../store/table.js'
72
84
  export default {
73
85
  components: {
74
86
  TaskNavBar,
75
- SideBar,
87
+ // SideBar,
76
88
  Table,
77
- TableRowsCounter
89
+ TableRowsCounter,
90
+ AlertLabelsWithError,
91
+ NavBarSkeleton
78
92
  },
79
93
  data () {
80
94
  return {
@@ -363,6 +377,19 @@ export default {
363
377
  this.showSkeleton = true
364
378
  this.store.cleanTableFilter()
365
379
  this.getRows()
380
+ this.$refs.AlertLabelsWithError.alert = true
381
+ this.$refs.AlertLabelsWithError.labelsErrors.push({
382
+ label: '558877',
383
+ error: 'The Bin does not exist. Identification fields and values',
384
+ icon: 'cancel',
385
+ spinner: false
386
+ },
387
+ {
388
+ label: '558871',
389
+ error: 'The Bin does not exist. Identification fields and values',
390
+ icon: 'cancel',
391
+ spinner: false
392
+ })
366
393
  },
367
394
  methods: {
368
395
  getRows () {
@@ -393,6 +420,17 @@ export default {
393
420
  },
394
421
  onClickBtnMenu () {
395
422
  this.toggleRightDrawer()
423
+ },
424
+ retryReadLabel () {
425
+ console.log('retryReadLabel')
426
+ },
427
+ onCloseDialogLabelsError () {
428
+ console.log('onCloseDialogLabelsError')
429
+ },
430
+ getX () {
431
+ // this.$refs.AlertLabelsWithError.setLabelsSpinner(labelCode, true)
432
+
433
+ // this.$refs.AlertLabelsWithError.setIconCircleCheck(labelCode)
396
434
  }
397
435
  }
398
436
  }