-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update package.json * HLM-4751 added facilty and product tab in view project (#76) * Hlm 4539 update (#75) * Added the Download feature in the view screen * updated the view page code * updated the version * updated all package version * HLM-4668: UI Project Staff add / delete in view Campaign screen (#77) * HLM-4536 made the view screen * HLM-4536 table the table in the components * HLM-4537:Added edit option for dates * HLM-4537:Updated code * HLM-4668: Added api integration for project staff * HLM-4668: Updated modal * HLM-4468: Fixed delete issue --------- Co-authored-by: Bhavya-egov <[email protected]> * Hlm 4751 enhancement in view project (#82) * HLM-4751 added facilty and product tab in view project * HLM-4751 added new columns in view product and facility table * HLM-4751 resolved the conflicts * HLM-4751 added label in the project staff * HLM-4751 updated the package version --------- Co-authored-by: Bhavya-egov <[email protected]> Co-authored-by: himanshukeshari-eGov <[email protected]> Co-authored-by: Anil Singha <[email protected]> Co-authored-by: Bhavya-egov <[email protected]>
- Loading branch information
1 parent
fcdf4a3
commit 791eb35
Showing
24 changed files
with
899 additions
and
164 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
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
34 changes: 34 additions & 0 deletions
34
...eb/micro-ui-internals/packages/modules/workbench-hcm/src/components/ConfirmationDialog.js
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,34 @@ | ||
import { Card, Modal, CloseSvg, Close } from "@egovernments/digit-ui-react-components"; | ||
import React, { useState } from "react"; | ||
|
||
const ConfirmationDialog = ({ t, onSubmit, closeModal, heading }) => { | ||
const CloseBtn = (props) => { | ||
return ( | ||
<div onClick={props?.onClick} style={props?.isMobileView ? { padding: 5 } : null}> | ||
{props?.isMobileView ? ( | ||
<CloseSvg /> | ||
) : ( | ||
<div className={"icon-bg-secondary"} style={{ backgroundColor: "#FFFFFF" }}> | ||
<Close /> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
const Heading = (props) => { | ||
return <h1 className="heading-m">{props.heading}</h1>; | ||
}; | ||
return ( | ||
<Modal | ||
headerBarMain={<Heading t={t} heading={t(heading)} />} | ||
headerBarEnd={<CloseBtn onClick={closeModal} />} | ||
actionCancelLabel={t("CS_COMMON_CANCEL")} | ||
actionCancelOnSubmit={closeModal} | ||
actionSaveLabel={t("WBH_EVENT_DELETE")} | ||
actionSaveOnSubmit={(confirmed) => onSubmit(confirmed)} | ||
> | ||
<Card style={{ boxShadow: "none" }}>{t("WBH_DELETE_TEXT")}</Card> | ||
</Modal> | ||
); | ||
}; | ||
export default ConfirmationDialog; |
104 changes: 104 additions & 0 deletions
104
...web/micro-ui-internals/packages/modules/workbench-hcm/src/components/FacilityComponent.js
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,104 @@ | ||
import React from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { Card, Header, Button, Loader } from "@egovernments/digit-ui-react-components"; | ||
import { data } from "../configs/ViewProjectConfig"; | ||
|
||
const FacilityComponent = (props) => { | ||
const { t } = useTranslation(); | ||
|
||
const requestCriteria = { | ||
url: "/project/facility/v1/_search", | ||
changeQueryName: props.projectId, | ||
params: { | ||
tenantId: "mz", | ||
offset: 0, | ||
limit: 10, | ||
}, | ||
|
||
body: { | ||
ProjectFacility: { | ||
"projectId": [props.projectId] | ||
}, | ||
} | ||
}; | ||
|
||
const { isLoading, data: projectFacility } = Digit.Hooks.useCustomAPIHook(requestCriteria); | ||
|
||
|
||
const facilityRequestCriteria = { | ||
url: "/facility/v1/_search", | ||
changeQueryName: projectFacility?.ProjectFacilities?.[0]?.facilityId, | ||
params: { | ||
tenantId: "mz", | ||
offset: 0, | ||
limit: 10, | ||
}, | ||
|
||
body: { | ||
Facility: { | ||
"id": [projectFacility?.ProjectFacilities?.[0]?.facilityId] | ||
}, | ||
} | ||
}; | ||
|
||
const { isLoadingFacilty, data: Facility } = Digit.Hooks.useCustomAPIHook(facilityRequestCriteria); | ||
|
||
const updatedProjectFacility = projectFacility?.ProjectFacilities.map(row => { | ||
const facilityData = Facility?.Facilities?.find(facility => facility.id === row.facilityId); | ||
return { | ||
...row, | ||
storageCapacity: facilityData?.storageCapacity || "NA", | ||
name: facilityData?.name || "NA", | ||
usage: facilityData?.usage || "NA", | ||
address: facilityData?.address || "NA", | ||
}; | ||
}); | ||
|
||
const columns = [ | ||
{ label: t("FACILITY_ID"), key: "facilityId" }, | ||
{ label: t("PROJECT_FACILITY_ID"), key: "id" }, | ||
{ label: t("STORAGE_CAPACITY"), key: "storageCapacity" }, | ||
{ label: t("FACILITY_NAME"), key: "name" }, | ||
{ label: t("FACILITY_USAGE"), key: "usage" } | ||
]; | ||
|
||
|
||
if (isLoading) { | ||
return <Loader></Loader>; | ||
} | ||
|
||
return ( | ||
<div className="override-card"> | ||
<Header className="works-header-view">{t("FACILITY")}</Header> | ||
{updatedProjectFacility?.length === 0 ? ( | ||
<h1>{t("NO_FACILITY")}</h1> | ||
) : ( | ||
<table className="table reports-table sub-work-table"> | ||
<thead> | ||
<tr> | ||
{columns.map((column, index) => ( | ||
<th key={index}>{column.label}</th> | ||
))} | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{updatedProjectFacility?.map((row, rowIndex) => ( | ||
<tr key={rowIndex}> | ||
{columns.map((column, columnIndex) => ( | ||
<td key={columnIndex}> | ||
{row[column.key] || "NA"} | ||
</td> | ||
))} | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
) | ||
} | ||
|
||
</div> | ||
|
||
) | ||
} | ||
|
||
export default FacilityComponent |
76 changes: 76 additions & 0 deletions
76
...ro-ui-internals/packages/modules/workbench-hcm/src/components/ProductDeliveryComponent.js
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,76 @@ | ||
import React from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { Card, Header, Button, Loader } from "@egovernments/digit-ui-react-components"; | ||
import { data } from "../configs/ViewProjectConfig"; | ||
|
||
const ProductDeliveryComponent = (props) => { | ||
const { t } = useTranslation(); | ||
|
||
const requestCriteria = { | ||
url: "/product/v1/_search", | ||
changeQueryName:props.projectId, | ||
params: { | ||
tenantId : "mz", | ||
offset: 0, | ||
limit: 10, | ||
}, | ||
|
||
body: { | ||
Product: { | ||
|
||
}, | ||
// apiOperation: "SEARCH" | ||
} | ||
}; | ||
|
||
const {isLoading, data: product } = Digit.Hooks.useCustomAPIHook(requestCriteria); | ||
// console.log("product",product); | ||
|
||
|
||
const columns = [ | ||
{ label: t("PRODUCT_ID"), key: "id" }, | ||
{ label: t("MANUFACTURER"), key: "manufacturer" }, | ||
{ label: t("NAME"), key: "name" }, | ||
{ label: t("TYPE"), key: "type" } | ||
]; | ||
|
||
|
||
if (isLoading) { | ||
return <Loader></Loader>; | ||
} | ||
|
||
return ( | ||
<div className="override-card"> | ||
<Header className="works-header-view">{t("PRODUCT")}</Header> | ||
{product?.Product.length === 0 ? ( | ||
<h1>{t("NO_PRODUCT")}</h1> | ||
) : ( | ||
<table className="table reports-table sub-work-table"> | ||
<thead> | ||
<tr> | ||
{columns.map((column, index) => ( | ||
<th key={index}>{column.label}</th> | ||
))} | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{product?.Product.map((row, rowIndex) => ( | ||
<tr key={rowIndex}> | ||
{columns.map((column, columnIndex) => ( | ||
<td key={columnIndex}> | ||
{row[column.key] || "NA"} | ||
</td> | ||
))} | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
) | ||
} | ||
|
||
</div> | ||
|
||
) | ||
} | ||
|
||
export default ProductDeliveryComponent; |
Oops, something went wrong.