Skip to content

Commit cc8f5cd

Browse files
authored
Merge pull request #3347 from JohnDuprey/dev
bugfixes
2 parents 0c326bd + f912a82 commit cc8f5cd

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

src/components/CippWizard/CippWizardOffboarding.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ export const CippWizardOffboarding = (props) => {
300300
onPreviousStep={onPreviousStep}
301301
onNextStep={onNextStep}
302302
formControl={formControl}
303+
replacementBehaviour="removeNulls"
303304
/>
304305
</Stack>
305306
);

src/components/CippWizard/CippWizardStepButtons.jsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,24 @@ export const CippWizardStepButtons = (props) => {
1313
formControl,
1414
noNextButton = false,
1515
noSubmitButton = false,
16+
replacementBehaviour,
1617
queryKeys,
1718
...other
1819
} = props;
1920
const { isValid, isSubmitted, isSubmitting } = useFormState({ control: formControl.control });
2021
const sendForm = ApiPostCall({ relatedQueryKeys: queryKeys });
2122
const handleSubmit = () => {
2223
const values = formControl.getValues();
23-
sendForm.mutate({ url: postUrl, data: values });
24+
const newData = {};
25+
Object.keys(values).forEach((key) => {
26+
const value = values[key];
27+
if (replacementBehaviour !== "removeNulls") {
28+
newData[key] = value;
29+
} else if (row[value] !== undefined) {
30+
newData[key] = row[value];
31+
}
32+
});
33+
sendForm.mutate({ url: postUrl, data: newData });
2434
};
2535

2636
return (

src/pages/tenant/administration/alert-configuration/alert.jsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,21 @@ const AlertWizard = () => {
206206
};
207207

208208
const handleScriptSubmit = (values) => {
209+
const getInputParams = () => {
210+
if (values.command.value.requiresInput) {
211+
return {
212+
[values.command.value.inputName]: values[values.command.value.inputName],
213+
};
214+
}
215+
return {};
216+
};
217+
209218
const postObject = {
210219
RowKey: router.query.clone ? undefined : router.query.id ? router.query.id : undefined,
211220
tenantFilter: values.tenantFilter?.value,
212221
Name: `${values.tenantFilter.value}: ${values.command.label}`,
213222
Command: { value: `Get-CIPPAlert${values.command.value.name}` },
214-
Parameters: {},
223+
Parameters: getInputParams(),
215224
ScheduledTime: Math.floor(new Date().getTime() / 1000) + 60,
216225
Recurrence: values.recurrence,
217226
PostExecution: values.postExecution,

src/pages/tenant/gdap-management/onboarding/start.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ const Page = () => {
205205
});
206206

207207
var missingDefaults = [];
208-
relationshipRoles.forEach((role) => {
209-
if (!cippDefaults?.find((defaultRole) => defaultRole.value === role.roleDefinitionId)) {
208+
cippDefaults.forEach((defaultRole) => {
209+
if (!relationshipRoles?.find((role) => defaultRole.value === role.roleDefinitionId)) {
210210
missingDefaults.push(role);
211211
}
212212
});

0 commit comments

Comments
 (0)