Skip to content

Commit

Permalink
Merge pull request #1619 from dhis2/ui-adjustments
Browse files Browse the repository at this point in the history
fix: interface adjustments
  • Loading branch information
cooper-joe authored Jan 10, 2023
2 parents eb4545d + da281f0 commit 1976060
Show file tree
Hide file tree
Showing 33 changed files with 2,797 additions and 2,527 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@dhis2/d2-i18n": "^1.1.0",
"@dhis2/maps-gl": "^3.5.1",
"@dhis2/prop-types": "^3.1.2",
"@dhis2/ui": "^8.4.15",
"@dhis2/ui": "^8.7.2",
"classnames": "^2.2.6",
"final-form-arrays": "^3.0.2",
"react-final-form-arrays": "^3.1.3",
Expand Down
1 change: 1 addition & 0 deletions src/App.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ body {
.sidebar {
grid-column: sidebar;
background-color: var(--colors-grey200);
border-right: 1px solid var(--colors-grey400);
height: 100%;
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/BasicOptions/BasicOptions.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
font-size: 18px;
font-weight: 500;
color: var(--colors-grey900);
margin-bottom: var(--spacers-dp4);
margin: 0 0 var(--spacers-dp4) 0;
}

.header {
margin: var(--spacers-dp8) 0;
margin: 0 0 var(--spacers-dp8) 0;
}
10 changes: 5 additions & 5 deletions src/components/DatePicker/__snapshots__/DatePicker.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@ exports[`matches snapshot 1`] = `
data-test="date-picker"
>
<label
class="jsx-2718078600 "
class="jsx-2904627559 "
data-test="date-picker-label"
for="file"
>
<span
class="jsx-2718078600"
class="jsx-2904627559"
>
Start date
</span>
</label>
<div
class="jsx-3111771310 "
class="jsx-3651602664 "
data-test="date-picker-content"
>
<div
class="jsx-2908043323 "
data-test="dhis2-uicore-box"
>
<div
class="jsx-3353877153 jsx-3090974169 input"
class="jsx-3353877153 jsx-3173911271 input"
data-test="dhis2-uicore-input"
>
<input
class="jsx-3353877153 jsx-3090974169 "
class="jsx-3353877153 jsx-3173911271 "
id="file"
name="file"
type="date"
Expand Down
4 changes: 2 additions & 2 deletions src/components/FormField/FormField.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
display: block;
font-size: 14px;
font-weight: 500;
color: var(--colors-grey800);
margin: 0 0 10px;
color: var(--colors-grey900);
margin: 0 0 var(--spacers-dp8);
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ exports[`matches snapshot 1`] = `
</div>
</div>
<p
class="jsx-4256586228 "
class="jsx-4265152438 "
data-test="import-strip-help"
>
A dry run tests the import settings without importing any data
Expand Down
4 changes: 2 additions & 2 deletions src/components/JobOverview/JobOverview.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TaskContext } from '../../contexts/index.js'
import { categoryTypes } from '../../utils/tasks.js'
import { JobSummary } from '../index.js'
import { ChipContainer } from './ChipContainer.js'
import { categoryTypesObj, jobToPath } from './helper.js'
import { jobToPath } from './helper.js'
import styles from './JobOverview.module.css'
import { MenuLabel } from './MenuLabel/MenuLabel.js'

Expand Down Expand Up @@ -65,6 +65,7 @@ const JobOverview = ({
<ChipContainer>
{categoryTypes.map(({ key, importType, label }) => (
<Chip
dense
onClick={() => onChipClick(importType)}
selected={activeTypes.includes(importType)}
key={key}
Expand All @@ -80,7 +81,6 @@ const JobOverview = ({
active={selectedJob && selectedJob.id === t.id}
label={<MenuLabel task={t} />}
onClick={() => setSelectedJob(t)}
icon={categoryTypesObj[t.importType].icon}
/>
))}
</Menu>
Expand Down
15 changes: 12 additions & 3 deletions src/components/JobOverview/JobOverview.module.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
.container {
display: grid;
grid-gap: 20px;
grid-template-rows: auto;
grid-template-columns: 1fr;
height: 100%;
border: 1px solid var(--colors-grey400);
background: var(--colors-white);
}

.chips {
margin-bottom: var(--spacers-dp4);
margin: var(--spacers-dp4);
}

.Menu {
Expand All @@ -17,9 +18,17 @@
overflow: auto;
}

.items {
border-right: 1px solid var(--colors-grey400);
}

.summary {
padding: var(--spacers-dp16);
}

@media (min-width: 1200px) {
.container {
grid-template-columns: [items] 350px [summary] minmax(0, 1fr);
grid-template-columns: [items] 320px [summary] minmax(0, 1fr);
}

.items {
Expand Down
22 changes: 11 additions & 11 deletions src/components/JobOverview/MenuLabel/MenuLabel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import i18n from '@dhis2/d2-i18n'
import { Tag } from '@dhis2/ui'
import PropTypes from 'prop-types'
import React from 'react'
import { jsDateToString } from '../../../utils/helper.js'
Expand All @@ -10,18 +11,17 @@ const MenuLabel = ({ task }) => {
className={styles.container}
data-test={`job-overview-menu-label-${task.id}`}
>
<div className={styles.status}>
<span className={styles.filename}>
{task.jobDetails.files[0].name}
</span>
<br />
<span>
{task.completed
? i18n.t('Completed')
: i18n.t('In progress')}{' '}
</span>
<div className={styles.filename}>
{task.jobDetails.files[0].name}
</div>
<div className={styles.subtitle}>
{task.completed ? (
<Tag positive>{i18n.t('Completed')}</Tag>
) : (
<Tag>{i18n.t('In progress')}</Tag>
)}{' '}
<p className={styles.date}>{jsDateToString(task.created)}</p>
</div>
<div className={styles.date}>{jsDateToString(task.created)}</div>
</div>
)
}
Expand Down
23 changes: 12 additions & 11 deletions src/components/JobOverview/MenuLabel/MenuLabel.module.css
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
.container {
display: flex;
align-items: center;
justify-content: space-between;
}

.status {
min-width: 120px;
flex-direction: column;
gap: var(--spacers-dp8);
}

.filename {
display: inline-block;
width: 300px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.subtitle {
display: flex;
gap: var(--spacers-dp8);
align-items: center;
}

.date {
margin-left: 20px;
font-size: 13px;
color: var(--colors-grey700);
margin: 0;
}

@media (min-width: 1200px) {
.filename {
width: 120px;
max-width: 290px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,31 @@ exports[`MenuLabel matches snapshot 1`] = `
data-test="job-overview-menu-label-EcJpZjEcMfI"
>
<div
class="status"
class="filename"
>
<span
class="filename"
>
data1.json
</span>
<br />
<span>
Completed
</span>
data1.json
</div>
<div
class="date"
class="subtitle"
>
2020-02-12 13:00:23
<div
class="jsx-72316749 positive"
data-test="dhis2-uicore-tag"
>
<span
class="jsx-1110058759"
data-test="dhis2-uicore-tag-text"
>
Completed
</span>
</div>
<p
class="date"
>
2020-02-12 13:00:23
</p>
</div>
</div>
</DocumentFragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,31 @@ exports[`matches snapshot 1`] = `
data-test="job-overview-menu-label-EcJpZjEcMfI"
>
<div
class="status"
class="filename"
>
<span
class="filename"
>
data1.json
</span>
<br />
<span>
Completed
</span>
data1.json
</div>
<div
class="date"
class="subtitle"
>
2020-02-12 13:00:23
<div
class="jsx-72316749 positive"
data-test="dhis2-uicore-tag"
>
<span
class="jsx-1110058759"
data-test="dhis2-uicore-tag-text"
>
Completed
</span>
</div>
<p
class="date"
>
2020-02-12 13:00:23
</p>
</div>
</div>
</DocumentFragment>
Expand Down
20 changes: 10 additions & 10 deletions src/components/JobSummary/JobSummary.module.css
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
.container {
margin-bottom: 15px;
margin-bottom: var(--spacers-dp16);
}

.title {
font-family: Roboto;
font-size: 16px;
line-height: 19px;
font-weight: 500;
margin: 0px;
}

.taskDetails {
margin: 6px 0px 0px;
font-size: 12px;
margin: var(--spacers-dp8) 0px var(--spacers-dp4);
font-size: 13px;
line-height: 14px;
color: rgb(74, 87, 104);
color: var(--colors-grey700);
}

.tags {
margin-top: 6px;
}

.tags > * {
margin-right: 6px;
display: flex;
gap: var(--spacers-dp4);
margin: var(--spacers-dp8) 0 0;
}
2 changes: 1 addition & 1 deletion src/components/MoreOptions/MoreOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const MoreOptions = ({
</div>
<h2 className={styles.label}>{label}</h2>
</header>
<Divider />
{!hidden && <Divider />}
<div className={styles.children} data-test={`${dataTest}-children`}>
{!hidden && children}
</div>
Expand Down
15 changes: 9 additions & 6 deletions src/components/MoreOptions/MoreOptions.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@
cursor: pointer;
display: flex;
align-items: center;
margin: var(--spacers-dp8) 0;
gap: var(--spacers-dp4);
margin: 0;
padding: var(--spacers-dp4) var(--spacers-dp8);
border-radius: 3px;
background: transparent;
}

.header:hover {
background: var(--colors-grey200);
}

.label {
Expand All @@ -21,11 +29,6 @@
margin-top: var(--spacers-dp4);
}

.header svg {
margin-left: -3px;
margin-right: 5px;
}

.chevronHidden svg {
transform: rotate(90deg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ exports[`matches snapshot when not toggled 1`] = `
Advanced options
</h2>
</header>
<div
class="jsx-1555285825 jsx-876534464 "
data-test="dhis2-uicore-divider"
/>
<div
class="children"
data-test="more-options-children"
Expand Down
Loading

0 comments on commit 1976060

Please sign in to comment.