Beliebige Entra-Attribute ins Profil übernehmen; eigene Profilfelder
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m43s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m52s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m49s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m49s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m12s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 1m57s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 1m59s
CI / Build-Artefakte aktuell (pull_request) Successful in 57s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m43s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m52s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m49s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m49s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m12s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 1m57s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 1m59s
CI / Build-Artefakte aktuell (pull_request) Successful in 57s
- Profilfelder frei definierbar (Typ, Sichtbarkeit, selbst pflegbar), Werte als JSON am Benutzer - Attribut-Zuordnung je Anbieter statt fester Feldliste: jedes Graph-Attribut inkl. verschachtelter Pfade, onPremisesExtensionAttributes und Verzeichniserweiterungen - Erweiterungsattribute per Knopf aus Entra laden - $select dynamisch aus der Zuordnung; Delta-Abgleich startet bei geänderter Zuordnung neu - Rückfall auf Grundattribute, wenn einzelne Attribute nicht lesbar sind - Ältere Konfiguration (synced_fields) wird weiter gelesen Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
51c94cd0cf
commit
6269d3302c
79 changed files with 1442 additions and 273 deletions
|
|
@ -14,6 +14,7 @@ import AppLayout from '@/layouts/AppLayout.vue';
|
|||
const props = defineProps({
|
||||
profile: { type: Object, required: true },
|
||||
managed: { type: Array, default: () => [] },
|
||||
customFields: { type: Array, default: () => [] },
|
||||
});
|
||||
|
||||
const isManaged = (field) => props.managed.includes(field);
|
||||
|
|
@ -29,8 +30,22 @@ const form = useForm({
|
|||
phone: props.profile.phone ?? '',
|
||||
mobile: props.profile.mobile ?? '',
|
||||
about: props.profile.about ?? '',
|
||||
custom_fields: Object.fromEntries(props.customFields.map((field) => [field.key, field.value ?? ''])),
|
||||
});
|
||||
|
||||
const inputTypes = { email: 'email', phone: 'tel', url: 'url', date: 'date' };
|
||||
|
||||
function customHint(field) {
|
||||
const hints = [];
|
||||
|
||||
if (field.managed) hints.push('Wird aus Microsoft Entra ID übernommen.');
|
||||
else if (field.readonly) hints.push('Wird von der Personalverwaltung gepflegt.');
|
||||
if (field.restricted) hints.push('Nur für Sie und die Personalverwaltung sichtbar.');
|
||||
if (field.help) hints.push(field.help);
|
||||
|
||||
return hints.join(' ');
|
||||
}
|
||||
|
||||
function saveProfile() {
|
||||
form.put('/profil', {
|
||||
preserveScroll: true,
|
||||
|
|
@ -150,6 +165,36 @@ function savePassword() {
|
|||
<Textarea id="about" v-model="form.about" rows="4" maxlength="2000" />
|
||||
</FormField>
|
||||
</div>
|
||||
<div v-if="customFields.length" class="grid gap-5 border-t pt-5">
|
||||
<h3 class="text-sm font-semibold">Weitere Angaben</h3>
|
||||
<div class="grid gap-5 sm:grid-cols-2">
|
||||
<FormField
|
||||
v-for="field in customFields"
|
||||
:id="`custom-${field.key}`"
|
||||
:key="field.key"
|
||||
:label="field.label"
|
||||
:error="form.errors[`custom_fields.${field.key}`]"
|
||||
:hint="customHint(field)"
|
||||
:class="{ 'sm:col-span-2': field.type === 'textarea' }"
|
||||
>
|
||||
<Textarea
|
||||
v-if="field.type === 'textarea'"
|
||||
:id="`custom-${field.key}`"
|
||||
v-model="form.custom_fields[field.key]"
|
||||
rows="3"
|
||||
:disabled="field.readonly"
|
||||
/>
|
||||
<Input
|
||||
v-else
|
||||
:id="`custom-${field.key}`"
|
||||
v-model="form.custom_fields[field.key]"
|
||||
:type="inputTypes[field.type] ?? 'text'"
|
||||
:disabled="field.readonly"
|
||||
:aria-invalid="!!form.errors[`custom_fields.${field.key}`]"
|
||||
/>
|
||||
</FormField>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end border-t pt-5">
|
||||
<Button type="submit" :disabled="form.processing || !form.isDirty">
|
||||
<LoaderCircle v-if="form.processing" class="animate-spin" />
|
||||
|
|
|
|||
|
|
@ -19,6 +19,14 @@ const contact = computed(() => [
|
|||
{ icon: Building2, label: 'Abteilung', value: props.person.department },
|
||||
{ icon: MapPin, label: 'Standort', value: props.person.location },
|
||||
].filter((item) => item.value));
|
||||
|
||||
function fieldHref(field) {
|
||||
if (field.type === 'email') return `mailto:${field.value}`;
|
||||
if (field.type === 'phone') return `tel:${field.value}`;
|
||||
if (field.type === 'url' && /^https?:\/\//i.test(field.value)) return field.value;
|
||||
|
||||
return null;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -45,7 +53,8 @@ const contact = computed(() => [
|
|||
</section>
|
||||
|
||||
<div class="mt-6 grid gap-6 lg:grid-cols-12">
|
||||
<Panel title="Kontakt" class="lg:col-span-5">
|
||||
<div class="grid content-start gap-6 lg:col-span-5">
|
||||
<Panel title="Kontakt">
|
||||
<dl class="grid gap-4">
|
||||
<div v-for="item in contact" :key="item.label" class="flex items-start gap-3">
|
||||
<component :is="item.icon" class="mt-0.5 size-4 shrink-0 text-muted-foreground" />
|
||||
|
|
@ -60,6 +69,19 @@ const contact = computed(() => [
|
|||
</dl>
|
||||
</Panel>
|
||||
|
||||
<Panel v-if="person.fields?.length" title="Weitere Angaben">
|
||||
<dl class="grid gap-4">
|
||||
<div v-for="field in person.fields" :key="field.key" class="min-w-0">
|
||||
<dt class="text-xs text-muted-foreground">{{ field.label }}</dt>
|
||||
<dd class="text-sm break-words" :class="{ 'whitespace-pre-line': field.type === 'textarea' }">
|
||||
<a v-if="fieldHref(field)" :href="fieldHref(field)" class="text-brand-text hover:underline" :target="field.type === 'url' ? '_blank' : undefined" rel="noopener">{{ field.value }}</a>
|
||||
<template v-else>{{ field.value }}</template>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</Panel>
|
||||
</div>
|
||||
|
||||
<div class="grid content-start gap-6 lg:col-span-7">
|
||||
<Panel title="Über mich">
|
||||
<p v-if="person.about" class="text-sm leading-relaxed whitespace-pre-line">{{ person.about }}</p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue