Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FWF-3971:[Feature] - Subflow and Decesion Table Import version display #351

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -245,18 +245,17 @@ export const ImportModal: React.FC<ImportModalProps> = React.memo(
if (!importLoader && !importError && !inprogress) {
return "upload-status-success";
}

if (!importLoader && importError && !inprogress) {
return "upload-status-error";
}

if (inprogress) {
return "upload-status-progress";
}

return "";
};


// Function to render the status text based on the upload condition
const renderUploadStatusText = () => {
Expand Down Expand Up @@ -301,6 +300,7 @@ export const ImportModal: React.FC<ImportModalProps> = React.memo(
{renderFileItemDetails()}
{renderLayoutOptions()}
{renderFlowOptions()}
{renderProcessOption()}
</div>
);
}
Expand All @@ -324,10 +324,14 @@ export const ImportModal: React.FC<ImportModalProps> = React.memo(
// Function to render the file item details (e.g. type and import version)
const renderFileItemDetails = () => {
return (
<div className="import-details">
<div className="file-item-header-text">{t("Type")}</div>
<div className="file-item-header-text">{t("Import")}</div>
</div>
<>
{(fileItems?.form?.majorVersion || processVersion?.majorVersion) && (
<div className="import-details">
<div className="file-item-header-text">{t("Type")}</div>
<div className="file-item-header-text">{t("Import")}</div>
</div>
)}
</>
);
};

Expand Down Expand Up @@ -401,6 +405,19 @@ export const ImportModal: React.FC<ImportModalProps> = React.memo(
);
};

const renderProcessOption = () => {
return (
processVersion?.majorVersion && (
<div className="file-item-content">
<div className="import-workflow-text">{processVersion.type}</div>
<div className="flex-grow-1">
{t(`Import as Version ${processVersion?.majorVersion}.${processVersion?.minorVersion} (only impacts new submissions)`)}
</div>
</div>
)
);
}

// Function to render the file upload area when no file is selected
const renderFileUploadArea = () => {
return (
Expand Down
Loading