Skip to content

Commit

Permalink
Merge pull request #226 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
[pull] dev from KelvinTegelaar:dev
  • Loading branch information
JohnDuprey authored Jan 16, 2025
2 parents 0d99c77 + 2864974 commit 51e77b5
Show file tree
Hide file tree
Showing 19 changed files with 95 additions and 96 deletions.

This file was deleted.

9 changes: 6 additions & 3 deletions Tools/Start-CippDevEmulatorsWithKitty.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
Get-Command kitty -ErrorAction Stop | Out-Null
Write-Host 'Starting CIPP Dev Emulators'
Get-Process node -ErrorAction SilentlyContinue | Stop-Process -ErrorAction SilentlyContinue
$Path = (Get-Item $PSScriptRoot).Parent.Parent.FullName

pwsh -file (Join-Path $PSScriptRoot 'Start-CippDevInstallation.ps1')

Write-Host 'Starting CIPP Dev Emulators'

if (Test-Path (Join-Path $Path 'CIPP-API-Processor')) {
$Process = Read-Host -Prompt 'Start Process Function (y/N)?'
}
Expand All @@ -11,14 +14,14 @@ if ($Process -eq 'y') {
kitty --detach --title 'CIPP' -o allow_remote_control=yes -- pwsh -c "
kitty @new-window --new-tab --tab-title `"Azurite`" --cwd $Path -- azurite ;
kitty @new-window --new-tab --tab-title `"FunctionApp`" --cwd (Join-Path $Path `"CIPP-API`") -- func start;
kitty @new-window --new-tab --tab-title `"CIPP Frontend`" --cwd (Join-Path $Path `"CIPP`") -- npm run dev ;
kitty @new-window --new-tab --tab-title `"CIPP Frontend`" --cwd (Join-Path $Path `"CIPP`") -- yarn run dev ;
kitty @new-window --new-tab --tab-title `"SWA`" --cwd (Join-Path $Path `"CIPP`") -- npm run start-swa;
kitty @new-window --new-tab --tab-title `"CIPP-API-Processor`" --cwd (Join-Path $Path `"CIPP-API-Processor`") -- func start --port 7072"

} else {
kitty --detach --title 'CIPP' -o allow_remote_control=yes -- pwsh -c "
kitty @new-window --new-tab --tab-title `"Azurite`" --cwd $Path -- azurite ;
kitty @new-window --new-tab --tab-title `"FunctionApp`" --cwd (Join-Path $Path `"CIPP-API`") -- func start;
kitty @new-window --new-tab --tab-title `"CIPP Frontend`" --cwd (Join-Path $Path `"CIPP`") -- npm run dev ;
kitty @new-window --new-tab --tab-title `"CIPP Frontend`" --cwd (Join-Path $Path `"CIPP`") -- yarn run dev ;
kitty @new-window --new-tab --tab-title `"SWA`" --cwd (Join-Path $Path `"CIPP`") -- npm run start-swa"
}
32 changes: 32 additions & 0 deletions Tools/Start-CippDevInstallation.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
$Path = (Get-Item $PSScriptRoot).Parent.Parent.FullName

if (-not(Get-Command npm)) {
throw 'npm is required to install the CIPP development environment'
}

if (-not(Get-Command azurite)) {
Write-Host 'Installing Azurite'
npm install --global 'azurite'
}

if (-not(Get-Command swa)) {
Write-Host 'Installing @azure/static-web-apps-cli'
npm install --global '@azure/static-web-apps-cli'
}

if (-not(Get-Command func)) {
Write-Host 'Installing Azure Functions Core Tools'
npm install --global 'azure-functions-core-tools@4' --unsafe-perms true
}

if (-not(Get-Command yarn)) {
Write-Host 'Installing Yarn'
npm install --global yarn
}

if (-not(yarn list --global --pattern 'next' | Select-String -Pattern 'next')) {
Write-Host 'Installing Next.js'
yarn install --global next --network-timeout 500000
}

yarn install --cwd (Join-Path $Path "CIPP") --network-timeout 500000
2 changes: 2 additions & 0 deletions deployment/DevAzureDeploymentTemplate_regionoptions.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@
"buildProperties": {
"appLocation": "/",
"apiLocation": "",

"appArtifactLocation": ""
"outputLocation": "/out"
}
},
"sku": {
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": "7.0.1"
"version": "7.0.3"
}
2 changes: 1 addition & 1 deletion src/components/CippComponents/CippTenantSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export const CippTenantSelector = (props) => {
},
{
label: "Compliance Portal",
link: `https://compliance.microsoft.com/?tid=${currentTenant?.addedFields?.customerId}`,
link: `https://purview.microsoft.com/?tid=${currentTenant?.addedFields?.customerId}`,
icon: <ShieldMoon />,
},
]}
Expand Down
9 changes: 5 additions & 4 deletions src/components/CippFormPages/CippExchangeSettingsForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,13 @@ const CippExchangeSettingsForm = (props) => {
label="Add Access"
name="calendar.UserToGetPermissions"
isFetching={isFetching || usersList.isFetching}
options={
usersList?.data?.Results?.map((user) => ({
options={[
{ value: "Default", label: "Default (Default)" },
...(usersList?.data?.Results?.map((user) => ({
value: user.userPrincipalName,
label: `${user.displayName} (${user.userPrincipalName})`,
})) || []
}
})) || []),
]}
multiple={false}
formControl={formControl}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/data/portals.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
{
"label": "Compliance Portal",
"name": "Compliance_Portal",
"url": "https://compliance.microsoft.com/?tid=customerId",
"url": "https://purview.microsoft.com/?tid=customerId",
"variable": "customerId",
"target": "_blank",
"external": true,
Expand Down
1 change: 1 addition & 0 deletions src/data/standards.json
Original file line number Diff line number Diff line change
Expand Up @@ -1827,6 +1827,7 @@
},
{
"type": "autoComplete",
"multiple": false,
"label": "High Confidence Spam Action",
"name": "standards.SpamFilterPolicy.HighConfidenceSpamAction",
"options": [
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export const nativeMenuItems = [
],
},
{
title: "Teams & Sharepoint",
title: "Teams & SharePoint",
type: "header",
icon: (
<SvgIcon>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/cipp/settings/tenants.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const Page = () => {
confirmText:
"This will refresh the tenant and update the tenant details. This can be used to force a tenant to reappear in the list. Run this with no Tenant Filter to refresh all tenants.",
type: "GET",
data: { TriggerRefresh: "!true", TenantFilter: "tenantFilter" },
data: { TriggerRefresh: "!true" },
replacementBehaviour: "removeNulls",
}}
/>
Expand Down
11 changes: 4 additions & 7 deletions src/pages/email/administration/quarantine/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Layout as DashboardLayout } from "/src/layouts/index.js";
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
import { useEffect, useState } from "react";
import { Dialog, DialogTitle, DialogContent, IconButton, Skeleton } from "@mui/material";
import { Dialog, DialogTitle, DialogContent, IconButton, Skeleton, Typography, CircularProgress } from "@mui/material";
import { Block, Close, Done, DoneAll, Subject } from "@mui/icons-material";
import { CippMessageViewer } from "/src/components/CippComponents/CippMessageViewer.jsx";
import { ApiGetCall, ApiPostCall } from "/src/api/ApiCall";
Expand Down Expand Up @@ -96,8 +96,7 @@ const Page = () => {
type: "POST",
url: "/api/ExecQuarantineManagement",
data: {
TenantFilter: "TenantFilter",
ID: "id",
Identity: "Identity",
Type: "Release",
},
confirmText: "Are you sure you want to release this message?",
Expand All @@ -108,8 +107,7 @@ const Page = () => {
type: "POST",
url: "/api/ExecQuarantineManagement",
data: {
TenantFilter: "TenantFilter",
ID: "id",
Identity: "Identity",
Type: "Deny",
},
confirmText: "Are you sure you want to deny this message?",
Expand All @@ -120,8 +118,7 @@ const Page = () => {
type: "POST",
url: "/api/ExecQuarantineManagement",
data: {
TenantFilter: "TenantFilter",
ID: "id",
Identity: "Identity",
Type: "Release",
AllowSender: true,
},
Expand Down
17 changes: 6 additions & 11 deletions src/pages/endpoint/MEM/list-compliance-policies/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,22 @@ const Page = () => {
const actions = [
{
label: "Create template based on policy",
type: "POST",
type: "GET",
url: "/api/AddIntuneTemplate",
data: {
TenantFilter: "Tenant",
ID: "id",
URLName: "deviceCompliancePolicies",
URLName: "URLName",
},
confirmText: "Are you sure you want to create a template based on this policy?",
icon: <Book />,
color: "info",
},
{
label: "Assign to All Users",
type: "POST",
type: "GET",
url: "/api/ExecAssignPolicy",
data: {
AssignTo: "allLicensedUsers",
TenantFilter: "Tenant",
ID: "id",
type: "deviceCompliancePolicies",
},
Expand All @@ -36,11 +34,10 @@ const Page = () => {
},
{
label: "Assign to All Devices",
type: "POST",
type: "GET",
url: "/api/ExecAssignPolicy",
data: {
AssignTo: "AllDevices",
TenantFilter: "Tenant",
ID: "id",
type: "deviceCompliancePolicies",
},
Expand All @@ -50,11 +47,10 @@ const Page = () => {
},
{
label: "Assign Globally (All Users / All Devices)",
type: "POST",
type: "GET",
url: "/api/ExecAssignPolicy",
data: {
AssignTo: "AllDevicesAndUsers",
TenantFilter: "Tenant",
ID: "id",
type: "deviceCompliancePolicies",
},
Expand All @@ -64,10 +60,9 @@ const Page = () => {
},
{
label: "Delete Policy",
type: "POST",
type: "GET",
url: "/api/RemovePolicy",
data: {
TenantFilter: "Tenant",
ID: "id",
URLName: "deviceCompliancePolicies",
},
Expand Down
3 changes: 1 addition & 2 deletions src/pages/identity/administration/deleted-items/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Page = () => {
const actions = [
{
label: "Restore Object",
type: "POST",
type: "GET",
url: "/api/ExecRestoreDeleted",
data: { TenantFilter: "Tenant", ID: "id" },
confirmText: "Are you sure you want to restore this user?",
Expand Down Expand Up @@ -46,7 +46,6 @@ const Page = () => {
<CippTablePage
title={pageTitle}
apiUrl="/api/ListDeletedItems"
apiDataKey="Results"
actions={actions}
offCanvas={offCanvas}
simpleColumns={columns}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/identity/administration/jit-admin/add.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ const Page = () => {
name="expireAction"
multiple={false}
options={[
{ label: "Delete User", value: "delete" },
{ label: "Disable User", value: "disable" },
{ label: "Remove Roles", value: "removeRoles" },
{ label: "Delete User", value: "DeleteUser" },
{ label: "Disable User", value: "DisableUser" },
{ label: "Remove Roles", value: "RemoveRoles" },
]}
formControl={formControl}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/identity/administration/risky-users/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Page = () => {
const actions = [
{
label: "Dismiss Risk",
type: "POST",
type: "GET",
icon: <Clear />,
url: "/api/ExecDismissRiskyUser",
data: { userId: "id", userDisplayName: "userDisplayName" },
Expand Down
34 changes: 22 additions & 12 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,30 @@ const Page = () => {
},
];

// Helper to get action counts for the current tenant
function getActionCountsForTenant(standardsData, currentTenant) {
if (!standardsData) return { remediateCount: 0, alertCount: 0, reportCount: 0, total: 0 };
if (!standardsData) {
return {
remediateCount: 0,
alertCount: 0,
reportCount: 0,
total: 0,
};
}

// Identify which templates apply:
const applicableTemplates = standardsData.filter((template) => {
const tenantFilterArr = Array.isArray(template?.tenantFilter) ? template.tenantFilter : [];
const excludedTenantsArr = Array.isArray(template?.excludedTenants)
? template.excludedTenants
: [];

const tenantInFilter =
template?.tenantFilter?.length > 0 &&
template.tenantFilter.some((tf) => tf.value === currentTenant);
tenantFilterArr.length > 0 && tenantFilterArr.some((tf) => tf.value === currentTenant);

const allTenantsTemplate =
template?.tenantFilter?.length > 0 &&
template.tenantFilter.some((tf) => tf.value === "AllTenants") &&
(!template?.excludedTenants ||
(Array.isArray(template?.excludedTenants) && template?.excludedTenants?.length === 0) ||
!template?.excludedTenants?.some((et) => et.value === currentTenant));
tenantFilterArr.some((tf) => tf.value === "AllTenants") &&
(excludedTenantsArr.length === 0 ||
!excludedTenantsArr.some((et) => et.value === currentTenant));

return tenantInFilter || allTenantsTemplate;
});

Expand All @@ -126,8 +135,8 @@ const Page = () => {
if (!Array.isArray(actions)) {
actions = [actions];
}

actions?.forEach((actionObj) => {
console.log("actions is", actions);
actions.forEach((actionObj) => {
if (actionObj?.value === "Remediate") {
remediateCount++;
} else if (actionObj?.value === "Alert") {
Expand All @@ -139,6 +148,7 @@ const Page = () => {
}

const total = Object.keys(combinedStandards).length;

return { remediateCount, alertCount, reportCount, total };
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/tenant/administration/tenants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Page = () => {
portal_azure: `https://portal.azure.com/${tenant.defaultDomainName}`,
portal_intune: `https://intune.microsoft.com/${tenant.defaultDomainName}`,
portal_security: `https://security.microsoft.com/?tid=${tenant.customerId}`,
portal_compliance: `https://compliance.microsoft.com/?tid=${tenant.customerId}`,
portal_compliance: `https://purview.microsoft.com/?tid=${tenant.customerId}`,
portal_sharepoint: `https://admin.microsoft.com/Partner/beginclientsession.aspx?CTID=${tenant.customerId}&CSDEST=SharePoint`,
});
});
Expand Down
Loading

0 comments on commit 51e77b5

Please sign in to comment.