1
0
Fork 0

chore(webui): Migrate to Quasar 2.x and Vue.js 3.x

This commit is contained in:
Andi Sardina Ramos 2024-02-26 16:02:04 +02:00 committed by GitHub
parent 153765f99f
commit f7edb394f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
65 changed files with 4374 additions and 7999 deletions

View file

@ -22,7 +22,7 @@ class Errors {
static handleResponse (error) {
console.log('handleResponse', error, error.response)
let body = error.response.data
const body = error.response.data
if (error.response.status === 401) {
// TODO - actions...
}

View file

@ -1,4 +1,4 @@
import { get } from 'dot-prop'
import { getProperty } from 'dot-prop'
class Helps {
// Getters
@ -11,7 +11,7 @@ class Helps {
// ------------------------------------------------------------------------
static get (obj, prop, def = undefined) {
return get(obj, prop, def)
return getProperty(obj, prop, def)
}
static hasIn (obj, prop) {
@ -39,13 +39,12 @@ class Helps {
}
static removeEmptyObjects (objects) {
const obj = {}
Object.entries(objects).map(item => {
if (item[1] !== '') {
obj[item[0]] = item[1]
}
})
return obj
Object.entries(objects)
.filter(item => item[1] !== '')
.reduce((acc, item) => {
acc[item[0]] = item[1]
return acc
}, {})
}
// Helps -> Numbers

View file

@ -1,8 +1,8 @@
import { set, get } from 'dot-prop'
import { setProperty, getProperty } from 'dot-prop'
export const withPagination = (type, opts = {}) => (state, data) => {
const { isSameContext, statePath } = opts
const currentState = get(state, statePath)
const currentState = getProperty(state, statePath)
let newState
@ -13,7 +13,7 @@ export const withPagination = (type, opts = {}) => (state, data) => {
loading: true
}
break
case 'success':
case 'success': {
const { body, page } = data
newState = {
...currentState,
@ -28,6 +28,7 @@ export const withPagination = (type, opts = {}) => (state, data) => {
loading: false
}
break
}
case 'failure':
newState = {
...currentState,
@ -39,6 +40,6 @@ export const withPagination = (type, opts = {}) => (state, data) => {
}
if (newState) {
set(state, statePath, newState)
setProperty(state, statePath, newState)
}
}