From 951aa1b1fba562355fe71cae2b7d25f689bfec20 Mon Sep 17 00:00:00 2001 From: Gavin Date: Thu, 3 Aug 2023 12:39:45 -0700 Subject: [PATCH 1/6] Move UX documents to /docs/tenant-ui Signed-off-by: Gavin --- .../tenant-ui/docs => docs/tenant-ui}/EMDT_001.xd | Bin .../tenant-ui/docs => docs/tenant-ui}/EMDT_002.xd | Bin .../tenant-ui/docs => docs/tenant-ui}/EMDT_003.xd | Bin .../tenant-ui}/EMDT_004_Presentation.xd | Bin .../docs => docs/tenant-ui}/EMDT_Chat_001.xd | Bin .../docs => docs/tenant-ui}/Email_templates_001.xd | Bin .../docs => docs/tenant-ui}/InnKeeper_001.xd | Bin .../docs => docs/tenant-ui}/Messages_001.xd | Bin .../docs => docs/tenant-ui}/QR_Code_001.xd | Bin .../tenant-ui/docs => docs/tenant-ui}/README.md | 0 .../docs => docs/tenant-ui}/RESERVATION_FLOW.md | 0 .../docs => docs/tenant-ui}/Tenant_SelfServe_001.xd | Bin .../docs => docs/tenant-ui}/persona_001.xd | Bin .../docs => docs/tenant-ui}/toast_messages.xd | Bin 14 files changed, 0 insertions(+), 0 deletions(-) rename {services/tenant-ui/docs => docs/tenant-ui}/EMDT_001.xd (100%) rename {services/tenant-ui/docs => docs/tenant-ui}/EMDT_002.xd (100%) rename {services/tenant-ui/docs => docs/tenant-ui}/EMDT_003.xd (100%) rename {services/tenant-ui/docs => docs/tenant-ui}/EMDT_004_Presentation.xd (100%) rename {services/tenant-ui/docs => docs/tenant-ui}/EMDT_Chat_001.xd (100%) rename {services/tenant-ui/docs => docs/tenant-ui}/Email_templates_001.xd (100%) rename {services/tenant-ui/docs => docs/tenant-ui}/InnKeeper_001.xd (100%) rename {services/tenant-ui/docs => docs/tenant-ui}/Messages_001.xd (100%) rename {services/tenant-ui/docs => docs/tenant-ui}/QR_Code_001.xd (100%) rename {services/tenant-ui/docs => docs/tenant-ui}/README.md (100%) rename {services/tenant-ui/docs => docs/tenant-ui}/RESERVATION_FLOW.md (100%) rename {services/tenant-ui/docs => docs/tenant-ui}/Tenant_SelfServe_001.xd (100%) rename {services/tenant-ui/docs => docs/tenant-ui}/persona_001.xd (100%) rename {services/tenant-ui/docs => docs/tenant-ui}/toast_messages.xd (100%) diff --git a/services/tenant-ui/docs/EMDT_001.xd b/docs/tenant-ui/EMDT_001.xd similarity index 100% rename from services/tenant-ui/docs/EMDT_001.xd rename to docs/tenant-ui/EMDT_001.xd diff --git a/services/tenant-ui/docs/EMDT_002.xd b/docs/tenant-ui/EMDT_002.xd similarity index 100% rename from services/tenant-ui/docs/EMDT_002.xd rename to docs/tenant-ui/EMDT_002.xd diff --git a/services/tenant-ui/docs/EMDT_003.xd b/docs/tenant-ui/EMDT_003.xd similarity index 100% rename from services/tenant-ui/docs/EMDT_003.xd rename to docs/tenant-ui/EMDT_003.xd diff --git a/services/tenant-ui/docs/EMDT_004_Presentation.xd b/docs/tenant-ui/EMDT_004_Presentation.xd similarity index 100% rename from services/tenant-ui/docs/EMDT_004_Presentation.xd rename to docs/tenant-ui/EMDT_004_Presentation.xd diff --git a/services/tenant-ui/docs/EMDT_Chat_001.xd b/docs/tenant-ui/EMDT_Chat_001.xd similarity index 100% rename from services/tenant-ui/docs/EMDT_Chat_001.xd rename to docs/tenant-ui/EMDT_Chat_001.xd diff --git a/services/tenant-ui/docs/Email_templates_001.xd b/docs/tenant-ui/Email_templates_001.xd similarity index 100% rename from services/tenant-ui/docs/Email_templates_001.xd rename to docs/tenant-ui/Email_templates_001.xd diff --git a/services/tenant-ui/docs/InnKeeper_001.xd b/docs/tenant-ui/InnKeeper_001.xd similarity index 100% rename from services/tenant-ui/docs/InnKeeper_001.xd rename to docs/tenant-ui/InnKeeper_001.xd diff --git a/services/tenant-ui/docs/Messages_001.xd b/docs/tenant-ui/Messages_001.xd similarity index 100% rename from services/tenant-ui/docs/Messages_001.xd rename to docs/tenant-ui/Messages_001.xd diff --git a/services/tenant-ui/docs/QR_Code_001.xd b/docs/tenant-ui/QR_Code_001.xd similarity index 100% rename from services/tenant-ui/docs/QR_Code_001.xd rename to docs/tenant-ui/QR_Code_001.xd diff --git a/services/tenant-ui/docs/README.md b/docs/tenant-ui/README.md similarity index 100% rename from services/tenant-ui/docs/README.md rename to docs/tenant-ui/README.md diff --git a/services/tenant-ui/docs/RESERVATION_FLOW.md b/docs/tenant-ui/RESERVATION_FLOW.md similarity index 100% rename from services/tenant-ui/docs/RESERVATION_FLOW.md rename to docs/tenant-ui/RESERVATION_FLOW.md diff --git a/services/tenant-ui/docs/Tenant_SelfServe_001.xd b/docs/tenant-ui/Tenant_SelfServe_001.xd similarity index 100% rename from services/tenant-ui/docs/Tenant_SelfServe_001.xd rename to docs/tenant-ui/Tenant_SelfServe_001.xd diff --git a/services/tenant-ui/docs/persona_001.xd b/docs/tenant-ui/persona_001.xd similarity index 100% rename from services/tenant-ui/docs/persona_001.xd rename to docs/tenant-ui/persona_001.xd diff --git a/services/tenant-ui/docs/toast_messages.xd b/docs/tenant-ui/toast_messages.xd similarity index 100% rename from services/tenant-ui/docs/toast_messages.xd rename to docs/tenant-ui/toast_messages.xd From 84116968d516a8b0b4aa53090846b2d80fe0d673 Mon Sep 17 00:00:00 2001 From: Gavin Date: Thu, 3 Aug 2023 12:42:05 -0700 Subject: [PATCH 2/6] Document testing of tenant-ui Signed-off-by: Gavin --- services/tenant-ui/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/services/tenant-ui/README.md b/services/tenant-ui/README.md index 824661e37..ef18adab8 100644 --- a/services/tenant-ui/README.md +++ b/services/tenant-ui/README.md @@ -59,6 +59,23 @@ npm run dev The Vite hot-module-reload app will serve from [here](http://127.0.0.1:5173/). +### Running Tests + +To Run tests simply execute + +```bash + npm run test +``` + +In addition to running tests this will also produce code coverage statistics. + +To test your changes in the same environment you would see in production use + +```bash + npm run build + npm run start +``` + ## Using docker Build and run a docker image (example shows using environment variable to point at a specific Traction Instance) From 28ad61c140f217e13db38081daab0f8dc7dd7b23 Mon Sep 17 00:00:00 2001 From: Gavin Date: Thu, 3 Aug 2023 12:42:29 -0700 Subject: [PATCH 3/6] Document JS internationalization scripts Signed-off-by: Gavin --- services/tenant-ui/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/services/tenant-ui/README.md b/services/tenant-ui/README.md index ef18adab8..d60a08cb1 100644 --- a/services/tenant-ui/README.md +++ b/services/tenant-ui/README.md @@ -98,6 +98,21 @@ When developing the Tenant UI, adhere to localization best practices including Currently localization is handled at the Tenant UI frontend level, but data that returns to the frontend from the Traction and AcaPy APIs may not include localization of text and status codes, etc. As such, full localization is a work in progress and will require some future work in integrating with Traction and AcaPy. + +To ensure that the language files are consistent with each other additional helper scripts have been added + +- `fill-keys` does is it takes everything in en.json and fills the other lang files with the entries suffixed by the locale code. +- `common-keys` looks at which keys point to the same values so they can be refactored into a common key. +- `sort-keys` does exactly what it says + +To execute any of these scripts navigate to `services/tenant-ui/frontend` and execute + +``` +npm run i18n:fill-keys +``` + +Replacing `fill-keys` with which ever script your would like to run + ## OIDC Login for Innkeeper The Tenant UI Inkeeper functionality can be configured to log in with either (or both) From 520fbfb4b1ac5ad6b636aebe52dfec1e878336ac Mon Sep 17 00:00:00 2001 From: Gavin Date: Thu, 3 Aug 2023 12:43:03 -0700 Subject: [PATCH 4/6] Document email mocking for local development with tenant-ui Signed-off-by: Gavin --- services/tenant-ui/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/services/tenant-ui/README.md b/services/tenant-ui/README.md index d60a08cb1..1bea34f13 100644 --- a/services/tenant-ui/README.md +++ b/services/tenant-ui/README.md @@ -123,6 +123,18 @@ To set up the OIDC provider of your choice, add configuration values in your dep As well, the Innkeeper secret must be available to the Tenant UI server, this is set in `server.innkeeper` configuration... +## Email Mocking + +Email is used in multiple components of `tenent-ui` for development +purposes we have included `maildev` to assist with monitoring and +mocking these emails in place of a proper SMTP server. + +to enable this set the following environment variables before starting the `tenant-ui` +- `SERVER_SMTP_SERVER=maildev` +- `SERVER_SMTP_PORT=1025` + +To view the emails being sent open http://localhost:1080/ in your web browser + ## Configuring Matomo If you would like to use Matomo for tracking you can set the FRONTEND_MATOMO_URL environment variable as exposed in [custom-environment-variables.json](../config/custom-environment-variables.json) From 33a2437ee0af653e7057eedcdbed0e3331baa1b7 Mon Sep 17 00:00:00 2001 From: Gavinok <34443260+Gavinok@users.noreply.github.com> Date: Thu, 3 Aug 2023 13:09:31 -0700 Subject: [PATCH 5/6] Correct grammatical error in `fill-keys`'s description Co-authored-by: Akiff Manji Signed-off-by: Gavin --- services/tenant-ui/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/tenant-ui/README.md b/services/tenant-ui/README.md index 1bea34f13..4e0a13c58 100644 --- a/services/tenant-ui/README.md +++ b/services/tenant-ui/README.md @@ -101,7 +101,7 @@ Currently localization is handled at the Tenant UI frontend level, but data that To ensure that the language files are consistent with each other additional helper scripts have been added -- `fill-keys` does is it takes everything in en.json and fills the other lang files with the entries suffixed by the locale code. +- `fill-keys` takes everything in en.json and fills the other lang files with the entries suffixed by the locale code. - `common-keys` looks at which keys point to the same values so they can be refactored into a common key. - `sort-keys` does exactly what it says From f13235eba1abcceb3202172194f6b3d328705676 Mon Sep 17 00:00:00 2001 From: Gavin Date: Tue, 8 Aug 2023 18:07:57 -0700 Subject: [PATCH 6/6] Explain that maildev needs to be ran locally if ran outside of docker Signed-off-by: Gavin --- services/tenant-ui/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/tenant-ui/README.md b/services/tenant-ui/README.md index 4e0a13c58..e5e9ba02d 100644 --- a/services/tenant-ui/README.md +++ b/services/tenant-ui/README.md @@ -126,15 +126,18 @@ As well, the Innkeeper secret must be available to the Tenant UI server, this is ## Email Mocking Email is used in multiple components of `tenent-ui` for development -purposes we have included `maildev` to assist with monitoring and +purposes we have included [maildev](https://maildev.github.io/maildev/) to assist with monitoring and mocking these emails in place of a proper SMTP server. -to enable this set the following environment variables before starting the `tenant-ui` +To enable this set the following environment variables before starting the `tenant-ui` - `SERVER_SMTP_SERVER=maildev` - `SERVER_SMTP_PORT=1025` To view the emails being sent open http://localhost:1080/ in your web browser +By default this is already configured in the docker-compose file. For +local use you will need to start `maildev` manually. + ## Configuring Matomo If you would like to use Matomo for tracking you can set the FRONTEND_MATOMO_URL environment variable as exposed in [custom-environment-variables.json](../config/custom-environment-variables.json)