- prettier formatting
All checks were successful
CI Pipeline / japa-tests (push) Successful in 51s

- npm updates
- new SearchMap.vue component
This commit is contained in:
Kaimbacher 2023-10-31 15:38:43 +01:00
parent 7bc9f90cca
commit a7142f694f
74 changed files with 3360 additions and 3577 deletions

View file

@ -1,34 +1,30 @@
<script setup>
import { Head, Link, useForm, router } from "@inertiajs/vue3"
import {
mdiAccountKey,
mdiArrowLeftBoldOutline,
mdiAccount, mdiNoteText, mdiFormTextarea
} from "@mdi/js"
import LayoutAuthenticated from "@/Layouts/LayoutAuthenticated.vue"
import SectionMain from "@/Components/SectionMain.vue"
import SectionTitleLineWithButton from "@/Components/SectionTitleLineWithButton.vue"
import CardBox from "@/Components/CardBox.vue"
import FormField from '@/Components/FormField.vue'
import FormControl from '@/Components/FormControl.vue'
import FormCheckRadioGroup from '@/Components/FormCheckRadioGroup.vue'
import BaseDivider from '@/Components/BaseDivider.vue'
import BaseButton from '@/Components/BaseButton.vue'
import BaseButtons from '@/Components/BaseButtons.vue'
import { Head, Link, useForm, router } from '@inertiajs/vue3';
import { mdiAccountKey, mdiArrowLeftBoldOutline, mdiAccount, mdiNoteText, mdiFormTextarea } from '@mdi/js';
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
import SectionMain from '@/Components/SectionMain.vue';
import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.vue';
import CardBox from '@/Components/CardBox.vue';
import FormField from '@/Components/FormField.vue';
import FormControl from '@/Components/FormControl.vue';
import FormCheckRadioGroup from '@/Components/FormCheckRadioGroup.vue';
import BaseDivider from '@/Components/BaseDivider.vue';
import BaseButton from '@/Components/BaseButton.vue';
import BaseButtons from '@/Components/BaseButtons.vue';
import { stardust } from '@eidellev/adonis-stardust/client';
const props = defineProps({
permissions: {
type: Object,
default: () => ({}),
},
permissions: {
type: Object,
default: () => ({}),
},
});
const form = useForm({
name: '',
display_name: '',
description: '',
permissions: []
name: '',
display_name: '',
description: '',
permissions: [],
});
const submit = async () => {
@ -37,58 +33,77 @@ const submit = async () => {
</script>
<template>
<LayoutAuthenticated>
<LayoutAuthenticated>
<Head title="Add role" />
<SectionMain>
<SectionTitleLineWithButton :icon="mdiAccountKey" title="Add role" main>
<BaseButton
:route-name="stardust.route('role.index')"
:icon="mdiArrowLeftBoldOutline"
label="Back"
color="white"
rounded-full
small
/>
</SectionTitleLineWithButton>
<!-- <CardBox form @submit.prevent="form.post(stardust.route('role.store'))"> -->
<CardBox form @submit.prevent="submit()">
<FormField label="Name" help="Required. Role name" :class="{ 'text-red-400': form.errors.name }">
<FormControl v-model="form.name" type="text" placeholder="Enter Name" required :error="form.errors.name">
<div class="text-red-400 text-sm" v-if="form.errors.name">
{{ form.errors.name }}
</div>
</FormControl>
</FormField>
<Head title="Add role" />
<SectionMain>
<SectionTitleLineWithButton :icon="mdiAccountKey" title="Add role" main>
<BaseButton :route-name="stardust.route('role.index')" :icon="mdiArrowLeftBoldOutline" label="Back" color="white"
rounded-full small />
</SectionTitleLineWithButton>
<!-- <CardBox form @submit.prevent="form.post(stardust.route('role.store'))"> -->
<CardBox form @submit.prevent="submit()">
<FormField label="Display Name" help="Optional. Display name" :class="{ 'text-red-400': form.errors.display_name }">
<FormControl v-model="form.display_name" name="display_name" :error="form.errors.display_name">
<div class="text-red-400 text-sm" v-if="form.errors.display_name">
{{ form.errors.display_name }}
</div>
</FormControl>
</FormField>
<FormField label="Name" help="Required. Role name" :class="{ 'text-red-400': form.errors.name }">
<FormControl v-model="form.name" type="text" placeholder="Enter Name" required :error="form.errors.name">
<div class="text-red-400 text-sm" v-if="form.errors.name">
{{ form.errors.name }}
</div>
</FormControl>
</FormField>
<FormField
label="Description"
help="Optional. Description of new role"
:class="{ 'text-red-400': form.errors.description }"
>
<FormControl
v-model="form.description"
v-bind:icon="mdiFormTextarea"
name="display_name"
:type="'textarea'"
:error="form.errors.description"
>
<div class="text-red-400 text-sm" v-if="form.errors.description">
{{ form.errors.description }}
</div>
</FormControl>
</FormField>
<FormField label="Display Name" help="Optional. Display name" :class="{ 'text-red-400': form.errors.display_name }">
<FormControl v-model="form.display_name" name="display_name" :error="form.errors.display_name">
<div class="text-red-400 text-sm" v-if="form.errors.display_name">
{{ form.errors.display_name }}
</div>
</FormControl>
</FormField>
<BaseDivider />
<FormField label="Description" help="Optional. Description of new role" :class="{ 'text-red-400': form.errors.description }">
<FormControl v-model="form.description" v-bind:icon="mdiFormTextarea" name="display_name" :type="'textarea'" :error="form.errors.description">
<div class="text-red-400 text-sm" v-if="form.errors.description">
{{ form.errors.description }}
</div>
</FormControl>
</FormField>
<FormField label="Permissions" wrap-body>
<FormCheckRadioGroup v-model="form.permissions" name="permissions" is-column :options="props.permissions" />
</FormField>
<div class="text-red-400 text-sm" v-if="form.errors.permissions && Array.isArray(form.errors.permissions)">
<!-- {{ errors.password_confirmation }} -->
{{ form.errors.permissions.join(', ') }}
</div>
<BaseDivider />
<FormField label="Permissions" wrap-body>
<FormCheckRadioGroup v-model="form.permissions" name="permissions" is-column :options="props.permissions" />
</FormField>
<div class="text-red-400 text-sm" v-if="form.errors.permissions && Array.isArray(form.errors.permissions)">
<!-- {{ errors.password_confirmation }} -->
{{ form.errors.permissions.join(', ') }}
</div>
<template #footer>
<BaseButtons>
<BaseButton type="submit" color="info" label="Submit" :class="{ 'opacity-25': form.processing }"
:disabled="form.processing" />
</BaseButtons>
</template>
</CardBox>
</SectionMain>
</LayoutAuthenticated>
<template #footer>
<BaseButtons>
<BaseButton
type="submit"
color="info"
label="Submit"
:class="{ 'opacity-25': form.processing }"
:disabled="form.processing"
/>
</BaseButtons>
</template>
</CardBox>
</SectionMain>
</LayoutAuthenticated>
</template>

View file

@ -1,43 +1,39 @@
<script setup>
import { Head, Link, useForm } from "@inertiajs/vue3"
import {
mdiAccountKey,
mdiArrowLeftBoldOutline,
mdiFormTextarea
} from "@mdi/js"
import LayoutAuthenticated from "@/Layouts/LayoutAuthenticated.vue"
import SectionMain from "@/Components/SectionMain.vue"
import SectionTitleLineWithButton from "@/Components/SectionTitleLineWithButton.vue"
import CardBox from "@/Components/CardBox.vue"
import FormField from '@/Components/FormField.vue'
import FormControl from '@/Components/FormControl.vue'
import FormCheckRadioGroup from '@/Components/FormCheckRadioGroup.vue'
import BaseDivider from '@/Components/BaseDivider.vue'
import BaseButton from '@/Components/BaseButton.vue'
import BaseButtons from '@/Components/BaseButtons.vue'
import { Head, Link, useForm } from '@inertiajs/vue3';
import { mdiAccountKey, mdiArrowLeftBoldOutline, mdiFormTextarea } from '@mdi/js';
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
import SectionMain from '@/Components/SectionMain.vue';
import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.vue';
import CardBox from '@/Components/CardBox.vue';
import FormField from '@/Components/FormField.vue';
import FormControl from '@/Components/FormControl.vue';
import FormCheckRadioGroup from '@/Components/FormCheckRadioGroup.vue';
import BaseDivider from '@/Components/BaseDivider.vue';
import BaseButton from '@/Components/BaseButton.vue';
import BaseButtons from '@/Components/BaseButtons.vue';
import { stardust } from '@eidellev/adonis-stardust/client';
const props = defineProps({
role: {
type: Object,
default: () => ({}),
},
permissions: {
type: Object,
default: () => ({}),
},
roleHasPermissions: {
type: Object,
default: () => ({}),
}
})
role: {
type: Object,
default: () => ({}),
},
permissions: {
type: Object,
default: () => ({}),
},
roleHasPermissions: {
type: Object,
default: () => ({}),
},
});
const form = useForm({
_method: 'put',
name: props.role.name,
description: props.role.description,
permissions: props.roleHasPermissions
})
_method: 'put',
name: props.role.name,
description: props.role.description,
permissions: props.roleHasPermissions,
});
const submit = async () => {
// await Inertia.post(stardust.route('user.store'), form);
@ -46,46 +42,65 @@ const submit = async () => {
</script>
<template>
<LayoutAuthenticated>
<LayoutAuthenticated>
<Head title="Update role" />
<SectionMain>
<SectionTitleLineWithButton :icon="mdiAccountKey" title="Update role" main>
<BaseButton
:route-name="stardust.route('role.index')"
:icon="mdiArrowLeftBoldOutline"
label="Back"
color="white"
rounded-full
small
/>
</SectionTitleLineWithButton>
<!-- <CardBox form @submit.prevent="form.put(stardust.route('role.update', [props.role.id]))"> -->
<CardBox form @submit.prevent="submit()">
<FormField label="Name" :class="{ 'text-red-400': form.errors.name }">
<FormControl v-model="form.name" type="text" placeholder="Enter Name" required :error="form.errors.name">
<div class="text-red-400 text-sm" v-if="form.errors.name">
{{ form.errors.name }}
</div>
</FormControl>
</FormField>
<Head title="Update role" />
<SectionMain>
<SectionTitleLineWithButton :icon="mdiAccountKey" title="Update role" main>
<BaseButton :route-name="stardust.route('role.index')" :icon="mdiArrowLeftBoldOutline" label="Back" color="white"
rounded-full small />
</SectionTitleLineWithButton>
<!-- <CardBox form @submit.prevent="form.put(stardust.route('role.update', [props.role.id]))"> -->
<CardBox form @submit.prevent="submit()">
<FormField label="Name" :class="{ 'text-red-400': form.errors.name }">
<FormControl v-model="form.name" type="text" placeholder="Enter Name" required :error="form.errors.name">
<div class="text-red-400 text-sm" v-if="form.errors.name">
{{ form.errors.name }}
</div>
</FormControl>
</FormField>
<FormField
label="Description"
help="Optional. Description of new role"
:class="{ 'text-red-400': form.errors.description }"
>
<FormControl
v-model="form.description"
v-bind:icon="mdiFormTextarea"
name="display_name"
:type="'textarea'"
:error="form.errors.description"
>
<div class="text-red-400 text-sm" v-if="form.errors.description">
{{ form.errors.description }}
</div>
</FormControl>
</FormField>
<FormField label="Description" help="Optional. Description of new role" :class="{ 'text-red-400': form.errors.description }">
<FormControl v-model="form.description" v-bind:icon="mdiFormTextarea" name="display_name" :type="'textarea'" :error="form.errors.description">
<div class="text-red-400 text-sm" v-if="form.errors.description">
{{ form.errors.description }}
</div>
</FormControl>
</FormField>
<BaseDivider />
<BaseDivider />
<FormField label="Permissions" wrap-body>
<FormCheckRadioGroup v-model="form.permissions" name="permissions" is-column :options="props.permissions" />
</FormField>
<FormField label="Permissions" wrap-body>
<FormCheckRadioGroup v-model="form.permissions" name="permissions" is-column :options="props.permissions" />
</FormField>
<template #footer>
<BaseButtons>
<BaseButton type="submit" color="info" label="Submit" :class="{ 'opacity-25': form.processing }"
:disabled="form.processing" />
</BaseButtons>
</template>
</CardBox>
</SectionMain>
</LayoutAuthenticated>
<template #footer>
<BaseButtons>
<BaseButton
type="submit"
color="info"
label="Submit"
:class="{ 'opacity-25': form.processing }"
:disabled="form.processing"
/>
</BaseButtons>
</template>
</CardBox>
</SectionMain>
</LayoutAuthenticated>
</template>

View file

@ -1,79 +1,68 @@
<script setup>
import { Head, Link, useForm } from "@inertiajs/vue3"
import {
mdiAccountKey,
mdiArrowLeftBoldOutline,
} from "@mdi/js"
import LayoutAuthenticated from "@/Layouts/LayoutAuthenticated.vue"
import SectionMain from "@/Components/SectionMain.vue"
import SectionTitleLineWithButton from "@/Components/SectionTitleLineWithButton.vue"
import CardBox from "@/Components/CardBox.vue"
import BaseButton from "@/Components/BaseButton.vue"
import { Head, Link, useForm } from '@inertiajs/vue3';
import { mdiAccountKey, mdiArrowLeftBoldOutline } from '@mdi/js';
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
import SectionMain from '@/Components/SectionMain.vue';
import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.vue';
import CardBox from '@/Components/CardBox.vue';
import BaseButton from '@/Components/BaseButton.vue';
import { stardust } from '@eidellev/adonis-stardust/client';
const props = defineProps({
role: {
type: Object,
default: () => ({}),
},
permissions: {
type: Object,
default: () => ({}),
},
roleHasPermissions: {
type: Object,
default: () => ({}),
}
})
role: {
type: Object,
default: () => ({}),
},
permissions: {
type: Object,
default: () => ({}),
},
roleHasPermissions: {
type: Object,
default: () => ({}),
},
});
</script>
<template>
<LayoutAuthenticated>
<Head title="View role" />
<SectionMain>
<SectionTitleLineWithButton :icon="mdiAccountKey" title="View role" main>
<BaseButton :route-name="stardust.route('role.index')" :icon="mdiArrowLeftBoldOutline" label="Back" color="white"
rounded-full small />
</SectionTitleLineWithButton>
<CardBox class="mb-6">
<table>
<tbody>
<tr>
<td class="p-4 pl-8 text-slate-500 dark:text-slate-400 hidden lg:block">
Name
</td>
<td data-label="Name">
{{ role.name }}
</td>
</tr>
<tr>
<td class="p-4 pl-8 text-slate-500 dark:text-slate-400 hidden lg:block">
Name
</td>
<td data-label="Description">
{{ role.description }}
</td>
</tr>
<tr>
<td class="
p-4
pl-8
text-slate-500
dark:text-slate-400
hidden
lg:block
">
Created
</td>
<td data-label="Created">
<!-- {{ new Date(role.created_at).toLocaleString() }} -->
{{ role.created_at }}
</td>
</tr>
</tbody>
</table>
</CardBox>
</SectionMain>
</LayoutAuthenticated>
<LayoutAuthenticated>
<Head title="View role" />
<SectionMain>
<SectionTitleLineWithButton :icon="mdiAccountKey" title="View role" main>
<BaseButton
:route-name="stardust.route('role.index')"
:icon="mdiArrowLeftBoldOutline"
label="Back"
color="white"
rounded-full
small
/>
</SectionTitleLineWithButton>
<CardBox class="mb-6">
<table>
<tbody>
<tr>
<td class="p-4 pl-8 text-slate-500 dark:text-slate-400 hidden lg:block">Name</td>
<td data-label="Name">
{{ role.name }}
</td>
</tr>
<tr>
<td class="p-4 pl-8 text-slate-500 dark:text-slate-400 hidden lg:block">Name</td>
<td data-label="Description">
{{ role.description }}
</td>
</tr>
<tr>
<td class="p-4 pl-8 text-slate-500 dark:text-slate-400 hidden lg:block">Created</td>
<td data-label="Created">
<!-- {{ new Date(role.created_at).toLocaleString() }} -->
{{ role.created_at }}
</td>
</tr>
</tbody>
</table>
</CardBox>
</SectionMain>
</LayoutAuthenticated>
</template>

View file

@ -40,12 +40,17 @@ const submit = async () => {
<template>
<LayoutAuthenticated>
<Head title="Add user" />
<SectionMain>
<SectionTitleLineWithButton :icon="mdiAccountKey" title="Add user" main>
<BaseButton :route-name="stardust.route('user.index')" :icon="mdiArrowLeftBoldOutline" label="Back"
color="modern" rounded-full small />
<BaseButton
:route-name="stardust.route('user.index')"
:icon="mdiArrowLeftBoldOutline"
label="Back"
color="modern"
rounded-full
small
/>
</SectionTitleLineWithButton>
<!-- @submit.prevent="form.post(stardust.route('user.store'))" -->
<CardBox form @submit.prevent="submit()">
@ -68,8 +73,7 @@ const submit = async () => {
</FormField>
<FormField label="Password" :class="{ 'text-red-400': errors.password }">
<FormControl v-model="form.password" type="password" placeholder="Enter Password"
:errors="errors.password">
<FormControl v-model="form.password" type="password" placeholder="Enter Password" :errors="errors.password">
<div class="text-red-400 text-sm" v-if="errors.password && Array.isArray(errors.password)">
<!-- {{ errors.password }} -->
{{ errors.password.join(', ') }}
@ -78,10 +82,16 @@ const submit = async () => {
</FormField>
<FormField label="Password Confirmation" :class="{ 'text-red-400': errors.password_confirmation }">
<FormControl v-model="form.password_confirmation" type="password"
placeholder="Enter Password Confirmation" :errors="errors.password">
<div class="text-red-400 text-sm"
v-if="errors.password_confirmation && Array.isArray(errors.password_confirmation)">
<FormControl
v-model="form.password_confirmation"
type="password"
placeholder="Enter Password Confirmation"
:errors="errors.password"
>
<div
class="text-red-400 text-sm"
v-if="errors.password_confirmation && Array.isArray(errors.password_confirmation)"
>
<!-- {{ errors.password_confirmation }} -->
{{ errors.password_confirmation.join(', ') }}
</div>
@ -100,8 +110,13 @@ const submit = async () => {
<template #footer>
<BaseButtons>
<BaseButton type="submit" color="info" label="Submit" :class="{ 'opacity-25': form.processing }"
:disabled="form.processing" />
<BaseButton
type="submit"
color="info"
label="Submit"
:class="{ 'opacity-25': form.processing }"
:disabled="form.processing"
/>
</BaseButtons>
</template>
</CardBox>

View file

@ -1,49 +1,46 @@
<script setup lang="ts">
import { Head, useForm, router } from "@inertiajs/vue3"
import {
mdiAccountKey,
mdiArrowLeftBoldOutline
} from "@mdi/js"
import LayoutAuthenticated from "@/Layouts/LayoutAuthenticated.vue"
import SectionMain from "@/Components/SectionMain.vue"
import SectionTitleLineWithButton from "@/Components/SectionTitleLineWithButton.vue"
import CardBox from "@/Components/CardBox.vue"
import FormField from '@/Components/FormField.vue'
import FormControl from '@/Components/FormControl.vue'
import FormCheckRadioGroup from '@/Components/FormCheckRadioGroup.vue'
import BaseDivider from '@/Components/BaseDivider.vue'
import BaseButton from '@/Components/BaseButton.vue'
import BaseButtons from '@/Components/BaseButtons.vue'
import { Head, useForm, router } from '@inertiajs/vue3';
import { mdiAccountKey, mdiArrowLeftBoldOutline } from '@mdi/js';
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
import SectionMain from '@/Components/SectionMain.vue';
import SectionTitleLineWithButton from '@/Components/SectionTitleLineWithButton.vue';
import CardBox from '@/Components/CardBox.vue';
import FormField from '@/Components/FormField.vue';
import FormControl from '@/Components/FormControl.vue';
import FormCheckRadioGroup from '@/Components/FormCheckRadioGroup.vue';
import BaseDivider from '@/Components/BaseDivider.vue';
import BaseButton from '@/Components/BaseButton.vue';
import BaseButtons from '@/Components/BaseButtons.vue';
import { stardust } from '@eidellev/adonis-stardust/client';
// import { Inertia } from '@inertiajs/inertia';
const props = defineProps({
user: {
type: Object,
default: () => ({}),
},
roles: {
type: Object,
default: () => ({}),
},
userHasRoles: {
type: Object,
default: () => ({}),
},
errors: {
type: Object,
default: () => ({}),
},
})
user: {
type: Object,
default: () => ({}),
},
roles: {
type: Object,
default: () => ({}),
},
userHasRoles: {
type: Object,
default: () => ({}),
},
errors: {
type: Object,
default: () => ({}),
},
});
const form = useForm({
_method: 'put',
login: props.user.login,
email: props.user.email,
password: '',
password_confirmation: '',
roles: props.userHasRoles, // fill actual user roles from db
})
_method: 'put',
login: props.user.login,
email: props.user.email,
password: '',
password_confirmation: '',
roles: props.userHasRoles, // fill actual user roles from db
});
const submit = async () => {
// await Inertia.post(stardust.route('user.store'), form);
@ -52,67 +49,83 @@ const submit = async () => {
</script>
<template>
<LayoutAuthenticated>
<LayoutAuthenticated>
<Head title="Update user" />
<SectionMain>
<SectionTitleLineWithButton :icon="mdiAccountKey" title="Update user" main>
<BaseButton
:route-name="stardust.route('user.index')"
:icon="mdiArrowLeftBoldOutline"
label="Back"
color="white"
rounded-full
small
/>
</SectionTitleLineWithButton>
<!-- <CardBox form @submit.prevent="form.put(stardust.route('user.update', [props.user.id]))"> -->
<CardBox form @submit.prevent="submit()">
<FormField label="Enter Login" :class="{ 'text-red-400': errors.name }">
<FormControl v-model="form.login" type="text" placeholder="Name" :errors="errors.login">
<div class="text-red-400 text-sm" v-if="errors.login">
{{ errors.login }}
</div>
</FormControl>
</FormField>
<Head title="Update user" />
<SectionMain>
<SectionTitleLineWithButton :icon="mdiAccountKey" title="Update user" main>
<BaseButton :route-name="stardust.route('user.index')" :icon="mdiArrowLeftBoldOutline" label="Back"
color="white" rounded-full small />
</SectionTitleLineWithButton>
<!-- <CardBox form @submit.prevent="form.put(stardust.route('user.update', [props.user.id]))"> -->
<CardBox form @submit.prevent="submit()">
<FormField label="Enter Email" :class="{ 'text-red-400': errors.email }">
<FormControl v-model="form.email" type="text" placeholder="Email" :errors="errors.email">
<div class="text-red-400 text-sm" v-if="errors.email && Array.isArray(errors.email)">
{{ errors.email.join(', ') }}
</div>
</FormControl>
</FormField>
<FormField label="Enter Login" :class="{ 'text-red-400': errors.name }">
<FormControl v-model="form.login" type="text" placeholder="Name" :errors="errors.login">
<div class="text-red-400 text-sm" v-if="errors.login">
{{ errors.login }}
</div>
</FormControl>
</FormField>
<FormField label="Password" :class="{ 'text-red-400': errors.password }">
<FormControl v-model="form.password" type="password" placeholder="Enter Password" :errors="errors.password">
<div class="text-red-400 text-sm" v-if="errors.password">
{{ errors.password }}
</div>
</FormControl>
</FormField>
<FormField label="Enter Email" :class="{ 'text-red-400': errors.email }">
<FormControl v-model="form.email" type="text" placeholder="Email" :errors="errors.email">
<div class="text-red-400 text-sm" v-if="errors.email && Array.isArray(errors.email)">
{{ errors.email.join(', ') }}
</div>
</FormControl>
</FormField>
<FormField label="Password Confirmation" :class="{ 'text-red-400': errors.password_confirmation }">
<FormControl
v-model="form.password_confirmation"
type="password"
placeholder="Enter Password Confirmation"
:errors="errors.password"
>
<div
class="text-red-400 text-sm"
v-if="errors.password_confirmation && Array.isArray(errors.password_confirmation)"
>
{{ errors.password_confirmation.join(', ') }}
</div>
</FormControl>
</FormField>
<FormField label="Password" :class="{ 'text-red-400': errors.password }">
<FormControl v-model="form.password" type="password" placeholder="Enter Password" :errors="errors.password">
<div class="text-red-400 text-sm" v-if="errors.password">
{{ errors.password }}
</div>
</FormControl>
</FormField>
<BaseDivider />
<FormField label="Password Confirmation" :class="{ 'text-red-400': errors.password_confirmation }">
<FormControl v-model="form.password_confirmation" type="password" placeholder="Enter Password Confirmation"
:errors="errors.password">
<div class="text-red-400 text-sm" v-if="errors.password_confirmation && Array.isArray(errors.password_confirmation)">
{{ errors.password_confirmation.join(', ') }}
</div>
</FormControl>
</FormField>
<FormField label="Roles" wrap-body :class="{ 'text-red-400': errors.roles }">
<FormCheckRadioGroup v-model="form.roles" name="roles" is-column :options="props.roles" />
</FormField>
<div class="text-red-400 text-sm" v-if="errors.roles && Array.isArray(errors.roles)">
<!-- {{ errors.password_confirmation }} -->
{{ errors.roles.join(', ') }}
</div>
<BaseDivider />
<FormField label="Roles" wrap-body :class="{ 'text-red-400': errors.roles }">
<FormCheckRadioGroup v-model="form.roles" name="roles" is-column :options="props.roles" />
</FormField>
<div class="text-red-400 text-sm" v-if="errors.roles && Array.isArray(errors.roles)">
<!-- {{ errors.password_confirmation }} -->
{{ errors.roles.join(', ') }}
</div>
<template #footer>
<BaseButtons>
<BaseButton type="submit" color="info" label="Submit" :class="{ 'opacity-25': form.processing }"
:disabled="form.processing" />
</BaseButtons>
</template>
</CardBox>
</SectionMain>
</LayoutAuthenticated>
<template #footer>
<BaseButtons>
<BaseButton
type="submit"
color="info"
label="Submit"
:class="{ 'opacity-25': form.processing }"
:disabled="form.processing"
/>
</BaseButtons>
</template>
</CardBox>
</SectionMain>
</LayoutAuthenticated>
</template>

View file

@ -2,13 +2,7 @@
// import { Head, Link, useForm, usePage } from '@inertiajs/inertia-vue3';
import { Head, Link, useForm, usePage } from '@inertiajs/vue3';
import { ComputedRef } from 'vue';
import {
mdiAccountKey,
mdiPlus,
mdiSquareEditOutline,
mdiTrashCan,
mdiAlertBoxOutline,
} from '@mdi/js';
import { mdiAccountKey, mdiPlus, mdiSquareEditOutline, mdiTrashCan, mdiAlertBoxOutline } from '@mdi/js';
import { computed } from 'vue';
import LayoutAuthenticated from '@/Layouts/LayoutAuthenticated.vue';
import SectionMain from '@/Components/SectionMain.vue';
@ -59,22 +53,26 @@ const formDelete = useForm({});
// async function destroy(id) {
const destroy = async (id) => {
if (confirm('Are you sure you want to delete?')) {
if (confirm('Are you sure you want to delete?')) {
await formDelete.delete(stardust.route('user.destroy', [id]));
}
}
};
</script>
<template>
<LayoutAuthenticated>
<Head title="Users" />
<SectionMain>
<SectionTitleLineWithButton :icon="mdiAccountKey" title="Tethys Users" main>
<BaseButton v-if="can.create" :route-name="stardust.route('user.create')" :icon="mdiPlus" label="Add"
color="modern" rounded-full small />
<BaseButton
v-if="can.create"
:route-name="stardust.route('user.create')"
:icon="mdiPlus"
label="Add"
color="modern"
rounded-full
small
/>
</SectionTitleLineWithButton>
<!-- <label>{{ form.search }}</label> -->
<NotificationBar v-if="flash.message" color="success" :icon="mdiAlertBoxOutline">
@ -85,11 +83,13 @@ const destroy = async (id) => {
<form @submit.prevent="form.get(stardust.route('user.index'))">
<div class="py-2 flex">
<div class="flex pl-4">
<input type="search" v-model="form.search"
<input
type="search"
v-model="form.search"
class="rounded-md shadow-sm border-gray-300 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
placeholder="Search" />
<BaseButton label="Search" type="submit" color="modern"
class="ml-4 inline-flex items-center px-4 py-2" />
placeholder="Search"
/>
<BaseButton label="Search" type="submit" color="modern" class="ml-4 inline-flex items-center px-4 py-2" />
</div>
</div>
</form>
@ -112,9 +112,11 @@ const destroy = async (id) => {
<tbody>
<tr v-for="user in users.data" :key="user.id">
<td data-label="Login">
<Link v-bind:href="stardust.route('user.show', [user.id])"
class="no-underline hover:underline text-cyan-600 dark:text-cyan-400">
{{ user.login }}
<Link
v-bind:href="stardust.route('user.show', [user.id])"
class="no-underline hover:underline text-cyan-600 dark:text-cyan-400"
>
{{ user.login }}
</Link>
<!-- {{ user.id }} -->
</td>
@ -124,19 +126,13 @@ const destroy = async (id) => {
<td v-if="can.edit || can.delete" class="before:hidden lg:w-1 whitespace-nowrap">
<BaseButtons type="justify-start lg:justify-end" no-wrap>
<BaseButton
v-if="can.edit"
:route-name="stardust.route('user.edit', [user.id])"
color="info"
:icon="mdiSquareEditOutline"
small
/>
<BaseButton
v-if="can.delete"
color="danger"
:icon="mdiTrashCan"
small
@click="destroy(user.id)"
/>
v-if="can.edit"
:route-name="stardust.route('user.edit', [user.id])"
color="info"
:icon="mdiSquareEditOutline"
small
/>
<BaseButton v-if="can.delete" color="danger" :icon="mdiTrashCan" small @click="destroy(user.id)" />
</BaseButtons>
</td>
</tr>

View file

@ -10,9 +10,9 @@ import { stardust } from '@eidellev/adonis-stardust/client';
defineProps({
user: {
type: Object,
default: () => ({}),
},
type: Object,
default: () => ({}),
},
roles: {
type: Object,
default: () => ({}),