From 30fae33dedb1501e570e9edca288fea3c84ac84a Mon Sep 17 00:00:00 2001 From: Steffen Jost Date: Fri, 8 Dec 2023 11:52:15 +0100 Subject: [PATCH] fix(admin): minor fixes and translations for admin problem page --- .../uniworx/categories/admin/de-de-formal.msg | 6 +++++- messages/uniworx/categories/admin/en-eu.msg | 6 +++++- .../uniworx/utils/table_column/de-de-formal.msg | 3 ++- messages/uniworx/utils/table_column/en-eu.msg | 3 ++- src/Foundation/Navigation.hs | 2 +- src/Handler/Admin.hs | 17 +++++++++-------- 6 files changed, 24 insertions(+), 13 deletions(-) diff --git a/messages/uniworx/categories/admin/de-de-formal.msg b/messages/uniworx/categories/admin/de-de-formal.msg index d6cd1fe98..f4c23696d 100644 --- a/messages/uniworx/categories/admin/de-de-formal.msg +++ b/messages/uniworx/categories/admin/de-de-formal.msg @@ -119,4 +119,8 @@ ProblemsNoAvsIdHeading: Fahrer ohne AVS-Id ProblemsNoAvsIdBody: Fahrer mit gültiger Fahrberechtigung in FRADrive, welche trotzdem nicht fahren dürfen, da die Fahrberechtigung aufgrund einer unbekannten AVS Id nicht an die Ausweisstelle übermittelt werden konnte: ProblemsAvsSynchHeading: Synchronisation AVS Fahrberechtigungen ProblemsAvsErrorHeading: Fehlermeldungen -ProblemsInterfaceSince: Berücksichtigt werden nur Erfolge und Fehler seit \ No newline at end of file +ProblemsInterfaceSince: Berücksichtigt werden nur Erfolge und Fehler seit + +InterfaceLastSynch: Zuletzt +InterfaceSubtype: Betreffend +InterfaceWrite: Schreibend \ No newline at end of file diff --git a/messages/uniworx/categories/admin/en-eu.msg b/messages/uniworx/categories/admin/en-eu.msg index 111fd0883..c035f54c0 100644 --- a/messages/uniworx/categories/admin/en-eu.msg +++ b/messages/uniworx/categories/admin/en-eu.msg @@ -119,4 +119,8 @@ ProblemsNoAvsIdHeading: Drivers without AVS id ProblemsNoAvsIdBody: Drivers having a valid apron driving licence within FRADrive only, but who may not drive since a missing AVS id prevents communication of the driving licence to AVS: ProblemsAvsSynchHeading: Synchronisation AVS Driving Licences ProblemsAvsErrorHeading: Error Log -ProblemsInterfaceSince: Only considering successes and errors since \ No newline at end of file +ProblemsInterfaceSince: Only considering successes and errors since + +InterfaceLastSynch: Last +InterfaceSubtype: Affecting +InterfaceWrite: Write \ No newline at end of file diff --git a/messages/uniworx/utils/table_column/de-de-formal.msg b/messages/uniworx/utils/table_column/de-de-formal.msg index 71e251d18..0a67481af 100644 --- a/messages/uniworx/utils/table_column/de-de-formal.msg +++ b/messages/uniworx/utils/table_column/de-de-formal.msg @@ -105,4 +105,5 @@ TableFilterComma: Es können mehrere alternative Suchkriterien mit Komma getrenn TableFilterCommaPlus: Mehrere alternative Suchkriterien mit Komma trennen. Mindestens ein Suchkriterium muss erfüllt werden, zusätzlich zu allen Suchkriterien mit vorangestelltem Plus-Symbol. TableFilterCommaName: Mehrere Namen mit Komma trennen. TableFilterCommaNameNr: Mehrere Namen oder Nummern mit Komma trennen. Nummern werden nur exakt gesucht. -TableUserEdit: Benutzer bearbeiten \ No newline at end of file +TableUserEdit: Benutzer bearbeiten +TableRows: Zeilen \ No newline at end of file diff --git a/messages/uniworx/utils/table_column/en-eu.msg b/messages/uniworx/utils/table_column/en-eu.msg index b000a6d7d..e7ae23a14 100644 --- a/messages/uniworx/utils/table_column/en-eu.msg +++ b/messages/uniworx/utils/table_column/en-eu.msg @@ -105,4 +105,5 @@ TableFilterComma: Separate multiple alternative filter criteria by comma, at lea TableFilterCommaPlus: Separate multiple alternative filter criteria by comma, at least one of which must be fulfilled in addition to all criteria preceded by a plus symbol. TableFilterCommaName: Separate names by comma. TableFilterCommaNameNr: Separate names and numbers by comma. Numbers have to match exact. -TableUserEdit: Edit user \ No newline at end of file +TableUserEdit: Edit user +TableRows: Rows \ No newline at end of file diff --git a/src/Foundation/Navigation.hs b/src/Foundation/Navigation.hs index 59e430487..ce7d466f4 100644 --- a/src/Foundation/Navigation.hs +++ b/src/Foundation/Navigation.hs @@ -121,7 +121,7 @@ breadcrumb ProblemUnreachableR = i18nCrumb MsgProblemsUnreachableHeading $ Just breadcrumb ProblemWithoutAvsId = i18nCrumb MsgProblemsNoAvsIdHeading $ Just AdminProblemsR breadcrumb ProblemFbutNoR = i18nCrumb MsgProblemsRWithoutFHeading $ Just AdminProblemsR breadcrumb ProblemAvsSynchR = i18nCrumb MsgProblemsAvsSynchHeading $ Just AdminProblemsR -breadcrumb ProblemAvsErrorR = i18nCrumb MsgProblemsAvsErrorHeading $ Just ProblemAvsSynchR +breadcrumb ProblemAvsErrorR = i18nCrumb MsgProblemsAvsErrorHeading $ Just AdminProblemsR breadcrumb FirmAllR = i18nCrumb MsgMenuFirms Nothing breadcrumb FirmsCommR{} = i18nCrumb MsgMenuFirmsComm $ Just FirmAllR diff --git a/src/Handler/Admin.hs b/src/Handler/Admin.hs index eb80a0633..6eb320e90 100644 --- a/src/Handler/Admin.hs +++ b/src/Handler/Admin.hs @@ -41,7 +41,7 @@ getAdminProblemsR = do now <- liftIO getCurrentTime let nowaday = utctDay now cutOffOldDays = 7 - cutOffOldTime = addLocalDays (-cutOffOldDays) now + cutOffOldTime = toMidnight $ addDays (-cutOffOldDays) nowaday -- we abuse messageTooltip for colored icons here msgSuccessTooltip <- messageI Success MsgMessageSuccess @@ -280,13 +280,13 @@ mkInterfaceLogTable flagError cutOffOldTime = do dbtRowKey = (E.^. InterfaceLogId) dbtProj = dbtProjId dbtColonnade = dbColonnade $ mconcat - [ sortable Nothing (textCell "Status" ) $ wgtCell . flagOld . view (resultILog . _interfaceLogTime) - , sortable (Just "interface") (textCell "Interface") $ \(view (resultILog . _interfaceLogInterface) -> n) -> textCell n - , sortable (Just "subtype") (textCell "Art" ) $ textCell . view (resultILog . _interfaceLogSubtype) - , sortable (Just "write") (textCell "Write" ) $ (`ifIconCell` IconEdit) . view (resultILog . _interfaceLogWrite) - , sortable (Just "time") (i18nCell MsgSystemMessageTimestamp) $ dateTimeCell . view (resultILog . _interfaceLogTime) - , sortable (Just "rows") (textCell "Zeilen" ) $ cellMaybe numCell . view (resultILog . _interfaceLogRows) - , sortable Nothing (textCell "Info" ) $ \(view resultILog -> ilt) -> case ilt of + [ sortable Nothing (textCell "Status" ) $ wgtCell . flagOld . view (resultILog . _interfaceLogTime) + , sortable (Just "interface") (textCell "Interface" ) $ \(view (resultILog . _interfaceLogInterface) -> n) -> textCell n + , sortable (Just "subtype") (i18nCell MsgInterfaceSubtype ) $ textCell . view (resultILog . _interfaceLogSubtype) + , sortable (Just "write") (i18nCell MsgInterfaceWrite ) $ (`ifIconCell` IconEdit) . view (resultILog . _interfaceLogWrite) + , sortable (Just "time") (i18nCell MsgInterfaceLastSynch ) $ dateTimeCell . view (resultILog . _interfaceLogTime) + , sortable (Just "rows") (i18nCell MsgTableRows ) $ cellMaybe numCell . view (resultILog . _interfaceLogRows) + , sortable Nothing (textCell "Info" ) $ \(view resultILog -> ilt) -> case ilt of InterfaceLog "AVS" "Synch" True _ _ i -> anchorCell ProblemAvsErrorR $ toWgt i InterfaceLog _ _ _ _ _ i -> textCell i ] @@ -306,4 +306,5 @@ mkInterfaceLogTable flagError cutOffOldTime = do dbtCsvDecode = Nothing dbtExtraReps = [] resultDBTableValidator = def + & defaultSorting [SortAscBy "interface", SortAscBy "subtype", SortAscBy "write"] dbTable resultDBTableValidator resultDBTable \ No newline at end of file