@zeniai/client-epic-state 5.3.20 → 5.3.21-betaAK1
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.
|
@@ -8,12 +8,14 @@ const responsePayload_1 = require("../../../responsePayload");
|
|
|
8
8
|
const sessionEndpointsLoader_1 = require("../../../sessionEndpointsLoader");
|
|
9
9
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
10
10
|
const tenantReducer_1 = require("../tenantReducer");
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
11
|
+
// Tenants come back as summaries (`is_full: false`); a tenant's full record
|
|
12
|
+
// comes from `fetchActiveTenant` when it is opened. Companies stay included
|
|
13
|
+
// because the tenant service only fills `company_name` and applies its
|
|
14
|
+
// company-status filter (which hides inactive companies) when they are; the
|
|
15
|
+
// company records themselves are not read.
|
|
14
16
|
const TENANT_SUMMARIES_QUERY = {
|
|
15
17
|
is_full: false,
|
|
16
|
-
is_include_companies_in_response:
|
|
18
|
+
is_include_companies_in_response: true,
|
|
17
19
|
};
|
|
18
20
|
/**
|
|
19
21
|
* The tenant the app lands on: the selected one, or the most recently opened
|
|
@@ -129,10 +129,13 @@ const tenant = (0, toolkit_1.createSlice)({
|
|
|
129
129
|
});
|
|
130
130
|
draft.tenantSummariesById = tenantSummariesById;
|
|
131
131
|
draft.tenantIds = Object.keys(tenantSummariesById);
|
|
132
|
-
// A tenant missing from the list is no longer accessible to the user
|
|
132
|
+
// A tenant missing from the list is no longer accessible to the user,
|
|
133
|
+
// except the open one: the list hides companies by status, and the
|
|
134
|
+
// selected tenant's record was loaded for it on its own.
|
|
133
135
|
const accessibleTenantsById = {};
|
|
134
136
|
Object.values(draft.tenantsById).forEach((tenant) => {
|
|
135
|
-
if (tenantSummariesById[tenant.tenantId] != null
|
|
137
|
+
if (tenantSummariesById[tenant.tenantId] != null ||
|
|
138
|
+
tenant.tenantId === draft.currentTenantId) {
|
|
136
139
|
accessibleTenantsById[tenant.tenantId] = tenant;
|
|
137
140
|
}
|
|
138
141
|
});
|
|
@@ -5,12 +5,14 @@ import { createZeniAPIStatus, isSuccessResponse } from '../../../responsePayload
|
|
|
5
5
|
import { getSessionEndpointsLoader } from '../../../sessionEndpointsLoader';
|
|
6
6
|
import { date, dateNow } from '../../../zeniDayJS';
|
|
7
7
|
import { fetchActiveTenant, fetchAllTenants, updateTenantFailure, updateTenantSuccess, updateTenantSummariesSuccess, updateTenantsFailure, } from '../tenantReducer';
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
8
|
+
// Tenants come back as summaries (`is_full: false`); a tenant's full record
|
|
9
|
+
// comes from `fetchActiveTenant` when it is opened. Companies stay included
|
|
10
|
+
// because the tenant service only fills `company_name` and applies its
|
|
11
|
+
// company-status filter (which hides inactive companies) when they are; the
|
|
12
|
+
// company records themselves are not read.
|
|
11
13
|
const TENANT_SUMMARIES_QUERY = {
|
|
12
14
|
is_full: false,
|
|
13
|
-
is_include_companies_in_response:
|
|
15
|
+
is_include_companies_in_response: true,
|
|
14
16
|
};
|
|
15
17
|
/**
|
|
16
18
|
* The tenant the app lands on: the selected one, or the most recently opened
|
|
@@ -118,10 +118,13 @@ const tenant = createSlice({
|
|
|
118
118
|
});
|
|
119
119
|
draft.tenantSummariesById = tenantSummariesById;
|
|
120
120
|
draft.tenantIds = Object.keys(tenantSummariesById);
|
|
121
|
-
// A tenant missing from the list is no longer accessible to the user
|
|
121
|
+
// A tenant missing from the list is no longer accessible to the user,
|
|
122
|
+
// except the open one: the list hides companies by status, and the
|
|
123
|
+
// selected tenant's record was loaded for it on its own.
|
|
122
124
|
const accessibleTenantsById = {};
|
|
123
125
|
Object.values(draft.tenantsById).forEach((tenant) => {
|
|
124
|
-
if (tenantSummariesById[tenant.tenantId] != null
|
|
126
|
+
if (tenantSummariesById[tenant.tenantId] != null ||
|
|
127
|
+
tenant.tenantId === draft.currentTenantId) {
|
|
125
128
|
accessibleTenantsById[tenant.tenantId] = tenant;
|
|
126
129
|
}
|
|
127
130
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.21-betaAK1",
|
|
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",
|