From 62a73eb6bf6b8da971ed4e7289f1ed9f7c45259d Mon Sep 17 00:00:00 2001 From: schefbi Date: Thu, 22 Feb 2024 11:12:01 +0100 Subject: [PATCH 1/5] gem:27379 Fix App Ad einlesen layout anf handel 409 --- .../App/HtmlTemplates/input.html | 4 ++-- .../App/Routes/result.js | 23 +++++++++++++++++-- .../CSS/Custom/anmeldedetails-einlesen.css | 13 ++++++++++- public/apps/EmberApps/Locale/Custom/de-CH.js | 3 ++- public/apps/EmberApps/Locale/Custom/fr-CH.js | 2 +- 5 files changed, 38 insertions(+), 7 deletions(-) diff --git a/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/input.html b/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/input.html index 41498e65..8343b524 100644 --- a/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/input.html +++ b/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/input.html @@ -7,10 +7,10 @@
{{#if showError}} - cancel{{translate "incorrectFormat"}} + {{translate "incorrectFormat"}} {{/if}}
- {{#link-to "validation" tagName="button" class="btn btn-primary" disabledWhen=cannotContinue}} + {{#link-to "validation" tagName="button" class="btn btn-primary float-right" disabledWhen=cannotContinue}}
{{translate "validate"}}
{{/link-to}}
diff --git a/public/apps/EmberApps/AnmeldedetailsEinlesen/App/Routes/result.js b/public/apps/EmberApps/AnmeldedetailsEinlesen/App/Routes/result.js index 7c55c4c6..3f9fea12 100644 --- a/public/apps/EmberApps/AnmeldedetailsEinlesen/App/Routes/result.js +++ b/public/apps/EmberApps/AnmeldedetailsEinlesen/App/Routes/result.js @@ -30,7 +30,7 @@ define([ // put a reference to the subscriptionDetails object on the model model.set('subscriptionDetails', subscriptionDetails); - + model.set('error',false); // put the new subscriptionDetails on the server one after another subscriptionDetails.reduce(function (previous, item) { @@ -43,13 +43,32 @@ define([ var raw = item.get('raw'); raw.Value = item.get('newValue'); - return new ember.RSVP.Promise(function (resolve) { + item.set('loading', true); + new ember.RSVP.Promise(function (resolve) { // set the new value of the subscriptionDetail api.updateSubscriptionDetail(raw, function () { item.set('uploaded', true); + item.set('loading', false); resolve(); }); + ember.Instrumentation.subscribe('validationErrorOccurred',{ + before(name, timestamp, payload) { + var message = payload.responseJSON.Issues[0].Message; + if (payload.status === 409 && message.search(item.subscriptionDetailId) > 0 ) { + item.set('errorUpload', message); + item.set('uploaded', false); + item.set('loading', false); + model.set('error',true); + + } + }, + after(name, timestamp, payload) { + + } + }); + }); + }); }, ember.RSVP.Promise.resolve()).then(function () { // every detail has bee sent diff --git a/public/apps/EmberApps/CSS/Custom/anmeldedetails-einlesen.css b/public/apps/EmberApps/CSS/Custom/anmeldedetails-einlesen.css index e0015fe4..a072c64a 100644 --- a/public/apps/EmberApps/CSS/Custom/anmeldedetails-einlesen.css +++ b/public/apps/EmberApps/CSS/Custom/anmeldedetails-einlesen.css @@ -61,6 +61,12 @@ .dialogFooter { background-color: transparent; padding: 0; + flex-direction: row !important; +} + +.float-right { + right: 0; + position: absolute; } .btn-primary { @@ -69,6 +75,11 @@ color: var(--bs-btn-color) !important; } +.btn-secondary { + border-color: var(--bs-btn-border-color) !important; + background: var(--bs-btn-bg) !important; +} + /* overwrite main.css so the height of the textarea isn't always 5rem */ .readSubscriptionDetails textarea { height: auto !important; @@ -98,7 +109,7 @@ /* center text */ .readSubscriptionDetails .center-text { - text-align: center; + text-align: center !important; } /* show the default cursor for disabled links */ diff --git a/public/apps/EmberApps/Locale/Custom/de-CH.js b/public/apps/EmberApps/Locale/Custom/de-CH.js index 112d75b7..3dd3ac18 100644 --- a/public/apps/EmberApps/Locale/Custom/de-CH.js +++ b/public/apps/EmberApps/Locale/Custom/de-CH.js @@ -20,7 +20,8 @@ define(function() { 'subscriptionDetailDoesNotExist': 'Das Anmeldedetail existiert nicht (auf dem Anlass)', 'notEditable': 'Das Anmeldedetail ist nicht für die Interneteingabe freigegeben', 'invalidSubscriptionDetailValue': 'Das Anmeldedetail hat einen ungültigen Wert', - 'goBackToStart': 'Alle neuen Werte wurden hochgeladen. Mit einem Klick auf den Pfeil kann der Vorgang erneut gestartet werden.', + 'goBackToStart': 'Alle neuen Werte wurden hochgeladen.', + 'goBackToStartError': 'Es konnten nicht alle neuen Werte erfolgreich aktualisiert werden. Bitte prüfen sie die Spalte Status.', 'continueWithErrors': 'Es werden alle in der Spalte Status validierten Datensätze übernommen.', 'ok': 'Ok', 'studentM': 'Teilnehmer', diff --git a/public/apps/EmberApps/Locale/Custom/fr-CH.js b/public/apps/EmberApps/Locale/Custom/fr-CH.js index f9d20a73..c93ea1bd 100644 --- a/public/apps/EmberApps/Locale/Custom/fr-CH.js +++ b/public/apps/EmberApps/Locale/Custom/fr-CH.js @@ -20,7 +20,7 @@ define(function() { 'subscriptionDetailDoesNotExist': 'le détail d\'inscription n\'existe pas', 'notEditable': 'le détail d\'inscription n\'est pas disponible pour la saisie en ligne', 'invalidSubscriptionDetailValue': 'le détail d\'inscription a une valeur non valide', - 'goBackToStart': 'Toutes les nouvelles valuers ont été transmises. Vous pouvez saisir d\'autres données en cliquant sur le bouton saisie.', + 'goBackToStart': 'Toutes les nouvelles valuers ont été transmises.', 'continueWithErrors': 'Toutes les données validées dans la colonne statut vont être transmises.', 'ok': 'ok', 'studentM': 'Élève', From 36e0570d5f3af2a954e5a2b7e3554a1d39a0b9e8 Mon Sep 17 00:00:00 2001 From: Sandro Date: Tue, 27 Feb 2024 11:42:36 +0100 Subject: [PATCH 2/5] gem:27379 Add error column --- .../App/HtmlTemplates/result.html | 25 +++++++++--- .../App/HtmlTemplates/validation.html | 38 +++++++++++++------ public/apps/EmberApps/Locale/Custom/de-CH.js | 1 + public/apps/EmberApps/Locale/Custom/fr-CH.js | 1 + 4 files changed, 47 insertions(+), 18 deletions(-) diff --git a/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/result.html b/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/result.html index e9e6eb9a..17d9459a 100644 --- a/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/result.html +++ b/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/result.html @@ -9,6 +9,7 @@ {{translate "oldValue"}} {{translate "newValue"}} {{translate "status"}} + {{translate "fehler"}} @@ -21,14 +22,20 @@ {{subscriptionDetail.oldValue}} {{subscriptionDetail.newValue}} -
+
+ {{#if subscriptionDetail.loading}} +
+
+ {{else}} {{#if subscriptionDetail.uploaded}} - check_circle + check_circle {{else}} - {{icon "loadingAnimation"}} + cancel
+ {{/if}} {{/if}}
+ {{subscriptionDetail.errorUpload}} {{/unless}} {{/each}} @@ -36,11 +43,17 @@
- {{#if model.everythingHasBeenSent}} - info{{translate "goBackToStart"}} + {{#if model.error}} + + {{translate "goBackToStartError"}} + + {{else}} +
+ {{translate "goBackToStart"}} +
{{/if}}
- {{#link-to "input" tagName="button" class="btn btn-primary" disabledWhen=(if model.everythingHasBeenSent false true)}} + {{#link-to "input" tagName="button" class="btn btn-primary float-right" disabledWhen=(if model.everythingHasBeenSent false true)}}
{{translate "input"}}
{{/link-to}}
diff --git a/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/validation.html b/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/validation.html index c52caab6..1753582d 100644 --- a/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/validation.html +++ b/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/validation.html @@ -9,6 +9,7 @@ {{translate "oldValue"}} {{translate "newValue"}} {{translate "status"}} + {{translate "fehler"}} @@ -21,15 +22,26 @@ {{subscriptionDetail.oldValue}} {{subscriptionDetail.newValue}} - {{#if subscriptionDetail.error}} - cancel - {{else}} - check_circle - {{/if}} +
+ {{#if subscriptionDetail.error}} + cancel + {{else}} + check_circle + {{/if}} +
+ {{subscriptionDetail.error}} {{else}} {{! we don't yet know the values of the other fields }} - {{icon "loadingAnimation"}} + + + + + + +
+
+ {{/if}} {{/each}} @@ -37,15 +49,17 @@
- info{{translate "continueWithErrors"}} +
+ {{#link-to "input" tagName="button" class="btn btn-secondary" disabledWhen=cannotGoBack}} +
{{translate "correct"}}
+ {{/link-to}} +
+
+ {{translate "continueWithErrors"}} +
{{#link-to "result" tagName="button" class="btn btn-primary" disabledWhen=cannotContinue}}
{{translate "submit"}}
{{/link-to}}
-
- {{#link-to "input" tagName="button" class="btn btn-primary" disabledWhen=cannotGoBack}} -
{{translate "correct"}}
- {{/link-to}} -
\ No newline at end of file diff --git a/public/apps/EmberApps/Locale/Custom/de-CH.js b/public/apps/EmberApps/Locale/Custom/de-CH.js index 3dd3ac18..a8766350 100644 --- a/public/apps/EmberApps/Locale/Custom/de-CH.js +++ b/public/apps/EmberApps/Locale/Custom/de-CH.js @@ -12,6 +12,7 @@ define(function() { 'oldValue': 'Wert alt', 'newValue': 'Wert neu', 'status': 'Status', + 'fehler': 'Fehler', 'correct': 'Korrigieren', 'submit': 'Einlesen', 'incorrectFormat': 'Die erfassten Daten entsprechen nicht dem gewünschten Format.', diff --git a/public/apps/EmberApps/Locale/Custom/fr-CH.js b/public/apps/EmberApps/Locale/Custom/fr-CH.js index c93ea1bd..b9959fa5 100644 --- a/public/apps/EmberApps/Locale/Custom/fr-CH.js +++ b/public/apps/EmberApps/Locale/Custom/fr-CH.js @@ -12,6 +12,7 @@ define(function() { 'oldValue': 'Valeur antérieure', 'newValue': 'Nouvelle valeur', 'status': 'Statut', + 'fehler': 'Error', 'correct': 'Corriger', 'submit': 'Enregistrer', 'incorrectFormat': 'Les données saisies ne correspondent pas au format recommandé.', From 605caad62add05b23e49e694e1b3e56f761ea0f3 Mon Sep 17 00:00:00 2001 From: schefbi Date: Thu, 29 Feb 2024 09:48:04 +0100 Subject: [PATCH 3/5] gem:27379 Button btn-secondary to btn-outline-secondary --- .../AnmeldedetailsEinlesen/App/HtmlTemplates/validation.html | 2 +- public/apps/EmberApps/CSS/Custom/anmeldedetails-einlesen.css | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/validation.html b/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/validation.html index 1753582d..67b5ebbe 100644 --- a/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/validation.html +++ b/public/apps/EmberApps/AnmeldedetailsEinlesen/App/HtmlTemplates/validation.html @@ -50,7 +50,7 @@
- {{#link-to "input" tagName="button" class="btn btn-secondary" disabledWhen=cannotGoBack}} + {{#link-to "input" tagName="button" class="btn btn-outline-secondary" disabledWhen=cannotGoBack}}
{{translate "correct"}}
{{/link-to}}
diff --git a/public/apps/EmberApps/CSS/Custom/anmeldedetails-einlesen.css b/public/apps/EmberApps/CSS/Custom/anmeldedetails-einlesen.css index a072c64a..f8613edd 100644 --- a/public/apps/EmberApps/CSS/Custom/anmeldedetails-einlesen.css +++ b/public/apps/EmberApps/CSS/Custom/anmeldedetails-einlesen.css @@ -75,9 +75,8 @@ color: var(--bs-btn-color) !important; } -.btn-secondary { - border-color: var(--bs-btn-border-color) !important; - background: var(--bs-btn-bg) !important; +.btn-outline-secondary{ + border: 1px solid #000 !important; } /* overwrite main.css so the height of the textarea isn't always 5rem */ From b1924adba24bcc190ea2b6f91c7adbcb1cfb6a90 Mon Sep 17 00:00:00 2001 From: schefbi Date: Thu, 29 Feb 2024 09:55:01 +0100 Subject: [PATCH 4/5] gem:27379 Status 409 handle correct --- .../apps/EmberApps/AnmeldedetailsEinlesen/App/Routes/result.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/apps/EmberApps/AnmeldedetailsEinlesen/App/Routes/result.js b/public/apps/EmberApps/AnmeldedetailsEinlesen/App/Routes/result.js index 3f9fea12..44ea7019 100644 --- a/public/apps/EmberApps/AnmeldedetailsEinlesen/App/Routes/result.js +++ b/public/apps/EmberApps/AnmeldedetailsEinlesen/App/Routes/result.js @@ -54,7 +54,7 @@ define([ ember.Instrumentation.subscribe('validationErrorOccurred',{ before(name, timestamp, payload) { var message = payload.responseJSON.Issues[0].Message; - if (payload.status === 409 && message.search(item.subscriptionDetailId) > 0 ) { + if (payload.status === 409 && message.search(item.subscriptionDetailId) > 0 && message.search('= '+item.newValue) > 0) { item.set('errorUpload', message); item.set('uploaded', false); item.set('loading', false); From 3026142bbb8b265316c5efeb86ac229a76e4b842 Mon Sep 17 00:00:00 2001 From: schefbi Date: Thu, 29 Feb 2024 14:06:39 +0100 Subject: [PATCH 5/5] gem:27379 Uebersetzungen --- public/apps/EmberApps/Locale/Custom/de-CH.js | 2 +- public/apps/EmberApps/Locale/Custom/fr-CH.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/public/apps/EmberApps/Locale/Custom/de-CH.js b/public/apps/EmberApps/Locale/Custom/de-CH.js index a8766350..91645bf3 100644 --- a/public/apps/EmberApps/Locale/Custom/de-CH.js +++ b/public/apps/EmberApps/Locale/Custom/de-CH.js @@ -22,7 +22,7 @@ define(function() { 'notEditable': 'Das Anmeldedetail ist nicht für die Interneteingabe freigegeben', 'invalidSubscriptionDetailValue': 'Das Anmeldedetail hat einen ungültigen Wert', 'goBackToStart': 'Alle neuen Werte wurden hochgeladen.', - 'goBackToStartError': 'Es konnten nicht alle neuen Werte erfolgreich aktualisiert werden. Bitte prüfen sie die Spalte Status.', + 'goBackToStartError': 'Es konnten nicht alle neuen Werte erfolgreich aktualisiert werden. Bitte prüfen Sie die Spalte Status', 'continueWithErrors': 'Es werden alle in der Spalte Status validierten Datensätze übernommen.', 'ok': 'Ok', 'studentM': 'Teilnehmer', diff --git a/public/apps/EmberApps/Locale/Custom/fr-CH.js b/public/apps/EmberApps/Locale/Custom/fr-CH.js index b9959fa5..4bc16869 100644 --- a/public/apps/EmberApps/Locale/Custom/fr-CH.js +++ b/public/apps/EmberApps/Locale/Custom/fr-CH.js @@ -22,6 +22,7 @@ define(function() { 'notEditable': 'le détail d\'inscription n\'est pas disponible pour la saisie en ligne', 'invalidSubscriptionDetailValue': 'le détail d\'inscription a une valeur non valide', 'goBackToStart': 'Toutes les nouvelles valuers ont été transmises.', + 'goBackToStartError': 'Toutes les nouvelles valeurs n\'ont pas pu être mises à jour avec succès. Veuillez vérifier la colonne statut.', 'continueWithErrors': 'Toutes les données validées dans la colonne statut vont être transmises.', 'ok': 'ok', 'studentM': 'Élève',