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

fix: [DHIS2-17322] Ensure app hub id is in the right format #559

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@ 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: 2022-11-16T12:52:56.478Z\n"
"PO-Revision-Date: 2022-11-16T12:52:56.478Z\n"
"POT-Creation-Date: 2024-09-26T12:27:51.211Z\n"
"PO-Revision-Date: 2024-09-26T12:27:51.211Z\n"

msgid ""
"Your session has expired. Please refresh the page and login before trying "
"again."
msgstr ""
"Your session has expired. Please refresh the page and login before trying "
"again."

msgid "An unexpected error occurred"
msgstr "An unexpected error occurred"

msgid "Version {{version}} installed"
msgstr "Version {{version}} installed"
Expand Down Expand Up @@ -56,12 +66,18 @@ msgstr "App uninstalled successfully"
msgid "Failed to uninstall app: {{errorMessage}}"
msgstr "Failed to uninstall app: {{errorMessage}}"

msgid "Installing..."
msgstr "Installing..."

msgid "Update to latest version"
msgstr "Update to latest version"

msgid "Install"
msgstr "Install"

msgid "There are no compatible versions available."
msgstr "There are no compatible versions available."

msgid "{{channel}} release {{version}}"
msgstr "{{channel}} release {{version}}"

Expand Down Expand Up @@ -155,6 +171,9 @@ msgstr "All installed custom apps"
msgid "Search installed custom apps"
msgstr "Search installed custom apps"

msgid "View app details"
msgstr "View app details"

msgid "Uploading..."
msgstr "Uploading..."

Expand Down
9 changes: 8 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import { InstalledApp } from './pages/InstalledApp/InstalledApp.js'
import { ManualInstall } from './pages/ManualInstall/ManualInstall.js'
import './locales/index.js'

// Used to ensure we are matching the pattern of a valid app hub id, which should be a UUID version 4
const APP_HUB_ID_REGEXP =
'[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}'

const App = () => (
<HashRouter>
<QueryParamProvider
Expand All @@ -37,7 +41,10 @@ const App = () => (
component={InstalledApp}
/>
<Route path="/app-hub" component={AppHub} />
<Route path="/app/:appHubId" component={AppHubApp} />
<Route
path={`/app/:appHubId(${APP_HUB_ID_REGEXP})`}
component={AppHubApp}
/>
<Route
path="/manual-install"
component={ManualInstall}
Expand Down
Loading