Skip to content

Commit

Permalink
feat: finalize first wiki version
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Trost <[email protected]>
  • Loading branch information
galexrt committed Nov 8, 2024
1 parent e13f905 commit 9b72c72
Show file tree
Hide file tree
Showing 200 changed files with 10,511 additions and 5,356 deletions.
1 change: 1 addition & 0 deletions app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default defineAppConfig({
},
notification: 3500,
},
maxAccessEntries: 10,

// Nuxt UI app config
ui: {
Expand Down
2 changes: 1 addition & 1 deletion app/components/calendar/CalendarAccessEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ watch(selectedAccessRole, () => {
<q>{{ search }}</q> {{ $t('common.query_not_found') }}
</template>
<template #empty>
{{ $t('common.not_found', [$t('common.access', 1)]) }}
{{ $t('common.not_found', [$t('common.type')]) }}
</template>
</USelectMenu>
</ClientOnly>
Expand Down
2 changes: 1 addition & 1 deletion app/components/calendar/CalendarCreateOrUpdateModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const completorStore = useCompletorStore();
const notifications = useNotificatorStore();
const maxAccessEntries = 10;
const { maxAccessEntries } = useAppConfig();
const canDo = computed(() => ({
privatecalendar: attr('CalendarService.CreateOrUpdateCalendar', 'Fields', 'Job').value,
Expand Down
6 changes: 2 additions & 4 deletions app/components/citizens/CitizensList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,10 @@ const columns = [
: undefined,
].filter((c) => c !== undefined) as { key: string; label: string; class?: string; rowClass?: string; sortable?: boolean }[];
const input = ref<{ input: HTMLInputElement }>();
const input = useTemplateRef('input');
defineShortcuts({
'/': () => {
input.value?.input?.focus();
},
'/': () => input.value?.input?.focus(),
});
</script>

Expand Down
2 changes: 1 addition & 1 deletion app/components/documents/DocumentAccessEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ watch(selectedAccessRole, () => {
<q>{{ search }}</q> {{ $t('common.query_not_found') }}
</template>
<template #empty>
{{ $t('common.not_found', [$t('common.access', 1)]) }}
{{ $t('common.not_found', [$t('common.type')]) }}
</template>
</USelectMenu>
</ClientOnly>
Expand Down
12 changes: 3 additions & 9 deletions app/components/documents/DocumentComments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,12 @@ async function removeComment(id: string): Promise<void> {
emit('deletedComment');
}
const commentsEl = ref<HTMLDivElement | null>(null);
const commentsEl = useTemplateRef('commentsEl');
const isVisible = useElementVisibility(commentsEl);
watchOnce(isVisible, async () => refresh());
const commentInput = ref<HTMLInputElement | null>(null);
function focusCommentField(): void {
if (commentInput.value) {
commentInput.value.focus();
}
}
const commentInput = useTemplateRef('commentInput');
watch(offset, async () => refresh());
Expand Down Expand Up @@ -178,7 +172,7 @@ const onSubmitThrottle = useThrottleFn(async (event: FormSubmitEvent<Schema>) =>
v-else-if="!data?.comments || data?.comments.length === 0"
:message="$t('components.documents.document_comments.no_comments')"
icon="i-mdi-comment-text-multiple"
:focus="focusCommentField"
:focus="() => commentInput?.textarea?.focus()"
/>

<ul v-else role="list" class="divide-y divide-gray-100 dark:divide-gray-800">
Expand Down
2 changes: 1 addition & 1 deletion app/components/documents/DocumentEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const notifications = useNotificatorStore();
const route = useRoute();
const maxAccessEntries = 10;
const { maxAccessEntries } = useAppConfig();
const canEdit = ref(false);
Expand Down
6 changes: 2 additions & 4 deletions app/components/documents/DocumentList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,10 @@ watchDebounced(query.value, async () => refresh(), { debounce: 200, maxWait: 125
const categoriesLoading = ref(false);
const input = ref<{ input: HTMLInputElement }>();
const input = useTemplateRef('input');
defineShortcuts({
'/': () => {
input.value?.input?.focus();
},
'/': () => input.value?.input?.focus(),
});
</script>

Expand Down
2 changes: 1 addition & 1 deletion app/components/documents/DocumentView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function addToClipboard(): void {
});
}
const contentRef = ref<HTMLDivElement | null>(null);
const contentRef = useTemplateRef('contentRef');
function disableCheckboxes(): void {
if (contentRef.value === null) {
return;
Expand Down
2 changes: 1 addition & 1 deletion app/components/documents/templates/TemplateEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const notifications = useNotificatorStore();
const completorStore = useCompletorStore();
const maxAccessEntries = 10;
const { maxAccessEntries } = useAppConfig();
const schema = z.object({
weight: z.number().min(0).max(999_999),
Expand Down
6 changes: 2 additions & 4 deletions app/components/jobs/colleagues/ColleaguesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,10 @@ const columns = [
: undefined,
].filter((c) => c !== undefined) as { key: string; label: string; sortable?: boolean }[];
const input = ref<{ input: HTMLInputElement }>();
const input = useTemplateRef('input');
defineShortcuts({
'/': () => {
input.value?.input?.focus();
},
'/': () => input.value?.input?.focus(),
});
</script>

Expand Down
11 changes: 0 additions & 11 deletions app/components/jobs/conduct/ConductList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,6 @@ const columns = [
sortable: false,
},
];
const input = ref<{ input: HTMLInputElement }>();
defineShortcuts({
'/': () => {
input.value?.input?.focus();
},
});
</script>

<template>
Expand Down Expand Up @@ -227,9 +219,6 @@ defineShortcuts({
<template #empty>
{{ $t('common.not_found', [$t('common.creator', 2)]) }}
</template>
<template #trailing>
<UKbd value="/" />
</template>
</USelectMenu>
</ClientOnly>
</UFormGroup>
Expand Down
2 changes: 1 addition & 1 deletion app/components/jobs/timeclock/TimeclockList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ const itemsAll = computed(() =>
].flatMap((item) => (item !== undefined ? [item] : [])),
);
const input = ref<{ input: HTMLInputElement }>();
const input = useTemplateRef('input');
</script>

<template>
Expand Down
3 changes: 1 addition & 2 deletions app/components/jobs/timeclock/TimeclockStatsChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ const data = computed(() =>
}),
);
const cardRef = ref<HTMLElement | null>(null);
const cardRef = useTemplateRef('cardRef');
const { width } = useElementSize(cardRef);
const x = (_: DataRecord, i: number) => i;
Expand Down
2 changes: 1 addition & 1 deletion app/components/livemap/BaseMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function mapResize(): void {
map.invalidateSize();
}
const mapContainer = ref<HTMLElement | null>(null);
const mapContainer = useTemplateRef('mapContainer');
const mapResizeDebounced = useDebounceFn(mapResize, 350, { maxWait: 750 });
useResizeObserver(mapContainer, (_) => mapResizeDebounced());
Expand Down
2 changes: 1 addition & 1 deletion app/components/partials/WebSocketStatusOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const status = useDebounce(webSocket.status, 150);
const notificationId = ref<string | undefined>();
const overlay = ref<HTMLDivElement | null>(null);
const overlay = useTemplateRef('overlay');
async function checkWebSocketStatus(previousStatus: WebSocketStatus, status: WebSocketStatus): Promise<void> {
if (notificationId.value !== undefined && status === 'OPEN') {
Expand Down
6 changes: 4 additions & 2 deletions app/components/partials/data/DataNoDataBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ const props = withDefaults(
);
async function click() {
if (props.focus) {
props.focus();
if (!props.focus) {
return;
}
props.focus();
}
</script>

Expand Down
6 changes: 4 additions & 2 deletions app/components/qualifications/QualificationAccessEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ watch(selectedAccessRole, () => {
<q>{{ search }}</q> {{ $t('common.query_not_found') }}
</template>
<template #empty>
{{ $t('common.not_found', [$t('common.access', 1)]) }}
{{ $t('common.not_found', [$t('common.type')]) }}
</template>
</USelectMenu>
</ClientOnly>
Expand Down Expand Up @@ -215,7 +215,9 @@ watch(selectedAccessRole, () => {
<template #option-empty="{ query: search }">
<q>{{ search }}</q> {{ $t('common.query_not_found') }}
</template>
<template #empty> {{ $t('common.not_found', [$t('common.access', 2)]) }} </template>
<template #empty>
{{ $t('common.not_found', [$t('common.access', 2)]) }}
</template>
</USelectMenu>
</ClientOnly>
</UFormGroup>
Expand Down
2 changes: 1 addition & 1 deletion app/components/qualifications/QualificationEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const notifications = useNotificatorStore();
const completorStore = useCompletorStore();
const maxAccessEntries = 10;
const { maxAccessEntries } = useAppConfig();
const canDo = computed(() => ({
edit: can('QualificationsService.UpdateQualification').value,
Expand Down
6 changes: 2 additions & 4 deletions app/components/vehicles/VehiclesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,10 @@ const columns = computed(() =>
].flatMap((item) => (item !== undefined ? [item] : [])),
);
const input = ref<{ input: HTMLInputElement }>();
const input = useTemplateRef('input');
defineShortcuts({
'/': () => {
input.value?.input?.focus();
},
'/': () => input.value?.input?.focus(),
});
</script>

Expand Down
Loading

0 comments on commit 9b72c72

Please sign in to comment.