mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-26 13:48:33 +02:00
chore: feedback link on feature strategy (#9633)
Adds a new link on the feature strategy that points to the feedback link (pops out new window, only renders if release plans are enabled)  --------- Co-authored-by: Gastón Fournier <gaston@getunleash.io>
This commit is contained in:
parent
53a4f61260
commit
b5e52a6160
@ -5,7 +5,7 @@ import PermissionButton, {
|
|||||||
type IPermissionButtonProps,
|
type IPermissionButtonProps,
|
||||||
} from 'component/common/PermissionButton/PermissionButton';
|
} from 'component/common/PermissionButton/PermissionButton';
|
||||||
import { CREATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions';
|
import { CREATE_FEATURE_STRATEGY } from 'component/providers/AccessProvider/permissions';
|
||||||
import { Popover, styled } from '@mui/material';
|
import { Popover, styled, Link } from '@mui/material';
|
||||||
import { FeatureStrategyMenuCards } from './FeatureStrategyMenuCards/FeatureStrategyMenuCards';
|
import { FeatureStrategyMenuCards } from './FeatureStrategyMenuCards/FeatureStrategyMenuCards';
|
||||||
import { formatCreateStrategyPath } from '../FeatureStrategyCreate/FeatureStrategyCreate';
|
import { formatCreateStrategyPath } from '../FeatureStrategyCreate/FeatureStrategyCreate';
|
||||||
import MoreVert from '@mui/icons-material/MoreVert';
|
import MoreVert from '@mui/icons-material/MoreVert';
|
||||||
@ -20,7 +20,9 @@ import { useReleasePlans } from 'hooks/api/getters/useReleasePlans/useReleasePla
|
|||||||
import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled';
|
import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled';
|
||||||
import { formatUnknownError } from 'utils/formatUnknownError';
|
import { formatUnknownError } from 'utils/formatUnknownError';
|
||||||
import { useUiFlag } from 'hooks/useUiFlag';
|
import { useUiFlag } from 'hooks/useUiFlag';
|
||||||
|
import type { Link as RouterLink } from 'react-router-dom';
|
||||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
||||||
|
import { RELEASE_TEMPLATE_FEEDBACK } from 'constants/links';
|
||||||
|
|
||||||
interface IFeatureStrategyMenuProps {
|
interface IFeatureStrategyMenuProps {
|
||||||
label: string;
|
label: string;
|
||||||
@ -36,8 +38,12 @@ interface IFeatureStrategyMenuProps {
|
|||||||
const StyledStrategyMenu = styled('div')(({ theme }) => ({
|
const StyledStrategyMenu = styled('div')(({ theme }) => ({
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
width: '100%',
|
||||||
flexFlow: 'row',
|
flexFlow: 'row',
|
||||||
gap: theme.spacing(1),
|
gap: theme.spacing(1),
|
||||||
|
'& > :nth-child(2)': {
|
||||||
|
marginLeft: 'auto',
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const StyledAdditionalMenuButton = styled(PermissionButton)(({ theme }) => ({
|
const StyledAdditionalMenuButton = styled(PermissionButton)(({ theme }) => ({
|
||||||
@ -47,6 +53,15 @@ const StyledAdditionalMenuButton = styled(PermissionButton)(({ theme }) => ({
|
|||||||
paddingBlock: 0,
|
paddingBlock: 0,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const StyledLink = styled(Link<typeof RouterLink | 'a'>)(({ theme }) => ({
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
gap: theme.spacing(1),
|
||||||
|
color: theme.palette.links,
|
||||||
|
fontWeight: theme.typography.fontWeightMedium,
|
||||||
|
textDecoration: 'none',
|
||||||
|
}));
|
||||||
|
|
||||||
export const FeatureStrategyMenu = ({
|
export const FeatureStrategyMenu = ({
|
||||||
label,
|
label,
|
||||||
projectId,
|
projectId,
|
||||||
@ -162,6 +177,15 @@ export const FeatureStrategyMenu = ({
|
|||||||
<StyledStrategyMenu onClick={(event) => event.stopPropagation()}>
|
<StyledStrategyMenu onClick={(event) => event.stopPropagation()}>
|
||||||
{displayReleasePlanButton ? (
|
{displayReleasePlanButton ? (
|
||||||
<>
|
<>
|
||||||
|
<StyledLink
|
||||||
|
component='a'
|
||||||
|
href={RELEASE_TEMPLATE_FEEDBACK}
|
||||||
|
underline='hover'
|
||||||
|
rel='noopener noreferrer'
|
||||||
|
target='_blank'
|
||||||
|
>
|
||||||
|
Give feedback to release templates
|
||||||
|
</StyledLink>
|
||||||
<PermissionButton
|
<PermissionButton
|
||||||
data-testid='ADD_TEMPLATE_BUTTON'
|
data-testid='ADD_TEMPLATE_BUTTON'
|
||||||
permission={CREATE_FEATURE_STRATEGY}
|
permission={CREATE_FEATURE_STRATEGY}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { styled } from '@mui/material';
|
import { styled } from '@mui/material';
|
||||||
import { Card } from 'component/common/Card/Card';
|
import { Card } from 'component/common/Card/Card';
|
||||||
|
import { RELEASE_TEMPLATE_FEEDBACK } from 'constants/links';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
const StyledCardLink = styled(Link)(({ theme }) => ({
|
const StyledCardLink = styled(Link)(({ theme }) => ({
|
||||||
@ -11,9 +12,6 @@ const StyledCardLink = styled(Link)(({ theme }) => ({
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const feedbackLink =
|
|
||||||
'https://docs.google.com/forms/d/1ElbScYxbAhFcjQWgRinifoymYHeuXzqIoQXfpUVYGR8/preview';
|
|
||||||
|
|
||||||
export const ReleasesFeedback: React.FC<{
|
export const ReleasesFeedback: React.FC<{
|
||||||
title: string;
|
title: string;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
@ -24,7 +22,7 @@ export const ReleasesFeedback: React.FC<{
|
|||||||
title={title}
|
title={title}
|
||||||
footer={
|
footer={
|
||||||
<StyledCardLink
|
<StyledCardLink
|
||||||
to={feedbackLink}
|
to={RELEASE_TEMPLATE_FEEDBACK}
|
||||||
target='_blank'
|
target='_blank'
|
||||||
rel='noreferrer'
|
rel='noreferrer'
|
||||||
>
|
>
|
||||||
|
4
frontend/src/constants/links.ts
Normal file
4
frontend/src/constants/links.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
// honestly there's no nice place for this in our folder structure and I really, really need this to change in one place
|
||||||
|
// might be deletable once we're done with the initial feedback phase
|
||||||
|
export const RELEASE_TEMPLATE_FEEDBACK =
|
||||||
|
'https://docs.google.com/forms/d/e/1FAIpQLSfbbqsz6wQSgTuJ0NO6ooykTGC_osrzB5-qMrQkbda9SRwnxg/viewform?usp=preview';
|
Loading…
Reference in New Issue
Block a user