From 753e823cbd16c9654d6b6ee49bc71ace11245404 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 7 Jul 2020 18:17:05 +0000 Subject: [PATCH] --- server/AyaNova/Startup.cs | 9 +++++++-- server/AyaNova/biz/PrimeData.cs | 18 ++++++++++++++++++ server/AyaNova/resource/de.json | 4 +++- server/AyaNova/resource/en.json | 4 +++- server/AyaNova/resource/es.json | 4 +++- server/AyaNova/resource/fr.json | 6 ++++-- 6 files changed, 38 insertions(+), 7 deletions(-) diff --git a/server/AyaNova/Startup.cs b/server/AyaNova/Startup.cs index 6c4c493c..f84e358f 100644 --- a/server/AyaNova/Startup.cs +++ b/server/AyaNova/Startup.cs @@ -174,7 +174,7 @@ namespace AyaNova options.AddPolicy("CorsPolicy", builder => builder.AllowAnyOrigin() .AllowAnyMethod() - .AllowAnyHeader().SetPreflightMaxAge(TimeSpan.FromSeconds(600)) + .AllowAnyHeader().SetPreflightMaxAge(TimeSpan.FromSeconds(600)) ); }); @@ -547,6 +547,11 @@ namespace AyaNova _newLog.LogDebug("DB schema check"); AySchema.CheckAndUpdateAsync(dbContext, _newLog).Wait(); +// #if (DEBUG) +// System.Diagnostics.Debugger.Log(1, "BOOT", "Startup.cs -> RE-PRIMING TRANSLATIONS"); +// AyaNova.Biz.PrimeData.RePrimeTranslations().Wait(); +// #endif + //Check database integrity _newLog.LogDebug("DB integrity check"); DbUtil.CheckFingerPrintAsync(AySchema.EXPECTED_COLUMN_COUNT, AySchema.EXPECTED_INDEX_COUNT, _newLog).Wait(); @@ -583,7 +588,7 @@ namespace AyaNova { //to support html5 pushstate routing in spa //this ensures that a refresh at the client will not 404 but rather force back to the index.html app page and then handled internally by the client - await next(); + await next(); if (!context.Response.HasStarted && !context.Request.Path.Value.StartsWith("/api") && context.Request.Path.Value != "/docs" && context.Response.StatusCode == 404 && !Path.HasExtension(context.Request.Path.Value)) { context.Request.Path = "/index.html"; diff --git a/server/AyaNova/biz/PrimeData.cs b/server/AyaNova/biz/PrimeData.cs index ece33835..f62d3d82 100644 --- a/server/AyaNova/biz/PrimeData.cs +++ b/server/AyaNova/biz/PrimeData.cs @@ -5,6 +5,8 @@ using Microsoft.Extensions.Logging; using AyaNova.Util; using AyaNova.Models; +using Microsoft.EntityFrameworkCore; + namespace AyaNova.Biz { @@ -38,6 +40,22 @@ namespace AyaNova.Biz } + + // //used during development so I don't need to keep installing licenses over and over + // //just to refresh the translations + // public static async Task RePrimeTranslations() + // { + // //delete all the translations + // using (AyContext ct = ServiceProviderProvider.DBContext) + // { + // await ct.Database.ExecuteSqlRawAsync("delete from atranslationitem;"); + // await ct.Database.ExecuteSqlRawAsync("delete from atranslation;"); + // } + // //replace + // await PrimeTranslations(); + // } + + /// /// Prime the Translations /// This may be called before there are any users on a fresh db boot diff --git a/server/AyaNova/resource/de.json b/server/AyaNova/resource/de.json index 05968407..66414e48 100644 --- a/server/AyaNova/resource/de.json +++ b/server/AyaNova/resource/de.json @@ -1548,6 +1548,7 @@ "PageOfPageText": "{0}-{1} von {2}", "Loading": "Wird geladen...", "Tags": "Kategorien", + "Tag":"Tag", "UserTypeServiceContractor": "Subunternehmer", "AuthorizationRoles": "Autorisierungsrollen", "AuthorizationRoleNoRole": "Keine Rolle", @@ -1850,5 +1851,6 @@ "DeleteSelected": "Ausgewählte Elemente löschen", "Event": "Veranstaltung", "Extensions":"Erweiterungen", - "SelectedItems":"Ausgewählte Elemente" + "SelectedItems":"Ausgewählte Elemente", + "Remove":"Entfernen" } \ No newline at end of file diff --git a/server/AyaNova/resource/en.json b/server/AyaNova/resource/en.json index 1a18f16b..6d171b54 100644 --- a/server/AyaNova/resource/en.json +++ b/server/AyaNova/resource/en.json @@ -1548,6 +1548,7 @@ "PageOfPageText": "{0}-{1} of {2}", "Loading": "Loading...", "Tags": "Tags", + "Tag":"Tag", "UserTypeServiceContractor": "SubContractor user", "AuthorizationRoles": "Authorization roles", "AuthorizationRoleNoRole": "No role", @@ -1850,5 +1851,6 @@ "DeleteSelected": "Delete selected items", "Event": "Event", "Extensions":"Extensions", - "SelectedItems":"Selected items" + "SelectedItems":"Selected items", + "Remove":"Remove" } \ No newline at end of file diff --git a/server/AyaNova/resource/es.json b/server/AyaNova/resource/es.json index 480f230b..07850c70 100644 --- a/server/AyaNova/resource/es.json +++ b/server/AyaNova/resource/es.json @@ -1548,6 +1548,7 @@ "PageOfPageText": "{0}-{1} de {2}", "Loading": "Cargando...", "Tags": "Etiquetas", + "Tag":"Etiqueta", "UserTypeServiceContractor": "Subcontratista", "AuthorizationRoles": "Roles de autorización", "AuthorizationRoleNoRole": "Sin rol", @@ -1850,5 +1851,6 @@ "DeleteSelected": "Eliminar elementos seleccionados", "Event": "Evento", "Extensions":"Extensiones", - "SelectedItems":"Elementos seleccionados" + "SelectedItems":"Elementos seleccionados", + "Remove":"Eliminar" } \ No newline at end of file diff --git a/server/AyaNova/resource/fr.json b/server/AyaNova/resource/fr.json index 23fae666..df612db3 100644 --- a/server/AyaNova/resource/fr.json +++ b/server/AyaNova/resource/fr.json @@ -1548,6 +1548,7 @@ "PageOfPageText": "{0}-{1} sur {2}", "Loading": "Chargement...", "Tags": "Balises", + "Tag":"Balise", "UserTypeServiceContractor": "Sous-traitant", "AuthorizationRoles": "Rôles d'autorisation", "AuthorizationRoleNoRole": "Pas de rôle", @@ -1849,6 +1850,7 @@ "MoveSelected": "Déplacer les éléments sélectionnés", "DeleteSelected": "Supprimer les éléments sélectionnés", "Event": "Un événement", - "Extensions":"Extensions", - "SelectedItems":"Éléments sélectionnés" + "Extensions": "Extensions", + "SelectedItems": "Éléments sélectionnés", + "Remove": "Retirer" } \ No newline at end of file