Skip to content

Commit ec6394e

Browse files
authored
Merge pull request #16 from KelvinTegelaar/main
[pull] main from KelvinTegelaar:main
2 parents fabeb45 + 2622cf3 commit ec6394e

File tree

5 files changed

+31
-19
lines changed

5 files changed

+31
-19
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cipp",
3-
"version": "8.0.3",
3+
"version": "8.4.2",
44
"author": "CIPP Contributors",
55
"homepage": "https://cipp.app/",
66
"bugs": {

public/version.json

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

src/components/CippTable/CIPPTableToptoolbar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,8 @@ export const CIPPTableToptoolbar = ({
545545
display: "flex",
546546
flexDirection: { xs: "column", md: "row" },
547547
gap: { xs: 1, md: 2 },
548-
p: 0.5,
548+
px: 0.5,
549+
pb: 2,
549550
justifyContent: "space-between",
550551
alignItems: { xs: "stretch", md: "center" },
551552
backgroundColor: "background.paper",

src/pages/teams-share/sharepoint/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
PersonRemove,
99
AdminPanelSettings,
1010
NoAccounts,
11+
Delete,
1112
} from "@mui/icons-material";
1213
import Link from "next/link";
1314
import { CippDataTable } from "/src/components/CippTable/CippDataTable";
@@ -176,6 +177,18 @@ const Page = () => {
176177
],
177178
multiPost: false,
178179
},
180+
{
181+
label: "Delete Site",
182+
type: "POST",
183+
icon: <Delete />,
184+
url: "/api/DeleteSharepointSite",
185+
data: {
186+
SiteId: "siteId",
187+
},
188+
confirmText: "Are you sure you want to delete this SharePoint site? This action cannot be undone.",
189+
color: "error",
190+
multiPost: false,
191+
},
179192
];
180193

181194
const offCanvas = {

src/utils/get-cipp-unique-licenses.js

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ export const getCippUniqueLicenses = (dataArray) => {
2222
// Get the translated name for this license
2323
const translatedName = getCippLicenseTranslation([license]);
2424
const displayName = Array.isArray(translatedName) ? translatedName[0] : translatedName;
25-
25+
2626
uniqueLicensesMap.set(license.skuId, {
2727
skuId: license.skuId,
2828
displayName: displayName,
2929
// Store the original license object for reference
30-
originalLicense: license
30+
originalLicense: license,
3131
});
3232
}
3333
}
@@ -36,9 +36,11 @@ export const getCippUniqueLicenses = (dataArray) => {
3636
});
3737

3838
// Convert map to array and sort by display name
39-
return Array.from(uniqueLicensesMap.values()).sort((a, b) =>
40-
a.displayName.localeCompare(b.displayName)
41-
);
39+
return Array.from(uniqueLicensesMap.values()).sort((a, b) => {
40+
const nameA = a?.displayName || '';
41+
const nameB = b?.displayName || '';
42+
return nameA.localeCompare(nameB);
43+
});
4244
};
4345

4446
/**
@@ -56,12 +58,10 @@ export const userHasAllLicenses = (userLicenses, requiredLicenseSkuIds) => {
5658
return true; // No licenses required
5759
}
5860

59-
const userSkuIds = userLicenses.map(license => license.skuId).filter(Boolean);
60-
61+
const userSkuIds = userLicenses.map((license) => license.skuId).filter(Boolean);
62+
6163
// Check if user has all required licenses
62-
return requiredLicenseSkuIds.every(requiredSkuId =>
63-
userSkuIds.includes(requiredSkuId)
64-
);
64+
return requiredLicenseSkuIds.every((requiredSkuId) => userSkuIds.includes(requiredSkuId));
6565
};
6666

6767
/**
@@ -79,10 +79,8 @@ export const userHasAnyLicense = (userLicenses, licenseSkuIds) => {
7979
return true; // No licenses specified
8080
}
8181

82-
const userSkuIds = userLicenses.map(license => license.skuId).filter(Boolean);
83-
82+
const userSkuIds = userLicenses.map((license) => license.skuId).filter(Boolean);
83+
8484
// Check if user has any of the specified licenses
85-
return licenseSkuIds.some(licenseSkuId =>
86-
userSkuIds.includes(licenseSkuId)
87-
);
88-
};
85+
return licenseSkuIds.some((licenseSkuId) => userSkuIds.includes(licenseSkuId));
86+
};

0 commit comments

Comments
 (0)