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

13765 Commits

Author SHA1 Message Date
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
Tymoteusz Czech
1ccd201a25
feat: use modal for managing link templates (#9955)
Editing with modals is more focused.
2025-05-12 11:52:48 +02:00
Tymoteusz Czech
5614cb56d3
feat: ui for external link templates (#9945)
Support for project link templates to the frontend UI
2025-05-12 11:05:04 +02:00
Jaanus Sellin
ea26e008d0
chore: update styling for variant box (#9953) 2025-05-12 11:38:33 +03:00
Tymoteusz Czech
f55ea5f387
chore: remove embedProxy flag (#9874)
Clean up old flags
2025-05-12 10:28:31 +02:00
Jaanus Sellin
095d4d7074
chore: remove newStrategyDropdown flag (#9952) 2025-05-12 11:11:25 +03:00
Thomas Heartman
920b550051
fix: avoid focus loss when using popover (and don't close multi-value popover after adding a value) (#9951)
Fixes an issue where you would lose keyboard focus when interacting with
one of the input fields in the new editable constraint.

The fix was spinning out the inputs into their own separate component.
This prevents them from being re-rendered every time (or something idk)
which allows us to keep focus.

It also stops the popover for multi-value constraint operators from
closing after you've entered a value; allowing for faster entry of more
values (as was intended and as was how it functioned previously).
2025-05-09 19:44:28 +02:00
Thomas Heartman
fbc58ca1fc
fix difference calc and add tests (#9950)
Fixes a whoopsie in the difference function and adds tests at the same
time.
2025-05-09 18:47:52 +03:00
Melinda Fekete
278421a1c8
docs: change 'Get a demo' to 'Start free trial' (#9947)
Change the main docs CTA from 'Get a demo' to 'Start free trial'
2025-05-09 16:51:29 +02:00
Mateusz Kwasniewski
e414c4446d
feat: remove instances older than 1 day not 2 days (#9944) 2025-05-09 13:58:52 +02:00
Jaanus Sellin
7a012ce910
feat: add tooltips to constraint operator buttons (#9941)
![image](https://github.com/user-attachments/assets/9e40b6f8-a98e-48e0-a931-a946ad6ec9cf)
2025-05-09 14:56:32 +03:00
Tymoteusz Czech
fd4042db00
chore: update frontend OpenAPI models - (#9943)
project link templates
2025-05-09 13:05:22 +02:00
Tymoteusz Czech
f02c883da5
feat: external link templates (#9927)
Adds support for link templates in projects, allowing reusable URL
patterns with placeholders. Includes validation, database changes,
updated API schemas, and tests.
2025-05-09 12:40:14 +02:00
Thomas Heartman
e4ead3bd67
Refactor: get rid of editable constraint wrapper (#9921)
This (admittedly pretty big) PR removes a component layer, moves all
logic for updating constraint values into a single module, and dumbs
down other components.

The main changes are:
- EditableConstraintWrapper is gone. All the logic in there has been
moved into the new `useEditableConstraint` hook. Previously it was split
between the wrapper, editableConstraint itself, the legalValues
component.
- the `useEditableConstraint` hook accepts a constraint and a save
function and returns an editable version of that constraint, the
validator for input values, a function that accepts update commands,
and, when relevant, existing and deleted legal values.
- All the logic for updating a constraint now exists in the
`constraint-reducer` file. As a pure function, it'll be easy to unit
test pretty thoroughly to make sure all commands work as they should
(tests will come later)
- The legal values selector has been dumbed down consiberably as it no
longer needs to create its own internal weak map. The internal
representation of selected values is now a set, so any kind of lookup is
now constant time, which should remove the need for the extra layer of
abstraction.

## Discussion points

I know the reducer pattern isn't one we use a *lot* in Unleash, but I
found a couple examples of it in the front end and it's also quite
similar to how we handle state updates to change request states. I'd be
happy to find a different way to represent it if we can keep it in a
single, testable interface.

Semi-relatedly: I've exposed the actions to submit for the updates at
the moment, but we could map these to functions instead. It'd make
invocations a little easier (you wouldn't need to specify the action
yourself; only use the payload as a function arg if there is one), but
we'd end up doing more mapping to create them. I'm not sure it's worth
it, but I also don't mind if we do 💁🏼
2025-05-09 11:47:22 +02:00
Nuno Góis
bfc583b5b7
chore: prevent duplicate key errors in unknown flags (#9940)
https://linear.app/unleash/issue/2-3561/fix-duplicate-key-errors-in-unknown-flags

This should prevent `duplicate_key` errors in unknown flags.

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-09 10:02:38 +01:00
Jaanus Sellin
8b115122fc
chore: fix strategy tests (#9922)
This is still in progress.
2025-05-09 11:10:45 +03:00
Mateusz Kwasniewski
43efaf7c47
feat: report feature links by domain (#9936) 2025-05-09 09:39:15 +02:00
Mateusz Kwasniewski
857ee7da5c
feat: prevent more than 10 links in the UI and backend (#9937) 2025-05-08 21:21:28 +02:00
Thomas Heartman
c72f39bb4f
chore: make operator checking more ergonomic and type-ful (#9932)
This is a helper PR for a refactor I'm working on for the new constraint
inputs. In the refactoring, it's useful to have individual subtypes for
the various subgroups of operators and to be able to easily assert
whether something is X operator or not.

The only change required in the code base is a single check for
operators, which is now handled by using the new `isXOperator` functions
instead.

Yes, the operator file in constants now includes functions, but it
seemed useful to put the identification functions there instead of
somewhere unrelated. The tests are primarily to ensure that the
identifier function works, and I'd be happy to remove them if we think
it's necessary. That said, they're pretty simple unit tests, so I think
it's fine to leave them.

The main bulk of the change is: removing the explicit `: Operator[]`
typing to the various sub-sets of operators and instead adding explicit
types. Additionally, there's the new identifier functions.
2025-05-08 14:10:57 +02:00
Mateusz Kwasniewski
a3ac624deb
feat: report top used domains (#9934) 2025-05-08 14:06:10 +02:00
Tymoteusz Czech
499ee1e099
migration: project settings - external link templates (#9933) 2025-05-08 13:51:21 +02:00
Mateusz Kwasniewski
28e5f39548
feat: store domain for links (#9931) 2025-05-08 13:33:41 +02:00
Mateusz Kwasniewski
9ca44e6188
feat: add domain to links (#9930) 2025-05-08 13:20:47 +02:00