Skip to content

Commit

Permalink
wip: Added confirmation prior to removing missing imported folders/files
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobiClark committed Dec 30, 2024
1 parent cc3790d commit c446570
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
15 changes: 7 additions & 8 deletions src/renderer/src/scripts/guided-mode/guided-curate-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -5536,22 +5536,21 @@ window.openPage = async (targetPageID) => {
if (nonExistentFiles.length > 0) {
const userChoseToResolveMissingImportedFilePaths = await swalFileListDoubleAction(
nonExistentFiles,
"Files imported into SODA that are no longer on your computer were detected",
"Some files imported into SODA that are no longer at their original locations were detected",
`
The file paths listed below are no longer at their original locations. This issue must be resolved before continuing by selecting one of the options below. <br /><br />
- <b>I would like to manually move my files back to their original locations:</b> Choose this option if you still have access to the files and can move them back to their original paths.<br />
- <b>Have SODA disregard the removed files:</b> Choose this option <b>only</b> if you no longer have access to the files and want SODA to treat them as if they were never imported. Note that this action can not be undone.
`,
Files that were previously imported into SODA are no longer at their original locations, as shown below. This issue must be resolved before continuing by selecting one of the options below. <br /><br />
- <b>I would like to manually move my files back to their original locations:</b> Choose this option if you still have access to the files and can move them back to their original paths on your computer.<br />
- <b>Have SODA disregard the missing files:</b> Choose this only if you no longer have access to the files or don't want to upload them, and you want SODA to treat them as if they were never imported. This action cannot be undone. `,
"I would like to manually move my files back to their original locations",
"Have SODA disregard the removed files",
"Have SODA disregard the missing files",
""
);

if (userChoseToResolveMissingImportedFilePaths) {
userMustReturnToPreviousPage = true;
} else {
const userChoseToDisregardMissingFiles = await swalAskQuestion(
"Are you sure you want to disregard the imported folders/files that are no longer on your computer and treat them as if they were never imported?",
"Are you sure you want to disregard the imported files that are no longer located where they were originally imported from and treat them as if they were never imported?",
"Yes, disregard the missing files",
"No, I will move the files back to their original locations"
);
Expand Down Expand Up @@ -7106,7 +7105,7 @@ const guidedOpenEntityEditSwal = async (entityName) => {
)}" id='input-new-entity-name' class='guided--input' type='text' placeholder='Enter new ${entityNameSingular} name and press edit'/>
</div>
`,
width: 800,
width: 900,
heightAuto: false,
backdrop: "rgba(0,0,0,0.4)",
showConfirmButton: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ const promptSpeciesAndStrainSelection = async () => {
</div>
</div>
`,
width: 800,
width: 900,
heightAuto: false,
backdrop: "rgba(0,0,0, 0.4)",
showCancelButton: true,
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/src/scripts/others/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ const startupServerAndApiCheck = async () => {
confirmButtonText: "Restart SODA To Try Again",
allowOutsideClick: false,
allowEscapeKey: false,
width: 800,
width: 900,
});
await window.electron.ipcRenderer.invoke("relaunch-soda");
}
Expand Down Expand Up @@ -4429,9 +4429,9 @@ const showFileImportLoadingSweetAlert = (delayBeforeShowingSweetAlert) => {
<div></div>
</div>
`,
width: 800,
width: 900,
heightAuto: false,
width: 800,
width: 900,
heightAuto: false,
backdrop: "rgba(0,0,0, 0.4)",
allowOutsideClick: false,
Expand Down

0 comments on commit c446570

Please sign in to comment.