Skip to content

Commit 5c432b2

Browse files
authored
Merge pull request #3823 from James-Baloyi/james/en/43/3781
James/en/43/3781
2 parents 3b2c063 + d0ae92b commit 5c432b2

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

shesha-reactjs/src/designer-components/wizard/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ const TabsComponent: IToolboxComponent<Omit<IWizardComponentProps, 'size'>> = {
4444
},
4545
initModel: (model) => ({
4646
...model,
47-
stylingBox: "{\"marginBottom\":\"5\"}"
47+
stylingBox: "{\"marginBottom\":\"5\"}",
48+
showBackButton: true,
49+
showDoneButton: true
4850
}),
4951
migrator: (m) =>
5052
m
@@ -101,6 +103,11 @@ const TabsComponent: IToolboxComponent<Omit<IWizardComponentProps, 'size'>> = {
101103
.add<IWizardComponentProps>(4, (prev) => migrateWizardActions(prev))
102104
.add<IWizardComponentProps>(5, (prev) => ({ ...migrateFormApi.properties(prev) }))
103105
.add<IWizardComponentProps>(6, (prev) => removeComponents(prev))
106+
.add<IWizardComponentProps>(7, (prev) => ({
107+
...prev,
108+
showBackButton: prev.showBackButton ?? true,
109+
showDoneButton: prev.showDoneButton ?? true
110+
}))
104111
,
105112
settingsFormFactory: (props) => <WizardSettingsForm {...props} />,
106113
// validateSettings: model => validateConfigurableComponentSettings(settingsForm, model),

shesha-reactjs/src/designer-components/wizard/models.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,6 @@ export interface IWizardComponentProps extends Omit<IConfigurableFormComponent,
7676
buttonsLayout?: 'left' | 'right' | 'spaceBetween';
7777
showStepStatus?: boolean;
7878
sequence?: IWizardSequence;
79+
showBackButton?: boolean;
80+
showDoneButton?: boolean;
7981
}

shesha-reactjs/src/designer-components/wizard/settings.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ const WizardSettings: FC<ISettingsFormFactoryArgs<IWizardComponentProps>> = (pro
147147
</Select>
148148
</SettingsFormItem>
149149

150+
<SettingsFormItem name="showBackButton" label="Show Back Button" valuePropName="checked" jsSetting>
151+
<Checkbox disabled={readOnly} />
152+
</SettingsFormItem>
153+
154+
<SettingsFormItem name="showDoneButton" label="Show Done Button" valuePropName="checked" jsSetting>
155+
<Checkbox disabled={readOnly} />
156+
</SettingsFormItem>
157+
150158
<SettingsFormItem name="hidden" label="Hidden" valuePropName="checked" jsSetting>
151159
<Checkbox disabled={readOnly} />
152160
</SettingsFormItem>

shesha-reactjs/src/designer-components/wizard/tabs.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export const Tabs: FC<Omit<IWizardComponentProps, 'size'>> = ({ form, ...model }
2828
isDynamic,
2929
labelPlacement,
3030
wizardType = 'default',
31+
showBackButton = true,
32+
showDoneButton = true,
3133
} = model;
3234

3335
const steps = useMemo(() => {
@@ -92,7 +94,7 @@ export const Tabs: FC<Omit<IWizardComponentProps, 'size'>> = ({ form, ...model }
9294
</Space>
9395
)}
9496
>
95-
{current > 0 && (
97+
{current > 0 && showBackButton && (
9698
<Button
9799
style={btnStyle('back')}
98100
onClick={back}
@@ -132,7 +134,7 @@ export const Tabs: FC<Omit<IWizardComponentProps, 'size'>> = ({ form, ...model }
132134
</Button>
133135
)}
134136

135-
{current === visibleSteps.length - 1 && (
137+
{current === visibleSteps.length - 1 && showDoneButton && (
136138
<Button
137139
type="primary"
138140
style={btnStyle('next')}

0 commit comments

Comments
 (0)