mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-04 13:48:56 +02:00
feat: start showing CR id in UI and make it clickable (#10259)

This commit is contained in:
parent
d573e04536
commit
0e5080fac5
@ -5,6 +5,7 @@ import { formatDateYMDHMS } from 'utils/formatDate';
|
|||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { styled } from '@mui/material';
|
import { styled } from '@mui/material';
|
||||||
import type { EventSchema } from 'openapi';
|
import type { EventSchema } from 'openapi';
|
||||||
|
import { useUiFlag } from 'hooks/useUiFlag';
|
||||||
|
|
||||||
interface IEventCardProps {
|
interface IEventCardProps {
|
||||||
entry: EventSchema;
|
entry: EventSchema;
|
||||||
@ -72,6 +73,7 @@ export const StyledCodeSection = styled('div')(({ theme }) => ({
|
|||||||
|
|
||||||
const EventCard = ({ entry }: IEventCardProps) => {
|
const EventCard = ({ entry }: IEventCardProps) => {
|
||||||
const { locationSettings } = useLocationSettings();
|
const { locationSettings } = useLocationSettings();
|
||||||
|
const eventGroupingEnabled = useUiFlag('eventGrouping');
|
||||||
|
|
||||||
const createdAtFormatted = formatDateYMDHMS(
|
const createdAtFormatted = formatDateYMDHMS(
|
||||||
entry.createdAt,
|
entry.createdAt,
|
||||||
@ -138,6 +140,26 @@ const EventCard = ({ entry }: IEventCardProps) => {
|
|||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
<ConditionallyRender
|
||||||
|
condition={
|
||||||
|
eventGroupingEnabled &&
|
||||||
|
Boolean(entry.data?.changeRequestId)
|
||||||
|
}
|
||||||
|
show={
|
||||||
|
<>
|
||||||
|
<StyledDefinitionTerm>
|
||||||
|
Change request id:
|
||||||
|
</StyledDefinitionTerm>
|
||||||
|
<dd>
|
||||||
|
<Link
|
||||||
|
to={`/projects/${entry.project}/change-requests/${entry.data?.changeRequestId}`}
|
||||||
|
>
|
||||||
|
{String(entry.data?.changeRequestId)}
|
||||||
|
</Link>
|
||||||
|
</dd>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
</dl>
|
</dl>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={Boolean(entry.data || entry.preData)}
|
condition={Boolean(entry.data || entry.preData)}
|
||||||
|
@ -93,6 +93,7 @@ export type UiFlags = {
|
|||||||
impactMetrics?: boolean;
|
impactMetrics?: boolean;
|
||||||
crDiffView?: boolean;
|
crDiffView?: boolean;
|
||||||
changeRequestApproverEmails?: boolean;
|
changeRequestApproverEmails?: boolean;
|
||||||
|
eventGrouping?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IVersionInfo {
|
export interface IVersionInfo {
|
||||||
|
@ -62,7 +62,8 @@ export type IFlagKey =
|
|||||||
| 'createFlagDialogCache'
|
| 'createFlagDialogCache'
|
||||||
| 'improvedJsonDiff'
|
| 'improvedJsonDiff'
|
||||||
| 'crDiffView'
|
| 'crDiffView'
|
||||||
| 'changeRequestApproverEmails';
|
| 'changeRequestApproverEmails'
|
||||||
|
| 'eventGrouping';
|
||||||
|
|
||||||
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
|
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
|
||||||
|
|
||||||
@ -291,6 +292,10 @@ const flags: IFlags = {
|
|||||||
process.env.UNLEASH_EXPERIMENTAL_IMPACT_METRICS,
|
process.env.UNLEASH_EXPERIMENTAL_IMPACT_METRICS,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
|
eventGrouping: parseEnvVarBoolean(
|
||||||
|
process.env.UNLEASH_EXPERIMENTAL_EVENT_GROUPING,
|
||||||
|
false,
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
export const defaultExperimentalOptions: IExperimentalOptions = {
|
export const defaultExperimentalOptions: IExperimentalOptions = {
|
||||||
|
@ -58,6 +58,7 @@ process.nextTick(async () => {
|
|||||||
improvedJsonDiff: true,
|
improvedJsonDiff: true,
|
||||||
impactMetrics: true,
|
impactMetrics: true,
|
||||||
crDiffView: true,
|
crDiffView: true,
|
||||||
|
eventGrouping: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
authentication: {
|
authentication: {
|
||||||
|
Loading…
Reference in New Issue
Block a user