refactor: refs #8440 update required and deletable attribute checks to use originalAttrs
This commit is contained in:
parent
82b2180cba
commit
01af6e8c2d
|
@ -19,9 +19,8 @@ import VnInput from 'components/common/VnInput.vue';
|
|||
const emit = defineEmits(['onFetch']);
|
||||
|
||||
const originalAttrs = useAttrs();
|
||||
|
||||
const $attrs = computed(() => {
|
||||
const { style, ...rest } = originalAttrs;
|
||||
const { style, required, deletable, ...rest } = originalAttrs;
|
||||
return rest;
|
||||
});
|
||||
|
||||
|
@ -149,7 +148,7 @@ function fetchData([data]) {
|
|||
v-model="newNote.observationTypeFk"
|
||||
option-label="description"
|
||||
style="flex: 0.15"
|
||||
:required="Object.keys($attrs).includes('required')"
|
||||
:required="Object.keys(originalAttrs).includes('required')"
|
||||
@keyup.enter.stop="insert"
|
||||
/>
|
||||
<VnInput
|
||||
|
@ -159,7 +158,7 @@ function fetchData([data]) {
|
|||
filled
|
||||
autogrow
|
||||
@keyup.enter.stop="handleClick"
|
||||
:required="Object.keys($attrs).includes('required')"
|
||||
:required="Object.keys(originalAttrs).includes('required')"
|
||||
clearable
|
||||
>
|
||||
<template #append>
|
||||
|
@ -231,13 +230,15 @@ function fetchData([data]) {
|
|||
<span v-text="toDateHourMin(note.created)" />
|
||||
<div>
|
||||
<QIcon
|
||||
v-if="Object.keys($attrs).includes('deletable')"
|
||||
v-if="
|
||||
Object.keys(originalAttrs).includes('deletable')
|
||||
"
|
||||
name="delete"
|
||||
size="sm"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
@click="deleteNote(note)"
|
||||
data-cy="ticketNotesRemoveNoteBtn"
|
||||
data-cy="notesRemoveNoteBtn"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('ticketNotes.removeNote') }}
|
||||
|
|
Loading…
Reference in New Issue