-
Notifications
You must be signed in to change notification settings - Fork 2
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 #185 from BLSQ/bluesquare-components-tree
tree selection
- Loading branch information
Showing
26 changed files
with
1,509 additions
and
273 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
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,23 @@ | ||
import React from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import OrgunitRelatedSection from "../shared/OrgunitRelatedSection"; | ||
import ContractSummary from "../shared/contracts/ContractSummary"; | ||
|
||
const ContractsSection = ({ orgUnit, orgUnitSectionStyle }) => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<OrgunitRelatedSection messageKey={"dataEntry.activeContracts"} orgUnitSectionStyle={orgUnitSectionStyle}> | ||
{orgUnit.activeContracts && | ||
orgUnit.activeContracts.map((c) => ( | ||
<div style={{paddingTop : "0px"}}> | ||
<ContractSummary orgUnit={orgUnit} contract={c} /> | ||
</div> | ||
))} | ||
{(orgUnit.activeContracts === undefined || orgUnit.activeContracts.length === 0) && ( | ||
<div style={{ marginLeft: "20px" }}>{t("noActiveContracts")}</div> | ||
)} | ||
</OrgunitRelatedSection> | ||
); | ||
}; | ||
|
||
export default ContractsSection; |
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,33 @@ | ||
import React from "react"; | ||
import PluginRegistry from "../core/PluginRegistry"; | ||
import OrgunitRelatedSection from "../shared/OrgunitRelatedSection"; | ||
import DataEntryLinks from "../shared/data_entries/DataEntryLinks"; | ||
|
||
const DataEntriesSection = ({ orgUnit, period, dataEntryCode, orgUnitSectionStyle }) => { | ||
const dataEntryRegistry = PluginRegistry.extension("dataentry.dataEntries"); | ||
const config = PluginRegistry.extension("core.config"); | ||
|
||
let dataEntries = []; | ||
if (orgUnit && orgUnit.activeContracts && orgUnit.activeContracts[0]) { | ||
const expectedDataEntries = dataEntryRegistry.getExpectedDataEntries(orgUnit.activeContracts[0], period); | ||
dataEntries = expectedDataEntries; | ||
} | ||
|
||
return ( | ||
<OrgunitRelatedSection messageKey="dataEntry.dataEntries" orgUnitSectionStyle={orgUnitSectionStyle}> | ||
<div> | ||
{dataEntries && ( | ||
<DataEntryLinks | ||
dataEntries={dataEntries} | ||
dataEntryCode={dataEntryCode || undefined} | ||
period={period} | ||
orgUnit={orgUnit} | ||
periodFormat={config.global.periodFormat} | ||
/> | ||
)} | ||
</div> | ||
</OrgunitRelatedSection> | ||
); | ||
}; | ||
|
||
export default DataEntriesSection; |
Oops, something went wrong.