-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #263 from EyeSeeTea/development
Release 0.4.0
- Loading branch information
Showing
42 changed files
with
10,930 additions
and
5,054 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ install: | |
script: | ||
- yarn wait-on http-get://localhost:8080 | ||
- curl -F [email protected] -X POST -u "$CYPRESS_DHIS2_AUTH" "http://localhost:8080/api/apps" | ||
- CYPRESS_EXTERNAL_API=http://localhost:8080 CYPRESS_ROOT_URL=http://localhost:8080 xvfb-run --auto-servernum --server-num=1 --server-args="-screen 0 1024x768x24" yarn cy:e2e:run --browser chrome --record --key ae48c13f-96a1-4850-b8b2-d5329b3c4813 | ||
- CYPRESS_EXTERNAL_API=http://localhost:8080 CYPRESS_ROOT_URL=http://localhost:8080 yarn cy:e2e:run --record --key ae48c13f-96a1-4850-b8b2-d5329b3c4813 | ||
- kill $(jobs -p) || true | ||
addons: | ||
apt: | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from "react"; | ||
import Sidebar, { SidebarProps, MenuItem } from "../steps/data-elements/Sidebar"; | ||
import { Id } from "../../types/d2-api"; | ||
|
||
interface SectionsSidebarProps { | ||
sectorId: Id; | ||
items: SidebarProps["menuItems"]; | ||
setSector(sectorItem: MenuItem): void; | ||
} | ||
|
||
const SectionsSidebar: React.FC<SectionsSidebarProps> = props => { | ||
const { sectorId, items, setSector, children } = props; | ||
return ( | ||
<Sidebar | ||
menuItems={items} | ||
currentMenuItemId={sectorId} | ||
onMenuItemClick={setSector} | ||
contents={<div style={styles.wrapper}>{children}</div>} | ||
/> | ||
); | ||
}; | ||
|
||
const styles = { wrapper: { width: "100%" } }; | ||
|
||
export default SectionsSidebar; |
15 changes: 15 additions & 0 deletions
15
src/components/sections-sidebar/sections-sidebar-hooks.tsx
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 @@ | ||
import React from "react"; | ||
import Project from "../../models/Project"; | ||
import { Ref } from "../../types/d2-api"; | ||
|
||
export function useSectionsSidebar(project: Project) { | ||
const items = React.useMemo(() => { | ||
return project.sectors.map(sector => ({ id: sector.id, text: sector.displayName })); | ||
}, [project]); | ||
|
||
const [sectorId, setSectorId] = React.useState<string>(items.length > 0 ? items[0].id : ""); | ||
|
||
const setSector = React.useCallback((sector: Ref) => setSectorId(sector.id), [setSectorId]); | ||
|
||
return { items, sectorId, setSector }; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/components/steps/data-elements-selection/DataElementsSelectionStep.tsx
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 React from "react"; | ||
import { StepProps } from "../../../pages/project-wizard/ProjectWizard"; | ||
import DataElementsStep, { DataElementsStepProps } from "../data-elements/DataElementsStep"; | ||
|
||
const DataElementsSelectionStep: React.FC<StepProps> = props => { | ||
const { project } = props; | ||
const getSelection: DataElementsStepProps["onSelect"] = React.useCallback( | ||
(sectorId, dataElementIds) => { | ||
return project.updateDataElementsSelection(sectorId, dataElementIds); | ||
}, | ||
[project] | ||
); | ||
|
||
return ( | ||
<DataElementsStep | ||
{...props} | ||
onSelect={getSelection} | ||
dataElementsSet={project.dataElementsSelection} | ||
/> | ||
); | ||
}; | ||
|
||
export default React.memo(DataElementsSelectionStep); |
Oops, something went wrong.