From c79465e7d9ed9574fa4a42bae6001e4fde0a403d Mon Sep 17 00:00:00 2001 From: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com> Date: Thu, 28 Jul 2022 13:45:08 +0200 Subject: [PATCH 1/6] fix: refetch immutable toggle when adding strategy (#1164) --- .../component/common/PercentageCircle/PercentageCircle.tsx | 5 ++++- .../FeatureStrategyEmpty/FeatureStrategyEmpty.tsx | 7 +++++++ .../StrategyItem/StrategyExecution/StrategyExecution.tsx | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend/src/component/common/PercentageCircle/PercentageCircle.tsx b/frontend/src/component/common/PercentageCircle/PercentageCircle.tsx index ecf2b9948e..0a21250267 100644 --- a/frontend/src/component/common/PercentageCircle/PercentageCircle.tsx +++ b/frontend/src/component/common/PercentageCircle/PercentageCircle.tsx @@ -5,12 +5,14 @@ interface IPercentageCircleProps { percentage: number; secondaryPieColor?: string; className?: string; + hideNumber?: boolean; } const PercentageCircle = ({ styles, percentage, secondaryPieColor, + hideNumber, ...rest }: IPercentageCircleProps) => { const theme = useTheme(); @@ -35,9 +37,10 @@ const PercentageCircle = ({ display: 'flex', justifyContent: 'center', alignItems: 'center', + fontSize: '12px', }} > - 100% + {hideNumber ? null : '100%'} ); } diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/FeatureStrategyEmpty.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/FeatureStrategyEmpty.tsx index 060b9a6dc4..01d24e8cd1 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/FeatureStrategyEmpty.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/FeatureStrategyEmpty.tsx @@ -8,6 +8,7 @@ import { FeatureStrategyMenu } from '../FeatureStrategyMenu/FeatureStrategyMenu' import { PresetCard } from './PresetCard/PresetCard'; import { useStyles } from './FeatureStrategyEmpty.styles'; import { formatUnknownError } from 'utils/formatUnknownError'; +import { useFeatureImmutable } from 'hooks/api/getters/useFeature/useFeatureImmutable'; import { getFeatureStrategyIcon } from 'utils/strategyNames'; interface IFeatureStrategyEmptyProps { @@ -25,9 +26,15 @@ export const FeatureStrategyEmpty = ({ const { addStrategyToFeature } = useFeatureStrategyApi(); const { setToastData, setToastApiError } = useToast(); const { refetchFeature } = useFeature(projectId, featureId); + const { refetchFeature: refetchFeatureImmutable } = useFeatureImmutable( + projectId, + featureId + ); const onAfterAddStrategy = () => { refetchFeature(); + refetchFeatureImmutable(); + setToastData({ title: 'Strategy created', text: 'Successfully created strategy', diff --git a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyExecution/StrategyExecution.tsx b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyExecution/StrategyExecution.tsx index 804615d3fa..380ba8c3c4 100644 --- a/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyExecution/StrategyExecution.tsx +++ b/frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/EnvironmentAccordionBody/StrategyDraggableItem/StrategyItem/StrategyExecution/StrategyExecution.tsx @@ -50,6 +50,7 @@ export const StrategyExecution = ({ strategy }: IStrategyExecutionProps) => { sx={{ display: 'flex', alignItems: 'center' }} > Date: Thu, 28 Jul 2022 15:02:41 +0200 Subject: [PATCH 2/6] fix: add permission lock to quick strategy add (#1165) --- .../FeatureStrategyEmpty.tsx | 4 +++ .../PresetCard/PresetCard.tsx | 28 +++++++++++++------ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/FeatureStrategyEmpty.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/FeatureStrategyEmpty.tsx index 01d24e8cd1..2bd7481087 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/FeatureStrategyEmpty.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/FeatureStrategyEmpty.tsx @@ -103,6 +103,8 @@ export const FeatureStrategyEmpty = ({ title="Standard strategy" Icon={getFeatureStrategyIcon('default')} onClick={onAddSimpleStrategy} + projectId={projectId} + environmentId={environmentId} > The standard strategy is strictly on/off for your entire userbase. @@ -111,6 +113,8 @@ export const FeatureStrategyEmpty = ({ title="Gradual rollout" Icon={getFeatureStrategyIcon('flexibleRollout')} onClick={onAddGradualRolloutStrategy} + projectId={projectId} + environmentId={environmentId} > Roll out to a percentage of your userbase. diff --git a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/PresetCard/PresetCard.tsx b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/PresetCard/PresetCard.tsx index 345550d059..a6603fe019 100644 --- a/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/PresetCard/PresetCard.tsx +++ b/frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/PresetCard/PresetCard.tsx @@ -1,8 +1,12 @@ import { ElementType, FC } from 'react'; -import { Button, Card, CardContent, styled, Typography } from '@mui/material'; +import { Card, CardContent, Typography, styled, Box } from '@mui/material'; +import PermissionButton from 'component/common/PermissionButton/PermissionButton'; +import { CREATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions'; interface IPresetCardProps { title: string; + projectId: string; + environmentId: string; onClick: () => void; Icon: ElementType; } @@ -17,6 +21,8 @@ export const PresetCard: FC = ({ title, children, Icon, + projectId, + environmentId, onClick, }) => ( @@ -34,14 +40,18 @@ export const PresetCard: FC = ({ {children} - + + + Use template + + ); From 4e61cf22c0cb2ede08f4e848b0f9fa8d0754bf27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Thu, 28 Jul 2022 14:27:38 +0100 Subject: [PATCH 3/6] fix: small ui fixes related to groups and tooltips (#1167) --- .../src/component/admin/groups/Group/Group.tsx | 10 +--------- .../component/admin/groups/GroupForm/GroupForm.tsx | 14 ++++++++++---- .../GroupFormUsersTable/GroupFormUsersTable.tsx | 2 -- .../groups/GroupsList/GroupCard/GroupCard.tsx | 4 +--- .../GroupCardActions/GroupCardActions.tsx | 8 +------- .../ActionsCell/ActionsCell.tsx | 8 +------- .../ProjectGroupView/ProjectGroupView.tsx | 1 + 7 files changed, 15 insertions(+), 32 deletions(-) diff --git a/frontend/src/component/admin/groups/Group/Group.tsx b/frontend/src/component/admin/groups/Group/Group.tsx index f50bd58b92..d7ccb7d91c 100644 --- a/frontend/src/component/admin/groups/Group/Group.tsx +++ b/frontend/src/component/admin/groups/Group/Group.tsx @@ -132,13 +132,7 @@ export const Group: VFC = () => { align: 'center', Cell: ({ row: { original: rowUser } }: any) => ( - + { setSelectedUser(rowUser); @@ -151,9 +145,7 @@ export const Group: VFC = () => { { diff --git a/frontend/src/component/admin/groups/GroupForm/GroupForm.tsx b/frontend/src/component/admin/groups/GroupForm/GroupForm.tsx index 9a387b06fd..d5ef3190c3 100644 --- a/frontend/src/component/admin/groups/GroupForm/GroupForm.tsx +++ b/frontend/src/component/admin/groups/GroupForm/GroupForm.tsx @@ -24,6 +24,10 @@ const StyledInput = styled(Input)(({ theme }) => ({ marginBottom: theme.spacing(2), })); +const StyledGroupFormUsersTableWrapper = styled('div')(({ theme }) => ({ + marginBottom: theme.spacing(6), +})); + const StyledButtonContainer = styled('div')(() => ({ marginTop: 'auto', display: 'flex', @@ -101,10 +105,12 @@ export const GroupForm: FC = ({ users={users} setUsers={setUsers} /> - + + + } /> diff --git a/frontend/src/component/admin/groups/GroupForm/GroupFormUsersTable/GroupFormUsersTable.tsx b/frontend/src/component/admin/groups/GroupForm/GroupFormUsersTable/GroupFormUsersTable.tsx index abbfc907e5..b25d8cf80c 100644 --- a/frontend/src/component/admin/groups/GroupForm/GroupFormUsersTable/GroupFormUsersTable.tsx +++ b/frontend/src/component/admin/groups/GroupForm/GroupFormUsersTable/GroupFormUsersTable.tsx @@ -83,9 +83,7 @@ export const GroupFormUsersTable: VFC = ({ diff --git a/frontend/src/component/admin/groups/GroupsList/GroupCard/GroupCard.tsx b/frontend/src/component/admin/groups/GroupsList/GroupCard/GroupCard.tsx index 2f78c3e6bc..8373b42d2e 100644 --- a/frontend/src/component/admin/groups/GroupsList/GroupCard/GroupCard.tsx +++ b/frontend/src/component/admin/groups/GroupsList/GroupCard/GroupCard.tsx @@ -102,11 +102,9 @@ export const GroupCard = ({ group }: IGroupCardProps) => { ))} elseShow={ Not used diff --git a/frontend/src/component/admin/groups/GroupsList/GroupCard/GroupCardActions/GroupCardActions.tsx b/frontend/src/component/admin/groups/GroupsList/GroupCard/GroupCardActions/GroupCardActions.tsx index 24fc4db856..3106eb91ca 100644 --- a/frontend/src/component/admin/groups/GroupsList/GroupCard/GroupCardActions/GroupCardActions.tsx +++ b/frontend/src/component/admin/groups/GroupsList/GroupCard/GroupCardActions/GroupCardActions.tsx @@ -52,13 +52,7 @@ export const GroupCardActions: FC = ({ e.stopPropagation(); }} > - + = ({ return ( - + ({ height: '100vh', + overflow: 'auto', padding: theme.spacing(7.5, 6), '& .header': { padding: theme.spacing(0, 0, 2, 0), From 0f93743772ac3fa36b48761827b06fbc44bb2a48 Mon Sep 17 00:00:00 2001 From: Christopher Kolstad Date: Thu, 28 Jul 2022 15:28:52 +0200 Subject: [PATCH 4/6] 4.14.0 --- frontend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/package.json b/frontend/package.json index ae34a79117..df647e82ac 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "unleash-frontend", "description": "unleash your features", - "version": "4.14.0-beta.6", + "version": "4.14.0", "keywords": [ "unleash", "feature toggle", From ff6ef4ae5a232146783e2fb25777a8baf0089233 Mon Sep 17 00:00:00 2001 From: Christopher Kolstad Date: Thu, 28 Jul 2022 15:34:58 +0200 Subject: [PATCH 5/6] Update release changelog to flag prereleases properly --- frontend/.github/workflows/release_changelog.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/.github/workflows/release_changelog.yml b/frontend/.github/workflows/release_changelog.yml index 223175691a..52d02d0151 100644 --- a/frontend/.github/workflows/release_changelog.yml +++ b/frontend/.github/workflows/release_changelog.yml @@ -22,5 +22,6 @@ jobs: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} body: ${{ steps.github_release.outputs.changelog }} + prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}} From edb093f1ab8bac1769136d4ea5dc70a7e865710e Mon Sep 17 00:00:00 2001 From: Christopher Kolstad Date: Thu, 28 Jul 2022 15:35:50 +0200 Subject: [PATCH 6/6] 4.14.1 --- frontend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/package.json b/frontend/package.json index df647e82ac..eb1f9eae80 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "unleash-frontend", "description": "unleash your features", - "version": "4.14.0", + "version": "4.14.1", "keywords": [ "unleash", "feature toggle",