@@ -1793,7 +1793,7 @@ ipcRenderer.on("selected-generate-metadata-subjects", (event, dirpath, filename)
1793
1793
didOpen : ( ) => {
1794
1794
Swal . showLoading ( ) ;
1795
1795
} ,
1796
- } ) . then ( ( result ) => { } ) ;
1796
+ } ) . then ( ( result ) => { } ) ;
1797
1797
generateSubjectsFileHelper ( false ) ;
1798
1798
}
1799
1799
} ) ;
@@ -1809,7 +1809,7 @@ ipcRenderer.on("selected-generate-metadata-subjects", (event, dirpath, filename)
1809
1809
didOpen : ( ) => {
1810
1810
Swal . showLoading ( ) ;
1811
1811
} ,
1812
- } ) . then ( ( result ) => { } ) ;
1812
+ } ) . then ( ( result ) => { } ) ;
1813
1813
generateSubjectsFileHelper ( false ) ;
1814
1814
}
1815
1815
}
@@ -1892,7 +1892,7 @@ const generateSubjectsFileHelper = async (uploadBFBoolean) => {
1892
1892
didOpen : ( ) => {
1893
1893
Swal . showLoading ( ) ;
1894
1894
} ,
1895
- } ) . then ( ( result ) => { } ) ;
1895
+ } ) . then ( ( result ) => { } ) ;
1896
1896
1897
1897
try {
1898
1898
log . info ( `Generating a subjects file.` ) ;
@@ -2002,7 +2002,7 @@ ipcRenderer.on("selected-generate-metadata-samples", (event, dirpath, filename)
2002
2002
didOpen : ( ) => {
2003
2003
Swal . showLoading ( ) ;
2004
2004
} ,
2005
- } ) . then ( ( result ) => { } ) ;
2005
+ } ) . then ( ( result ) => { } ) ;
2006
2006
generateSamplesFileHelper ( uploadBFBoolean ) ;
2007
2007
}
2008
2008
} ) ;
@@ -2018,7 +2018,7 @@ ipcRenderer.on("selected-generate-metadata-samples", (event, dirpath, filename)
2018
2018
didOpen : ( ) => {
2019
2019
Swal . showLoading ( ) ;
2020
2020
} ,
2021
- } ) . then ( ( result ) => { } ) ;
2021
+ } ) . then ( ( result ) => { } ) ;
2022
2022
generateSamplesFileHelper ( uploadBFBoolean ) ;
2023
2023
}
2024
2024
}
@@ -2100,7 +2100,7 @@ const generateSamplesFileHelper = async (uploadBFBoolean) => {
2100
2100
didOpen : ( ) => {
2101
2101
Swal . showLoading ( ) ;
2102
2102
} ,
2103
- } ) . then ( ( result ) => { } ) ;
2103
+ } ) . then ( ( result ) => { } ) ;
2104
2104
2105
2105
try {
2106
2106
let samplesFileResponse = await client . post (
@@ -2620,7 +2620,7 @@ const loadTaxonomySpecies = async (commonName, destinationInput, curationMode) =
2620
2620
didOpen : ( ) => {
2621
2621
Swal . showLoading ( ) ;
2622
2622
} ,
2623
- } ) . then ( ( result ) => { } ) ;
2623
+ } ) . then ( ( result ) => { } ) ;
2624
2624
try {
2625
2625
let load_taxonomy_species = await client . get ( `/taxonomy/species` , {
2626
2626
params : {
@@ -4926,10 +4926,10 @@ const swalFileListSingleAction = async (fileList, title, helpText, postActionTex
4926
4926
${ helpText ? `<p>${ helpText } </p>` : "" }
4927
4927
<div class="swal-file-list">
4928
4928
${ fileList
4929
- . map (
4930
- ( file ) => `<div class="swal-file-row"><span class="swal-file-text">${ file } </span></div>`
4931
- )
4932
- . join ( "" ) }
4929
+ . map (
4930
+ ( file ) => `<div class="swal-file-row"><span class="swal-file-text">${ file } </span></div>`
4931
+ )
4932
+ . join ( "" ) }
4933
4933
</div>
4934
4934
${ postActionText ? `<b>${ postActionText } </b>` : "" }
4935
4935
` ,
@@ -4959,10 +4959,10 @@ const swalFileListDoubleAction = async (
4959
4959
${ helpText }
4960
4960
<div class="swal-file-list">
4961
4961
${ fileList
4962
- . map (
4963
- ( file ) => `<div class="swal-file-row"><span class="swal-file-text">${ file } </span></div>`
4964
- )
4965
- . join ( "" ) }
4962
+ . map (
4963
+ ( file ) => `<div class="swal-file-row"><span class="swal-file-text">${ file } </span></div>`
4964
+ )
4965
+ . join ( "" ) }
4966
4966
</div>
4967
4967
<b>${ confirmationText } </b>
4968
4968
` ,
@@ -4994,10 +4994,10 @@ const swalFileListTripleAction = async (
4994
4994
${ helpText }
4995
4995
<div class="swal-file-list">
4996
4996
${ fileList
4997
- . map (
4998
- ( file ) => `<div class="swal-file-row"><span class="swal-file-text">${ file } </span></div>`
4999
- )
5000
- . join ( "" ) }
4997
+ . map (
4998
+ ( file ) => `<div class="swal-file-row"><span class="swal-file-text">${ file } </span></div>`
4999
+ )
5000
+ . join ( "" ) }
5001
5001
</div>
5002
5002
<b>${ confirmationText } </b>
5003
5003
` ,
@@ -6703,9 +6703,8 @@ const listItems = async (jsonObj, uiItem, amount_req, reset) => {
6703
6703
${ dragDropInstructionsText }
6704
6704
</p>
6705
6705
<p class="text-center">
6706
- You may also <b>add</b> or <b>import</b> ${
6707
- folderType === undefined ? "folders or files" : folderType + " data"
6708
- } using the buttons in the upper right corner
6706
+ You may also <b>add</b> or <b>import</b> ${ folderType === undefined ? "folders or files" : folderType + " data"
6707
+ } using the buttons in the upper right corner
6709
6708
</p>
6710
6709
</div>`
6711
6710
) ;
@@ -7393,7 +7392,7 @@ const deleteTreeviewFiles = (sodaJSONObj) => {
7393
7392
if (
7394
7393
"manifest.xlsx" in sodaJSONObj [ "dataset-structure" ] [ "folders" ] [ highLevelFol ] [ "files" ] &&
7395
7394
sodaJSONObj [ "dataset-structure" ] [ "folders" ] [ highLevelFol ] [ "files" ] [ "manifest.xlsx" ] [
7396
- "forTreeview"
7395
+ "forTreeview"
7397
7396
]
7398
7397
) {
7399
7398
delete sodaJSONObj [ "dataset-structure" ] [ "folders" ] [ highLevelFol ] [ "files" ] [ "manifest.xlsx" ] ;
@@ -8468,7 +8467,9 @@ ipcRenderer.on("selected-manifest-folder", async (event, result) => {
8468
8467
}
8469
8468
} ) ;
8470
8469
8471
- async function showBFAddAccountSweetalert ( ) {
8470
+ async function showBFAddAccountSweetalert ( ev ) {
8471
+ console . log ( "The ev: " , ev )
8472
+ let target = ev . target
8472
8473
await Swal . fire ( {
8473
8474
title : bfaddaccountTitle ,
8474
8475
html : bfAddAccountBootboxMessage ,
@@ -8518,7 +8519,7 @@ async function showBFAddAccountSweetalert() {
8518
8519
selected_account : name ,
8519
8520
} ,
8520
8521
} )
8521
- . then ( ( response ) => {
8522
+ . then ( async ( response ) => {
8522
8523
let user_email = response . data . email ;
8523
8524
$ ( "#current-bf-account" ) . text ( user_email ) ;
8524
8525
$ ( "#current-bf-account-generate" ) . text ( user_email ) ;
@@ -8528,9 +8529,42 @@ async function showBFAddAccountSweetalert() {
8528
8529
$ ( "#current-bf-dataset-generate" ) . text ( "None" ) ;
8529
8530
$ ( ".bf-dataset-span" ) . html ( "None" ) ;
8530
8531
$ ( "#para-continue-bf-dataset-getting-started" ) . text ( "" ) ;
8532
+ // set the workspace field values to the user's current workspace
8533
+ let org = response . data . organization ;
8534
+ $ ( ".bf-organization-span" ) . text ( org ) ;
8531
8535
showHideDropdownButtons ( "account" , "show" ) ;
8532
8536
confirm_click_account_function ( ) ;
8533
8537
updateBfAccountList ( ) ;
8538
+
8539
+ // If the clicked button has the data attribute "reset-guided-mode-page" and the value is "true"
8540
+ // then reset the guided mode page
8541
+ if ( target ?. getAttribute ( "data-reset-guided-mode-page" ) == "true" ) {
8542
+ // Get the current page that the user is on in the guided mode
8543
+ const currentPage = CURRENT_PAGE . id ;
8544
+ if ( currentPage ) {
8545
+ await openPage ( currentPage ) ;
8546
+ }
8547
+ }
8548
+
8549
+ // reset the selected dataset to None
8550
+ $ ( ".bf-dataset-span" ) . html ( "None" ) ;
8551
+ // reset the current owner span in the manage dataset make pi owner of a dataset tab
8552
+ $ ( ".current-permissions" ) . html ( "None" ) ;
8553
+
8554
+ refreshOrganizationList ( ) ;
8555
+
8556
+
8557
+ // If the button that triggered the organization has the class
8558
+ // guided-change-workspace (from guided mode), handle changes based on the ev id
8559
+ // otherwise, reset the FFM UI based on the ev class
8560
+ // NOTE: For API Key sign in flow it is more simple to just reset the UI as the new user may be in a separate workspace than the prior user.
8561
+ target ?. classList . contains ( "data-reset-guided-mode-page" )
8562
+ ? handleGuidedModeOrgSwitch ( target )
8563
+ : resetFFMUI ( target ) ;
8564
+
8565
+ datasetList = [ ] ;
8566
+ defaultBfDataset = null ;
8567
+ clearDatasetDropdowns ( ) ;
8534
8568
} )
8535
8569
. catch ( ( error ) => {
8536
8570
Swal . showValidationMessage ( userErrorMessage ( error ) ) ;
0 commit comments