feat: Integrate official drive_provider, update user profile features & UI improvements
All checks were successful
CI / container-job (push) Successful in 41s

- adonisrc.ts: Load official drive_provider and unload custom driver_provider.
- packages.json: Add @headlessui/vue dependency for tab components.
- AvatarController.ts: Rewrite avatar generation logic to always return the same avatar per user.
- auth/UserController.ts: Add profile and profileUpdate methods to support user profile editing.
- Submitter/datasetController.ts & app/models/file.ts: Adapt code to use the official drive_provider.
- app/models/user.ts: Introduce “isAdmin” getter.
- config/drive.ts: Create new configuration for the official drive_provider.
- providers/vinejs_provider.ts: Adapt allowedExtensions control to use provided options or database enabled extensions.
- resource/js/app.ts: Load default Head and Link components.
- resources/js/menu.ts: Add settings-profile.edit menu point.
- resources/js/Components/action-message.vue: Add new component for improved user feedback after form submissions.
- New avatar-input.vue component: Enable profile picture selection.
- Components/CardBox.vue: Alter layout to optionally show HeaderIcon in title bar.
- FormControl.vue: Define a readonly prop for textareas.
- Improve overall UI with updates to NavBar.vue, UserAvatar.vue, UserAvatarCurrentUser.vue, and add v-model support to password-meter.vue.
- Remove profile editing logic from AccountInfo.vue and introduce new profile components (show.vue, update-password-form.vue, update-profile-information.vue).
- app.edge: Modify page (add @inertiaHead tag) for better meta management.
- routes.ts: Add new routes for editing user profiles.
- General npm updates.
This commit is contained in:
Kaimbacher 2025-02-27 16:24:25 +01:00
parent a41b091214
commit 36cd7a757b
34 changed files with 1396 additions and 407 deletions

View file

@ -12,7 +12,7 @@ import {
mdiAsterisk,
mdiFormTextboxPassword,
mdiArrowLeftBoldOutline,
mdiAlertBoxOutline,
mdiAlertBoxOutline,
} from '@mdi/js';
import SectionMain from '@/Components/SectionMain.vue';
import CardBox from '@/Components/CardBox.vue';
@ -36,16 +36,16 @@ import PasswordMeter from '@/Components/SimplePasswordMeter/password-meter.vue';
const emit = defineEmits(['confirm', 'update:confirmation'])
const enabled = ref(false);
const handleScore = (score: number) => {
if (score >= 4){
enabled.value = true;
} else {
enabled.value = false;
}
// strengthLabel.value = scoreLabel;
// score.value = scoreValue;
};
// const enabled = ref(false);
// const handleScore = (score: number) => {
// if (score >= 4) {
// enabled.value = true;
// } else {
// enabled.value = false;
// }
// // strengthLabel.value = scoreLabel;
// // score.value = scoreValue;
// };
defineProps({
// user will be returned from controller action
@ -82,20 +82,20 @@ defineProps({
// };
const passwordForm = useForm({
old_password: '',
new_password: '',
confirm_password: '',
});
const passwordSubmit = async () => {
await passwordForm.post(stardust.route('account.password.store'), {
preserveScroll: true,
onSuccess: () => {
// console.log(resp);
passwordForm.reset();
},
});
};
// const passwordForm = useForm({
// old_password: '',
// new_password: '',
// confirm_password: '',
// });
// const passwordSubmit = async () => {
// await passwordForm.post(stardust.route('account.password.store'), {
// preserveScroll: true,
// onSuccess: () => {
// // console.log(resp);
// passwordForm.reset();
// },
// });
// };
const flash: Ref<any> = computed(() => {
return usePage().props.flash;
@ -139,40 +139,10 @@ const flash: Ref<any> = computed(() => {
{{ $page.props.flash.message }}
</NotificationBar> -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
<!-- <div class="grid grid-cols-1 lg:grid-cols-1 gap-6"> -->
<div class="grid grid-cols-1 gap-6">
<!-- password form -->
<!-- <CardBox title="Edit Profile" :icon="mdiAccountCircle" form @submit.prevent="profileForm.post(route('admin.account.info.store'))"> -->
<!-- <CardBox title="Edit Profile" :icon="mdiAccountCircle" form @submit.prevent="profileSubmit()">
<FormField label="Login" help="Required. Your login name" :class="{ 'text-red-400': errors.login }">
<FormControl v-model="profileForm.login" v-bind:icon="mdiAccount" name="login" required :error="errors.login">
<div class="text-red-400 text-sm" v-if="errors.login">
{{ errors.login }}
</div>
</FormControl>
</FormField>
<FormField label="Email" help="Required. Your e-mail" :class="{ 'text-red-400': errors.email }">
<FormControl v-model="profileForm.email" :icon="mdiMail" type="email" name="email" required :error="errors.email">
<div class="text-red-400 text-sm" v-if="errors.email">
{{ errors.email }}
</div>
</FormControl>
</FormField>
<template #footer>
<BaseButtons>
<BaseButton color="info" type="submit" label="Submit" />
</BaseButtons>
</template>
</CardBox> -->
<!-- password form -->
<!-- <CardBox title="Change Password" :icon="mdiLock" form @submit.prevent="passwordForm.post(route('admin.account.password.store'), {
preserveScroll: true,
onSuccess: () => passwordForm.reset(),
}) "> -->
<CardBox id="passwordForm" title="Change Password" :icon="mdiLock" form @submit.prevent="passwordSubmit()">
<!-- <CardBox id="passwordForm" title="Change Password" :icon="mdiLock" form
@submit.prevent="passwordSubmit()">
<FormValidationErrors v-bind:errors="errors" />
<FormField label="Current password" help="Required. Your current password"
@ -186,22 +156,15 @@ const flash: Ref<any> = computed(() => {
</FormField>
<BaseDivider />
<!-- <FormField label="New password" help="Required. New password"
:class="{ 'text-red-400': passwordForm.errors.new_password }">
<FormControl v-model="passwordForm.new_password" :icon="mdiFormTextboxPassword" name="new_password"
type="password" required :error="passwordForm.errors.new_password">
<div class="text-red-400 text-sm" v-if="passwordForm.errors.new_password">
{{ passwordForm.errors.new_password }}
</div>
</FormControl>
</FormField> -->
<PasswordMeter v-model:password="passwordForm.new_password" :errors="passwordForm.errors" @score="handleScore" />
<PasswordMeter v-model="passwordForm.new_password" :errors="passwordForm.errors"
@score="handleScore" />
<FormField label="Confirm password" help="Required. New password one more time"
:class="{ 'text-red-400': passwordForm.errors.confirm_password }">
<FormControl v-model="passwordForm.confirm_password" :icon="mdiFormTextboxPassword"
name="confirm_password" type="password" required :error="passwordForm.errors.confirm_password">
name="confirm_password" type="password" required
:error="passwordForm.errors.confirm_password">
<div class="text-red-400 text-sm" v-if="passwordForm.errors.confirm_password">
{{ passwordForm.errors.confirm_password }}
</div>
@ -219,16 +182,17 @@ const flash: Ref<any> = computed(() => {
<template #footer>
<BaseButtons>
<BaseButton type="submit" color="info" label="Change password" :disabled="passwordForm.processing == true || enabled == false" />
<BaseButton type="submit" color="info" label="Change password"
:disabled="passwordForm.processing == true || enabled == false" />
</BaseButtons>
</template>
</CardBox>
</CardBox> -->
<PersonalTotpSettings :twoFactorEnabled="twoFactorEnabled" :backupState="backupState">
</PersonalTotpSettings>
<!-- <PersonalSettings :state="backupState"/> -->
<PersonalTotpSettings :twoFactorEnabled="twoFactorEnabled" :backupState="backupState">
</PersonalTotpSettings>
<!-- <PersonalSettings :state="backupState"/> -->
<!-- <CardBox v-if="!props.twoFactorEnabled" title="Two-Factor Authentication" :icon="mdiInformation" form
@submit.prevent="enableTwoFactorAuthentication()">
@ -248,7 +212,7 @@ const flash: Ref<any> = computed(() => {
</template>
</CardBox> -->
</div>
</SectionMain>