@zeniai/client-epic-state 4.19.86-betaRD5 → 4.19.86-betaRD7

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,4 +1,5 @@
1
1
  import { reduceAnyFetchState, reduceFetchState, } from '../../../commonStateTypes/reduceFetchState';
2
+ import { getIsAccountingClassesEnabled } from '../../../entity/tenant/tenantSelector';
2
3
  import { getAccountBase } from '../../../entity/account/accountSelector';
3
4
  import { getAddressByAddressId } from '../../../entity/address/addressSelector';
4
5
  import { getBankAccountsByBankAccountIds } from '../../../entity/bankAccount/bankAccountSelector';
@@ -60,13 +61,17 @@ export const getVendorView = (state, vendorIdFromUrl) => {
60
61
  ?.vendorDetailLocalData,
61
62
  supportedCountries: billPayConfigState.vendor.supportedCountries,
62
63
  };
63
- fetchState = reduceFetchState([
64
+ const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state);
65
+ const editFetchStateList = [
64
66
  accountList,
65
- classList,
66
67
  vendorTypeListState,
67
68
  vendorViewState.editVendorStateById[vendorIdFromUrl]?.fetchStatus ??
68
69
  vendorViewInitialState.newVendorState.fetchStatus,
69
- ]);
70
+ ];
71
+ if (isAccountingClassesEnabled) {
72
+ editFetchStateList.push(classList);
73
+ }
74
+ fetchState = reduceFetchState(editFetchStateList);
70
75
  }
71
76
  else {
72
77
  const basicVendorDetails = getBasicVendorDetailsForNewVendor(state, vendorViewState.newVendorState);
@@ -95,11 +100,14 @@ export const getVendorView = (state, vendorIdFromUrl) => {
95
100
  if (tentativeName != null) {
96
101
  entityRecommendations = getRecommendationsForEntity(state, tentativeName, 'vendor');
97
102
  }
103
+ const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state);
98
104
  const fetchStateList = [
99
105
  { fetchState: accountList.fetchState, error: accountList.error },
100
- { fetchState: classList.fetchState, error: classList.error },
101
106
  vendorTypeListState,
102
107
  ];
108
+ if (isAccountingClassesEnabled) {
109
+ fetchStateList.push({ fetchState: classList.fetchState, error: classList.error });
110
+ }
103
111
  if (entityRecommendations != null &&
104
112
  entityRecommendations.recommendations != null &&
105
113
  entityRecommendations.recommendations.length > 0) {
@@ -144,6 +152,7 @@ export const getVendorView = (state, vendorIdFromUrl) => {
144
152
  fetchState: fetchState.fetchState,
145
153
  hasWireTransfer,
146
154
  hasInternationalWireTransfer,
155
+ isAccountingClassesEnabled: getIsAccountingClassesEnabled(state),
147
156
  deleteFileStatusById,
148
157
  updateFileStatusById,
149
158
  loggedInUserVerification,