1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-10-13 11:17:26 +02:00
unleash.unleash/frontend/src/component
Thomas Heartman d2e2378481
Show change request stage timestamps in UI (#10388)
Adds a timestamp for each state we have time (and that isn't a state
downstream from the current state) in the CR timeline.

<img width="437" height="318" alt="image"
src="https://github.com/user-attachments/assets/a499e73f-c506-46a0-8d1a-7e4eb5ec4f7d"
/>

The timestamp respects the user's preferred locale and uses the `time`
element.

I've used the current name of the API payload's timestamps as it stands
on the enterprise main branch for now. This name is not set in any
schemas yet, so it is likely to change. Because it's not currently
exposed to any users, that will not cause any issues. Name suggestions
are welcome if you have them.

We only show timestamps for states up to and including the current
state. Timestamps for downstream states (such as "approved" if you're in
the "in review" state), will not be shown, even if they exist in the
payload. (There are some decisions to make on whether to include these
in the payload at all or not.)

There's no flags in this PR. They're not necessary If the API payload
doesn't contain the timestamp, we just don't render the timestamp, and
the timeline looks the way it always did:
<img width="447" height="399" alt="image"
src="https://github.com/user-attachments/assets/0062393a-190c-4099-bc16-29f9da82e7ea"
/>


## Bonus work

In the `ChangeRequestTimeline.tsx` file, I've made a few extra changes:
- `createTimelineItem` and `createScheduledTimelineItem` have become
normal React components (`TimelineItem` and `ScheduledTimelineItem`) and
are being called as such (in accordance with [React
recommendations](https://react.dev/reference/rules/react-calls-components-and-hooks#never-call-component-functions-directly)).
- I've updated the subtitles for schedules to also use the time element,
to improve HTML structure.

## Outstanding work

There's a few things that still need to be sorted out (primarily with
UX). Mainly about how we handle scheduled items, which already have time
information. For now, it looks like this:

<img width="426" height="394" alt="image"
src="https://github.com/user-attachments/assets/4bfc4ca2-c738-4954-9251-8d063143371e"
/>

<img width="700" height="246" alt="image"
src="https://github.com/user-attachments/assets/fe688b08-c5c8-40f8-a9d0-fe455e44665f"
/>
2025-07-24 12:42:29 +00:00
..
admin fix: banner form state (#10397) 2025-07-23 08:36:48 +01:00
application chore(AI): registerFrontendClient flag cleanup (#10297) 2025-07-03 10:52:48 +02:00
archive chore: revive archive page (#10001) 2025-05-15 11:54:52 +01:00
banners feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
changeRequest Show change request stage timestamps in UI (#10388) 2025-07-24 12:42:29 +00:00
commandBar feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
common docs: update docs navigation (#9942) 2025-07-11 13:33:11 +02:00
context chore: disable delete button if a context field has usage (#10002) 2025-05-15 13:55:56 +02:00
counters/ExploreCounters feat: custom metrics (#10022) 2025-05-22 09:58:54 +02:00
demo chore: fix demo by adapting to new constraints flow (#10213) 2025-06-25 17:26:03 +01:00
environments chore: fix weird button styling (#10113) 2025-06-11 14:07:24 +02:00
events feat: add id as removable param for event list (#10289) 2025-07-03 09:27:01 +03:00
feature fix: add strategy release templates visibility for non Enterprise (#10401) 2025-07-23 20:17:22 +01:00
featureTypes chore: fix weird button styling (#10113) 2025-06-11 14:07:24 +02:00
feedback feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
feedbackNew feat: adjust feedback columns (#10119) 2025-06-11 15:50:26 +02:00
filter chore(ux): If there's only a single available filter, always show that filter (don't hide it beneath a filters button) (#10127) 2025-06-12 12:25:58 +00:00
impact-metrics refactor: impact metrics modal - label filtering and UX (#10377) 2025-07-22 10:08:29 +02:00
insights feat: basic flag creation chart (#10411) 2025-07-24 14:45:16 +03:00
integrations chore: hide/disallow new instances of deprecated integrations (#10104) 2025-06-10 12:19:37 +02:00
layout update 'config' icon (#10319) 2025-07-07 10:41:43 +02:00
loginHistory feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
maintenance
menu chore: unknown flags UI (#10332) 2025-07-08 17:51:03 +01:00
onboarding feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
personalDashboard chore(AI): healthToTechDebt flag cleanup (#10346) 2025-07-11 14:15:55 +02:00
playground/Playground chore(1-3832): clean up flag overview redesign (#10140) 2025-06-13 10:41:08 +00:00
project chore(AI): healthToTechDebt flag cleanup (#10346) 2025-07-11 14:15:55 +02:00
providers feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
releases Chore(1-3825)/remove legacy strategy separator (#10137) 2025-06-13 10:06:48 +00:00
segments chore(1-3842): don't reorder constraint properties / make id's non-optional (#10160) 2025-06-19 10:09:38 +02:00
signals feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
splash
strategies feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
tags chore: fix weird button styling (#10113) 2025-06-11 14:07:24 +02:00
unknownFlags chore: unknown flags UI (#10332) 2025-07-08 17:51:03 +01:00
user feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
App.tsx feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
InitialRedirect.tsx feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00