diff --git a/CHANGELOG.md b/CHANGELOG.md index 16f0bb4..6f4a7c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,25 +5,6 @@ All notable changes to 'byjove' will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## Unreleased - -## [0.1.26] - 2024-06-03 -### Changed -- Optionally allow decimal quantities for receiving. - -## [0.1.25] - 2024-05-29 -### Changed -- Show actual error text if applicable, for receiving failure. - -## [0.1.24] - 2024-03-26 -### Changed -- Add delay when fetching rows data for model CRUD component. - -## [0.1.23] - 2023-12-26 -### Changed -- Improve focus behavior for inventory count view. -- Keep row filters "raw" until encoding for actual request. - ## [0.1.22] - 2023-10-23 ### Changed - Use columns instead of table, for row receiving quantities. diff --git a/package-lock.json b/package-lock.json index afb3f25..dbc67a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "byjove", - "version": "0.1.26", + "version": "0.1.22", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "byjove", - "version": "0.1.26", + "version": "0.1.22", "license": "GPL-3.0-or-later", "dependencies": { "vue": "^2.7.14" diff --git a/package.json b/package.json index 6a78ccf..0145795 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "byjove", - "version": "0.1.26", + "version": "0.1.22", "description": "Generic-ish app components for Vue.js frontend to Tailbone API backend", "keywords": [ "rattail", diff --git a/src/components/inventory/ByjoveInventory.vue b/src/components/inventory/ByjoveInventory.vue index b6201c7..31e84e7 100644 --- a/src/components/inventory/ByjoveInventory.vue +++ b/src/components/inventory/ByjoveInventory.vue @@ -83,10 +83,6 @@ export default { type: Boolean, default: true, }, - focusCases: { - type: Boolean, - default: false, - }, allowEdit: { type: Boolean, default: false, @@ -96,7 +92,6 @@ export default { default: false, }, }, - data() { return { row: {}, @@ -107,6 +102,16 @@ export default { this.fetch(this.$route.params.uuid) }, + updated() { + this.$nextTick(() => { + if (this.shouldAllowCases()) { + this.$refs.cases.focus() + } else { + this.$refs.units.focus() + } + }) + }, + methods: { getIndexUrl() { @@ -160,14 +165,6 @@ export default { if (this.row.batch_executed || this.row.batch_complete) { // cannot edit this row, so view it instead this.$router.push(this.getViewUrl()) - } else { - this.$nextTick(() => { - if (this.shouldAllowCases() && this.focusCases) { - this.$refs.cases.focus() - } else { - this.$refs.units.focus() - } - }) } }, response => { if (response.status == 403) { // forbidden; redirect to model index diff --git a/src/components/model-crud/ByjoveModelCrud.vue b/src/components/model-crud/ByjoveModelCrud.vue index 25068f0..20f223f 100644 --- a/src/components/model-crud/ByjoveModelCrud.vue +++ b/src/components/model-crud/ByjoveModelCrud.vue @@ -189,10 +189,10 @@ export default { rowFilters: { type: Function, default: (uuid) => { - return [ + return JSON.stringify([ {field: 'batch_uuid', op: 'eq', value: uuid}, {field: 'removed', op: 'eq', value: false}, - ] + ]) }, }, rowOrderBy: { @@ -511,14 +511,7 @@ export default { this.record = response.data.data this.$emit('refresh', this.record) if (this.hasRows) { - // TODO: was seeing occasional errors when a batch - // view was loaded, and it tried to fetch rows but - // somehow the uuid was not passed along and - // server failed to build a query filter. so - // hoping the nextTick() delay fixes it..? - this.$nextTick(() => { - this.fetchRows(uuid) - }) + this.fetchRows(uuid) } }, response => { if (response.status == 403) { // forbidden @@ -545,7 +538,7 @@ export default { fetchRows(uuid) { let params = { - filters: JSON.stringify(this.rowFilters(uuid)), + filters: this.rowFilters(uuid), orderBy: this.rowOrderBy, ascending: this.rowOrderAscending ? 1 : 0, } diff --git a/src/components/numeric-input/NumericInput.vue b/src/components/numeric-input/NumericInput.vue deleted file mode 100644 index 7bdef1b..0000000 --- a/src/components/numeric-input/NumericInput.vue +++ /dev/null @@ -1,152 +0,0 @@ - - - diff --git a/src/components/numeric-input/index.js b/src/components/numeric-input/index.js deleted file mode 100644 index fa116e7..0000000 --- a/src/components/numeric-input/index.js +++ /dev/null @@ -1,28 +0,0 @@ -// Import vue component -import NumericInput from './NumericInput.vue' - -// Declare install function executed by Vue.use() -export function install(Vue) { - if (install.installed) return; - install.installed = true; - Vue.component('NumericInput', NumericInput); -} - -// Create module definition for Vue.use() -const plugin = { - install, -}; - -// Auto-install when vue is found (eg. in browser via