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

13186 Commits

Author SHA1 Message Date
renovate[bot]
a1f195b47c
chore(deps): update material-ui monorepo 2025-02-18 12:37:10 +00:00
Thomas Heartman
14b6b38238
feat(1-3379): add stale badge to the new header (#9320)
Without this, there's no way to tell if a flag is stale or not on the
flag page, so we're adding it back in. However, we'll only show the
badge if it's stale, not if it's an active flag.

Stale flag with badge:

![image](https://github.com/user-attachments/assets/eded97ab-0bba-41e5-8e1c-37cc90684c63)

When it wraps:

![image](https://github.com/user-attachments/assets/223eb672-20d2-4f3c-a5d9-34c3b739ce5e)

To make the badge line up properly when it wraps, I removed the
hard-coded margin in the badge. To counteract that, I've also removed
the hard-coded margin in the "copy name" button and switched to using
flex gaps to sort that.

It still looks right.

Before:

![image](https://github.com/user-attachments/assets/d945b067-c182-4448-967f-5505cf2e47ca)

After:

![image](https://github.com/user-attachments/assets/3b78b9fc-82b9-4d21-a53a-a3849819e916)
2025-02-18 12:34:46 +00:00
Thomas Heartman
4701dc1552
refactor: move feature overview header into separate file (#9319)
This PR moves the flag page header into a separate file, so that the
overview file is more clearly focused on the overview.

Additionally, it moves the modals that are triggered from the header
into the new file. This should give a nice little performance boost, as
opening and closing these modals should no longer trigger a re-rendering
of the full flag overview page, only the header.
2025-02-18 11:35:40 +01:00
Tymoteusz Czech
2ede2a6578
feat: new flag info box (#9308)
- updated spacing of elements
- modified header and "flag type" 
- added "collaborators"
- refactored tags

Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-02-18 10:30:52 +01:00
Thomas Heartman
b15502ec5e
fix(1-3377): handle singular counts in project status lifecycle boxes (#9317)
If the average number of days in a stage is 1, use `1 day` instead of
`1 days`.

Likewise, if your total number of archived flags is 1, use `1 flag
archived` instead of `1 flags archived`.

I grepped through the file, but couldn't find any other hardcoded
instances of "flags" or "days", so I think this is everything.
2025-02-17 12:41:04 +00:00
Thomas Heartman
134c32589a
fix(1-3375): Fix unintended scroll on dashboard (#9316)
Fixes a bug where the dashboard would scroll you down from the top of
the page on load if your window was too short too see both the
selected flag and the selected project.

This solves it by immediately scrolling to the top of the page after
scrolling your selected element into view. Because this hook only runs
on page load, it shouldn't be safe. (At least I couldn't make this
misbehave with manual testing).

It also changes the list scroll behavior to scroll your selected item
to the top of the list instead of to the bottom (effectively). During
testing, that seems like a better solution to me.

## Background (or why do we auto-scroll here?)

The dashboard's flag and projects panels stores your last selection,
so that when you return to the page you'll be shown what you were
looking at last. This is especially useful if you have a lot of flags
but you're focusing on one in particular.

However, if you **do** have a lot of flags, then it's also quite
likely that your selection will be "below the fold" of the panel, and
you won't see your selected flag/project immediately in the
list (without scrolling).

It seemed like a nice UI affordance to automatically bring your
selected item into view (especially because without it, there's no way
to see what flag/project) you're looking at, so I added the

[`scrollIntoView`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView)
hook.

What I didn't realize, however, is that it scrolls all scrollable
ancestor containers, which means that if your screen is too short,
it'll scroll you down the page.

From my reading of the docs and some local testing, I don't think
there is a way to limit the scrolling to only the nearest ancestor, so
the easiest way to ensure that we're always at the top seemed to be to
just scroll to the immediately after.
2025-02-17 12:07:35 +01:00
Mateusz Kwasniewski
b207606800
fix: delete project segment with change request (#9315) 2025-02-17 10:41:56 +01:00
Ivar Conradi Østhus
3f730bb7f3
fix: add a metric to track client registrations (#9314)
Adding a counter to track every time a client registers with Unleash.
2025-02-17 09:01:19 +01:00
Christopher Kolstad
edd03d02dd
task: add status_code to edge traffic table to store 304s as well (#9312) 2025-02-14 14:52:45 +01:00
Thomas Heartman
aafacc68cf
feat: new flag header (#9302)
Initial spike to add the new design for the flag page header
2025-02-14 14:33:35 +01:00
Tymoteusz Czech
8dc6fbf149
fix(1-3374): access e2e test (#9313)
Fix e2e test, failing because of subtle table syntax change. Nested `span`s are counted twice in Cypress `:contains`
2025-02-14 13:33:17 +00:00
Jaanus Sellin
4a72580b24
fix: return undefined from delta if no events (#9311)
Nameprefix can remove events from result, so we should send 304 in that
case.
2025-02-14 12:28:43 +02:00
Nuno Góis
0e208fd8eb
chore: add change request events to teams integration (#9309)
https://linear.app/unleash/issue/2-3265/investigate-teams-integration-for-change-request-notifications

Adds change request events to the Teams integration.
2025-02-14 09:43:56 +00:00
Christopher Kolstad
1dad28fdb5
task: add edge observability tables (#9307)
Adds two stat tables to store edge observability data.
2025-02-14 08:48:13 +00:00
Fredrik Strand Oseberg
fa43420ab9
fix: mutating delta events (#9303)
Fix a bug where delta events would be mutated due to Object.assign.
2025-02-14 10:30:14 +02:00
Jaanus Sellin
aa15fbee9a
fix: hydration event should update with every event (#9310)
We were not updating hydration event id. This fixes it.
2025-02-14 09:35:08 +02:00
Christopher Kolstad
8de801025f
task: make setting service handle conflict on insert (#9160)
Currently, in enterprise we're struggling with setting service and
transactionality; all our verfications says that the setting key is not
present, so setting-store happily tries to insert a new row with a new
PK. However, somehow at the same time, the key already exists. This
commit adds conflict handling to the insertNewRow.
2025-02-13 15:54:43 +01:00
Melinda Fekete
1036fb6012
Update js tutorial to fix bugs and writing style (#9304) 2025-02-13 15:14:51 +01:00
Jaanus Sellin
8d998c82d8
chore: bump unleash client version to beta 6.5 (#9305) 2025-02-13 10:42:54 +02:00
Gastón Fournier
cbbf255d9e
docs: include create db permission required for new tests (#9301) 2025-02-12 16:36:03 +01:00
Tymoteusz Czech
b5bd5ee3f2
refactor: MuiTab font sizes (#9296)
I didn't find where this style is taken into account, but I don't like
leaving `1rem` when everything else is scaled down to 15px
2025-02-12 15:13:22 +01:00
Thomas Heartman
243088fdca
fix: Add strategy and more strategies button are different heights (#9300)
Fixes the height discrepancy between add strategy and more strategies
buttons, both with and without the flag enabled.

The essence of the fix is to make the "more strategies" button's height
dynamic and grow to match the height of the other button.



Before (flag enabled):

![image](https://github.com/user-attachments/assets/4dda44b3-3add-40cd-93ed-48150e73ac35)

After (flag enabled):

![image](https://github.com/user-attachments/assets/2788f141-fe64-4733-9202-f9f115396001)


Before (flag disabled):

![image](https://github.com/user-attachments/assets/c3a9d396-cb30-4a61-9400-45458189d3f2)

After (flag disabled):

![image](https://github.com/user-attachments/assets/0570ff85-401a-4e6f-93e7-d1619a4cd848)

As a bonus: also enables the ui font redesign flag for server-dev.

If you're very sharp-eyed, you might notice a few things:

1. There's more padding on the new button. This was done in concert with
UX when we noticed there was more padding on other buttons. So as a
result, we set the button type to the default instead of "small".

1. The kebab button isn't perfectly square with the flag on. There's a
few issues here, but essentially: to use `aspect-ratio: 1`, you need
either a height or a width set. Because we want everything here to be
auto-generated (use the button's intrinsic height), I couldn't make it
work. In the end, I think this is close enough. If you have other ideas,
you're very welcome to try and fix it.
2025-02-12 13:54:06 +01:00
Nuno Góis
151db95c2d
feat: frontend API POST endpoint (#9291)
https://linear.app/unleash/issue/2-3260/implement-post-request-support-in-unleashs-frontend-api

Implements the POST endpoint in Unleash's frontend API.
2025-02-12 11:56:51 +00:00
Thomas Heartman
5c23a52119
fix: add some missing button labels on the project page (#9299)
Adds aria-labels to the env visibility toggle button and the "copy
env" button.
2025-02-12 09:39:03 +01:00
Thomas Heartman
f4e87389f1
fix: make the chip in the playground project selector small (#9298)
This makes it the same size as the env selector, fixing a slight
visual misalignment.

Doing a reference check, I can't find any other uses of this selector,
so I'm making the changes directly.

Before:

![image](https://github.com/user-attachments/assets/a9847dc7-8237-46bd-8d5b-7149a5682a59)

After:

![image](https://github.com/user-attachments/assets/a78d71ed-3391-4f72-9c8f-64f926a821cf)
2025-02-12 09:38:49 +01:00
David Leek
5921f0ea09
chore: add migration that backfills scim user email hashes (#9295) 2025-02-12 09:05:36 +01:00
Melinda Fekete
17e93509e9
Upgrade docusaurus (#9284)
Upgrade docusaurus and fix mermaid bug
2025-02-11 17:37:14 +01:00
Tymoteusz Czech
b035299a18
fix: command bar spacing (#9288) 2025-02-11 16:17:24 +01:00
Mateusz Kwasniewski
54766fd4a0
feat: connection count usage (#9294) 2025-02-11 16:15:45 +01:00
Gastón Fournier
8045fbe13a
chore: use gitcliff changelog for release (#9289)
This is to reuse the gitcliff output for the release
2025-02-11 15:56:40 +01:00
Github Actions Bot
140290a94b 6.7.1 2025-02-11 13:46:38 +00:00
Github Actions Bot
c2d6cd3f1f docs: Update CHANGELOG.md 2025-02-11 13:46:27 +00:00
Thomas Heartman
abb0450a6a
fix: Use the right theme even if the payload is a variant. (#9292)
Also, use extra css selectors to increase specificity so that this
takes precedence over the MUI themes.

I don't like that we need to do this weird selector thing, but hey, it
is what it is.
2025-02-11 13:28:36 +00:00
Tymoteusz Czech
cac38b0cee
fix: font size flag change to boolean (#9290)
## About the changes
Fix for `uiGlobalFontSize` flag being returned as an object, which is truthy.
2025-02-11 13:24:18 +01:00
Gastón Fournier
5e9698fe63
chore: Create test db from template (#9265)
## About the changes
Based on the first hypothesis from
https://github.com/Unleash/unleash/pull/9264, I decided to find an
alternative way of initializing the DB, mainly trying to run migrations
only once and removing that from the actual test run.

I found in [Postgres template
databases](https://www.postgresql.org/docs/current/manage-ag-templatedbs.html)
an interesting option in combination with jest global initializer.

### Changes on how we use DBs for testing

Previously, we were relying on a single DB with multiple schemas to
isolate tests, but each schema was empty and required migrations or
custom DB initialization scripts.

With this method, we don't need to use different schema names
(apparently there's no templating for schemas), and we can use new
databases. We can also eliminate custom initialization code.

### Legacy tests

This method also highlighted some wrong assumptions in existing tests.
One example is the existence of `default` environment, that because of
being deprecated is no longer available, but because tests are creating
the expected db state manually, they were not updated to match the
existing db state.

To keep tests running green, I've added a configuration to use the
`legacy` test setup (24 tests). By migrating these, we'll speed up
tests, but the code of these tests has to be modified, so I leave this
for another PR.

## Downsides
1. The template db initialization happens at the beginning of any test,
so local development may suffer from slower unit tests. As a workaround
we could define an environment variable to disable the db migration
2. Proliferation of test dbs. In ephemeral environments, this is not a
problem, but for local development we should clean up from time to time.
There's the possibility of cleaning up test dbs using the db name as a
pattern:
2ed2e1c274/scripts/jest-setup.ts (L13-L18)
but I didn't want to add this code yet. Opinions?

## Benefits
1. It allows us migrate only once and still get the benefits of having a
well known state for tests.
3. It removes some of the custom setup for tests (which in some cases
ends up testing something not realistic)
4. It removes the need of testing migrations:
https://github.com/Unleash/unleash/blob/main/src/test/e2e/migrator.e2e.test.ts
as migrations are run at the start
5. Forces us to keep old tests up to date when we modify our database
2025-02-11 13:01:43 +01:00
Github Actions Bot
a8ea174ead 6.7.0 2025-02-11 10:56:32 +00:00
Github Actions Bot
5e38a23cf9 docs: Update CHANGELOG.md 2025-02-11 10:56:22 +00:00
Gastón Fournier
e587b2c892
chore: remove concurrency block (#9286)
This is to unblock the release
![Screenshot from 2025-02-11
11-20-56](https://github.com/user-attachments/assets/99122eaa-850b-4d7b-bd67-ae3604edd24f)
2025-02-11 10:52:27 +00:00
Gastón Fournier
4a2450050e
chore: Retry release 6.7 (#9287)
Undo release commits
2025-02-11 11:51:37 +01:00
Thomas Heartman
63dbd40a2e
chore: add button styles to dark mode too (#9285)
This adds the same button stylings to the dark theme as we did to the
light theme in #9275.
2025-02-11 11:17:05 +01:00
Thomas Heartman
43a5d59225
fix: add legacy button styles (#9283)
Adds the button styles that were removed from `app.css` into the
legacy theme file. These change very slightly when the flag is on, and
because the hardcoded `app.css` styles have been removed, we'll use
the legacy file as fallback.
2025-02-11 09:32:26 +00:00
Github Actions Bot
abae81234a 6.7.0 2025-02-11 08:54:00 +00:00
Github Actions Bot
04faf6766d docs: Update CHANGELOG.md 2025-02-11 08:53:49 +00:00
Thomas Heartman
65bec89d3c
chore(1-3356): make mui buttons respect font size changes (#9275)
Makes the MUI buttons use `body1.fontSize` for their own font size.

Turns out we had a hardcoded `16px` in the `app.css` file, which made it
hard to override. This change removes mui button styling in `app.css`
and puts it into the `theme.ts` file instead.

Also updates the border radius to match the one we use in the theme
(from 3px to 4px). It's a subtle change:

before:

![image](https://github.com/user-attachments/assets/a6f94250-9b4b-43e0-aa65-280f3fa007bb)


after:

![image](https://github.com/user-attachments/assets/3ef205c8-8119-4bf1-9541-39371b26dda9)
2025-02-11 08:33:27 +00:00
Thomas Heartman
fd1ad5ac5b
fix: some accessibility issues (#9282)
Fixes a small number of accessibility issues that Firefox was
complaining about (and some that I noticed myself):

1. In `CommandBar.tsx`, use a `Label` element instead of aria-label. We
can hide it with the `ScreenReaderOnly` component.
2. Add an `aria-label` to the icon button in the sidebar. (side note:
should we do any fancy detection on whether it's cmd + b or ctrl+b
there? I think we do that in the command bar)
3. Update the playground guidance popper;
  i. Add an aria-label to the icon button
ii. Make the popper a `Popover` instead. This fixes a few issues: It
wasn't possible to focus or close just using the keyboard before.
Because it didn't steal focus, it also meant that it'd cover other parts
of the page. Now it traps focus so you can navigate to the close button,
and escape will also close it for you.
iii. Remove aria-describedby. Using aria-describedby on the button would
mean that the **button** is described by its content, which seems wrong.
aria-describedby should also only be used for plain strings. Complex
markups isn't supported. For that aria-details is the right way to go.
But because the popover is only rendered when it's open, the details or
describedby link will point to nothing most of the time.
iv. In doing this, there is a slight change in the popover shadow (I
couldn't find onef of our shadows that did the same thing as before),
but it matches other popovers we have, such as on the data usage tab.

Before:

![image](https://github.com/user-attachments/assets/8c2a3471-949f-4c01-b467-cde06c8980b5)

After:

![image](https://github.com/user-attachments/assets/980114c6-6552-4e75-8a6c-281b97a8af03)
2025-02-11 09:16:20 +01:00
Tymoteusz Czech
23e8040cd9
refactor: theme - font size (#9273) 2025-02-11 09:07:27 +01:00
renovate[bot]
a0164e4c88
chore(deps): update dependency @tanstack/react-virtual to v3.12.0 (#9279)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@tanstack/react-virtual](https://tanstack.com/virtual)
([source](https://redirect.github.com/TanStack/virtual/tree/HEAD/packages/react-virtual))
| [`3.11.3` ->
`3.12.0`](https://renovatebot.com/diffs/npm/@tanstack%2freact-virtual/3.11.3/3.12.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@tanstack%2freact-virtual/3.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@tanstack%2freact-virtual/3.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@tanstack%2freact-virtual/3.11.3/3.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@tanstack%2freact-virtual/3.11.3/3.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>TanStack/virtual (@&#8203;tanstack/react-virtual)</summary>

###
[`v3.12.0`](https://redirect.github.com/TanStack/virtual/releases/tag/v3.12.0)

[Compare
Source](https://redirect.github.com/TanStack/virtual/compare/v3.11.3...v3.12.0)

Version 3.12.0 - 2/3/25, 4:02 AM

#### Changes

##### Feat

- virtual-core: add getVirtualIndexesAPI
([`a1cb9ce`](https://redirect.github.com/TanStack/virtual/commit/a1cb9ce))
by Kevin Van Cott

##### Other

-
([`a485978`](https://redirect.github.com/TanStack/virtual/commit/a485978))
by Kevin Van Cott

#### Packages

-
[@&#8203;tanstack/virtual-core](https://redirect.github.com/tanstack/virtual-core)[@&#8203;3](https://redirect.github.com/3).12.0
-
[@&#8203;tanstack/lit-virtual](https://redirect.github.com/tanstack/lit-virtual)[@&#8203;3](https://redirect.github.com/3).12.0
-
[@&#8203;tanstack/react-virtual](https://redirect.github.com/tanstack/react-virtual)[@&#8203;3](https://redirect.github.com/3).12.0
-
[@&#8203;tanstack/solid-virtual](https://redirect.github.com/tanstack/solid-virtual)[@&#8203;3](https://redirect.github.com/3).12.0
-
[@&#8203;tanstack/svelte-virtual](https://redirect.github.com/tanstack/svelte-virtual)[@&#8203;3](https://redirect.github.com/3).12.0
-
[@&#8203;tanstack/vue-virtual](https://redirect.github.com/tanstack/vue-virtual)[@&#8203;3](https://redirect.github.com/3).12.0
-
[@&#8203;tanstack/angular-virtual](https://redirect.github.com/tanstack/angular-virtual)[@&#8203;3](https://redirect.github.com/3).12.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 7pm every weekday,before 5am
every weekday" in timezone Europe/Madrid, Automerge - At any time (no
schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/Unleash/unleash).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNjQuMSIsInVwZGF0ZWRJblZlciI6IjM5LjE2NC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-10 18:10:28 +00:00
renovate[bot]
99a27d51a9
chore(deps): update dependency @codemirror/state to v6.5.2 (#9278)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@codemirror/state](https://redirect.github.com/codemirror/state) |
[`6.5.1` ->
`6.5.2`](https://renovatebot.com/diffs/npm/@codemirror%2fstate/6.5.1/6.5.2)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@codemirror%2fstate/6.5.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@codemirror%2fstate/6.5.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@codemirror%2fstate/6.5.1/6.5.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@codemirror%2fstate/6.5.1/6.5.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>codemirror/state (@&#8203;codemirror/state)</summary>

###
[`v6.5.2`](https://redirect.github.com/codemirror/state/blob/HEAD/CHANGELOG.md#652-2025-02-03)

[Compare
Source](https://redirect.github.com/codemirror/state/compare/6.5.1...6.5.2)

##### Bug fixes

Fix a bug where reconfiguring a field with a new `init` value didn't
update the value of the field.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 7pm every weekday,before 5am
every weekday" in timezone Europe/Madrid, Automerge - At any time (no
schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/Unleash/unleash).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNjQuMSIsInVwZGF0ZWRJblZlciI6IjM5LjE2NC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-10 18:10:05 +00:00
Melinda Fekete
5c4060d6ae
RBAC page docs fixes (#9276) 2025-02-10 16:54:18 +01:00
Melinda Fekete
1ffcfe826f
Update license policy doc (#9274) 2025-02-10 16:53:27 +01:00