Skip to content

Commit

Permalink
Merge pull request #3529 from Ren-Roros-Digital/namedlocation
Browse files Browse the repository at this point in the history
fix: added condition, added a few icons
  • Loading branch information
JohnDuprey authored Jan 30, 2025
2 parents fd35931 + 7e8bdc6 commit a25dd35
Show file tree
Hide file tree
Showing 13 changed files with 156 additions and 109 deletions.
8 changes: 5 additions & 3 deletions src/pages/email/administration/contacts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,31 @@ import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"
import { Edit } 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 Down
3 changes: 3 additions & 0 deletions src/pages/email/administration/quarantine/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const Page = () => {
},
confirmText: "Are you sure you want to release this message?",
icon: <Done />,
condition: (row) => row.ReleaseStatus !== "RELEASED",
},
{
label: "Deny",
Expand All @@ -112,6 +113,7 @@ const Page = () => {
},
confirmText: "Are you sure you want to deny this message?",
icon: <Block />,
condition: (row) => row.ReleaseStatus !== "DENIED",
},
{
label: "Release & Allow Sender",
Expand All @@ -125,6 +127,7 @@ const Page = () => {
confirmText:
"Are you sure you want to release this email and add the sender to the whitelist?",
icon: <DoneAll />,
condition: (row) => row.ReleaseStatus !== "RELEASED",
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js";
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
import { Button } from "@mui/material";
import Link from "next/link";
import TrashIcon from '@heroicons/react/24/outline/TrashIcon';

const Page = () => {
const pageTitle = "Tenant Allow/Block Lists";
Expand All @@ -18,6 +19,7 @@ const Page = () => {
},
confirmText: "Are you sure you want to delete?",
color: "danger",
icon: <TrashIcon />,
},
];

Expand Down
8 changes: 5 additions & 3 deletions src/pages/email/reports/SharedMailboxEnabledAccount/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Layout as DashboardLayout } from "/src/layouts/index.js";
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
import { Block } from "@mui/icons-material";

/*
NOTE for Devs:
Expand All @@ -18,10 +19,11 @@ const Page = () => {
actions={[
{
label: "Block Sign In",
type: "POST",
type: "GET",
icon: <Block />,
url: "/api/ExecDisableUser",
data: { TenantFilter: "Tenant", ID: "id" },
confirmText: "Are you sure you want to block this user from signing in?",
data: { ID: "id" },
confirmText: "Are you sure you want to block the sign-in for this user?",
},
]}
offCanvas={{
Expand Down
18 changes: 10 additions & 8 deletions src/pages/email/reports/antiphishing-filters/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Layout as DashboardLayout } from "/src/layouts/index.js";
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
import { Block, Check } from "@mui/icons-material";

const Page = () => {
const pageTitle = "List of Anti-Phishing Filters";
Expand All @@ -8,25 +9,27 @@ const Page = () => {
const actions = [
{
label: "Enable Rule",
type: "POST",
type: "GET",
icon: <Check />,
url: "/api/EditAntiPhishingFilter",
data: {
State: "Enable",
TenantFilter: "TenantFilter", // TenantFilter used in API path as per original file
RuleName: "id",
RuleName: "RuleName",
},
confirmText: "Are you sure you want to enable this rule?",
condition: (row) => row.State === "Disabled",
},
{
label: "Disable Rule",
type: "POST",
type: "GET",
icon: <Block />,
url: "/api/EditAntiPhishingFilter",
data: {
State: "Disable",
TenantFilter: "TenantFilter",
RuleName: "id",
RuleName: "RuleName",
},
confirmText: "Are you sure you want to disable this rule?",
condition: (row) => row.State === "Enabled",
},
// Uncomment the following block if Delete Rule is to be re-enabled in the future
/*
Expand All @@ -35,8 +38,7 @@ const Page = () => {
type: "POST",
url: "/api/RemoveAntiPhishingFilter",
data: {
TenantFilter: "TenantFilter",
RuleName: "id",
RuleName: "RuleName",
},
confirmText: "Are you sure you want to delete this rule?",
},
Expand Down
5 changes: 5 additions & 0 deletions src/pages/email/reports/global-address-list/index.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
import { Layout as DashboardLayout } from "/src/layouts/index.js";
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
import { Visibility, VisibilityOff } from "@mui/icons-material";

const Page = () => {
const actions = [
{
label: "Unhide from Global Address List",
type: "POST",
url: "/api/ExecHideFromGAL",
icon: <Visibility />,
data: {
HideFromGAL: false,
ID: "PrimarySmtpAddress",
},
confirmText: "Are you sure you want to show this mailbox in the Global Address List?",
condition: (row) => row.HiddenFromAddressListsEnabled == true,
},
{
label: "Hide from Global Address List",
type: "POST",
url: "/api/ExecHideFromGAL",
icon: <VisibilityOff />,
data: {
HideFromGAL: true,
ID: "PrimarySmtpAddress",
},
confirmText: "Are you sure you want to hide this mailbox from the Global Address List?",
condition: (row) => row.HiddenFromAddressListsEnabled == false,
},
];

Expand Down
18 changes: 10 additions & 8 deletions src/pages/email/reports/malware-filters/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Layout as DashboardLayout } from "/src/layouts/index.js";
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
import { Block, Check } from "@mui/icons-material";

const Page = () => {
return (
Expand All @@ -9,34 +10,35 @@ const Page = () => {
actions={[
{
label: "Enable Rule",
type: "POST",
type: "GET",
icon: <Check />,
url: "/api/EditMalwareFilter",
data: {
State: "Enable",
TenantFilter: "tenant.defaultDomainName",
RuleName: "row.RuleName",
RuleName: "RuleName",
},
confirmText: "Are you sure you want to enable this rule?",
condition: (row) => row.State === "Disabled",
},
{
label: "Disable Rule",
type: "POST",
type: "GET",
icon: <Block />,
url: "/api/EditMalwareFilter",
data: {
State: "Disable",
TenantFilter: "tenant.defaultDomainName",
RuleName: "row.RuleName",
RuleName: "RuleName",
},
confirmText: "Are you sure you want to disable this rule?",
condition: (row) => row.State === "Enabled",
},
/* Uncomment and add additional actions if required by future specs
{
label: "Delete Rule",
type: "POST",
url: "/api/RemoveMalwareFilter",
data: {
TenantFilter: "tenant.defaultDomainName",
RuleName: "row.RuleName",
RuleName: "RuleName",
},
confirmText: "Are you sure you want to delete this rule?",
},
Expand Down
22 changes: 12 additions & 10 deletions src/pages/email/reports/safeattachments-filters/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Layout as DashboardLayout } from "/src/layouts/index.js";
import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx";
import { Block, Check } from "@mui/icons-material";

const Page = () => {
const pageTitle = "List of Safe Attachment Filters";
Expand All @@ -9,37 +10,38 @@ const Page = () => {
const actions = [
{
label: "Enable Rule",
type: "POST",
type: "GET",
icon: <Check />,
url: "/api/EditSafeAttachmentsFilter",
data: {
State: "Enable",
TenantFilter: "tenant.defaultDomainName", // TenantFilter uses default domain name in context
RuleName: "row.RuleName",
State: "!enable",
RuleName: "RuleName",
},
confirmText: "Are you sure you want to enable this rule?",
color: "info",
condition: (row) => row.State === "Disabled"
},
{
label: "Disable Rule",
type: "POST",
type: "GET",
icon: <Block />,
url: "/api/EditSafeAttachmentsFilter",
data: {
State: "Disable",
TenantFilter: "tenant.defaultDomainName", // TenantFilter uses default domain name in context
RuleName: "row.RuleName",
RuleName: "RuleName",
},
confirmText: "Are you sure you want to disable this rule?",
color: "info",
condition: (row) => row.State === "Enabled",
},
// Commented out "Delete Rule" action from the original file as it was also commented in legacy code
/*
{
label: "Delete Rule",
type: "POST",
type: "GET",
url: "/api/RemoveSafeAttachmentsFilter",
data: {
TenantFilter: "tenant.defaultDomainName",
RuleName: "row.RuleName",
RuleName: "RuleName",
},
confirmText: "Are you sure you want to delete this rule?",
color: "danger",
Expand Down
Loading

0 comments on commit a25dd35

Please sign in to comment.