update permissions
This commit is contained in:
parent
6c1140f7d2
commit
8c4a53bc17
22 changed files with 89 additions and 24 deletions
|
@ -19,6 +19,7 @@
|
|||
v-if="!editStatus && !activeDamageReportObj.done"
|
||||
primary
|
||||
class="w-fit! self-end"
|
||||
:disabled="!can('update', 'unit', 'damage_report')"
|
||||
@click="editStatus = true"
|
||||
>
|
||||
Status ändern
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<template #pageRow="{ row }: { row: DamageReportViewModel }">
|
||||
<RouterLink
|
||||
:to="{ name: 'admin-unit-damage_report-overview', params: { damageReportId: row.id } }"
|
||||
:disabled="!can('create', 'unit', 'damage_report')"
|
||||
class="flex flex-col h-fit w-full border border-primary rounded-md"
|
||||
>
|
||||
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
<template #pageRow="{ row }: { row: InspectionViewModel }">
|
||||
<RouterLink
|
||||
:to="{ name: 'admin-unit-inspection-execute', params: { inspectionId: row.id } }"
|
||||
:disabled="!can('create', 'unit', 'inspection')"
|
||||
class="flex flex-col h-fit w-full border border-primary rounded-md"
|
||||
>
|
||||
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
|
||||
|
@ -24,8 +25,8 @@
|
|||
</Pagination>
|
||||
<div class="flex flex-row gap-4">
|
||||
<RouterLink
|
||||
v-if="can('create', 'unit', 'equipment')"
|
||||
:to="{ name: 'admin-unit-inspection-start', params: { type: 'equipment', relatedId: equipmentId } }"
|
||||
:disable="!can('create', 'unit', 'inspection')"
|
||||
button
|
||||
primary
|
||||
class="w-fit!"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<template #pageRow="{ row }: { row: RepairViewModel }">
|
||||
<RouterLink
|
||||
:to="{ name: 'admin-unit-repair-overview', params: { repairId: row.id } }"
|
||||
:disabled="!can('create', 'unit', 'repair')"
|
||||
class="flex flex-col h-fit w-full border border-primary rounded-md"
|
||||
>
|
||||
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
|
||||
|
@ -24,6 +25,7 @@
|
|||
</Pagination>
|
||||
<RouterLink
|
||||
:to="{ name: 'admin-unit-repair-create', params: { type: 'equipment', relatedId: equipmentId } }"
|
||||
:disabled="!can('create', 'unit', 'repair')"
|
||||
button
|
||||
primary
|
||||
class="w-fit!"
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
</div>
|
||||
<div class="flex flex-row gap-4">
|
||||
<RouterLink
|
||||
v-if="can('create', 'unit', 'equipment_type')"
|
||||
:to="{ name: 'admin-unit-inspection_plan-create', query: { type: 'equipment', id: equipmentTypeId } }"
|
||||
:disabled="!can('create', 'unit', 'inspection_plan')"
|
||||
button
|
||||
primary
|
||||
class="w-fit!"
|
||||
|
|
|
@ -31,35 +31,38 @@
|
|||
<OkNotOk
|
||||
v-if="point.type == InspectionPointEnum.oknok"
|
||||
:inspectionPoint="point"
|
||||
:editable="activeInspectionObj.isOpen"
|
||||
:editable="activeInspectionObj.isOpen && can('update', 'unit', 'inspection')"
|
||||
:modelValue="boolPointResult(point.id)"
|
||||
@update:model-value="(val) => updateCheckResult(point.id, val)"
|
||||
/>
|
||||
<NumberInput
|
||||
v-else-if="point.type == InspectionPointEnum.number"
|
||||
:inspectionPoint="point"
|
||||
:editable="activeInspectionObj.isOpen"
|
||||
:editable="activeInspectionObj.isOpen && can('update', 'unit', 'inspection')"
|
||||
:modelValue="pointResult(point.id)"
|
||||
@update:model-value="(val) => updateCheckResult(point.id, val)"
|
||||
/>
|
||||
<TextInput
|
||||
v-else-if="point.type == InspectionPointEnum.text"
|
||||
:inspectionPoint="point"
|
||||
:editable="activeInspectionObj.isOpen"
|
||||
:editable="activeInspectionObj.isOpen && can('update', 'unit', 'inspection')"
|
||||
:modelValue="pointResult(point.id)"
|
||||
@update:model-value="(val) => updateCheckResult(point.id, val)"
|
||||
/>
|
||||
<FileInput
|
||||
v-else-if="point.type == InspectionPointEnum.file"
|
||||
:inspectionPoint="point"
|
||||
:editable="activeInspectionObj.isOpen"
|
||||
:editable="activeInspectionObj.isOpen && can('update', 'unit', 'inspection')"
|
||||
:modelValue="pointResult(point.id)"
|
||||
@update:model-value="(val) => updateCheckResult(point.id, val)"
|
||||
@update:upload="(val) => (fileStore[point.id] = val)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="activeInspectionObj.isOpen" class="flex flex-row justify-end flex-wrap min-h-fit gap-2">
|
||||
<div
|
||||
v-if="activeInspectionObj.isOpen && can('update', 'unit', 'inspection')"
|
||||
class="flex flex-row justify-end flex-wrap min-h-fit gap-2"
|
||||
>
|
||||
<button primary-outline type="reset" class="w-fit!" :disabled="canSaveOrReset" @click="resetForm">
|
||||
verwerfen
|
||||
</button>
|
||||
|
@ -85,7 +88,7 @@
|
|||
<SuccessCheckmark v-else-if="status?.status == 'success'" />
|
||||
<FailureXMark v-else-if="status?.status == 'failed'" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-else-if="!activeInspectionObj.isOpen">
|
||||
<button primary type="button" @click="openPrintModal">Bericht anzeigen</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
<div class="flex flex-row gap-4">
|
||||
<RouterLink
|
||||
v-if="can('create', 'unit', 'inspection_plan')"
|
||||
:to="{ name: 'admin-unit-inspection_plan-create' }"
|
||||
:disabled="!can('create', 'unit', 'inspection_plan')"
|
||||
primary
|
||||
button
|
||||
class="w-fit!"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
:related="activeRepairObj.assigned"
|
||||
:relatedId="activeRepairObj.relatedId"
|
||||
:model-value="activeRepairObj.reports.map((r) => r.id)"
|
||||
:disabled="!!activeRepairObj.finishedAt"
|
||||
:disabled="!!activeRepairObj.finishedAt || !can('update', 'unit', 'repair')"
|
||||
@add:damage-report="handleReportAdd"
|
||||
@remove:difference="handleReportRemove"
|
||||
/>
|
||||
|
@ -28,7 +28,12 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button primary class="w-fit! self-end" :disabled="!!activeRepairObj.finishedAt" @click="saveReports">
|
||||
<button
|
||||
primary
|
||||
class="w-fit! self-end"
|
||||
:disabled="!!activeRepairObj.finishedAt || !can('update', 'unit', 'repair')"
|
||||
@click="saveReports"
|
||||
>
|
||||
Änderungen speichern
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
</div>
|
||||
<button
|
||||
v-if="!editStatus && !activeRepairObj.finishedAt"
|
||||
:disabled="!can('update', 'unit', 'repair')"
|
||||
primary
|
||||
class="w-fit! self-end"
|
||||
@click="editStatus = true"
|
||||
|
@ -20,17 +21,39 @@
|
|||
<form class="flex flex-col gap-2" @submit.prevent="saveData">
|
||||
<div>
|
||||
<label for="title">Kurzbeschreibung</label>
|
||||
<input id="title" type="text" placeholder="---" :value="activeRepairObj.title" />
|
||||
<input
|
||||
id="title"
|
||||
type="text"
|
||||
placeholder="---"
|
||||
:value="activeRepairObj.title"
|
||||
:disabled="!!activeRepairObj.finishedAt || !can('update', 'unit', 'repair')"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="description">Beschreibung der Reparatur</label>
|
||||
<textarea id="description" placeholder="---" :value="activeRepairObj.description"></textarea>
|
||||
<textarea
|
||||
id="description"
|
||||
placeholder="---"
|
||||
:value="activeRepairObj.description"
|
||||
:disabled="!!activeRepairObj.finishedAt || !can('update', 'unit', 'repair')"
|
||||
></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label for="responsible">Verantwortlich</label>
|
||||
<input id="responsible" type="text" placeholder="---" :value="activeRepairObj.responsible" />
|
||||
<input
|
||||
id="responsible"
|
||||
type="text"
|
||||
placeholder="---"
|
||||
:value="activeRepairObj.responsible"
|
||||
:disabled="!!activeRepairObj.finishedAt || !can('update', 'unit', 'repair')"
|
||||
/>
|
||||
</div>
|
||||
<button primary type="submit" class="w-fit! self-end" :disabled="!!activeRepairObj.finishedAt">
|
||||
<button
|
||||
primary
|
||||
type="submit"
|
||||
class="w-fit! self-end"
|
||||
:disabled="!!activeRepairObj.finishedAt || !can('update', 'unit', 'repair')"
|
||||
>
|
||||
Änderungen speichern
|
||||
</button>
|
||||
</form>
|
||||
|
|
|
@ -21,7 +21,13 @@
|
|||
</RouterLink>
|
||||
</div>
|
||||
<RouterView />
|
||||
<RouterLink :to="{ name: 'admin-unit-repair-create' }" button primary class="w-fit!">
|
||||
<RouterLink
|
||||
:to="{ name: 'admin-unit-repair-create' }"
|
||||
button
|
||||
primary
|
||||
class="w-fit!"
|
||||
:disabled="!can('create', 'unit', 'repair')"
|
||||
>
|
||||
Reparatur erstellen
|
||||
</RouterLink>
|
||||
</div>
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<template #pageRow="{ row }: { row: DamageReportViewModel }">
|
||||
<RouterLink
|
||||
:to="{ name: 'admin-unit-damage_report-overview', params: { damageReportId: row.id } }"
|
||||
:disabled="!can('read', 'unit', 'damage_report')"
|
||||
class="flex flex-col h-fit w-full border border-primary rounded-md"
|
||||
>
|
||||
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<template #pageRow="{ row }: { row: InspectionViewModel }">
|
||||
<RouterLink
|
||||
:to="{ name: 'admin-unit-inspection-execute', params: { inspectionId: row.id } }"
|
||||
:disabled="!can('read', 'unit', 'inspection')"
|
||||
class="flex flex-col h-fit w-full border border-primary rounded-md"
|
||||
>
|
||||
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
|
||||
|
@ -25,8 +26,8 @@
|
|||
</Pagination>
|
||||
<div class="flex flex-row gap-4">
|
||||
<RouterLink
|
||||
v-if="can('create', 'unit', 'vehicle')"
|
||||
:to="{ name: 'admin-unit-inspection-start', params: { type: 'vehicle', relatedId: vehicleId } }"
|
||||
:disabled="!can('read', 'unit', 'damage_report')"
|
||||
button
|
||||
primary
|
||||
class="w-fit!"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<template #pageRow="{ row }: { row: RepairViewModel }">
|
||||
<RouterLink
|
||||
:to="{ name: 'admin-unit-repair-overview', params: { repairId: row.id } }"
|
||||
:disabled="!can('read', 'unit', 'repair')"
|
||||
class="flex flex-col h-fit w-full border border-primary rounded-md"
|
||||
>
|
||||
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
|
||||
|
@ -24,6 +25,7 @@
|
|||
</Pagination>
|
||||
<RouterLink
|
||||
:to="{ name: 'admin-unit-repair-create', params: { type: 'vehicle', relatedId: vehicleId } }"
|
||||
:disabled="!can('read', 'unit', 'repair')"
|
||||
button
|
||||
primary
|
||||
class="w-fit!"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<div class="flex flex-row gap-4">
|
||||
<RouterLink
|
||||
v-if="can('create', 'unit', 'equipment')"
|
||||
v-if="can('create', 'unit', 'vehicle')"
|
||||
:to="{ name: 'admin-unit-vehicle-create' }"
|
||||
primary
|
||||
button
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
<div class="flex flex-row gap-4">
|
||||
<RouterLink
|
||||
v-if="can('create', 'unit', 'vehicle_type')"
|
||||
:to="{ name: 'admin-unit-inspection_plan-create', query: { type: 'vehicle', id: vehicleTypeId } }"
|
||||
:disabled="!can('read', 'unit', 'inspection_plan')"
|
||||
button
|
||||
primary
|
||||
class="w-fit!"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<template #pageRow="{ row }: { row: DamageReportViewModel }">
|
||||
<RouterLink
|
||||
:to="{ name: 'admin-unit-damage_report-overview', params: { damageReportId: row.id } }"
|
||||
:disabled="!can('read', 'unit', 'damage_report')"
|
||||
class="flex flex-col h-fit w-full border border-primary rounded-md"
|
||||
>
|
||||
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<template #pageRow="{ row }: { row: InspectionViewModel }">
|
||||
<RouterLink
|
||||
:to="{ name: 'admin-unit-inspection-execute', params: { inspectionId: row.id } }"
|
||||
:disabled="!can('read', 'unit', 'inspection')"
|
||||
class="flex flex-col h-fit w-full border border-primary rounded-md"
|
||||
>
|
||||
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
|
||||
|
@ -25,8 +26,8 @@
|
|||
</Pagination>
|
||||
<div class="flex flex-row gap-4">
|
||||
<RouterLink
|
||||
v-if="can('create', 'unit', 'wearable')"
|
||||
:to="{ name: 'admin-unit-inspection-start', params: { type: 'wearable', relatedId: wearableId } }"
|
||||
:disabled="!can('create', 'unit', 'inspection')"
|
||||
button
|
||||
primary
|
||||
class="w-fit!"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<template #pageRow="{ row }: { row: RepairViewModel }">
|
||||
<RouterLink
|
||||
:to="{ name: 'admin-unit-repair-overview', params: { repairId: row.id } }"
|
||||
:disabled="!can('read', 'unit', 'repair')"
|
||||
class="flex flex-col h-fit w-full border border-primary rounded-md"
|
||||
>
|
||||
<div class="bg-primary p-2 text-white flex flex-row gap-2 items-center">
|
||||
|
@ -24,6 +25,7 @@
|
|||
</Pagination>
|
||||
<RouterLink
|
||||
:to="{ name: 'admin-unit-repair-create', params: { type: 'wearable', relatedId: wearableId } }"
|
||||
:disabled="!can('read', 'unit', 'repair')"
|
||||
button
|
||||
primary
|
||||
class="w-fit!"
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
<div class="flex flex-row gap-4">
|
||||
<RouterLink
|
||||
v-if="can('create', 'unit', 'vehicle_type')"
|
||||
:to="{ name: 'admin-unit-inspection_plan-create', query: { type: 'vehicle', id: vehicleTypeId } }"
|
||||
:disabled="!can('read', 'unit', 'inspection_plan')"
|
||||
button
|
||||
primary
|
||||
class="w-fit!"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue