diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue
index a9c2db9b4..7655f5878 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue
@@ -1,6 +1,7 @@
{{ user.label }}
+ {{ user }}
({{ user.user_job.label.fr }}) ({{ user.main_scope.name.fr }}) A
diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts
index 1af87d044..5ff90bc42 100644
--- a/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts
+++ b/src/Bundle/ChillTicketBundle/src/Resources/public/types.ts
@@ -68,8 +68,9 @@ interface AddPersonEvent extends TicketHistory<"add_person", PersonHistory> {};
interface AddCommentEvent extends TicketHistory<"add_comment", Comment> {};
interface SetMotiveEvent extends TicketHistory<"set_motive", MotiveHistory> {};
interface AddAddressee extends TicketHistory<"add_addressee", AddresseeHistory> {};
+interface RemoveAddressee extends TicketHistory<"remove_addressee", AddresseeHistory> {};
-type TicketHistoryLine = AddPersonEvent | AddCommentEvent | SetMotiveEvent | AddAddressee;
+type TicketHistoryLine = AddPersonEvent | AddCommentEvent | SetMotiveEvent | AddAddressee | RemoveAddressee;
export interface Ticket {
type: "ticket_ticket",
diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue
index e738bd10a..a605fd416 100644
--- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue
+++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/App.vue
@@ -52,17 +52,27 @@
{{ $t("banner.speaker") }}
+
+
+
- {{
- typeof addressee.label == "string"
- ? addressee.label
- : addressee.label.fr
- }}
+ {{ user_group.label }}
+
+
+ {{ user_group.label.fr }}
@@ -71,7 +81,7 @@
-
+
@@ -81,6 +91,11 @@ import { computed, defineComponent, inject, onMounted, ref } from "vue";
import { useStore } from "vuex";
// Types
+import {
+ DateTime,
+ User,
+ UserGroup,
+} from "../../../../../../ChillMainBundle/Resources/public/types";
import { Motive, Ticket } from "../../types";
// Components
@@ -88,7 +103,6 @@ import TicketSelectorComponent from "./components/TicketSelectorComponent.vue";
import TicketHistoryListComponent from "./components/TicketHistoryListComponent.vue";
import ActionToolbarComponent from "./components/ActionToolbarComponent.vue";
import UserRenderBoxBadge from "../../../../../../ChillMainBundle/Resources/public/vuejs/_components/Entity/UserRenderBoxBadge.vue";
-import { DateTime } from "../../../../../../ChillMainBundle/Resources/public/types";
export default defineComponent({
name: "App",
@@ -107,6 +121,9 @@ export default defineComponent({
const motives = computed(() => store.getters.getMotives as Motive[]);
const ticket = computed(() => store.getters.getTicket as Ticket);
+ const ticketHistory = computed(
+ () => store.getters.getDistinctAddressesHistory
+ );
function getSince(createdAt: DateTime) {
const today = new Date();
@@ -127,6 +144,7 @@ export default defineComponent({
});
return {
+ ticketHistory,
headline,
motives,
ticket,
diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryAddresseeComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryAddresseeComponent.vue
index 3e4203561..234dfb26f 100644
--- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryAddresseeComponent.vue
+++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryAddresseeComponent.vue
@@ -1,19 +1,17 @@
-
-
-
+
+
+
+
{{
- $t("history.transfert_user_group", {
+ $t(`history.${event_type}_user_group`, {
user_group: addressee.label.fr,
})
}}
-
-
-
-
+
{{
- $t("history.transfert_user", {
+ $t(`history.${event_type}_user`, {
user: addressee.username,
})
}}
@@ -35,8 +33,11 @@ export default defineComponent({
type: Object as PropType,
required: true,
},
+ event_type: {
+ type: String,
+ required: true,
+ },
},
-
setup(props, ctx) {
return {
addressee: ref(props.addresseeHistory.addressee as UserGroupOrUser),
diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryListComponent.vue b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryListComponent.vue
index 4d0722c14..8c301178f 100644
--- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryListComponent.vue
+++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/components/TicketHistoryListComponent.vue
@@ -4,32 +4,47 @@
v-for="history_line in history"
:key="history.indexOf(history_line)"
>
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts
index 31f5c94d7..77b63977e 100644
--- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts
+++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/i18n/messages.ts
@@ -10,8 +10,10 @@ const messages = {
user: "Prise en charge par {username}",
motive: "Motif indiqué: {motive}",
comment: "Commentaire: {comment}",
- transfert_user_group: "Transferé au groupe: {user_group}",
- transfert_user: "Transferé vers l'utilisateur: {user}",
+ add_addressee_user_group: "Groupe {user_group} transferé",
+ remove_addressee_user_group: "Groupe {user_group} retiré",
+ add_addressee_user: " Utilisateur {user} Transferé",
+ remove_addressee_user: "Utilisateur {user} retiré",
},
comment: {
title: "Commentaire",
diff --git a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/ticket.ts b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/ticket.ts
index c02b520eb..f3db197c2 100644
--- a/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/ticket.ts
+++ b/src/Bundle/ChillTicketBundle/src/Resources/public/vuejs/TicketApp/store/modules/ticket.ts
@@ -14,7 +14,24 @@ export const moduleTicket: Module ={
getters: {
getTicket(state) {
return state.ticket;
- }
+ },
+ getDistinctAddressesHistory(state) {
+ const addresseeHistory = state.ticket.history.reduce((result, item) => {
+ const { datetime } = item.at;
+ if (!["add_addressee","remove_addressee"].includes(item.event_type)) {
+ result[datetime] = item
+ return result;
+ }
+
+ if (!result[datetime]) {
+ result[datetime] = [];
+ }
+ result[datetime].push(item);
+ return result;
+ }, {} as any);
+ return Object.values(addresseeHistory) as Array;
+ }
+
},
mutations: {
setTicket(state, ticket) {