1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-12 01:17:04 +02:00
Commit Graph

3766 Commits

Author SHA1 Message Date
Thomas Heartman
a064672635
chore(1-3422): playground strategies list (#9504)
Initial rough work on adapting the playground strategies to the new
designs. This PR primarily splits components into Legacy files and adds
new replacements. There are *some* updates (including spacing and text
color), but nothing juicy yet. However, I wanted to get this in now,
before this PR grows even bigger.
2025-03-11 11:36:14 +01:00
Thomas Heartman
be57f9f8fd
chore: remove apitoken.username (#9448)
Removes usage of the deprecated API token property `username` and uses
`tokenName` instead.

Affected components:

Token table:

![image](https://github.com/user-attachments/assets/7275e9ae-a79c-4815-9f8d-157008480b97)


Token deletion dialog:

![image](https://github.com/user-attachments/assets/1c47cd3d-c7ff-4547-9779-eaba16274d1e)


Environment post-clone screen (which is automatically hidden now, so it
... doesn't matter)
2025-03-11 08:32:50 +01:00
Tymoteusz Czech
312adc0c1a
chore: remove granularAdminPermissions flag (#9467)
- removed a flag
- deprecated `POST /admin/ui-config` endpoint in favor of `POST
/admin/ui-config/cors`
2025-03-10 16:36:59 +01:00
Thomas Heartman
7dd89034aa
chore: use new designs for project default strategies (#9447)
Implements the new strategy list design for default strategies. Moves
the old impl into a legacy file. Also: removes the description from the
strategy item. From my digging, we only showed this for default strategy
items and it didn't really provide any useful information. The only
other place you can add a description is for custom strategies (at least
that I could find), but these are deprecated and we never show the
description when you apply the strategy anyway.

Rendered:

![image](https://github.com/user-attachments/assets/fb244f10-0a19-42f5-a517-090d6703c76a)

Without the flag (nothing changes):

![image](https://github.com/user-attachments/assets/62159338-8b26-4cb2-825d-e20965c6558d)
2025-03-10 16:09:32 +01:00
Thomas Heartman
23852afcdd
chore: Constrains custom strategy titles to a single line (#9469)
Constrains long custom strategy titles to a single line.

Before:

![image](https://github.com/user-attachments/assets/e00545db-bf95-4539-ac6e-557a8784ddd0)


After:

![image](https://github.com/user-attachments/assets/266bad74-77ba-4e59-8317-2d6b9d2333a7)
2025-03-10 14:09:05 +00:00
Thomas Heartman
51c9617da8
Fix: weird strategy spacing on envs without release plans (#9466)
Fixes a visual bug where envs without release plans would get too much
spacing on the top of their first strategy.

It does this flattening the list of strategies if there are no release
plans. In doing so, I have extracted the strategy list rendering into a
separate component (to make things more legible and re-usable) and have
also removed the FeatureStrategyEmpty component and marked it as
deprecated. In the new designs, you can't expand envs without
strategies, so the component is no longer needed.

Before (what looks like a shadow is actually the extra list being
rendered with a bit of padding):

![image](https://github.com/user-attachments/assets/5ba06ac9-046c-4fbd-8b46-b077b8a0570b)

After:

![image](https://github.com/user-attachments/assets/64270582-1221-4bdf-a85b-c24ce23bd4a3)
2025-03-10 14:49:26 +01:00
Mateusz Kwasniewski
3059d23446
feat: always show features table (#9446) 2025-03-10 10:19:36 +01:00
Mateusz Kwasniewski
6d02e33680
feat: rename api token column (#9445) 2025-03-10 10:16:36 +01:00
Thomas Heartman
220550071f
chore(1-3450): Place strategy names and titles on the same line (and fix list nesting issues) (#9443)
Moves strategy titles and names onto the same line, as per the new
designs.

In doing so, I've also updated the component to use a more semantic
hgroup with the header being the strategy title if it exists or the
strategy name if not.

The downside of being more semantically correct here is that we need to
know what header level we want the strategy to use. In most cases,
that's 3 (e.g. flag name > environment > strategy, release plan >
milestone > strategy), but for plans on flag envs, it's 4 (flag name >
env > milestone name > strategy).

I've also taken the opportunity to fix a little mistake I made earlier.
`ol`s can only have `li` children, and I'd forgotten to wrap a nested
`ol` inside an `li`. The changes in `EnvironmentAccordionBody` all
relate to that change. Because we now have several layers of lists
nested within each other, dealing with styling and padding gets a little
tricky, but CSS has the power do help us out here.

Rendered:

![image](https://github.com/user-attachments/assets/634615fe-b06d-4baa-8aa3-22447d1fb8b4)
2025-03-07 13:09:36 +01:00
Thomas Heartman
f6987909e7
Chore(1-3449): release plans in strategy env (#9441)
Use new design for release plans in flag environments.

- Move old ReleasePlanMilestone into Legacy file and update imports
- In the new version, use the same strategy list and item as in the
general strategy list and milestone template creation (components to be
extracted in the future)
- Fix an issue with the border being obscured by overflow by hiding
overflow


![image](https://github.com/user-attachments/assets/2258263d-aa96-4939-8af1-88236050cbd6)
2025-03-07 11:18:09 +01:00
Thomas Heartman
7db692e976
fix: Only show accrued traffic charges and estimated overages for the current month (#9440)
For past months, customers can refer to their invoices instead. Hiding
it when the selection is not the current month avoids weird things such
as estimation errors due to to a month not having finished (vs what it
actually *was* when it finished), potential changes in traffic package
pricing, etc.
2025-03-07 07:32:15 +00:00
Thomas Heartman
e5be1bf43e
Fix: drag and drop reverts to previous position on drop (#9439)
Fixes an issue where, when dragging large expanded milestone cards, the
position would revert from the current visual state to the previous one
when you drop the item.
2025-03-06 14:11:48 +00:00
Thomas Heartman
2e2bb9cf25
refactor: don't use absolute positioning for drag handle (#9434)
Avoids absolutely positioning the drag handle by instead creating a two
column grid where column 1 is the drag handle, column two is the
milestone card. The grid has a negative margin based on the padding of
the form container. I wanted to avoid modifying the form container
component (because we use it in so many places), so I used css variables
to store the information and hook into that further down the line.

Rendered:

Wide:


![image](https://github.com/user-attachments/assets/bb43b1b9-595b-475e-a59f-24ebf82df489)

Narrow:

![image](https://github.com/user-attachments/assets/344b9c6f-08e7-43ca-8a02-1b224ccdd2c8)

## Known bugs and limitations
The current drag implementation has some issues if you try to drag
something over a large, expanded card. They'll trade places visually,
but when you let go, the revert back to where they were. We can avoid
that by modifying the onDrop function in the drag handler, but I don't
want to do that before checking all the other places where we do drag
and drop ([linear
ticket](https://linear.app/unleash/issue/1-3458/drag-and-drop-is-a-little-finicky)).

I also want to get UX to sign off on this before making those changes.
2025-03-06 14:21:19 +01:00
Thomas Heartman
8629cda4d7
chore: remove dataUsageMultiMonthView flag (#9429)
Remove data usage multi month view flag and deprecated components and
functions.
2025-03-05 12:08:33 +01:00
Thomas Heartman
2e086161eb
refactor: strategy draggable item is now proj/env agnostic (#9411)
Updates `StrategyDraggableItem` (and `StrategyItem`) to be project/env
agnostic. They now instead expect you to pass in the required header
items (CR badges, strategy actions) at the call site. Updates their
usage in the feature env accordion, and the release plan card.

All components that have been updated are part of the new overview
rework. The legacy components (which are used when the flag is off)
remain untouched.

Also makes a few small tweaks explained in inline comments.

## Rendered 

Milestone card (with flag on):

![image](https://github.com/user-attachments/assets/828d5fe4-4b07-4ebe-86cd-1ab24608ba31)

Milestone card (with flag off):

![image](https://github.com/user-attachments/assets/10e37cc4-e5e4-4a07-a4f9-5e5f5c388915)


Feature env accordion (flag on (no change)):

![image](https://github.com/user-attachments/assets/2e5db9e7-24b1-4b3e-9434-4705e5737157)


Feature env accordion (flag off):

![image](https://github.com/user-attachments/assets/469970b6-ab57-4332-a99f-8f8e2e645230)
2025-03-05 10:34:55 +01:00
Thomas Heartman
a50fb7db35
chore: remove frontendHeaderRedesign flag (#9428)
Removes all references to the flag and deletes unused components.
2025-03-05 09:40:53 +01:00
David Leek
f6bb94addf
feat: UI for archiving release templates (#9415) 2025-03-05 08:08:57 +01:00
Gastón Fournier
4ae09fdb05
fix: copy strategy is allowed to copy to self (duplicate) (#9407)
When checking for permissions we were checking if the user was allowed
to copy to other environments but it can also copy to the same
environment.

Before the change: 

![image](https://github.com/user-attachments/assets/3bb1b738-8a4b-4c1b-b45f-c48895454c0a)


After the change: 

![image](https://github.com/user-attachments/assets/869e0fed-b7da-436c-93b4-fc50b6830e45)
2025-03-03 17:11:50 +01:00
Simon Hornby
f3ede7681f
chore: flip UI and backend validation for project env disabling (#9395) 2025-03-03 17:13:41 +02:00
Thomas Heartman
596577a1b7
feat: use new strategy list in release plans (#9405)
Here's an initial first pass of replacing the strategy lists in release
plan milestones.

The existing MilestoneCard has been moved to a Legacy file to avoid
conflicts.

This PR places the strategies in a list and changes the background color
of the list items (the strategies themselves still have a white
background, however).

It also re-orders the buttons in the footer and places the
milestone-level drag handle outside the milestone card.


![image](https://github.com/user-attachments/assets/5807bf09-ecbc-4539-a507-03482face154)

## For later

Changing out the strategy list item itself hasn't been done yet. I want
to see if we can re-use the existing strategy draggable item instead of
making a copy. There's some dependencies on project path params etc that
need to be worked out first, though, so I'd prefer to do get these
initial changes through first.
2025-03-03 13:17:55 +01:00
Melinda Fekete
eee212f3f0
Update docs for data and privacy (#9397) 2025-02-28 16:28:32 +01:00
Tymoteusz Czech
1b67b288ee
Segment view for strategy evaluation (#9399)
Refactored "segments" part of strategy evaluation. This shows a lot of places, that use "Legacy" component.
2025-02-28 15:15:25 +01:00
Nuno Góis
8d0820fc8b
chore: release plan replacement UI (#9400) 2025-02-28 14:14:34 +01:00
Nuno Góis
da91ae6afe
chore: new add release plan dialog (#9389)
https://linear.app/unleash/issue/2-3249/adding-a-release-plan-to-a-non-cr-environment-feels-too-immediate

This adds a new confirmation / preview dialog when adding a release
plan.

What's cool about it is that it will describe what will happen before
you confirm. It also acts as the "add to CR" dialog, so we now only have
1 dialog instead of 2 separate ones.

This also refactors quite a bit of our code here, hopefully simplifying
it.

### Simple (env disabled)

![image](https://github.com/user-attachments/assets/579697a8-5b21-4400-a48b-96d2df3931f6)

### CR protected (env enabled)

![image](https://github.com/user-attachments/assets/35398bc9-faed-4ce1-8c78-52e89fe21f4a)
2025-02-28 10:57:20 +00:00
Nuno Góis
2064cae20f
chore: release template card min height (#9390)
https://linear.app/unleash/issue/2-3328/release-template-cards-should-have-a-consistent-minimum-height

Sets a consistent min height in our release template cards.


![image](https://github.com/user-attachments/assets/4e1f1994-6044-4df0-9019-abe76ffc9a37)
2025-02-28 10:23:21 +00:00
Tymoteusz Czech
a6cfcea029
refactor: new constraints style (#9363)
Refactored styles for strategy evaluation parameters. New look for constraints etc
2025-02-28 10:49:23 +01:00
Thomas Heartman
97fd1c0fec
chore(1-3423): adapt existing tests to new components (#9396)
Adds tests for the new version of components that were moved to legacy
files in https://github.com/Unleash/unleash/pull/9361 and where there
were tests already.
2025-02-28 09:45:29 +00:00
Thomas Heartman
0a0d6e9e2a
refactor(1-3429): makes the drag args optional, defaulting to noops (#9394)
Removes the `() => {} as any` args from the StrategyDraggableItem
invocation when you have paginated strats. Instead makes all the drag
params optional. It defaults to a no op if not provided.

Also, the reason it had to be typed as `any` before is probably because
it was missing a function. The correct empty param is `() => () => {}` 💁
2025-02-28 08:45:01 +00:00
Mateusz Kwasniewski
bf78d74dc5
feat: frontend traffic tab (#9385) 2025-02-27 16:02:09 +01:00
Thomas Heartman
d5d172647c
chore: deprecate envAccordion colors; update non-legacy components (#9378)
Deprecates the `envAccordion` colors (`expanded` and `disabled`) and
updates the components that I do not expect to be deprecated as part of
the strategy facelift project to use `elevation1` instead.

The difference is very slight. envAccordion.expanded:

![image](https://github.com/user-attachments/assets/affaa000-11a7-45af-ac1e-1454281615d8)

Elevation 1:

![image](https://github.com/user-attachments/assets/6baa7219-7a6b-4e5d-bd55-1da9e284e7ed)
2025-02-27 15:29:37 +01:00
Thomas Heartman
63d4b8b0e4
chore: adjust env dropdown (#9382)
Adjusts styling of the env dropdown now that we have both release plans
and strategies.

Key points:
- simplifies strategy separator, removes inherent height. Also: extracts
it from the draggable component (it has no business knowing whether to
add that or not)
- Puts release plans and strategies in the same list so that it becomes:
```markdown
- Release plan
  - strategy 1
  - strategy 2
- (OR) Strategy A
- (OR) Strategy B
```
- Adjusts some padding around to make it line up properly
- Swaps a couple conditional renders for ternaries


Rendered:

![image](https://github.com/user-attachments/assets/d6d5cd56-572f-419e-90ed-6449a63fdc96)

## Still todo:

Handle cases where you have >50 strats and we show the warning etc. It's
a little trickier because of how it interacts with release plans, so I
wanna leave that for later.

I'm also unsure about how we handle spacing today. All the little items
have their own different spacing and I'm not sure it won't get out of
sync, but I'm also not sure how else to handle it. We should look at it
later.
2025-02-27 15:28:41 +01:00
Mateusz Kwasniewski
426f53cd8d
test: connection count chart functions (#9383) 2025-02-27 14:38:49 +01:00
Mateusz Kwasniewski
f46ec293df
feat: backend connections tab (#9381) 2025-02-27 13:38:42 +01:00
Thomas Heartman
359b7cc4c0
chore: handle release plans in new strategy list (#9380)
Splits the release plan component into a Legacy component and a new one
with the initial changes for the new strategy list view.

Here's what it looks like:

![image](https://github.com/user-attachments/assets/ecca20d5-1c29-42a9-93f4-61d158ba5a76)

Notice that the background color stops a little early (before the OR
token). I'll handle that in a follow-up because the changes also impact
how the rest of the env accordion body is rendered.
2025-02-27 11:16:24 +01:00
Mateusz Kwasniewski
e29eb51f3c
chore: consumption model flag (#9379) 2025-02-27 09:45:07 +01:00
Thomas Heartman
0c6ef912d4
chore(1-3420): wrap strategy list in an ordered list (#9377)
Improves the semantic correctness of the strategy list by wrapping it
in an `ol` tag.

Strategy order matters (due to variant resolution etc), so the order
is important (hence the `ol` instead of a `ul`).

Dragging still works and it's visually the same.
2025-02-27 08:15:08 +00:00
Jaanus Sellin
be3fa73244
chore: fix text on last seen instances (#9376) 2025-02-27 09:21:40 +02:00
Jaanus Sellin
9ae9221960
feat: now instances are only shown for last 24 hours (#9372) 2025-02-27 09:19:48 +02:00
Thomas Heartman
e25fb9f7c0
chore(1-3389): new env strategy containers (#9361)
Updates the strategy list based on the new designs and moves the current
versions of the touched components into `Legacy...` files (the vast
majority of changes are that and updating imports). The relevant changes
to the components are listed in their original files.

Flag on:

![image](https://github.com/user-attachments/assets/cd49c283-6044-46d4-bcef-182cb6a1de4e)

Flag off:

![image](https://github.com/user-attachments/assets/7ef92b6d-31e5-4218-90b2-dedd5e6cc6de)

## Next steps

There's two items to review for improving these current comments (also
noted inline):
- Whether to aria-hide the "or" separator or not (I need to read up a
bit and think whether it makes sense to show that or not)
- Changing the list of strategies into an actual ordered list (`ol`).
That'd reflect the semantics better.

Next would be checking the other places we use strategy lists and then
updating those too. In doing so, I might find that some things need to
be updated, but I'll handle those when I get there.

There's also handling release plans.
2025-02-26 16:24:50 +01:00
Nuno Góis
192bd83fa6
chore: improve release plan template form validation (#9371)
https://linear.app/unleash/issue/2-3321/improve-release-template-name-uniqueness-error-response-messages
https://linear.app/unleash/issue/2-3285/milestone-name-uniqueness

Slightly improves UX in our release plan template form validation.


![image](https://github.com/user-attachments/assets/2b3bf475-64cc-40ab-a78a-4fe2ca3cdbd1)
2025-02-26 13:01:34 +00:00
Tymoteusz Czech
4e7ce65567
chore: remove uiGlobalFontSize flag (#9331)
1-3383
2025-02-26 12:39:53 +01:00
Thomas Heartman
27bd4e2491
feat: allow command bar navigation to wrap around (#9370)
Lets you navigate to the top of the list when you're at the bottom,
and vice versa.

Arrow down at the end of the list takes you to the search field and
arrow up from the search field takes you to the end of the list.
2025-02-26 10:35:44 +01:00
Nuno Góis
a91876790e
chore: deprecate and undeprecate protected environments (#9360)
https://linear.app/unleash/issue/2-3320/allow-users-to-deprecate-and-undeprecate-protected-environments

Allows users to deprecate and undeprecate protected environments.


![image](https://github.com/user-attachments/assets/621684d3-21e3-4f58-b6b5-2d2731c9fd9e)
2025-02-25 13:41:41 +00:00
Nuno Góis
add4191381
chore: months old version banner (#9352)
https://linear.app/unleash/issue/2-3309/warn-users-of-lagging-versions-3-months-old

Adds a banner warning users in case they are running an outdated Unleash
version (>=3 months old) in case the build date data is present.

When clicking "Changelog" the users are redirected to
https://github.com/Unleash/unleash/releases.


![image](https://github.com/user-attachments/assets/f6b9b361-e780-4558-8b6c-5987b12efe68)
2025-02-25 12:48:55 +00:00
Thomas Heartman
000ee66692
fix: long flag names push table to overflow and flag descriptions are not truncated (#9350)
Addresses two issues related to flag names and descriptions overflowing:

1: In the project flag overview, long flag names push the environments
off screen. This is handled by setting overflow-wrap: anywhere on the
offending text. The text will now use ellipses instead.

Before full-width: 

![image](https://github.com/user-attachments/assets/1c63481a-6733-4f6e-a3a7-46c9035c38f7)

Before narrower:

![image](https://github.com/user-attachments/assets/86cf3531-8259-42f0-9905-4a22dd7f98a7)


After full-width:

![image](https://github.com/user-attachments/assets/e13fa6ff-4cbe-4f6e-8530-b089a8343c65)

After narrower:

![image](https://github.com/user-attachments/assets/c4df0e5d-e32f-4909-9351-afc864383c7b)

2: On the flag page, long descriptions are rendered in their entirety,
even if that's not sensible. They are now truncated after five lines.
There is a tooltip that shows the full text, or you can go the flag
settings to see the full description.

Before:

![image](https://github.com/user-attachments/assets/121ffeac-b92b-4b9b-bb79-17bf5d4ef734)


After:

![image](https://github.com/user-attachments/assets/cd4ff0c2-e110-42c1-8ce6-e0e897823420)


After (with tooltip):

![image](https://github.com/user-attachments/assets/90c147e4-a397-4e60-8318-9a08c4e069aa)


---

Note, I don't think this is necessarily the perfect solution (it'd be
nice to get tooltips for overflowing flag names a "show full
description" disclosure button instead of the stupidly long tooltip),
but I think it's a step in the right direction.
2025-02-25 13:39:30 +01:00
Tymoteusz Czech
7ec6c141f3
refactor: fix deprecation for string truncator (#9359) 2025-02-25 12:24:03 +00:00
Tymoteusz Czech
42a05ef418
feat: new environment box (#9342)
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-02-25 10:34:36 +00:00
David Leek
f19ffd0e7e
chore: fix small UI issues in release templates/plans (#9341) 2025-02-24 15:25:44 +01:00
Nuno Góis
7245112e14
chore: Edge observability width fix (#9345)
Makes the Edge instance node width consistent.
2025-02-21 12:11:50 +00:00
Thomas Heartman
1db97882c2
feat: make env selector filterable (#9340)
Makes the env selector on the flag page act the same way as the env
selector on the new project page or any of the filterable buttons in the
new project/flag dialogs.

Also slightly changes the styles of the existing dropdown lists to bring
them in line with the new env selector (more padding, full-width
highlights).

Selector:


![image](https://github.com/user-attachments/assets/83875aa3-f9d1-4763-b8eb-75f7dc493b13)


Project/flag creation:
Before:

![image](https://github.com/user-attachments/assets/97926ec8-64a0-4d08-900b-0acd5709ef92)


After:


![image](https://github.com/user-attachments/assets/2616615f-3382-4183-a048-5ea4defc8fb2)

## Technical notes

I was a little unsure how best to share the padding/spacing styles
between the search field and popover at first (as was requested by UX).
The easiest way (and most compliant with how we do it today) was to
define the spacing in a variable and move the relevant components into
the same file.

However, I actually think that using a CSS variable (e.g.
`--popover-spacing`) would be "better" here, but we don't really use
them much, so I've left that out for now. That said, if you agree, I'd
be more than happy to use that instead 🙋🏼
2025-02-21 11:20:43 +00:00