Skip to content

Commit 33af7ae

Browse files
authored
Merge pull request #3472 from KelvinTegelaar/dev
Dev to hotfix
2 parents 1d499e8 + a3346a9 commit 33af7ae

File tree

4 files changed

+41
-35
lines changed

4 files changed

+41
-35
lines changed

public/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "7.1.0"
2+
"version": "7.1.1"
33
}

src/components/CippIntegrations/CippIntegrationTenantMapping.jsx

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { CippFormTenantSelector } from "../CippComponents/CippFormTenantSelector
2222
import { Sync, SyncAlt } from "@mui/icons-material";
2323
import { CippFormComponent } from "../CippComponents/CippFormComponent";
2424
import { CippApiResults } from "../CippComponents/CippApiResults";
25+
import { ApiGetCallWithPagination } from "../../api/ApiCall";
2526

2627
const CippIntegrationSettings = ({ children }) => {
2728
const router = useRouter();
@@ -35,7 +36,7 @@ const CippIntegrationSettings = ({ children }) => {
3536
queryKey: `IntegrationTenantMapping-${router.query.id}`,
3637
});
3738

38-
const tenantList = ApiGetCall({
39+
const tenantList = ApiGetCallWithPagination({
3940
url: "/api/ListTenants",
4041
data: { AllTenantSelector: false },
4142
queryKey: "ListTenants-notAllTenants",
@@ -94,37 +95,37 @@ const CippIntegrationSettings = ({ children }) => {
9495
};
9596

9697
const handleAutoMap = () => {
97-
const newTableData = [];
98-
tenantList.data.forEach((tenant) => {
99-
const matchingCompany = mappings.data.Companies.find(
100-
(company) => company.name === tenant.displayName
101-
);
102-
if (
103-
Array.isArray(tableData) &&
104-
tableData?.find((item) => item.TenantId === tenant.customerId)
105-
)
106-
return;
107-
if (matchingCompany) {
108-
newTableData.push({
109-
TenantId: tenant.customerId,
110-
Tenant: tenant.displayName,
111-
IntegrationName: matchingCompany.name,
112-
IntegrationId: matchingCompany.value,
98+
const newTableData = [];
99+
tenantList.data?.pages[0]?.forEach((tenant) => {
100+
const matchingCompany = mappings.data.Companies.find(
101+
(company) => company.name === tenant.displayName
102+
);
103+
if (
104+
Array.isArray(tableData) &&
105+
tableData?.find((item) => item.TenantId === tenant.customerId)
106+
)
107+
return;
108+
if (matchingCompany) {
109+
newTableData.push({
110+
TenantId: tenant.customerId,
111+
Tenant: tenant.displayName,
112+
IntegrationName: matchingCompany.name,
113+
IntegrationId: matchingCompany.value,
114+
});
115+
}
116+
});
117+
if (Array.isArray(tableData)) {
118+
setTableData([...tableData, ...newTableData]);
119+
} else {
120+
setTableData(newTableData);
121+
}
122+
if (extension.autoMapSyncApi) {
123+
automapPostCall.mutate({
124+
url: `/api/ExecExtensionMapping?AutoMapping=${router.query.id}`,
125+
queryKey: `IntegrationTenantMapping-${router.query.id}`,
113126
});
114127
}
115-
});
116-
if (Array.isArray(tableData)) {
117-
setTableData([...tableData, ...newTableData]);
118-
} else {
119-
setTableData(newTableData);
120-
}
121-
if (extension.autoMapSyncApi) {
122-
automapPostCall.mutate({
123-
url: `/api/ExecExtensionMapping?AutoMapping=${router.query.id}`,
124-
queryKey: `IntegrationTenantMapping-${router.query.id}`,
125-
});
126-
}
127-
};
128+
};
128129

129130
const actions = [
130131
{

src/components/CippSettings/CippCustomRoles.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
} from "@mui/material";
1515

1616
import Grid from "@mui/material/Grid2";
17-
import { ApiGetCall, ApiPostCall } from "../../api/ApiCall";
17+
import { ApiGetCall, ApiGetCallWithPagination, ApiPostCall } from "../../api/ApiCall";
1818
import { CippOffCanvas } from "/src/components/CippComponents/CippOffCanvas";
1919
import { CippFormTenantSelector } from "/src/components/CippComponents/CippFormTenantSelector";
2020
import { Save } from "@mui/icons-material";
@@ -67,10 +67,14 @@ export const CippCustomRoles = () => {
6767
queryKey: "customRoleList",
6868
});
6969

70-
const { data: tenants = [], isSuccess: tenantsSuccess } = ApiGetCall({
70+
const {
71+
data: { pages = [] } = {},
72+
isSuccess: tenantsSuccess,
73+
} = ApiGetCallWithPagination({
7174
url: "/api/ListTenants?AllTenantSelector=true",
7275
queryKey: "ListTenants-AllTenantSelector",
7376
});
77+
const tenants = pages[0] || [];
7478

7579
useEffect(() => {
7680
if (customRoleListSuccess && tenantsSuccess && selectedRole !== currentRole?.value) {

src/pages/cipp/super-admin/sam-app-roles.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import CippFormPage from "/src/components/CippFormPages/CippFormPage";
55
import { Alert, CardContent, Stack, Typography } from "@mui/material";
66
import { WarningAmberOutlined } from "@mui/icons-material";
77
import { useForm } from "react-hook-form";
8-
import { ApiGetCall } from "../../../api/ApiCall";
8+
import { ApiGetCall, ApiGetCallWithPagination } from "../../../api/ApiCall";
99
import { useEffect } from "react";
1010
import CippFormComponent from "../../../components/CippComponents/CippFormComponent";
1111
import GDAPRoles from "/src/data/GDAPRoles";
@@ -23,10 +23,11 @@ const Page = () => {
2323
queryKey: "ExecSAMRoles",
2424
});
2525

26-
const { data: tenants = [], isSuccess: tenantsSuccess } = ApiGetCall({
26+
const { data: tenantsData = { pages: [] }, isSuccess: tenantsSuccess } = ApiGetCallWithPagination({
2727
url: "/api/ListTenants?AllTenantSelector=true",
2828
queryKey: "ListTenants-AllTenantSelector",
2929
});
30+
const tenants = tenantsData?.pages?.[0] || [];
3031

3132
useEffect(() => {
3233
if (execSAMRoles.isSuccess && tenantsSuccess) {

0 commit comments

Comments
 (0)