diff --git a/frontend/cypress/integration/projects/notifications.spec.ts b/frontend/cypress/integration/projects/notifications.spec.ts index 223613b57f..8cd2bef1e3 100644 --- a/frontend/cypress/integration/projects/notifications.spec.ts +++ b/frontend/cypress/integration/projects/notifications.spec.ts @@ -15,7 +15,6 @@ describe('notifications', () => { cy.runBefore(); }); - // This one is failing on CI: https://github.com/Unleash/unleash/actions/runs/4609305167/jobs/8160244872#step:4:193 it.skip('should create a notification when a feature is created in a project', () => { cy.login_UI(); cy.createUser_API(userName, EDITOR).then(value => { @@ -41,7 +40,7 @@ describe('notifications', () => { cy.get("[data-testid='NOTIFICATIONS_BUTTON']").click(); //then - // cy.get("[data-testid='UNREAD_NOTIFICATIONS']").should('exist'); + cy.get("[data-testid='UNREAD_NOTIFICATIONS']").should('exist'); cy.get("[data-testid='NOTIFICATIONS_LIST']").should( 'contain.text', `New feature ${featureToggleName}` diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx index 0047c06518..93be11a0bf 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyCreate/FeatureStrategyCreate.tsx @@ -74,7 +74,7 @@ export const FeatureStrategyCreate = () => { forceRefreshCache(feature); ref.current = feature; } - }, [feature]); + }, [feature.name]); useEffect(() => { if (strategyDefinition) { diff --git a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsModal/EnvironmentVariantsModal.tsx b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsModal/EnvironmentVariantsModal.tsx index 7e46b3ca17..83058c7c43 100644 --- a/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsModal/EnvironmentVariantsModal.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants/EnvironmentVariantsModal/EnvironmentVariantsModal.tsx @@ -273,7 +273,13 @@ export const EnvironmentVariantsModal = ({ isChangeRequestConfigured(environment?.name || '') && uiConfig.flags.crOnVariants; - const stickiness = variants[0]?.stickiness || defaultStickiness; + const stickiness = useMemo(() => { + if (!loading) { + return variants[0]?.stickiness || defaultStickiness; + } + return ''; + }, [loading, defaultStickiness, JSON.stringify(variants[0] ?? {})]); + const stickinessOptions = useMemo( () => [ 'default', @@ -296,7 +302,7 @@ export const EnvironmentVariantsModal = ({ }; const onStickinessChange = (value: string) => { - updateStickiness(value).catch(console.warn); + updateStickiness(value); }; const [error, setError] = useState(); @@ -308,14 +314,13 @@ export const EnvironmentVariantsModal = ({ }, [apiPayload.error]); const handleClose = () => { - updateStickiness(defaultStickiness).then(); + updateStickiness(defaultStickiness); setOpen(false); }; if (loading || stickiness === '') { return ; } - return ( { - const projectId = useOptionalPathParam('projectId'); + const projectId = useRequiredPathParam('projectId'); const { defaultStickiness, loading } = useDefaultProjectSettings(projectId); const onUpdate = (field: string) => (newValue: string) => { diff --git a/frontend/src/component/feature/StrategyTypes/FlexibleStrategy/StickinessSelect/StickinessSelect.tsx b/frontend/src/component/feature/StrategyTypes/FlexibleStrategy/StickinessSelect/StickinessSelect.tsx index a857bacca5..8565e13fe7 100644 --- a/frontend/src/component/feature/StrategyTypes/FlexibleStrategy/StickinessSelect/StickinessSelect.tsx +++ b/frontend/src/component/feature/StrategyTypes/FlexibleStrategy/StickinessSelect/StickinessSelect.tsx @@ -41,7 +41,6 @@ export const StickinessSelect = ({ ); const stickinessOptions = resolveStickinessOptions(); - return (