Skip to content

Commit

Permalink
chore: cleanup partials imports and move icons list to own file
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Trost <[email protected]>
  • Loading branch information
galexrt committed Feb 4, 2025
1 parent 222c4fe commit b786c2d
Show file tree
Hide file tree
Showing 47 changed files with 146 additions and 159 deletions.
7 changes: 3 additions & 4 deletions app/assets/css/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
@tailwind utilities;

@layer base {

input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
-webkit-appearance: none;
Expand Down Expand Up @@ -52,13 +51,13 @@ html {
align-items: flex-start;
display: flex;

>label {
> label {
flex: 0 0 auto;
margin-right: 0.5rem;
user-select: none;
}

>div {
> div {
flex: 1 1 auto;

p {
Expand Down Expand Up @@ -102,7 +101,7 @@ html {
position: relative;
vertical-align: top;

>* {
> * {
margin-bottom: 0;
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/components/auth/ForgotPasswordForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import type { FormSubmitEvent } from '#ui/types';
import { z } from 'zod';
import PasswordStrengthMeter from '~/components/auth/PasswordStrengthMeter.vue';
import DataErrorBlock from '~/components/partials/data/DataErrorBlock.vue';
import { useNotificatorStore } from '~/store/notificator';
import { NotificationType } from '~~/gen/ts/resources/notifications/notifications';
import DataErrorBlock from '../partials/data/DataErrorBlock.vue';
const props = defineProps<{
modelValue: boolean;
Expand Down
2 changes: 1 addition & 1 deletion app/components/auth/LoginForm.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts" setup>
import type { FormSubmitEvent } from '#ui/types';
import { z } from 'zod';
import DataErrorBlock from '~/components/partials/data/DataErrorBlock.vue';
import { useAuthStore } from '~/store/auth';
import { useCookiesStore } from '~/store/cookies';
import { useSettingsStore } from '~/store/settings';
import DataErrorBlock from '../partials/data/DataErrorBlock.vue';
const props = defineProps<{
modelValue: boolean;
Expand Down
2 changes: 1 addition & 1 deletion app/components/auth/RegistrationForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import type { FormSubmitEvent } from '#ui/types';
import { z } from 'zod';
import PasswordStrengthMeter from '~/components/auth/PasswordStrengthMeter.vue';
import DataErrorBlock from '~/components/partials/data/DataErrorBlock.vue';
import { openTokenMgmt } from '~/composables/nui';
import { useNotificatorStore } from '~/store/notificator';
import { NotificationType } from '~~/gen/ts/resources/notifications/notifications';
import DataErrorBlock from '../partials/data/DataErrorBlock.vue';
const notifications = useNotificatorStore();
Expand Down
6 changes: 3 additions & 3 deletions app/components/calendar/CalendarCreateOrUpdateModal.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<script lang="ts" setup>
import type { FormSubmitEvent } from '#ui/types';
import { z } from 'zod';
import ColorPickerTW from '~/components/partials/ColorPickerTW.vue';
import AccessManager from '~/components/partials/access/AccessManager.vue';
import { enumToAccessLevelEnums } from '~/components/partials/access/helpers';
import DataErrorBlock from '~/components/partials/data/DataErrorBlock.vue';
import DataNoDataBlock from '~/components/partials/data/DataNoDataBlock.vue';
import DataPendingBlock from '~/components/partials/data/DataPendingBlock.vue';
Expand All @@ -9,9 +12,6 @@ import { useNotificatorStore } from '~/store/notificator';
import { AccessLevel, type CalendarJobAccess, type CalendarUserAccess } from '~~/gen/ts/resources/calendar/access';
import { NotificationType } from '~~/gen/ts/resources/notifications/notifications';
import type { CreateOrUpdateCalendarResponse } from '~~/gen/ts/services/calendar/calendar';
import ColorPickerTW from '../partials/ColorPickerTW.vue';
import AccessManager from '../partials/access/AccessManager.vue';
import { enumToAccessLevelEnums } from '../partials/access/helpers';
const props = defineProps<{
calendarId?: number;
Expand Down
2 changes: 1 addition & 1 deletion app/components/calendar/CalendarViewSlideover.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts" setup>
import AccessBadges from '~/components/partials/access/AccessBadges.vue';
import CitizenInfoPopover from '~/components/partials/citizens/CitizenInfoPopover.vue';
import ConfirmModal from '~/components/partials/ConfirmModal.vue';
import DataErrorBlock from '~/components/partials/data/DataErrorBlock.vue';
Expand All @@ -7,7 +8,6 @@ import DataPendingBlock from '~/components/partials/data/DataPendingBlock.vue';
import OpenClosedBadge from '~/components/partials/OpenClosedBadge.vue';
import { useCalendarStore } from '~/store/calendar';
import { AccessLevel } from '~~/gen/ts/resources/calendar/access';
import AccessBadges from '../partials/access/AccessBadges.vue';
import CalendarCreateOrUpdateModal from './CalendarCreateOrUpdateModal.vue';
import { checkCalendarAccess } from './helpers';
Expand Down
2 changes: 1 addition & 1 deletion app/components/citizens/CitizensList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import type { TableColumn } from '#ui/types';
import { vMaska } from 'maska/vue';
import { z } from 'zod';
import { sexToTextColor } from '~/components/partials/citizens/helpers';
import PhoneNumberBlock from '~/components/partials/citizens/PhoneNumberBlock.vue';
import ProfilePictureImg from '~/components/partials/citizens/ProfilePictureImg.vue';
import DataErrorBlock from '~/components/partials/data/DataErrorBlock.vue';
Expand All @@ -11,7 +12,6 @@ import { useNotificatorStore } from '~/store/notificator';
import { NotificationType } from '~~/gen/ts/resources/notifications/notifications';
import type { User } from '~~/gen/ts/resources/users/users';
import type { ListCitizensRequest, ListCitizensResponse } from '~~/gen/ts/services/citizenstore/citizenstore';
import { sexToTextColor } from '../partials/citizens/helpers';
const { t } = useI18n();
Expand Down
16 changes: 8 additions & 8 deletions app/components/documents/DocumentEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { z } from 'zod';
import DocumentReferenceManager from '~/components/documents/DocumentReferenceManager.vue';
import DocumentRelationManager from '~/components/documents/DocumentRelationManager.vue';
import { checkDocAccess, logger } from '~/components/documents/helpers';
import AccessManager from '~/components/partials/access/AccessManager.vue';
import { enumToAccessLevelEnums } from '~/components/partials/access/helpers';
import TiptapEditor from '~/components/partials/editor/TiptapEditor.vue';
import { availableIcons, fallbackIcon } from '~/components/partials/icons';
import { getDocument, getUser, useClipboardStore } from '~/store/clipboard';
import { useCompletorStore } from '~/store/completor';
import { useDocumentEditorStore } from '~/store/documenteditor';
Expand All @@ -17,10 +21,6 @@ import { DocReference, DocRelation } from '~~/gen/ts/resources/documents/documen
import { NotificationType } from '~~/gen/ts/resources/notifications/notifications';
import type { UserShort } from '~~/gen/ts/resources/users/users';
import type { CreateDocumentRequest, UpdateDocumentRequest } from '~~/gen/ts/services/docstore/docstore';
import { markerFallbackIcon, markerIcons } from '../livemap/helpers';
import AccessManager from '../partials/access/AccessManager.vue';
import { enumToAccessLevelEnums } from '../partials/access/helpers';
import TiptapEditor from '../partials/editor/TiptapEditor.vue';
const props = defineProps<{
documentId?: number;
Expand Down Expand Up @@ -551,9 +551,9 @@ logger.info(
>
<component
:is="
markerIcons.find(
availableIcons.find(
(item) => item.name === state.category?.icon,
) ?? markerFallbackIcon
) ?? fallbackIcon
"
v-if="state.category.icon"
class="size-5"
Expand All @@ -567,8 +567,8 @@ logger.info(
<span class="inline-flex gap-1" :class="`bg-${option.color}-500`">
<component
:is="
markerIcons.find((item) => item.name === option.icon) ??
markerFallbackIcon
availableIcons.find((item) => item.name === option.icon) ??
fallbackIcon
"
v-if="option.icon"
class="size-5"
Expand Down
14 changes: 6 additions & 8 deletions app/components/documents/DocumentList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import { z } from 'zod';
import DocumentListEntry from '~/components/documents/DocumentListEntry.vue';
import DataErrorBlock from '~/components/partials/data/DataErrorBlock.vue';
import DataNoDataBlock from '~/components/partials/data/DataNoDataBlock.vue';
import DateRangePickerPopoverClient from '~/components/partials/DateRangePickerPopover.client.vue';
import { availableIcons, fallbackIcon } from '~/components/partials/icons';
import Pagination from '~/components/partials/Pagination.vue';
import SortButton from '~/components/partials/SortButton.vue';
import { useCompletorStore } from '~/store/completor';
import { useSettingsStore } from '~/store/settings';
import type { OpenClose } from '~/typings';
import * as googleProtobufTimestamp from '~~/gen/ts/google/protobuf/timestamp';
import type { Category } from '~~/gen/ts/resources/documents/category';
import type { UserShort } from '~~/gen/ts/resources/users/users';
import type { ListDocumentsRequest, ListDocumentsResponse } from '~~/gen/ts/services/docstore/docstore';
import { markerFallbackIcon, markerIcons } from '../livemap/helpers';
import DateRangePickerPopoverClient from '../partials/DateRangePickerPopover.client.vue';
import SortButton from '../partials/SortButton.vue';
const { t } = useI18n();
Expand Down Expand Up @@ -191,8 +191,8 @@ defineShortcuts({
<span class="inline-flex gap-1" :class="`bg-${category.color}-500`">
<component
:is="
markerIcons.find((item) => item.name === category?.icon) ??
markerFallbackIcon
availableIcons.find((item) => item.name === category?.icon) ??
fallbackIcon
"
v-if="category.icon"
class="size-5"
Expand All @@ -207,9 +207,7 @@ defineShortcuts({
<template #option="{ option }">
<span class="inline-flex gap-1" :class="`bg-${option.color}-500`">
<component
:is="
markerIcons.find((item) => item.name === option.icon) ?? markerFallbackIcon
"
:is="availableIcons.find((item) => item.name === option.icon) ?? fallbackIcon"
v-if="option.icon"
class="size-5"
/>
Expand Down
2 changes: 1 addition & 1 deletion app/components/documents/DocumentListEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import IDCopyBadge from '~/components/partials/IDCopyBadge.vue';
import OpenClosedBadge from '~/components/partials/OpenClosedBadge.vue';
import CitizenInfoPopover from '~/components/partials/citizens/CitizenInfoPopover.vue';
import DocumentCategoryBadge from '~/components/partials/documents/DocumentCategoryBadge.vue';
import GenericTime from '~/components/partials/elements/GenericTime.vue';
import type { DocumentShort } from '~~/gen/ts/resources/documents/documents';
import DocumentCategoryBadge from '../partials/documents/DocumentCategoryBadge.vue';
defineProps<{
document: DocumentShort;
Expand Down
2 changes: 1 addition & 1 deletion app/components/documents/DocumentReferenceManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import type { TabItem } from '#ui/types';
import CitizenInfoPopover from '~/components/partials/citizens/CitizenInfoPopover.vue';
import DataErrorBlock from '~/components/partials/data/DataErrorBlock.vue';
import DocumentInfoPopover from '~/components/partials/documents/DocumentInfoPopover.vue';
import GenericTime from '~/components/partials/elements/GenericTime.vue';
import type { ClipboardDocument } from '~/store/clipboard';
import { getDocument, useClipboardStore } from '~/store/clipboard';
import type { DocumentReference, DocumentShort } from '~~/gen/ts/resources/documents/documents';
import { DocReference } from '~~/gen/ts/resources/documents/documents';
import DocumentInfoPopover from '../partials/documents/DocumentInfoPopover.vue';
const props = defineProps<{
open: boolean;
Expand Down
2 changes: 1 addition & 1 deletion app/components/documents/DocumentReferences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import CitizenInfoPopover from '~/components/partials/citizens/CitizenInfoPopove
import DataErrorBlock from '~/components/partials/data/DataErrorBlock.vue';
import DataNoDataBlock from '~/components/partials/data/DataNoDataBlock.vue';
import DataPendingBlock from '~/components/partials/data/DataPendingBlock.vue';
import DocumentCategoryBadge from '~/components/partials/documents/DocumentCategoryBadge.vue';
import GenericTime from '~/components/partials/elements/GenericTime.vue';
import type { DocumentReference } from '~~/gen/ts/resources/documents/documents';
import { DocReference } from '~~/gen/ts/resources/documents/documents';
import DocumentCategoryBadge from '../partials/documents/DocumentCategoryBadge.vue';
import { refToBadge } from './helpers';
const props = withDefaults(
Expand Down
2 changes: 1 addition & 1 deletion app/components/documents/DocumentRelations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import CitizenInfoPopover from '~/components/partials/citizens/CitizenInfoPopove
import DataErrorBlock from '~/components/partials/data/DataErrorBlock.vue';
import DataNoDataBlock from '~/components/partials/data/DataNoDataBlock.vue';
import DataPendingBlock from '~/components/partials/data/DataPendingBlock.vue';
import DocumentCategoryBadge from '~/components/partials/documents/DocumentCategoryBadge.vue';
import GenericTime from '~/components/partials/elements/GenericTime.vue';
import type { DocumentRelation } from '~~/gen/ts/resources/documents/documents';
import { DocRelation } from '~~/gen/ts/resources/documents/documents';
import DocumentCategoryBadge from '../partials/documents/DocumentCategoryBadge.vue';
import { relationToBadge } from './helpers';
const props = withDefaults(
Expand Down
2 changes: 1 addition & 1 deletion app/components/documents/DocumentReminderModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import type { FormSubmitEvent } from '#ui/types';
import { subDays } from 'date-fns';
import { z } from 'zod';
import DatePickerPopoverClient from '~/components/partials/DatePickerPopover.client.vue';
import { useNotificatorStore } from '~/store/notificator';
import { NotificationType } from '~~/gen/ts/resources/notifications/notifications';
import type { Timestamp } from '~~/gen/ts/resources/timestamp/timestamp';
import type { SetDocumentReminderResponse } from '~~/gen/ts/services/docstore/docstore';
import DatePickerPopoverClient from '../partials/DatePickerPopover.client.vue';
const props = defineProps<{
documentId: number;
Expand Down
16 changes: 8 additions & 8 deletions app/components/documents/DocumentView.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
<script lang="ts" setup>
import AddToButton from '~/components/clipboard/AddToButton.vue';
import DocumentActivityList from '~/components/documents/DocumentActivityList.vue';
import DocumentComments from '~/components/documents/DocumentComments.vue';
import DocumentActivityList from '~/components/documents/activity/DocumentActivityList.vue';
import DocumentComments from '~/components/documents/comments/DocumentComments.vue';
import DocumentReferences from '~/components/documents/DocumentReferences.vue';
import DocumentRelations from '~/components/documents/DocumentRelations.vue';
import { checkDocAccess } from '~/components/documents/helpers';
import DocumentRequestAccess from '~/components/documents/requests/DocumentRequestAccess.vue';
import DocumentRequestsModal from '~/components/documents/requests/DocumentRequestsModal.vue';
import ConfirmModal from '~/components/partials/ConfirmModal.vue';
import IDCopyBadge from '~/components/partials/IDCopyBadge.vue';
import OpenClosedBadge from '~/components/partials/OpenClosedBadge.vue';
import AccessBadges from '~/components/partials/access/AccessBadges.vue';
import CitizenInfoPopover from '~/components/partials/citizens/CitizenInfoPopover.vue';
import ConfirmModal from '~/components/partials/ConfirmModal.vue';
import HTMLContent from '~/components/partials/content/HTMLContent.vue';
import DataErrorBlock from '~/components/partials/data/DataErrorBlock.vue';
import DataNoDataBlock from '~/components/partials/data/DataNoDataBlock.vue';
import DataPendingBlock from '~/components/partials/data/DataPendingBlock.vue';
import DocumentCategoryBadge from '~/components/partials/documents/DocumentCategoryBadge.vue';
import GenericTime from '~/components/partials/elements/GenericTime.vue';
import IDCopyBadge from '~/components/partials/IDCopyBadge.vue';
import OpenClosedBadge from '~/components/partials/OpenClosedBadge.vue';
import { useClipboardStore } from '~/store/clipboard';
import { useNotificatorStore } from '~/store/notificator';
import type { DocumentAccess } from '~~/gen/ts/resources/documents/access';
Expand All @@ -23,9 +26,6 @@ import type { Document } from '~~/gen/ts/resources/documents/documents';
import { NotificationType } from '~~/gen/ts/resources/notifications/notifications';
import type { Timestamp } from '~~/gen/ts/resources/timestamp/timestamp';
import type { ToggleDocumentPinResponse } from '~~/gen/ts/services/docstore/docstore';
import AccessBadges from '../partials/access/AccessBadges.vue';
import HTMLContent from '../partials/content/HTMLContent.vue';
import DocumentCategoryBadge from '../partials/documents/DocumentCategoryBadge.vue';
import DocumentReminderModal from './DocumentReminderModal.vue';
const props = defineProps<{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import DocumentActivityListEntry from '~/components/documents/DocumentActivityListEntry.vue';
import DocumentActivityListEntry from '~/components/documents/activity/DocumentActivityListEntry.vue';
import DataErrorBlock from '~/components/partials/data/DataErrorBlock.vue';
import DataNoDataBlock from '~/components/partials/data/DataNoDataBlock.vue';
import DataPendingBlock from '~/components/partials/data/DataPendingBlock.vue';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import GenericTime from '~/components/partials/elements/GenericTime.vue';
import { AccessLevel } from '~~/gen/ts/resources/documents/access';
import type { DocActivity } from '~~/gen/ts/resources/documents/activity';
import { DocActivityType } from '~~/gen/ts/resources/documents/activity';
import { getDocAtivityIcon } from './helpers';
import { getDocAtivityIcon } from '../helpers';
defineProps<{
entry: DocActivity;
Expand Down
3 changes: 2 additions & 1 deletion app/components/documents/categories/CategoriesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const modal = useModal();
<template #title>
<USkeleton class="h-6 w-[275px]" />
</template>

<template #description>
<USkeleton class="h-11 w-[350px]" />
</template>
Expand All @@ -93,7 +94,7 @@ const modal = useModal();
:error="error"
:retry="refresh"
/>
<DataNoDataBlock v-else-if="categories && categories.length === 0" icon="i-mdi-tag" :type="$t('common.category', 2)" />
<DataNoDataBlock v-else-if="!categories || categories.length === 0" icon="i-mdi-tag" :type="$t('common.category', 2)" />

<div v-else class="flex justify-center">
<CardsList :items="items" @selected="categorySelected($event)" />
Expand Down
Loading

0 comments on commit b786c2d

Please sign in to comment.