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

[DOCS] Fix interactions with versioning dropdown #9493

Merged
merged 12 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/docusaurus/docs/resources/get_support.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
sidebar_label: 'Get support'
title: 'Get support'
hide_table_of_contents: true
description: Learn what resources are available to help you resolve issues with GX Cloud and GX OSS.
---

Expand Down
8 changes: 4 additions & 4 deletions docs/docusaurus/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,16 @@ module.exports = {
repository: 'great_expectations',
},
{
type: 'doc',
label: 'Home',
docId: 'gx_welcome',
to: '/docs/home',
position: 'right',
className: 'non-versioned-section',
},
{
type: 'doc',
label: 'GX Cloud',
docId: 'cloud/gx_cloud_lp',
to: 'docs/cloud',
position: 'right',
className: 'non-versioned-section',
},
{
type: 'doc',
Expand Down
11 changes: 11 additions & 0 deletions docs/docusaurus/src/css/navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
box-shadow: unset;
height: unset;
padding: 0;

&:has(.non-versioned-section.navbar__link--active) {
.navbar__items .dropdown {
visibility: hidden;
}
}
}

.navbar__item {
Expand Down Expand Up @@ -86,6 +92,11 @@

.navbar__link--active {
border-bottom: 2px solid var(--ifm-color-primary);

&[href*="0.17"] {
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 added to prevent all three tabs (GX OSS, learn and api) from being selected at the samte in version 0.17. The source problem relies on a retrocompatibility problem due to extensive changes in docs structure from version 0.17 to 0.18 which will be solved by cutting this version out of the current project (similar to what has been done with version 0.16)

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think I understand. Looks like the links are still clickable, they just aren't styled like they are.

from being selected at the samte in version 0.17.
Was that supposed to say "at the same time"? Was there just something visually wrong?

I think this chunk of css might need to be fixed up or replaced with a different solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, they should be clickable, but the problem is that with the fix they're all highlighted at the same time because of the structure of the docs for version 0.17, which is all under a big folder of docs and has no subfolders for the different sections. What you say is correct this is just a visual workaround so it doesn't look weird to habe three tabs with an underline at once, the purpose of this change is to get rid of the underline only for this particular version and we should take this out if we go with the approach of having that version on its own link, as version 0.16 has now

Copy link
Contributor

Choose a reason for hiding this comment

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

Note to anyone else looking at this: I'm fine with this approach because it's an improvement, and archiving 0.17 later this week will make fully resolve the issue.

border-bottom: none;
color: var(--ifm-navbar-link-color);
}
}

.header-cloud-link {
Expand Down
10 changes: 10 additions & 0 deletions docs/docusaurus/src/theme/NavbarItem/DropdownNavbarItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import DropdownNavbarItem from '@theme-original/NavbarItem/DropdownNavbarItem';

export default function DropdownNavbarItemWrapper(props) {
return (
// The href is overwritten to prevent default redirect when clicking on the label of the dropdown
// With the new href the user will stay in the current page even if they click it
<DropdownNavbarItem {...props} href={'#'} />
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 href is added to prevent dropdown to redirect to inner link when clicked (it only should make a redirection when a version inside the dropdown options is clicked)

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I follow. What is the behavior with and without this change? And if we need this, do you mind throwing some comments in the code about this? I think this might be a source of confusion to future readers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can see the current behavior in https://docs.greatexpectations.io/docs/home/ by clicking the label of the dropdown (not one of the options but the label itself). It makes a weird redirect to why gx cloud page, so here I'm just overriding that behavior so that it stays on the current page. I think this it the simplest solution without having to change the actual implementation of the dropdown from docusaurus, as we're trying to keep that need as a minimum because it's not recommended by the documentation

Copy link
Member

Choose a reason for hiding this comment

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

I agree with @tyler-hoffman , what is the intent behavior if this href={"#"} I'm not familiarized with this approach.

Copy link
Contributor

Choose a reason for hiding this comment

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

@josectobar an href of just # means it's a url fragment. When it's not followed by an element id, it's a reference to the top of the page. So this basically hijacks the href to point to the current page, rather than the "why gx cloud" page that it otherwise defaults to. I did a tiny bit of looking to figure out why docusaurus defaults to that, and reported some intermediate findings here: https://greatexpectationslabs.slack.com/archives/C03B8DZCJ07/p1708537374187499.

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'm not able to see the message as I'm not part of the org 👀 could you paste that info here or send me an invite to join?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to see us figure out a better solution, but I'm okay with this in the short term!

);
}
36 changes: 36 additions & 0 deletions docs/docusaurus/versioned_docs/version-0.17/oss/oss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: 'GX OSS'
description: Get started with GX OSS and learn more about GX OSS features and functionality.
hide_table_of_contents: true
pagination_next: null
pagination_prev: null
displayed_sidebar: docs
---

import LinkCardGrid from '@site/src/components/LinkCardGrid';
import LinkCard from '@site/src/components/LinkCard';

<p class="DocItem__header-description">Test and validate your Data Assets with our open source offering.</p>

### Prepare

<LinkCardGrid>
<LinkCard topIcon label="Get started with GX OSS" description="This is a great place to start if you're unfamiliar with GX OSS, or you want to use GX OSS with Databricks or a SQL Data Source in a production environment." to="/guides/setup/get_started_lp" icon="/img/small_gx_logo.png" />
<LinkCard topIcon label="Configure your GX OSS environment" description="Set up GX OSS in your specific environment." to="/guides/setup/setup_overview_lp" icon="/img/small_gx_logo.png" />
<LinkCard topIcon label="Connect to source data" description="Connect to source data stored on databases and local filesystems, request data from a Data Source, organize Batches in a file-based Data Asset, and connect GX OSS to SQL tables and data returned by SQL database queries." to="/guides/connecting_to_your_data/connect_to_data_lp" icon="/img/small_gx_logo.png" />
<LinkCard topIcon label="Review the changelog" description="View a summary of all changes released to GX Cloud and GX OSS." to="/changelog" icon="/img/release_notes_icon.svg" />
</LinkCardGrid>

### Identify, validate, and integrate

<LinkCardGrid>
<LinkCard topIcon label="Create Expectations" description="Create and manage Expectations and Expectation Suites." to="/guides/expectations/expectations_lp" icon="/img/small_gx_logo.png" />
<LinkCard topIcon label="Validate Data" description="Validate Data, save Validation Results, run Actions, and create Data Docs." to="/guides/validation/validate_data_lp" icon="/img/small_gx_logo.png" />
<LinkCard topIcon label="Integrations" description="Integrate GX OSS with commonly used data engineering tools." to="/category/integrations" icon="/img/small_gx_logo.png" />
</LinkCardGrid>

### Contribute

<LinkCardGrid>
<LinkCard topIcon label="Contribute" description="Contribute to GX OSS documentation or code." to="/contributing/contributing" icon="/img/small_gx_logo.png" />
</LinkCardGrid>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
sidebar_label: 'Reference'
title: 'Reference'
id: reference_overview
description: Supplemental information that will help you get the most out of Great Expectations.
displayed_sidebar: docs
---

import LinkCardGrid from '@site/src/components/LinkCardGrid';
import LinkCard from '@site/src/components/LinkCard';

<p class="DocItem__header-description">This is where you'll find supplemental information that will help you get the most out of Great Expectations (GX).</p>

<LinkCardGrid>
<LinkCard topIcon label="Feature and code readiness" description="The readiness levels for GX features and code" to="/contributing/contributing_maturity" icon="/img/code_readiness_icon.svg" />
<LinkCard topIcon label="Usage statistics" description="Learn what usage statistics are collected and how they are used" to="/reference/usage_statistics" icon="/img/statistics_icon.svg" />
<LinkCard topIcon label="Expectation classes" description="An overview of the available Expectation classes, why they are helpful, and when they should be used" to="/conceptual_guides/expectation_classes" icon="/img/overview_icon.svg" />
<LinkCard topIcon label="API documentation" description="The GX API reference" to="/reference/api_reference" icon="/img/api_icon.svg" />
<LinkCard topIcon label="Glossary" description="An alphabetical list of GX terms and words with definitions" to="/glossary" icon="/img/glossary_icon.svg" />
</LinkCardGrid>
3 changes: 0 additions & 3 deletions docs/docusaurus/versioned_sidebars/version-0.18-sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,5 @@
"reference/learn/terms/validation_result"
]
}
],
"resources": [
"resources/get_support"
]
}