Skip to content

Commit

Permalink
FWF-3794:[Feature]-Added header and primary button props
Browse files Browse the repository at this point in the history
  • Loading branch information
Josephalexantony-aot committed Oct 29, 2024
1 parent e492c7f commit e0f9358
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions forms-flow-web/src/components/Form/EditForm/FormEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,8 @@ const Edit = React.memo(() => {
onClose={handleCloseSelectedAction}
handleImport={handleImport}
fileItems={fileItems}
headerText="Import File"
primaryButtonText="Confirm And Replace"
/>

<ExportModal
Expand Down
2 changes: 2 additions & 0 deletions forms-flow-web/src/components/Form/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ const List = React.memo((props) => {
description={description}
onClose={onCloseimportModal}
handleImport={handleImport}
headerText="Import New Form"
primaryButtonText="Confirm and Edit form"
/>
</div>
</div>
Expand Down
7 changes: 4 additions & 3 deletions forms-flow-web/src/components/Modals/ImportModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CloseIcon, CustomButton, UploadIcon, SuccessIcon, FailedIcon, IButton,

const ImportModal = React.memo(({ importFormModal, onClose, formSubmitted,
uploadActionType, importError, importLoader, formName, description,
handleImport, fileItems }) => {
handleImport, fileItems, headerText, primaryButtonText}) => {

const computedStyle = getComputedStyle(document.documentElement);
const redColor = computedStyle.getPropertyValue("--ff-red-000");
Expand Down Expand Up @@ -55,6 +55,7 @@ const ImportModal = React.memo(({ importFormModal, onClose, formSubmitted,
};

const onImport = () => {
closeModal();
handleImport(selectedFile, uploadActionType.IMPORT,
selectedLayoutVersion?.value, selectedFlowVersion?.value);
};
Expand All @@ -80,7 +81,7 @@ const ImportModal = React.memo(({ importFormModal, onClose, formSubmitted,
<Modal show={importFormModal} onHide={closeModal} centered={true} size="sm">
<Modal.Header>
<Modal.Title>
<b><Translation>{(t) => t("Import New Form")}</Translation></b>
<b><Translation>{(t) => t(headerText)}</Translation></b>
</Modal.Title>
<div className="d-flex align-items-center">
<CloseIcon width="16.5" height="16.5" onClick={() => {
Expand Down Expand Up @@ -239,7 +240,7 @@ const ImportModal = React.memo(({ importFormModal, onClose, formSubmitted,
variant={importError && !selectedFile ? "dark" : "primary"}
disabled={importError}
size="md"
label={<Translation>{(t) => t("Confirm and Edit form")}</Translation>}
label={<Translation>{(t) => t(primaryButtonText)}</Translation>}
onClick={onImport}
buttonLoading={!importError && formSubmitted ? true : false}
className=""
Expand Down

0 comments on commit e0f9358

Please sign in to comment.