Skip to content

Commit

Permalink
Merge branch 'BC-8011-disabled-linter-rules' of https://github.com/hp…
Browse files Browse the repository at this point in the history
…i-schul-cloud/nuxt-client into BC-8011-disabled-linter-rules
  • Loading branch information
odalys-dataport committed Mar 6, 2025
2 parents c7801ad + 634b4f6 commit 14c64fc
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 25 deletions.
135 changes: 124 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
"maska": "^2.1.10",
"mobile-drag-drop": "^3.0.0-rc.0",
"object-hash": "^3.0.0",
"pinia": "^2.1.7",
"pinia": "^3.0.0",
"socket.io-client": "^4.7.5",
"sortablejs": "^1.15.2",
"sortablejs-vue3": "^1.2.11",
"vue": "^3.4.21",
"vue-dompurify-html": "^4.1.4",
"vue-i18n": "^9.14.2",
"vue-router": "^4.2.4",
"vue-router": "^4.5.0",
"vue3-mq": "^3.1.3",
"vuedraggable": "^4.1.0",
"vuetify": "^3.7.12",
Expand Down
26 changes: 17 additions & 9 deletions src/components/organisms/administration/SchoolPolicyFormDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<v-custom-dialog
:is-open="isOpen"
:size="425"
@dialog-closed="cancel"
@dialog-canceled="cancel"
has-buttons
confirm-btn-title-key="pages.administration.school.index.schoolPolicy.replace"
:confirm-btn-icon="mdiFileReplaceOutline"
Expand All @@ -29,7 +29,6 @@
ref="input-file"
class="input-file mb-2"
data-testid="input-file"
v-model="files"
density="compact"
accept="application/pdf"
truncate-length="30"
Expand All @@ -44,6 +43,7 @@
:persistent-hint="true"
:rules="[rules.required, rules.mustBePdf, rules.maxSize(4194304)]"
@blur="onBlur"
@update:modelValue="onFileChange"
>
<template v-slot:append-inner>
<v-icon
Expand All @@ -61,19 +61,19 @@

<script lang="ts">
import vCustomDialog from "@/components/organisms/vCustomDialog.vue";
import { computed, ComputedRef, defineComponent, ref, Ref } from "vue";
import { currentDate } from "@/plugins/datetime";
import { CreateConsentVersionPayload } from "@/store/types/consent-version";
import { School } from "@/store/types/schools";
import { toBase64 } from "@/utils/fileHelper";
import {
injectStrict,
NOTIFIER_MODULE_KEY,
PRIVACY_POLICY_MODULE_KEY,
SCHOOLS_MODULE_KEY,
} from "@/utils/inject";
import { useI18n } from "vue-i18n";
import { mdiAlert, mdiFileReplaceOutline } from "@icons/material";
import { School } from "@/store/types/schools";
import { currentDate } from "@/plugins/datetime";
import { toBase64 } from "@/utils/fileHelper";
import { CreateConsentVersionPayload } from "@/store/types/consent-version";
import { computed, ComputedRef, defineComponent, ref, Ref } from "vue";
import { useI18n } from "vue-i18n";
export default defineComponent({
name: "SchoolPolicyFormDialog",
Expand Down Expand Up @@ -115,6 +115,14 @@ export default defineComponent({
),
};
const onFileChange = (_files: File[] | File) => {
if (Array.isArray(_files)) {
files.value = _files;
} else {
files.value = [_files];
}
};
const onBlur = () => {
isTouched.value = true;
};
Expand Down Expand Up @@ -156,11 +164,11 @@ export default defineComponent({
return {
t,
files,
rules,
cancel,
submit,
onBlur,
onFileChange,
isValid,
isTouched,
policyForm,
Expand Down
14 changes: 11 additions & 3 deletions src/components/organisms/administration/SchoolTermsFormDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<v-custom-dialog
:is-open="isOpen"
:size="425"
@dialog-closed="cancel"
@dialog-canceled="cancel"
has-buttons
confirm-btn-title-key="pages.administration.school.index.termsOfUse.replace"
:confirm-btn-icon="mdiFileReplaceOutline"
Expand All @@ -29,7 +29,6 @@
ref="input-file"
class="input-file mb-2"
data-testid="input-file"
v-model="files"
:multiple="false"
density="compact"
accept="application/pdf"
Expand All @@ -43,6 +42,7 @@
:persistent-hint="true"
:rules="[rules.required, rules.mustBePdf, rules.maxSize(4194304)]"
@blur="onBlur"
@update:modelValue="onFileChange"
>
<template v-slot:append-inner>
<v-icon
Expand Down Expand Up @@ -116,6 +116,14 @@ export default defineComponent({
isFormTouched.value = true;
};
const onFileChange = (_files: File[] | File) => {
if (Array.isArray(_files)) {
files.value = _files;
} else {
files.value = [_files];
}
};
const resetForm = () => {
termsForm.value = [];
isFormValid.value = false;
Expand Down Expand Up @@ -153,11 +161,11 @@ export default defineComponent({
return {
t,
files,
rules: validationRules,
cancel,
submit,
onBlur,
onFileChange,
isValid: isFormValid,
isTouched: isFormTouched,
termsForm,
Expand Down

0 comments on commit 14c64fc

Please sign in to comment.