Skip to content

Commit

Permalink
fix: render App Hub metadata for installed apps
Browse files Browse the repository at this point in the history
  • Loading branch information
mediremi committed Jun 1, 2021
1 parent 84469ba commit b10f887
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 59 deletions.
114 changes: 58 additions & 56 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,177 +5,179 @@ 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: 2021-05-31T16:43:30.605Z\n"
"PO-Revision-Date: 2021-05-31T16:43:30.605Z\n"
"POT-Creation-Date: 2021-06-01T07:54:16.857Z\n"
"PO-Revision-Date: 2021-06-01T07:54:16.857Z\n"

msgid "Version {{version}} installed"
msgstr ""
msgstr "Version {{version}} installed"

msgid "Version {{version}}"
msgstr ""
msgstr "Version {{version}}"

msgid "Last updated {{relativeTime}}"
msgstr ""
msgstr "Last updated {{relativeTime}}"

msgid "First published {{relativeTime}}"
msgstr ""
msgstr "First published {{relativeTime}}"

msgid "by {{- developer}}"
msgstr ""
msgstr "by {{- developer}}"

msgid "About this app"
msgstr ""
msgstr "About this app"

msgid "The developer of this application has not provided a description"
msgstr ""
msgstr "The developer of this application has not provided a description"

msgid "Additional information"
msgstr ""
msgstr "Additional information"

msgid "Screenshots"
msgstr ""
msgstr "Screenshots"

msgid "All compatible versions of this application"
msgstr ""
msgstr "All compatible versions of this application"

msgid "App updated successfully"
msgstr ""
msgstr "App updated successfully"

msgid "App installed successfully"
msgstr ""
msgstr "App installed successfully"

msgid "Failed to update app: {{errorMessage}}"
msgstr ""
msgstr "Failed to update app: {{errorMessage}}"

msgid "Failed to install app: {{errorMessage}}"
msgstr ""
msgstr "Failed to install app: {{errorMessage}}"

msgid "App uninstalled successfully"
msgstr ""
msgstr "App uninstalled successfully"

msgid "Failed to uninstall app: {{errorMessage}}"
msgstr ""
msgstr "Failed to uninstall app: {{errorMessage}}"

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

msgid "Install"
msgstr ""
msgstr "Install"

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

msgid "Uninstall"
msgstr ""
msgstr "Uninstall"

msgid "Channel"
msgstr ""
msgstr "Channel"

msgid "Version"
msgstr ""
msgstr "Version"

msgid "Upload date"
msgstr ""
msgstr "Upload date"

msgid "Installed"
msgstr ""
msgstr "Installed"

msgid "Download"
msgstr ""
msgstr "Download"

msgid "There are no compatible versions matching your criteria"
msgstr ""
msgstr "There are no compatible versions matching your criteria"

msgid "Stable"
msgstr ""
msgstr "Stable"

msgid "Development"
msgstr ""
msgstr "Development"

msgid "Canary"
msgstr ""
msgstr "Canary"

msgid "No apps found"
msgstr ""
msgstr "No apps found"

msgid "Preinstalled core apps"
msgstr ""
msgstr "Preinstalled core apps"

msgid "Custom apps"
msgstr ""
msgstr "Custom apps"

msgid "App Hub"
msgstr ""
msgstr "App Hub"

msgid "Manual install"
msgstr ""
msgstr "Manual install"

msgid "Search AppHub apps"
msgstr ""
msgstr "Search AppHub apps"

msgid "Something went wrong whilst loading App Hub apps"
msgstr ""
msgstr "Something went wrong whilst loading App Hub apps"

msgid "Error loading app"
msgstr ""
msgstr "Error loading app"

msgid "App not found"
msgstr ""
msgstr "App not found"

msgid "Something went wrong whilst loading your core apps"
msgstr ""
msgstr "Something went wrong whilst loading your core apps"

msgid "Core apps with updates available"
msgstr ""
msgstr "Core apps with updates available"

msgid "All core apps"
msgstr ""
msgstr "All core apps"

msgid "Search core apps"
msgstr ""
msgstr "Search core apps"

msgid "Something went wrong whilst loading your custom apps"
msgstr ""
msgstr "Something went wrong whilst loading your custom apps"

msgid "Custom apps with updates available"
msgstr ""
msgstr "Custom apps with updates available"

msgid "All installed custom apps"
msgstr ""
msgstr "All installed custom apps"

msgid "Search installed custom apps"
msgstr ""
msgstr "Search installed custom apps"

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

msgid "Upload an app to install"
msgstr ""
msgstr "Upload an app to install"

msgid "Manually install an app"
msgstr ""
msgstr "Manually install an app"

msgid ""
"Installed apps have access to your DHIS2 data and metadata. Make sure you "
"trust an app before installing it."
msgstr ""
"Installed apps have access to your DHIS2 data and metadata. Make sure you "
"trust an app before installing it."

msgctxt "developer of application"
msgid "by {{- developer}}"
msgstr ""
msgstr "by {{- developer}}"

msgctxt "AppHub release channel"
msgid "Channel"
msgstr ""
msgstr "Channel"

msgctxt "Name of AppHub release channel"
msgid "Stable"
msgstr ""
msgstr "Stable"

msgctxt "Name of AppHub release channel"
msgid "Development"
msgstr ""
msgstr "Development"

msgctxt "Name of AppHub release channel"
msgid "Canary"
msgstr ""
msgstr "Canary"
4 changes: 2 additions & 2 deletions src/components/AppDetails/AppDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Versions } from './Versions'
const Metadata = ({ installedVersion, versions }) => {
const relativeTime = datetime => moment(datetime).fromNow()
versions = versions.sort((a, b) => a.created - b.created)
const latestVersion = getLatestVersion(versions)
const latestVersion = getLatestVersion(versions)?.version

return (
<ul className={styles.metadataList}>
Expand All @@ -21,7 +21,7 @@ const Metadata = ({ installedVersion, versions }) => {
version: installedVersion,
})
: i18n.t('Version {{version}}', {
version: latestVersion.version,
version: latestVersion,
})}
</li>
<li className={styles.metadataItem}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppDetails/ManageInstalledVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const ManageInstalledVersion = ({
const canUpdate =
installedApp &&
latestVersion &&
semverGt(latestVersion, installedApp.version)
semverGt(latestVersion.version, installedApp.version)
const { installVersion, uninstallApp } = useApi()
const successAlert = useAlert(({ message }) => message, { success: true })
const errorAlert = useAlert(({ message }) => message, { critical: true })
Expand Down
1 change: 1 addition & 0 deletions src/pages/InstalledApp/InstalledApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const InstalledApp = ({ match }) => {

if (app.app_hub_id && !appHubResponse.called) {
appHubResponse.refetch({ appHubId: app.app_hub_id })

return (
<CenteredContent>
<CircularLoader />
Expand Down

0 comments on commit b10f887

Please sign in to comment.