-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #686 from dhis2/next
chore(release): merge next to master
- Loading branch information
Showing
20 changed files
with
1,086 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ module.exports = { | |
}, | ||
ui: { | ||
dhisVersions: [ | ||
'2.39', | ||
'2.38', | ||
'2.37', | ||
'2.36', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
import PropTypes from 'prop-types' | ||
import ReactMarkdown from 'react-markdown' | ||
import styles from './AppDescription.module.css' | ||
|
||
const AppDescription = ({ description, paragraphClassName }) => { | ||
const lines = description.split('\n') | ||
return lines.map((line, index) => { | ||
if (!line.trim()) { | ||
return <br key={index} /> | ||
} | ||
return ( | ||
<p key={index} className={paragraphClassName}> | ||
{line} | ||
</p> | ||
) | ||
}) | ||
return ( | ||
<div className={paragraphClassName}> | ||
<ReactMarkdown | ||
className={styles.markdownDescription} | ||
linkTarget={'_blank'} | ||
> | ||
{description} | ||
</ReactMarkdown> | ||
</div> | ||
) | ||
} | ||
|
||
AppDescription.propTypes = { | ||
description: PropTypes.string, | ||
paragraphClassName: PropTypes.string, | ||
} | ||
|
||
export default AppDescription |
19 changes: 19 additions & 0 deletions
19
client/src/components/AppDescription/AppDescription.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.markdownDescription h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6 { | ||
font-size: 16px; | ||
font-weight: 500; | ||
} | ||
|
||
.markdownDescription a { | ||
color: var(--colors-blue600); | ||
} | ||
|
||
.markdownDescription a:hover, | ||
.markdownDescription a:focus { | ||
color: var(--colors-blue700); | ||
text-decoration: underline; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { ReactFinalForm, TextAreaFieldFF } from '@dhis2/ui' | ||
import styles from './MarkdownEditor.module.css' | ||
import MarkdownIcon from 'assets/icons/markdown_icon.svg' | ||
|
||
const MARKDOWN_GUIDE_URL = 'https://www.markdownguide.org/basic-syntax/' | ||
|
||
const MarkdownEditor = ({ ...fieldProps }) => { | ||
return ( | ||
<div className={styles.markdownFieldWrapper}> | ||
<ReactFinalForm.Field | ||
component={TextAreaFieldFF} | ||
autoGrow | ||
{...fieldProps} | ||
/> | ||
<label className={styles.markdownSupportedText}> | ||
<span>Styling with Markdown is supported.</span> | ||
<a | ||
href={MARKDOWN_GUIDE_URL} | ||
target={'_blank'} | ||
className={styles.markdownLink} | ||
> | ||
<MarkdownIcon /> | ||
</a> | ||
</label> | ||
</div> | ||
) | ||
} | ||
|
||
export default MarkdownEditor |
43 changes: 43 additions & 0 deletions
43
client/src/components/MarkdownEditor/MarkdownEditor.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
.markdownFieldWrapper { | ||
border: 1px solid var(--colors-grey500); | ||
border-radius: 3px; | ||
background-color: var(--colors-grey100); | ||
} | ||
|
||
.markdownFieldWrapper :global(textarea) { | ||
border: 0 !important; | ||
border-bottom: 1px dashed var(--colors-grey600) !important; | ||
border-bottom-left-radius: 0 !important; | ||
box-shadow: none !important; | ||
} | ||
|
||
/* | ||
TODO: Can remove when UI-library is updated | ||
Fix for status-icon margin | ||
This is fixed in latest UI | ||
https://github.com/dhis2/ui/commit/3f23cc541e52ed02e4846dadb7a8e54baa92aef6 */ | ||
.markdownFieldWrapper :global(.status-icon) { | ||
display: none; | ||
} | ||
|
||
.markdownSupportedText { | ||
font-size: 12px; | ||
padding: 4px 8px; | ||
background-color: var(--colors-grey100); | ||
color: var(--colors-grey700); | ||
border-top: 1px dashed var(--colors-grey100); | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
border-radius: 3px; | ||
} | ||
|
||
.markdownLink { | ||
fill: var(--colors-grey700); | ||
} | ||
|
||
.markdownLink:hover, | ||
.markdownLink:focus { | ||
fill: var(--colors-grey900); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.