Uploaded image for project: 'IGB'
  1. IGB
  2. IGBF-1140

Convert "Choose Local Folder" file chooser to the operating system's Native File Chooser

    Details

    • Story Points:
      2
    • Sprint:
      Fall 2017

      Description

      Certain places in IGB use the operating system's native file chooser and some do not. One place that does not is the "Choose Local Folder" option under the Data Sources tab of IGB Preferences.

      You can access IGB Preferences by hitting the gear icon in the IGB toolbar. From there you can access the Data Sources tab and then select "Add..." at the bottom of the tab. Then you can select "Choose Local Folder" (see screen shot)

      Before beginning work on this story, I still need to track down other JIRA issues relating to this and possibly find related commits so the developer working on this issue can more easily work on this issue.

        Attachments

          Issue Links

            Activity

            mason Mason Meyer (Inactive) created issue -
            mason Mason Meyer (Inactive) made changes -
            Field Original Value New Value
            Description Certain places in IGB use the operating system's native file chooser and some do not. One place that does not is the "Choose Local Folder" option under the Data Sources tab of IGB Preferences.

            You can access IGB Preferences by hitting the gear icon in the IGB toolbar. From there you can access the Data Sources tab and then select "Add..." at the bottom of the tab. Then you can select "Choose Local Folder" (see screen shot)
            Certain places in IGB use the operating system's native file chooser and some do not. One place that does not is the "Choose Local Folder" option under the Data Sources tab of IGB Preferences.

            You can access IGB Preferences by hitting the gear icon in the IGB toolbar. From there you can access the Data Sources tab and then select "Add..." at the bottom of the tab. Then you can select "Choose Local Folder" (see screen shot)

            Before beginning work on this story, I still need to track down other JIRA issues relating to this and possibly find related commits so the developer working on this issue can more easily work on this issue.
            mason Mason Meyer (Inactive) made changes -
            Status Open [ 1 ] Needs Testing [ 10002 ]
            ann.loraine Ann Loraine made changes -
            Story Points 2
            ann.loraine Ann Loraine made changes -
            Status Needs Testing [ 10002 ] Open [ 1 ]
            akadam3 Ashwini Kadam (Inactive) made changes -
            Assignee Ashwini Kadam [ akadam3 ]
            akadam3 Ashwini Kadam (Inactive) made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            akadam3 Ashwini Kadam (Inactive) made changes -
            Status In Progress [ 3 ] Needs 1st Level Review [ 10005 ]
            akadam3 Ashwini Kadam (Inactive) made changes -
            Assignee Ashwini Kadam [ akadam3 ]
            akadam3 Ashwini Kadam (Inactive) made changes -
            Link This issue relates to IGBF-1151 [ IGBF-1151 ]
            akadam3 Ashwini Kadam (Inactive) made changes -
            Link This issue relates to IGBF-1152 [ IGBF-1152 ]
            akadam3 Ashwini Kadam (Inactive) made changes -
            Link This issue relates to IGBF-1153 [ IGBF-1153 ]
            akadam3 Ashwini Kadam (Inactive) made changes -
            Link This issue relates to IGBF-1150 [ IGBF-1150 ]
            akadam3 Ashwini Kadam (Inactive) made changes -
            Link This issue relates to IGBF-1157 [ IGBF-1157 ]
            Hide
            akadam3 Ashwini Kadam (Inactive) added a comment -

            I have fixed this issue by changing JFileChooser to FileChooser which avails OS native file chooser.
            To do so, I have created and added new file DirectoryFileChooser.java (based on FileChooser.java).

            NOTE:
            I didn't have any quickload local folder to test this fix. Even though 'open folder window' is displayed as expected, i couldn't test what happens after selecting any valid folder.
            Also, this fix has not been tested on other OS like Linux or MacOS.

            >>> I think, we should have some folder or example files (or at least soem documentation some where) for testing purpose for developers.

            Show
            akadam3 Ashwini Kadam (Inactive) added a comment - I have fixed this issue by changing JFileChooser to FileChooser which avails OS native file chooser. To do so, I have created and added new file DirectoryFileChooser.java (based on FileChooser.java). NOTE: I didn't have any quickload local folder to test this fix. Even though 'open folder window' is displayed as expected, i couldn't test what happens after selecting any valid folder. Also, this fix has not been tested on other OS like Linux or MacOS. >>> I think, we should have some folder or example files (or at least soem documentation some where) for testing purpose for developers.
            Hide
            akadam3 Ashwini Kadam (Inactive) added a comment -

            I have linked this issue with IGBF-1150, IGBF-1151, IGBF-1152, IGBF-1153 and IGBF-1157 as they exhibit the similar behavior.

            Show
            akadam3 Ashwini Kadam (Inactive) added a comment - I have linked this issue with IGBF-1150 , IGBF-1151 , IGBF-1152 , IGBF-1153 and IGBF-1157 as they exhibit the similar behavior.
            Hide
            sneha Sneha Ramesh Watharkar (Inactive) added a comment -

            File > Preferences > Data Sources > Add... now has a 'Chose Local Folder' option, and that option identifies valid folders but all file types are greyed out. Is there a list somewhere of file types that should be accepted?

            Show
            sneha Sneha Ramesh Watharkar (Inactive) added a comment - File > Preferences > Data Sources > Add... now has a 'Chose Local Folder' option, and that option identifies valid folders but all file types are greyed out. Is there a list somewhere of file types that should be accepted?
            sneha Sneha Ramesh Watharkar (Inactive) made changes -
            Assignee Jennifer Daly [ jdaly ]
            sneha Sneha Ramesh Watharkar (Inactive) made changes -
            Status Needs 1st Level Review [ 10005 ] Reviewing [ 10301 ]
            Hide
            ann.loraine Ann Loraine added a comment -

            User should select folders only. Thus names of files are "grayed out" - to indicate that they should not be selected.

            Show
            ann.loraine Ann Loraine added a comment - User should select folders only. Thus names of files are "grayed out" - to indicate that they should not be selected.
            sneha Sneha Ramesh Watharkar (Inactive) made changes -
            Comment [ Sounds good. Everything is working as expected then, moving to 'ready for pull request' ]
            Hide
            sneha Sneha Ramesh Watharkar (Inactive) added a comment -

            After selecting a folder, when clicking 'open' should the folder show up beside 'URL:' ? What should happen when clicking submit, should it add the folder to the list?

            At the moment, it does neither of those things.

            Show
            sneha Sneha Ramesh Watharkar (Inactive) added a comment - After selecting a folder, when clicking 'open' should the folder show up beside 'URL:' ? What should happen when clicking submit, should it add the folder to the list? At the moment, it does neither of those things.
            Hide
            sneha Sneha Ramesh Watharkar (Inactive) added a comment - - edited

            Successfully added a selected folder to data sources. Completed first level review, moving to 'needs review' for 2nd review.

            Show
            sneha Sneha Ramesh Watharkar (Inactive) added a comment - - edited Successfully added a selected folder to data sources. Completed first level review, moving to 'needs review' for 2nd review.
            sneha Sneha Ramesh Watharkar (Inactive) made changes -
            Attachment IGBF-1140_addedfolder.png [ 13986 ]
            sneha Sneha Ramesh Watharkar (Inactive) made changes -
            Status Reviewing [ 10301 ] Needs 1st Level Review [ 10005 ]
            sneha Sneha Ramesh Watharkar (Inactive) made changes -
            Assignee Jennifer Daly [ jdaly ]
            Hide
            ieclabau Ivory Blakley (Inactive) added a comment -

            First level review, #2 of 2.

            Functional review:
            TBD

            Code review:

            The git history is a little messy. Of the 6 commits on bitbucket, 4 have the same commit message, and 1 is "Manual Merge file with online IGBF-1140 branch" which sounds like it shouldn't need to be there at all. In the first commit (https://bitbucket.org/ashwiniK27/integrated-genome-browser/commits/3071c7a00fdb77274537911187f5942947fbc778?at=IGBF-1140) nbactions.xml is deleted, (this file is part of the project, it should not be deleted).

            Ashwini and I worked together to start cleaning this up.

            Show
            ieclabau Ivory Blakley (Inactive) added a comment - First level review, #2 of 2. Functional review: TBD Code review: The git history is a little messy. Of the 6 commits on bitbucket, 4 have the same commit message, and 1 is "Manual Merge file with online IGBF-1140 branch" which sounds like it shouldn't need to be there at all. In the first commit ( https://bitbucket.org/ashwiniK27/integrated-genome-browser/commits/3071c7a00fdb77274537911187f5942947fbc778?at=IGBF-1140 ) nbactions.xml is deleted, (this file is part of the project, it should not be deleted). Ashwini and I worked together to start cleaning this up.
            ieclabau Ivory Blakley (Inactive) made changes -
            Assignee Ivory Clabaugh [ ieclabau ]
            ieclabau Ivory Blakley (Inactive) made changes -
            Status Needs 1st Level Review [ 10005 ] Reviewing [ 10301 ]
            Hide
            ieclabau Ivory Blakley (Inactive) added a comment - - edited

            Needs just a little more git cleanup....sorry.

            We don't want the history of nbactions.xml to show a commit where it was deleted and then another commit where it was added back.

            use $git rebase --interactive
            Set the terms to "edit" for the commit where the file was deleted (commit 68d2c89), and skip commit f7245b3 (where it was added back) by removing that line of text.
            This should stop you at the commit where nbactions was deleted in the first place.
            Add the file back as part of the same commit.
            I think you can use $git checkout 88ce977aec49e1c7ccdd7cf10487fcd203950c1f nbactions.xml
            That will pull the copy of nbactions.xml from the commit just before it was deleted.
            Use $git commit --amend --no-edit
            That will make adding the file back part of the same commit as where it was deleted, negating the deletion.
            Then continue with the rebase, $git rebase --continue

            After you push this to your remote ($git push -f), you should be able to look at the branch on bitbucket, and look at the first commit (68d2c89). We should NOT see nbactions.xml as one of the files changed.

            ---This worked as expected. If we ever have a commit that deletes a file (like this), I think this is the ideal way to get it back. It leaves the git history free of needless do-undo records.

            Show
            ieclabau Ivory Blakley (Inactive) added a comment - - edited Needs just a little more git cleanup....sorry. We don't want the history of nbactions.xml to show a commit where it was deleted and then another commit where it was added back. use $git rebase --interactive Set the terms to "edit" for the commit where the file was deleted (commit 68d2c89), and skip commit f7245b3 (where it was added back) by removing that line of text. This should stop you at the commit where nbactions was deleted in the first place. Add the file back as part of the same commit. I think you can use $git checkout 88ce977aec49e1c7ccdd7cf10487fcd203950c1f nbactions.xml That will pull the copy of nbactions.xml from the commit just before it was deleted. Use $git commit --amend --no-edit That will make adding the file back part of the same commit as where it was deleted, negating the deletion. Then continue with the rebase, $git rebase --continue After you push this to your remote ($git push -f), you should be able to look at the branch on bitbucket, and look at the first commit (68d2c89). We should NOT see nbactions.xml as one of the files changed. ---This worked as expected. If we ever have a commit that deletes a file (like this), I think this is the ideal way to get it back. It leaves the git history free of needless do-undo records.
            ieclabau Ivory Blakley (Inactive) made changes -
            Assignee Ivory Clabaugh [ ieclabau ] Ashwini Kadam [ akadam3 ]
            ieclabau Ivory Blakley (Inactive) made changes -
            Status Reviewing [ 10301 ] Open [ 1 ]
            ieclabau Ivory Blakley (Inactive) made changes -
            Status Open [ 1 ] Reviewing [ 10301 ]
            ieclabau Ivory Blakley (Inactive) made changes -
            Assignee Ashwini Kadam [ akadam3 ] Ivory Clabaugh [ ieclabau ]
            Hide
            ieclabau Ivory Blakley (Inactive) added a comment -

            With the addition of DirectoryChooserUtil.java, there are two very similar classes:
            /Users/lorainelab/Documents/Repos/integrated-genome-browser/core/igb-javafx-util/src/main/java/org/lorainelab/igb/javafx/DirectoryChooserUtil.java
            and
            /Users/lorainelab/Documents/Repos/integrated-genome-browser/core/igb-javafx-util/src/main/java/org/lorainelab/igb/javafx/FileChooserUtil.java

            Why do we need both?
            I think you need to add some comments at the top of the new class explaining why we need this class. Why is FileChooserUtil.java not enough by itself?

            They seem to have very similar functions.... It looks like the only difference between them is that the new class does not have all of the members that the original one has (it looses "private Optional<String> defaultFileName;" and "private Optional<List<ExtensionFilter>> extensionFilters;") and it has two functions that the original does not have.

            Why not add the new functions [retrieveDirFromFxChooser() and getDirChooser()] as additional functions in the FileChooserUtil class? That seems simpler and does not produce any duplication. If the difference between these two classes is more significant than what I just described, please add comments to make that difference clear.

            I'm reassigning to Ashwini to address this, and moving back to to-do.

            Show
            ieclabau Ivory Blakley (Inactive) added a comment - With the addition of DirectoryChooserUtil.java, there are two very similar classes: /Users/lorainelab/Documents/Repos/integrated-genome-browser/core/igb-javafx-util/src/main/java/org/lorainelab/igb/javafx/DirectoryChooserUtil.java and /Users/lorainelab/Documents/Repos/integrated-genome-browser/core/igb-javafx-util/src/main/java/org/lorainelab/igb/javafx/FileChooserUtil.java Why do we need both? I think you need to add some comments at the top of the new class explaining why we need this class. Why is FileChooserUtil.java not enough by itself? They seem to have very similar functions.... It looks like the only difference between them is that the new class does not have all of the members that the original one has (it looses "private Optional<String> defaultFileName;" and "private Optional<List<ExtensionFilter>> extensionFilters;") and it has two functions that the original does not have. Why not add the new functions [retrieveDirFromFxChooser() and getDirChooser()] as additional functions in the FileChooserUtil class? That seems simpler and does not produce any duplication. If the difference between these two classes is more significant than what I just described, please add comments to make that difference clear. I'm reassigning to Ashwini to address this, and moving back to to-do.
            ieclabau Ivory Blakley (Inactive) made changes -
            Assignee Ivory Clabaugh [ ieclabau ] Ashwini Kadam [ akadam3 ]
            ieclabau Ivory Blakley (Inactive) made changes -
            Status Reviewing [ 10301 ] Open [ 1 ]
            akadam3 Ashwini Kadam (Inactive) made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            Hide
            akadam3 Ashwini Kadam (Inactive) added a comment -

            Ivory,

            You have described the difference between two files correctly. However, as FileChooserUtil.java is written to pick file from file system, I though it would be a good design to create new file for similar functionality to emphasize the difference between their objectives.
            I could write both new functions in FIleChosserUtil.java as you suggested but I strongly favor adding new file instead.

            Please let me know your views on this. I will change my design accordingly.

            Show
            akadam3 Ashwini Kadam (Inactive) added a comment - Ivory, You have described the difference between two files correctly. However, as FileChooserUtil.java is written to pick file from file system, I though it would be a good design to create new file for similar functionality to emphasize the difference between their objectives. I could write both new functions in FIleChosserUtil.java as you suggested but I strongly favor adding new file instead. Please let me know your views on this. I will change my design accordingly.
            akadam3 Ashwini Kadam (Inactive) made changes -
            Status In Progress [ 3 ] Pull Request Submitted [ 10101 ]
            akadam3 Ashwini Kadam (Inactive) made changes -
            Assignee Ashwini Kadam [ akadam3 ]
            ann.loraine Ann Loraine made changes -
            Status Pull Request Submitted [ 10101 ] Needs Testing [ 10002 ]
            ann.loraine Ann Loraine made changes -
            Assignee Mason Meyer [ mason ]
            mason Mason Meyer (Inactive) made changes -
            Status Needs Testing [ 10002 ] Testing In Progress [ 10003 ]
            Hide
            mason Mason Meyer (Inactive) added a comment -

            After testing this story I can confirm that the Choose Local Folder file chooser within the Data Sources tab of IGB Preferences has been changed to the operating system's native file chooser. This has been tested on Mac and Windows and is functioning as expected. Data Sources are being opened properly in IGB using the feature and there seem to be no side effects resulting from this change. Since this issue is resolved it will now be closed.

            Show
            mason Mason Meyer (Inactive) added a comment - After testing this story I can confirm that the Choose Local Folder file chooser within the Data Sources tab of IGB Preferences has been changed to the operating system's native file chooser. This has been tested on Mac and Windows and is functioning as expected. Data Sources are being opened properly in IGB using the feature and there seem to be no side effects resulting from this change. Since this issue is resolved it will now be closed.
            mason Mason Meyer (Inactive) made changes -
            Resolution Done [ 10000 ]
            Status Testing In Progress [ 10003 ] Closed [ 6 ]
            mason Mason Meyer (Inactive) made changes -
            Fix Version/s 9.0.1 Minor Release [ 10500 ]
            ann.loraine Ann Loraine made changes -
            Workflow Loraine Lab Workflow [ 17750 ] Fall 2019 Workflow Update [ 19792 ]
            ann.loraine Ann Loraine made changes -
            Workflow Fall 2019 Workflow Update [ 19792 ] Revised Fall 2019 Workflow Update [ 21911 ]

              People

              • Assignee:
                mason Mason Meyer (Inactive)
                Reporter:
                mason Mason Meyer (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: