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

Add Application Page Header for Visualize Pages #7712

Merged
merged 4 commits into from
Aug 20, 2024

Conversation

LDrago27
Copy link
Collaborator

@LDrago27 LDrago27 commented Aug 14, 2024

Description

This changes at resolving following issues.

  1. Add New Application Header for Visualize when the newHomePage flag is done
  2. Show New Application Header Layout for Discover when newHomePage and queryEnhancement flag is true.
  3. Show New Application Header Layout on Visualize landing page when the newHomePage flag is done
  4. Show New Application Header Layout on Dashboards landing Page when the newHomePage flag is done
  5. Add New Application Header for Vis Builder when the newHomePage flag is done

Issues Resolved

Screenshot

Visualize with newHomePage flag is done
image

Discover when newHomePage and queryEnhancement flag is true
image

Visualize landing page
image

Dashboards Landing page
image

Vis Builder Page
image

Testing the changes

Application header in Visualize

  • Enable the new homePage flag in Advanced Settings
  • Navigate to the visualize Page and Check the new Page headers
  • Validate the new changes

Application Header layout in Discover

  • Enable the new homePage flag in Advanced Settings
  • Enable the query Enhancement flag in Advanced Settings
  • Validate the new changes

Changelog

  • feat: Add New Page Header to Visualize

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

opensearch-changeset-bot bot added a commit to LDrago27/OpenSearch-Dashboards that referenced this pull request Aug 14, 2024
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 8.69565% with 42 lines in your changes missing coverage. Please review.

Project coverage is 63.80%. Comparing base (9a84202) to head (b0252ad).
Report is 185 commits behind head on main.

Files with missing lines Patch % Lines
...er/public/application/utils/get_top_nav_config.tsx 14.28% 18 Missing ⚠️
...components/dashboard_listing/dashboard_listing.tsx 0.00% 10 Missing ⚠️
src/plugins/vis_builder/public/application/app.tsx 0.00% 6 Missing ⚠️
..._builder/public/application/components/top_nav.tsx 0.00% 4 Missing ⚠️
.../data_explorer/public/components/app_container.tsx 33.33% 2 Missing ⚠️
...s_react/public/table_list_view/table_list_view.tsx 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7712      +/-   ##
==========================================
- Coverage   63.82%   63.80%   -0.03%     
==========================================
  Files        3653     3655       +2     
  Lines       81038    81157     +119     
  Branches    12903    12933      +30     
==========================================
+ Hits        51726    51784      +58     
- Misses      26138    26194      +56     
- Partials     3174     3179       +5     
Flag Coverage Δ
Linux_1 30.07% <6.97%> (+0.01%) ⬆️
Linux_2 55.87% <ø> (+0.01%) ⬆️
Linux_3 40.41% <6.66%> (-0.01%) ⬇️
Linux_4 31.29% <0.00%> (+<0.01%) ⬆️
Windows_1 30.08% <6.97%> (-0.01%) ⬇️
Windows_2 55.82% <ø> (+0.01%) ⬆️
Windows_3 40.42% <6.66%> (?)
Windows_4 31.29% <0.00%> (+<0.01%) ⬆️

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

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

AMoo-Miki
AMoo-Miki previously approved these changes Aug 16, 2024
@ashwin-pc ashwin-pc added backport 2.x v2.17.0 look & feel Look and Feel Improvements labels Aug 16, 2024
virajsanghvi
virajsanghvi previously approved these changes Aug 19, 2024
Copy link
Collaborator

@virajsanghvi virajsanghvi left a comment

Choose a reason for hiding this comment

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

May want to address Miki's feedback + patch coverage, but otherwise lgtm

@LDrago27 LDrago27 dismissed stale reviews from virajsanghvi and AMoo-Miki via 95c9f8c August 19, 2024 23:19
@LDrago27 LDrago27 force-pushed the visualizeNewHeader branch 2 times, most recently from 95c9f8c to f0e2d66 Compare August 19, 2024 23:40
@LDrago27 LDrago27 changed the title Add Application Page Header for Visualize Add Application Page Header for Visualize Pages Aug 20, 2024
LDrago27 pushed a commit to LDrago27/OpenSearch-Dashboards that referenced this pull request Aug 20, 2024
@LDrago27 LDrago27 force-pushed the visualizeNewHeader branch from f0e2d66 to ac27eca Compare August 20, 2024 03:05
LDrago27 pushed a commit to LDrago27/OpenSearch-Dashboards that referenced this pull request Aug 20, 2024
@LDrago27 LDrago27 force-pushed the visualizeNewHeader branch from ac27eca to 79ff126 Compare August 20, 2024 18:57
@LDrago27 LDrago27 force-pushed the visualizeNewHeader branch from 79ff126 to b0252ad Compare August 20, 2024 22:07
: i18n.translate('visBuilder.topNavMenu.saveVisualizationButtonLabel', {
defaultMessage: 'save',
}),
ariaLabel: i18n.translate('visBuilder.topNavMenu.saveVisualizationAsButtonLabel', {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Check with UX but I feel when disabled, the aria-label might want to show the reason too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure will check with UX Regarding this.

@@ -35,6 +35,7 @@ import { Route, Switch, useLocation } from 'react-router-dom';
import { AppMountParameters } from 'opensearch-dashboards/public';
import { syncQueryStateWithUrl } from '../../../data/public';
import { useOpenSearchDashboards } from '../../../opensearch_dashboards_react/public';
import { HeaderVariant } from '../../../../core/public/index';
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nope I will clean it up.

Comment on lines +60 to +65
useEffect(() => {
if (showActionsInGroup) setHeaderVariant?.(HeaderVariant.APPLICATION);

return () => {
setHeaderVariant?.();
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you are doing this on most of the pages, you can actually set the default header while registering the app to use APPLICATION and then set the variant to page on the page that needs it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried the method you suggested, there are some issues arising during navigations i.e when I change across the listing page and the individual editor pages.

@@ -216,14 +259,15 @@ const TopNav = ({
savedQueryId={currentAppState.savedQuery}
onSavedQueryIdChange={stateContainer.transitions.updateSavedQuery}
indexPatterns={indexPatterns}
screenTitle={vis.title}
screenTitle={vis.title.length ?? '' ? vis.title : 'New visualization'}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not just

Suggested change
screenTitle={vis.title.length ?? '' ? vis.title : 'New visualization'}
screenTitle={vis.title || 'New visualization'}

Copy link
Collaborator Author

@LDrago27 LDrago27 Aug 20, 2024

Choose a reason for hiding this comment

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

Will update it

@LDrago27 LDrago27 merged commit b3234dd into opensearch-project:main Aug 20, 2024
66 of 67 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 20, 2024
* Add Application Header for Visualize

Signed-off-by: Suchit Sahoo <[email protected]>

* Fix Application Header Layout for Discover

Signed-off-by: Suchit Sahoo <[email protected]>

* Changeset file for PR #7712 created/updated

* Add new Page Header in Vis Builder

Signed-off-by: Suchit Sahoo <[email protected]>

---------

Signed-off-by: Suchit Sahoo <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit b3234dd)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
LDrago27 pushed a commit that referenced this pull request Aug 21, 2024
* Add Application Header for Visualize

* Fix Application Header Layout for Discover

* Changeset file for PR #7712 created/updated

* Add new Page Header in Vis Builder

---------

(cherry picked from commit b3234dd)

Signed-off-by: Suchit Sahoo <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants