3 Commits
8.2.0 ... main

3 changed files with 138 additions and 5 deletions

View File

@@ -7,6 +7,17 @@
>Close / reopen cases</v-expansion-panel-header
>
<v-expansion-panel-content>
<!-- case 4745: closing sets this status; reopening sets New. Duplicate is one case at a time, on the case form -->
<v-radio-group
v-model="closeAs"
row
dense
:disabled="jobActive"
data-cy="extCloseCasesAs"
>
<v-radio label="Close as Done" :value="STATUS_DONE"></v-radio>
<v-radio label="Close as Never" :value="STATUS_NEVER"></v-radio>
</v-radio-group>
<v-btn
color="blue darken-1"
text
@@ -42,6 +53,10 @@ export default {
dataListSelection: { type: Object, default: null }
},
data: () => ({
//case 4745: GZCaseStatus values
STATUS_DONE: 5,
STATUS_NEVER: 6,
closeAs: 5,
jobActive: false,
opening: false,
currentJobId: null,
@@ -68,7 +83,7 @@ export default {
//Clear any possible prior errors
vm.$emit("ext-show-job-log", "clear");
vm.opening = open;
const url = `job-operations/batch-close-cases?open=${open}`;
const url = `job-operations/batch-close-cases?open=${open}&status=${this.closeAs}`;
try {
this.progress = "";
let jobId = await window.$gz.api.upsert(url, this.dataListSelection);

View File

@@ -118,7 +118,10 @@
@change="fieldValueChanged('agent')"
></v-checkbox>
</v-col>
<v-col v-if="obj.agent && obj.id != 0" cols="12">
<v-col
v-if="obj.agent && obj.id != 0 && !formState.dirty"
cols="12"
>
<v-card outlined class="pa-3" data-cy="agentTokens">
<div class="text-subtitle-1">
{{ $sock.t("AgentTokens") }}
@@ -136,6 +139,15 @@
>
<code>{{ newAgentToken }}</code>
</div>
<v-btn
small
class="mt-2"
data-cy="copyAgentToken"
@click="copyAgentToken()"
>
<v-icon small left>$sockiCopy</v-icon>
{{ $sock.t("CopyToClipboard") }}
</v-btn>
</v-alert>
<v-simple-table v-if="agentTokens.length > 0" dense>
<tbody>
@@ -198,7 +210,13 @@
</v-row>
</v-card>
</v-col>
<v-col v-if="obj.allowLogin" cols="12" sm="6" lg="4" xl="3">
<v-col
v-if="obj.allowLogin && !obj.agent"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field
id="username"
ref="login"
@@ -217,7 +235,13 @@
></v-text-field>
</v-col>
<v-col v-if="obj.allowLogin" cols="12" sm="6" lg="4" xl="3">
<v-col
v-if="obj.allowLogin && !obj.agent"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field
id="password"
ref="password"
@@ -962,6 +986,13 @@ export default {
window.$gz.locale.getHour12()
);
},
copyAgentToken() {
window.$gz.util.copyToClipboard(this.newAgentToken);
window.$gz.eventBus.$emit(
"notify-success",
this.$sock.t("CopyToClipboard")
);
},
async getAgentTokens() {
const vm = this;
vm.newAgentToken = null;
@@ -1276,6 +1307,7 @@ async function fetchTranslatedText() {
"AgentTokenRevoke",
"AgentTokenRevoked",
"AgentTokenNone",
"CopyToClipboard",
"Vendor",
"User",
"UserSettings",

View File

@@ -18,6 +18,50 @@
@input="fieldValueChanged('name')"
></v-text-field>
</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">
<gz-pick-list
ref="customerId"
@@ -152,7 +196,14 @@ export default {
closed: null,
customerId: null,
wiki: null,
tags: []
tags: [],
status: GZCASE_STATUS_NEW,
product: null,
release: null
},
selectLists: {
statuses: [],
products: []
},
formState: {
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
this.obj.caseId = 0;
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.name = `${this.obj.name} - ${window.$gz.translation.get(
"Copy"
@@ -275,7 +329,9 @@ export default {
},
async setClosed(close) {
//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.status = close ? GZCASE_STATUS_DONE : GZCASE_STATUS_NEW;
this.fieldValueChanged("closed");
await this.submit();
if (close && !this.formState.dirty) {
@@ -357,6 +413,11 @@ export default {
} else {
//PUT
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({
vm: vm,
@@ -602,12 +663,34 @@ function generateMenu(vm) {
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) {
await fetchTranslatedText();
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",
"GZCaseId",
"GZCaseClosed",
"GZCaseStatus",
"GZCaseProduct",
"GZCaseRelease",
"Created",
"GZCaseNotes",
"Customer"