@egovernments/digit-ui-module-core 1.5.0-alpha.2 → 1.5.0-alpha.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.
@@ -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, ComplaintIcon, PTIcon, CaseIcon, OBPSIcon, Calender, DocumentIcon, StandaloneSearchBar, CardBasedOptions, WhatsNewCard, 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, 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
 
@@ -2962,7 +2962,7 @@ var TopBar = function TopBar(_ref) {
2962
2962
  return Promise.reject(e);
2963
2963
  }
2964
2964
  }, [profilePic !== null, userDetails === null || userDetails === void 0 ? void 0 : (_userDetails$info2 = userDetails.info) === null || _userDetails$info2 === void 0 ? void 0 : _userDetails$info2.uuid]);
2965
- var CitizenHomePageTenantId = Digit.ULBService.getCitizenCurrentTenant();
2965
+ var CitizenHomePageTenantId = Digit.ULBService.getCitizenCurrentTenant(true);
2966
2966
  var history = useHistory();
2967
2967
 
2968
2968
  var _useLocation = useLocation(),
@@ -4657,144 +4657,6 @@ 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();
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
-
4798
4660
  var LanguageSelection$1 = function LanguageSelection() {
4799
4661
  var _useTranslation = useTranslation(),
4800
4662
  t = _useTranslation.t;
@@ -4851,7 +4713,7 @@ var LocationSelection = function LocationSelection() {
4851
4713
 
4852
4714
  var _useState = useState(function () {
4853
4715
  return {
4854
- code: Digit.ULBService.getCitizenCurrentTenant()
4716
+ code: Digit.ULBService.getCitizenCurrentTenant(true)
4855
4717
  };
4856
4718
  }),
4857
4719
  selectedCity = _useState[0],
@@ -4908,7 +4770,7 @@ var getTenants$1 = function getTenants(codes, tenants) {
4908
4770
  });
4909
4771
  };
4910
4772
 
4911
- var Home$1 = function Home$1(_ref) {
4773
+ var Home = function Home(_ref) {
4912
4774
  var _window, _window$globalConfigs, _window$globalConfigs2;
4913
4775
 
4914
4776
  var stateInfo = _ref.stateInfo,
@@ -4987,7 +4849,10 @@ var Home$1 = function Home$1(_ref) {
4987
4849
  }, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
4988
4850
  exact: true,
4989
4851
  path: path
4990
- }, /*#__PURE__*/React.createElement(Home, null)), /*#__PURE__*/React.createElement(Route, {
4852
+ }, /*#__PURE__*/React.createElement(AppHome, {
4853
+ userType: "citizen",
4854
+ modules: modules
4855
+ })), /*#__PURE__*/React.createElement(Route, {
4991
4856
  exact: true,
4992
4857
  path: path + "/select-language"
4993
4858
  }, /*#__PURE__*/React.createElement(LanguageSelection$1, null)), /*#__PURE__*/React.createElement(Route, {
@@ -5108,7 +4973,7 @@ var DigitApp = function DigitApp(_ref) {
5108
4973
  path: "/digit-ui/employee"
5109
4974
  }, /*#__PURE__*/React.createElement(EmployeeApp, commonProps)), /*#__PURE__*/React.createElement(Route, {
5110
4975
  path: "/digit-ui/citizen"
5111
- }, /*#__PURE__*/React.createElement(Home$1, commonProps)), /*#__PURE__*/React.createElement(Route, null, /*#__PURE__*/React.createElement(Redirect, {
4976
+ }, /*#__PURE__*/React.createElement(Home, commonProps)), /*#__PURE__*/React.createElement(Route, null, /*#__PURE__*/React.createElement(Redirect, {
5112
4977
  to: "/digit-ui/citizen"
5113
4978
  })));
5114
4979
  };