Skip to content

Commit

Permalink
Merge pull request #97 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
[pull] dev from KelvinTegelaar:dev
  • Loading branch information
kris6673 authored Jan 31, 2025
2 parents 44798d7 + 2198b45 commit 5c538ca
Show file tree
Hide file tree
Showing 65 changed files with 734 additions and 255 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"license": "AGPL-3.0",
"engines": {
"node": "^20.18.2"
"node": "^20.18.1"
},
"repository": {
"type": "git",
Expand Down
Binary file added public/assets/integrations/github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/integrations/github_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/components/CippComponents/CippApiDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export const CippApiDialog = (props) => {
} else {
Object.keys(dataObject).forEach((key) => {
const value = dataObject[key];

if (typeof value === "string" && value.startsWith("!")) {
newData[key] = value.slice(1);
} else if (typeof value === "string") {
Expand Down
4 changes: 2 additions & 2 deletions src/components/CippFormPages/CippAddGroupForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const CippAddGroupForm = (props) => {
formControl={formControl}
name="owners"
label="Owners"
multiple={false}
multiple={true}
select={"id,userPrincipalName,displayName"}
/>
</Grid>
Expand All @@ -62,7 +62,7 @@ const CippAddGroupForm = (props) => {
formControl={formControl}
name="members"
label="Members"
multiple={false}
multiple={true}
select={"id,userPrincipalName,displayName"}
/>
</Grid>
Expand Down
3 changes: 1 addition & 2 deletions src/components/CippFormPages/CippFormPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const CippFormPage = (props) => {
formControl,
postUrl,
customDataformatter,
resetForm = true,
resetForm = false,
hideBackButton = false,
hidePageType = false,
hideTitle = false,
Expand All @@ -36,7 +36,6 @@ const CippFormPage = (props) => {
...other
} = props;
const router = useRouter();

//check if there are
const postCall = ApiPostCall({
datafromUrl: true,
Expand Down
23 changes: 12 additions & 11 deletions src/components/CippStandards/CippStandardsSideBar.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import PropTypes from "prop-types";
import {
Card,
CardContent,
CardHeader,
Divider,
formControlLabelClasses,
Stack,
SvgIcon,
Typography,
} from "@mui/material";
import { Card, CardContent, CardHeader, Divider, Stack, SvgIcon, Typography } from "@mui/material";
import { styled } from "@mui/material/styles";
import {
Timeline,
Expand All @@ -24,7 +15,7 @@ import { ActionListItem } from "/src/components/action-list-item";
import CheckIcon from "@heroicons/react/24/outline/CheckIcon";
import CloseIcon from "@mui/icons-material/Close";
import { useWatch } from "react-hook-form";
import { useEffect, useState } from "react";
import { use, useEffect, useState } from "react";
import _ from "lodash";
import CippFormComponent from "/src/components/CippComponents/CippFormComponent";
import { CippFormTenantSelector } from "../CippComponents/CippFormTenantSelector";
Expand Down Expand Up @@ -127,6 +118,15 @@ const CippStandardsSideBar = ({
fullWidth
/>
<Divider />
<CippFormComponent
type="richText"
name="description"
label="Description"
formControl={formControl}
placeholder="Enter a description for the template"
fullWidth
/>
<Divider />
<CippFormTenantSelector
allTenants={true}
label="Included Tenants"
Expand Down Expand Up @@ -225,6 +225,7 @@ const CippStandardsSideBar = ({
data: {
tenantFilter: "tenantFilter",
excludedTenants: "excludedTenants",
description: "description",
templateName: "templateName",
standards: "standards",
...(edit ? { GUID: "GUID" } : {}),
Expand Down
29 changes: 29 additions & 0 deletions src/components/bulk-actions-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@ import PropTypes from "prop-types";
import ChevronDownIcon from "@heroicons/react/24/outline/ChevronDownIcon";
import { Button, Link, ListItemText, Menu, MenuItem, SvgIcon } from "@mui/material";
import { usePopover } from "../hooks/use-popover";
import { FilePresent, Laptop, Mail, Share, Shield, ShieldMoon } from "@mui/icons-material";
import { GlobeAltIcon, UsersIcon, ServerIcon } from "@heroicons/react/24/outline";

function getIconByName(iconName) {
switch (iconName) {
case "GlobeAltIcon":
return <GlobeAltIcon />;
case "Mail":
return <Mail />;
case "UsersIcon":
return <UsersIcon />;
case "FilePresent":
return <FilePresent />;
case "ServerIcon":
return <ServerIcon />;
case "Laptop":
return <Laptop />;
case "Share":
return <Share />;
case "Shield":
return <Shield />;
case "ShieldMoon":
return <ShieldMoon />;
default:
return null;
}
}

export const BulkActionsMenu = (props) => {
const { buttonName, sx, row, actions = [], ...other } = props;
Expand Down Expand Up @@ -55,12 +82,14 @@ export const BulkActionsMenu = (props) => {
target="_blank"
rel="noreferrer"
>
<SvgIcon sx={{ mr: 1 }}>{getIconByName(action.icon)}</SvgIcon>
<ListItemText primary={action.label} />
</MenuItem>
);
} else {
return (
<MenuItem key={index} onClick={action.onClick}>
<SvgIcon sx={{ mr: 1 }}>{getIconByName(action.icon)}</SvgIcon>
<ListItemText primary={action.label} />
</MenuItem>
);
Expand Down
34 changes: 17 additions & 17 deletions src/data/portals.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"variable": "customerId",
"target": "_blank",
"external": true,
"icon": "cog"
"icon": "GlobeAltIcon"
},
{
"label": "Exchange Portal",
Expand All @@ -15,7 +15,7 @@
"variable": "defaultDomainName",
"target": "_blank",
"external": true,
"icon": "mail-bulk"
"icon": "Mail"
},
{
"label": "Entra Portal",
Expand All @@ -24,7 +24,7 @@
"variable": "defaultDomainName",
"target": "_blank",
"external": true,
"icon": "users"
"icon": "UsersIcon"
},
{
"label": "Teams Portal",
Expand All @@ -33,7 +33,7 @@
"variable": "defaultDomainName",
"target": "_blank",
"external": true,
"icon": "comments"
"icon": "FilePresent"
},
{
"label": "Azure Portal",
Expand All @@ -42,7 +42,7 @@
"variable": "defaultDomainName",
"target": "_blank",
"external": true,
"icon": "server"
"icon": "ServerIcon"
},
{
"label": "Intune Portal",
Expand All @@ -51,7 +51,16 @@
"variable": "defaultDomainName",
"target": "_blank",
"external": true,
"icon": "laptop-code"
"icon": "Laptop"
},
{
"label": "SharePoint Admin",
"name": "SharePoint_Admin",
"url": "https://admin.microsoft.com/Partner/beginclientsession.aspx?CTID=customerId&CSDEST=SharePoint",
"variable": "customerId",
"target": "_blank",
"external": true,
"icon": "Share"
},
{
"label": "Security Portal",
Expand All @@ -60,7 +69,7 @@
"variable": "customerId",
"target": "_blank",
"external": true,
"icon": "shield-alt"
"icon": "Shield"
},
{
"label": "Compliance Portal",
Expand All @@ -69,15 +78,6 @@
"variable": "customerId",
"target": "_blank",
"external": true,
"icon": "shield-alt"
},
{
"label": "SharePoint Admin",
"name": "SharePoint_Admin",
"url": "https://admin.microsoft.com/Partner/beginclientsession.aspx?CTID=customerId&CSDEST=SharePoint",
"variable": "customerId",
"target": "_blank",
"external": true,
"icon": "book"
"icon": "ShieldMoon"
}
]
1 change: 1 addition & 0 deletions src/pages/cipp/logs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const Page = () => {
apiUrl={apiUrl}
simpleColumns={simpleColumns}
queryKey={`Listlogs-${dateFilter}-${filterEnabled}`}
tenantInTitle={false}
apiData={{
DateFilter: dateFilter, // Pass date filter from state
Filter: filterEnabled, // Pass filter toggle state
Expand Down
7 changes: 6 additions & 1 deletion src/pages/cipp/settings/tenants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import tabOptions from "./tabOptions";
import { Button, SvgIcon } from "@mui/material";
import { CippApiDialog } from "/src/components/CippComponents/CippApiDialog";
import { useDialog } from "/src/hooks/use-dialog";
import { Sync } from "@mui/icons-material";
import { Sync, Block, PlayArrow, RestartAlt, Delete, Add } from "@mui/icons-material";

const Page = () => {
const pageTitle = "Tenants - Backend";
Expand All @@ -17,6 +17,7 @@ const Page = () => {
label: "Exclude Tenants",
type: "POST",
url: `/api/ExecExcludeTenant?AddExclusion=true`,
icon: <Block />,
data: { value: "customerId" },
confirmText: "Are you sure you want to exclude these tenants?",
multiPost: false,
Expand All @@ -25,6 +26,7 @@ const Page = () => {
label: "Include Tenants",
type: "POST",
url: `/api/ExecExcludeTenant?RemoveExclusion=true`,
icon: <Add />,
data: { value: "customerId" },
confirmText: "Are you sure you want to include these tenants?",
multiPost: false,
Expand All @@ -33,6 +35,7 @@ const Page = () => {
label: "Refresh CPV Permissions",
type: "POST",
url: `/api/ExecCPVPermissions`,
icon: <PlayArrow />,
data: { TenantFilter: "customerId" },
confirmText: "Are you sure you want to refresh the CPV permissions for these tenants?",
multiPost: false,
Expand All @@ -41,6 +44,7 @@ const Page = () => {
label: "Reset CPV Permissions",
type: "POST",
url: `/api/ExecCPVPermissions?&ResetSP=true`,
icon: <RestartAlt />,
data: { TenantFilter: "customerId" },
confirmText:
"Are you sure you want to reset the CPV permissions for these tenants? (This will delete the Service Principal and re-add it.)",
Expand All @@ -50,6 +54,7 @@ const Page = () => {
label: "Remove Tenant",
type: "POST",
url: `/api/ExecRemoveTenant`,
icon: <Delete />,
data: { TenantID: "customerId" },
confirmText: "Are you sure you want to remove this tenant?",
multiPost: false,
Expand Down
16 changes: 11 additions & 5 deletions src/pages/email/administration/contacts/index.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
import { Layout as DashboardLayout } from "/src/layouts/index.js";
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
import { Edit } from "@mui/icons-material";
import { Edit, PersonAdd } from "@mui/icons-material";
import { Button } from "@mui/material";
import Link from "next/link";
import TrashIcon from '@heroicons/react/24/outline/TrashIcon';

const Page = () => {
const pageTitle = "Contacts";

const actions = [
{
label: "Remove Contact",
type: "POST",
type: "GET",
url: "/api/RemoveContact",
data: {
TenantFilter: "Tenant",
GUID: "id",
},
confirmText: "Are you sure you want to delete this contact?",
color: "danger",
icon: <TrashIcon />,
},
/* TODO: Implement edit contact
{
label: "Edit Contact",
link: "/email/administration/edit-contact/[id]",
multiPost: false,
icon: <Edit />,
color: "warning",
},
},*/
];

const simpleColumns = ["displayName", "mail", "companyName", "onPremisesSyncEnabled"];
Expand All @@ -38,7 +40,11 @@ const Page = () => {
simpleColumns={simpleColumns}
cardButton={
<>
<Button component={Link} href="/email/administration/contacts/add">
<Button
component={Link}
href="/email/administration/contacts/add"
startIcon={<PersonAdd />}
>
Add contact
</Button>
</>
Expand Down
Loading

0 comments on commit 5c538ca

Please sign in to comment.