From 85e6cc8a9f71cd7db475794810515343a901d94f Mon Sep 17 00:00:00 2001 From: David Whittaker Date: Fri, 17 Nov 2023 16:45:30 -0800 Subject: [PATCH 1/4] Working on ParticipantSelect --- .../static/dispatch/src/case/DetailsTab.vue | 11 ++++++ .../src/components/ParticipantSelect.vue | 36 +++++++++++++++---- .../dispatch/src/incident/DetailsTab.vue | 13 +++++-- .../static/dispatch/src/incident/store.js | 7 ++++ 4 files changed, 59 insertions(+), 8 deletions(-) diff --git a/src/dispatch/static/dispatch/src/case/DetailsTab.vue b/src/dispatch/static/dispatch/src/case/DetailsTab.vue index e9a92feb0333..f5e78ac0a0c4 100644 --- a/src/dispatch/static/dispatch/src/case/DetailsTab.vue +++ b/src/dispatch/static/dispatch/src/case/DetailsTab.vue @@ -46,6 +46,8 @@ hint="The organization member to which the case is assigned." clearable :project="project" + name="Assignee" + :rules="[only_one]" /> @@ -55,6 +57,8 @@ hint="The organization member who reported the case." clearable :project="project" + name="Reporter" + :rules="[only_one]" /> @@ -160,6 +164,13 @@ export default { statuses: ["New", "Triage", "Escalated", "Closed"], visibilities: ["Open", "Restricted"], resolutionReasons: ["False Positive", "User Acknowledged", "Mitigated", "Escalated"], + only_one: (value) => { + console.log(`**** the participant rules is ${value}`) + if (value && value.length > 1) { + return "Only one is allowed" + } + return true + }, } }, diff --git a/src/dispatch/static/dispatch/src/components/ParticipantSelect.vue b/src/dispatch/static/dispatch/src/components/ParticipantSelect.vue index a4ff901b074c..4118d23574ed 100644 --- a/src/dispatch/static/dispatch/src/components/ParticipantSelect.vue +++ b/src/dispatch/static/dispatch/src/components/ParticipantSelect.vue @@ -4,15 +4,15 @@ :label="label" :loading="loading" v-model:search="search" - clearable + closable-chips hide-selected item-title="individual.name" item-value="individual.id" return-object - chips - :hide-no-data="false" v-model="participant" + chips @update:model-value="handleClear" + :menu-props="{ closeOnContentClick: true }" >