From 0609fdebf7cae3c4d8642edfa940c602ab384e18 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 11 Dec 2023 13:16:59 -0600 Subject: [PATCH 1/9] Improve focus behavior for inventory count view --- src/components/inventory/ByjoveInventory.vue | 23 +++++++++++--------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/components/inventory/ByjoveInventory.vue b/src/components/inventory/ByjoveInventory.vue index 31e84e7..b6201c7 100644 --- a/src/components/inventory/ByjoveInventory.vue +++ b/src/components/inventory/ByjoveInventory.vue @@ -83,6 +83,10 @@ export default { type: Boolean, default: true, }, + focusCases: { + type: Boolean, + default: false, + }, allowEdit: { type: Boolean, default: false, @@ -92,6 +96,7 @@ export default { default: false, }, }, + data() { return { row: {}, @@ -102,16 +107,6 @@ 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() { @@ -165,6 +160,14 @@ 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 From 7bc9991be0893b59fb516dd75b89b8b8b146c722 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 20 Dec 2023 11:48:09 -0600 Subject: [PATCH 2/9] Keep row filters "raw" until encoding for actual request so there is no need to use `JSON.stringify()` everywhere, keep that part in just one place --- src/components/model-crud/ByjoveModelCrud.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/model-crud/ByjoveModelCrud.vue b/src/components/model-crud/ByjoveModelCrud.vue index 20f223f..6b3af32 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 JSON.stringify([ + return [ {field: 'batch_uuid', op: 'eq', value: uuid}, {field: 'removed', op: 'eq', value: false}, - ]) + ] }, }, rowOrderBy: { @@ -538,7 +538,7 @@ export default { fetchRows(uuid) { let params = { - filters: this.rowFilters(uuid), + filters: JSON.stringify(this.rowFilters(uuid)), orderBy: this.rowOrderBy, ascending: this.rowOrderAscending ? 1 : 0, } From 86fbf8f16426e285c4ee4f0f3565eb51e5049841 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 26 Dec 2023 20:22:43 -0600 Subject: [PATCH 3/9] Update changelog --- CHANGELOG.md | 5 +++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f4a7c6..ef68469 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ 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). +## [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 dbc67a5..ec60d20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "byjove", - "version": "0.1.22", + "version": "0.1.23", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "byjove", - "version": "0.1.22", + "version": "0.1.23", "license": "GPL-3.0-or-later", "dependencies": { "vue": "^2.7.14" diff --git a/package.json b/package.json index 0145795..fcf9055 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "byjove", - "version": "0.1.22", + "version": "0.1.23", "description": "Generic-ish app components for Vue.js frontend to Tailbone API backend", "keywords": [ "rattail", From 18936d9efd082539fcee4f8179a90f152857aa07 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 29 Dec 2023 19:38:41 -0600 Subject: [PATCH 4/9] Add delay when fetching rows data for model CRUD component hoping this actually works, but can't reproduce the problem locally so will just have to wait and see --- src/components/model-crud/ByjoveModelCrud.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/model-crud/ByjoveModelCrud.vue b/src/components/model-crud/ByjoveModelCrud.vue index 6b3af32..25068f0 100644 --- a/src/components/model-crud/ByjoveModelCrud.vue +++ b/src/components/model-crud/ByjoveModelCrud.vue @@ -511,7 +511,14 @@ export default { this.record = response.data.data this.$emit('refresh', this.record) if (this.hasRows) { - this.fetchRows(uuid) + // 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) + }) } }, response => { if (response.status == 403) { // forbidden From b6e8b74eefbea6c0eb3cafd1dbe025592029424e Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 26 Mar 2024 12:57:49 -0500 Subject: [PATCH 5/9] Update changelog --- CHANGELOG.md | 6 ++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef68469..07a00a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ 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.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. diff --git a/package-lock.json b/package-lock.json index ec60d20..5524b23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "byjove", - "version": "0.1.23", + "version": "0.1.24", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "byjove", - "version": "0.1.23", + "version": "0.1.24", "license": "GPL-3.0-or-later", "dependencies": { "vue": "^2.7.14" diff --git a/package.json b/package.json index fcf9055..d0dbfc9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "byjove", - "version": "0.1.23", + "version": "0.1.24", "description": "Generic-ish app components for Vue.js frontend to Tailbone API backend", "keywords": [ "rattail", From 32d1bd430f85240d51c13639bce805e660d65a57 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 11 Apr 2024 14:14:01 -0500 Subject: [PATCH 6/9] Show actual error text if applicable, for receiving failure --- src/components/receiving/ByjoveReceiving.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/receiving/ByjoveReceiving.vue b/src/components/receiving/ByjoveReceiving.vue index 9b11867..1a96d3a 100644 --- a/src/components/receiving/ByjoveReceiving.vue +++ b/src/components/receiving/ByjoveReceiving.vue @@ -359,17 +359,17 @@ export default { } this.$http.post(url, params).then(response => { - if (response.data.data) { + if (!response.data.error) { this.$router.push(`/receiving/${this.row.batch_uuid}`) } else { this.$buefy.toast.open({ - message: response.data.error || "Failed to post receiving!", + message: response.data.error, type: 'is-danger', }) } }, response => { this.$buefy.toast.open({ - message: "Failed to post receiving!", + message: "Save failed: unknown error", type: 'is-danger', }) }) From b04fa3eb72bc16cb89135fc0a9137f1a970695a8 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 29 May 2024 09:43:53 -0500 Subject: [PATCH 7/9] Update changelog --- CHANGELOG.md | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07a00a5..a9e8cbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## Unreleased +## [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. diff --git a/package-lock.json b/package-lock.json index 5524b23..3791936 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "byjove", - "version": "0.1.24", + "version": "0.1.25", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "byjove", - "version": "0.1.24", + "version": "0.1.25", "license": "GPL-3.0-or-later", "dependencies": { "vue": "^2.7.14" diff --git a/package.json b/package.json index d0dbfc9..55201b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "byjove", - "version": "0.1.24", + "version": "0.1.25", "description": "Generic-ish app components for Vue.js frontend to Tailbone API backend", "keywords": [ "rattail", From f21a7298feb98e0eb00347da5b580371cb968b22 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 31 May 2024 10:58:44 -0500 Subject: [PATCH 8/9] Optionally allow decimal quantities for receiving --- src/components/numeric-input/NumericInput.vue | 152 ++++++++++++++++++ src/components/numeric-input/index.js | 28 ++++ src/components/receiving/ByjoveReceiving.vue | 19 ++- 3 files changed, 195 insertions(+), 4 deletions(-) create mode 100644 src/components/numeric-input/NumericInput.vue create mode 100644 src/components/numeric-input/index.js diff --git a/src/components/numeric-input/NumericInput.vue b/src/components/numeric-input/NumericInput.vue new file mode 100644 index 0000000..7bdef1b --- /dev/null +++ b/src/components/numeric-input/NumericInput.vue @@ -0,0 +1,152 @@ + + + diff --git a/src/components/numeric-input/index.js b/src/components/numeric-input/index.js new file mode 100644 index 0000000..fa116e7 --- /dev/null +++ b/src/components/numeric-input/index.js @@ -0,0 +1,28 @@ +// 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