Skip to content

Commit

Permalink
chore: event timeline GA (#8552)
Browse files Browse the repository at this point in the history
https://linear.app/unleash/issue/2-2682/remove-feature-flag

https://linear.app/unleash/issue/2-2705/remove-experimental-tag-from-the-new-event-properties

https://linear.app/unleash/issue/2-2751/remove-the-beta-badge-for-event-timeline-in-new-in-unleash

Makes event timeline GA by tackling the respective tasks:

 - Remove `eventTimeline` feature flag
 - Remove `[Experimental]` tag from the new schema properties
 - No longer show the "beta" badge for this item in "New in Unleash"
  • Loading branch information
nunogois authored Oct 30, 2024
1 parent 65c7f77 commit 1add516
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/Condit
import { EventTimeline } from 'component/events/EventTimeline/EventTimeline';
import { useEventTimelineContext } from 'component/events/EventTimeline/EventTimelineContext';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { useUiFlag } from 'hooks/useUiFlag';
import { useEffect, useState } from 'react';

const StyledEventTimelineSlider = styled(Box)(({ theme }) => ({
Expand All @@ -21,10 +20,9 @@ const StyledEventTimelineWrapper = styled(Box)(({ theme }) => ({
export const MainLayoutEventTimeline = () => {
const { isOss } = useUiConfig();
const { open: showTimeline } = useEventTimelineContext();
const eventTimelineEnabled = useUiFlag('eventTimeline') && !isOss();
const [isInitialLoad, setIsInitialLoad] = useState(true);

const open = showTimeline && eventTimelineEnabled;
const open = showTimeline && !isOss();

useEffect(() => {
setIsInitialLoad(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export const NewInUnleash = ({
);
const { isOss, isEnterprise } = useUiConfig();
const signalsEnabled = useUiFlag('signals');
const eventTimelineEnabled = useUiFlag('eventTimeline');

const { setHighlighted } = useEventTimelineContext();

Expand Down Expand Up @@ -159,7 +158,7 @@ export const NewInUnleash = ({
},
docsLink:
'https://docs.getunleash.io/reference/events#event-timeline',
show: !isOss() && eventTimelineEnabled,
show: !isOss(),
longDescription: (
<>
<p>
Expand All @@ -174,7 +173,6 @@ export const NewInUnleash = ({
</p>
</>
),
beta: true,
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import LinearScaleIcon from '@mui/icons-material/LinearScale';
import { useEventTimelineContext } from 'component/events/EventTimeline/EventTimelineContext';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
import { useUiFlag } from 'hooks/useUiFlag';

const StyledHeaderEventTimelineButton = styled(IconButton, {
shouldForwardProp: (prop) => prop !== 'highlighted',
Expand Down Expand Up @@ -34,14 +33,13 @@ const StyledHeaderEventTimelineButton = styled(IconButton, {
export const HeaderEventTimelineButton = () => {
const { trackEvent } = usePlausibleTracker();
const { isOss } = useUiConfig();
const eventTimeline = useUiFlag('eventTimeline') && !isOss();
const {
open: showTimeline,
setOpen: setShowTimeline,
highlighted,
} = useEventTimelineContext();

if (!eventTimeline) return null;
if (isOss()) return null;

return (
<Tooltip
Expand Down
20 changes: 8 additions & 12 deletions src/lib/features/events/event-search-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,15 @@ export default class EventSearchController extends Controller {
}

enrichEvents(events: IEvent[]): IEvent[] | IEnrichedEvent[] {
if (this.flagResolver.isEnabled('eventTimeline')) {
return events.map((event) => {
const { label, text: summary } =
this.msgFormatter.format(event);
return events.map((event) => {
const { label, text: summary } = this.msgFormatter.format(event);

return {
...event,
label,
summary,
};
});
}
return events;
return {
...event,
label,
summary,
};
});
}

maybeAnonymiseEvents(events: IEvent[]): IEvent[] {
Expand Down
6 changes: 2 additions & 4 deletions src/lib/openapi/spec/event-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,12 @@ export const eventSchema = {
label: {
type: 'string',
nullable: true,
description:
'**[Experimental]** The concise, human-readable name of the event.',
description: 'The concise, human-readable name of the event.',
},
summary: {
type: 'string',
nullable: true,
description:
'**[Experimental]** A markdown-formatted summary of the event.',
description: 'A markdown-formatted summary of the event.',
},
},
components: {
Expand Down
5 changes: 0 additions & 5 deletions src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export type IFlagKey =
| 'removeUnsafeInlineStyleSrc'
| 'onboardingUI'
| 'projectRoleAssignment'
| 'eventTimeline'
| 'personalDashboardUI'
| 'trackLifecycleMetrics'
| 'purchaseAdditionalEnvironments'
Expand Down Expand Up @@ -263,10 +262,6 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_PROJECT_ROLE_ASSIGNMENT,
false,
),
eventTimeline: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_EVENT_TIMELINE,
false,
),
personalDashboardUI: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_PERSONAL_DASHBOARD_UI,
false,
Expand Down

0 comments on commit 1add516

Please sign in to comment.