case 4745 - case form Status, Product and Release fields

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-02 13:52:58 -07:00
parent 573722da39
commit 501be1764b

View File

@@ -18,6 +18,50 @@
@input="fieldValueChanged('name')" @input="fieldValueChanged('name')"
></v-text-field> ></v-text-field>
</v-col> </v-col>
<!-- case 4745: triage (Sockeye only, so plain English); a closing status closes the case when saved -->
<v-col cols="12" sm="6" lg="4" xl="3">
<v-select
ref="status"
v-model="obj.status"
dense
:items="selectLists.statuses"
item-text="name"
item-value="id"
:readonly="formState.readOnly"
:label="$sock.t('GZCaseStatus')"
data-cy="status"
:error-messages="form().serverErrors(this, 'status')"
@input="fieldValueChanged('status')"
></v-select>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-select
ref="product"
v-model="obj.product"
dense
:items="selectLists.products"
item-text="name"
item-value="id"
:readonly="formState.readOnly"
:label="$sock.t('GZCaseProduct')"
data-cy="product"
:error-messages="form().serverErrors(this, 'product')"
@input="fieldValueChanged('product')"
></v-select>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="release"
v-model="obj.release"
dense
:readonly="formState.readOnly"
:label="$sock.t('GZCaseRelease')"
hint="e.g. 8.3.2; needed once the case is Built"
data-cy="release"
:error-messages="form().serverErrors(this, 'release')"
@input="fieldValueChanged('release')"
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3"> <v-col cols="12" sm="6" lg="4" xl="3">
<gz-pick-list <gz-pick-list
ref="customerId" ref="customerId"
@@ -152,7 +196,14 @@ export default {
closed: null, closed: null,
customerId: null, customerId: null,
wiki: null, wiki: null,
tags: [] tags: [],
status: GZCASE_STATUS_NEW,
product: null,
release: null
},
selectLists: {
statuses: [],
products: []
}, },
formState: { formState: {
ready: false, ready: false,
@@ -225,6 +276,9 @@ export default {
//case 4714: a duplicate is a new, open case: the server gives it the next case number when saved //case 4714: a duplicate is a new, open case: the server gives it the next case number when saved
this.obj.caseId = 0; this.obj.caseId = 0;
this.obj.closed = null; this.obj.closed = null;
//case 4745: and starts at the beginning of triage
this.obj.status = GZCASE_STATUS_NEW;
this.obj.release = null;
this.obj.created = window.$gz.locale.nowUTC8601String(); this.obj.created = window.$gz.locale.nowUTC8601String();
this.obj.name = `${this.obj.name} - ${window.$gz.translation.get( this.obj.name = `${this.obj.name} - ${window.$gz.translation.get(
"Copy" "Copy"
@@ -275,7 +329,9 @@ export default {
}, },
async setClosed(close) { async setClosed(close) {
//case 4604: Close sets the closed date to now, saves the case and goes back; Open clears it and saves //case 4604: Close sets the closed date to now, saves the case and goes back; Open clears it and saves
//case 4745: closing makes it Done, reopening New (Never and Duplicate are chosen in Status)
this.obj.closed = close ? window.$gz.locale.nowUTC8601String() : null; this.obj.closed = close ? window.$gz.locale.nowUTC8601String() : null;
this.obj.status = close ? GZCASE_STATUS_DONE : GZCASE_STATUS_NEW;
this.fieldValueChanged("closed"); this.fieldValueChanged("closed");
await this.submit(); await this.submit();
if (close && !this.formState.dirty) { if (close && !this.formState.dirty) {
@@ -357,6 +413,11 @@ export default {
} else { } else {
//PUT //PUT
vm.obj.concurrency = res.data.concurrency; vm.obj.concurrency = res.data.concurrency;
//case 4745: the server sets closed from the status (and may move the status), so show what it saved
//(the PUT answer carries these as well as concurrency)
vm.obj.closed = res.data.closed;
vm.obj.status = res.data.status;
vm.obj.release = res.data.release;
} }
window.$gz.form.setFormState({ window.$gz.form.setFormState({
vm: vm, vm: vm,
@@ -602,12 +663,34 @@ function generateMenu(vm) {
let JUST_DELETED = false; let JUST_DELETED = false;
//case 4745: GZCaseStatus values the form sets itself
const GZCASE_STATUS_NEW = 1;
const GZCASE_STATUS_DONE = 5;
///////////////////////////////// /////////////////////////////////
// //
// //
async function initForm(vm) { async function initForm(vm) {
await fetchTranslatedText(); await fetchTranslatedText();
await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY, vm); await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY, vm);
await populateSelectionLists(vm);
}
//////////////////////
//
//
async function populateSelectionLists(vm) {
//case 4745: status in process order, not by name
await window.$gz.enums.fetchEnumList("gzcasestatus");
vm.selectLists.statuses = window.$gz.enums.getSelectionList(
"gzcasestatus",
true
);
await window.$gz.enums.fetchEnumList("gzcaseproduct");
vm.selectLists.products = window.$gz.enums.getSelectionList(
"gzcaseproduct",
true
);
} }
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
@@ -620,6 +703,9 @@ async function fetchTranslatedText() {
"GZCaseName", "GZCaseName",
"GZCaseId", "GZCaseId",
"GZCaseClosed", "GZCaseClosed",
"GZCaseStatus",
"GZCaseProduct",
"GZCaseRelease",
"Created", "Created",
"GZCaseNotes", "GZCaseNotes",
"Customer" "Customer"