Skip to content

Commit bdc8d93

Browse files
remoove any type
1 parent ce2cc3f commit bdc8d93

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

app/src/components/ticket/rightPanel.vue

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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"]
132132
type SlaPartDto = components["schemas"]["SlaPartDto"]
133133
type EntityPartDto = components["schemas"]["EntityPartDto"]
134134
type 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']
135139
const props = defineProps({
136140
ticketData: {
137141
type: Object,
@@ -186,7 +190,7 @@ if (entitiesError.value) {
186190
}
187191
188192
const 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
201205
const 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
214218
const 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
218222
const 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
222226
const 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
226230
const 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
235239
const 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
})

app/src/pages/tickets.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ const pagination = ref<QTableProps['pagination']>({
252252
descending: true
253253
})
254254
255-
const onRequest = async (props: any) => {
255+
const onRequest = async (props: QTableProps) => {
256256
const { page, rowsPerPage, sortBy, descending } = props.pagination
257257
pagination.value!.rowsNumber = tickets.value?.total
258258
pagination.value!.page = page
@@ -309,9 +309,9 @@ const fieldsList = computed(() => {
309309
)
310310
})
311311
312-
const getState = (state: { id: string, name: string }) => {
313-
const findedState = states.value?.data.find((s: any) => {
314-
return s._id === state.id
312+
const getState = (stateParam: { id: string, name: string }) => {
313+
const findedState = states.value?.data.find((state: State) => {
314+
return state._id === stateParam.id
315315
})
316316
return findedState
317317
}

0 commit comments

Comments
 (0)