Skip to content

Commit

Permalink
fix: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzemp committed Aug 6, 2024
1 parent 7cbc62e commit e9d0825
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 48 deletions.
65 changes: 37 additions & 28 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ 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: 2024-07-23T14:31:09.295Z\n"
"PO-Revision-Date: 2024-07-23T14:31:09.295Z\n"
"POT-Creation-Date: 2024-08-06T11:43:03.886Z\n"
"PO-Revision-Date: 2024-08-06T11:43:03.886Z\n"

msgid "Editing the target setup will require you to reenter authentication details."
msgstr "Editing the target setup will require you to reenter authentication details."
Expand Down Expand Up @@ -90,29 +90,40 @@ msgstr "Requests"
msgid "Input ID scheme options"
msgstr "Input ID scheme options"

msgid ""
"Defines the scheme (ID, code, attribute value) on the target system that "
"will be used, upon input, to match data sent from the source system."
msgstr ""
"Defines the scheme (ID, code, attribute value) on the target system that "
"will be used, upon input, to match data sent from the source system."

msgid "Input general ID scheme"
msgstr "Input general ID scheme"

msgid "This is some description for this item"
msgstr "This is some description for this item"
msgid ""
"Applies to all elements as the default ID scheme. If the chosen scheme is "
"not present for a given element, ID will be used as the fallback."
msgstr ""
"Applies to all elements as the default ID scheme. If the chosen scheme is "
"not present for a given element, ID will be used as the fallback."

msgid "Input data element ID scheme"
msgstr "Input data element ID scheme"

msgid "This is a different description for this item"
msgstr "This is a different description for this item"
msgid "Applies to data elements."
msgstr "Applies to data elements."

msgid "Input organisation unit ID scheme"
msgstr "Input organisation unit ID scheme"

msgid "Another description for this item"
msgstr "Another description for this item"
msgid "Applies to organisation units."
msgstr "Applies to organisation units."

msgid "Input category option combo ID scheme"
msgstr "Input category option combo ID scheme"

msgid "Last description for this item"
msgstr "Last description for this item"
msgid "Applies to category option combos."
msgstr "Applies to category option combos."

msgid "Add exchange"
msgstr "Add exchange"
Expand Down Expand Up @@ -244,37 +255,35 @@ msgstr "Organisation units"
msgid "Output ID scheme options"
msgstr "Output ID scheme options"

msgid ""
"Defines how data from the source system will be output before it is sent to "
"the target instance."
msgstr ""
"Defines how data from the source system will be output before it is sent to "
"the target instance."

msgid "Output general ID scheme"
msgstr "Output general ID scheme"

msgid ""
"The default ID scheme that will be applied for the data that is exported "
"from the source system. In the case, that the selected scheme is not "
"present, ID will be used as a fallback."
msgstr ""
"The default ID scheme that will be applied for the data that is exported "
"from the source system. In the case, that the selected scheme is not "
"present, ID will be used as a fallback."
msgid "Output data item ID scheme"
msgstr "Output data item ID scheme"

msgid "Applies to data elements, indicators, and program indicators."
msgstr "Applies to data elements, indicators, and program indicators."

msgid "Output data element ID scheme"
msgstr "Output data element ID scheme"

msgid ""
"This scheme is applied to all data elements. It will override the "
"outputDataItemIdScheme"
"Applies to data elements. It will override the scheme specified by "
"outputDataItemIdScheme for data elements."
msgstr ""
"This scheme is applied to all data elements. It will override the "
"outputDataItemIdScheme"

msgid "Output data item ID scheme"
msgstr "Output data item ID scheme"
"Applies to data elements. It will override the scheme specified by "
"outputDataItemIdScheme for data elements."

msgid "Output organisation unit ID scheme"
msgstr "Output organisation unit ID scheme"

msgid "Description for organisation unit ID scheme"
msgstr "Description for organisation unit ID scheme"

msgid "Edit exchange: Add request"
msgstr "Edit exchange: Add request"

Expand Down
13 changes: 7 additions & 6 deletions src/components/edit/exchange-update/exchange-form-contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ export const ExchangeFormContents = React.memo(
</Subsection>
<Subsection
text={i18n.t('Input ID scheme options')}
description={i18n.t(
'Defines the scheme (ID, code, attribute value) on the target system that will be used, upon input, to match data sent from the source system.'
)}
className={styles.idSchemeSection}
>
<>
Expand All @@ -283,16 +286,14 @@ export const ExchangeFormContents = React.memo(
<SchemeSelector
label={i18n.t('Input general ID scheme')}
description={i18n.t(
'This is some description for this item'
'Applies to all elements as the default ID scheme. If the chosen scheme is not present for a given element, ID will be used as the fallback.'
)}
name="target_idScheme"
disabled={editTargetSetupDisabled}
/>
<SchemeSelector
label={i18n.t('Input data element ID scheme')}
description={i18n.t(
'This is a different description for this item'
)}
description={i18n.t('Applies to data elements.')}
name="target_dataElementIdScheme"
disabled={editTargetSetupDisabled}
canBeNone={true}
Expand All @@ -303,7 +304,7 @@ export const ExchangeFormContents = React.memo(
<SchemeSelector
label={i18n.t('Input organisation unit ID scheme')}
description={i18n.t(
'Another description for this item'
'Applies to organisation units.'
)}
name="target_orgUnitIdScheme"
disabled={editTargetSetupDisabled}
Expand All @@ -317,7 +318,7 @@ export const ExchangeFormContents = React.memo(
'Input category option combo ID scheme'
)}
description={i18n.t(
'Last description for this item'
'Applies to category option combos.'
)}
name="target_categoryOptionComboIdScheme"
disabled={editTargetSetupDisabled}
Expand Down
35 changes: 22 additions & 13 deletions src/components/edit/request-update/request-form-contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,36 +119,45 @@ export const RequestFormContents = () => {
/>
</div>
</Subsection>
<Subsection text={i18n.t('Output ID scheme options')}>
<Subsection
text={i18n.t('Output ID scheme options')}
description={i18n.t(
'Defines how data from the source system will be output before it is sent to the target instance.'
)}
>
<>
<SchemeSelector
label={i18n.t('Output general ID scheme')}
description={i18n.t(
'The default ID scheme that will be applied for the data that is exported from the source system. In the case, that the selected scheme is not present, ID will be used as a fallback.'
'Applies to all elements as the default ID scheme. If the chosen scheme is not present for a given element, ID will be used as the fallback.'
)}
name="source_outputIdScheme"
/>
{outputDataItemIdSchemeAvailable && (
<SchemeSelector
label={i18n.t('Output data item ID scheme')}
description={i18n.t(
'Applies to data elements, indicators, and program indicators.'
)}
name="source_outputDataItemIdScheme"
canBeNone={true}
defaultIDSchemeName={i18n.t(
'Output general ID scheme'
)}
/>
)}
<SchemeSelector
label={i18n.t('Output data element ID scheme')}
description={i18n.t(
'This scheme is applied to all data elements. It will override the outputDataItemIdScheme'
'Applies to data elements. For data elements, it will override the scheme specified by Output data item ID scheme.'
)}
name="source_outputDataElementIdScheme"
canBeNone={true}
defaultIDSchemeName={i18n.t('Output general ID scheme')}
/>
{outputDataItemIdSchemeAvailable && (
<SchemeSelector
label={i18n.t('Output data item ID scheme')}
name="source_outputDataItemIdScheme"
/>
)}

<SchemeSelector
label={i18n.t('Output organisation unit ID scheme')}
description={i18n.t(
'Description for organisation unit ID scheme'
)}
description={i18n.t('Applies to organisation units.')}
name="source_outputOrgUnitIdScheme"
canBeNone={true}
defaultIDSchemeName={i18n.t('Output general ID scheme')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@
.checkContainer {
margin-block-start: var(--spacers-dp16);
}

.schemeExplanationText {
font-size: 12px;
color: var(--colors-grey700);
font-weight: 400;
margin: 0 0 var(--spacers-dp8) 0;
}
6 changes: 5 additions & 1 deletion src/components/edit/shared/form-subsection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import PropTypes from 'prop-types'
import React from 'react'
import styles from './form-subsection.module.css'

export const Subsection = ({ text, children, className = '' }) => (
export const Subsection = ({ text, description, children, className = '' }) => (
<div className={className}>
<div className={styles.subtitleContainer}>
<div className={styles.subtitle}>{text}</div>
{description && (
<div className={styles.description}>{description}</div>
)}
</div>
<div className={styles.subsectionContent}>{children}</div>
</div>
Expand All @@ -14,5 +17,6 @@ export const Subsection = ({ text, children, className = '' }) => (
Subsection.propTypes = {
children: PropTypes.node,
className: PropTypes.string,
description: PropTypes.string,
text: PropTypes.string,
}
8 changes: 8 additions & 0 deletions src/components/edit/shared/form-subsection.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
display: inline-block;
}

.description {
margin-inline-start: var(--spacers-dp4);
margin-block-start: var(--spacers-dp8);
font-size: 14px;
color: var(--colors-grey700);
display: block;
}

.subsectionContent {
padding: var(--spacers-dp4);
}

0 comments on commit e9d0825

Please sign in to comment.