Skip to content

Commit

Permalink
Improve layout of the collections POC (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
qgerome authored Apr 20, 2022
1 parent b9bf1cd commit 32be2dc
Show file tree
Hide file tree
Showing 9 changed files with 2,068 additions and 568 deletions.
1,538 changes: 1,527 additions & 11 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"react": "17.0.2",
"react-dom": "17.0.2",
"react-dropzone": "^12.0.5",
"react-markdown": "^8.0.2",
"react-popper": "^2.2.5",
"react-popper-tooltip": "^4.3.1",
"react-select": "^5.2.2",
Expand Down
17 changes: 9 additions & 8 deletions public/locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"# Elements": "# Elements",
"# Rows": "# Rows",
"Actions": "Actions",
"An unexpected error ocurred.": "An unexpected error ocurred.",
Expand All @@ -8,32 +7,34 @@
"Code": "Code",
"Collection properties": "Collection properties",
"Collections": "Collections",
"Content": "Content",
"Created": "Created",
"Created at": "Created at",
"Created At": "Created At",
"Created by": "Created by",
"Database Tables": "Database Tables",
"Description": "Description",
"DHIS Sources": "DHIS Sources",
"Details": "Details",
"DHIS2 Instances": "DHIS2 Instances",
"Download": "Download",
"Edit": "Edit",
"Extract": "Extract",
"Filename": "Filename",
"Home": "Home",
"Id": "Id",
"Last extracted": "Last extracted",
"Loading...": "Loading...",
"Location": "Location",
"Name": "Name",
"Next": "Next",
"Notebooks": "Notebooks",
"Open": "Open",
"Other Sources": "Other Sources",
"Preview": "Preview",
"Preview data source": "Preview data source",
"Postgres Data": "Postgres Data",
"Previous": "Previous",
"S3 Files": "S3 Files",
"Showing {{start}} to {{end}} of {{totalItems}} results": "Showing {{start}} to {{end}} of {{totalItems}} results",
"Showing all results": "Showing all results",
"Tags": "Tags",
"Type": "Type",
"View": "View",
"Visibility": "Visibility"
"Visibility": "Visibility",
"Visualizations": "Visualizations"
}
17 changes: 9 additions & 8 deletions public/locales/fr/messages.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"# Elements": "",
"# Rows": "",
"Actions": "",
"An unexpected error ocurred.": "",
Expand All @@ -8,32 +7,34 @@
"Code": "",
"Collection properties": "",
"Collections": "",
"Content": "",
"Created": "",
"Created at": "",
"Created At": "",
"Created by": "",
"Database Tables": "",
"Description": "",
"DHIS Sources": "",
"Details": "",
"DHIS2 Instances": "",
"Download": "",
"Edit": "",
"Extract": "",
"Filename": "",
"Home": "",
"Id": "",
"Last extracted": "",
"Loading...": "",
"Location": "",
"Name": "",
"Next": "",
"Notebooks": "",
"Open": "",
"Other Sources": "",
"Preview": "",
"Preview data source": "",
"Postgres Data": "",
"Previous": "",
"S3 Files": "",
"Showing {{start}} to {{end}} of {{totalItems}} results": "",
"Showing all results": "",
"Tags": "",
"Type": "",
"View": "",
"Visibility": ""
"Visibility": "",
"Visualizations": ""
}
61 changes: 12 additions & 49 deletions src/features/collection/CollectionDataSourceViewerDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const CollectionDataSourceViewerDialog = (
const { t } = useTranslation();
return (
<Dialog open={open} onClose={onClose} maxWidth="max-w-3xl">
<Dialog.Title onClose={onClose}>{t("Preview data source")}</Dialog.Title>
<Dialog.Title onClose={onClose}>{t("Details")}</Dialog.Title>
<Dialog.Content>
<table className={TableClasses.table}>
<thead className={TableClasses.thead}>
Expand All @@ -28,65 +28,28 @@ const CollectionDataSourceViewerDialog = (
<th className={TableClasses.thCondensed} scope="col">
{t("Type")}
</th>
<th className={TableClasses.thCondensed} scope="col">
{t("Id")}
</th>
<th className={TableClasses.thCondensed} scope="col">
{t("Code")}
</th>
<th className={TableClasses.thCondensed} scope="col">
<span className="sr-only">{t("Actions")}</span>
</th>
</tr>
</thead>
<tbody className={TableClasses.tbody}>
<tr>
<td className={TableClasses.tdCondensed}>Psychoses</td>
<td className={TableClasses.tdCondensed}>-</td>
<td className={TableClasses.tdCondensed}>aAzdq921</td>
<td className={TableClasses.tdCondensed}>DE_xZAs</td>
<td className={TableClasses.tdCondensed}>
<div className="flex items-center justify-end gap-6">
<Button
size="sm"
variant="white"
leadingIcon={<DocumentDownloadIcon className="h-4" />}
>
{t("Extract")}
</Button>
<a
href=""
className="inline-flex items-center font-medium text-blue-600 hover:text-blue-900"
>
{t("Preview")}
<ChevronRightIcon className="ml-1 h-4" />
</a>
</div>
</td>
<td className={TableClasses.tdCondensed}>HF Visits</td>
<td className={TableClasses.tdCondensed}>Data element</td>
<td className={TableClasses.tdCondensed}>data_element_de</td>
</tr>
<tr>
<td className={TableClasses.tdCondensed}>Psychoses</td>
<td className={TableClasses.tdCondensed}>-</td>
<td className={TableClasses.tdCondensed}>aAzdq921</td>
<td className={TableClasses.tdCondensed}>DE_xZAs</td>
<td className={TableClasses.tdCondensed}>
<div className="flex items-center justify-end gap-6">
<Button
size="sm"
variant="white"
leadingIcon={<DocumentDownloadIcon className="h-4" />}
>
{t("Extract")}
</Button>
<a
href=""
className="inline-flex items-center font-medium text-blue-600 hover:text-blue-900"
>
{t("Preview")}
<ChevronRightIcon className="ml-1 h-4" />
</a>
</div>
Level of water per month
</td>
<td className={TableClasses.tdCondensed}>Indicator</td>
<td className={TableClasses.tdCondensed}>id_indicator_lwpm</td>
</tr>
<tr>
<td className={TableClasses.tdCondensed}>An indicator</td>
<td className={TableClasses.tdCondensed}>Indicator</td>
<td className={TableClasses.tdCondensed}>id_indicator_xaz</td>
</tr>
</tbody>
</table>
Expand Down
27 changes: 22 additions & 5 deletions src/libs/collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,47 @@ export const FAKE_COLLECTIONS = [
{
id: "1",
name: "COD Covid Data",
location: "COD",
location: "Burkina Faso",
locationCode: "bf",
createdBy: "Alfonse Brown",
visibility: "Bluesquare Data science (+2)",
createdAt: "2022-04-21",
excerpt: "COD Covid data is made by BLSQ and regroups lot of data",

description:
"<p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.</p><p>Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.</p><p>Temporibus autem.</p>",
tags: ["Malaria", "Polio", "Logistics"],
},
{
id: "2",
name: "BFA Vaccination 2022",
location: "BFA",
location: "Burkina Faso",
locationCode: "bf",
createdBy: "Alfonse Brown",
visibility: "Bluesquare Data science (+2)",
createdAt: "Just Now",
description:
"<p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.</p><p>Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.</p><p>Temporibus autem.</p>",
excerpt:
"BFA Vaccination collection is made by BLSQ and regroups lot of data",
description: `At vero eos et accusamus et iusto odio dignissimos :
- ducimus qui blanditiis praesentium voluptatum
- deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident.
### similique
sunt in culpa qui officia [deserunt mollitia animi](https://app.openhexa.org), id est laborum et dolorum fuga.
Et harum **quidem rerum** facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
_Temporibus_ autem.`,
tags: ["Logistics"],
},
{
id: "3",
name: "IHP Working Data",
createdBy: "Alfonse Brown",
location: "Global",
location: "Netherlands",
locationCode: "nl",
visibility: "Private",
createdAt: "2022-04-21",
description: "",
Expand Down
Loading

0 comments on commit 32be2dc

Please sign in to comment.