Skip to content

Commit 7f98709

Browse files
authored
fix: fixes an issue where the new feedback button on the config strategy pane (#9638)
1 parent f97924e commit 7f98709

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

frontend/src/component/feature/FeatureStrategy/FeatureStrategyMenu/FeatureStrategyMenu.tsx

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,16 @@ interface IFeatureStrategyMenuProps {
3333
matchWidth?: boolean;
3434
size?: IPermissionButtonProps['size'];
3535
disableReason?: string;
36+
allowReleasePlanFeedback?: boolean;
3637
}
3738

3839
const StyledStrategyMenu = styled('div')(({ theme }) => ({
3940
flexShrink: 0,
4041
display: 'flex',
41-
width: '100%',
4242
flexFlow: 'row',
43+
flex: 1,
44+
justifyContent: 'flex-end',
4345
gap: theme.spacing(1),
44-
'& > :nth-child(2)': {
45-
marginLeft: 'auto',
46-
},
4746
}));
4847

4948
const StyledAdditionalMenuButton = styled(PermissionButton)(({ theme }) => ({
@@ -62,6 +61,10 @@ const StyledLink = styled(Link<typeof RouterLink | 'a'>)(({ theme }) => ({
6261
textDecoration: 'none',
6362
}));
6463

64+
const Spacer = styled('div')(({ theme }) => ({
65+
flex: 1,
66+
}));
67+
6568
export const FeatureStrategyMenu = ({
6669
label,
6770
projectId,
@@ -71,6 +74,7 @@ export const FeatureStrategyMenu = ({
7174
size,
7275
matchWidth,
7376
disableReason,
77+
allowReleasePlanFeedback = false,
7478
}: IFeatureStrategyMenuProps) => {
7579
const [anchor, setAnchor] = useState<Element>();
7680
const [onlyReleasePlans, setOnlyReleasePlans] = useState<boolean>(false);
@@ -177,15 +181,20 @@ export const FeatureStrategyMenu = ({
177181
<StyledStrategyMenu onClick={(event) => event.stopPropagation()}>
178182
{displayReleasePlanButton ? (
179183
<>
180-
<StyledLink
181-
component='a'
182-
href={RELEASE_TEMPLATE_FEEDBACK}
183-
underline='hover'
184-
rel='noopener noreferrer'
185-
target='_blank'
186-
>
187-
Give feedback to release templates
188-
</StyledLink>
184+
{allowReleasePlanFeedback ? (
185+
<>
186+
<StyledLink
187+
component='a'
188+
href={RELEASE_TEMPLATE_FEEDBACK}
189+
underline='hover'
190+
rel='noopener noreferrer'
191+
target='_blank'
192+
>
193+
Give feedback to release templates
194+
</StyledLink>
195+
<Spacer />
196+
</>
197+
) : null}
189198
<PermissionButton
190199
data-testid='ADD_TEMPLATE_BUTTON'
191200
permission={CREATE_FEATURE_STRATEGY}

frontend/src/component/feature/FeatureView/FeatureOverview/FeatureOverviewEnvironments/FeatureOverviewEnvironment/FeatureOverviewEnvironment.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ const NewStyledAccordionDetails = styled(AccordionDetails)(({ theme }) => ({
4343
const StyledAccordionFooter = styled('footer')(({ theme }) => ({
4444
padding: theme.spacing(2, 3, 3),
4545
display: 'flex',
46-
flexDirection: 'column',
47-
alignItems: 'flex-end',
46+
flexDirection: 'row',
47+
justifyContent: 'end',
4848
gap: theme.spacing(2),
4949
}));
5050

@@ -131,6 +131,7 @@ export const FeatureOverviewEnvironment = ({
131131
projectId={projectId}
132132
featureId={featureId}
133133
environmentId={environment.name}
134+
allowReleasePlanFeedback={true}
134135
/>
135136
{isOss() && environment?.type === 'production' ? (
136137
<UpgradeChangeRequests />

0 commit comments

Comments
 (0)