diff --git a/client/src/pages/AppView/AppView.js b/client/src/pages/AppView/AppView.js index d5b7d0428..f50a79fdd 100644 --- a/client/src/pages/AppView/AppView.js +++ b/client/src/pages/AppView/AppView.js @@ -5,6 +5,7 @@ import { Card, Divider, Button, + Tag, } from '@dhis2/ui' import classnames from 'classnames' import PropTypes from 'prop-types' @@ -17,7 +18,13 @@ import Screenshots from 'src/components/Screenshots/Screenshots' import Versions from 'src/components/Versions/Versions' import { renderDhisVersionsCompatibility } from 'src/lib/render-dhis-versions-compatibility' -const HeaderSection = ({ appName, appDeveloper, appType, logoSrc }) => ( +const HeaderSection = ({ + appName, + appDeveloper, + appType, + logoSrc, + isCoreApp, +}) => (
@@ -27,6 +34,7 @@ const HeaderSection = ({ appName, appDeveloper, appType, logoSrc }) => ( by {appDeveloper} {appType} + {isCoreApp && Core App}
) @@ -34,6 +42,7 @@ HeaderSection.propTypes = { appDeveloper: PropTypes.string.isRequired, appName: PropTypes.string.isRequired, appType: PropTypes.string.isRequired, + isCoreApp: PropTypes.bool, logoSrc: PropTypes.string, } @@ -111,6 +120,7 @@ const AppView = ({ match }) => { appDeveloper={appDeveloper} appType={config.ui.appTypeToDisplayName[app.appType]} logoSrc={logoSrc} + isCoreApp={app.coreApp} /> { return text } -const AppCardItem = ({ id, name, developer, type, description, images }) => { +const AppCardItem = ({ + id, + name, + developer, + type, + description, + images, + isCoreApp, +}) => { const logo = images.find(elem => elem.logo) return ( @@ -29,6 +38,7 @@ const AppCardItem = ({ id, name, developer, type, description, images }) => { {config.ui.appTypeToDisplayName[type]} + {isCoreApp && Core App}

@@ -48,6 +58,7 @@ AppCardItem.propTypes = { type: PropTypes.string.isRequired, description: PropTypes.string, images: PropTypes.array, + isCoreApp: PropTypes.bool, } export default AppCardItem diff --git a/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css b/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css index 87b723e91..cbe826fd8 100644 --- a/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css +++ b/client/src/pages/Apps/AppCards/AppCardItem/AppCardItem.module.css @@ -17,7 +17,7 @@ .appCardHeader { display: grid; - grid-template-columns: 72px auto; + grid-template-columns: 72px auto 67px; grid-gap: var(--spacers-dp12); } @@ -50,3 +50,7 @@ font-size: 15px; line-height: 21px; } + +.coreAppIcon { + width: 25px +} diff --git a/client/src/pages/Apps/AppCards/AppCards.js b/client/src/pages/Apps/AppCards/AppCards.js index 4c7818836..888e6793f 100644 --- a/client/src/pages/Apps/AppCards/AppCards.js +++ b/client/src/pages/Apps/AppCards/AppCards.js @@ -39,6 +39,7 @@ const AppCards = ({ isLoading, error, apps }) => { type={app.appType} description={app.description} images={app.images} + isCoreApp={app.coreApp} /> ))} diff --git a/client/src/pages/UserApp/DetailsCard/DetailsCard.js b/client/src/pages/UserApp/DetailsCard/DetailsCard.js index 31107cf7c..0ac5a2fae 100644 --- a/client/src/pages/UserApp/DetailsCard/DetailsCard.js +++ b/client/src/pages/UserApp/DetailsCard/DetailsCard.js @@ -1,4 +1,4 @@ -import { Card, Button, Divider } from '@dhis2/ui' +import { Card, Button, Divider, Tag } from '@dhis2/ui' import PropTypes from 'prop-types' import { useState, useRef } from 'react' import { Link } from 'react-router-dom' @@ -92,6 +92,7 @@ const DetailsCard = ({ app, mutate }) => { {appType} + {app.coreApp && Core App}

diff --git a/client/src/pages/UserApp/DetailsCard/DetailsCard.module.css b/client/src/pages/UserApp/DetailsCard/DetailsCard.module.css index bc236da6c..ddeb2a039 100644 --- a/client/src/pages/UserApp/DetailsCard/DetailsCard.module.css +++ b/client/src/pages/UserApp/DetailsCard/DetailsCard.module.css @@ -1,6 +1,6 @@ .detailsCardHeader { display: grid; - grid-template-columns: 120px auto; + grid-template-columns: 120px auto 67px; grid-gap: var(--spacers-dp12); margin-bottom: var(--spacers-dp8); } diff --git a/client/src/pages/UserAppEdit/UserAppEdit.js b/client/src/pages/UserAppEdit/UserAppEdit.js index 4f2804274..01451d25e 100644 --- a/client/src/pages/UserAppEdit/UserAppEdit.js +++ b/client/src/pages/UserAppEdit/UserAppEdit.js @@ -7,15 +7,18 @@ import { ReactFinalForm, InputFieldFF, TextAreaFieldFF, + SwitchFieldFF, hasValue, url, } from '@dhis2/ui' import PropTypes from 'prop-types' +import { useSelector } from 'react-redux' import { useHistory } from 'react-router-dom' import styles from './UserAppEdit.module.css' import { useQueryV1 } from 'src/api' import * as api from 'src/api' import { useSuccessAlert, useErrorAlert } from 'src/lib/use-alert' +import { isManager as isManagerSelector } from 'src/selectors/userSelectors' const UserAppEdit = ({ match }) => { const { appId } = match.params @@ -23,6 +26,7 @@ const UserAppEdit = ({ match }) => { const history = useHistory() const successAlert = useSuccessAlert() const errorAlert = useErrorAlert() + const isManager = useSelector(isManagerSelector) const handleSubmit = async values => { try { @@ -101,6 +105,18 @@ const UserAppEdit = ({ match }) => { className={styles.field} validate={url} /> + {isManager && ( + + )}