refactor: simplify OwnerVerificationRowActions component by removing unused props and updating related usages in data table actions

This commit is contained in:
Yoga Pangestu 2026-06-28 23:28:14 +07:00
parent 8f66502f25
commit f20889e962
5 changed files with 3 additions and 28 deletions

View File

@ -24,9 +24,6 @@ import { approve, reject, approve_request, reject_request } from '@/routes/admin
const props = defineProps<{
type: 'request' | 'cutting';
id: number;
title?: string;
subjectLabel?: string;
actionLabel?: string;
}>();
const { can } = useCan();
@ -98,21 +95,6 @@ function submitReject() {
</DialogHeader>
<div class="space-y-4">
<div v-if="subjectLabel || title || actionLabel" class="rounded-md border p-3 text-xs space-y-2">
<div v-if="subjectLabel">
<span class="text-muted-foreground">Modul:</span>
<span class="ml-1 font-medium">{{ subjectLabel }}</span>
</div>
<div v-if="title">
<span class="text-muted-foreground">Item:</span>
<span class="ml-1 font-medium">{{ title }}</span>
</div>
<div v-if="actionLabel">
<span class="text-muted-foreground">Aksi:</span>
<span class="ml-1 font-medium">{{ actionLabel }}</span>
</div>
</div>
<Field>
<FieldLabel for="owner-verification-reject-reason">Alasan Penolakan</FieldLabel>
<Textarea id="owner-verification-reject-reason" v-model="rejectForm.reason"

View File

@ -264,8 +264,7 @@ watch(rejectDialogOpen, (isOpen) => {
<template>
<div class="flex flex-wrap items-center justify-end gap-1">
<OwnerVerificationRowActions v-if="cutting.status === CuttingStatus.PENDING_VERIFICATION" type="cutting"
:id="cutting.id" :title="cutting.description ?? `Cutting #${cutting.id}`" subject-label="Cutting"
action-label="Verifikasi Stok" />
:id="cutting.id" />
<template v-for="action in availableActions" :key="action.status">
<RowStatusAction v-if="canPerformAction(action)" :size="'sm'" :icon="cuttingStatusActionIcon(action.status)"

View File

@ -15,9 +15,7 @@ const { can } = useCan();
<template>
<div class="flex items-center justify-end gap-1">
<OwnerVerificationRowActions v-if="purchase.has_pending_request && purchase.pending_request_id" type="request"
:id="purchase.pending_request_id"
:title="`${purchase.total_formatted} — ${purchase.supplier?.name ?? purchase.supplier_name ?? 'Supplier'}`"
subject-label="Belanja" :action-label="purchase.pending_request_action_label" />
:id="purchase.pending_request_id" />
<RowEditAction v-if="can('purchases.update')" :href="edit.url(purchase.id)"
:disabled="purchase.has_pending_request"

View File

@ -46,8 +46,7 @@ function handleTransferClick() {
<template>
<div class="flex items-center justify-end gap-1">
<OwnerVerificationRowActions v-if="product.has_pending_request && product.pending_request_id" type="request"
:id="product.pending_request_id" :title="product.name" subject-label="Produk"
:action-label="product.pending_request_action_label" />
:id="product.pending_request_id" />
<RowTransferAction
v-if="can('stocks.view')"

View File

@ -18,9 +18,6 @@ const { can } = useCan();
v-if="material.has_pending_request && material.pending_request_id"
type="request"
:id="material.pending_request_id"
:title="material.name"
subject-label="Bahan Baku"
:action-label="material.pending_request_action_label"
/>
<RowEditAction