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

13987 Commits

Author SHA1 Message Date
Tymoteusz Czech
4d92d54f9a
feat: track last seen clients using bulk update (#9981)
Let's not update `lastSeen` in the db on each client call
2025-05-15 13:06:54 +02:00
Nuno Góis
480689e828
chore: revive archive page (#10001)
Related to:

-
https://linear.app/unleash/issue/2-3366/remove-get-apiadminarchivefeatures-deprecated-in-4100
-
https://linear.app/unleash/issue/2-3367/remove-get-apiadminarchivefeaturesprojectid-deprecated-in-4110

Brings back the overall flag archive page and table using the feature
flag search endpoint.
2025-05-15 11:54:52 +01:00
Jaanus Sellin
0255cf137a
fix: now feature is not pulled from server if not defined (#10000) 2025-05-15 11:54:40 +03:00
Nuno Góis
45c2a0b939
chore: small visual improvements to the new invite mail template (#9998)
https://linear.app/unleash/issue/2-3567/improve-the-look-of-the-unleash-instance-getting-started-email

Some small visual improvements to the email template after the latest
changes.

Follow-up to: https://github.com/Unleash/unleash/pull/9997
2025-05-15 08:52:01 +01:00
Jaanus Sellin
9aa0c4c738
feat: constraints that are in recents will have generated key (#9996)
Previously it was trying to get constraint id for key, but id did not
exist. Now for unique keys, I am using the hashed constraint payload.
2025-05-15 10:50:59 +03:00
Thomas Heartman
a2723ec0c0
chore remove and clean some stuff (#9993)
- Deletes an unused file
- Fixes a console.error due to a prop being passed on to the HTML
component
- Puts all editable constraint files within a separate directory.
2025-05-15 07:23:33 +00:00
Nuno Góis
e9768f7363
chore: new invite email template improvements (#9997)
https://linear.app/unleash/issue/2-3567/improve-the-look-of-the-unleash-instance-getting-started-email

Follow-up to: https://github.com/Unleash/unleash/pull/9980

Refactored the new email template to use a table-based layout with
inline styles for maximum compatibility across email clients, while
preserving the original design.
2025-05-14 17:26:56 +01:00
Nuno Góis
0e8f187948
chore: new getting started email template (#9980)
https://linear.app/unleash/issue/2-3567/improve-the-look-of-the-unleash-instance-getting-started-email

Adds a new getting started email template, hidden behind a
`newGettingStartedEmail` flag.

If it works nicely, we may follow up with PRs to update and align the
remaining email templates.

### Old


![image](https://github.com/user-attachments/assets/a1bf1ccd-7adb-4a41-b101-653c648c24f3)

### New


![image](https://github.com/user-attachments/assets/ebe600df-254f-4ebb-8976-69aa6b200d8a)
2025-05-14 15:55:38 +01:00
Thomas Heartman
a80b667cf5
chore(1-3747): minor strategy edit header updates (#9992)
Makes a few small changes to the strategy header:
- Removes the rollout percentage and environment indicator
- Changes the env disabled alert from warning to info
- Maybe moves the alert to the end of the form, only on the general tab
panel

I've placed the removal of the rollout percentage and env header behind
a flag, but not the alert changes.

Before:

![image](https://github.com/user-attachments/assets/29382afe-9a75-4138-be1c-2bab45a75787)


After:
<img width="1239" alt="image"
src="https://github.com/user-attachments/assets/db73c9c8-3244-40db-9991-c412c9aadc18"
/>
2025-05-14 12:48:46 +00:00
Jaanus Sellin
ba80c925e7
feat: now pressing enter will submit the new rollout percentage (#9995) 2025-05-14 15:01:55 +03:00
Jaanus Sellin
a0e4f08507
feat: now updating strategy also saves recents (#9990)
The issue was that processing constraints after the API call in
updateStrategyOnFeature caused React's state updates to be interrupted
before they could be persisted to localStorage, but by moving that
processing before the API call, we ensure constraints are saved
immediately, regardless of API timing.
2025-05-14 15:01:11 +03:00
Thomas Heartman
26a1156959
1-3744: Set a min-width for context field selector + underline when not focused (#9991)
When you have very short names (1--2 characters) the field itself can be
hard to see, so we'll set a min width.

Before (with hover): 
<img width="455" alt="image"
src="https://github.com/user-attachments/assets/a9590d3d-88a2-4814-9581-33b8378f4524"
/>

After (without hover):
<img width="523" alt="image"
src="https://github.com/user-attachments/assets/1e7b6028-e142-442a-9b53-55425d2d6c59"
/>
2025-05-14 11:56:05 +00:00
Gastón Fournier
23d55340f2
chore: now we need to build before running tests (#9989)
This should fix the coverage report
2025-05-14 11:33:32 +00:00
renovate[bot]
d17d68d6aa
chore(deps): update node.js to v22 (#9487) 2025-05-14 10:31:18 +00:00
dependabot[bot]
4f7fb8f1ae
chore(deps): bump formidable from 3.5.1 to 3.5.4 (#9865) 2025-05-14 09:55:11 +00:00
Mateusz Kwasniewski
1523e2d056
feat: plausible tracking for links (#9988) 2025-05-14 11:19:37 +02:00
Gastón Fournier
abe160eb7d
feat: Unleash v7 ESM migration (#9877)
We're migrating to ESM, which will allow us to import the latest
versions of our dependencies.

Co-Authored-By: Christopher Kolstad <chriswk@getunleash.io>
2025-05-14 09:47:12 +02:00
Thomas Heartman
c358a8ffd3
Make hover underline purple (#9985)
Uses a purple color for the hover underline. Also, sets it to be
transparent when not-hovered, so that you get a nice fade in effect.

Focus (top) and hover (bottom) now have the same visual style, but
different ways to get to that state (expansion vs fade-in):
<img width="979" alt="image"
src="https://github.com/user-attachments/assets/e342ea4e-4821-4e4c-bb5d-6b9d3a672e26"
/>
2025-05-14 06:57:20 +00:00
Jaanus Sellin
aa885b9afd
feat: now recently used constraints are not shown if already in use (#9984) 2025-05-14 09:53:50 +03:00
Jaanus Sellin
9bd69a852e
feat: now only recents show segments that are not being used currently (#9983)
Now only recents show segments that are not being used currently
2025-05-14 09:40:33 +03:00
Thomas Heartman
96a388298f
fix(1-3740): Don't autofocus the editable constraint field. (#9982)
There can be any number of these on a page, so setting autofocus here is
a Bad Idea (TM). It's probably a holdover from when the input was an
accordion and we wanted to give you focus when you opened it (we do a
similar thing for the popover, for instance).

This property will cause you to focus (and potentially scroll) to the
last constraint on the page.
2025-05-14 08:04:47 +02:00
Thomas Heartman
4ea2499ce7
Chore(1-3688): improve performance for large lists of legal values (#9978)
This PR implements a number of strategies to make the app perform better
when you have large lists. For instance, we have a constraint field that
has ~600 legal values. Currently in main, it is pretty slow and sloggy
to use (about on par with what we see in hosted).

With this PR, it becomes pretty snappy, as shown in this video (should
hopefully be even better in production mode?):


https://www.loom.com/share/2e882bee25a3454a85bec7752e8252dc?sid=7786b22d-6c60-47e8-bd71-cc5f347c4e0f

The steps taken are:
1. Change the `useState` hook to instead use `useReducer`. The reason is
that its dispatch function is guaranteed to have a stable identity. This
lets us use it in memoized functions and components.

2. Because useReducer doesn't update the state variable until the next
render, we need to use `useEffect` to update the constraint when it has
actually updated instead of just calling it after the reducer.

3. Add a `toggle value` action and use that instead of checking whether
the value is equal or not inside an onChange function. If we were to
check the state of the value outside the reducer, the memoized function
would be re-evaluated every time value or values change, which would
result in more renders than necessary. By instead doing this kind of
checking inside the reducer, we can cache more aggressively.

4. Because the onChange function can now be memoized, we can memoize all
the legal value selector labels too. This is the real goal here, because
we don't need to re-render 600 components, because one of them was
checked.

One side effect of using useEffect to call `onUpdate` is that it will
also be called immediately when the hook is invoked the first time, but
it will be called with the same value as the constraint that was passed
in, so I don't think that's an issue.

Second: the `useEffect` call uses `localConstraint` directly as a dep
instead of stringifying it. I'm not sure why, but stringifying it makes
it not update correctly for legal values.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-14 08:04:39 +02:00
Nuno Góis
e7da79d974
refactor: clean up dead code after removing deprecated project role access endpoint (#9949)
https://linear.app/unleash/issue/2-3363/remove-post-apiadminprojectsprojectidroleroleidaccess-deprecated-in

Cleans up dead code after removing POST
`/api/admin/projects/{projectId}/role/{roleId}/access` which was
deprecated in v5.5.

Should only be merged after the Enterprise PR.
2025-05-13 13:52:13 +01:00
David Leek
3a37386449
chore: undeprecate custom strategies (#9939) 2025-05-13 14:13:15 +02:00
Fredrik Strand Oseberg
94c73bbc5d
feat: event log environment filter (#9979)
Add Environment Filter to Event Log
2025-05-13 13:45:22 +02:00
Nuno Góis
c0c7005859
refactor: remove deprecated post project role access endpoint (#9948)
https://linear.app/unleash/issue/2-3363/remove-post-apiadminprojectsprojectidroleroleidaccess-deprecated-in

Removes POST `/api/admin/projects/{projectId}/role/{roleId}/access`
which was deprecated in v5.5.
Also cleans up related code.

Needs follow up PRs.
2025-05-13 12:28:44 +01:00
Tymoteusz Czech
57d11ae6b3
feat: link templates applied on flags (#9976) 2025-05-13 13:16:26 +02:00
Nuno Góis
0429c1985a
refactor: remove deprecated get archive featured by project endpoint (#9938)
https://linear.app/unleash/issue/2-3367/remove-get-apiadminarchivefeaturesprojectid-deprecated-in-4110

Removes GET `/api/admin/archive/features/{projectId}` which was
deprecated in v4.11.
Also cleans up related code.

I leveraged our search features endpoint where needed, since that's what
we're using now in our UI (to see archived features you filter by
archived=true).

Builds on top of https://github.com/Unleash/unleash/pull/9924 — Since
they're both related.
2025-05-13 12:09:52 +01:00
Nuno Góis
42b6fc810e
refactor: remove deprecated GET archive features endpoint (#9924)
https://linear.app/unleash/issue/2-3366/remove-get-apiadminarchivefeatures-deprecated-in-4100

Removes GET `/api/admin/archive/features` which was deprecated in v4.10.
Also cleans up related code.

May include some slight scouting.

**P.S.** Should we merge this into main, or is there a `v7` branch we
should be targeting instead?
2025-05-13 11:45:03 +01:00
Mateusz Kwasniewski
410142cb42
feat: make all feature toggle service write methods transactional (#9973) 2025-05-13 12:16:20 +02:00
Gastón Fournier
2a083edc14
chore: accept 429 responses (#9974)
When being throttled assume the link is ok, eventually someday it will
be checked

Already tested it works on this branch:
https://github.com/Unleash/unleash/actions/runs/14993127371
2025-05-13 11:05:55 +01:00
Jaanus Sellin
5f4d7de62e
chore: fix rendering issue without setConstraints (#9975)
The current implementation states that if you do not have
access—typically as a viewer user—it renders the old component.
Rendering an empty view is acceptable, as this is part of the segment
creation flow, and if you do not have permissions, you do not need to
see it.
2025-05-13 12:41:19 +03:00
Thomas Heartman
257b8d1f40
test/refactor: useEditableConstraint hook (#9970)
Adds a test suite for the useEditableConstraint hook, attempting to test
all the parts of it that we can't test in isolation.

Plus: a few, small refactorings:
- Renames `onAutoSave` on `onUpdate` to better match `onDelete` (and
because autosave doesn't really mean anything anymore).
- Simplifies and collapses some types
2025-05-13 11:30:07 +02:00
Tymoteusz Czech
309816ca38
feat: add getProjectLinkTemplates method (#9971)
Add `getProjectLinkTemplates` method to ProjectStore and corresponding
test. Ideally this should be in a read-model, but let's finish link
templates end to end
2025-05-13 11:21:18 +02:00
Jaanus Sellin
3c42edfbe8
chore: fix setConstraints being undefined/null (#9972) 2025-05-13 12:20:15 +03:00
Nuno Góis
333f1203dc
refactor: lax newUserInviteLink user arg (#9967)
Part of:
https://linear.app/unleash/issue/2-3560/payg-flow-sends-2-email-one-from-bluebird-and-one-from-unleash-we-want

This laxes our `user` argument in `newUserInviteLink` to just pick the
id, since that's the only property we're interested in. This allows us
to send `{ id }` when we don't have the full `IUserWithRootRole`
available while keeping compatibility intact.
2025-05-13 09:41:33 +01:00
Mateusz Kwasniewski
9c05e56c4a
refactor: simplify feature toggle service deps (#9964) 2025-05-13 09:42:37 +02:00
Tymoteusz Czech
82dddb2eef
feat: update flags overview status column (#9961)
Improved spacing in the flag overview columns.
2025-05-13 09:37:22 +02:00
Jaanus Sellin
31a23db05e
chore: clarify deleted legal values warning (#9969) 2025-05-13 10:19:11 +03:00
Thomas Heartman
8bf3b1f135
test(1-3734): test constraint reducer (#9966)
Adds a fairly comprehensive test suite for the constraint reducer. I put
in all cases I thought were relevant.

As part of this, I discovered one bug, and changed two actions.

The bug was toggling on the wrong property when you tried to invert case
sensitivity.

The action changes are:
- rename "remove value from list" to "remove value"
- remove "set value" in favor of instead letting "add value(s)" work in
single-value constraints too.
2025-05-13 09:02:38 +02:00
Gastón Fournier
3e0b127113
chore: remove proxy from integrations (#9962)
Removing proxy from integrations as it's been deprecated while ago and
currently unmaintained
2025-05-12 16:37:18 +02:00
Thomas Heartman
d0975c52a9
Test(1-3733): get invalid and deleted legal values (#9963)
Extracts and tests the implementation of the functions to get deleted
and invalid legal values.

This is pretty straightforward stuff and arguably not crucial, but it
was an easy place to start and I don't think it hurts to have these in
place anyway.
2025-05-12 12:57:55 +00:00
Gastón Fournier
8b4ad4b574
chore: remove semver version from footer and proxy from sdk list (#9956)
This will stop displaying the semver version for our hosted (i.e.
managed) customers, as it has become less relevant over time. It remains
valuable for self-hosted users.
2025-05-12 14:32:12 +02:00
Jaanus Sellin
42f3ba5fc2
feat: add input box for gradual rollout slider (#9960) 2025-05-12 15:27:31 +03:00
Melinda Fekete
148e6e0da8
docs: update UI docs and screenshots for v6.10 (#9902) 2025-05-12 14:21:12 +02:00
Mateusz Kwasniewski
d175a5705a
feat: Import feature links (#9958) 2025-05-12 13:59:18 +02:00
Fredrik Strand Oseberg
d4d6e658ff
Chore/cleanup tag color feature falg (#9959)
Removes the flag for tag type colors.
2025-05-12 13:54:38 +02:00
Thomas Heartman
6efbe2d545
Single legal values (#9935)
Adds an input form for single legal values (i.e. for number and semver
operators).

- Uses the `validator` for the constraint to check the list of legal
values and provides a list of "invalid legal values" for values that
don't pass validation.
- Values in the "invalid legal values" set are "disabled" when rendered
in the UI. Additionally, there's an extra bit of text that tells you
that values that aren't valid are disabled.
- Makes the legal values selector more generic and makes it adapt to
multi- or single-value selection based on input props. The external
interface is two separate components (to make it clearer that they are
different things and because their props don't line up perfectly).

Rendered:
<img width="957" alt="image"
src="https://github.com/user-attachments/assets/cd8d2f32-057d-4e31-8fd3-174676eeb65e"
/>


Still todo: testing deleted/invalid legal value detection. I'll do that
as part of the big testathon in a followup.
2025-05-12 13:35:45 +02:00
Tymoteusz Czech
520d708978
fix: ensure linkTemplates defaults to an empty array if not provided 2025-05-12 13:21:06 +02:00
Mateusz Kwasniewski
5708acb5b7
feat: export feature links (#9954) 2025-05-12 12:07:00 +02:00