Skip to content

Commit

Permalink
fix: some type issues
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Trost <[email protected]>
  • Loading branch information
galexrt committed Sep 2, 2024
1 parent e62725a commit 7a188b8
Show file tree
Hide file tree
Showing 13 changed files with 100 additions and 85 deletions.
3 changes: 2 additions & 1 deletion app/components/HelpSlideover.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup lang="ts">
import type { ButtonColor } from '#ui/types';
import { useSettingsStore } from '~/store/settings';
const { isHelpSlideoverOpen } = useDashboard();
Expand All @@ -18,7 +19,7 @@ const links = computed(() =>
label: t('common.shortcuts'),
icon: 'i-mdi-key',
trailingIcon: 'i-mdi-arrow-right',
color: 'gray',
color: 'gray' as ButtonColor,
onClick: () => {
shortcuts.value = true;
},
Expand Down
8 changes: 4 additions & 4 deletions app/components/calendar/CalendarCreateOrUpdateModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ function setFromProps(): void {
watch(data, () => setFromProps());
watch(props, async () => refresh());
const access = ref<
Map<
const access = ref(
new Map<
string,
{
id: string;
Expand All @@ -189,8 +189,8 @@ const access = ref<
minimumGrade?: number;
};
}
>
>(new Map());
>(),
);
function addAccessEntry(): void {
if (access.value.size > maxAccessEntries - 1) {
Expand Down
3 changes: 2 additions & 1 deletion app/components/calendar/FindCalendarsModal.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts" setup>
import type { BadgeColor } from '#ui/types';
import { useCalendarStore } from '~/store/calendar';
import type { ListCalendarsResponse, SubscribeToCalendarResponse } from '~~/gen/ts/services/calendar/calendar';
import CitizenInfoPopover from '../partials/citizens/CitizenInfoPopover.vue';
Expand Down Expand Up @@ -85,7 +86,7 @@ async function subscribeToCalendar(calendarId: string, subscribe: boolean): Prom
class="hover:border-primary-500/25 dark:hover:border-primary-400/25 hover:bg-primary-100/50 dark:hover:bg-primary-900/10 flex flex-initial items-center justify-between gap-1 border-white py-1 dark:border-gray-900"
>
<div class="inline-flex gap-1">
<UBadge :color="calendar.color" :ui="{ rounded: 'rounded-full' }" size="lg" />
<UBadge :color="calendar.color as BadgeColor" :ui="{ rounded: 'rounded-full' }" size="lg" />

<span>{{ calendar.name }}</span>
<span v-if="calendar.description" class="hidden sm:block"
Expand Down
3 changes: 2 additions & 1 deletion app/components/calendar/entry/EntryViewSlideover.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts" setup>
import type { BadgeColor } from '#ui/types';
import { isSameDay } from 'date-fns';
import CitizenInfoPopover from '~/components/partials/citizens/CitizenInfoPopover.vue';
import ConfirmModal from '~/components/partials/ConfirmModal.vue';
Expand Down Expand Up @@ -39,7 +40,7 @@ const {
const entry = computed(() => data.value?.entry);
const access = computed(() => data.value?.entry?.calendar?.access);
const color = computed(() => entry.value?.calendar?.color ?? 'primary');
const color = computed(() => (entry.value?.calendar?.color ?? 'primary') as BadgeColor);
function copyLinkToClipboard(): void {
copyToClipboardWrapper(`${w.location.href}?entry_id=${props.entryId}`);
Expand Down
2 changes: 1 addition & 1 deletion app/components/messenger/MessengerList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const emit = defineEmits<{
(e: 'update:model-value', value: Thread | undefined): void;
}>();
const threadRefs = ref<Map<string, Element>>(new Map());
const threadRefs = ref(new Map<string, Element>());
const selectedThread = computed({
get() {
Expand Down
2 changes: 1 addition & 1 deletion app/middleware/02.auth.global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default defineNuxtRouteMiddleware(async (to: RouteLocationNormalized, fro
// If the user has an acitve char, check for perms otherwise, redirect to char selector
if (activeChar.value === null) {
// If we don't have an active char, but a last char ID set, try to choose it and immidiately continue
if (lastCharID.value > 0) {
if (lastCharID.value !== undefined && lastCharID.value > 0) {
const { setActiveChar, setPermissions, setJobProps } = authStore;
try {
await authStore.chooseCharacter(authStore.lastCharID);
Expand Down
17 changes: 11 additions & 6 deletions app/pages/calendar/index.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts" setup>
import type { ButtonColor } from '#ui/types';
import { useRouteQuery } from '@vueuse/router';
import { addDays, isFuture, isPast, isSameDay, isToday } from 'date-fns';
import type { DateRangeSource } from 'v-calendar/dist/types/src/utils/date/range.js';
Expand Down Expand Up @@ -345,10 +346,14 @@ const isOpen = ref(false);
@change="calendarIdChange(calendar.id, $event)"
/>

<UBadge :color="calendar.color" :ui="{ rounded: 'rounded-full' }" size="lg" />
<UBadge
:color="calendar.color as ButtonColor"
:ui="{ rounded: 'rounded-full' }"
size="lg"
/>

<UButton
:color="calendar.color"
:color="calendar.color as ButtonColor"
size="sm"
variant="link"
:padded="false"
Expand Down Expand Up @@ -421,7 +426,7 @@ const isOpen = ref(false);
>
<span class="inline-flex items-center gap-1">
<UBadge
:color="attr.customData.color"
:color="attr.customData.color as ButtonColor"
:ui="{ rounded: 'rounded-full' }"
size="lg"
/>
Expand Down Expand Up @@ -461,7 +466,7 @@ const isOpen = ref(false);
>
<span class="inline-flex items-center gap-1">
<UBadge
:color="attr.customData.color"
:color="attr.customData.color as ButtonColor"
:ui="{ rounded: 'rounded-full' }"
size="lg"
/>
Expand Down Expand Up @@ -566,10 +571,10 @@ const isOpen = ref(false);
@change="calendarIdChange(calendar.id, $event)"
/>

<UBadge :color="calendar.color" :ui="{ rounded: 'rounded-full' }" />
<UBadge :color="calendar.color as ButtonColor" :ui="{ rounded: 'rounded-full' }" />

<UButton
:color="calendar.color"
:color="calendar.color as ButtonColor"
:padded="false"
variant="link"
size="sm"
Expand Down
2 changes: 1 addition & 1 deletion app/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const links = computed(
to: '/auth/registration',
}
: undefined,
].flatMap((item) => (item !== undefined ? [item] : [])) as (Button & { click?: Function })[],
].flatMap((item) => (item !== undefined ? [item] : [])) as (Button & { click?: (...args: any[]) => void })[],
);
</script>

Expand Down
3 changes: 2 additions & 1 deletion app/plugins/1.config.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ async function loadConfig(): Promise<void> {
signal: abort.signal,
})
.catch((e) => {
const err = e as Error;
throw createError({
statusCode: 500,
statusMessage: 'Failed to get FiveNet config from backend',
message: e,
message: err.message + '(Cause: ' + err.cause + ')',
fatal: true,
unhandled: false,
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"@types/howler": "2.2.11",
"@types/leaflet": "1.9.12",
"@types/leaflet-contextmenu": "1.4.3",
"@types/node": "22.5.1",
"@types/node": "22.5.2",
"@types/splitpanes": "2.2.6",
"@types/uuid": "10.0.0",
"@types/zxcvbn": "4.4.5",
Expand Down
5 changes: 5 additions & 0 deletions pkg/cron/cron.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package cron

type Provider struct {
// TODO
}
1 change: 1 addition & 0 deletions pkg/cron/nats.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package cron
Loading

0 comments on commit 7a188b8

Please sign in to comment.