From 48ca33e5643319833aff23c22f6d1f344c8a7885 Mon Sep 17 00:00:00 2001 From: Charpell Date: Tue, 30 Jan 2018 12:48:30 +0100 Subject: [PATCH] Display all Maintainers/Developers names on the addon page --- app/js/components/manageApps/Addon.jsx | 29 +++++++++++++++----------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/app/js/components/manageApps/Addon.jsx b/app/js/components/manageApps/Addon.jsx index 208d2ea..748b930 100644 --- a/app/js/components/manageApps/Addon.jsx +++ b/app/js/components/manageApps/Addon.jsx @@ -69,10 +69,13 @@ class Addon extends Component { axios.get(`${urlPrefix}/${apiBaseUrl}${this.requestUrl}`) .then(response => { this.getAffectedModules(response.data.uuid); - this.setState({ - app: response.data, - loadingComplete: true, - }); + return axios.get(`${ApiHelper.getAddonUrl()}?modulePackage=${response.data.packageName}`) + .then(response => { + this.setState({ + app: response.data, + loadingComplete: true, + }); + }); }).catch((error) => { error.response.status === 401 ? location.href = `${location.href.substr(0, location.href.indexOf(location.href.split('/')[4]))}login.htm` : null; this.setState({ loadingComplete: true }); @@ -277,6 +280,9 @@ class Addon extends Component { messageBody, messageType, showMessage } = this.state; + + const developerName = Object.keys(app).length !== 0 ? app.developer.name : null; + const maintainers = app.maintainers ? app.maintainers : app.name; const message = app.startupErrorMessage && app.startupErrorMessage.length > 0 ? 'Error starting ' @@ -330,7 +336,7 @@ class Addon extends Component {

{app.name}

{app.description}

- {app.uuid ? + {app.uid || app.uuid ?

NOTE: Adding, removing, or starting modules will restart OpenMRS, meaning that all scheduled tasks and background processes will be interrupted.

: null @@ -354,7 +360,11 @@ class Addon extends Component { Version: - {app.version} + + { + app.version || app.latestVersion + } + Type: @@ -368,12 +378,7 @@ class Addon extends Component { Maintainers/Developers: { - app.uuid ? - app.author : - app.developer ? - app.developer.name : - app.maintainers ? - app.maintainers[0].name : "" + Array.isArray(maintainers) ? maintainers.map(maintainer => maintainer.name).join(', ') : maintainers }