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

5955 Commits

Author SHA1 Message Date
Thomas Heartman
0e1ab236c9
Fix/constraint value wrapping (#9873)
Changes how constraint values are treated and wrapped.

Previously, they would have their own column and fill it up:

![image](https://github.com/user-attachments/assets/3d13fa75-2b53-4393-8bb2-8677741016e3)

Then we changed it to always being on the next line below certain
widths:

![image](https://github.com/user-attachments/assets/e2fea1e2-3ab8-4000-a727-831802c583c4)

But that would also cause it to break even if there was no need for it.
This iteration instead uses display `contents` on the value lists to let
them be handled by the flex flow of the containing element. This allows
them to only wrap when necessary.

<img width="995" alt="image"
src="https://github.com/user-attachments/assets/d61f6f49-b1ef-49ec-91a4-df868cedc678"
/>

Of course, if they don't need to wrap, they don't:
<img width="1030" alt="image"
src="https://github.com/user-attachments/assets/84c27997-7cb2-4e1b-8977-d43a46f7de6e"
/>


This loom video shows how it folds in the most complex scenario, with
all elements being visible and within bounds down to about 300px:
https://www.loom.com/share/4f29cdb105d54edeb70edd54dfaca9f9
2025-04-30 13:57:57 +02:00
Jaanus Sellin
3c6d797234
feat: recently used constraints have use this button now (#9871)
Also splitted actions, so we have edit view actions, and view actions.


![image](https://github.com/user-attachments/assets/27220835-36d2-4782-86c4-25511f6f778f)
2025-04-30 14:12:49 +03:00
Thomas Heartman
691a9e6e57
fix: appropriately size case icon for non-editing constraints (#9869)
This fixes an issue where the "case sensitive" chip for existing
constraints was way too big. The underlying reason is that I switched
the icon for one with more padding to give it a consistent size with the
"not case sensitive" icon (PR:
https://github.com/Unleash/unleash/pull/9851).

The fix here is:
1. Add a viewBox to the SVG to let it scale properly.
2. Make the containing box stretch to fill the height of it's flex
container.
3. Use a size for height that doesn't grow too large.

Before:
<img width="137" alt="image"
src="https://github.com/user-attachments/assets/f23043f7-76a9-48c4-9f5c-c50371c24f72"
/>

After:
<img width="178" alt="image"
src="https://github.com/user-attachments/assets/cc2f8109-21ed-4070-b4bc-7c94be5b8e8d"
/>
2025-04-30 08:37:16 +00:00
Jaanus Sellin
3ec1daad2b
feat: now recent constraints work e2e (#9868)
Small intermediate cleanup.
Next step is to add usage buttons.
2025-04-30 11:34:03 +03:00
Tymoteusz Czech
6c5fa4c8a7
feat: update search placement on flags overview screen (#9854)
- search has a new place, closer to filters
- filters are adjusted to wrap properly on small screens
2025-04-30 09:25:45 +02:00
Thomas Heartman
d44b7ac6c2
1-3651/single value inputs (#9859)
Adds an "add value" with popover input for single-value fields
(numerical and semver operators).

The implementation re-uses the popover from the multi-value constraint
operators, so I've extracted it for re-use.

All current input types:
<img width="779" alt="image"
src="https://github.com/user-attachments/assets/ad522e4d-72ba-402c-ad7c-8609ef2fb3a8"
/>

For the new one, opening the popover when there's a value will
pre-select the value, so you can override it by typing immediately:
<img width="297" alt="image"
src="https://github.com/user-attachments/assets/31d18f9e-6ef9-4450-9d63-ca5034b59f19"
/>

Buttons look pretty identical:
<img width="784" alt="image"
src="https://github.com/user-attachments/assets/d96b0b0d-0cbb-4262-9ca8-4ec919cbfafb"
/>

## Discussion points

### Input type

I haven't set an input type anywhere on the popover yet. In theory, we
could use input type "number" for numerical inputs and I think it's
worth looking at that, but we don't do in the old implementation either.

I've added a task for it.

### Weird esc handling

This implementation uses a chip for the button/value display for the
single. In almost all cases it works exactly as I'd expect, but closing
the popover with esc moves your focus to the top of `body`.
Unfortunately, this isn't something we can address directly (trust me,
I've tried), but the good news is that this was fixed in mui v6. The
current major is v7, so we probably want to update before too long,
which will also fix this. More info in the MUI docs:
https://mui.com/material-ui/migration/upgrade-to-v6/#chip

I think that for the single value entry, losing focus on esc is a fair
tradeoff because it handles swapping states etc so gracefully. For the
multi-value operators, however, esc is the only way to close the
popover, so losing focus when you do that is not acceptable to me. As
such, I'll leave the multi-value input as a button for now instead.
(It's also totally fine because the button never updates or needs to
change).
2025-04-29 15:06:42 +02:00
Jaanus Sellin
cb987ac78b
feat: now updating/editing strategy will store constraints in recents (#9861) 2025-04-29 15:33:06 +03:00
Jaanus Sellin
7356453c0c
feat: view for recently used constraints (#9860) 2025-04-29 13:36:17 +03:00
Mateusz Kwasniewski
3980cfa2a8
feat: show backend and frontend sdks separately (#9857) 2025-04-29 10:36:02 +02:00
David Leek
e450d1e35e
chore: replace inherit color on menu item hover to common.white (#9856) 2025-04-29 09:27:09 +02:00
Thomas Heartman
20a259fc4a
Chore/constraint value styling (#9853)
Fixes a few small styling issues with the constraint value chips:
- Background color was wrong
- They shouldn't have a border when they're not focused
 
Different styles: 
1. Keyboard focus
2. Mouse hover
3. No focus
4. No focus
5. Add values button for reference.
<img width="405" alt="image"
src="https://github.com/user-attachments/assets/ded98393-a7a8-4d4a-81ff-63a3f4d32184"
/>
2025-04-28 14:52:08 +02:00
Jaanus Sellin
1b031c9caf
feat: recently used constraints hook (#9850) 2025-04-28 15:51:50 +03:00
Thomas Heartman
b8c50e6ed2
1 3634/new icons 2 (#9851)
Adds new icons for the constraint operator buttons (equals and case
sensitive).
<img width="398" alt="image"
src="https://github.com/user-attachments/assets/2bd2a20f-700b-489a-b7d3-e6e26d80c316"
/>
<img width="442" alt="image"
src="https://github.com/user-attachments/assets/e5cca824-d8c0-4ea4-b137-c7c1eae642cc"
/>


The icons are all 24x24, so using them for buttons is pretty easy.

There is one caveat: The heights are very subtly off (~1.25 px) when the
buttons wrap and end up on a line without the input field, but it's
really not noticeable. In this screenie, the Aa button has is a tiny bit
smaller than the items on the row above:

<img width="328" alt="image"
src="https://github.com/user-attachments/assets/d89e2a01-9274-4d6f-b203-1fc3d487543f"
/>
2025-04-28 14:35:55 +02:00
sjaanus
5c894c78be
fix: remove pushed files 2025-04-28 15:02:59 +03:00
sjaanus
19cb225623
feat: recently used constraints hook 2025-04-28 15:01:46 +03:00
Jaanus Sellin
5c483c7d8d
feat: split and clean up constraint lists (#9839) 2025-04-28 13:46:22 +03:00
David Leek
25790c1e0b
chore: fix colors, sizes and corner roundings on admin menu (#9847) 2025-04-28 10:57:24 +02:00
Tymoteusz Czech
3ac087e0f6
feat: count per lifecycle stage (#9845)
Show count per stage, and include count if flags are filtered.
2025-04-25 10:52:11 +00:00
Mateusz Kwasniewski
bd78a75177
chore: remove flag for global change request config (#9840) 2025-04-25 12:47:18 +02:00
Thomas Heartman
44082b24a1
chore: second design pass for editable constraints (#9843)
Fix a number of visual issues with the main editable constraint
component.

I've introduced a few more layers of container nesting to make the
layout break the right ways:
- Put everything on the same line when on wide.
- At 700px place selected values on the row below
- From 700px down, when necessary, also wrap operator options


Support super long context names without breaking layout
<img width="399" alt="image"
src="https://github.com/user-attachments/assets/07555e9c-d875-417f-ae6b-d4600731d5eb"
/>

Wrap values at 700px width container:
<img width="703" alt="image"
src="https://github.com/user-attachments/assets/deb6e059-57d4-4e47-88da-3ec5d6bce751"
/>

Wrap operator options when necessary
<img width="359" alt="image"
src="https://github.com/user-attachments/assets/ff96db40-f47d-4ddf-bed7-dfced4d69973"
/>

Absolutely position delete button to allow to not push it out of the
container on narrow screens:
<img width="330" alt="image"
src="https://github.com/user-attachments/assets/c7b8f88d-538a-46a1-ae3f-e5a761b50289"
/>

Remove extra focus styling from MUI (darken select background):
Before:
<img width="348" alt="image"
src="https://github.com/user-attachments/assets/99aff08d-c1af-46c0-8a75-40c1ea3c103f"
/>

<img width="357" alt="image"
src="https://github.com/user-attachments/assets/b7a0edac-2716-48a7-b50c-b3437e5f5be8"
/>

After:
<img width="379" alt="image"
src="https://github.com/user-attachments/assets/74da884c-7b1a-4b9a-8383-31592326a71b"
/>
<img width="350" alt="image"
src="https://github.com/user-attachments/assets/0ebea696-5f7d-4d4e-b91c-b087a8fc56a3"
/>
2025-04-25 10:37:04 +00:00
Thomas Heartman
44e9023fb3
Don't show extra input component if we have "add values" button (#9842)
Makes it so that the InputContainer is only rendered if we don't have
the add values button up top. We might need to adjust this later (as we
get more sketches for other input types, such as single numbers, single
semvers etc), but it works for now.

With legal values  (no add values button)
<img width="765" alt="image"
src="https://github.com/user-attachments/assets/032cc848-584e-4c3f-83ed-be1fb1cdc0f8"
/>

Without legal values (but add values button)
<img width="763" alt="image"
src="https://github.com/user-attachments/assets/1a8fa68e-a73b-42fc-a1b8-e8f5997f3c5d"
/>

Because we don't handle single value cases yet, some of those inputs are
still stuck in an in-between state:
<img width="775" alt="image"
src="https://github.com/user-attachments/assets/25b6ae89-9267-4f06-a32d-3460abe4a847"
/>
2025-04-25 12:23:18 +02:00
Thomas Heartman
799fc1f518
1-3658/fix legal values selector issues (#9838)
Fixes an issue with the new legal values selector where selecting an
item from filtering or changing the checkbox state would move your focus
to the top of the page. I think it's because we'd re-render the whole
tree because of it, and this would clear your focus selection. To get
around it, I've used the existing ResolveInput component. We might want
to change this later as we get around to more input components (single
values, etc), but for now, I think this is good enough.

As a bonus, I get to delete the most annoying part of the
EditableConstraints file 😄

The constraint still opens in edit mode for now, but I expect that to
get resolved once we properly implement the split between editable and
non-editable constraints that was started yesterday.
2025-04-25 09:41:23 +02:00
Nuno Góis
8e46bda8e1
chore: fix admin routes should respect plan data (#9828)
https://linear.app/unleash/issue/2-2852/sidebar-bug-with-enterprisepro-only-route-constraints

Fixes an issue where admin routes didn't respect plan data if their flag
was enabled.

First noticed here:
https://github.com/Unleash/unleash/pull/8469#discussion_r1804361222

Issue was that only `adminRoutes` respected plan data. `mainNavRoutes`
and `primaryRoutes` did not follow the same filtering logic.

We can probably clean this up even further in the future, but didn't
want to extend the PR too much.

Also adds tests to validate the intended behavior.
2025-04-24 15:44:06 +01:00
Tymoteusz Czech
0e2f7374e5
Feat: update variants placement (#9832) 2025-04-24 16:01:35 +02:00
Jaanus Sellin
3774cf8b87
feat: separate constraint edit/view screens (#9836)
Separating constraing edit and view screens.
Next PR is to start using these.
2025-04-24 16:49:30 +03:00
Tymoteusz Czech
bffaab5560
chore: update OpenAPI frontend types (#9834)
For lifecycle-count endpoint
2025-04-24 11:42:27 +00:00
Tymoteusz Czech
a38bf8ea4c
feat: remove sort by user on flags overview (#9826)
We don't aggregate all users, for filters on flags overview. Let's drop this filter
2025-04-24 13:37:30 +02:00
Thomas Heartman
f6eb572a14
Prevent legal value selection from triggering form submit (#9831)
Use event.preventDefault to prevent the app from trying to submit the
legal values (or the strategy) form when you hit "enter" in the legal
values filter input.
2025-04-24 10:19:03 +00:00
Thomas Heartman
3bb54c5a9d
feat: 1-3652/legal value selector visual update (#9829)
Handles the visual changes for the legal value selector widget.

Before:
<img width="792" alt="image"
src="https://github.com/user-attachments/assets/0965d577-c4cf-4c1d-9fe7-f8f90d683988"
/>

After:
<img width="769" alt="image"
src="https://github.com/user-attachments/assets/33bdf40c-8bbb-4650-a6ba-c4b9e62f8cbd"
/>

I'm still working on improving the functionality of selecting from the
search input and not losing focus when you select/deselect an item (both
of these work (mostly) as expected on hosted, so we've introduced a
regression somewhere).
2025-04-24 12:17:05 +02:00
Jaanus Sellin
b05e12d028
feat: remove warning boxes for empty values (#9830)
We had issues, where when you selected the operator, these boxes were
jumping up. The problem was that the illegal value checker was marking
empty values as illegal also.

Now empty value is not included in illegal values.


![image](https://github.com/user-attachments/assets/13c6b21e-6b7e-40ac-bade-4496e65f10ba)
2025-04-24 11:41:14 +03:00
Nuno Góis
26f582db21
chore: add terraform to integrations (#9827)
https://linear.app/unleash/issue/2-2565/add-terraform-to-list-of-integrations

Adds Terraform to our integrations list.

It links to: https://docs.getunleash.io/reference/terraform

<img width="769" alt="image"
src="https://github.com/user-attachments/assets/28edb65f-a56d-4ffc-8ce3-cbb6bde6b19b"
/>
2025-04-23 16:11:18 +01:00
Jaanus Sellin
08c11664ce
feat: change requests, use new accordion list not legacy (#9825)
This should be final piece where old accordion is used.


![image](https://github.com/user-attachments/assets/854dfab9-4b05-4a14-bb17-0de49705079d)
2025-04-23 17:37:54 +03:00
Thomas Heartman
9977b3e0f8
fix: legal value selector chips and option updates (#9819) 2025-04-23 14:41:28 +02:00
Tymoteusz Czech
b179f86fb7
fix: stale flag status chip (#9821) 2025-04-23 12:02:58 +00:00
Jaanus Sellin
31dbef84f6
feat: move away from old accordion list, create/edit segment (#9820)
This is one path that is using old component, that we can update.


![image](https://github.com/user-attachments/assets/2f88eea9-651c-4bb2-9b00-d8c54e8e5aab)
2025-04-23 15:02:13 +03:00
Thomas Heartman
08d0907d89
Always show the value list + hide "add values" on non-free text entries (#9817)
Removes the condition to hide the value list if we use legal values. 

In doing so, I also realized that focus handling when you delete the
last item in the constraint values list doesn't work if the add values
button isn't there (which it shouldn't be for legal values and more). So
I've hidden the add values button when it doesn't do anythnig helpful
(or for cases where we don't have designs yet). In cases where you don't
have the add values button and you delete the last constraint value,
we'll move the focus to the "delete constraint" button (that was easier
than making sure we pass refs all the way down into the operator select,
but we can change that later).

To facilitate this (refs coming from the parent component), I refactored
the value list component to accept the add values widget as a child (and
extracted it to its own file).
2025-04-23 10:59:10 +02:00
Nuno Góis
dbe2f9b6bd
chore: remove demo plans dialog (#9816)
https://linear.app/unleash/issue/2-3531/remove-pricing-pop-up

We decided to remove this dialog in favor of linking directly to
https://www.getunleash.io/pricing
2025-04-23 08:55:49 +01:00
Jaanus Sellin
a2e39a05c4
chore: clean up old accordion code path (#9813)
Remove unused code.
2025-04-23 10:52:01 +03:00
Thomas Heartman
77d72ce5a1
Stop "add values" from closing on adding a value (#9815)
Instead of closing the "add values" popover when you add a value, we now
keep it open to facilitate rapid entry of multiple values. It already
clears successfully and adds the new value to the list, so it's actually
quite smooth to use from just the keyboard now!

Additionally, I propose using a `form` element for the add values
popover, because it really is just a tiny form. This also allows us to
use regular form handling instead for submission instead of checking
what key the user pressed. It also means we don't need to specify the
action in the button, because the form handles it.

There's a few more things fixed: 
- I've added a label (only visible to screen readers) to the input label
(as per standard a11y guidelines).
- When you add a value by pressing the "add" button, your focus returns
to the input field, so that you can just start typing out the next one.
this is handy if you submit by mouse click or by tabbing to the button
instead of just hitting enter inside the input field.
2025-04-23 09:32:37 +02:00
Mateusz Kwasniewski
da05c7be5c
chore: remove disable notifications UI (#9814) 2025-04-22 15:03:15 +02:00
Tymoteusz Czech
9d98d0771e
fix: strategy-reorder tooltip padding (#9811)
Tooltip is created a gap on the right side of flag overview page
2025-04-22 14:26:40 +02:00
Mateusz Kwasniewski
a22f5d0201
chore: adjust reminder days (#9810) 2025-04-22 12:29:07 +02:00
Thomas Heartman
150a044207
Use svg icons for case sensitivity button and give it better textual representation (#9808)
Light mode:
<img width="110" alt="image"
src="https://github.com/user-attachments/assets/dba5dd69-685c-4259-ba07-f50ad7c66833"
/>
<img width="265" alt="image"
src="https://github.com/user-attachments/assets/1ac2e71b-36f7-4a90-b96c-38f9aee4cb51"
/>

Dark mode:
<img width="311" alt="image"
src="https://github.com/user-attachments/assets/780c2110-2871-4634-b755-e3e0e3681826"
/>
<img width="285" alt="image"
src="https://github.com/user-attachments/assets/fdf0d790-eee6-4640-823a-758570c53b2f"
/>
2025-04-22 12:25:05 +02:00
Gastón Fournier
a88e781391
feat: run cypress against current branch (#9793)
## About the changes
Currently, we're running against the older version of our UI. When
making changes to it we want to make sure we're testing the current code

**Details in comments**

---------

Co-authored-by: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com>
2025-04-22 11:58:22 +02:00
Tymoteusz Czech
18850a5156
feat: move 'copy flag name' button (#9805)
- moved "copy flag name" action next to the flag name
- refactored this component into a separate file
- added "Ctrl+C" shortcut
2025-04-22 11:12:37 +02:00
Jaanus Sellin
bc7856a23a
feat: enter will select the first filtered value (#9807)
![image](https://github.com/user-attachments/assets/deff3204-100d-464f-8a87-f36759bdee3a)
2025-04-21 16:56:54 +03:00
Mateusz Kwasniewski
916ee157ab
refactor: pass feature to feature overview metadata component (#9803) 2025-04-18 14:24:48 +02:00
Mateusz Kwasniewski
e436cf72e6
feat: revert to production (#9802) 2025-04-18 11:42:43 +02:00
Mateusz Kwasniewski
78f0d02a84
feat: snooze reminder tracking (#9798) 2025-04-18 10:10:13 +02:00
Tymoteusz Czech
6403ae7f9b
feat: futureproofing last viewed page redirect (#9794)
You should not be able to break initial page redirect even if you set
'/' as target. It is not strictly needed in the current code path. This
will create a redirect loop only if you manually modify local storage.
It just makes this part safer if it is ever modified.
2025-04-17 17:40:04 +02:00