Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cipp",
"version": "8.0.3",
"version": "8.4.2",
"author": "CIPP Contributors",
"homepage": "https://cipp.app/",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion public/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "8.4.1"
"version": "8.4.2"
}
3 changes: 2 additions & 1 deletion src/components/CippTable/CIPPTableToptoolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 13 additions & 0 deletions src/pages/teams-share/sharepoint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -176,6 +177,18 @@ const Page = () => {
],
multiPost: false,
},
{
label: "Delete Site",
type: "POST",
icon: <Delete />,
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 = {
Expand Down
30 changes: 14 additions & 16 deletions src/utils/get-cipp-unique-licenses.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}
}
Expand All @@ -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);
});
};

/**
Expand All @@ -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));
};

/**
Expand All @@ -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)
);
};
return licenseSkuIds.some((licenseSkuId) => userSkuIds.includes(licenseSkuId));
};