refactor: simplify OwnerVerificationRowActions component by removing unused props and updating related usages in data table actions
This commit is contained in:
parent
8f66502f25
commit
f20889e962
@ -24,9 +24,6 @@ import { approve, reject, approve_request, reject_request } from '@/routes/admin
|
|||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
type: 'request' | 'cutting';
|
type: 'request' | 'cutting';
|
||||||
id: number;
|
id: number;
|
||||||
title?: string;
|
|
||||||
subjectLabel?: string;
|
|
||||||
actionLabel?: string;
|
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const { can } = useCan();
|
const { can } = useCan();
|
||||||
@ -98,21 +95,6 @@ function submitReject() {
|
|||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
|
|
||||||
<div class="space-y-4">
|
<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>
|
<Field>
|
||||||
<FieldLabel for="owner-verification-reject-reason">Alasan Penolakan</FieldLabel>
|
<FieldLabel for="owner-verification-reject-reason">Alasan Penolakan</FieldLabel>
|
||||||
<Textarea id="owner-verification-reject-reason" v-model="rejectForm.reason"
|
<Textarea id="owner-verification-reject-reason" v-model="rejectForm.reason"
|
||||||
|
|||||||
@ -264,8 +264,7 @@ watch(rejectDialogOpen, (isOpen) => {
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex flex-wrap items-center justify-end gap-1">
|
<div class="flex flex-wrap items-center justify-end gap-1">
|
||||||
<OwnerVerificationRowActions v-if="cutting.status === CuttingStatus.PENDING_VERIFICATION" type="cutting"
|
<OwnerVerificationRowActions v-if="cutting.status === CuttingStatus.PENDING_VERIFICATION" type="cutting"
|
||||||
:id="cutting.id" :title="cutting.description ?? `Cutting #${cutting.id}`" subject-label="Cutting"
|
:id="cutting.id" />
|
||||||
action-label="Verifikasi Stok" />
|
|
||||||
|
|
||||||
<template v-for="action in availableActions" :key="action.status">
|
<template v-for="action in availableActions" :key="action.status">
|
||||||
<RowStatusAction v-if="canPerformAction(action)" :size="'sm'" :icon="cuttingStatusActionIcon(action.status)"
|
<RowStatusAction v-if="canPerformAction(action)" :size="'sm'" :icon="cuttingStatusActionIcon(action.status)"
|
||||||
|
|||||||
@ -15,9 +15,7 @@ const { can } = useCan();
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex items-center justify-end gap-1">
|
<div class="flex items-center justify-end gap-1">
|
||||||
<OwnerVerificationRowActions v-if="purchase.has_pending_request && purchase.pending_request_id" type="request"
|
<OwnerVerificationRowActions v-if="purchase.has_pending_request && purchase.pending_request_id" type="request"
|
||||||
:id="purchase.pending_request_id"
|
: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" />
|
|
||||||
|
|
||||||
<RowEditAction v-if="can('purchases.update')" :href="edit.url(purchase.id)"
|
<RowEditAction v-if="can('purchases.update')" :href="edit.url(purchase.id)"
|
||||||
:disabled="purchase.has_pending_request"
|
:disabled="purchase.has_pending_request"
|
||||||
|
|||||||
@ -46,8 +46,7 @@ function handleTransferClick() {
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex items-center justify-end gap-1">
|
<div class="flex items-center justify-end gap-1">
|
||||||
<OwnerVerificationRowActions v-if="product.has_pending_request && product.pending_request_id" type="request"
|
<OwnerVerificationRowActions v-if="product.has_pending_request && product.pending_request_id" type="request"
|
||||||
:id="product.pending_request_id" :title="product.name" subject-label="Produk"
|
:id="product.pending_request_id" />
|
||||||
:action-label="product.pending_request_action_label" />
|
|
||||||
|
|
||||||
<RowTransferAction
|
<RowTransferAction
|
||||||
v-if="can('stocks.view')"
|
v-if="can('stocks.view')"
|
||||||
|
|||||||
@ -18,9 +18,6 @@ const { can } = useCan();
|
|||||||
v-if="material.has_pending_request && material.pending_request_id"
|
v-if="material.has_pending_request && material.pending_request_id"
|
||||||
type="request"
|
type="request"
|
||||||
:id="material.pending_request_id"
|
:id="material.pending_request_id"
|
||||||
:title="material.name"
|
|
||||||
subject-label="Bahan Baku"
|
|
||||||
:action-label="material.pending_request_action_label"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<RowEditAction
|
<RowEditAction
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user