-
Notifications
You must be signed in to change notification settings - Fork 5.6k
feat: Add feature flag for gator permissions page #35307
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
70e375a
Add feature flag for gator permissions page
V00D00-child 711d380
Always make sure the feature flag is false
V00D00-child 6b86a49
Fix incorrect reset in afterEach test
V00D00-child 3e4bbd4
Fix lint error
V00D00-child 9684fbf
Fix lint errors in GatorPermissionsPage
V00D00-child 46ae01d
Add feature flag for gator permissions page
V00D00-child 1f3f43e
Always make sure the feature flag is false
V00D00-child fa633bc
Fix incorrect reset in afterEach test
V00D00-child 8fe9420
Fix lint error
V00D00-child 1c14355
Fix lint errors in GatorPermissionsPage
V00D00-child 88e22ac
Merge branch 'feat/add-gator-permissions-feature-flag' of github.com:…
V00D00-child f60c62e
Use string values for GATOR_PERMISSIONS_PAGE feature flag
V00D00-child 36e4b64
Expose isGatorPermissionsFeatureEnabled function in shared modules
V00D00-child 0fa6c81
Merge branch 'main' into feat/add-gator-permissions-feature-flag
V00D00-child 0715f7f
Merge branch 'main' into feat/add-gator-permissions-feature-flag
V00D00-child 2c0c795
Merge branch 'main' into feat/add-gator-permissions-feature-flag
V00D00-child e4ea8e2
Merge branch 'main' into feat/add-gator-permissions-feature-flag
V00D00-child 4378c40
Merge branch 'main' into feat/add-gator-permissions-feature-flag
V00D00-child File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import { ENVIRONMENT } from '../../development/build/constants'; | ||
| import { isProduction } from './environment'; | ||
| import { isGatorPermissionsFeatureEnabled, isProduction } from './environment'; | ||
|
|
||
| describe('isProduction', () => { | ||
| let originalMetaMaskEnvironment: string | undefined; | ||
|
|
@@ -27,3 +27,20 @@ describe('isProduction', () => { | |
| expect(isProduction()).toBe(false); | ||
| }); | ||
| }); | ||
|
|
||
| describe('isGatorPermissionsFeatureEnabled', () => { | ||
| it('should return true when GATOR_PERMISSIONS_ENABLED is "true"', () => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the expected behaviour for strings other than "true" or "false"? |
||
| process.env.GATOR_PERMISSIONS_ENABLED = 'true'; | ||
| expect(isGatorPermissionsFeatureEnabled()).toBe(true); | ||
| }); | ||
|
|
||
| it('should return false when GATOR_PERMISSIONS_ENABLED is "false"', () => { | ||
| process.env.GATOR_PERMISSIONS_ENABLED = 'false'; | ||
| expect(isGatorPermissionsFeatureEnabled()).toBe(false); | ||
| }); | ||
|
|
||
| it('should return false when GATOR_PERMISSIONS_ENABLED is undefined', () => { | ||
| delete process.env.GATOR_PERMISSIONS_ENABLED; | ||
| expect(isGatorPermissionsFeatureEnabled()).toBe(false); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
ui/components/multichain/pages/gator-permissions/gator-permissions-page.test.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import React from 'react'; | ||
| import { renderWithProvider } from '../../../../../test/lib/render-helpers'; | ||
| import { GatorPermissionsPage } from './gator-permissions-page'; | ||
|
|
||
| describe('Gator Permissions Page', () => { | ||
| describe('render', () => { | ||
| it('renders Gator Permissions page title', () => { | ||
| const { getByTestId } = renderWithProvider(<GatorPermissionsPage />); | ||
| expect(getByTestId('gator-permissions-page-title')).toBeInTheDocument(); | ||
| }); | ||
| }); | ||
| }); |
53 changes: 53 additions & 0 deletions
53
ui/components/multichain/pages/gator-permissions/gator-permissions-page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import React from 'react'; | ||
| import { useHistory } from 'react-router-dom'; | ||
| import { Header, Page } from '../page'; | ||
| import { | ||
| ButtonIcon, | ||
| ButtonIconSize, | ||
| IconName, | ||
| Text, | ||
| } from '../../../component-library'; | ||
| import { | ||
| IconColor, | ||
| BackgroundColor, | ||
| TextAlign, | ||
| TextVariant, | ||
| } from '../../../../helpers/constants/design-system'; | ||
| import { useI18nContext } from '../../../../hooks/useI18nContext'; | ||
| import { DEFAULT_ROUTE } from '../../../../helpers/constants/routes'; | ||
|
|
||
| export const GatorPermissionsPage = () => { | ||
| const t = useI18nContext(); | ||
| const history = useHistory(); | ||
|
|
||
| return ( | ||
| <Page | ||
| className="main-container" | ||
| data-testid="gator-permissions-page" | ||
| key="gator-permissions-page" | ||
| > | ||
| <Header | ||
| backgroundColor={BackgroundColor.backgroundDefault} | ||
| startAccessory={ | ||
| <ButtonIcon | ||
| ariaLabel={t('back')} | ||
| iconName={IconName.ArrowLeft} | ||
| className="connections-header__start-accessory" | ||
| color={IconColor.iconDefault} | ||
| onClick={() => history.push(DEFAULT_ROUTE)} | ||
| size={ButtonIconSize.Sm} | ||
| /> | ||
| } | ||
| > | ||
| <Text | ||
| as="span" | ||
| variant={TextVariant.headingMd} | ||
| textAlign={TextAlign.Center} | ||
| data-testid="gator-permissions-page-title" | ||
| > | ||
| Gator Permissions | ||
| </Text> | ||
| </Header> | ||
| </Page> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to duplicate the definition for flask build, rather than allowing the default to take precedence?