Skip to content

Commit

Permalink
Merge pull request #114 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
[pull] dev from KelvinTegelaar:dev
  • Loading branch information
pull[bot] authored Feb 24, 2025
2 parents c48d311 + 33ac08f commit 4e4eff8
Show file tree
Hide file tree
Showing 34 changed files with 297 additions and 117 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/cipp_dev_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@ jobs:
uses: actions/checkout@v4.2.2

# Set up Node.js
- name: Get Node version
id: get_node_version
run: |
node_raw_version=$(node -p "require('./package.json').engines.node")
node_sanitized_version=$(echo $node_raw_version | sed -E 's/[^0-9.]+//g')
echo "node_version=$node_sanitized_version" >> $GITHUB_OUTPUT
- name: Set up Node.js
uses: actions/setup-node@v4.2.0
with:
node-version: '20.18.1'
node-version: ${{ steps.get_node_version.outputs.node_version }}

# Install dependencies
- name: Install Dependencies
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/cipp_frontend_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@ jobs:
uses: actions/checkout@v4.2.2

# Set up Node.js
- name: Get Node version
id: get_node_version
run: |
node_raw_version=$(node -p "require('./package.json').engines.node")
node_sanitized_version=$(echo $node_raw_version | sed -E 's/[^0-9.]+//g')
echo "node_version=$node_sanitized_version" >> $GITHUB_OUTPUT
- name: Set up Node.js
uses: actions/setup-node@v4.2.0
with:
node-version: '20.18.1'
node-version: ${{ steps.get_node_version.outputs.node_version }}

# Install dependencies
- name: Install Dependencies
Expand Down
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.1"
"node": "^22.13.0"
},
"repository": {
"type": "git",
Expand Down
30 changes: 15 additions & 15 deletions src/components/CippComponents/CippUserActions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const CippUserActions = () => {
//tested

label: "Create Temporary Access Password",
type: "GET",
type: "POST",
icon: <Password />,
url: "/api/ExecCreateTAP",
data: { ID: "userPrincipalName" },
Expand All @@ -63,7 +63,7 @@ export const CippUserActions = () => {
{
//tested
label: "Re-require MFA registration",
type: "GET",
type: "POST",
icon: <PhonelinkSetup />,
url: "/api/ExecResetMFA",
data: { ID: "userPrincipalName" },
Expand Down Expand Up @@ -107,26 +107,26 @@ export const CippUserActions = () => {
{
//tested
label: "Convert to Shared Mailbox",
type: "GET",
type: "POST",
icon: <Email />,
url: "/api/ExecConvertToSharedMailbox",
data: { ID: "userPrincipalName" },
url: "/api/ExecConvertMailbox",
data: { ID: "userPrincipalName", MailboxType: "!Shared" },
confirmText: "Are you sure you want to convert this user to a shared mailbox?",
multiPost: false,
},
{
label: "Convert to User Mailbox",
type: "GET",
type: "POST",
icon: <Email />,
url: "/api/ExecConvertToSharedMailbox",
data: { ID: "userPrincipalName", ConvertToUser: true },
url: "/api/ExecConvertMailbox",
data: { ID: "userPrincipalName", MailboxType: "!Regular" },
confirmText: "Are you sure you want to convert this user to a user mailbox?",
multiPost: false,
},
{
//tested
label: "Enable Online Archive",
type: "GET",
type: "POST",
icon: <Archive />,
url: "/api/ExecEnableArchive",
data: { ID: "userPrincipalName" },
Expand Down Expand Up @@ -237,7 +237,7 @@ export const CippUserActions = () => {
},
{
label: "Block Sign In",
type: "GET",
type: "POST",
icon: <Block />,
url: "/api/ExecDisableUser",
data: { ID: "id" },
Expand All @@ -247,7 +247,7 @@ export const CippUserActions = () => {
},
{
label: "Unblock Sign In",
type: "GET",
type: "POST",
icon: <LockOpen />,
url: "/api/ExecDisableUser",
data: { ID: "id", Enable: true },
Expand All @@ -257,7 +257,7 @@ export const CippUserActions = () => {
},
{
label: "Reset Password (Must Change)",
type: "GET",
type: "POST",
icon: <LockReset />,
url: "/api/ExecResetPass",
data: {
Expand All @@ -271,7 +271,7 @@ export const CippUserActions = () => {
},
{
label: "Reset Password",
type: "GET",
type: "POST",
icon: <LockReset />,
url: "/api/ExecResetPass",
data: {
Expand All @@ -296,7 +296,7 @@ export const CippUserActions = () => {
},
{
label: "Revoke all user sessions",
type: "GET",
type: "POST",
icon: <PersonOff />,
url: "/api/ExecRevokeSessions",
data: { ID: "id", Username: "userPrincipalName" },
Expand All @@ -305,7 +305,7 @@ export const CippUserActions = () => {
},
{
label: "Delete User",
type: "GET",
type: "POST",
icon: <TrashIcon />,
url: "/api/RemoveUser",
data: { ID: "id" },
Expand Down
28 changes: 28 additions & 0 deletions src/components/CippStandards/CippStandardDialog.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { differenceInDays } from 'date-fns';
import {
Dialog,
DialogActions,
Expand Down Expand Up @@ -47,6 +48,12 @@ const CippStandardDialog = ({
[]
);

const isNewStandard = (dateAdded) => {
const currentDate = new Date();
const addedDate = new Date(dateAdded);
return differenceInDays(currentDate, addedDate) <= 30;
};

return (
<Dialog
open={dialogOpen}
Expand Down Expand Up @@ -86,8 +93,17 @@ const CippStandardDialog = ({
display: "flex",
flexDirection: "column",
height: "100%",
position: "relative",
}}
>
{isNewStandard(standard.addedDate) && (
<Chip
label="New"
size="small"
color="success"
sx={{ position: "absolute"}}
/>
)}
<CardContent sx={{ flexGrow: 1 }}>
<Typography variant="h6" gutterBottom>
{standard.label}
Expand Down Expand Up @@ -151,6 +167,18 @@ const CippStandardDialog = ({
</Typography>
</>
)}
{standard.addedDate?.length > 0 && (
<>
<Typography variant="subtitle2" sx={{ mt: 2 }}>
Date Added:
</Typography>
<Box sx={{ display: "flex", alignItems: "center" }}>
<Typography variant="body2" color="textSecondary">
{standard.addedDate}
</Typography>
</Box>
</>
)}
</CardContent>

<CardContent>
Expand Down
Loading

0 comments on commit 4e4eff8

Please sign in to comment.