Skip to content

Commit

Permalink
24.08.27: "close" multiselect event, agent-status-select pause re-sel…
Browse files Browse the repository at this point in the history
…ect [WTEL-4703]
  • Loading branch information
dlohvinov committed Aug 23, 2024
1 parent 8ada8cd commit 83fa5c2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@webitel/ui-sdk",
"version": "24.8.26",
"version": "24.8.27",
"private": false,
"scripts": {
"dev": "vite",
Expand Down
7 changes: 4 additions & 3 deletions src/components/wt-select/mixins/multiselectMixin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import VueMultiselect from 'vue-multiselect';
import { ObserveVisibility } from 'vue-observe-visibility';
import validationMixin from '../../../mixins/validationMixin/validationMixin.js';
import validationMixin
from '../../../mixins/validationMixin/validationMixin.js';
import debounce from '../../../scripts/debounce.js';
import isEmpty from '../../../scripts/isEmpty.js';
import labelUsageMixin from '../../wt-label/mixins/labelUsageMixin.js';
Expand Down Expand Up @@ -143,8 +144,8 @@ export default {
this.$emit('input', value);
},

close() {
this.$emit('closed');
close(event) {
this.$emit('closed', event);
},

tag() {},
Expand Down
6 changes: 5 additions & 1 deletion src/components/wt-status-select/wt-status-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:value="selectedOption"
class="wt-status-select"
track-by="value"
@closed="closedHandler"
@input="inputHandler"
>
<template #singleLabel="{ option }">
Expand Down Expand Up @@ -52,7 +53,7 @@ export default {
// options: ['sm', 'md'],
// },
},
emits: ['change'],
emits: ['change', 'closed'],
computed: {
selectedOption() {
return this.statusOptions.find((option) => option.value === this.status);
Expand Down Expand Up @@ -91,6 +92,9 @@ export default {
inputHandler(value) {
this.$emit('change', value.value);
},
closedHandler(event) {
this.$emit('closed', event);
},
},
};
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<wt-status-select
:status="status"
:status-duration="statusDuration"
@closed="handleClosed"
@change="handleStatusSelectInput"
/>
<pause-cause-popup
Expand Down Expand Up @@ -94,6 +95,10 @@ async function handleStatusSelectInput(status) {
await changeStatus({ status });
}
function handleClosed(event) {
return handleStatusSelectInput(event.value);
}
function handlePauseCauseInput(pauseCause) {
const status = AgentStatus.PAUSE;
return changeStatus({ status, pauseCause });
Expand Down

0 comments on commit 83fa5c2

Please sign in to comment.