Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions web/rainmaker/packages/employee/src/modules/Routes/employee.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { ImageModalDisplay } from "modules/common";
import { PrivacyPolicy } from "modules/common";
import LandingPage from "modules/employee/LandingPage";
import Inbox from "modules/employee/Inbox";
import ModuleInbox from "modules/employee/ModuleInbox";
import MDMS from "modules/common/MDMS";
import Home from "modules/employee/Home";
import Report from "modules/employee/reports/report";
Expand Down Expand Up @@ -120,6 +121,18 @@ const routes = [
isHomeScreen: true,
},
},
{
path: ":moduleName/inbox",
component: ModuleInbox,
needsAuthentication: true,
options: {
hideFooter: true,
redirectionUrl,
title: "Inbox",
hideTitle: true,
isHomeScreen: true,
},
},
{
path: "image",
component: ImageModalDisplay,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import React from "react";
import { MultiSelectDropdown } from "egov-ui-kit/components";
import Label from "egov-ui-kit/utils/translationNode";
import "../Inbox/components/Filter/index.css";

/**
* FilteredFilter - Module filter component for module-specific inbox
* Difference from original Filter:
* - Module dropdown is disabled when preselectedModule is set
* - This component is used for /employee/:moduleName/inbox route
*/

const FilteredFilter = ({ filter, handleChangeFilter, clearFilter, preselectedModule }) => {
return (
<div>
<div className="row" style={{marginLeft:'-5px', marginBottom: '15px'}}>
<div className="col-md-3">
<MultiSelectDropdown
multiple
onChange={(e) => { handleChangeFilter('moduleFilter', e.target.value) }}
floatingLabelText={<Label label="CS_INBOX_MODULE_FILTER" fontSize="12px" />}//"Module"
className="filter-fields"
labelStyle={{fontWeight:500,color:'black!important'}}
dropDownData={filter.moduleFilter.dropdownData}
value={filter.moduleFilter.selectedValue}
underlineStyle={{
position: "absolute",
bottom: -1,
borderBottom: "1px solid #FE7A51",
width: "100%"
}}
prefix ={"CS_COMMON_INBOX_"}
disabled={preselectedModule ? true : false}
/>
</div>
<div className="col-md-3">
<MultiSelectDropdown
multiple
onChange={(e) => { handleChangeFilter('businessServiceFilter', e.target.value) }}
floatingLabelText={<Label label="CS_INBOX_BUSINESS_SERVICE_FILTER" fontSize="12px" />}
className="filter-fields"
labelStyle={{fontWeight:500,color:'black!important'}}
dropDownData={filter.businessServiceFilter.dropdownData}
value={filter.businessServiceFilter.selectedValue}
underlineStyle={{
position: "absolute",
bottom: -1,
borderBottom: "1px solid #FE7A51",
width: "100%"
}}
/>
</div>
<div className="col-md-3">
<MultiSelectDropdown
multiple
onChange={(e, index, value) => {
handleChangeFilter('localityFilter', e.target.value)
}}
floatingLabelText={<Label label="CS_INBOX_LOCALITY_FILTER" fontSize="12px"/>}
className="filter-fields"
dropDownData={filter.localityFilter.dropdownData}
value={filter.localityFilter.selectedValue}
underlineStyle={{
position: "absolute",
bottom: -1,
borderBottom: "1px solid #FE7A51",
width: "90%"
}}
/>
</div>
<div className="col-md-3" >
<MultiSelectDropdown
multiple
floatingLabelText={<Label label="CS_INBOX_STATUS_FILTER" fontSize="12px" />}
className="filter-fields"
dropDownData={filter.statusFilter.dropdownData}
onChange={(e, index, value) => {

handleChangeFilter('statusFilter', e.target.value) }}
value={filter.statusFilter.selectedValue}
underlineStyle={{
position: "absolute",
bottom: -1,
borderBottom: "1px solid #FE7A51",
width: "100%"
}}
prefix ={"COMMON_"}
/>
</div>
</div>
<div className="row" style={{marginLeft:'-5px', marginBottom: '15px'}}>
<div className="col-md-3">
<div className="rainmaker-displayInline filter-clear-icon" onClick={clearFilter} >
<Label label="CS_INBOX_CLEAR" color="#fe7a51" fontSize="15px" />
</div>
</div>
</div>
</div>
);
};

export default FilteredFilter;
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import LoadingIndicator from "egov-ui-framework/ui-molecules/LoadingIndicator";
import MenuButton from "egov-ui-framework/ui-molecules/MenuButton";
import { setRoute } from "egov-ui-framework/ui-redux/app/actions";
import { prepareFinalObject } from "egov-ui-framework/ui-redux/screen-configuration/actions";
import { fetchLocalizationLabel } from "egov-ui-kit/redux/app/actions";
import { getLocale, getTenantId } from "egov-ui-kit/utils/localStorageUtils";
import Label from "egov-ui-kit/utils/translationNode";
import React, { Component } from "react";
import { connect } from "react-redux";
import FilterDialog from "../Inbox/components/FilterDialog";
import FilteredTableData from "./FilteredTableData";
import "../Inbox/index.css";

/**
* FilteredInbox - Module-specific inbox component
* Shows only workflow tasks for a specific module (e.g., PT, TL, WS)
* Does NOT show module cards (ServiceList)
* Module filter is auto-selected based on URL parameter
*/
class FilteredInbox extends Component {
state = {
actionList: [],
hasWorkflow: false,
filterPopupOpen: false
};

componentDidMount = () => {
const { fetchLocalizationLabel } = this.props
const tenantId = getTenantId();
fetchLocalizationLabel(getLocale(), tenantId, tenantId);
}


componentWillReceiveProps(nextProps) {
const { menu } = nextProps;
const workflowList = menu && menu.filter((item) => item.name === "rainmaker-common-workflow");
if (workflowList && workflowList.length > 0) {
this.setState({
hasWorkflow: true,
});
} else {
this.setState({
hasWorkflow: false,
});
}

const list = menu && menu.filter((item) => item.url === "card");
this.setState({
actionList: list,
});
}

handleClose = () => {
this.setState({ filterPopupOpen: false });
};

onPopupOpen = () => {
this.setState({ filterPopupOpen: true });
}

render() {
const { name, history, setRoute, menu, Loading, preselectedModule, businessServices } = this.props;
const { hasWorkflow } = this.state;
const a = menu ? menu.filter(item => item.url === "quickAction") : [];
const downloadMenu = a.map((obj, index) => {
return {
labelName: obj.displayName,
labelKey: `ACTION_TEST_${obj.displayName.toUpperCase().replace(/[._:-\s\/]/g, "_")}`,
link: () => {
if (obj.navigationURL === "tradelicence/apply") {
this.props.setRequiredDocumentFlag();
}
if (obj.navigationURL && obj.navigationURL.includes('digit-ui')) {
window.location.href = obj.navigationURL;
return;
} else {
setRoute(obj.navigationURL)
}
}
}
})
const { isLoading } = Loading;
const buttonItems = {
label: { labelName: "Take Action", labelKey: "INBOX_QUICK_ACTION" },
rightIcon: "arrow_drop_down",
props: { variant: "outlined", style: { marginLeft: 5, marginRight: 15, marginTop: 10, backgroundColor: "#FE7A51", color: "#fff", border: "none", height: "40px", width: "200px" } },
menu: downloadMenu
}

return (
<div>
<div className="rainmaker-topHeader" style={{ marginTop: "0px", justifyContent: "space-between" }}>
{Loading && isLoading && <LoadingIndicator></LoadingIndicator>}
<div className="rainmaker-topHeader flex">
<Label className="landingPageHeader flex-child" label={"CS_LANDING_PAGE_WELCOME_TEXT"} />
<Label className="landingPageUser flex-child" label={name} />,
</div>
<div className="quick-action-button">
<MenuButton data={buttonItems} />
</div>
</div>

{/* ServiceList (module cards) hidden for module-specific inbox */}

{hasWorkflow && <FilteredTableData onPopupOpen={this.onPopupOpen} preselectedModule={preselectedModule} businessServices={businessServices} />}
<FilterDialog popupOpen={this.state.filterPopupOpen} popupClose={this.handleClose} />
</div>
);
}
}

const mapStateToProps = (state) => {
const { auth, app, screenConfiguration } = state;
const { menu } = app;
const { userInfo } = auth;
const name = auth && userInfo.name;
const { preparedFinalObject } = screenConfiguration;
const { Loading = {} } = preparedFinalObject;
const { isLoading } = Loading;
return { name, menu, Loading, isLoading };
};

const mapDispatchToProps = (dispatch) => {
return {
setRoute: url => dispatch(setRoute(url)),
fetchLocalizationLabel: (locale, tenantId, module) => dispatch(fetchLocalizationLabel(locale, tenantId, module)),
setRequiredDocumentFlag: () => dispatch(prepareFinalObject("isRequiredDocuments", true))
};
}

export default connect(
mapStateToProps, mapDispatchToProps
)(FilteredInbox);
Loading