@plutonhq/core-frontend 0.1.29 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/components/Plan/PlanForm/PlanForm.d.ts.map +1 -1
- package/dist-lib/components/Plan/PlanForm/PlanForm.js +20 -11
- package/dist-lib/components/Plan/PlanForm/PlanForm.js.map +1 -1
- package/dist-lib/components/Plan/PlanSettings/PlanAdvancedSettings.d.ts +2 -1
- package/dist-lib/components/Plan/PlanSettings/PlanAdvancedSettings.d.ts.map +1 -1
- package/dist-lib/components/Plan/PlanSettings/PlanAdvancedSettings.js +28 -21
- package/dist-lib/components/Plan/PlanSettings/PlanAdvancedSettings.js.map +1 -1
- package/dist-lib/components/Plan/PlanSettings/PlanGeneralSettings.d.ts +2 -1
- package/dist-lib/components/Plan/PlanSettings/PlanGeneralSettings.d.ts.map +1 -1
- package/dist-lib/components/Plan/PlanSettings/PlanGeneralSettings.js +21 -20
- package/dist-lib/components/Plan/PlanSettings/PlanGeneralSettings.js.map +1 -1
- package/dist-lib/components/common/form/Toggle/Toggle.d.ts +2 -1
- package/dist-lib/components/common/form/Toggle/Toggle.d.ts.map +1 -1
- package/dist-lib/components/common/form/Toggle/Toggle.js +21 -11
- package/dist-lib/components/common/form/Toggle/Toggle.js.map +1 -1
- package/dist-lib/components/common/form/Toggle/Toggle.module.scss.js +6 -4
- package/dist-lib/components/common/form/Toggle/Toggle.module.scss.js.map +1 -1
- package/dist-lib/hooks/usePlanSingleActions.d.ts.map +1 -1
- package/dist-lib/hooks/usePlanSingleActions.js +34 -33
- package/dist-lib/hooks/usePlanSingleActions.js.map +1 -1
- package/dist-lib/styles/core-frontend.css +1 -1
- package/package.json +1 -1
- package/src/components/Plan/PlanForm/PlanForm.tsx +7 -1
- package/src/components/Plan/PlanSettings/PlanAdvancedSettings.tsx +7 -2
- package/src/components/Plan/PlanSettings/PlanGeneralSettings.tsx +3 -1
- package/src/components/common/form/Toggle/Toggle.module.scss +7 -0
- package/src/components/common/form/Toggle/Toggle.tsx +14 -3
- package/src/hooks/usePlanSingleActions.tsx +4 -2
package/package.json
CHANGED
|
@@ -273,7 +273,13 @@ const PlanForm = ({
|
|
|
273
273
|
)}
|
|
274
274
|
{step === 4 && (
|
|
275
275
|
<div className={PFClasses.planStep}>
|
|
276
|
-
<PlanAdvancedSettings
|
|
276
|
+
<PlanAdvancedSettings
|
|
277
|
+
plan={planSettings}
|
|
278
|
+
appSettings={appSettings}
|
|
279
|
+
onUpdate={onPlanSettingsChange}
|
|
280
|
+
device={deviceInstance}
|
|
281
|
+
isEditing={type === 'edit'}
|
|
282
|
+
/>
|
|
277
283
|
</div>
|
|
278
284
|
)}
|
|
279
285
|
</div>
|
|
@@ -16,9 +16,10 @@ interface PlanAdvancedSettingsProps {
|
|
|
16
16
|
appSettings?: Record<string, any>;
|
|
17
17
|
device: Device;
|
|
18
18
|
onUpdate: (notificationSettings: NewPlanSettings) => void;
|
|
19
|
+
isEditing: boolean;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
const PlanAdvancedSettings = ({ plan, appSettings, device, onUpdate }: PlanAdvancedSettingsProps) => {
|
|
22
|
+
const PlanAdvancedSettings = ({ plan, appSettings, device, onUpdate, isEditing }: PlanAdvancedSettingsProps) => {
|
|
22
23
|
const [advancedTab, setAdvancedTab] = useState('General');
|
|
23
24
|
const settings = plan.settings;
|
|
24
25
|
const integrationTypes = useMemo(() => {
|
|
@@ -75,7 +76,11 @@ const PlanAdvancedSettings = ({ plan, appSettings, device, onUpdate }: PlanAdvan
|
|
|
75
76
|
)}
|
|
76
77
|
<div className={classes.advancedTabContent}>
|
|
77
78
|
{advancedTab === 'General' && (
|
|
78
|
-
<PlanGeneralSettings
|
|
79
|
+
<PlanGeneralSettings
|
|
80
|
+
settings={settings}
|
|
81
|
+
onUpdate={(newSettings) => onUpdate({ ...plan, settings: newSettings })}
|
|
82
|
+
isEditing={isEditing}
|
|
83
|
+
/>
|
|
79
84
|
)}
|
|
80
85
|
{advancedTab === 'Notification' && (
|
|
81
86
|
<PlanNotificationSettings
|
|
@@ -6,9 +6,10 @@ import classes from './PlanSettings.module.scss';
|
|
|
6
6
|
interface PlanGeneralSettingsProps {
|
|
7
7
|
settings: NewPlanSettings['settings'];
|
|
8
8
|
onUpdate: (settings: NewPlanSettings['settings']) => void;
|
|
9
|
+
isEditing: boolean;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
const PlanGeneralSettings = ({ settings, onUpdate }: PlanGeneralSettingsProps) => {
|
|
12
|
+
const PlanGeneralSettings = ({ settings, onUpdate, isEditing }: PlanGeneralSettingsProps) => {
|
|
12
13
|
const { encryption, compression, retries, retryDelay } = settings;
|
|
13
14
|
return (
|
|
14
15
|
<>
|
|
@@ -16,6 +17,7 @@ const PlanGeneralSettings = ({ settings, onUpdate }: PlanGeneralSettingsProps) =
|
|
|
16
17
|
<label className={classes.label}>Encryption</label>
|
|
17
18
|
<Toggle
|
|
18
19
|
fieldValue={encryption}
|
|
20
|
+
disabled={isEditing}
|
|
19
21
|
onUpdate={(val: boolean) => onUpdate({ ...settings, encryption: val })}
|
|
20
22
|
description="Encrypt Source Files before backup"
|
|
21
23
|
/>
|
|
@@ -9,11 +9,22 @@ type ToggleProps = {
|
|
|
9
9
|
inline?: boolean;
|
|
10
10
|
hint?: string;
|
|
11
11
|
error?: string;
|
|
12
|
+
disabled?: boolean;
|
|
12
13
|
fieldValue: boolean;
|
|
13
14
|
onUpdate: (f: boolean) => void;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
|
-
const Toggle = ({
|
|
17
|
+
const Toggle = ({
|
|
18
|
+
label,
|
|
19
|
+
description,
|
|
20
|
+
customClasses = '',
|
|
21
|
+
fieldValue = false,
|
|
22
|
+
inline = false,
|
|
23
|
+
hint = '',
|
|
24
|
+
error,
|
|
25
|
+
disabled = false,
|
|
26
|
+
onUpdate,
|
|
27
|
+
}: ToggleProps) => {
|
|
17
28
|
const toggleID = nanoid();
|
|
18
29
|
const updateField = (event: React.FormEvent<HTMLInputElement>) => {
|
|
19
30
|
const inputVal = event.currentTarget.value === 'true';
|
|
@@ -22,8 +33,8 @@ const Toggle = ({ label, description, customClasses = '', fieldValue = false, in
|
|
|
22
33
|
|
|
23
34
|
return (
|
|
24
35
|
<FormField type="toggle" label={label} hint={hint} error={error} inline={inline} classes={`${classes.toggleField} ${customClasses}`}>
|
|
25
|
-
<div className={classes.toggleCheckbox}>
|
|
26
|
-
<input type="checkbox" id={toggleID} value={fieldValue.toString()} onChange={updateField} checked={fieldValue} />
|
|
36
|
+
<div className={`${classes.toggleCheckbox} ${disabled ? classes.toggleDisabled : ''}`}>
|
|
37
|
+
<input type="checkbox" id={toggleID} value={fieldValue.toString()} onChange={updateField} checked={fieldValue} disabled={disabled} />
|
|
27
38
|
<label htmlFor={toggleID}>{label}</label>
|
|
28
39
|
{description && <span className={classes.description}>{description}</span>}
|
|
29
40
|
</div>
|
|
@@ -99,13 +99,15 @@ export const usePlanSingleActions = (): {
|
|
|
99
99
|
|
|
100
100
|
performBackupMutation.mutate(plan.id, {
|
|
101
101
|
onSuccess: (data) => {
|
|
102
|
+
const msg = data?.message || `${isSync ? 'Sync' : 'Backup'} initiated successfully! 🚀`;
|
|
103
|
+
const notStarted = !isSync && data?.message && data?.message.includes('reached the concurrency limit');
|
|
102
104
|
toast.update(toastId, {
|
|
103
|
-
render: isSync ?
|
|
105
|
+
render: isSync ? msg : notStarted ? data?.message : 'Backup initiated successfully!',
|
|
104
106
|
type: 'success',
|
|
105
107
|
isLoading: false,
|
|
106
108
|
autoClose: 3000,
|
|
107
109
|
});
|
|
108
|
-
if (!isSync) {
|
|
110
|
+
if (!isSync && !notStarted) {
|
|
109
111
|
navigate(`/plan/${plan.id}?pendingbackup=1`);
|
|
110
112
|
}
|
|
111
113
|
},
|