@egovernments/digit-ui-module-core 1.5.0-alpha.3 → 1.5.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +141 -6
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +142 -7
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -3
package/dist/index.modern.js
CHANGED
|
@@ -3,7 +3,7 @@ import { QueryClient, QueryClientProvider } from 'react-query';
|
|
|
3
3
|
import { Provider } from 'react-redux';
|
|
4
4
|
import { useLocation, useRouteMatch, useHistory, Switch, Route, Redirect, Link, BrowserRouter } from 'react-router-dom';
|
|
5
5
|
import { useTranslation, getI18n } from 'react-i18next';
|
|
6
|
-
import { BackButton, FormStep, OTPInput, CardText, CardLabelError, AppContainer, Toast, Loader, Dropdown, FormComposer, CardSubHeader, Card, CustomButton, SubmitBar, TopBar as TopBar$1, Hamburger, HomeIcon, LanguageIcon, LogoutIcon, EditPencilIcon, Phone, NavBar, GalleryIcon, RemoveIcon, BreadCrumb, CameraIcon, LabelFieldPair, CardLabel, TextInput, MobileNumber, PageBasedInput, CardHeader, RadioButtons, SearchOnRadioButtons, Body } from '@egovernments/digit-ui-react-components';
|
|
6
|
+
import { BackButton, FormStep, OTPInput, CardText, CardLabelError, AppContainer, Toast, Loader, Dropdown, FormComposer, CardSubHeader, Card, CustomButton, SubmitBar, TopBar as TopBar$1, Hamburger, HomeIcon, LanguageIcon, LogoutIcon, EditPencilIcon, Phone, NavBar, GalleryIcon, RemoveIcon, BreadCrumb, CameraIcon, LabelFieldPair, CardLabel, TextInput, MobileNumber, ComplaintIcon, PTIcon, CaseIcon, OBPSIcon, Calender, DocumentIcon, StandaloneSearchBar, CardBasedOptions, WhatsNewCard, PageBasedInput, CardHeader, RadioButtons, SearchOnRadioButtons, Body } from '@egovernments/digit-ui-react-components';
|
|
7
7
|
import { compose, applyMiddleware, createStore, combineReducers } from 'redux';
|
|
8
8
|
import thunk from 'redux-thunk';
|
|
9
9
|
|
|
@@ -4657,6 +4657,144 @@ var EmployeeApp = function EmployeeApp(_ref) {
|
|
|
4657
4657
|
}))));
|
|
4658
4658
|
};
|
|
4659
4659
|
|
|
4660
|
+
var Home = function Home() {
|
|
4661
|
+
var _useTranslation = useTranslation(),
|
|
4662
|
+
t = _useTranslation.t;
|
|
4663
|
+
|
|
4664
|
+
var history = useHistory();
|
|
4665
|
+
var tenantId = Digit.ULBService.getCitizenCurrentTenant(true);
|
|
4666
|
+
|
|
4667
|
+
var _Digit$Hooks$useStore = Digit.Hooks.useStore.getInitData(),
|
|
4668
|
+
_Digit$Hooks$useStore2 = _Digit$Hooks$useStore.data;
|
|
4669
|
+
|
|
4670
|
+
_Digit$Hooks$useStore2 = _Digit$Hooks$useStore2 === void 0 ? {} : _Digit$Hooks$useStore2;
|
|
4671
|
+
var stateInfo = _Digit$Hooks$useStore2.stateInfo,
|
|
4672
|
+
isLoading = _Digit$Hooks$useStore.isLoading;
|
|
4673
|
+
|
|
4674
|
+
var conditionsToDisableNotificationCountTrigger = function conditionsToDisableNotificationCountTrigger() {
|
|
4675
|
+
var _Digit$UserService, _Digit$UserService$ge, _Digit$UserService$ge2, _Digit$UserService2, _Digit$UserService2$g;
|
|
4676
|
+
|
|
4677
|
+
if (((_Digit$UserService = Digit.UserService) === null || _Digit$UserService === void 0 ? void 0 : (_Digit$UserService$ge = _Digit$UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : (_Digit$UserService$ge2 = _Digit$UserService$ge.info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.type) === "EMPLOYEE") return false;
|
|
4678
|
+
if (!((_Digit$UserService2 = Digit.UserService) !== null && _Digit$UserService2 !== void 0 && (_Digit$UserService2$g = _Digit$UserService2.getUser()) !== null && _Digit$UserService2$g !== void 0 && _Digit$UserService2$g.access_token)) return false;
|
|
4679
|
+
return true;
|
|
4680
|
+
};
|
|
4681
|
+
|
|
4682
|
+
var _Digit$Hooks$useEvent = Digit.Hooks.useEvents({
|
|
4683
|
+
tenantId: tenantId,
|
|
4684
|
+
variant: "whats-new",
|
|
4685
|
+
config: {
|
|
4686
|
+
enabled: conditionsToDisableNotificationCountTrigger()
|
|
4687
|
+
}
|
|
4688
|
+
}),
|
|
4689
|
+
EventsData = _Digit$Hooks$useEvent.data,
|
|
4690
|
+
EventsDataLoading = _Digit$Hooks$useEvent.isLoading;
|
|
4691
|
+
|
|
4692
|
+
if (!tenantId) {
|
|
4693
|
+
history.push("/digit-ui/citizen/select-language");
|
|
4694
|
+
}
|
|
4695
|
+
|
|
4696
|
+
var allCitizenServicesProps = {
|
|
4697
|
+
header: t("DASHBOARD_CITIZEN_SERVICES_LABEL"),
|
|
4698
|
+
sideOption: {
|
|
4699
|
+
name: t("DASHBOARD_VIEW_ALL_LABEL"),
|
|
4700
|
+
onClick: function onClick() {
|
|
4701
|
+
return history.push("/digit-ui/citizen/all-services");
|
|
4702
|
+
}
|
|
4703
|
+
},
|
|
4704
|
+
options: [{
|
|
4705
|
+
name: t("ES_PGR_HEADER_COMPLAINT"),
|
|
4706
|
+
Icon: /*#__PURE__*/React.createElement(ComplaintIcon, null),
|
|
4707
|
+
onClick: function onClick() {
|
|
4708
|
+
return history.push("/digit-ui/citizen/pgr-home");
|
|
4709
|
+
}
|
|
4710
|
+
}, {
|
|
4711
|
+
name: t("MODULE_PT"),
|
|
4712
|
+
Icon: /*#__PURE__*/React.createElement(PTIcon, {
|
|
4713
|
+
className: "fill-path-primary-main"
|
|
4714
|
+
}),
|
|
4715
|
+
onClick: function onClick() {
|
|
4716
|
+
return history.push("/digit-ui/citizen/pt-home");
|
|
4717
|
+
}
|
|
4718
|
+
}, {
|
|
4719
|
+
name: t("MODULE_TL"),
|
|
4720
|
+
Icon: /*#__PURE__*/React.createElement(CaseIcon, {
|
|
4721
|
+
className: "fill-path-primary-main"
|
|
4722
|
+
}),
|
|
4723
|
+
onClick: function onClick() {
|
|
4724
|
+
return history.push("/digit-ui/citizen/tl-home");
|
|
4725
|
+
}
|
|
4726
|
+
}, {
|
|
4727
|
+
name: t("CS_COMMON_INBOX_BPA"),
|
|
4728
|
+
Icon: /*#__PURE__*/React.createElement(OBPSIcon, null),
|
|
4729
|
+
onClick: function onClick() {
|
|
4730
|
+
return history.push("/digit-ui/citizen/obps-home");
|
|
4731
|
+
}
|
|
4732
|
+
}],
|
|
4733
|
+
styles: {
|
|
4734
|
+
display: "flex",
|
|
4735
|
+
flexWrap: "wrap",
|
|
4736
|
+
justifyContent: "flex-start",
|
|
4737
|
+
width: "100%"
|
|
4738
|
+
}
|
|
4739
|
+
};
|
|
4740
|
+
var allInfoAndUpdatesProps = {
|
|
4741
|
+
header: t("CS_COMMON_DASHBOARD_INFO_UPDATES"),
|
|
4742
|
+
sideOption: {
|
|
4743
|
+
name: t("DASHBOARD_VIEW_ALL_LABEL"),
|
|
4744
|
+
onClick: function onClick() {}
|
|
4745
|
+
},
|
|
4746
|
+
options: [{
|
|
4747
|
+
name: t("CS_HEADER_MYCITY"),
|
|
4748
|
+
Icon: /*#__PURE__*/React.createElement(HomeIcon, null)
|
|
4749
|
+
}, {
|
|
4750
|
+
name: t("EVENTS_EVENTS_HEADER"),
|
|
4751
|
+
Icon: /*#__PURE__*/React.createElement(Calender, null),
|
|
4752
|
+
onClick: function onClick() {
|
|
4753
|
+
return history.push("/digit-ui/citizen/engagement/events");
|
|
4754
|
+
}
|
|
4755
|
+
}, {
|
|
4756
|
+
name: t("CS_COMMON_DOCUMENTS"),
|
|
4757
|
+
Icon: /*#__PURE__*/React.createElement(DocumentIcon, null),
|
|
4758
|
+
onClick: function onClick() {
|
|
4759
|
+
return history.push("/digit-ui/citizen/engagement/docs");
|
|
4760
|
+
}
|
|
4761
|
+
}, {
|
|
4762
|
+
name: t("CS_COMMON_SURVEYS"),
|
|
4763
|
+
Icon: /*#__PURE__*/React.createElement(DocumentIcon, null),
|
|
4764
|
+
onClick: function onClick() {
|
|
4765
|
+
return history.push("/digit-ui/citizen/engagement/surveys/list");
|
|
4766
|
+
}
|
|
4767
|
+
}],
|
|
4768
|
+
styles: {
|
|
4769
|
+
display: "flex",
|
|
4770
|
+
flexWrap: "wrap",
|
|
4771
|
+
justifyContent: "flex-start",
|
|
4772
|
+
width: "100%"
|
|
4773
|
+
}
|
|
4774
|
+
};
|
|
4775
|
+
return isLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", {
|
|
4776
|
+
className: "HomePageWrapper"
|
|
4777
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
4778
|
+
className: "BannerWithSearch"
|
|
4779
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
4780
|
+
src: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl
|
|
4781
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
4782
|
+
className: "Search"
|
|
4783
|
+
}, /*#__PURE__*/React.createElement(StandaloneSearchBar, {
|
|
4784
|
+
placeholder: t("CS_COMMON_SEARCH_PLACEHOLDER")
|
|
4785
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
4786
|
+
className: "ServicesSection"
|
|
4787
|
+
}, /*#__PURE__*/React.createElement(CardBasedOptions, allCitizenServicesProps), /*#__PURE__*/React.createElement(CardBasedOptions, allInfoAndUpdatesProps)), conditionsToDisableNotificationCountTrigger() ? EventsDataLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", {
|
|
4788
|
+
className: "WhatsNewSection"
|
|
4789
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
4790
|
+
className: "headSection"
|
|
4791
|
+
}, /*#__PURE__*/React.createElement("h2", null, t("DASHBOARD_WHATS_NEW_LABEL")), /*#__PURE__*/React.createElement("p", {
|
|
4792
|
+
onClick: function onClick() {
|
|
4793
|
+
return history.push("/digit-ui/citizen/engagement/whats-new");
|
|
4794
|
+
}
|
|
4795
|
+
}, t("DASHBOARD_VIEW_ALL_LABEL"))), /*#__PURE__*/React.createElement(WhatsNewCard, EventsData === null || EventsData === void 0 ? void 0 : EventsData[0])) : null);
|
|
4796
|
+
};
|
|
4797
|
+
|
|
4660
4798
|
var LanguageSelection$1 = function LanguageSelection() {
|
|
4661
4799
|
var _useTranslation = useTranslation(),
|
|
4662
4800
|
t = _useTranslation.t;
|
|
@@ -4770,7 +4908,7 @@ var getTenants$1 = function getTenants(codes, tenants) {
|
|
|
4770
4908
|
});
|
|
4771
4909
|
};
|
|
4772
4910
|
|
|
4773
|
-
var Home = function Home(_ref) {
|
|
4911
|
+
var Home$1 = function Home$1(_ref) {
|
|
4774
4912
|
var _window, _window$globalConfigs, _window$globalConfigs2;
|
|
4775
4913
|
|
|
4776
4914
|
var stateInfo = _ref.stateInfo,
|
|
@@ -4849,10 +4987,7 @@ var Home = function Home(_ref) {
|
|
|
4849
4987
|
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
|
|
4850
4988
|
exact: true,
|
|
4851
4989
|
path: path
|
|
4852
|
-
}, /*#__PURE__*/React.createElement(
|
|
4853
|
-
userType: "citizen",
|
|
4854
|
-
modules: modules
|
|
4855
|
-
})), /*#__PURE__*/React.createElement(Route, {
|
|
4990
|
+
}, /*#__PURE__*/React.createElement(Home, null)), /*#__PURE__*/React.createElement(Route, {
|
|
4856
4991
|
exact: true,
|
|
4857
4992
|
path: path + "/select-language"
|
|
4858
4993
|
}, /*#__PURE__*/React.createElement(LanguageSelection$1, null)), /*#__PURE__*/React.createElement(Route, {
|
|
@@ -4973,7 +5108,7 @@ var DigitApp = function DigitApp(_ref) {
|
|
|
4973
5108
|
path: "/digit-ui/employee"
|
|
4974
5109
|
}, /*#__PURE__*/React.createElement(EmployeeApp, commonProps)), /*#__PURE__*/React.createElement(Route, {
|
|
4975
5110
|
path: "/digit-ui/citizen"
|
|
4976
|
-
}, /*#__PURE__*/React.createElement(Home, commonProps)), /*#__PURE__*/React.createElement(Route, null, /*#__PURE__*/React.createElement(Redirect, {
|
|
5111
|
+
}, /*#__PURE__*/React.createElement(Home$1, commonProps)), /*#__PURE__*/React.createElement(Route, null, /*#__PURE__*/React.createElement(Redirect, {
|
|
4977
5112
|
to: "/digit-ui/citizen"
|
|
4978
5113
|
})));
|
|
4979
5114
|
};
|