diff --git a/src/containers/Flow/Flow.tsx b/src/containers/Flow/Flow.tsx
index f6c1bde16e..984b9a8f7f 100644
--- a/src/containers/Flow/Flow.tsx
+++ b/src/containers/Flow/Flow.tsx
@@ -351,7 +351,7 @@ export const Flow = () => {
customHandler={customHandler}
helpData={flowInfo}
backLinkButton={`/${backLink}`}
- buttonState={{ text: 'Save', status: isTemplate }}
+ buttonState={{ text: 'Save', status: isTemplate, show: true }}
restrictButtonStatus={{ status: isTemplate }}
/>
);
diff --git a/src/containers/Form/FormLayout.tsx b/src/containers/Form/FormLayout.tsx
index dd6500eae7..cfb5ad4092 100644
--- a/src/containers/Form/FormLayout.tsx
+++ b/src/containers/Form/FormLayout.tsx
@@ -53,6 +53,7 @@ export interface FormLayoutProps {
text?: string;
status?: boolean;
styles?: string;
+ show?: boolean;
};
type?: string;
afterSave?: Function;
@@ -76,6 +77,7 @@ export interface FormLayoutProps {
languageAttributes?: any;
helpData?: HelpDataProps;
noHeading?: boolean;
+ isView?: boolean;
partialPage?: boolean;
confirmationState?: {
show: boolean;
@@ -86,7 +88,10 @@ export interface FormLayoutProps {
text?: string;
status?: boolean;
};
- skipCancel?: boolean;
+ errorButtonState?: {
+ show?: boolean;
+ text?: string;
+ };
}
export const FormLayout = ({
@@ -95,9 +100,14 @@ export const FormLayout = ({
setStates,
validationSchema,
listItemName,
+ isView = false,
dialogMessage,
formFields,
redirectionLink,
+ errorButtonState = {
+ show: true,
+ text: 'Cancel',
+ },
listItem,
getItemQuery,
createItemQuery,
@@ -118,7 +128,7 @@ export const FormLayout = ({
advanceSearch,
cancelAction,
button = 'Save',
- buttonState = { text: '', status: false, styles: '' },
+ buttonState = { text: '', status: false, styles: '', show: true },
type,
afterSave,
afterDelete,
@@ -140,7 +150,6 @@ export const FormLayout = ({
partialPage = false,
confirmationState,
restrictButtonStatus,
- skipCancel = false,
}: FormLayoutProps) => {
const [showDialog, setShowDialog] = useState(false);
const [formSubmitted, setFormSubmitted] = useState(false);
@@ -584,22 +593,24 @@ export const FormLayout = ({
);
})}
-
+ {buttonState.show && (
+
+ )}
{additionalAction ? (