generated from EyeSeeTea/dhis2-app-skeleton
-
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.
- Loading branch information
Showing
10 changed files
with
448 additions
and
205 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
61 changes: 61 additions & 0 deletions
61
src/webapp/components/incident-management-team/IncidentManagementTeamView.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,61 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
|
||
import { | ||
IMTeamHierarchyOption, | ||
IMTeamHierarchyView, | ||
} from "../im-team-hierarchy/IMTeamHierarchyView"; | ||
import { Id } from "../../../domain/entities/Ref"; | ||
import { BasicTable, TableColumn, TableRowType } from "../table/BasicTable"; | ||
|
||
type IncidentManagementTeamViewProps = { | ||
selectedHierarchyItemIds?: Id[]; | ||
onSelectHierarchyItem?: (nodeId: string, selected: boolean) => void; | ||
searchTerm: string; | ||
onSearchChange: (term: string) => void; | ||
incidentManagementTeamHierarchyItems: IMTeamHierarchyOption[]; | ||
defaultTeamRolesExpanded: Id[]; | ||
diseaseOutbreakEventName: string; | ||
isSelectable?: boolean; | ||
constactTableColumns: TableColumn[]; | ||
constactTableRows: TableRowType[]; | ||
}; | ||
|
||
export const IncidentManagementTeamView: React.FC<IncidentManagementTeamViewProps> = React.memo( | ||
props => { | ||
const { | ||
selectedHierarchyItemIds, | ||
onSelectHierarchyItem, | ||
searchTerm, | ||
onSearchChange, | ||
incidentManagementTeamHierarchyItems, | ||
defaultTeamRolesExpanded, | ||
diseaseOutbreakEventName, | ||
constactTableColumns, | ||
constactTableRows, | ||
isSelectable = false, | ||
} = props; | ||
|
||
return ( | ||
<IncidentManagementTeamViewContainer> | ||
<IMTeamHierarchyView | ||
items={incidentManagementTeamHierarchyItems} | ||
selectedItemIds={selectedHierarchyItemIds} | ||
onSelectedItemChange={onSelectHierarchyItem} | ||
diseaseOutbreakEventName={diseaseOutbreakEventName} | ||
onSearchChange={onSearchChange} | ||
searchTerm={searchTerm} | ||
defaultTeamRolesExpanded={defaultTeamRolesExpanded} | ||
isSelectable={isSelectable} | ||
/> | ||
<BasicTable columns={constactTableColumns} rows={constactTableRows} /> | ||
</IncidentManagementTeamViewContainer> | ||
); | ||
} | ||
); | ||
|
||
const IncidentManagementTeamViewContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 24px; | ||
`; |
Oops, something went wrong.