Skip to content

Custom Classes on Sidebar Items #888

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

Closed
wants to merge 1 commit into from
Closed

Custom Classes on Sidebar Items #888

wants to merge 1 commit into from

Conversation

tyler-mairose-sp
Copy link
Contributor

@tyler-mairose-sp tyler-mairose-sp commented Jul 15, 2024

Add the ability to customize the sidebar class names based upon custom api specification criteria. This is a code change to implement #858.

This code allows you to use the customProps option within the sidebarOptions to specify custom spec criteria to enable class names.

Where the key is the class name to add and the value is the criteria check which will evaluate to true or false.

{
    "sidebarOptions": {
        "groupPathsBy": "tag",
        "categoryLinkSource": "tag",
        "customProps": {
            "additionalClassChecks": {
                "menu__list-item--experimental": "!!item.api.parameters?.find(header => header.name === 'X-SailPoint-Experimental')"
            }
        }
    }
}

Feel free to change the names of variables or config items.

Description

Motivation and Context

#858.

How Has This Been Tested?

Tested in my local environment off of the latest main branch of this plugin.

Screenshots (if appropriate)

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@tyler-mairose-sp tyler-mairose-sp closed this by deleting the head repository Jul 21, 2024
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.

1 participant