Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENGAGE-1935] - Rooms list otimization and new visual #538

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
fb90a3d
fix: block two users in one rooms
mateuseduardomedeiros Oct 10, 2024
301d90f
fix: view closed room in room queue
mateuseduardomedeiros Oct 10, 2024
1a4197d
fix: last message not show
mateuseduardomedeiros Oct 10, 2024
893f2bb
Merge branch 'main' into hotfix/chats-otimizations
mateuseduardomedeiros Oct 14, 2024
2d0aa41
revert
mateuseduardomedeiros Oct 14, 2024
5bd8117
Merge branch 'main' into hotfix/chats-otimizations
mateuseduardomedeiros Oct 15, 2024
b8e41d4
fix: socket not change on assume chat
mateuseduardomedeiros Oct 21, 2024
befc2fe
Merge branch 'main' into hotfix/chats-otimizations
mateuseduardomedeiros Oct 21, 2024
10ae0f5
Merge branch 'main' into hotfix/chats-otimizations
mateuseduardomedeiros Oct 23, 2024
8871372
feat: init new contact list view
mateuseduardomedeiros Oct 23, 2024
43b151c
feat: pagination handling and count
mateuseduardomedeiros Oct 24, 2024
ec85a81
fix: select all on change tab
mateuseduardomedeiros Oct 24, 2024
b73ad71
fix: visual issues
mateuseduardomedeiros Oct 24, 2024
8e00d23
feat: add rooms count
mateuseduardomedeiros Oct 25, 2024
7d8918d
wip: add card group ref
mateuseduardomedeiros Oct 25, 2024
587248c
fix: select all not show
mateuseduardomedeiros Oct 25, 2024
ea760ba
fix: room always open
mateuseduardomedeiros Oct 25, 2024
583bb59
fix: add missing promise all
mateuseduardomedeiros Oct 25, 2024
ab2d885
fix: active tab not reactive on change language
mateuseduardomedeiros Oct 25, 2024
5c8c70f
fix: auto open transfer modal
mateuseduardomedeiros Oct 25, 2024
05c848b
fix: rooms count
mateuseduardomedeiros Oct 28, 2024
d1b80f1
refact: change watch logic to method
mateuseduardomedeiros Oct 28, 2024
988c0d6
Merge branch 'main' into feat/contact-list
mateuseduardomedeiros Oct 29, 2024
0cd6ed3
Merge pull request #541 from weni-ai/hotfix/list-contact
mateuseduardomedeiros Oct 30, 2024
23b0eb3
Merge branch 'main' into feature/keep-old-css
Aldemylla Oct 30, 2024
2f5007e
Merge pull request #536 from weni-ai/feature/keep-old-css
Aldemylla Oct 30, 2024
34826b2
Merge branch 'main' into feat/contact-list
mateuseduardomedeiros Oct 30, 2024
7918134
Merge branch 'main' into feat/contact-list
mateuseduardomedeiros Oct 31, 2024
dd5c752
Merge branch 'main' into feat/contact-list
mateuseduardomedeiros Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { useConfig } from './store/modules/config';
import { useProfile } from './store/modules/profile';
import { useQuickMessages } from './store/modules/chats/quickMessages';
import { useQuickMessageShared } from './store/modules/chats/quickMessagesShared';
import { useRooms } from './store/modules/chats/rooms';
import { useDashboard } from './store/modules/dashboard';

import initHotjar from '@/plugins/Hotjar';
Expand All @@ -35,7 +34,6 @@ export default {
},

computed: {
...mapState(useRooms, ['activeRoom']),
...mapState(useProfile, ['me']),
...mapState(useDashboard, ['viewedAgent']),
...mapState(useQuickMessages, ['nextQuickMessages']),
Expand Down
1 change: 1 addition & 0 deletions src/components/ModalQueuePriorizations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export default {
this.removeRoom(room.uuid);
}
});

await this.getAllRooms({ limit: 100 });

callUnnnicAlert({
Expand Down
6 changes: 1 addition & 5 deletions src/components/chats/ContactInfo/TransferSession.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,8 @@ export default {
this.$refs.roomsTransferFields.transfer();
},

transferComplete(status) {
transferComplete() {
this.isLoading = false;

if (status === 'success') {
this.resetActiveRoom();
}
},

resetActiveRoom() {
Expand Down
15 changes: 11 additions & 4 deletions src/components/chats/RoomsTransferFields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ export default {
},

computed: {
...mapState(useRooms, ['selectedRoomsToTransfer', 'contactToTransfer']),
...mapState(useRooms, [
'selectedRoomsToTransfer',
'contactToTransfer',
'activeRoom',
]),
...mapState(useProfile, ['me']),

queuesDefault() {
Expand Down Expand Up @@ -178,7 +182,7 @@ export default {
...mapActions(useRooms, [
'setSelectedRoomsToTransfer',
'setContactToTransfer',
'removeRoom',
'setActiveRoom',
]),

async getQueues() {
Expand Down Expand Up @@ -226,21 +230,24 @@ export default {

const selectedQueue = this.selectedQueue?.[0]?.value;
const selectedAgent = this.selectedAgent?.[0]?.value;

const activeRoom = { ...this.activeRoom };
try {
await this.setActiveRoom(null);

const response = await Room.bulkTranfer({
rooms: roomsToTransfer,
intended_queue: selectedQueue,
intended_agent: selectedAgent,
});

if (response.status === 200) {
this.transferSuccess();
this.resetRoomsToTransfer();
this.transferSuccess();
} else {
this.transferError();
}
} catch (error) {
await this.setActiveRoom(activeRoom);
console.error(
'An error occurred while performing the mass transfer:',
error,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
<template>
<UnnnicCollapse
v-model="isCollapseOpened"
size="md"
<section
class="card-group"
@click.stop
>
<template #header>
<label class="card-group__header">
<section @click.stop>
<UnnnicCheckbox
v-if="withSelection"
v-model="collapseCheckboxValue"
class="card-group__checkbox"
size="sm"
@change="updateSelectAllRooms($event)"
/>
</section>
{{ label }}
</label>
</template>
<UnnnicCheckbox
v-if="withSelection"
v-model="collapseCheckboxValue"
class="card-group__checkbox"
size="sm"
:textRight="$t('select_all')"
@change="updateSelectAllRooms($event)"
/>
<template v-if="rooms && rooms.length">
<RoomCard
v-for="room in rooms"
Expand All @@ -42,7 +36,7 @@
@keypress.enter="open(discussion)"
/>
</template>
</UnnnicCollapse>
</section>
</template>

<script>
Expand Down Expand Up @@ -113,6 +107,10 @@ export default {
}
},

unmounted() {
this.setSelectedRoomsToTransfer([]);
},

methods: {
...mapActions(useRooms, ['setSelectedRoomsToTransfer']),
open(room) {
Expand Down Expand Up @@ -162,9 +160,8 @@ export default {
align-items: flex-start;
gap: $unnnic-spacing-nano;
}
&__checkbox {
padding: $unnnic-spacing-nano;

&__checkbox {
:deep(.unnnic-checkbox) {
// !important at fill is needed here because the
// unnnicCollapse header is applying an unwanted style when hovering
Expand All @@ -174,4 +171,11 @@ export default {
}
}
}

.card-group .card-group__checkbox {
display: flex;
align-items: center;
padding: $unnnic-spacing-nano;
margin-bottom: $unnnic-spacing-sm;
}
</style>
64 changes: 64 additions & 0 deletions src/layouts/ChatsLayout/components/TheCardGroups/Tag.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<template>
<section
:class="{ 'filter-tag': true, 'filter-tag--active': active, clickable }"
@click.stop="$emit('click', label)"
>
<p class="filter-tag__label">
{{ label }}
{{ count ? `(${count})` : '' }}
</p>
</section>
</template>

<script>
export default {
name: 'FilterTag',
props: {
label: {
type: String,
default: '',
},
count: {
type: Number,
default: 0,
},
active: { type: Boolean, default: false },
clickable: { type: Boolean, default: true },
},
emits: ['click'],
};
</script>

<style lang="scss">
.clickable {
cursor: pointer;
}
.filter-tag {
padding: $unnnic-spacing-nano $unnnic-spacing-xs;
background-color: $unnnic-color-neutral-light;
border-radius: 600px;

:hover {
color: $unnnic-color-weni-700;
}

&__label {
color: $unnnic-color-neutral-cloudy;
font-family: $unnnic-font-family-secondary;
font-size: $unnnic-font-size-body-md;
line-height: $unnnic-font-size-body-md + $unnnic-font-size-body-sm;
}

&--active {
background-color: white;
border: 1px solid $unnnic-color-weni-700;
.filter-tag__label {
color: $unnnic-color-weni-700;
}
}

&__label {
text-align: center;
}
}
</style>
Loading
Loading