@zeniai/client-epic-state 5.0.16-betaJK3 → 5.0.16

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.
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.getMonthEndCloseChecksViewByTenantId = exports.isMonthEndInsightDisabled = void 0;
4
7
  const toolkit_1 = require("@reduxjs/toolkit");
8
+ const isEqual_1 = __importDefault(require("lodash/isEqual"));
5
9
  const formatZeniDateFY_1 = require("../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
6
10
  const timePeriod_1 = require("../../commonStateTypes/timePeriod");
7
11
  const monthEndCloseChecksSelector_1 = require("../../entity/monthEndCloseChecks/monthEndCloseChecksSelector");
@@ -14,6 +18,13 @@ const isMonthEndInsightDisabled = (currentTenant, selectedPeriod, userAllowedToA
14
18
  userAllowedToAccessMonthEndInsights === false) {
15
19
  return true;
16
20
  }
21
+ const previousMonthPeriod = {
22
+ month: (0, timePeriod_1.toMonth)((0, zeniDayJS_1.dateNow)().subtract(1, 'month').month() + 1),
23
+ year: (0, zeniDayJS_1.dateNow)().subtract(1, 'month').year(),
24
+ };
25
+ if (!(0, isEqual_1.default)(previousMonthPeriod, selectedPeriod)) {
26
+ return true;
27
+ }
17
28
  // if the selected period is November 2024, then book close date should not be null and book close date should be 30th November 2024
18
29
  const { bookCloseDate } = currentTenant;
19
30
  const selectedPeriodFirstDay = (0, zeniDayJS_1.date)(`${selectedPeriod.year}-${selectedPeriod.month}-01`);
@@ -52,7 +63,7 @@ exports.getMonthEndCloseChecksViewByTenantId = (0, toolkit_1.createSelector)((st
52
63
  if (check.id === 'month_end_insights') {
53
64
  const isDisabled = monthEndCloseChecks.reportEmailSentDate == null
54
65
  ? (0, exports.isMonthEndInsightDisabled)(currentTenant, selectedPeriod, userAllowedToAccessMonthEndInsights, monthEndCloseChecks.auditSummary)
55
- : true;
66
+ : false;
56
67
  return {
57
68
  ...check,
58
69
  isDisabled,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.0.16-betaJK3",
3
+ "version": "5.0.16",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/esm/index.js",