Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Bump #277

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE_IMAGE_BUILDER=node:20.11.1-alpine3.19
ARG BASE_IMAGE=nginx:1.25-alpine
ARG BASE_IMAGE_BUILDER=node:20.18.0-alpine3.19
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed

Check warning

Code scanning / Trivy

curl: curl netrc password leak Medium

Package: curl
Installed Version: 8.11.0-r2
Vulnerability CVE-2024-11053
Severity: MEDIUM
Fixed Version: 8.11.1-r0
Link: CVE-2024-11053

Check warning

Code scanning / Trivy

curl: curl netrc password leak Medium

Package: libcurl
Installed Version: 8.11.0-r2
Vulnerability CVE-2024-11053
Severity: MEDIUM
Fixed Version: 8.11.1-r0
Link: CVE-2024-11053
ARG BASE_IMAGE=nginx:1.26-alpine

# Build Stage
FROM $BASE_IMAGE_BUILDER as build
Expand Down
4,655 changes: 2,720 additions & 1,935 deletions package-lock.json

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,47 +20,47 @@
},
"dependencies": {
"@mdi/font": "^7.4.47",
"@vee-validate/yup": "^4.12.6",
"@vee-validate/yup": "^4.13.2",
"axios": "^1.6.7",
"date-fns": "^3.6.0",
"pinia": "^2.1.7",
"pinia": "^2.2.4",
"vee-validate": "^4.12.5",
"vite-plugin-vuetify": "^2.0.3",
"vite-plugin-vuetify": "^2.0.4",
"vue": "^3.4.14",
"vue-i18n": "^9.10.1",
"vue-router": "^4.4.3",
"vuetify": "^3.5.9",
"vue-i18n": "^9.14.1",
"vue-router": "^4.4.5",
"vuetify": "^3.7.2",
"yup": "^1.4.0"
},
"devDependencies": {
"@intlify/unplugin-vue-i18n": "^3.0.1",
"@openapitools/openapi-generator-cli": "^2.12.0",
"@pinia/testing": "^0.1.3",
"@rushstack/eslint-patch": "^1.7.2",
"@tsconfig/node18": "^18.2.2",
"@types/node": "^20.11.26",
"@typescript-eslint/parser": "^7.2.0",
"@openapitools/openapi-generator-cli": "^2.14.0",
"@pinia/testing": "^0.1.6",
"@rushstack/eslint-patch": "^1.10.4",
"@tsconfig/node18": "^18.2.4",
"@types/node": "^20.16.11",
"@typescript-eslint/parser": "^7.18.0",
"@vitejs/plugin-basic-ssl": "^1.1.0",
"@vitejs/plugin-vue": "^5.0.4",
"@vitejs/plugin-vue": "^5.1.4",
"@vitest/coverage-istanbul": "^2.1.1",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"@vue/test-utils": "^2.4.4",
"@vue/test-utils": "^2.4.6",
"@vue/tsconfig": "^0.5.1",
"axios-mock-adapter": "^1.22.0",
"eslint": "^8.57.0",
"eslint": "^8.57.1",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-vue": "^9.23.0",
"jsdom": "^24.0.0",
"msw": "^2.2.3",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-vue": "^9.29.0",
"jsdom": "^24.1.3",
"msw": "^2.4.10",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.5",
"sass": "^1.71.1",
"sass-loader": "^14.1.1",
"prettier": "^3.3.3",
"sass": "^1.79.5",
"sass-loader": "^14.2.1",
"typescript": "~5.4.2",
"vite": "^5.1.6",
"vite": "^5.4.8",
"vitest": "^2.1.1",
"vue-tsc": "^2.0.6"
"vue-tsc": "^2.1.6"
}
}
24 changes: 7 additions & 17 deletions src/components/admin/ResultTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,9 @@
import { onMounted, onUnmounted } from 'vue';
import type { VDataTableServer } from 'vuetify/lib/components/index.mjs';

const searchFilterStore: SearchFilterStore = useSearchFilterStore();

type ReadonlyHeaders = InstanceType<typeof VDataTableServer>['headers'];
type Headers = VDataTableServer['headers'];

// Mutable headers
type ReadonlyHeadersMutable = VDataTableServer['$props']['headers'];
type UnwrapReadonlyArray<A> = A extends Readonly<Array<infer I>> ? I : never;
type ReadonlyDataTableHeader = UnwrapReadonlyArray<ReadonlyHeadersMutable>;
type DeepMutable<T> = { -readonly [P in keyof T]: DeepMutable<T[P]> };
type Headers = DeepMutable<ReadonlyDataTableHeader>;
const searchFilterStore: SearchFilterStore = useSearchFilterStore();

export type TableItem = Record<string, unknown>;
export type TableRow<T> = {
Expand All @@ -26,7 +19,7 @@
type Props = {
currentPage?: number;
disableRowClick?: boolean;
headers: ReadonlyHeaders | Headers;
headers: Headers;
items: TableItem[];
itemsPerPage: number;
itemValuePath: string;
Expand Down Expand Up @@ -117,12 +110,9 @@
onMounted(() => {
// If the sortField in the store has a value then we don't trigger this logic. This logic should only be triggered when the table was first opened without any changes to sorting.
if (searchFilterStore.sortField === '') {
const headers: Headers[] = props.headers as Headers[];
const firstHeader: Headers = headers[0] as Headers;

if (firstHeader.key) {
if (props.headers && props.headers[0]?.key) {
emit('onTableUpdate', {
sortField: firstHeader.key as string,
sortField: props.headers[0]?.key,
sortOrder: SortOrder.Asc,
});
}
Expand All @@ -146,7 +136,7 @@
:items-length="totalItems"
:items-per-page="itemsPerPage"
:items-per-page-options="[30, 50, 100, 300]"
:items-per-page-text="$t('itemsPerPage')"
:items-per-page-text="'itemsPerPage'"
:item-value="itemValuePath"
:page="currentPage"
ref="v-data-table-server"
Expand All @@ -157,7 +147,7 @@
@update:options="onUpdateOptions"
@update:page="(page: number) => $emit('onPageUpdate', page)"
@update:itemsPerPage="(limit: number) => $emit('onItemsPerPageUpdate', limit)"
:no-data-text="$t('noDataFound')"
:no-data-text="'noDataFound'"
>
<template
v-for="(_, name) in $slots as unknown as Readonly<Slots>"
Expand Down
2 changes: 1 addition & 1 deletion src/components/admin/personen/BefristungInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
const localBefristungOption: Ref<string | undefined> = ref<string | undefined>(props.befristungOption);

// Handles any change related to the befristung radio buttons
function handleBefristungOptionChange(value: string | undefined): void {
function handleBefristungOptionChange(value: string | null): void {
localBefristung.value = undefined;
switch (value) {
case BefristungOption.SCHULJAHRESENDE: {
Expand Down
61 changes: 33 additions & 28 deletions src/views/admin/KlassenManagementView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,24 @@

const router: Router = useRouter();

type ReadonlyHeaders = VDataTableServer['$props']['headers'];
type UnwrapReadonlyArray<A> = A extends Readonly<Array<infer I>> ? I : never;
type ReadonlyDataTableHeader = UnwrapReadonlyArray<ReadonlyHeaders>;

// Utility type to make headers mutable
type DeepMutable<T> = { -readonly [P in keyof T]: DeepMutable<T[P]> };
type DataTableHeader = DeepMutable<ReadonlyDataTableHeader>;
type TableHeaders = VDataTableServer['headers'];

// Define headers as a mutable array
const headers: Ref<DataTableHeader[]> = ref([
let headers: TableHeaders = [
{
title: t('admin.klasse.klasse'),
key: 'name',
align: 'start',
width: '250px',
} as DataTableHeader,
},
{
title: t('action'),
key: 'actions',
align: 'center',
sortable: false,
width: '250px',
} as DataTableHeader,
]);
},
];

const selectedSchule: Ref<string | null> = ref(null);
const selectedKlassen: Ref<Array<string>> = ref([]);
Expand Down Expand Up @@ -81,6 +75,22 @@
}))
.sort((a: TranslatedObject, b: TranslatedObject) => a.title.localeCompare(b.title));
});
const errorTitle: ComputedRef<string> = computed(() => {
if (!organisationStore.errorCode) {
return '';
}
return organisationStore.errorCode === 'UNSPECIFIED_ERROR'
? t('admin.klasse.loadingErrorTitle')
: t(`admin.klasse.title.${organisationStore.errorCode}`);
});
const errorText: ComputedRef<string> = computed(() => {
if (!organisationStore.errorCode) {
return '';
}
return organisationStore.errorCode === 'UNSPECIFIED_ERROR'
? t('admin.klasse.loadingErrorText')
: t(`admin.klasse.errors.${organisationStore.errorCode}`);
});

async function fetchKlassenBySelectedSchuleId(schuleId: string | null): Promise<void> {
// Fetch Klassen related to the selected Schule
Expand Down Expand Up @@ -413,13 +423,16 @@
hasAutoselectedSchule.value = true;
totalKlassen = klassenOptions.value?.length || 0;
}
} else {
headers.value.unshift({
title: t('admin.schule.dienststellennummer'),
key: 'schuleDetails',
align: 'start',
width: '350px',
} as DataTableHeader);
} else if (headers) {
headers = [
{
title: t('admin.schule.dienststellennummer'),
key: 'schuleDetails',
align: 'start',
width: '350px',
},
...headers,
];
}
}
}
Expand Down Expand Up @@ -482,18 +495,10 @@
<!-- Error Message Display -->
<SpshAlert
:model-value="!!organisationStore.errorCode"
:title="
organisationStore.errorCode === 'UNSPECIFIED_ERROR'
? $t('admin.klasse.loadingErrorTitle')
: $t(`admin.klasse.title.${organisationStore.errorCode}`)
"
:title="errorTitle"
:type="'error'"
:closable="false"
:text="
organisationStore.errorCode === 'UNSPECIFIED_ERROR'
? $t('admin.klasse.loadingErrorText')
: $t(`admin.klasse.errors.${organisationStore.errorCode}`)
"
:text="errorText"
:showButton="true"
:buttonText="$t('nav.backToList')"
:buttonAction="handleAlertClose"
Expand Down
2 changes: 1 addition & 1 deletion src/views/admin/PersonManagementView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
let timerId: ReturnType<typeof setTimeout>;
const hasAutoSelectedOrganisation: Ref<boolean> = ref(false);

type ReadonlyHeaders = InstanceType<typeof VDataTableServer>['headers'];
type ReadonlyHeaders = VDataTableServer['headers'];
const headers: ReadonlyHeaders = [
{ title: t('person.lastName'), key: 'person.name.familienname', align: 'start' },
{ title: t('person.firstName'), key: 'person.name.vorname', align: 'start' },
Expand Down
Loading