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

task/WP-65-DropdownViewFullPath #866

Merged
merged 24 commits into from
Oct 27, 2023
Merged

Conversation

tjgrafft
Copy link
Collaborator

@tjgrafft tjgrafft commented Sep 29, 2023

Overview

Started out as:

Some paths in the data files area can get quite long, and the breadcrumbs are often truncated. It may be ideal to offer a tooltip on hover to show the full path, untruncated.

Reach out to #cep-design for direction of design and functionality (and desirability of this feature).

I reached out to the cep-design team and Tracy for guidance on the design and functionality. The functionality changed from the original overview/goals. Instead of breadcrumb links, we now have a dropdown menu that contains the previous directories and the root directory. The current directory the user is in, is displayed to the right of the dropdown menu. Since WP-278 and WP-279 were related and basically required to complete WP-65, I have added them to this PR. We now have a new modal design for both the new "View Full Path" button/link and the "View Path" button/link in the File listings.

Related

Changes

  • Quite a few files had to change in order to design and make the new layout functional.
  • Got rid of older breadcrumbs design and replaced it with a dropdown menu.
  • Dropdown menu (Accessed by clicking the new "Go to ..." button) contains all previous directories (as user navigates through file system) and will contain a dropdownitem for the root directory (if homeDir is present).
  • Current directory is shown to the right of the new dropdown menu.
  • If file and/or folder names got too long (this was true for frontera juypter notebook names mostly) I added the truncateMiddle util to shorter it with ...
  • User can navigate between folders by opening the dropdown menu and clicking the desired folder they want to jump to.
  • Redesigned the datafiles modal per WP-278 and WP-279. I added a new parameter for TextCopyField (called renderType), which allows the developers to decide whether they want the old modal design (single-line) or the new design (text-area where the full path wraps so that user can see full path). I retained the old functionality of the old modal (per Wesley's request) so that it will default to the displayField='input' if no value is given for that new parameter.
  • Added View Full Path button/link. This will not render when systemName is not defined to avoid error/user clicking on it.
  • Had to rewrite and delete some of the old unit tests in DataFilesBreadcrumbs.test.js and PublicData.test.js because of the new layout/design.
  • Also had to change the size of the DataFilesToolbar buttons to small to make more room for new layout
  • Per Wesley's help, added a dropdown-menu.css file in styles/components/dropdown-menu.css. This file is now used for both the dropdown menu styles and the add button styles.
  • Moved Dropdown menu component into its own file. Added a file called CombinedBreadcrumbs that is used for combining both the dropdown comp and the breadcrumbs comp.
  • Select, Move, and Copy modals were all affected by the changes to the BreadCrumb file. So I had to change the code, and add dispatch actions to bring in APIs, definitions, and systems.

Testing

  1. Go to https://cep.test/
  2. Click on Data Files in sidebar
  3. Using different systems (Corral, Frontera, Public Data, etc) navigate through folders and use new dropdown to see new navigation. Click on the folders in dropdown to make sure navigation is working properly.
  4. Use both the View Full Path button/link to the right of the Go to ... button to see the full path of current directory. Also use the View Path button/link in the File Listings to get the full path for individual files.
  5. Try opening the Move, Copy, (in Data Files) and Select Modals (in Applications for selecting individual files in apps like NAMD for example) and making sure the View Full Path button in them works correctly.
  6. Compare with images below.

UI

New Dropdown button and View Full Path Layout
Screenshot 2023-10-25 at 3 01 52 PM

Dropdown open
Screenshot 2023-10-25 at 3 02 17 PM

Truncate middle for long folder/file names
Screenshot 2023-10-25 at 3 02 42 PM

New Shared Workspaces dropdown layout with Project Name included for nav
Screenshot 2023-10-25 at 3 03 12 PM

New View Full Path Modal
Screenshot 2023-10-25 at 3 03 35 PM

Copy Modal with View Full Path
Screenshot 2023-10-25 at 3 04 58 PM

Move Modal with View Full Path
Screenshot 2023-10-25 at 3 05 20 PM

Select Modal with View Full Path
Screenshot 2023-10-25 at 3 05 40 PM

Notes

@codecov
Copy link

codecov bot commented Sep 29, 2023

Codecov Report

Merging #866 (d01917f) into main (8ac9be3) will increase coverage by 0.01%.
The diff coverage is 84.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #866      +/-   ##
==========================================
+ Coverage   63.38%   63.40%   +0.01%     
==========================================
  Files         430      432       +2     
  Lines       12297    12381      +84     
  Branches     2542     2574      +32     
==========================================
+ Hits         7795     7850      +55     
- Misses       4293     4319      +26     
- Partials      209      212       +3     
Flag Coverage Δ
javascript 69.69% <84.00%> (-0.06%) ⬇️
unittests 56.99% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...aFiles/CombinedBreadcrumbs/CombinedBreadcrumbs.jsx 100.00% <100.00%> (ø)
client/src/components/DataFiles/DataFiles.jsx 71.11% <ø> (ø)
...iles/DataFilesBreadcrumbs/DataFilesBreadcrumbs.jsx 68.57% <100.00%> (-18.74%) ⬇️
...ts/DataFiles/DataFilesToolbar/DataFilesToolbar.jsx 75.72% <ø> (ø)
...DataFiles/DataFilesModals/DataFilesSelectModal.jsx 69.69% <0.00%> (-2.18%) ⬇️
...taFiles/DataFilesModals/DataFilesShowPathModal.jsx 90.90% <90.00%> (+1.62%) ⬆️
...ataFilesSystemSelector/DataFilesSystemSelector.jsx 73.68% <0.00%> (-2.00%) ⬇️
...components/_common/TextCopyField/TextCopyField.jsx 68.18% <71.42%> (-2.41%) ⬇️
.../DataFiles/DataFilesDropdown/DataFilesDropdown.jsx 81.96% <81.96%> (ø)

Copy link
Member

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks functional. But there is room for improvement to the code.

@wesleyboar wesleyboar self-requested a review October 2, 2023 19:12
Copy link
Member

@rstijerina rstijerina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great so far! Functionality is working perfectly. A few comments on styling

@tjgrafft
Copy link
Collaborator Author

tjgrafft commented Oct 10, 2023

I made the Dropdown a separate component from DataFilesBreadcrumbs. Moved the Copy button in the modals from the left to the right (that was the original mock, and it looks better with everything left aligned in the modal imo). Also had to change the dropdown navigation logic from the previous commit. I tested it on Public and Community Data, but will test it on Frontera and other file systems tomorrow.

Update: New navigation logic working correctly on Frontera and other systems too.

Copy link
Member

@rstijerina rstijerina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working great for the most part! Found a few things worth discussing

Comment on lines -159 to -169
<div className={`breadcrumbs ${className}`}>
{scheme === 'projects' && (
<>
<RootProjectsLink
api={api}
section={section}
operation={operation}
label="Shared Workspaces"
/>{' '}
{system && `/ `}
</>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously we had the "Shared Workspaces" root in the breadcrumb path. Do we want to include that with this feature as well?
Screenshot 2023-10-18 at 12 16 08 PM

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SharedProjects What do you think of this? I'll fix the folder icon alignment, but do you like this idea for Shared Workspaces?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@tjgrafft tjgrafft requested a review from rstijerina October 24, 2023 15:39
}

.storage-values,
.storage-google {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just use storage-values and get rid of storage-google, since they have the same css

@@ -91,6 +100,7 @@ const DataFilesSelectModal = ({ isOpen, toggle, onSelect }) => {
/>
)}
</div>
<DataFilesShowPathModal api={apiValue} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than define a new prop and initiate the dispatch here, can we move it to DataFilesShowPathModal? If not, then we can instead use a selector to grab the api value in the DataFilesShowPathModal component

@tjgrafft tjgrafft requested a review from rstijerina October 25, 2023 19:11
Copy link
Contributor

@sophia-massie sophia-massie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting some console errors when running locally. Was going to pass them on here in the review, but Tapis server also keeps intermittently going down making it difficult to test. May have to defer to the other reviewers for now.

@sophia-massie
Copy link
Contributor

Getting some console errors when running locally. Was going to pass them on here in the review, but Tapis server also keeps intermittently going down making it difficult to test. May have to defer to the other reviewers for now.

Tapis came back up. Tested the issues previously brought up. LGTM good work!

@sophia-massie sophia-massie self-requested a review October 25, 2023 21:19
@rstijerina
Copy link
Member

Looks great! Going to deploy to dev.cep to confirm that Google Drive works as well

Copy link
Member

@rstijerina rstijerina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works and looks great! Left a couple comments, but not blockers to merge

Comment on lines +51 to +54
dispatch({
type: 'FETCH_SYSTEM_DEFINITION',
payload: system.system,
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this needed both here and in DataFilesShowPathModal.jsx? Just curious

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea/logic was every time the user selects a different system in the dropdown, it fetches that system definition (so the definition isn't null or undefined). ShowPathModal's dispatch would just be upon the modal opening, and since the modal is already open--my thought was it wouldn't fetch the new system definition without it also being in SystemSelector.

@chandra-tacc chandra-tacc merged commit 1f3884c into main Oct 27, 2023
6 checks passed
@chandra-tacc chandra-tacc deleted the task/WP-65-DropdownViewFullPath branch October 27, 2023 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants