1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-15 01:16:22 +02:00

Merge branch 'main' into task/Add_strategy_information_to_playground_results

This commit is contained in:
andreas-unleash 2022-07-28 16:52:41 +03:00
commit cdaf7299be
13 changed files with 52 additions and 43 deletions

View File

@ -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}}

View File

@ -1,7 +1,7 @@
{
"name": "unleash-frontend",
"description": "unleash your features",
"version": "4.14.0-beta.6",
"version": "4.14.1",
"keywords": [
"unleash",
"feature toggle",

View File

@ -132,13 +132,7 @@ export const Group: VFC = () => {
align: 'center',
Cell: ({ row: { original: rowUser } }: any) => (
<ActionCell>
<Tooltip
title="Edit user"
arrow
placement="bottom-end"
describeChild
enterDelay={1000}
>
<Tooltip title="Edit user" arrow describeChild>
<IconButton
onClick={() => {
setSelectedUser(rowUser);
@ -151,9 +145,7 @@ export const Group: VFC = () => {
<Tooltip
title="Remove user from group"
arrow
placement="bottom-end"
describeChild
enterDelay={1000}
>
<IconButton
onClick={() => {

View File

@ -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<IGroupForm> = ({
users={users}
setUsers={setUsers}
/>
<GroupFormUsersTable
users={users}
setUsers={setUsers}
/>
<StyledGroupFormUsersTableWrapper>
<GroupFormUsersTable
users={users}
setUsers={setUsers}
/>
</StyledGroupFormUsersTableWrapper>
</>
}
/>

View File

@ -83,9 +83,7 @@ export const GroupFormUsersTable: VFC<IGroupFormUsersTableProps> = ({
<Tooltip
title="Remove user from group"
arrow
placement="bottom-end"
describeChild
enterDelay={1000}
>
<IconButton
onClick={() =>

View File

@ -102,11 +102,9 @@ export const GroupCard = ({ group }: IGroupCardProps) => {
))}
elseShow={
<Tooltip
title="This project is not used in any project"
title="This group is not used in any project"
arrow
placement="bottom-end"
describeChild
enterDelay={1000}
>
<Badge>Not used</Badge>
</Tooltip>

View File

@ -52,13 +52,7 @@ export const GroupCardActions: FC<IGroupCardActions> = ({
e.stopPropagation();
}}
>
<Tooltip
title="Group actions"
arrow
placement="bottom-end"
describeChild
enterDelay={1000}
>
<Tooltip title="Group actions" arrow describeChild>
<IconButton
id={id}
aria-controls={open ? menuId : undefined}

View File

@ -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%'}
</div>
);
}

View File

@ -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',
@ -96,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.
@ -104,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.
</PresetCard>

View File

@ -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<IPresetCardProps> = ({
title,
children,
Icon,
projectId,
environmentId,
onClick,
}) => (
<StyledCard variant="outlined">
@ -34,14 +40,18 @@ export const PresetCard: FC<IPresetCardProps> = ({
{children}
</Typography>
<Button
variant="outlined"
size="small"
sx={{ ml: 'auto', mt: 'auto' }}
onClick={onClick}
>
Use template
</Button>
<Box sx={{ ml: 'auto', mt: 'auto', pt: 1 }}>
<PermissionButton
permission={CREATE_FEATURE_STRATEGY}
projectId={projectId}
environmentId={environmentId}
variant="outlined"
size="small"
onClick={onClick}
>
Use template
</PermissionButton>
</Box>
</CardContent>
</StyledCard>
);

View File

@ -50,6 +50,7 @@ export const StrategyExecution = ({ strategy }: IStrategyExecutionProps) => {
sx={{ display: 'flex', alignItems: 'center' }}
>
<PercentageCircle
hideNumber
percentage={parseParameterNumber(
parameters[key]
)}

View File

@ -59,13 +59,7 @@ export const ActionsCell: VFC<IActionsCellProps> = ({
return (
<Box className={classes.cell}>
<Tooltip
title="Feature toggle actions"
arrow
placement="bottom-end"
describeChild
enterDelay={1000}
>
<Tooltip title="Feature toggle actions" arrow describeChild>
<IconButton
id={id}
aria-controls={open ? menuId : undefined}

View File

@ -23,6 +23,7 @@ import { sortTypes } from 'utils/sortTypes';
const StyledPageContent = styled(PageContent)(({ theme }) => ({
height: '100vh',
overflow: 'auto',
padding: theme.spacing(7.5, 6),
'& .header': {
padding: theme.spacing(0, 0, 2, 0),