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": "10.0.1",
"version": "10.0.3",
"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": "10.0.2"
"version": "10.0.3"
}
78 changes: 54 additions & 24 deletions src/pages/cipp/settings/licenses.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ import tabOptions from "./tabOptions";
import { TabbedLayout } from "/src/layouts/TabbedLayout";
import { Layout as DashboardLayout } from "/src/layouts/index.js";
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
import { Button, SvgIcon } from "@mui/material";
import { Button, SvgIcon, Stack } from "@mui/material";
import { TrashIcon } from "@heroicons/react/24/outline";
import { Add } from "@mui/icons-material";
import { Add, RestartAlt } from "@mui/icons-material";
import { CippApiDialog } from "../../../components/CippComponents/CippApiDialog";
import { useDialog } from "../../../hooks/use-dialog";

const Page = () => {
const pageTitle = "Excluded Licenses";
const apiUrl = "/api/ExecExcludeLicenses";
const apiData = { List: true };
const apiUrl = "/api/ListExcludedLicenses";
const createDialog = useDialog();
const resetDialog = useDialog();
const simpleColumns = ["Product_Display_Name", "GUID"];

const actions = [
{
label: "Delete Exclusion",
type: "POST",
url: "/api/ExecExcludeLicenses?RemoveExclusion=true",
data: { GUID: "GUID" },
url: "/api/ExecExcludeLicenses",
data: { Action: "!RemoveExclusion", GUID: "GUID" },
confirmText: "Do you want to delete this exclusion?",
color: "error",
icon: (
Expand All @@ -31,21 +31,32 @@ const Page = () => {
},
];

const AddExcludedLicense = () => {
const CardButtons = () => {
return (
<Button
variant="contained"
size="small"
color="primary"
onClick={createDialog.handleOpen}
startIcon={
<SvgIcon fontSize="small">
<Add />
</SvgIcon>
}
>
Add Excluded License
</Button>
<Stack spacing={2} direction="row">
<Button
variant="contained"
size="small"
color="primary"
onClick={createDialog.handleOpen}
startIcon={
<SvgIcon fontSize="small">
<Add />
</SvgIcon>
}
>
Add Excluded License
</Button>
<Button
variant="outlined"
size="small"
color="primary"
onClick={resetDialog.handleOpen}
startIcon={<RestartAlt />}
>
Restore Defaults
</Button>
</Stack>
);
};

Expand All @@ -60,9 +71,9 @@ const Page = () => {
title={pageTitle}
queryKey="ExcludedLicenses"
apiUrl={apiUrl}
cardButton={<AddExcludedLicense />}
apiData={apiData}
cardButton={<CardButtons />}
actions={actions}
apiDataKey="Results"
offCanvas={offCanvas}
simpleColumns={simpleColumns}
tenantInTitle={false}
Expand All @@ -85,15 +96,34 @@ const Page = () => {
},
]}
api={{
url: "/api/ExecExcludeLicenses?AddExclusion=true",
url: "/api/ExecExcludeLicenses",
confirmText:
"Add a license to the exclusion table, make sure to enter the correct GUID and SKU Name",
type: "POST",
data: {},
data: { Action: "!AddExclusion" },
replacementBehaviour: "removeNulls",
relatedQueryKeys: ["ExcludedLicenses"],
}}
/>
<CippApiDialog
title="Restore Defaults"
createDialog={resetDialog}
fields={[
{
type: "switch",
name: "FullReset",
label: "Full Reset (clear all entries including manually added ones)",
},
]}
api={{
url: "/api/ExecExcludeLicenses",
confirmText:
"This will restore default licenses from the config file. If 'Full Reset' is enabled, all existing entries will be cleared first.",
type: "POST",
data: { Action: "!RestoreDefaults" },
relatedQueryKeys: ["ExcludedLicenses"],
}}
/>
</>
);
};
Expand Down