-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
4,656 additions
and
2,509 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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
src/data-workspace/data-workspace.js → ...mponents/data-workspace/data-workspace.js
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,23 @@ | ||
import i18n from '@dhis2/d2-i18n' | ||
import { Button, SelectorBar } from '@dhis2/ui' | ||
import React from 'react' | ||
import { Link } from 'react-router-dom' | ||
import styles from './edit-home-top-bar.module.css' | ||
|
||
export const EditHomeTopBar = () => ( | ||
<div> | ||
<SelectorBar> | ||
<Link to="/"> | ||
<Button small className={styles.exitConfigurationsButton}> | ||
{i18n.t('Exit configuration mode')} | ||
</Button> | ||
</Link> | ||
</SelectorBar> | ||
<div className={styles.editTopBarContainer}> | ||
<h2 className={styles.editTitle}> | ||
{i18n.t('Data exchange configurator')} | ||
</h2> | ||
<Button primary>{i18n.t('New exchange configuration')}</Button> | ||
</div> | ||
</div> | ||
) |
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,15 @@ | ||
.editTopBarContainer { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding: 0 var(--spacers-dp16) 0 var(--spacers-dp16); | ||
} | ||
|
||
.editTitle { | ||
font-size: 26px; | ||
font-weight: 300; | ||
} | ||
|
||
.exitConfigurationsButton { | ||
margin: var(--spacers-dp8); | ||
} |
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,85 @@ | ||
import { useTimeZoneConversion } from '@dhis2/app-runtime' | ||
import i18n from '@dhis2/d2-i18n' | ||
import { | ||
Button, | ||
ButtonStrip, | ||
Card, | ||
IconArrowRight16, | ||
IconApps16, | ||
IconClock16, | ||
} from '@dhis2/ui' | ||
import PropTypes from 'prop-types' | ||
import React from 'react' | ||
import { Link } from 'react-router-dom' | ||
import { useAppContext } from '../../../app-context/index.js' | ||
import { getNaturalCapitalization } from '../../../utils/helpers.js' | ||
import styles from './items-list.module.css' | ||
|
||
const IconTextItem = ({ icon, text }) => ( | ||
<div className={styles.iconText}> | ||
<div className={styles.icon}>{icon}</div> | ||
<div>{text}</div> | ||
</div> | ||
) | ||
|
||
IconTextItem.propTypes = { | ||
icon: PropTypes.node, | ||
text: PropTypes.string, | ||
} | ||
|
||
const AggregateDataExchangeCard = ({ ade }) => { | ||
const { fromServerDate } = useTimeZoneConversion() | ||
const createdClient = fromServerDate(ade?.created) | ||
return ( | ||
<div className={styles.cardContainer}> | ||
<Card key={ade.id} className={styles.cardContainerInner}> | ||
<div className={styles.exchangeTitle}>{ade.displayName}</div> | ||
<div className={styles.detailsContainer}> | ||
<IconTextItem | ||
icon={<IconArrowRight16 />} | ||
text={getNaturalCapitalization(ade.target?.type)} | ||
/> | ||
<IconTextItem | ||
icon={<IconApps16 />} | ||
text={i18n.t('{{numberOfRequests}} requests', { | ||
numberOfRequests: ade.source.requests, | ||
})} | ||
/> | ||
<IconTextItem | ||
icon={<IconClock16 />} | ||
text={i18n.t('Created {{createdDate}}', { | ||
createdDate: createdClient | ||
.getClientZonedISOString() | ||
.substring(0, 10), | ||
})} | ||
/> | ||
</div> | ||
<div> | ||
<ButtonStrip> | ||
<Link to={`/edit/${ade.id}`}> | ||
<Button small>{i18n.t('Edit')}</Button> | ||
</Link> | ||
<Button destructive secondary small> | ||
{i18n.t('Delete')} | ||
</Button> | ||
</ButtonStrip> | ||
</div> | ||
</Card> | ||
</div> | ||
) | ||
} | ||
|
||
AggregateDataExchangeCard.propTypes = { | ||
ade: PropTypes.object, | ||
} | ||
|
||
export const EditItemsList = () => { | ||
const { aggregateDataExchanges } = useAppContext() | ||
return ( | ||
<div className={styles.listContainer}> | ||
{aggregateDataExchanges.map((ade) => ( | ||
<AggregateDataExchangeCard key={ade.id} ade={ade} /> | ||
))} | ||
</div> | ||
) | ||
} |
Oops, something went wrong.