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

EDSC-4252: Update the Application header to match the design in post tophat2 update #1816

Merged
merged 48 commits into from
Oct 30, 2024

Conversation

eudoroolivares2016
Copy link
Contributor

@eudoroolivares2016 eudoroolivares2016 commented Oct 24, 2024

Overview

What is the feature?

Integrating tophat2's new features onto earthdata search to deprecate the additional header. Implementing design to move secondary toolbar buttons as an overlay on each applicable page

What is the Solution?

Removing the Application header creating floating buttons for the secondary toolbar onto the map

What areas of the application does this impact?

Changes the app header, locations of colormap and legend, updates the secondary toolbar that appears on most application pages

Testing

Reproduction steps

  • **Environment for testing:ANY
  • **Collection to test with:NA
  1. Ensure that all pages of EDSC have access to the top level header
  2. Regression test to ensure that creating projects, using the tour, logging in, all work as expected
  3. Ensure that visually the components look like the original design specifications
  4. Ensure that colormaps are placed further down near the leaflet controls
  5. Ensure that the tophat2 like works as expected to bring you back to the top level page from anywhere in the application

Attachments

When Error Banner is up
image

When Colormap is up
image

Toplevel page:
image

Preferences but, looks the same on all the pages
image

Order Status page:
image

Project page:
image

My project saved project
image

Not found page:
image

Logged out:
image

These buttons do in fact line-up
image

The order status page:
image

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 88.23529% with 4 lines in your changes missing coverage. Please review.

Project coverage is 91.02%. Comparing base (ecf5fdb) to head (edf8de1).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
static/src/js/App.jsx 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1816      +/-   ##
==========================================
- Coverage   93.46%   91.02%   -2.44%     
==========================================
  Files         772      770       -2     
  Lines       18555    18565      +10     
  Branches     4784     4788       +4     
==========================================
- Hits        17342    16899     -443     
- Misses       1165     1524     +359     
- Partials       48      142      +94     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eudoroolivares2016 eudoroolivares2016 changed the title EDSC-4252 EDSC-4252: Update the Application header to match the design in post tophat2 update Oct 25, 2024
@@ -21,4 +17,14 @@ $headerHeight: 2rem;
.is-panels-dragging & {
pointer-events: none;
}

&__color-map {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This might be OBE

// map tools.
return routeWrapperWidth - 55
// Set the maxWidth to the available space minus the width of the secondary toolbar with some buffer.
const secondaryToolbarWidth = document.querySelector('.secondary-toolbar').offsetWidth
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is getting tested by playwright panels.spec.js

@@ -103,6 +103,7 @@ const SearchTour = () => {
stepIndex={stepIndex}
continuous
callback={handleJoyrideCallback}
disableScrollParentFix
Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://docs.react-joyride.com/props - this was to fix an issue for some cases on joyride in our case with the wrapping-container this was adding a style that messed up the overflows we added in SCSS
it was adding overflow: initial to the parent element of the Search Tour

@@ -22,7 +22,7 @@ export const NotFound = ({

// Modify the background color of root element for the not found page so we can load stars jpg
const selectElementById = () => {
const element = document.getElementById('app')
const element = document.getElementById('wrapping-container')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is needed because we can't set this to black with the map selector unless we add a list of all the routes etc. Since this is the route we will be going to if it matches none of our routes

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is interesting. Not a deal breaker but Id be curious to see if react-router had a way to check to see if any routes were matched on the current page.

@@ -22,7 +22,7 @@ export const NotFound = ({

// Modify the background color of root element for the not found page so we can load stars jpg
const selectElementById = () => {
const element = document.getElementById('app')
const element = document.getElementById('wrapping-container')
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is interesting. Not a deal breaker but Id be curious to see if react-router had a way to check to see if any routes were matched on the current page.

// Set the maxWidth to the available space minus the width of the
// map tools.
return routeWrapperWidth - 55
return routeWrapperWidth - 165
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe add back a comment here so we know why were subtracting. Something simple like this would probably work.

Subtracting from the available space to ensure the user menu/login button and map tools remain visible at the maximum panel width

@@ -87,6 +89,7 @@ class SecondaryToolbar extends Component {
onUpdateProjectName(newProjectName)
}

// Needed for Save Project so page does not change
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you could elaborate here. Not sure exactly what you mean by this comment. Ideally were using full sentences and adding all the required details to understand the implementation more easily.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. we discussed this at one point as a team if we needed some of the event.stopPropagation() calls but, we do because if we don't have that when the project-id updates the url path it tries to refresh the page. (If you remove them I mean)

Copy link
Collaborator

Choose a reason for hiding this comment

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

The spacing here looks a little wonky when a colormap is visible. If possible, it would be great if there was the same about of space between the map tools and colormap as there is between the colormap and scale

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only issue with that is that is really going to break a significant amount of the map.spec tests

Copy link
Collaborator

Choose a reason for hiding this comment

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

The inconsistent spacing looks pretty bad. If we cant get it in now, we should write an improvement ticket to track it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added those to the https://bugs.earthdata.nasa.gov/browse/EDSC-4302 ticket as new AC with the comment in the description

Copy link
Collaborator

@trevorlang trevorlang left a comment

Choose a reason for hiding this comment

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

One last tweak 😄

@@ -15,12 +15,14 @@ export const WrappingContainer = (props) => {
const { search, pathname } = location
let isMapPage = ['/search']

// Currently saved projects and a project page share route1
// Currently saved projects and a project page share route as such we must determine if we are on the saved projects page
Copy link
Collaborator

Choose a reason for hiding this comment

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

Currently saved projects and a project page share a route as such we must determine if we are on the saved projects page

😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's what I get for going fast 🤦

@eudoroolivares2016 eudoroolivares2016 merged commit 4b77b15 into main Oct 30, 2024
11 checks passed
@eudoroolivares2016 eudoroolivares2016 deleted the EDSC-4252 branch October 30, 2024 18:27
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.

3 participants