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

2515 Commits

Author SHA1 Message Date
Thomas Heartman
5d32d149cd
feat: add stale flag count to project status payload (#8751)
This PR adds stale flag count to the project status payload. This is
useful for the project status page to show the number of stale flags in
the project.
2024-11-14 14:10:10 +00:00
Tymoteusz Czech
3699646680
Restore additional feedback page (#8750)
Partial revert of 656483d819
Reuse search feedback.
2024-11-14 12:01:45 +02:00
Mateusz Kwasniewski
4fabf49706
feat: show deleted user sessions (#8749) 2024-11-14 10:30:31 +01:00
Jaanus Sellin
ec9be77383
feat: licensed users migration table (#8748) 2024-11-14 10:59:29 +02:00
Tymoteusz Czech
60fb647489
Count active browser sessions per user (#8736)
Show info on how many devices a user is logged in to an admin.
2024-11-13 15:49:25 +00:00
Mateusz Kwasniewski
bcbbd5c3e6
refactor: sessions for user without error (#8742) 2024-11-13 16:37:05 +01:00
Mateusz Kwasniewski
c6519cd95d
feat: delete stale user sessions (#8738) 2024-11-13 15:41:07 +01:00
Jaanus Sellin
d2daae5857
feat: prometheus now gets licensed users data (#8740)
We have the licensed users service implemented, this just spread the
data to prometheus.
2024-11-13 16:00:47 +02:00
Jaanus Sellin
940182aaf0
feat: introduce new term licensed users (#8737)
Introducing new term Licensed users.
Added query to read it from database and extensive tests to cover the
logic.
2024-11-13 14:32:58 +02:00
Mateusz Kwasniewski
61e297dd22
fix: password auth metrics (#8735) 2024-11-13 12:10:53 +01:00
Mateusz Kwasniewski
bb0403d551
feat: metrics for password and scim enabled (#8730) 2024-11-13 10:07:06 +01:00
Thomas Heartman
a964868e00
1-3093: round the project health (#8718)
This PR rounds the average health score we show for a project. With
fractional numbers, it'd often overflow the graph. It also doesn't
really give you much extra info, so we can round it. The rounding is
then used both in the text, in the graph, and to calculate the graph
fill percentage.

Before:

![image](https://github.com/user-attachments/assets/8d0fea3d-411d-42fb-bd80-d2683a63cdf2)

After:

![image](https://github.com/user-attachments/assets/f5c51742-8a2c-4b1a-bca3-7e812b9a1072)
2024-11-12 15:44:29 +02:00
Jaanus Sellin
c8bc40146a
feat: email will be stored hashed now for all users (#8720)
Adding email_hash column to users table.
We will update all existing users to have hashed email. 
All new users will also get the hash.

We are fine to use md5, because we just need uniqueness. We have emails
in events table stored anyways, so it is not sensitive.
2024-11-12 13:28:19 +02:00
Thomas Heartman
24a30e5ec3
Update orval for project status lifecycle (#8716)
Update schema and orval for project status to add lifecycle information
2024-11-12 09:28:27 +00:00
Nuno Góis
11d264541d
chore: add release plan events (#8715)
Adds new release plan events. 

These will be triggered by the new release plans API.
2024-11-12 08:59:36 +00:00
Thomas Heartman
8493bee272
feat(1-3085): hook up lifecycle read model data to endpoint (#8709)
This PR hooks up the project lifecycle summary read model to the service
and exposes the lifecycle summary data in the controller.
2024-11-11 11:22:28 +01:00
Christopher Kolstad
92f7acbfc4
task: added release plan template permissions to permissions.ts (#8708) 2024-11-11 11:05:19 +01:00
Christopher Kolstad
d417dda229
task: added migration for release plan template permissions (#8707)
Due to the cascade on the permission in role_permission, the down
migration does not need to remove the rows from role_permission.
2024-11-11 10:42:38 +01:00
Jaanus Sellin
961501567c
feat: remove excessing debug logging (#8701)
This debugger has been spamming me locally and I think this was
forgotten during some development. Removing.
2024-11-08 14:57:26 +02:00
Thomas Heartman
f92441fa50
chore: put project lifecycle read model in own directory + add fake (#8700)
This PR moves the project lifecycle summary to its own subdirectory and
adds files for types (interface) and a fake implementation.

It also adds a query for archived flags within the last 30 days taken
from `getStatusUpdates` in `src/lib/features/project/project-service.ts`
and maps the gathered data onto the expected structure. The expected
types have also been adjusted to account for no data.

Next step will be hooking it up to the project status service, adding
schema, and exposing it in the controller.
2024-11-08 11:33:03 +00:00
Thomas Heartman
b141981f91
1-3085: count flags in each stage (#8699)
This PR adds the next query to the lifecycle read model: how many flags
are in each stage.
2024-11-08 10:41:42 +00:00
Thomas Heartman
0a250a7526
tests: add more tests for the lifecycle avg calculation query (#8698)
This PR adds more tests to check a few more cases for the lifecycle
calculation query. Specifically, it tests that:
- If we don't have any data for a stage, we return `null`.
- We filter on projects
- It correctly takes `0` days into account when calculating averages.
2024-11-08 11:29:17 +01:00
Thomas Heartman
e07aab68cc
feat: Add lifecycle summary info read model + average time spent in lifecycle query (#8691)
This PR adds a project lifecycle read model file along with the most
important (and most complicated) query that runs with it: calculating
the average time spent in each stage.

The calculation relies on the following:
- when calculating the average of a stage, only flags who have gone into
a following stage are taken into account.
- we'll count "next stage" as the next row for the same feature where
the `created_at` timestamp is higher than the current row
- if you skip a stage (go straight to live or archived, for instance),
that doesn't matter, because we don't look at that.

The UI only shows the time spent in days, so I decided to go with
rounding to days directly in the query.

## Discussion point:

This one uses a subquery, but I'm not sure it's possible to do without
it. However, if it's too expensive, we can probably also cache the value
somehow, so it's not calculated more than every so often.
2024-11-08 09:45:47 +00:00
Tymoteusz Czech
656483d819
chore: remove stale flags (#8689)
- `projectOverviewRefactorFeedback`
- `featureSearchFeedbackPosting`
- `featureSearchFeedback`
2024-11-08 09:40:17 +01:00
Jaanus Sellin
d6c03fdbfa
feat: health score backend (#8687)
Implements the backend part for project health.

---------

Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2024-11-07 13:22:01 +02:00
Mateusz Kwasniewski
e039cdc85c
feat: count recently deleted users (#8688) 2024-11-07 11:57:47 +01:00
Tymoteusz Czech
f5eafe6d49
Fix: email colors on iOS (#8680)
Force light mode in Apple mail, preventing issues with button text
colors.
2024-11-06 14:28:49 +00:00
Thomas Heartman
2615a71474
test: add tests for project resources data (#8675)
Adds a test that checks all the values in the project status' resources
object.
2024-11-06 13:30:45 +00:00
Thomas Heartman
c70c023143
refactor: introduce countProjectTokens method on ApiTokenStore (#8674)
This change introduces a new method `countProjectTokens` on the
`IApiTokenStore` interface. It also swaps out the manual filtering for
api tokens belonging to a project in the project status service.
2024-11-06 13:13:44 +00:00
Jaanus Sellin
76bf6dbcb8
fix: active flags double stale flags (#8673)
Do not count stale flags as potentially stale flags to remove
duplicates.
Stale flags feel like more superior state and it should not show up
under potentially stale.
2024-11-06 15:04:07 +02:00
Thomas Heartman
8a5771dd50
chore (1-3076): add remaining "project resources" to status payload (#8660)
This PR adds member, api token, and segment counts to the project status
payload. It updates the schemas and adds the necessary stores to get
this information. It also adds a new query to the segments store for
getting project segments.

I'll add tests in a follow-up.
2024-11-06 11:46:04 +00:00
Christopher Kolstad
4ed5b1bb8a
task: Added Release Plan Template events (#8668)
As part of the release plan template work. This PR adds the three events
for actions with the templates.

Actually activating milestones should probably trigger existing
FeatureStrategyAdd events when adding and FeatureStrategyRemove when
changing milestones.
2024-11-06 12:15:01 +01:00
Jaanus Sellin
d6e722b7b3
feat: activity chart polish (#8665)
![image](https://github.com/user-attachments/assets/a97f5745-1300-473e-80af-54f0cfc985e1)
2024-11-06 12:00:42 +02:00
Mateusz Kwasniewski
ba72be6169
chore: export user subscriptions read model (#8664) 2024-11-06 09:34:38 +01:00
Nuno Góis
16e136e42c
chore: add flagOverviewRedesign flag (#8653)
https://linear.app/unleash/issue/2-2916/create-a-new-flag-for-the-new-feature-flag-overview-page-redesign

Adds the `flagOverviewRedesign` feature flag, allowing us to toggle the
new feature flag overview page redesign.
2024-11-05 15:53:15 +00:00
Tymoteusz Czech
7aa74cccd3
feat: add user preference change to event log (#8652) 2024-11-05 14:52:11 +00:00
Thomas Heartman
2b13aff4f1
feat: hook up project resources API to resources widget (#8657)
This PR wires up the connectedenvironments data from the API to the
resources widget.

Additionally, it adjusts the orval schema to add the new
connectedEnvironments property, and adds a loading state indicator for
the resource values based on the project status endpoint response.

As was discussed in a previous PR, I think this is a good time to update
the API to include all the information required for this view. This
would get rid of three hooks, lots of loading state indicators (because
we **can** do them individually; check out
0a334f9892)
and generally simplify this component a bit.

Here's the loading state:

![image](https://github.com/user-attachments/assets/c9938383-afcd-4f4b-92df-c64b83f5b1df)
2024-11-05 14:50:51 +01:00
Mateusz Kwasniewski
a2a94dd011
feat: user profile returns user subscriptions (#8656) 2024-11-05 14:17:37 +01:00
Tymoteusz Czech
2017ab7719
test(productivity-report): user subscripton read model (#8654) 2024-11-05 14:04:18 +01:00
Tymoteusz Czech
471cb796c9
migration(producitivty-report): cascade user unsubscription (#8655)
Remove opt-outs for deleted users. This is useful in tests, where we
delete users permanently.
2024-11-05 13:54:32 +01:00
weekwith.me
ef8417a08d
feat: Make disableMigration option handled by environment variable (#8634)
In some cases, people want to disable database migration. For example,
some people or companies want to grant whole permissions to handle the
schema by DBAs, not by application level hence I use
`parseEnvVarBoolean` to handle `disableMigration` option by environment
variable. I set the default value as `false` for the backward
compatibility.
2024-11-05 13:13:49 +01:00
Mateusz Kwasniewski
b5a2befec7
feat: export transactional user subscriptions service (#8651) 2024-11-05 11:52:15 +01:00
Thomas Heartman
1897f8a19d
chore: add connected environments to project status payload (#8645)
This PR adds connected environments to the project status payload.

It's done by:
- adding a new `getConnectedEnvironmentCountForProject` method to the
project store (I opted for this approach instead of creating a new view
model because it already has a `getEnvironmentsForProject` method)
- adding the project store to the project status service
- updating the schema

For the schema, I opted for adding a `resources` property, under which I
put `connectedEnvironments`. My thinking was that if we want to add the
rest of the project resources (that go in the resources widget), it'd
make sense to group those together inside an object. However, I'd also
be happy to place the property on the top level. If you have opinions
one way or the other, let me know.

As for the count, we're currently only counting environments that have
metrics and that are active for the current project.
2024-11-05 11:12:08 +01:00
Mateusz Kwasniewski
6a8a75ce71
feat: composition root for user subscriptions (#8649)
Co-Authored-By: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com>
2024-11-05 10:50:31 +01:00
Tymoteusz Czech
2bd2d74f83
feat: User subscriptions store and service (#8648)
Co-authored-by: kwasniew <kwasniewski.mateusz@gmail.com>
2024-11-05 10:14:47 +01:00
Thomas Heartman
a7d581aa7d
fix: set a dynamic yesterday date instead of a fixed one. (#8646)
This was an oversight. The test would always fail after 2024-11-04,
because yesterday is no longer 2024-11-03. This way, we're using the
same string in both places.
2024-11-05 08:15:54 +00:00
Tymoteusz Czech
4a67607a0c
fix(productivity-report): email table alignment on mobile (#8641) 2024-11-04 14:14:36 +01:00
Jaanus Sellin
0ce49c789e
feat: now backend returns event counts for activity chart (#8638) 2024-11-04 14:29:10 +02:00
Mateusz Kwasniewski
6f09bcdee1
feat: unsubscribe link to user profile (#8637) 2024-11-04 12:10:32 +01:00
sjaanus
1c53256887
fix: remove extra event search controller 2024-11-04 09:49:52 +02:00