store/resources/js/pages/admin/system/roles/table/data-table-actions.vue
Yoga Pangestu 15e2b7ec5b
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (8.3) (push) Waiting to run
tests / ci (8.4) (push) Waiting to run
tests / ci (8.5) (push) Waiting to run
feat: add material_result field to CuttingMaterial and CuttingMaterialCombination; update validation rules and service logic to handle new material result calculations; enhance frontend components for displaying material results in cutting management
2026-07-04 23:14:37 +07:00

27 lines
1.0 KiB
Vue

<script setup lang="ts">
import { computed } from 'vue';
import { RowDeleteAction, RowEditAction } from '@/components/button';
import { useCan } from '@/composables/useCan';
import { edit, destroy } from '@/routes/admin/system/roles';
import type { RoleListItem } from './columns';
const props = defineProps<{
role: RoleListItem;
}>();
const { can } = useCan();
const isSystemRole = computed(() => {
return ['developer', 'owner', 'admin-toko', 'admin-bahan-baku', 'direktur', 'marketing-offline', 'marketing-online', 'cashier', 'non-operator'].includes(props.role.name);
});
</script>
<template>
<div class="flex items-center justify-end gap-1">
<RowEditAction v-if="can('roles.update')" :href="edit.url(role.id)" />
<RowDeleteAction v-if="can('roles.delete') && !isSystemRole" :action-url="destroy.url(role.id)" title="Hapus role?"
:description="`Role ${role.name} akan dihapus secara permanen. Tindakan ini tidak dapat dibatalkan.`"
error-message="Gagal menghapus role." />
</div>
</template>