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

DOP-5134: Language selector #80

Merged
merged 3 commits into from
Nov 19, 2024
Merged

DOP-5134: Language selector #80

merged 3 commits into from
Nov 19, 2024

Conversation

mmeigs
Copy link
Collaborator

@mmeigs mmeigs commented Nov 19, 2024

Stories/Links:

DOP-5134

Notes:

Adds Language selector to UnifiedNav in redoc OpenAPI pages.

Sadly the consistent-nav does not export their types therefore we have a couple instances of git-ignore 😞
I tried to create mirrored types, but also oddly consistent-nav right now does not include ja-jp as a valid language. 😱

Most of this code is copied/slightly altered from Snooty's locale.js file.

Preprd example of it working!!

To build

To build locally and review, here are helpful steps:


Ensure Artifactory credentials are set up and set to NPM_BASE_64_AUTH and NPM_EMAIL env variables. This should be similar to the setup on Snooty. Below are the instructions to work with Redoc locally with custom MongoDB components, such as the Consistent Nav:

  1. checkout branch DOP-5133 in git
  2. In redoc/root folder of this fork, run npm install.
  3. In redoc/cli folder, run npm install.
  4. In redoc/cli folder, run: npm link ../ ../node_modules/react/ ../node_modules/styled-components/. This will link certain CLI dependencies to be compatible with the local instance and fork of Redoc.
  5. In redoc/root folder, run: npm run bundle. This will create bundled files needed by the CLI / needed to run the CLI.
  6. Run the following command to see a full example built into a local file called redoc-static.html in your root directory.
node cli/index.js build https://mongodb-mms-prod-build-server.s3.amazonaws.com/openapi/7f44860f3d20f152e7f187fe498a104aa7a9e3ba.json  --options options.json
  1. Once built, use your browser to view the static html by putting the path to that file in your browser as a url

Copy link
Collaborator

@rayangler rayangler left a comment

Choose a reason for hiding this comment

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

Works great on the pre-prod site! Just a few non-blocking nits just for the purpose of cleaning up

@mmeigs mmeigs merged commit db4ee80 into main Nov 19, 2024
2 checks passed
@mmeigs mmeigs deleted the DOP-5134-lang-select branch November 19, 2024 18:01
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.

2 participants