Skip to content

Allow adding 'locked' features to menu items and routes#25588

Merged
mcbattirola merged 28 commits intomasterfrom
mcbattirola/allow-locked-features
May 9, 2023
Merged

Allow adding 'locked' features to menu items and routes#25588
mcbattirola merged 28 commits intomasterfrom
mcbattirola/allow-locked-features

Conversation

@mcbattirola
Copy link
Copy Markdown
Contributor

@mcbattirola mcbattirola commented May 3, 2023

This PR adds a way to add "locked" features in the menu items.

This is used in https://github.com/gravitational/teleport.e/pull/1200, where we add a different version of a feature (a "preview") for customers without that feature enabled

@mcbattirola mcbattirola requested a review from kimlisa May 3, 2023 20:17
Comment thread web/packages/teleport/src/Main/Main.tsx Outdated
@mcbattirola mcbattirola marked this pull request as ready for review May 4, 2023 18:02
@github-actions github-actions Bot requested review from gzdunek and ryanclark May 4, 2023 18:02
@mcbattirola mcbattirola changed the title (wip) Allow adding 'locked' features to menu items and routes Allow adding 'locked' features to menu items and routes May 4, 2023
@mcbattirola mcbattirola requested a review from kimlisa May 5, 2023 14:31
Comment thread web/packages/teleport/src/types.ts Outdated
Comment thread web/packages/teleport/src/teleportContext.tsx Outdated
@mcbattirola mcbattirola requested a review from kimlisa May 8, 2023 14:02
Comment thread web/packages/teleport/src/Main/Main.tsx Outdated
Comment thread web/packages/teleport/src/Main/Main.tsx Outdated
Comment thread web/packages/teleport/src/Main/Main.tsx Outdated
Comment thread web/packages/teleport/src/Navigation/NavigationItem.tsx
mcbattirola and others added 3 commits May 8, 2023 11:57
Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>
Comment thread web/packages/teleport/src/Navigation/NavigationItem.tsx Outdated
Copy link
Copy Markdown
Contributor

@gzdunek gzdunek left a comment

Choose a reason for hiding this comment

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

With a minor change.

Comment thread web/packages/teleport/src/Navigation/NavigationItem.tsx Outdated
@mcbattirola mcbattirola enabled auto-merge May 9, 2023 11:16
@mcbattirola mcbattirola added this pull request to the merge queue May 9, 2023
mcbattirola added a commit that referenced this pull request May 9, 2023
* Add locked feature options

* Remove routes from items with locked parents

* Refactor to simplify features

* Add type for LockedFeatures

* Improve comment

* Fix call to isLockedAndUpdatedRouteAndNavigationItem wrong param

* Set locked features based on usage based billing

* Add back lockedRoute and list items

* Use simpler sintax

Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>

* Simplify isParentLocked

* Improve navigation item rendering

* Remove unucessary condition from if

* Prevent adding a route if the feature is locked

* Throw error instead of logging

* Improve if condition

---------

Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>
Merged via the queue into master with commit 23b7e46 May 9, 2023
@mcbattirola mcbattirola deleted the mcbattirola/allow-locked-features branch May 9, 2023 13:19
@public-teleport-github-review-bot
Copy link
Copy Markdown

@mcbattirola See the table below for backport results.

Branch Result
branch/v12 Create PR
branch/v13 Failed

hugoShaka pushed a commit that referenced this pull request May 9, 2023
* Add locked feature options

* Remove routes from items with locked parents

* Refactor to simplify features

* Add type for LockedFeatures

* Improve comment

* Fix call to isLockedAndUpdatedRouteAndNavigationItem wrong param

* Set locked features based on usage based billing

* Add back lockedRoute and list items

* Use simpler sintax

Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>

* Simplify isParentLocked

* Improve navigation item rendering

* Remove unucessary condition from if

* Prevent adding a route if the feature is locked

* Throw error instead of logging

* Improve if condition

---------

Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>
mcbattirola added a commit that referenced this pull request May 9, 2023
)

* Add locked feature options

* Remove routes from items with locked parents

* Refactor to simplify features

* Add type for LockedFeatures

* Improve comment

* Fix call to isLockedAndUpdatedRouteAndNavigationItem wrong param

* Set locked features based on usage based billing

* Add back lockedRoute and list items

* Use simpler sintax



* Simplify isParentLocked

* Improve navigation item rendering

* Remove unucessary condition from if

* Prevent adding a route if the feature is locked

* Throw error instead of logging

* Improve if condition

---------

Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>
mcbattirola added a commit that referenced this pull request May 9, 2023
* Add locked feature options

* Remove routes from items with locked parents

* Refactor to simplify features

* Add type for LockedFeatures

* Improve comment

* Fix call to isLockedAndUpdatedRouteAndNavigationItem wrong param

* Set locked features based on usage based billing

* Add back lockedRoute and list items

* Use simpler sintax

Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>

* Simplify isParentLocked

* Improve navigation item rendering

* Remove unucessary condition from if

* Prevent adding a route if the feature is locked

* Throw error instead of logging

* Improve if condition

---------

Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>
mcbattirola added a commit that referenced this pull request May 10, 2023
* Allow adding 'locked' features to menu items and routes (#25588)

* Add locked feature options

* Remove routes from items with locked parents

* Refactor to simplify features

* Add type for LockedFeatures

* Improve comment

* Fix call to isLockedAndUpdatedRouteAndNavigationItem wrong param

* Set locked features based on usage based billing

* Add back lockedRoute and list items

* Use simpler sintax

Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>

* Simplify isParentLocked

* Improve navigation item rendering

* Remove unucessary condition from if

* Prevent adding a route if the feature is locked

* Throw error instead of logging

* Improve if condition

---------

Co-authored-by: Grzegorz Zdunek <gzdunek@users.noreply.github.com>

* Allow adding locked features to menu items and routes

* Fix duplicated imports

* Remove blank line

---------

Co-authored-by: Grzegorz Zdunek <gzdunek@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