Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7bfb389a3a | |||
| 501be1764b | |||
| 573722da39 |
@@ -7,6 +7,17 @@
|
|||||||
>Close / reopen cases</v-expansion-panel-header
|
>Close / reopen cases</v-expansion-panel-header
|
||||||
>
|
>
|
||||||
<v-expansion-panel-content>
|
<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
|
<v-btn
|
||||||
color="blue darken-1"
|
color="blue darken-1"
|
||||||
text
|
text
|
||||||
@@ -42,6 +53,10 @@ export default {
|
|||||||
dataListSelection: { type: Object, default: null }
|
dataListSelection: { type: Object, default: null }
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
|
//case 4745: GZCaseStatus values
|
||||||
|
STATUS_DONE: 5,
|
||||||
|
STATUS_NEVER: 6,
|
||||||
|
closeAs: 5,
|
||||||
jobActive: false,
|
jobActive: false,
|
||||||
opening: false,
|
opening: false,
|
||||||
currentJobId: null,
|
currentJobId: null,
|
||||||
@@ -68,7 +83,7 @@ export default {
|
|||||||
//Clear any possible prior errors
|
//Clear any possible prior errors
|
||||||
vm.$emit("ext-show-job-log", "clear");
|
vm.$emit("ext-show-job-log", "clear");
|
||||||
vm.opening = open;
|
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 {
|
try {
|
||||||
this.progress = "";
|
this.progress = "";
|
||||||
let jobId = await window.$gz.api.upsert(url, this.dataListSelection);
|
let jobId = await window.$gz.api.upsert(url, this.dataListSelection);
|
||||||
|
|||||||
@@ -118,7 +118,10 @@
|
|||||||
@change="fieldValueChanged('agent')"
|
@change="fieldValueChanged('agent')"
|
||||||
></v-checkbox>
|
></v-checkbox>
|
||||||
</v-col>
|
</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">
|
<v-card outlined class="pa-3" data-cy="agentTokens">
|
||||||
<div class="text-subtitle-1">
|
<div class="text-subtitle-1">
|
||||||
{{ $sock.t("AgentTokens") }}
|
{{ $sock.t("AgentTokens") }}
|
||||||
@@ -136,6 +139,15 @@
|
|||||||
>
|
>
|
||||||
<code>{{ newAgentToken }}</code>
|
<code>{{ newAgentToken }}</code>
|
||||||
</div>
|
</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-alert>
|
||||||
<v-simple-table v-if="agentTokens.length > 0" dense>
|
<v-simple-table v-if="agentTokens.length > 0" dense>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -198,7 +210,13 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</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
|
<v-text-field
|
||||||
id="username"
|
id="username"
|
||||||
ref="login"
|
ref="login"
|
||||||
@@ -217,7 +235,13 @@
|
|||||||
></v-text-field>
|
></v-text-field>
|
||||||
</v-col>
|
</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
|
<v-text-field
|
||||||
id="password"
|
id="password"
|
||||||
ref="password"
|
ref="password"
|
||||||
@@ -962,6 +986,13 @@ export default {
|
|||||||
window.$gz.locale.getHour12()
|
window.$gz.locale.getHour12()
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
copyAgentToken() {
|
||||||
|
window.$gz.util.copyToClipboard(this.newAgentToken);
|
||||||
|
window.$gz.eventBus.$emit(
|
||||||
|
"notify-success",
|
||||||
|
this.$sock.t("CopyToClipboard")
|
||||||
|
);
|
||||||
|
},
|
||||||
async getAgentTokens() {
|
async getAgentTokens() {
|
||||||
const vm = this;
|
const vm = this;
|
||||||
vm.newAgentToken = null;
|
vm.newAgentToken = null;
|
||||||
@@ -1276,6 +1307,7 @@ async function fetchTranslatedText() {
|
|||||||
"AgentTokenRevoke",
|
"AgentTokenRevoke",
|
||||||
"AgentTokenRevoked",
|
"AgentTokenRevoked",
|
||||||
"AgentTokenNone",
|
"AgentTokenNone",
|
||||||
|
"CopyToClipboard",
|
||||||
"Vendor",
|
"Vendor",
|
||||||
"User",
|
"User",
|
||||||
"UserSettings",
|
"UserSettings",
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user