Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Custom header and footer. Move settings to its own page #17

Merged
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,28 @@ Now you can start the server and check if every visualization is working properl
### Storage

Settings can be saved in the data store (default) or as constants. Use the env variable **REACT_APP_STORAGE** to select which one to use (`datastore` or `constants`).

### Custom Header and Footer

The header and footer can be configured in `src/app-config.ts`. They can be disabled by setting their values to `false`.
See `HeaderOptions` and `FooterOptions` types for supported options.

Example config:

```typescript
{
header: {
title: "Dashboard Reports - Custom Header Title",
background: "rgba(19,52,59,1)",
color: "white",
},
footer: {
text: `Dashboard Reports - Custom Footer.
Multi-line text is allowed.
TBD: More customization options.
`,
background: "linear-gradient(90deg, rgba(31,41,30,1) 0%, rgba(20,50,28,1) 50%, rgba(31,41,30,1) 100%)",
color: "white",
}
}
```
21 changes: 12 additions & 9 deletions i18n/ar.po
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: i18next-conv\n"
"POT-Creation-Date: 2024-12-30T12:25:50.318Z\n"
"POT-Creation-Date: 2025-01-08T17:04:38.103Z\n"
"PO-Revision-Date: 2018-10-25T09:02:35.143Z\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"

msgid "Not authorized - only admins can save settings"
msgstr ""

msgid "Select Dashboard"
msgstr ""

Expand All @@ -26,19 +29,16 @@ msgstr ""
msgid "Export to Word"
msgstr ""

msgid "App Settings"
msgstr ""

msgid "Font Size"
msgstr ""

msgid "Show/Hide Feedback"
msgstr ""

msgid "Save"
msgid "Cancel"
msgstr ""

msgid "Close"
msgid "Save"
msgstr ""

msgid "Loading..."
Expand All @@ -50,9 +50,6 @@ msgstr ""
msgid "Select Organization Units"
msgstr ""

msgid "Cancel"
msgstr ""

msgid "Select"
msgstr ""

Expand All @@ -71,6 +68,9 @@ msgstr ""
msgid "Templates not found"
msgstr ""

msgid "Settings saved"
msgstr ""

msgid "Distributed under GNU GLPv3"
msgstr ""

Expand Down Expand Up @@ -99,3 +99,6 @@ msgstr ""

msgid "EyeSeeTea"
msgstr ""

msgid "App Settings"
msgstr ""
23 changes: 13 additions & 10 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-12-30T12:25:50.318Z\n"
"PO-Revision-Date: 2024-12-30T12:25:50.318Z\n"
"POT-Creation-Date: 2025-01-08T17:04:38.103Z\n"
"PO-Revision-Date: 2025-01-08T17:04:38.103Z\n"

msgid "Not authorized - only admins can save settings"
msgstr ""

msgid "Select Dashboard"
msgstr ""
Expand All @@ -26,19 +29,16 @@ msgstr ""
msgid "Export to Word"
msgstr ""

msgid "App Settings"
msgstr ""

msgid "Font Size"
msgstr ""

msgid "Show/Hide Feedback"
msgstr ""

msgid "Save"
msgid "Cancel"
msgstr ""

msgid "Close"
msgid "Save"
msgstr ""

msgid "Loading..."
Expand All @@ -50,9 +50,6 @@ msgstr ""
msgid "Select Organization Units"
msgstr ""

msgid "Cancel"
msgstr ""

msgid "Select"
msgstr ""

Expand All @@ -71,6 +68,9 @@ msgstr ""
msgid "Templates not found"
msgstr ""

msgid "Settings saved"
msgstr ""

msgid "Distributed under GNU GLPv3"
msgstr ""

Expand Down Expand Up @@ -99,3 +99,6 @@ msgstr ""

msgid "EyeSeeTea"
msgstr ""

msgid "App Settings"
msgstr ""
21 changes: 12 additions & 9 deletions i18n/es.po
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: i18next-conv\n"
"POT-Creation-Date: 2024-12-30T12:25:50.318Z\n"
"POT-Creation-Date: 2025-01-08T17:04:38.103Z\n"
"PO-Revision-Date: 2018-10-25T09:02:35.143Z\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"

msgid "Not authorized - only admins can save settings"
msgstr ""

msgid "Select Dashboard"
msgstr "Seleccionar panel"

Expand All @@ -26,19 +29,16 @@ msgstr ""
msgid "Export to Word"
msgstr ""

msgid "App Settings"
msgstr ""

msgid "Font Size"
msgstr ""

msgid "Show/Hide Feedback"
msgstr ""

msgid "Save"
msgid "Cancel"
msgstr ""

msgid "Close"
msgid "Save"
msgstr ""

msgid "Loading..."
Expand All @@ -50,9 +50,6 @@ msgstr ""
msgid "Select Organization Units"
msgstr ""

msgid "Cancel"
msgstr ""

msgid "Select"
msgstr ""

Expand All @@ -71,6 +68,9 @@ msgstr ""
msgid "Templates not found"
msgstr ""

msgid "Settings saved"
msgstr ""

msgid "Distributed under GNU GLPv3"
msgstr ""

Expand Down Expand Up @@ -100,6 +100,9 @@ msgstr ""
msgid "EyeSeeTea"
msgstr ""

msgid "App Settings"
msgstr ""

#~ msgid "Add"
#~ msgstr "Añadir"

Expand Down
21 changes: 12 additions & 9 deletions i18n/fr.po
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: i18next-conv\n"
"POT-Creation-Date: 2024-12-30T12:25:50.318Z\n"
"POT-Creation-Date: 2025-01-08T17:04:38.103Z\n"
"PO-Revision-Date: 2018-10-25T09:02:35.143Z\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"

msgid "Not authorized - only admins can save settings"
msgstr ""

msgid "Select Dashboard"
msgstr ""

Expand All @@ -26,19 +29,16 @@ msgstr ""
msgid "Export to Word"
msgstr ""

msgid "App Settings"
msgstr ""

msgid "Font Size"
msgstr ""

msgid "Show/Hide Feedback"
msgstr ""

msgid "Save"
msgid "Cancel"
msgstr ""

msgid "Close"
msgid "Save"
msgstr ""

msgid "Loading..."
Expand All @@ -50,9 +50,6 @@ msgstr ""
msgid "Select Organization Units"
msgstr ""

msgid "Cancel"
msgstr ""

msgid "Select"
msgstr ""

Expand All @@ -71,6 +68,9 @@ msgstr ""
msgid "Templates not found"
msgstr ""

msgid "Settings saved"
msgstr ""

msgid "Distributed under GNU GLPv3"
msgstr ""

Expand Down Expand Up @@ -99,3 +99,6 @@ msgstr ""

msgid "EyeSeeTea"
msgstr ""

msgid "App Settings"
msgstr ""
21 changes: 12 additions & 9 deletions i18n/pt.po
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: i18next-conv\n"
"POT-Creation-Date: 2024-12-30T12:25:50.318Z\n"
"POT-Creation-Date: 2025-01-08T17:04:38.103Z\n"
"PO-Revision-Date: 2018-10-25T09:02:35.143Z\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"

msgid "Not authorized - only admins can save settings"
msgstr ""

msgid "Select Dashboard"
msgstr ""

Expand All @@ -26,19 +29,16 @@ msgstr ""
msgid "Export to Word"
msgstr ""

msgid "App Settings"
msgstr ""

msgid "Font Size"
msgstr ""

msgid "Show/Hide Feedback"
msgstr ""

msgid "Save"
msgid "Cancel"
msgstr ""

msgid "Close"
msgid "Save"
msgstr ""

msgid "Loading..."
Expand All @@ -50,9 +50,6 @@ msgstr ""
msgid "Select Organization Units"
msgstr ""

msgid "Cancel"
msgstr ""

msgid "Select"
msgstr ""

Expand All @@ -71,6 +68,9 @@ msgstr ""
msgid "Templates not found"
msgstr ""

msgid "Settings saved"
msgstr ""

msgid "Distributed under GNU GLPv3"
msgstr ""

Expand Down Expand Up @@ -99,3 +99,6 @@ msgstr ""

msgid "EyeSeeTea"
msgstr ""

msgid "App Settings"
msgstr ""
4 changes: 4 additions & 0 deletions src/CompositionRoot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { GetPluginVisualizationUseCase } from "./domain/usecases/GetPluginVisual
import { GetRootOrgUnitsUseCase } from "./domain/usecases/GetRootOrgUnitsUseCase";
import { OrgUnitD2Repository } from "./data/repositories/OrgUnitD2Repository";
import { GetOrgUnitsByIdsUseCase } from "./domain/usecases/GetOrgUnitsByIdsUseCase";
import { InitDefaultSettingsUseCase } from "./domain/usecases/InitDefaultSettingsUseCase";
import { DefaultSettingsHTTPRepository } from "./data/repositories/DefaultSettingsHTTPRepository";

export function getCompositionRoot(api: D2Api, instance: Instance, storageName: StorageName) {
const instanceRepository = new InstanceDefaultRepository(instance);
Expand All @@ -28,6 +30,7 @@ export function getCompositionRoot(api: D2Api, instance: Instance, storageName:
const exportDocxRepository = new DashboardExportDocxRepository();
const pluginVisualizationsRepository = new PluginVisualizationD2Repository(api);
const orgUnitsRepository = new OrgUnitD2Repository(api);
const defaultSettingsRepository = new DefaultSettingsHTTPRepository();

return {
instance: {
Expand All @@ -45,6 +48,7 @@ export function getCompositionRoot(api: D2Api, instance: Instance, storageName:
settings: {
get: new GetSettingsUseCase(settingsRepository),
save: new SaveSettingsUseCase(settingsRepository),
initDefaults: new InitDefaultSettingsUseCase(settingsRepository, defaultSettingsRepository),
},
export: {
save: new SaveRawReportUseCase(exportDocxRepository),
Expand Down
Loading
Loading