Skip to content

Commit

Permalink
Merge pull request KelvinTegelaar#3651 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
Dev to hotfix
  • Loading branch information
JohnDuprey authored Feb 14, 2025
2 parents 1e93ee9 + 44eba18 commit 93b02f1
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 32 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/cipp_dev_build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
name: CIPP Frontend Build
name: CIPP Frontend Dev Build

on:
push:
branches:
- dev
workflow_dispatch:

permissions:
contents: write

jobs:
build:
if: github.event.repository.fork == false
Expand All @@ -18,11 +15,11 @@ jobs:
steps:
# Checkout the repository
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4.2.2

# Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4.2.0
with:
node-version: '20.18.1'

Expand All @@ -43,7 +40,7 @@ jobs:
# Upload to Azure Blob Storage
- name: Azure Blob Upload
uses: LanceMcCarthy/Action-AzureBlobUpload@v3.3.0
uses: LanceMcCarthy/Action-AzureBlobUpload@v3.3.1
with:
connection_string: ${{ secrets.AZURE_CONNECTION_STRING }}
container_name: cipp
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/cipp_frontend_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
- main
workflow_dispatch:

permissions:
contents: write

jobs:
build:
if: github.event.repository.fork == false
Expand All @@ -18,11 +15,11 @@ jobs:
steps:
# Checkout the repository
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4.2.2

# Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4.2.0
with:
node-version: '20.18.1'

Expand All @@ -43,11 +40,10 @@ jobs:
# Upload to Azure Blob Storage
- name: Azure Blob Upload
uses: LanceMcCarthy/Action-AzureBlobUpload@v3.3.0
uses: LanceMcCarthy/Action-AzureBlobUpload@v3.3.1
with:
connection_string: ${{ secrets.AZURE_CONNECTION_STRING }}
container_name: cipp
source_folder: build/
destination_folder: /
delete_if_exists: true

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.2.2"
"version": "7.2.3"
}
3 changes: 2 additions & 1 deletion src/components/CippComponents/CippFormTenantSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CippFormComponent } from "./CippFormComponent";

export const CippFormTenantSelector = ({
formControl,
componentType='autoComplete',
allTenants = false,
type = "multiple",
name = "tenantFilter",
Expand All @@ -23,7 +24,7 @@ export const CippFormTenantSelector = ({

return (
<CippFormComponent
type="autoComplete"
type={componentType}
name={name}
formControl={formControl}
placeholder="Select a tenant"
Expand Down
2 changes: 1 addition & 1 deletion src/components/CippFormPages/CippFormPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const CippFormPage = (props) => {
<Stack spacing={2} direction="row">
{addedButtons && addedButtons}
<Button
disabled={postCall.isPending || !isValid || (!allowResubmit && !isDirty)}
disabled={postCall.isPending || !isValid || (!allowResubmit && (!isDirty))}
onClick={formControl.handleSubmit(handleSubmit)}
type="submit"
variant="contained"
Expand Down
2 changes: 1 addition & 1 deletion src/components/CippTable/util-columnsFromAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getCippFilterVariant } from "../../utils/get-cipp-filter-variant";
import { getCippFormatting } from "../../utils/get-cipp-formatting";
import { getCippTranslation } from "../../utils/get-cipp-translation";

const skipRecursion = ["location"];
const skipRecursion = ["location", "ScheduledBackupValues"];
// Function to merge keys from all objects in the array
const mergeKeys = (dataArray) => {
return dataArray.reduce((acc, item) => {
Expand Down
3 changes: 1 addition & 2 deletions src/components/CippWizard/CIPPDeploymentStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,7 @@ export const CippDeploymentStep = (props) => {
placeholder="Enter the application secret. Leave blank to retain previous key."
validators={{
validate: (value) => {
const secretRegex =
/^(?![0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)[0-9a-zA-Z]{40}$/;
const secretRegex = /^(?!^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)[A-Za-z0-9-_~.]{20,}$/;
return (
value === "" ||
secretRegex.test(value) ||
Expand Down
19 changes: 12 additions & 7 deletions src/pages/tenant/backup/backup-wizard/add.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js";
import CippFormPage from "/src/components/CippFormPages/CippFormPage";
import CippFormComponent from "/src/components/CippComponents/CippFormComponent";
import { useSettings } from "/src/hooks/use-settings";
import { CippFormTenantSelector } from "../../../../components/CippComponents/CippFormTenantSelector";
import { te } from "date-fns/locale";

const CreateBackup = () => {
const userSettingsDefaults = useSettings();
Expand All @@ -30,7 +32,7 @@ const CreateBackup = () => {

return (
<CippFormPage
title="Add Backup Schedule"
title="Backup Schedule"
formControl={formControl}
queryKey={`Backup Tasks`}
postUrl="/api/AddScheduledItem?hidden=true&DisallowDuplicateName=true"
Expand All @@ -41,7 +43,7 @@ const CreateBackup = () => {
const tenantFilter = values.tenantFilter || tenantDomain;
const shippedValues = {
TenantFilter: tenantFilter,
Name: `CIPP Backup ${tenantFilter}`,
Name: `CIPP Backup - ${tenantFilter}`,
Command: { value: `New-CIPPBackup` },
Parameters: { backupType: "Scheduled", ScheduledBackupValues: { ...values } },
ScheduledTime: unixTime,
Expand All @@ -50,18 +52,21 @@ const CreateBackup = () => {
return shippedValues;
}}
backButtonTitle="Backup Tasks"
allowResubmit={true}
>
<Typography variant="body1">
Backups are stored in CIPP's storage and can be restored using the CIPP Restore Backup
Wizard. Backups run daily or on demand by clicking the backup now button.
</Typography>
<Grid container spacing={2}>
<Grid container spacing={2} sx={{ my: 2 }}>
<Grid item xs={12}>
<CippFormComponent
type="tenantSelector"
label="Tenant"
name="tenantFilter"
<CippFormTenantSelector
formControl={formControl}
allTenants={true}
name="tenantFilter"
required={true}
disableClearable={true}
componentType="select"
/>
</Grid>

Expand Down
10 changes: 8 additions & 2 deletions src/pages/tenant/backup/backup-wizard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ const Page = () => {
showHidden: true,
Type: "New-CIPPBackup",
}}
simpleColumns={["Tenant", "TaskState", "ExecutedTime"]}
simpleColumns={[
"Tenant",
"Name",
"Parameters.ScheduledBackupValues",
"TaskState",
"ExecutedTime",
]}
actions={[
{
label: "Delete Task",
Expand All @@ -39,7 +45,7 @@ const Page = () => {
},
]}
offCanvas={{
extendedInfoFields: ["RowKey", "TaskState", "ExecutedTime"],
extendedInfoFields: ["Name", "Tenant", "TaskState", "ExecutedTime"],
actions: [
{
label: "Delete Task",
Expand Down
17 changes: 14 additions & 3 deletions src/utils/get-cipp-formatting.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,19 @@ export const getCippFormatting = (data, cellName, type, canReceive) => {
return isText ? data : <Chip variant="outlined" label={data} size="small" color="info" />;
}

if (cellName === "Parameters.ScheduledBackupValues") {
return isText ? (
JSON.stringify(data)
) : (
<CippDataTableButton
data={Object.keys(data).map((key) => {
return { key, value: data[key] };
})}
tableTitle={getCippTranslation(cellName)}
/>
);
}

// Handle null or undefined data
if (data === null || data === undefined) {
return isText ? (
Expand Down Expand Up @@ -439,9 +452,7 @@ export const getCippFormatting = (data, cellName, type, canReceive) => {
variant="outlined"
label={data}
size="small"
color={
data === "private" ? "error" :data === "public" ? "success" : "primary"
}
color={data === "private" ? "error" : data === "public" ? "success" : "primary"}
sx={{ textTransform: "capitalize" }}
/>
);
Expand Down

0 comments on commit 93b02f1

Please sign in to comment.