Skip to content

Commit

Permalink
Merge pull request #698 from dhis2/next
Browse files Browse the repository at this point in the history
chore(release): merge next to master
  • Loading branch information
Birkbjo authored Nov 16, 2022
2 parents 20a0403 + 6ece4ef commit db4e643
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 13 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## [2.31.3](https://github.com/dhis2/app-hub/compare/v2.31.2...v2.31.3) (2022-11-16)


### Bug Fixes

* **apps:** fix source-url being cleared when new version is uploaded ([#697](https://github.com/dhis2/app-hub/issues/697)) ([4ff7525](https://github.com/dhis2/app-hub/commit/4ff7525e89083dcf6154964762755d38dee65b3d))

## [2.31.2](https://github.com/dhis2/app-hub/compare/v2.31.1...v2.31.2) (2022-11-15)


### Bug Fixes

* **add app:** allow clearing optional select field ([#694](https://github.com/dhis2/app-hub/issues/694)) ([24bd6bc](https://github.com/dhis2/app-hub/commit/24bd6bc55221d3fbb06d55dd637fc2d79738a4ab))

## [2.31.1](https://github.com/dhis2/app-hub/compare/v2.31.0...v2.31.1) (2022-11-15)


### Bug Fixes

* **description-editor:** fix some styling issues ([1835663](https://github.com/dhis2/app-hub/commit/1835663afa6ddc970e5f695fdaef645e3ebff5d6))

# [2.31.0](https://github.com/dhis2/app-hub/compare/v2.30.2...v2.31.0) (2022-09-21)


Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "client",
"version": "2.31.0",
"version": "2.31.3",
"description": "The App Hub Client",
"repository": "https://github.com/dhis2/app-hub",
"author": "Birk Johansson <[email protected]>",
Expand Down
13 changes: 8 additions & 5 deletions client/src/pages/UserAppEdit/DescriptionEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useField } from 'react-final-form'
import AppDescription from '../../components/AppDescription/AppDescription'
import styles from './UserAppEdit.module.css'
import MarkdownEditor from '../../components/MarkdownEditor/MarkdownEditor'
import cx from 'classnames'

const tabs = {
WRITE: 'WRITE',
Expand Down Expand Up @@ -38,9 +39,11 @@ const DescriptionEditor = ({ description }) => {
Preview
</Tab>
</TabBar>
{selectedTab === tabs.WRITE && (
<WriteContent description={description} />
)}

<WriteContent
description={description}
hidden={selectedTab !== tabs.WRITE}
/>
{selectedTab === tabs.PREVIEW && <PreviewContent />}
<Help className={styles.helpText}>
A good app description helps users of the App Hub quickly
Expand All @@ -55,9 +58,9 @@ DescriptionEditor.propTypes = {
description: PropTypes.string,
}

const WriteContent = ({ description }) => {
const WriteContent = ({ description, hidden }) => {
return (
<div className={styles.writeContent}>
<div className={cx(styles.writeContent, { [styles.hidden]: hidden })}>
<MarkdownEditor
name="description"
initialValue={description}
Expand Down
12 changes: 12 additions & 0 deletions client/src/pages/UserAppEdit/UserAppEdit.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,15 @@
.writeContent {
margin-top: 8px;
}

.writeContent :global(textarea) {
min-height: 48px;
}

.writeContent :global(p.error) {
margin-left: 8px;
}

.hidden {
display: none;
}
1 change: 1 addition & 0 deletions client/src/pages/UserAppUpload/UserAppUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ const UserAppUpload = ({ user }) => {
className={styles.field}
validate={maxDhisVersionValidator}
options={dhisVersionOptions}
clearable
/>
</section>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
},
"version": "2.31.0"
"version": "2.31.3"
}
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "server",
"version": "2.31.0",
"version": "2.31.3",
"description": "The App Hub Server",
"main": "src/main.js",
"repository": "https://github.com/dhis2/app-hub",
Expand Down
16 changes: 12 additions & 4 deletions server/src/routes/v1/apps/formatting/convertAppsToApiV1Format.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const debug = require('debug')(
const { MediaType } = require('../../../../enums')
const getServerUrl = require('../../../../utils/getServerUrl')

const convertDbAppViewRowToAppApiV1Object = app => ({
const convertDbAppViewRowToAppApiV1Object = (app) => ({
appType: app.type,

status: app.status,
Expand Down Expand Up @@ -78,7 +78,7 @@ const convertAll = (apps, request) => {
debug(`Using serverUrl: ${serverUrl}`)

const formattedApps = {}
apps.forEach(app => {
apps.forEach((app) => {
let currentApp = formattedApps[app.app_id]

if (!currentApp) {
Expand All @@ -90,7 +90,7 @@ const convertAll = (apps, request) => {
if (app.media_id !== null) {
const media = convertAppToV1Media(app, serverUrl)

if (!currentApp.images.find(img => img.id === media.id)) {
if (!currentApp.images.find((img) => img.id === media.id)) {
currentApp.images.push(media)
}

Expand All @@ -100,9 +100,17 @@ const convertAll = (apps, request) => {
})
}

// some app-version may not have a version set
// sourceUrl really should be in 'app'-table, not 'app_version'
if (app.source_url && !currentApp.sourceUrl) {
currentApp.sourceUrl = app.source_url
}

//Prevent duplicate versions
if (
!currentApp.versions.find(version => version.id === app.version_id)
!currentApp.versions.find(
(version) => version.id === app.version_id
)
) {
currentApp.versions.push(convertAppToV1AppVersion(app, serverUrl))
}
Expand Down
2 changes: 1 addition & 1 deletion tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tools",
"version": "2.31.0",
"version": "2.31.3",
"description": "",
"main": "clone.js",
"repository": "https://github.com/dhis2/app-hub",
Expand Down

0 comments on commit db4e643

Please sign in to comment.