@@ -6,7 +6,7 @@ q-scroll-area(:style="{height: '100%'}")
66 q-btn( @click ="showCloseTicketDialog()" color ="red" icon ="mdi-close" size ="md" : disable= "isDisabledTicket" )
77 q-tooltip.text-body2 Cloturer
88 q-btn(
9- v-if ="!props.ticketData.envelope.assigned.find((user: any ) => user.id === store.state.value.auth.user._id)"
9+ v-if ="!props.ticketData.envelope.assigned.find((user) => user.id === store.state.value.auth.user._id)"
1010 color ="green" icon ="mdi-clipboard-arrow-down-outline" @click ="assignTicket" size ="md" : disable= "isDisabledTicket"
1111 )
1212 q-tooltip.text-body2 M'assigner le ticket
@@ -132,6 +132,10 @@ type IdnamePartDto = components["schemas"]["IdnamePartDto"]
132132type SlaPartDto = components [" schemas" ][" SlaPartDto" ]
133133type EntityPartDto = components [" schemas" ][" EntityPartDto" ]
134134type TicketType = components [' schemas' ][' TicketDto' ]
135+ type Entity = components [' schemas' ][' EntityDto' ]
136+ type State = components [' schemas' ][' StateDto' ]
137+ type Project = components [' schemas' ][' ProjectDto' ]
138+ type Sla = components [' schemas' ][' SlaDto' ]
135139const props = defineProps ({
136140 ticketData: {
137141 type: Object ,
@@ -186,7 +190,7 @@ if (entitiesError.value) {
186190}
187191
188192const observers = computed (() => {
189- return entities .value ?.data .reduce ((acc : any , entity : any ) => {
193+ return entities .value ?.data .reduce ((acc : { id : string , name : string , type : number }[], entity : Entity ) => {
190194 if (entity .type <= EntityType .OTHER ) {
191195 acc .push ({
192196 id: entity ._id ,
@@ -199,7 +203,7 @@ const observers = computed(() => {
199203})
200204
201205const assigned = computed (() => {
202- return entities .value ?.data .reduce ((acc : any , entity : any ) => {
206+ return entities .value ?.data .reduce ((acc : { id : string , name : string , type : number }[], entity : Entity ) => {
203207 if (entity .type <= EntityType .AGENT ) {
204208 acc .push ({
205209 id: entity ._id ,
@@ -212,19 +216,19 @@ const assigned = computed(() => {
212216})
213217
214218const typeOfTicket = computed (() => {
215- return ticketType .find ((type : any ) => type .value === props .ticketData .type )
219+ return ticketType .find ((type ) => type .value === props .ticketData .type )
216220})
217221
218222const lifestepOfTicket = computed (() => {
219- return lifeSteps .find ((step : any ) => step .value === props .ticketData .lifestep )
223+ return lifeSteps .find ((step ) => step .value === props .ticketData .lifestep )
220224})
221225
222226const stateOfTicket = computed (() => {
223- return states .value ?.data .find ((state : any ) => state ._id === props .ticketData .state ?.id )
227+ return states .value ?.data .find ((state : State ) => state ._id === props .ticketData .state ?.id )
224228})
225229
226230const getProjectsData = computed (() => {
227- return projects .value ?.data .map ((project : any ) => {
231+ return projects .value ?.data .map ((project : Project ) => {
228232 return {
229233 id: project ._id ,
230234 name: project .name ,
@@ -233,7 +237,7 @@ const getProjectsData = computed(() => {
233237})
234238
235239const getSlaData = computed (() => {
236- return sla .value ?.data .map ((sla : any ) => {
240+ return sla .value ?.data .map ((sla : Sla ) => {
237241 return {
238242 id: sla ._id ,
239243 name: sla .name ,
@@ -382,7 +386,7 @@ const unasignTicket = async () => {
382386 body: {
383387 envelope: {
384388 ... props .ticketData .envelope ,
385- assigned: props .ticketData .envelope .assigned .filter ((user : any ) => user .id !== store .state .value .auth .user ._id )
389+ assigned: props .ticketData .envelope .assigned .filter ((user : { id : string , name : string , type : number } ) => user .id !== store .state .value .auth .user ._id )
386390 }
387391 }
388392 })
0 commit comments