Skip to content

Commit

Permalink
Merge branch 'release/v2.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
nnkogift committed Jul 17, 2024
2 parents 2f99aac + 63f4dcb commit f1093c4
Show file tree
Hide file tree
Showing 6 changed files with 948 additions and 1,562 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"readme": "https://github.com/hisptz/action-tracker-standalone/blob/develop/README.md",
"name": "action-tracker-standalone",
"version": "2.0.0",
"version": "2.0.1",
"description": "The action tracker is a management tool that helps improve effective coverage of priority interventions at district and community level, covering various interventions such as maternal, newborn, and child health (MNCH), HIV, and nutrition. ",
"license": "BSD-3-Clause",
"private": true,
Expand Down Expand Up @@ -32,7 +32,7 @@
"@badeball/cypress-cucumber-preprocessor": "16.0.3",
"@cypress/react": "^7.0.3",
"@cypress/webpack-preprocessor": "^5.17.1",
"@dhis2/cli-app-scripts": "^10.4.1",
"@dhis2/cli-app-scripts": "^11.4.2",
"@dhis2/cli-utils-cypress": "^10.0.3",
"@dhis2/cypress-commands": "^10.0.3",
"@dhis2/cypress-plugins": "^10.0.3",
Expand Down Expand Up @@ -64,10 +64,10 @@
"wait-on": "^7.0.1"
},
"dependencies": {
"@dhis2/app-runtime": "^3.10.2",
"@dhis2/app-runtime": "^3.10.5",
"@dhis2/app-service-datastore": "^1.0.0-alpha.2",
"@dhis2/d2-i18n": "^1.1.3",
"@dhis2/ui": "^9.2.0",
"@dhis2/ui": "^9.8.9",
"@hisptz/dhis2-ui": "^2.0.2",
"@hisptz/dhis2-utils": "^1.0.56",
"@hookform/resolvers": "^3.1.1",
Expand Down
104 changes: 52 additions & 52 deletions src/modules/Main/components/MainArea/components/DataArea/DataArea.tsx
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
import { FullPageLoader } from '../../../../../../shared/components/Loaders'
import { colors, Pagination } from '@dhis2/ui'
import i18n from '@dhis2/d2-i18n'
import { AddButton } from '../AddButton'
import React from 'react'
import { useCategoryContext } from '../DataProvider'
import { isEmpty } from 'lodash'
import { DataCard } from './components/DataCard'
import { ViewModalProvider } from '../../../../../../shared/components/ViewModal'
import { FullPageLoader } from "../../../../../../shared/components/Loaders";
import { colors, Pagination } from "@dhis2/ui";
import i18n from "@dhis2/d2-i18n";
import { AddButton } from "../AddButton";
import React from "react";
import { useCategoryContext } from "../DataProvider";
import { isEmpty } from "lodash";
import { DataCard } from "./components/DataCard";
import { ViewModalProvider } from "../../../../../../shared/components/ViewModal";

export function DataArea () {
const {
loading,
category,
categoryData,
refetch,
error,
...pagination
} = useCategoryContext()
export function DataArea() {
const { loading, category, categoryData, refetch, error, ...pagination } =
useCategoryContext();

if (loading) {
return (
<FullPageLoader/>
)
}
if (loading) {
return <FullPageLoader />;
}

if (error) {
return (
<div className="column w-100 h-100 align-center center gap-16">
<h1 style={{ color: colors.grey800 }}>{i18n.t('There was an error loading the data.')}</h1>
</div>
)
}
if (isEmpty(categoryData)) {
return (
<div className="column w-100 h-100 align-center center gap-16">
<h1 style={{ color: colors.grey800 }}>{i18n.t('There is no data for the the selected dimensions.')}</h1>
<AddButton primary/>
</div>
)
}

return (
<div className="column gap-32">
<ViewModalProvider>
{
categoryData?.map((data, index) => (
<DataCard index={index} refetch={refetch} instanceConfig={category}
key={`${data.trackedEntity}-card`}
data={data}/>))
}
</ViewModalProvider>
<Pagination {...pagination} />
</div>
)
if (error) {
return (
<div className="column w-100 h-100 align-center center gap-16">
<h1 style={{ color: colors.grey800 }}>
{i18n.t("There was an error loading the data.")}
</h1>
</div>
);
}
if (isEmpty(categoryData)) {
return (
<div className="column w-100 h-100 align-center center gap-16">
<h1 style={{ color: colors.grey800 }}>
{i18n.t(
"There is no data for the the selected dimensions.",
)}
</h1>
<AddButton primary />
</div>
);
}

return (
<div className="column gap-32">
<ViewModalProvider>
{categoryData?.map((data, index) => (
<DataCard
index={index}
refetch={refetch}
instanceConfig={category}
key={`${data.trackedEntity}-card`}
data={data}
/>
))}
</ViewModalProvider>
<Pagination {...pagination} />
</div>
);
}
Loading

0 comments on commit f1093c4

Please sign in to comment.