1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-23 00:22:19 +01:00
Commit Graph

3934 Commits

Author SHA1 Message Date
Thomas Heartman
2b668bc5c8
fix: open/close animation on personal dashboard is choppy (#9253)
Extracts each panel into its own component for the personal dashboard.
This lets us use separate states for each panel, which in turn lets each
panel change its open / close state without causing the other panels to
re-render.

When you have a lot of flags and/or projects, the list to render becomes
very long, which causes performance problems, especially when you need
to rerender both flags and projects and the timeline whenever one of
them changes.

The problems were especially noticeable in Firefox for me. Even with
this, the event timeline is a little choppy. I suspect that's because of
it might take a long time to paint? But we can look into that later.

Also updates the dashboard state hook to let you only pass in the
flags/projects you want. We could extract this into three different
hooks that all use the same localhost key, but I'm not sure whether
that's better or worse 🤷🏼
2025-02-10 10:40:26 +01:00
Nuno Góis
c07fb589a7
chore: add release management to new in unleash (#9257)
https://linear.app/unleash/issue/2-3244/add-release-management-to-new-in-unleash

Adds release management to "New in Unleash".


![image](https://github.com/user-attachments/assets/5bbfc502-f730-4cd4-bf5e-747f1fe9e773)
2025-02-07 14:33:25 +00:00
Nuno Góis
13ac0567c5
chore: make the milestone status a button (#9255)
https://linear.app/unleash/issue/2-3251/make-the-milestone-status-action-link-and-icon-a-proper-button-that

Makes the milestone status a button while trying to keep most of the
original design intact.


![image](https://github.com/user-attachments/assets/677cb9df-8ae2-4244-8d07-6cd2bd1da5fe)
2025-02-07 14:03:59 +00:00
Thomas Heartman
c02c5a4d47
fix(1-3296): don't navigate through the list on tab (#9259)
Prevents tab from navigating you through the list of results. Instead
makes it so that the tab key always takes you to the next item in the
same hierarchy.

As a bonus: also automatically closes the menu when you navigate
away (the previous implementation has a bug where it wouldn't if you
shift-tab).

The behavior of not letting you navigate the list with tab is
consistent with native HTML select elements as well as MUI select
elements. You typically navigate them with the arrow keys.
2025-02-07 14:58:05 +01:00
Thomas Heartman
4f30ce7155
chore(1-3349): no border for event timeline / dropdowns to the right (#9252)
Removes the border between the accordion summary and its contents for
the event timeline, and moves dropdown selectors to the right to avoid
overcrowding on the left.


![image](https://github.com/user-attachments/assets/b0df4c11-8e61-46f8-b844-349a709bd4e9)
2025-02-07 11:11:54 +01:00
Thomas Heartman
f9bd9d2d03
Adds a more visible focus indicator to the filter chips (#9251)
When the filter chip is focused, adds a 1px solid outline in the theme's
primary color. This makes it easier to tell when the chip has focused.

Additionally, adds a slight refactor in how we call the event log result
component. I'm pretty sure I've seen react docs say that you should
always use the component calling instead of a regular function call, so
this does that.

Before (the first chip has focus; can you tell?):

![image](https://github.com/user-attachments/assets/8fb4382c-9a38-4d77-acc2-35ae9fed1180)

After:

![image](https://github.com/user-attachments/assets/7f6969c3-059f-4c0f-bbfc-9a295adf4070)


Optionally, we could do something similar to on hover (first one has
focus again), but it's kinda subtle and .. I don't think it's a theme
color we have defined:

![image](https://github.com/user-attachments/assets/3fc10d34-858f-4007-9a80-06c4df2fc756)
2025-02-07 10:22:08 +01:00
Tymoteusz Czech
4e36d2285e
chore: remove sortProjectRoles flag (#9226) 2025-02-06 19:40:10 +01:00
Nuno Góis
21fb9a3118
chore: release management plausible events (#9230)
https://linear.app/unleash/issue/2-2834/plausible

Adds the following Plausible events to the Release management feature:
 - Add plan
 - Start milestone
 - Remove plan
 - Create template
 - Edit template
 - Delete template
2025-02-06 16:09:15 +00:00
David Leek
e689e2e3d2
feat: implement dialogs for changerequest milestone handling and removing release plans (#9240) 2025-02-06 16:45:24 +01:00
Thomas Heartman
61f8236711
chore: changes the panel title to "Event timeline" (#9245)
Keeps it consistent with the previous title for this component and
with what it's known as in the docs.
2025-02-06 15:30:27 +01:00
Thomas Heartman
56c9584bb6
feat: move timeline to panel (#9243)
Moves the event timeline to the personal dashboard from the header when
the `frontendHeaderRedesign` flag is active.

When the flag is active, it also:
- hides the event timeline and corresponding button in the header
- renders the environment selector next to the time selector instead of
at the other end of the header


![image](https://github.com/user-attachments/assets/cccd8f07-d42a-4180-807f-20937019442d)

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
2025-02-06 13:55:59 +00:00
Tymoteusz Czech
54e4fd2190
chore: remove lifecycle v2 flag (#9224) 2025-02-06 14:54:45 +01:00
Nuno Góis
4871cd57d1
chore: mark release management as an enterprise feature (#9229)
https://linear.app/unleash/issue/2-3093/sales-pitch-ui-for-release-management-to-show-non-enterprise-users

Marks Release Management as a premium Enterprise feature.

Once the `releasePlans` flag is enabled for everyone / removed, this is
what non-Enterprise users will see:


![image](https://github.com/user-attachments/assets/7191fb09-976e-4e14-8e2f-6db114b5e2ca)
2025-02-06 09:59:38 +00:00
Thomas Heartman
2ff385a4b6
fix(1-3295): fix broken skip link (#9239)
Fixes the issue where the skip link wouldn't take you to the main
content of the page anymore.

Also includes a few related minor semantic and a11y improvements:

1. The `main` element now only surrounds the actual main content of the
page. The sidebar is nav content and shouldn't be within it. The easiest
way to do this was to change the element that was previously a `main` to
a `div` and make the main content wrapper a `main` instead.
2. Makes the skip link target visible when focused. But invisible
otherwise. This has two benefits:
1. It's immediately obvious that using the skip link has worked. It
tells you that it's at the start of the main content.
2. Because the link now has text, it can be targeted by link search
(e.g. in Firefox, press `'` to search for links (I use this **a lot**)),
making it super easy to move your focus to the main content directly.
(Yes, landmark navigation should also work here, though, especially with
the `main` change).

The implementation of UI considerations of the skip link are based on
the CSS-tricks article [a deep dive on skipping to
content](https://css-tricks.com/a-deep-dive-on-skipping-to-content/)
from 2021.

Here's what it looks like when you skip to content:

![image](https://github.com/user-attachments/assets/c22819e6-f801-47d8-a9d9-908c250fd6ba)


When it doesn't have focus, it's invisible.
2025-02-06 10:21:56 +01:00
Nuno Góis
9fa7f5aa7b
chore: release plan changes in change request view (#9225)
https://linear.app/unleash/issue/2-3169/add-release-plan-ui-representation-in-change-request-ui

Adds visual representations for release plan change requests.

### Add release plan


![image](https://github.com/user-attachments/assets/8511c6a3-c83e-4eee-aa18-9affe4a9ac1d)

### Remove release plan


![image](https://github.com/user-attachments/assets/ed13f9ac-140c-40c9-a1a2-3c066c89c09a)

### Start milestone


![image](https://github.com/user-attachments/assets/ac8e5408-e877-470c-a98b-295b41444bfa)


![image](https://github.com/user-attachments/assets/abf19a55-89df-4dd8-8738-9dfcd63949b7)
2025-02-05 15:27:36 +00:00
Thomas Heartman
90e5adb695
chore: use union type for traffic search data (#9221)
Makes the data returned from the traffic search a union type to avoid
nasty object-is-undefined errors at runtime.

It requires more explicit handling, sure, but it means we don't need
to accept undefined.
2025-02-05 10:50:39 +00:00
Thomas Heartman
17a4099dbf
refactor: add functions to estimate monthly usage from data directly (#9219)
Adds new monthly estimation functions that operate on raw usage data
instead of chart data. This brings those methods in line with the rest
of the traffic calculation functions that we have in that file and means
we can remove other external dependencies.

 This is somewhat inspired by #9218, but not directly linked.
2025-02-05 11:12:17 +01:00
Thomas Heartman
543be6dede
chore(1-3342): extract into hook, use new endpoint if flag on (#9218)
Updates the existing BillingDetails pages (pro and payg) to use the new
traffic search endpoint (and calculations) if the flag to do so is on.
Otherwise, it falls back to using the existing method.

I've extracted the overage calculation into a separate shared hook.
2025-02-05 10:45:41 +01:00
Thomas Heartman
bd6a90ffd4
chore: add tests for new traffic usage functions (#9208)
This PR adds tests to all the TODOs created in
https://github.com/Unleash/unleash/pull/9191.

Additionally it finally manages to refactor the `toChartData` function.
2025-02-05 09:47:36 +01:00
Gastón Fournier
a4a5687687
feat: render markdown in toats (#9207)
## About the changes
Toasts sometimes render messages that are in markdown format. This
changes how we display them from

![image](https://github.com/user-attachments/assets/61930d1d-b54c-49a0-b982-af1484cd2981)
to this:
![Screenshot from 2025-02-04
15-23-36](https://github.com/user-attachments/assets/a569345c-abf5-4d9d-9cf6-4c94701689c7)
2025-02-04 16:35:25 +01:00
Gastón Fournier
ae65919f92
fix: license banner using message type (#9209)
## About the changes
Actually uses messageType and maps from warn to warning.
2025-02-04 15:14:47 +00:00
Thomas Heartman
c85c687816
chore(1-3335): filters data coming from the API to remove data points we're not interested in (#9205)
Implements a function that cleans and filters incoming data from the
new traffic API.

Specifically, it:
- Removes `/edge` data points
- Removes any data from before may 2024, which is the first full month
we have on record

Because all uses of the existing hook do this filtering themselves, I
have added the filtering at the hook level. This is to avoid
forgetting this filtering later. If we find out we need this data, we
can move the filtering.
2025-02-04 13:26:08 +01:00
Thomas Heartman
96dac84880
refactor: period selector component (#9202)
Refactors the period selector component now that the design / system is
pretty much finished.

Main points are: change from using CSS selectors to using styled
components; use props instead of classes. This is in keeping with the
general Unleash approach.

There's two very slight visual changes here:
1. There is 4px of added space below the "range" "header" text.
2. The months in the grid are a little closer together and not as wide.
This is because we remove the explicit column gap due to the grid having
a set width. Previously the width was automatic, but because we want
this to line up with the button, we need to set the width explicitly on
both items. As such, with the padding, the grid was a little too wide,
so there was too little padding on the right. This rectifies that.
2025-02-04 11:37:58 +01:00
Thomas Heartman
2980c0de4e
refactor(1-3336): useTrafficData / NetworkTrafficUsage.tsx cleanup (#9191)
This PR refactors the `NetworkTrafficUsage.tsx` and `useTrafficData`
files a bit.

The primary objective was to make the network traffic usage component
easier to work with, so I suggest to the reviewer that they start there.

Part of that refactoring, was taking things out of the useTraffic hook
that didn't need to be there. In the end, I'd removed so much that I
didn't even need the hook itself in the new component, so I switched
that to a regular useState.

It made more sense to me to put some of the functions inside the hook
into a separate file and import them directly (because they don't rely
on any hook state), so I have done that and removed those functions from
the trafficData hook. In this case, I also moved the tests.

I have not added any new tests in this PR, but will do so in a
follow-up. The functions I intend to test have been marked as such.
2025-02-04 10:32:59 +01:00
Tymoteusz Czech
c1e41b2b05
fix: users groups table columns on small screens (#9194)
On page "edit users for group", prevent user names and avatars form
disappearing on devices with small screen.
2025-02-04 10:19:40 +01:00
Mateusz Kwasniewski
c68a542a63
refactor: project users virtual autocomplete (#9196) 2025-02-04 10:04:36 +01:00
Melinda Fekete
ef8191c68d
Update API tokens and client keys pages (#9143) 2025-02-04 09:32:32 +01:00
Mateusz Kwasniewski
c86ea091b7
feat: virtual autocomplete (#9181) 2025-02-03 16:07:24 +01:00
Gastón Fournier
b9aa554b0d
feat: ability to communicate other license messages (#9192)
## About the changes
This gives us the ability to communicate other license messages which
are not errors. By default they'll be warning but I'm opening the
possibility of using a backend-provided value to make them informative
instead of warning.

The intention is to communicate things like:
- Your license is about to expire in x days.
- You are getting close to the maximum number of seats in your license
- etc
2025-02-03 15:17:06 +01:00
Thomas Heartman
fd1ad31bb5
fix: make traffic usage test more robust by using this month's actual numbers (#9193)
The test was breaking because it assumed a month would have at least
30 days.

Because the test relies on the current month, this isn't necessarily
true.

Further, there's parts of the code that relies on "impure" state via
the "current date" (which will change based on when you run it), so
setting a specific month in the test won't work.

As such, this test makes the calculation explicit and uses the number
of days in the current month.
2025-02-03 13:29:07 +00:00
Thomas Heartman
bd12cfce7c
fix(1-3334): re-align the dropdown menu with the dropdown (#9188)
Makes it so that the dropdown menu sits below the dropdown button,
rather than being offset to the end of the containing flexbox.

The issue was caused by the surrounding container being a flexbox.
This caused the popover anchor to grow to the full height of the box,
making the menu look offset.

By using `align-items: start`, we get around this.

Before

![image](https://github.com/user-attachments/assets/0f044627-05a3-4225-9a25-b20393c40158)


After:

![image](https://github.com/user-attachments/assets/9a6d1d7f-7f18-48d3-abdf-f4bb7c02ba68)
2025-02-03 11:00:15 +01:00
Thomas Heartman
e72a7c1197
chore(1-3316): update request info boxes to new design (#9180)
Updates the existing number of requests and overage info boxes to the
new design.

The existing versions of the boxes had some issues on narrower screens,
so it was easier to just leave them as is and start from scratch.

The previous boxes on narrow screens:

![image](https://github.com/user-attachments/assets/f3efa00d-ac0d-41ed-82d8-11766e043cb5)


The current ones (from wide to narrower):
Wide

![image](https://github.com/user-attachments/assets/0a48c013-afcd-4652-9229-0fca19a83733)

Mid (the text should probably ideally wrap at the same time here, but
I'm not sure how at the moment)

![image](https://github.com/user-attachments/assets/2ea3a672-80a6-4445-ae90-736c91c6e88e)

Narrow

![image](https://github.com/user-attachments/assets/03e3de0e-23c1-436a-8f6c-4c78cd4fdae7)

Extra narrow:

![image](https://github.com/user-attachments/assets/652c0c3b-71b1-4b2e-9e86-217f0c827aa6)



There's still some work we **could** do, but we should have UX have a
look first. In particular, it's about how the text wraps in certain
places etc, but I think it's good enough for now.

I'll come back with tests for the calculations and some refactoring and
cleanup in a followup.
2025-01-31 14:05:36 +01:00
Nuno Góis
25e8f80f21
chore: drag to reorder release plan template milestones (#9176)
https://linear.app/unleash/issue/2-2821/drag-to-reorder-template-milestones

This PR introduces reordering release plan template milestones by
dragging and dropping them.

Was a bit undecided on the approach, but it seems like using an old
`useDragItem` hook we have is pretty elegant and behaves as expected.

I suggest reviewers try it out themselves.

Includes a slight refactor to `useDragItem`, which so far is only used
here and in environments. I manually tested, but I suggest trying that
one out as well just in case.


![image](https://github.com/user-attachments/assets/3e433f70-53f8-4860-a704-60361f3b0ed7)
2025-01-31 09:12:27 +00:00
Mateusz Kwasniewski
ec014c0fdf
feat: limit user filter options (#9179) 2025-01-31 10:09:29 +01:00
David Leek
b04079c82d
feat: send the add release plan change request from dialog when submitted (#9174) 2025-01-30 10:56:31 +01:00
Nuno Góis
91d318a495
chore: add hint to release plan template gradual rollout strategy groupId (#9171)
https://linear.app/unleash/issue/2-3101/ui-hint-for-gradual-rollout-groupid-magic-string-featurename

Explains the current release plan milestone gradual rollout strategy
groupId behavior with an HelpIcon and a tooltip next to the field, when
creating or editing a release plan template.


![image](https://github.com/user-attachments/assets/46f3d943-d9cf-4670-b05b-322c14401a19)
2025-01-29 15:39:02 +00:00
Thomas Heartman
08c016b755
chore: minor button style adjustments (#9170)
Make it look more like a dropdown
2025-01-29 15:43:10 +01:00
Thomas Heartman
f4556839c8
feat(1-3281): wraps the new datepicker in a dropdown (#9169)
Wraps the datepicker in a popover, making it function largely the same
as a dropdown list.

The dropdown displays one of:
- "current month" if you've selected the current month
- "<month> <year>" (e.g. "December 2024") if you've selected a month
that isn't the current month
- "Last n months" (e.g. "Last 3 months") if you have selected a range

Additionally, the range selections have been updated to span the whole
row, aligning with the look of generic dropdown lists.


![image](https://github.com/user-attachments/assets/d356aec5-d51b-42fa-9591-60e2b5038a8e)

Like with the rest of this file (`PeriodSelector`), the code is rough
and not according to Unleash standards. However, I'm prioritizing fast
changes so UX can have a look before I clean up the code to switch to
using styled components etc later. It's still behind a flag, so I'm not
very worried about it.
2025-01-29 15:29:30 +01:00
Thomas Heartman
7ca8cc2276
fix: dynamic highlight width (#9166)
This makes the width of the highlight bars in the network dynamic and
based on the number of labels included in the chart.

Since the number of labels should always correspond to the number of
data points, this seems like a sensible approach.

With this, the label width will now be calculated on the fly, so even if
you resize the window or change the number of labels, the highlighting
will still work as expected.

Daily view:

![image](https://github.com/user-attachments/assets/e1d158db-0587-46b3-afb1-76dfc523505d)

Monthly aggregate:

![image](https://github.com/user-attachments/assets/8c74d2a3-afc8-4623-8ac7-0c263c7e6037)

The labels are now a little narrower on the daily graphs, but it avoids
them being super wide on the monthly graphs
2025-01-29 12:03:31 +01:00
Thomas Heartman
87a84426ec
feat(1-3267): use new API for chart creation (#9149)
Adds support for the new /traffic-search API behind a flag. When active, you'll be able to select month ranges as well as specific single months.

Largely copies the existing network traffic component, and adds some minor tweaks to make it work with the new data.

This is quite rough, but it gives us a base to build on for later. There's still things that we need to solve for in following PRs.
2025-01-29 10:43:41 +01:00
Thomas Heartman
d0fa929847
chore(1-3267): add orval schemas for the new API endpoint (#9164)
Adds Orval schemas for the new API enpdoint to display monthly/daily
traffic data usage.
2025-01-29 09:11:29 +01:00
Fredrik Strand Oseberg
18857c8992
fix: commandbar colors (#9162)
Searchbar should be white when the new header is active.
2025-01-28 14:48:15 +01:00
Fredrik Strand Oseberg
1fba4e10d1
fix: tabs not growing to fill all available space (#9161)
Fix an issue where tabs would fill out all available space, now it's
left aligned.
2025-01-28 14:17:02 +01:00
Fredrik Strand Oseberg
378bbe5133
feat: configurable global font size (#9155)
This PR sets up the application to accept a value from a variant we
control to set the font size of the application on a global level. If it
fails, the value falls back to the previously set CSS value.
2025-01-27 14:43:32 +01:00
David Leek
7aefc573dc
feat: show a dialog when adding a release plan to a change request enabled feature environment (#9139) 2025-01-23 13:48:44 +01:00
David Leek
09872ae760
chore: create the releasePlanChangeRequests feature flag (#9126) 2025-01-21 14:26:22 +01:00
Thomas Heartman
e4eab4587c
fix: add a hover color for buttons in the period selectors. (#9125)
Adds the same hover color as for the sidebar. Also adds a transition
animation.
2025-01-21 13:23:07 +01:00
Thomas Heartman
5846952d7c
fix: specify colors for buttons (#9124)
Fixes an issue where the buttons would be illegible in dark mode
because we don't set the color explicitly. It just happened to work in
light mode.
2025-01-21 12:51:20 +01:00
Thomas Heartman
857c91b803
feat(1-3262): initial impl of new month/range picker (#9122)
This PR implements a first version of the new month/range picker for the
data usage graphs. It's minimally hooked up to the existing
functionality to not take anything away.

This primary purpose of this PR is to get the design and interaction out
on sandbox so that UX can have a look and we can make adjustments.

As such, there are a few things in the code that we'll want to clean up
before removing the flag later:
- for faster iteration, I've used a lot of CSS nesting and element
selectors. this isn't usually how we do it here, so we'll probably want
to extract into styled components later
- there is a temporary override of the value in the period selector so
that you can select ranges. It won't affect the chart state, but it
affects the selector state. Again, this lets you see how it acts and
works.
- I've added a `NewHeader` component because the existing setup smushed
the selector (it's a MUI grid setup, which isn't very flexible). I don't
know what we want to do with this in the end, but the existing chart
*does* have some problems when you resize your window, at least
(although this is likely due to the chart, and can be solved in the same
way that we did for the personal dashboards).


![image](https://github.com/user-attachments/assets/f3ce3ff9-bab3-4d00-afbe-56f5624fbe16)
2025-01-21 12:15:43 +01:00
Tymoteusz Czech
08a28c99d6
fix: align project roles checkboxes (#9123)
Fix checkbox alignment and grouping
2025-01-21 10:34:20 +00:00