Dev branch

This commit is contained in:
Simon Pocrnjič
2025-11-02 12:31:01 +01:00
parent 5f879c9436
commit 63e0958b66
241 changed files with 17686 additions and 7327 deletions
@@ -2,7 +2,8 @@
import AppLayout from '@/Layouts/AppLayout.vue'
import SectionTitle from '@/Components/SectionTitle.vue'
import PrimaryButton from '@/Components/PrimaryButton.vue'
import DialogModal from '@/Components/DialogModal.vue'
import CreateDialog from '@/Components/Dialogs/CreateDialog.vue'
import UpdateDialog from '@/Components/Dialogs/UpdateDialog.vue'
import ConfirmationModal from '@/Components/ConfirmationModal.vue'
import InputLabel from '@/Components/InputLabel.vue'
import InputError from '@/Components/InputError.vue'
@@ -97,10 +98,16 @@ const destroyConfig = () => {
</div>
<!-- create modal -->
<DialogModal :show="showCreate" @close="closeCreate">
<template #title>New Contract Configuration</template>
<template #content>
<div class="space-y-4">
<CreateDialog
:show="showCreate"
title="New Contract Configuration"
confirm-text="Create"
:processing="createForm.processing"
:disabled="!createForm.contract_type_id || !createForm.segment_id"
@close="closeCreate"
@confirm="submitCreate"
>
<div class="space-y-4">
<div>
<InputLabel for="type">Contract Type</InputLabel>
<select id="type" v-model="createForm.contract_type_id" class="mt-1 w-full rounded border-gray-300 focus:border-indigo-500 focus:ring-indigo-500">
@@ -121,19 +128,20 @@ const destroyConfig = () => {
<label for="is_initial" class="text-sm text-gray-700">Mark as initial</label>
</div>
</div>
</div>
</template>
<template #footer>
<button class="px-4 py-2 rounded bg-gray-200" @click="closeCreate">Cancel</button>
<PrimaryButton class="ml-2" :disabled="createForm.processing || !createForm.contract_type_id || !createForm.segment_id" @click="submitCreate">Create</PrimaryButton>
</template>
</DialogModal>
</div>
</CreateDialog>
<!-- simple inline edit dialog -->
<DialogModal :show="!!editing" @close="closeEdit">
<template #title>Edit Configuration</template>
<template #content>
<div class="space-y-4">
<UpdateDialog
:show="!!editing"
title="Edit Configuration"
confirm-text="Save"
:processing="editForm.processing"
:disabled="!editForm.segment_id"
@close="closeEdit"
@confirm="submitEdit"
>
<div class="space-y-4">
<div>
<InputLabel>Segment</InputLabel>
<select v-model="editForm.segment_id" class="mt-1 w-full rounded border-gray-300 focus:border-indigo-500 focus:ring-indigo-500">
@@ -149,13 +157,8 @@ const destroyConfig = () => {
<input id="active" type="checkbox" v-model="editForm.active" class="rounded border-gray-300 text-indigo-600 focus:ring-indigo-500">
<label for="active" class="text-sm text-gray-700">Active</label>
</div>
</div>
</template>
<template #footer>
<button class="px-4 py-2 rounded bg-gray-200" @click="closeEdit">Cancel</button>
<PrimaryButton class="ml-2" :disabled="editForm.processing || !editForm.segment_id" @click="submitEdit">Save</PrimaryButton>
</template>
</DialogModal>
</div>
</UpdateDialog>
</AppLayout>
<ConfirmationModal :show="showDelete" @close="cancelDelete">
<template #title>
+22 -35
View File
@@ -1,7 +1,8 @@
<script setup>
import AppLayout from "@/Layouts/AppLayout.vue";
import { Link, useForm } from "@inertiajs/vue3";
import DialogModal from "@/Components/DialogModal.vue";
import CreateDialog from "@/Components/Dialogs/CreateDialog.vue";
import UpdateDialog from "@/Components/Dialogs/UpdateDialog.vue";
import PrimaryButton from "@/Components/PrimaryButton.vue";
import InputLabel from "@/Components/InputLabel.vue";
import InputError from "@/Components/InputError.vue";
@@ -162,10 +163,15 @@ watch(
<PrimaryButton @click="openCreate">+ New</PrimaryButton>
</div>
<DialogModal :show="showCreate" @close="closeCreate">
<template #title> Create Field Job Setting </template>
<template #content>
<form @submit.prevent="store">
<CreateDialog
:show="showCreate"
title="Create Field Job Setting"
confirm-text="Create"
:processing="form.processing"
@close="closeCreate"
@confirm="store"
>
<form @submit.prevent="store">
<div class="grid grid-cols-1 gap-4">
<div>
<InputLabel for="segment" value="Segment" />
@@ -308,24 +314,17 @@ watch(
<InputError :message="form.errors.queue_segment_id" class="mt-1" />
</div>
</div>
<div class="flex justify-end gap-2 mt-6">
<button
type="button"
@click="closeCreate"
class="px-4 py-2 rounded bg-gray-200 hover:bg-gray-300"
>
Cancel
</button>
<PrimaryButton :disabled="form.processing">Create</PrimaryButton>
</div>
</form>
</template>
</DialogModal>
<DialogModal :show="showEdit" @close="closeEdit">
<template #title> Edit Field Job Setting </template>
<template #content>
<form @submit.prevent="update">
</CreateDialog>
<UpdateDialog
:show="showEdit"
title="Edit Field Job Setting"
confirm-text="Save"
:processing="editForm.processing"
@close="closeEdit"
@confirm="update"
>
<form @submit.prevent="update">
<div class="grid grid-cols-1 gap-4">
<div>
<InputLabel for="edit-segment" value="Segment" />
@@ -483,20 +482,8 @@ watch(
/>
</div>
</div>
<div class="flex justify-end gap-2 mt-6">
<button
type="button"
@click="closeEdit"
class="px-4 py-2 rounded bg-gray-200 hover:bg-gray-300"
>
Cancel
</button>
<PrimaryButton :disabled="editForm.processing">Save</PrimaryButton>
</div>
</form>
</template>
</DialogModal>
</UpdateDialog>
<table class="min-w-full text-left text-sm">
<thead>
<tr class="border-b">
@@ -1,7 +1,8 @@
<script setup>
// flowbite-vue table imports removed; using DataTableClient
import { EditIcon, TrashBinIcon } from "@/Utilities/Icons";
import DialogModal from "@/Components/DialogModal.vue";
import CreateDialog from "@/Components/Dialogs/CreateDialog.vue";
import UpdateDialog from "@/Components/Dialogs/UpdateDialog.vue";
import ConfirmationModal from "@/Components/ConfirmationModal.vue";
import { computed, onMounted, ref } from "vue";
import { router, useForm } from "@inertiajs/vue3";
@@ -216,12 +217,15 @@ const destroyAction = () => {
</DataTableClient>
</div>
<DialogModal :show="drawerEdit" @close="closeEditDrawer">
<template #title>
<span>Spremeni akcijo</span>
</template>
<template #content>
<form @submit.prevent="update">
<UpdateDialog
:show="drawerEdit"
title="Spremeni akcijo"
confirm-text="Shrani"
:processing="form.processing"
@close="closeEditDrawer"
@confirm="update"
>
<form @submit.prevent="update">
<div class="col-span-6 sm:col-span-4">
<InputLabel for="name" value="Ime" />
<TextInput
@@ -271,28 +275,21 @@ const destroyAction = () => {
/>
</div>
<div class="flex justify-end mt-4">
<ActionMessage :on="form.recentlySuccessful" class="me-3">
Shranjuje.
</ActionMessage>
<PrimaryButton
:class="{ 'opacity-25': form.processing }"
:disabled="form.processing"
>
Shrani
</PrimaryButton>
<div v-if="form.recentlySuccessful" class="mt-4 text-sm text-green-600">
Shranjuje.
</div>
</form>
</template>
</DialogModal>
</UpdateDialog>
<DialogModal :show="drawerCreate" @close="closeCreateDrawer">
<template #title>
<span>Dodaj akcijo</span>
</template>
<template #content>
<form @submit.prevent="store">
<CreateDialog
:show="drawerCreate"
title="Dodaj akcijo"
confirm-text="Dodaj"
:processing="createForm.processing"
@close="closeCreateDrawer"
@confirm="store"
>
<form @submit.prevent="store">
<div class="col-span-6 sm:col-span-4">
<InputLabel for="nameCreate" value="Ime" />
<TextInput
@@ -340,21 +337,11 @@ const destroyAction = () => {
/>
</div>
<div class="flex justify-end mt-4">
<ActionMessage :on="createForm.recentlySuccessful" class="me-3">
Shranjuje.
</ActionMessage>
<PrimaryButton
:class="{ 'opacity-25': createForm.processing }"
:disabled="createForm.processing"
>
Dodaj
</PrimaryButton>
<div v-if="createForm.recentlySuccessful" class="mt-4 text-sm text-green-600">
Shranjuje.
</div>
</form>
</template>
</DialogModal>
</CreateDialog>
<ConfirmationModal :show="showDelete" @close="cancelDelete">
<template #title> Delete action </template>
@@ -1,7 +1,8 @@
<script setup>
// flowbite-vue table imports removed; using DataTableClient
import { EditIcon, TrashBinIcon, DottedMenu } from "@/Utilities/Icons";
import DialogModal from "@/Components/DialogModal.vue";
import CreateDialog from "@/Components/Dialogs/CreateDialog.vue";
import UpdateDialog from "@/Components/Dialogs/UpdateDialog.vue";
import ConfirmationModal from "@/Components/ConfirmationModal.vue";
import { computed, onMounted, ref, watch, nextTick } from "vue";
import { router, useForm } from "@inertiajs/vue3";
@@ -508,12 +509,16 @@ const destroyDecision = () => {
</template>
</DataTableClient>
</div>
<DialogModal :show="drawerEdit" @close="closeEditDrawer">
<template #title>
<span>Spremeni odločitev</span>
</template>
<template #content>
<form @submit.prevent="update">
<UpdateDialog
:show="drawerEdit"
title="Spremeni odločitev"
confirm-text="Shrani"
:processing="form.processing"
:disabled="!eventsValidEdit"
@close="closeEditDrawer"
@confirm="update"
>
<form @submit.prevent="update">
<div class="col-span-6 sm:col-span-4">
<InputLabel for="name" value="Ime" />
<TextInput
@@ -729,28 +734,22 @@ const destroyDecision = () => {
</div>
</div>
<div class="flex justify-end mt-6">
<ActionMessage :on="form.recentlySuccessful" class="me-3">
Shranjuje.
</ActionMessage>
<PrimaryButton
:class="{ 'opacity-25': form.processing || !eventsValidEdit }"
:disabled="form.processing || !eventsValidEdit"
>
Shrani
</PrimaryButton>
<div v-if="form.recentlySuccessful" class="mt-6 text-sm text-green-600">
Shranjuje.
</div>
</form>
</template>
</DialogModal>
</UpdateDialog>
<DialogModal :show="drawerCreate" @close="closeCreateDrawer">
<template #title>
<span>Dodaj odločitev</span>
</template>
<template #content>
<form @submit.prevent="store">
<CreateDialog
:show="drawerCreate"
title="Dodaj odločitev"
confirm-text="Dodaj"
:processing="createForm.processing"
:disabled="!eventsValidCreate"
@close="closeCreateDrawer"
@confirm="store"
>
<form @submit.prevent="store">
<div class="col-span-6 sm:col-span-4">
<InputLabel for="nameCreate" value="Ime" />
<TextInput
@@ -971,21 +970,11 @@ const destroyDecision = () => {
</div>
</div>
<div class="flex justify-end mt-4">
<ActionMessage :on="createForm.recentlySuccessful" class="me-3">
Shranjuje.
</ActionMessage>
<PrimaryButton
:class="{ 'opacity-25': createForm.processing || !eventsValidCreate }"
:disabled="createForm.processing || !eventsValidCreate"
>
Dodaj
</PrimaryButton>
<div v-if="createForm.recentlySuccessful" class="mt-6 text-sm text-green-600">
Shranjuje.
</div>
</form>
</template>
</DialogModal>
</CreateDialog>
<ConfirmationModal :show="showDelete" @close="cancelDelete">
<template #title> Delete decision </template>
+22 -33
View File
@@ -2,7 +2,8 @@
import AppLayout from "@/Layouts/AppLayout.vue";
import { useForm, router } from "@inertiajs/vue3";
import { ref } from "vue";
import DialogModal from "@/Components/DialogModal.vue";
import CreateDialog from "@/Components/Dialogs/CreateDialog.vue";
import UpdateDialog from "@/Components/Dialogs/UpdateDialog.vue";
import PrimaryButton from "@/Components/PrimaryButton.vue";
import InputLabel from "@/Components/InputLabel.vue";
import InputError from "@/Components/InputError.vue";
@@ -84,10 +85,15 @@ const update = () => {
<PrimaryButton @click="openCreate">+ New</PrimaryButton>
</div>
<DialogModal :show="showCreate" @close="closeCreate">
<template #title>New Segment</template>
<template #content>
<form @submit.prevent="store" class="space-y-4">
<CreateDialog
:show="showCreate"
title="New Segment"
confirm-text="Create"
:processing="createForm.processing"
@close="closeCreate"
@confirm="store"
>
<form @submit.prevent="store" class="space-y-4">
<div>
<InputLabel for="nameCreate" value="Name" />
<TextInput
@@ -120,24 +126,18 @@ const update = () => {
/>
<label for="excludeCreate">Exclude</label>
</div>
<div class="flex justify-end gap-2 mt-4">
<button
type="button"
@click="closeCreate"
class="px-4 py-2 rounded bg-gray-200 hover:bg-gray-300"
>
Cancel
</button>
<PrimaryButton :disabled="createForm.processing">Create</PrimaryButton>
</div>
</form>
</template>
</DialogModal>
</CreateDialog>
<DialogModal :show="showEdit" @close="closeEdit">
<template #title>Edit Segment</template>
<template #content>
<form @submit.prevent="update" class="space-y-4">
<UpdateDialog
:show="showEdit"
title="Edit Segment"
confirm-text="Save"
:processing="editForm.processing"
@close="closeEdit"
@confirm="update"
>
<form @submit.prevent="update" class="space-y-4">
<div>
<InputLabel for="nameEdit" value="Name" />
<TextInput
@@ -167,19 +167,8 @@ const update = () => {
<label for="excludeEdit">Exclude</label>
</div>
<div class="flex justify-end gap-2 mt-4">
<button
type="button"
@click="closeEdit"
class="px-4 py-2 rounded bg-gray-200 hover:bg-gray-300"
>
Cancel
</button>
<PrimaryButton :disabled="editForm.processing">Save</PrimaryButton>
</div>
</form>
</template>
</DialogModal>
</UpdateDialog>
<table class="min-w-full text-left text-sm">
<thead>
+11 -7
View File
@@ -1,7 +1,7 @@
<script setup>
import AppLayout from "@/Layouts/AppLayout.vue";
import { ref } from "vue";
import { FwbTab, FwbTabs } from "flowbite-vue";
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/Components/ui/tabs";
import ActionTable from "../Partials/ActionTable.vue";
import DecisionTable from "../Partials/DecisionTable.vue";
@@ -22,15 +22,19 @@ const activeTab = ref("actions");
<div class="pt-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-xl sm:rounded-lg">
<fwb-tabs v-model="activeTab" variant="underline">
<fwb-tab name="actions" title="Akcije">
<Tabs v-model="activeTab" class="w-full">
<TabsList class="w-full justify-start border-b rounded-none bg-transparent p-0">
<TabsTrigger value="actions" class="rounded-none border-b-2 border-transparent data-[state=active]:border-primary">Akcije</TabsTrigger>
<TabsTrigger value="decisions" class="rounded-none border-b-2 border-transparent data-[state=active]:border-primary">Odločitve</TabsTrigger>
</TabsList>
<TabsContent value="actions" class="mt-0">
<ActionTable
:actions="actions"
:decisions="decisions"
:segments="segments"
/>
</fwb-tab>
<fwb-tab name="decisions" title="Odločitve">
</TabsContent>
<TabsContent value="decisions" class="mt-0">
<DecisionTable
:decisions="decisions"
:actions="actions"
@@ -39,8 +43,8 @@ const activeTab = ref("actions");
:segments="segments"
:archive-settings="archive_settings"
/>
</fwb-tab>
</fwb-tabs>
</TabsContent>
</Tabs>
</div>
</div>
</div>