Skip to content

Commit 93b02f1

Browse files
authored
Merge pull request KelvinTegelaar#3651 from KelvinTegelaar/dev
Dev to hotfix
2 parents 1e93ee9 + 44eba18 commit 93b02f1

File tree

10 files changed

+47
-32
lines changed

10 files changed

+47
-32
lines changed

.github/workflows/cipp_dev_build.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
name: CIPP Frontend Build
1+
name: CIPP Frontend Dev Build
22

33
on:
44
push:
55
branches:
66
- dev
77
workflow_dispatch:
88

9-
permissions:
10-
contents: write
11-
129
jobs:
1310
build:
1411
if: github.event.repository.fork == false
@@ -18,11 +15,11 @@ jobs:
1815
steps:
1916
# Checkout the repository
2017
- name: Checkout Code
21-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4.2.2
2219

2320
# Set up Node.js
2421
- name: Set up Node.js
25-
uses: actions/setup-node@v3
22+
uses: actions/setup-node@v4.2.0
2623
with:
2724
node-version: '20.18.1'
2825

@@ -43,7 +40,7 @@ jobs:
4340
4441
# Upload to Azure Blob Storage
4542
- name: Azure Blob Upload
46-
uses: LanceMcCarthy/Action-AzureBlobUpload@v3.3.0
43+
uses: LanceMcCarthy/Action-AzureBlobUpload@v3.3.1
4744
with:
4845
connection_string: ${{ secrets.AZURE_CONNECTION_STRING }}
4946
container_name: cipp

.github/workflows/cipp_frontend_build.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
- main
77
workflow_dispatch:
88

9-
permissions:
10-
contents: write
11-
129
jobs:
1310
build:
1411
if: github.event.repository.fork == false
@@ -18,11 +15,11 @@ jobs:
1815
steps:
1916
# Checkout the repository
2017
- name: Checkout Code
21-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4.2.2
2219

2320
# Set up Node.js
2421
- name: Set up Node.js
25-
uses: actions/setup-node@v3
22+
uses: actions/setup-node@v4.2.0
2623
with:
2724
node-version: '20.18.1'
2825

@@ -43,11 +40,10 @@ jobs:
4340
4441
# Upload to Azure Blob Storage
4542
- name: Azure Blob Upload
46-
uses: LanceMcCarthy/Action-AzureBlobUpload@v3.3.0
43+
uses: LanceMcCarthy/Action-AzureBlobUpload@v3.3.1
4744
with:
4845
connection_string: ${{ secrets.AZURE_CONNECTION_STRING }}
4946
container_name: cipp
5047
source_folder: build/
5148
destination_folder: /
5249
delete_if_exists: true
53-

public/version.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "7.2.2"
2+
"version": "7.2.3"
33
}

src/components/CippComponents/CippFormTenantSelector.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { CippFormComponent } from "./CippFormComponent";
33

44
export const CippFormTenantSelector = ({
55
formControl,
6+
componentType='autoComplete',
67
allTenants = false,
78
type = "multiple",
89
name = "tenantFilter",
@@ -23,7 +24,7 @@ export const CippFormTenantSelector = ({
2324

2425
return (
2526
<CippFormComponent
26-
type="autoComplete"
27+
type={componentType}
2728
name={name}
2829
formControl={formControl}
2930
placeholder="Select a tenant"

src/components/CippFormPages/CippFormPage.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ const CippFormPage = (props) => {
134134
<Stack spacing={2} direction="row">
135135
{addedButtons && addedButtons}
136136
<Button
137-
disabled={postCall.isPending || !isValid || (!allowResubmit && !isDirty)}
137+
disabled={postCall.isPending || !isValid || (!allowResubmit && (!isDirty))}
138138
onClick={formControl.handleSubmit(handleSubmit)}
139139
type="submit"
140140
variant="contained"

src/components/CippTable/util-columnsFromAPI.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { getCippFilterVariant } from "../../utils/get-cipp-filter-variant";
22
import { getCippFormatting } from "../../utils/get-cipp-formatting";
33
import { getCippTranslation } from "../../utils/get-cipp-translation";
44

5-
const skipRecursion = ["location"];
5+
const skipRecursion = ["location", "ScheduledBackupValues"];
66
// Function to merge keys from all objects in the array
77
const mergeKeys = (dataArray) => {
88
return dataArray.reduce((acc, item) => {

src/components/CippWizard/CIPPDeploymentStep.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,7 @@ export const CippDeploymentStep = (props) => {
341341
placeholder="Enter the application secret. Leave blank to retain previous key."
342342
validators={{
343343
validate: (value) => {
344-
const secretRegex =
345-
/^(?![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}$/;
344+
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,}$/;
346345
return (
347346
value === "" ||
348347
secretRegex.test(value) ||

src/pages/tenant/backup/backup-wizard/add.jsx

+12-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js";
55
import CippFormPage from "/src/components/CippFormPages/CippFormPage";
66
import CippFormComponent from "/src/components/CippComponents/CippFormComponent";
77
import { useSettings } from "/src/hooks/use-settings";
8+
import { CippFormTenantSelector } from "../../../../components/CippComponents/CippFormTenantSelector";
9+
import { te } from "date-fns/locale";
810

911
const CreateBackup = () => {
1012
const userSettingsDefaults = useSettings();
@@ -30,7 +32,7 @@ const CreateBackup = () => {
3032

3133
return (
3234
<CippFormPage
33-
title="Add Backup Schedule"
35+
title="Backup Schedule"
3436
formControl={formControl}
3537
queryKey={`Backup Tasks`}
3638
postUrl="/api/AddScheduledItem?hidden=true&DisallowDuplicateName=true"
@@ -41,7 +43,7 @@ const CreateBackup = () => {
4143
const tenantFilter = values.tenantFilter || tenantDomain;
4244
const shippedValues = {
4345
TenantFilter: tenantFilter,
44-
Name: `CIPP Backup ${tenantFilter}`,
46+
Name: `CIPP Backup - ${tenantFilter}`,
4547
Command: { value: `New-CIPPBackup` },
4648
Parameters: { backupType: "Scheduled", ScheduledBackupValues: { ...values } },
4749
ScheduledTime: unixTime,
@@ -50,18 +52,21 @@ const CreateBackup = () => {
5052
return shippedValues;
5153
}}
5254
backButtonTitle="Backup Tasks"
55+
allowResubmit={true}
5356
>
5457
<Typography variant="body1">
5558
Backups are stored in CIPP's storage and can be restored using the CIPP Restore Backup
5659
Wizard. Backups run daily or on demand by clicking the backup now button.
5760
</Typography>
58-
<Grid container spacing={2}>
61+
<Grid container spacing={2} sx={{ my: 2 }}>
5962
<Grid item xs={12}>
60-
<CippFormComponent
61-
type="tenantSelector"
62-
label="Tenant"
63-
name="tenantFilter"
63+
<CippFormTenantSelector
6464
formControl={formControl}
65+
allTenants={true}
66+
name="tenantFilter"
67+
required={true}
68+
disableClearable={true}
69+
componentType="select"
6570
/>
6671
</Grid>
6772

src/pages/tenant/backup/backup-wizard/index.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ const Page = () => {
2828
showHidden: true,
2929
Type: "New-CIPPBackup",
3030
}}
31-
simpleColumns={["Tenant", "TaskState", "ExecutedTime"]}
31+
simpleColumns={[
32+
"Tenant",
33+
"Name",
34+
"Parameters.ScheduledBackupValues",
35+
"TaskState",
36+
"ExecutedTime",
37+
]}
3238
actions={[
3339
{
3440
label: "Delete Task",
@@ -39,7 +45,7 @@ const Page = () => {
3945
},
4046
]}
4147
offCanvas={{
42-
extendedInfoFields: ["RowKey", "TaskState", "ExecutedTime"],
48+
extendedInfoFields: ["Name", "Tenant", "TaskState", "ExecutedTime"],
4349
actions: [
4450
{
4551
label: "Delete Task",

src/utils/get-cipp-formatting.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,19 @@ export const getCippFormatting = (data, cellName, type, canReceive) => {
270270
return isText ? data : <Chip variant="outlined" label={data} size="small" color="info" />;
271271
}
272272

273+
if (cellName === "Parameters.ScheduledBackupValues") {
274+
return isText ? (
275+
JSON.stringify(data)
276+
) : (
277+
<CippDataTableButton
278+
data={Object.keys(data).map((key) => {
279+
return { key, value: data[key] };
280+
})}
281+
tableTitle={getCippTranslation(cellName)}
282+
/>
283+
);
284+
}
285+
273286
// Handle null or undefined data
274287
if (data === null || data === undefined) {
275288
return isText ? (
@@ -439,9 +452,7 @@ export const getCippFormatting = (data, cellName, type, canReceive) => {
439452
variant="outlined"
440453
label={data}
441454
size="small"
442-
color={
443-
data === "private" ? "error" :data === "public" ? "success" : "primary"
444-
}
455+
color={data === "private" ? "error" : data === "public" ? "success" : "primary"}
445456
sx={{ textTransform: "capitalize" }}
446457
/>
447458
);

0 commit comments

Comments
 (0)