refactor: add hideDelete prop to various components and update delete button visibility logic
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 6s

This commit is contained in:
puriphatt 2025-07-07 10:40:35 +07:00
parent f646b3c9ba
commit a5791a1b54
7 changed files with 40 additions and 57 deletions

View file

@ -102,7 +102,13 @@ const telephoneNo = defineModel<string>('telephoneNo', { default: '' });
class="col-md-6"
:readonly
:disabled="
!isRoleInclude(['admin', 'system', 'head_of_admin']) && !readonly
!isRoleInclude([
'admin',
'system',
'head_of_admin',
'executive',
'accountant',
]) && !readonly
"
:label="$t('customer.form.registeredBranch')"
select-first-value

View file

@ -51,6 +51,7 @@ withDefaults(
actionDisabled?: boolean;
customerType?: 'CORP' | 'PERS';
hideAction?: boolean;
hideDelete?: boolean;
}>(),
{
hideAction: false,
@ -81,7 +82,7 @@ withDefaults(
/>
<DeleteButton
icon-only
v-if="readonly"
v-if="readonly && !hideDelete"
@click="$emit('delete')"
type="button"
:disabled="actionDisabled"