AlaskaAirlines / AuroDocsSite

Repository for the management of the Auro doc site
https://auro.alaskaair.com/
0 stars 0 forks source link

fix: correct the broken dynamic link generation #259

Closed jason-capsule42 closed 1 month ago

jason-capsule42 commented 1 month ago

Alaska Airlines Pull Request

Summary:

fixes the broken dynamic links on several pages

Type of change:

Please delete options that are not relevant.

Checklist:

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!
-- Auro Design System Team

Summary by Sourcery

Bug Fixes:

sourcery-ai[bot] commented 1 month ago

Reviewer's Guide by Sourcery

This PR fixes broken dynamic link generation across multiple components by modifying the link renderer function. The changes include adding fallback text for links and correcting the href property access for external links.

Updated class diagram for link renderer function

classDiagram
    class MarkdownPageWrapper {
        +Renderer renderer
    }
    class Renderer {
        +link(href, title, text)
    }
    MarkdownPageWrapper --> Renderer
    note for Renderer "Updated link function to fix dynamic link generation"

    class AuroComponent {
        +Renderer renderer
    }
    class AuroContributing {
        +Renderer renderer
    }
    class AuroTokenList {
        +Renderer renderer
    }
    class RenderMarkdownPage {
        +Renderer renderer
    }

    MarkdownPageWrapper <|-- AuroComponent
    MarkdownPageWrapper <|-- AuroContributing
    MarkdownPageWrapper <|-- AuroTokenList
    MarkdownPageWrapper <|-- RenderMarkdownPage

    note for AuroComponent "Uses updated renderer"
    note for AuroContributing "Uses updated renderer"
    note for AuroTokenList "Uses updated renderer"
    note for RenderMarkdownPage "Uses updated renderer"

File-Level Changes

Change Details Files
Modified link renderer function to handle link text fallback
  • Added fallback for link text using href.text when text parameter is not provided
  • Added semicolons for consistent code style
  • Added newline for better code readability
src/content/dynamic/_template/component.js
src/content/dynamic/contributing/contributing.js
src/content/dynamic/contributing/dod.js
src/content/dynamic/tokenlist/component.js
src/functions/renderMarkdownPage.js
Fixed external link href property access
  • Changed href string access to href.href property access in external link generation
src/content/dynamic/_template/component.js
src/content/dynamic/contributing/contributing.js
src/content/dynamic/contributing/dod.js
src/content/dynamic/tokenlist/component.js
src/functions/renderMarkdownPage.js

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).