diff --git a/package.json b/package.json index f816b31d5d71..2ade75d4e6c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cipp", - "version": "8.0.3", + "version": "8.4.2", "author": "CIPP Contributors", "homepage": "https://cipp.app/", "bugs": { diff --git a/public/version.json b/public/version.json index a809230b8095..6a8d059b3176 100644 --- a/public/version.json +++ b/public/version.json @@ -1,3 +1,3 @@ { - "version": "8.4.1" + "version": "8.4.2" } diff --git a/src/components/CippTable/CIPPTableToptoolbar.js b/src/components/CippTable/CIPPTableToptoolbar.js index c14da5ce3467..9abffd703fba 100644 --- a/src/components/CippTable/CIPPTableToptoolbar.js +++ b/src/components/CippTable/CIPPTableToptoolbar.js @@ -545,7 +545,8 @@ export const CIPPTableToptoolbar = ({ display: "flex", flexDirection: { xs: "column", md: "row" }, gap: { xs: 1, md: 2 }, - p: 0.5, + px: 0.5, + pb: 2, justifyContent: "space-between", alignItems: { xs: "stretch", md: "center" }, backgroundColor: "background.paper", diff --git a/src/pages/teams-share/sharepoint/index.js b/src/pages/teams-share/sharepoint/index.js index 13657bb47f82..d11415f904a8 100644 --- a/src/pages/teams-share/sharepoint/index.js +++ b/src/pages/teams-share/sharepoint/index.js @@ -8,6 +8,7 @@ import { PersonRemove, AdminPanelSettings, NoAccounts, + Delete, } from "@mui/icons-material"; import Link from "next/link"; import { CippDataTable } from "/src/components/CippTable/CippDataTable"; @@ -176,6 +177,18 @@ const Page = () => { ], multiPost: false, }, + { + label: "Delete Site", + type: "POST", + icon: , + url: "/api/DeleteSharepointSite", + data: { + SiteId: "siteId", + }, + confirmText: "Are you sure you want to delete this SharePoint site? This action cannot be undone.", + color: "error", + multiPost: false, + }, ]; const offCanvas = { diff --git a/src/utils/get-cipp-unique-licenses.js b/src/utils/get-cipp-unique-licenses.js index eb48d16edf02..fcb68de559a0 100644 --- a/src/utils/get-cipp-unique-licenses.js +++ b/src/utils/get-cipp-unique-licenses.js @@ -22,12 +22,12 @@ export const getCippUniqueLicenses = (dataArray) => { // Get the translated name for this license const translatedName = getCippLicenseTranslation([license]); const displayName = Array.isArray(translatedName) ? translatedName[0] : translatedName; - + uniqueLicensesMap.set(license.skuId, { skuId: license.skuId, displayName: displayName, // Store the original license object for reference - originalLicense: license + originalLicense: license, }); } } @@ -36,9 +36,11 @@ export const getCippUniqueLicenses = (dataArray) => { }); // Convert map to array and sort by display name - return Array.from(uniqueLicensesMap.values()).sort((a, b) => - a.displayName.localeCompare(b.displayName) - ); + return Array.from(uniqueLicensesMap.values()).sort((a, b) => { + const nameA = a?.displayName || ''; + const nameB = b?.displayName || ''; + return nameA.localeCompare(nameB); + }); }; /** @@ -56,12 +58,10 @@ export const userHasAllLicenses = (userLicenses, requiredLicenseSkuIds) => { return true; // No licenses required } - const userSkuIds = userLicenses.map(license => license.skuId).filter(Boolean); - + const userSkuIds = userLicenses.map((license) => license.skuId).filter(Boolean); + // Check if user has all required licenses - return requiredLicenseSkuIds.every(requiredSkuId => - userSkuIds.includes(requiredSkuId) - ); + return requiredLicenseSkuIds.every((requiredSkuId) => userSkuIds.includes(requiredSkuId)); }; /** @@ -79,10 +79,8 @@ export const userHasAnyLicense = (userLicenses, licenseSkuIds) => { return true; // No licenses specified } - const userSkuIds = userLicenses.map(license => license.skuId).filter(Boolean); - + const userSkuIds = userLicenses.map((license) => license.skuId).filter(Boolean); + // Check if user has any of the specified licenses - return licenseSkuIds.some(licenseSkuId => - userSkuIds.includes(licenseSkuId) - ); -}; \ No newline at end of file + return licenseSkuIds.some((licenseSkuId) => userSkuIds.includes(licenseSkuId)); +};