ソースを参照

add buletinCriteriaSort field in Parameters form

Olivier Massot 1 年間 前
コミット
e7de5bbde0

+ 3 - 1
components/Ui/Form.vue

@@ -240,7 +240,7 @@ const submit = async (next: string|null = null) => {
 
   } catch (error: any) {
 
-    if (error.response.status === 422 && error.response.data['violations']) {
+    if (error.response && error.response.status === 422 && error.response.data['violations']) {
 
       // TODO: à revoir
       const violations: Array<string> = []
@@ -254,6 +254,8 @@ const submit = async (next: string|null = null) => {
       useFormStore().addViolation(fields)
 
       usePageStore().addAlert(TYPE_ALERT.ALERT, ['invalid_form'])
+    } else {
+      throw error
     }
   } finally {
     usePageStore().loading = false

+ 3 - 0
lang/fr.json

@@ -57,6 +57,8 @@
   "GUARDIANS": "Tuteurs uniquement",
   "STUDENTS": "Élèves uniquement",
   "STUDENTS_AND_THEIR_GUARDIANS": "Élèves et leurs tuteurs",
+  "ALPHANUM": "Alphanumérique",
+  "BY_CRITERIA_INSERT": "Par ordre de saisie des critères",
   "ANNUAL": "Annuel",
   "HALF": "Semestriel",
   "QUARTERLY": "Trimestriel",
@@ -196,6 +198,7 @@
   "bulletinSignatureDirector": "Un cadre « Tampon / Signature » pour l'administration",
   "bulletinPrintAddress": "L'adresse postale de l'élève ou son tuteur",
   "bulletinWithTeacher": "Le nom du professeur",
+  "bulletinCriteriaSort": "Ordre de tri des critères",
   "superAdminEmail" : "Adresse mail associée",
   "bulletin_parameters": "Bulletins",
   "sms": "Sms",

+ 3 - 0
models/Organization/Parameters.ts

@@ -91,6 +91,9 @@ export default class Parameters extends ApiModel {
   @Str('STUDENTS_AND_THEIR_GUARDIANS')
   declare bulletinReceiver: string | null
 
+  @Str('BY_CRITERIA_INSERT')
+  declare bulletinCriteriaSort: string | null
+
   @Str(null)
   declare usernameSMS: string | null
 

+ 7 - 0
pages/parameters/bulletin.vue

@@ -61,6 +61,13 @@
               enum-name="organization_bulletin_send_to"
               variant="underlined"
           />
+
+          <UiInputAutocompleteWithEnum
+              v-model="parameters.bulletinCriteriaSort"
+              field="bulletinCriteriaSort"
+              enum-name="organization_bulletin_criteria_sort"
+              variant="underlined"
+          />
         </v-col>
       </v-row>
     </UiForm>