Mise à jour des messages de l'interface utilisateur pour inclure les fonctionnalités de commentaire, de motif et de transfert

This commit is contained in:
Boris Waaub 2024-04-25 11:16:08 +02:00
parent 3e10e47e29
commit b40ad9e445
5 changed files with 61 additions and 76 deletions

View File

@ -3,7 +3,6 @@
<div class="container-xxl p-3"> <div class="container-xxl p-3">
<ticket-selector-component :tickets="[]" /> <ticket-selector-component :tickets="[]" />
<ticket-history-list-component :history="ticket.history" /> <ticket-history-list-component :history="ticket.history" />
<motive-list-component :motives="motives" />
</div> </div>
<action-toolbar-component /> <action-toolbar-component />
</template> </template>
@ -22,7 +21,6 @@ import TicketSelectorComponent from './components/TicketSelectorComponent.vue';
import TicketHistoryListComponent from './components/TicketHistoryListComponent.vue'; import TicketHistoryListComponent from './components/TicketHistoryListComponent.vue';
import ActionToolbarComponent from './components/ActionToolbarComponent.vue'; import ActionToolbarComponent from './components/ActionToolbarComponent.vue';
import BannerComponent from './components/BannerComponent.vue'; import BannerComponent from './components/BannerComponent.vue';
import MotiveListComponent from './components/MotiveListComponent.vue';
export default defineComponent({ export default defineComponent({
name: 'App', name: 'App',
@ -30,7 +28,6 @@ export default defineComponent({
BannerComponent, BannerComponent,
TicketSelectorComponent, TicketSelectorComponent,
TicketHistoryListComponent, TicketHistoryListComponent,
MotiveListComponent,
ActionToolbarComponent ActionToolbarComponent
}, },
setup() { setup() {
@ -44,8 +41,6 @@ export default defineComponent({
const ticket = computed(() => store.getters.getTicket as Ticket) const ticket = computed(() => store.getters.getTicket as Ticket)
onMounted(() => { onMounted(() => {
console.log(headline.value.textContent);
try { try {
store.dispatch('fetchMotives') store.dispatch('fetchMotives')
} catch (error) { } catch (error) {

View File

@ -4,29 +4,43 @@
<div class="tab-content"> <div class="tab-content">
<div v-if="activeTab === 'commentaire'" class="p-2"> <div v-if="activeTab === 'commentaire'" class="p-2">
<label class="col-form-label" for="content">{{ $t('comment.title') }}</label>
<label class="col-form-label" for="content">{{ $t('comment.label') }}</label>
<textarea v-model="comment" class="form-control" id="content" rows="3" <textarea v-model="comment" class="form-control" id="content" rows="3"
placeholder="{{ $t('comment.placeholder') }}"> :placeholder="$t('comment.label')">
</textarea> </textarea>
<div class="d-flex justify-content-end p-2">
<button class="btn btn-chill-green text-white float-right" type="submit">
<i class="fa fa-pencil"></i>
{{ $t('comment.save') }}
</button>
</div>
</div> </div>
<div v-if="activeTab === 'transfert'"> <div v-if="activeTab === 'transfert'" class="p-2">
<!-- Content for the 'Transfert' tab pane --> <label class="col-form-label" for="content">{{ $t('transfert.title') }}</label>
<p>This is the Transfert tab pane content.</p>
<div class="d-flex justify-content-end p-2">
<button class="btn btn-chill-green text-white float-right" type="submit">
<i class="fa fa-pencil"></i>
{{ $t('transfert.save') }}
</button>
</div>
</div> </div>
<div v-if="activeTab === 'motif'"> <div v-if="activeTab === 'motif'" class="p-2">
<!-- Content for the 'Motif' tab pane --> <label class="col-form-label" for="content">{{ $t('motive.title') }}</label>
<p>This is the Motif tab pane content.</p> <div>
</div> <MotiveSelectorComponent :motives="motives" />
<div v-if="activeTab === 'fermer'"> </div>
<!-- Content for the 'Fermer' tab pane --> <div class="d-flex justify-content-end p-2">
<p>This is the Fermer tab pane content.</p> <button class="btn btn-chill-green text-white float-right" type="submit">
<i class="fa fa-pencil"></i>
{{ $t('motive.save') }}
</button>
</div>
</div> </div>
</div> </div>
<button class="btn btn-chill-green text-white">Enregistrer</button>
</div> </div>
<div class="footer-ticket-main"> <div class="footer-ticket-main">
<ul class="nav nav-tabs justify-content-end"> <ul class="nav nav-tabs justify-content-end">
@ -49,7 +63,7 @@
</button> </button>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<button type="button" class="m-2 btn btn-light" @click="activeTab = 'fermer'"> <button type="button" class="m-2 btn btn-light" @click="activeTab = ''">
<i class="fa fa-bolt"></i> <i class="fa fa-bolt"></i>
Fermer Fermer
</button> </button>
@ -61,17 +75,24 @@
<script lang="ts"> <script lang="ts">
import { defineComponent, ref } from 'vue'; import { computed, defineComponent, ref } from 'vue';
import { useStore } from 'vuex'; import { useStore } from 'vuex';
import MotiveSelectorComponent from './MotiveSelectorComponent.vue';
import { Motive } from '../../../types';
export default defineComponent({ export default defineComponent({
name: 'ActionToolbarComponent', name: 'ActionToolbarComponent',
components: {
MotiveSelectorComponent
},
setup(props, ctx) { setup(props, ctx) {
const store = useStore(); const store = useStore();
const editor = ref(); const editor = ref();
const activeTab = ref(""); const activeTab = ref("");
const comment = ref(""); const comment = ref("");
const motives = computed(() => store.getters.getMotives as Motive[])
return { return {
motives,
activeTab, activeTab,
comment, comment,
editor, editor,

View File

@ -1,43 +0,0 @@
<template>
<div class="card my-2 bg-light" v-for="motive in motives" :key="motive.id">
<div class="card-header">
<span class="fw-bold fst-italic">
</span>
<span class="badge bg-white text-black mx-1">{{motive.active}}</span>
</div>
<div class="card-body row fst-italic">
<div class="col-12">
<i class="fa fa-comment" style="min-width: 16px;"></i>
<span class="mx-1">
{{ motive.label.fr }}
</span>
</div>
</div>
</div>
</template>
<script lang="ts">
import { PropType, defineComponent } from 'vue';
// Types
import { Motive } from '../../../types';
export default defineComponent({
name: 'MotiveListComponent',
props: {
motives: {
type: Object as PropType<Motive[]>,
required: true,
},
},
setup() {
return {}
}
});
</script>
<style lang="scss" scoped></style>

View File

@ -1,17 +1,14 @@
<template> <template>
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-light dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> <button type="button" class="btn btn-light dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
{{ $t('ticket.previous_tickets') }} {{ $t('motive.label') }}
<span class="badge rounded-pill bg-chill-green"> <span class="visually-hidden">{{ $t('motive.label') }}</span>
{{ tickets.length }}
<span class="visually-hidden">Tickets</span>
</span>
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><button class="dropdown-item" type="button">Action</button></li> <li v-for="motive in motives" :key="motive.label.fr"><button class="dropdown-item" type="button">
<li><button class="dropdown-item" type="button">Another action</button></li> {{ motive.label.fr }}
<li><button class="dropdown-item" type="button">Something else here</button></li> </button>
</li>
</ul> </ul>
</div> </div>
</template> </template>
@ -23,13 +20,13 @@ import { PropType, defineComponent } from 'vue';
// Types // Types
import { Ticket } from '../../../types'; import { Motive } from '../../../types';
export default defineComponent({ export default defineComponent({
name: 'MotiveSelectorComponent', name: 'MotiveSelectorComponent',
props: { props: {
tickets: { motives: {
type: Object as PropType<Ticket[]>, type: Object as PropType<Motive[]>,
required: true, required: true,
}, },
}, },

View File

@ -8,5 +8,20 @@ export const messages = {
user: "Prise en charge par {username}", user: "Prise en charge par {username}",
motive: "Motif indiqué: {motive}", motive: "Motif indiqué: {motive}",
}, },
comment: {
title: "Commentaire",
label: "Ajouter un commentaire",
save: "Enregistrer",
},
motive: {
title: "Motif",
label: "Ajouter un motif",
save: "Enregistrer",
},
transfert: {
title: "Transfert",
label: "Transferer vers",
save: "Enregistrer",
},
}, },
}; };