-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
fix: Disable Edit constraint when context field was deleted #4460
fix: Disable Edit constraint when context field was deleted #4460
Conversation
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
const { contextName } = constraint; | ||
|
||
const disableEdit = !context | ||
.map(contextDefinition => contextDefinition.name) |
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.
.map(contextDefinition => contextDefinition.name) | |
.map(({name}) => name) |
Another concise way to do
@@ -3,6 +3,7 @@ import { IConstraint } from 'interfaces/strategy'; | |||
import { ConstraintAccordionViewHeaderInfo } from './ConstraintAccordionViewHeaderInfo'; | |||
import { ConstraintAccordionHeaderActions } from '../../ConstraintAccordionHeaderActions/ConstraintAccordionHeaderActions'; | |||
import { styled } from '@mui/system'; | |||
import useUnleashContext from '../../../../../hooks/api/getters/useUnleashContext/useUnleashContext'; |
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.
dots
@@ -34,6 +35,13 @@ export const ConstraintAccordionViewHeader = ({ | |||
expanded, | |||
compact, | |||
}: IConstraintAccordionViewHeaderProps) => { | |||
const { context } = useUnleashContext(); |
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.
we could create useContextFieldExists('name')
hook
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
…ld_was_deleted # Conflicts: # frontend/cypress/integration/import/import.spec.ts
Disable Edit constraint when context field was deleted
Closes: 1-1208