1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
Commit Graph

95 Commits

Author SHA1 Message Date
andreas-unleash
3193423d2d
feat: Project scoped stickiness (#3289)
Project scoped stickiness 
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->

Adds `projectScopedStickiness` flag to experimental.ts
Refactor Stickiness select for reusability
Modify FlexibleStrategy to respect the setting.
Modify EnvironmentVariantModal to respect the setting

## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

<!-- Does it close an issue? Multiple? -->
Closes #

<!-- (For internal contributors): Does it relate to an issue on public
roadmap? -->
<!--
Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#
-->

### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-03-10 12:28:02 +02:00
andreas-unleash
068c55a925
Feat/notifications cypress (#3244)
<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->

## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

<!-- Does it close an issue? Multiple? -->
Closes #
[1-743](https://linear.app/unleash/issue/1-743/add-cypress-test-for-notifications-happy-path)

<!-- (For internal contributors): Does it relate to an issue on public
roadmap? -->
<!--
Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#
-->

### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
2023-03-08 12:47:42 +02:00
Jaanus Sellin
9f93f78fcc
Cypress test for importing (#3058) 2023-02-08 11:16:38 +02:00
sjaanus
b80e84b438
Revert "formatApiPath / formatAssetPath - Implement smart functionality to detect double subpath" (#3001)
Reverts Unleash/unleash#2777
2023-01-26 15:34:42 +01:00
Tymoteusz Czech
ddb9d11039
refactor: styles batch 3 (#2821) 2023-01-11 17:44:21 +01:00
Tymoteusz Czech
1653b0449a
Orval generator POC (#2724)
for #2715
2023-01-05 11:57:53 +01:00
sjaanus
88d649d239
Allow hiding environments from the feature overview screen (#2727) 2023-01-03 15:41:34 +02:00
sjaanus
8a8cd1bf27
UI Flags cleanup (#2778) 2023-01-02 15:41:43 +02:00
sjaanus
d5e47ac352
formatApiPath / formatAssetPath - Implement smart functionality to detect double subpath (#2777)
Today we have two functions that wrap our paths with the subpath. Since
all of our customers are hosted on a subpath, such as /eubb1001, we need
to account for this path when building API paths and asset paths.

These functions could be smarter, we could, for example detect if we
have already added the base path and ignore it if it already exists.

**This PR implements this and adds 2 capabilities:**

1. If there is list of paths that need to be joined and one is subset of
another, it is removed.
2. All duplicate paths in the list are removed
2023-01-02 12:06:33 +02:00
Gastón Fournier
4b519ead4f
perf: Simplify queries to prometheus (#2706)
## About the changes
This PR improves our queries to Prometheus (instead of making multiple queries do only one) and improves the UI and the code. 

The reports aggregate all HTTP methods (GET, POST, PUT, DELETE, OPTIONS, HEAD and PATCH) without distinction under the same "endpoint" (a relative path inside unleash up to a certain depth)

Co-authored-by: Nuno Góis <nuno@getunleash.ai>
2022-12-19 17:06:59 +01:00
Christopher Kolstad
23094b016e
feat: first draft of chart for instance traffic in frontend (#2670)
## What
We've already added the backend for this. This is the initial work for
drawing a chart for instance traffic in the frontend. It requires the environment variable `PROMETHEUS_API` set to a valid prometheus-query-language (promql) supported backend, such as Prometheus itself or Victoria Metrics. Besides, at the moment we're hiding this functionality behind the flag `UNLEASH_EXPERIMENTAL_NETWORK_VIEW` which has to be set to true

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
Co-authored-by: Gastón Fournier <gaston@getunleash.ai>
2022-12-15 08:47:07 +00:00
Mateusz Kwasniewski
cb0398ca63
loosen permissions for change requests (#2682) 2022-12-14 10:00:14 +01:00
Fredrik Strand Oseberg
cef4181f11
Fix/cr UI fixes (#2675)
This PR contains multiple UI fixes for the change request. It changes
font sizes, icon colors, margins and paddings to be more consistent.
2022-12-12 16:32:38 +01:00
Tymoteusz Czech
5f88269744
feat: favorite feature table icons (#2525) 2022-11-30 12:44:38 +00:00
Mateusz Kwasniewski
d1c565735a
linter fixes (#2561) 2022-11-30 10:52:13 +01:00
Mateusz Kwasniewski
0dba973881
Feat/apply changes (#2258)
* feat: add suggested change component

* fix: build

* feat: suggestion header

* ui sketching different toggle changes

* feat: strategy change sets UI tweaks

* refactor: extract nested components

Co-authored-by: Fredrik Oseberg <fredrik.no@gmail.com>
2022-10-26 09:45:24 +02:00
Tymoteusz Czech
b8c3833ae4
Suggest changes - initial frontend (#2213)
* feat: add initial controller

* feat: add fe

* feat: return status codes

* remove backend experiment

* refactor standalone route for project banner

* update suggest changeset type

* refactor changeset mock

* suggest changes banner feature flag

* fix: update routes snapshot

Co-authored-by: Fredrik Oseberg <fredrik.no@gmail.com>
2022-10-20 14:00:48 +02:00
Aneesh Relan
1a09d1778b
feat: prettify large numbers in metrics (#2176)
* prettify large numbers

* add tooltip for larger numbers

* add test ids, add unit test

* move dependency to devDependency

* remove unused import

* use conditional render component

* use prettify large number component for feature overview metrics
2022-10-12 16:19:37 +01:00
olav
ae3d6c06cf
refactor: simplify login redirect logic (#1987) 2022-08-30 09:54:52 +02:00
Nuno Góis
1d43c05131
feat: improve group users select search (#1988)
* feat: improve group users select search

* fix: implement in project access assignment as well

* refactor: move caseInsensitiveSearch helper to util
2022-08-30 08:06:59 +01:00
olav
c880e962ee fix: avoid validating boolean and undefined parameter values (#1244)
* fix: avoid validating boolean parameter values

* fix: avoid validating undefined parameter values
2022-08-24 10:38:08 +02:00
olav
0afb1eadcc fix: relax validation for required params (#1238)
* fix: relax validation for required params

* refactor: inline parameter type checkers
2022-08-22 16:35:51 +02:00
olav
523807359e fix: sort strategy parameters payload (#1218)
* refactor: improve useStrategy fetch hook

* fix: sort strategy parameters payload

* refactor: move React import to the top

* refactor: fix refetchStrategy name
2022-08-12 14:49:26 +02:00
Tymoteusz Czech
859aa435e0 Refine Playground UI (#1217)
* fix playground border radius consistency

* improve playground alerts

* fix: playground segments constraint type logic

* fix: refactor segment execution

* fix: comments

* fix: add summary width

* align playground spacing and borders

* fix build - ts segment type in playground

* fix status cell logic

* update playground disabled env info

* fix playground filter by status and sort

Co-authored-by: Nuno Góis <github@nunogois.com>

Co-authored-by: Fredrik Oseberg <fredrik.no@gmail.com>
Co-authored-by: andreas-unleash <104830839+andreas-unleash@users.noreply.github.com>
Co-authored-by: Nuno Góis <github@nunogois.com>
2022-08-12 10:13:07 +00:00
sjaanus
5ffb63e342 Add cypress tests for project access page (#1215)
* Add tests

* Some fixes

* Fix test
2022-08-12 09:54:32 +00:00
Nuno Góis
3200fee963 fix: remove group owner concept (#1210)
* fix: remove group owner concept

* fix: adapt e2e tests accordingly

* refactor users select to match improvement

* refactor: add user -> edit users

* feat: add edit users to group card actions

* add a few more UI improvements

* fix: edit group users icon

* improve loading behaviour

* fix group users refresh on card view

* improvement: create group form validation

* fix edit group, some refactoring

* fix: e2e tests, minor bugs

* fix: infinite re-renders due to useHiddenColumns useEffect array dependency

* fix re-rendering on useHiddenColumns for some tables

* refactor: validations into functions / variables
2022-08-11 15:34:17 +01:00
Nuno Góis
672a3f0b92 fix: group project access inconsistencies (#1178)
* fix: group project access inconsistencies

* fix relative path

* wip

* refactor: make project tabs work as routes

* refactor: finish refactoring project assign forms

* fix: update snaps

* fix: update snaps

* add some basic cypress e2e tests to groups

* add remaining cypress e2e tests for group CRUD

* add groups e2e to gh workflows

* refactor: simplify useMemo usage

* add GO_BACK navigate const

* fix: remove trailing slash on user creation request

Co-authored-by: olav <mail@olav.io>
Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
2022-08-04 12:57:25 +01:00
olav
59c8822cf2 fix: validate feature strategy parameters (#1192)
* refactor: extract InputCaption component

* refactor: split up GeneralStrategy component

* refactor: fill inn more default feature strategy parameter values

* fix: validate feature strategy parameters

* refactor: fix duplicate keys in strategy icon list

* refactor: expand variable names

* refactor: remove unnecessary useMemo

* refactor: use captions instead of tooltips for boolean parameter descriptions

* refactor: improve strategy definition form spacing
2022-08-04 13:34:30 +02:00
Tymoteusz Czech
850c7a26db fix: minor ui improvements (#1163) 2022-07-28 12:05:48 +02:00
Tymoteusz Czech
c70b38a62a Feature toggle page update (#1140)
* feat: add icon to custom strategies

* feat: update feature toggle screen layout

* strategy and constraints separators

* style disabled envirnments

* strategy constraint style

* strategy drag and drop

* feature env emtpy state

* quick add strategy api

* reorder strategies api integration

* feature strategy header title

* openapi update

* style small chip component

* fix comments after review

* fix issues with strategy constraint operators

* Revert "openapi update"

This reverts commit 27e7651ebae26f61ca76ec910e1f209bae7f2955.

* fix tooltip ref
2022-07-27 10:00:15 +00:00
Nuno Góis
df6208e309 feat: add user groups (#1130)
* feat: add user groups table

* add groups and group view

* fix top level await on mock data

* add UG flag

* create group files, refactor group cards

* add generic badge component

* adapt hooks to use endpoints

* implement basic create group

* fix: update snap

* fix: type id as string for now

* implement create group, use api, refactoring

* add stars to group owners

* refactor GroupForm.tsx to use styled components

* feat: remove group

* add edit group

* add group card actions

* feat: edit and remove group users

* add users to groups

* Initial commit

* refine project access table

* add project access group view

* Take users and groups from backend

* Add onsubmit

* new project access, assign and edit

* fix EditGroup, Group

* Finish assigning roles in project

* List assigned projects in group card

* Run prettier

* Add added column to project access table

Co-authored-by: Jaanus Sellin <jaanus@getunleash.ai>
Co-authored-by: sighphyre <liquidwicked64@gmail.com>
2022-07-22 07:31:08 +00:00
Tymoteusz Czech
9d74fd976d Refine playground form (#1136)
* integrate results table with playground form

* fix playground api integration

* fix: playground loading state from api
2022-07-13 14:35:43 +00:00
olav
583d636144 refactor: fix handling of expired/churned trial states (#1107) 2022-06-21 11:22:27 +02:00
Tymoteusz Czech
aaaefa864d Merge branch 'main' into archive_table 2022-06-14 11:51:29 +02:00
olav
f46047f10a refactor: fix trial expiration calculations (#1090)
* refactor: fix trial expiration calculations

* refactor: count full trial days for warning banner

* refactor: fix flaky test
2022-06-14 11:51:11 +02:00
Tymoteusz Czech
349106a2be fix: sort order across the app
discussed with Nicolae and Nuno
2022-06-14 11:14:56 +02:00
olav
3add10ccbe refactor: simplify error toast text (#1081)
* refactor: simplify error toast text

* refactor: simplify 404 error text
2022-06-09 15:36:01 +02:00
Tymoteusz Czech
608171ce93 Improve table performance (#1061)
* improve table performance

* revert to react-router navigation
2022-06-09 11:34:55 +02:00
olav
006b853f6c refactor: get segment limits from uiConfig (#1047)
* refactor: improve useUiConfig return type

* refactor: get segment limits from uiConfig
2022-06-02 10:58:55 +02:00
olav
f4d02e37b7 refactor: rewrite feature strategy icons list (#1039)
* refactor: fix strategy action icon layout

* refactor: use a custom SVG for the rollout strategy icon

* refactor: rewrite feature strategy icons list
2022-05-31 10:50:24 +02:00
Nuno Góis
570e9f88be feat: upgrade users table (#1040)
* feat: upgrade users table

* fix misc ui/ux bugs

* refactor: address PR comments

* fix: searching by `undefined`

* fix: searching for undefined on invoices, table placeholder centering

* refactor: abstract users list actions into new component

* refactor: move styled components to top of files
2022-05-31 07:59:09 +01:00
olav
eb5e83cdb4 refactor: remove unused code (#1036)
* refactor: remove unused code

* refactor: remove more unused code
2022-05-27 13:28:58 +02:00
Nuno Góis
7093b49962 feat: add billing page to admin (#993)
* feat: add billing page to admin

* some adjustments to billing page

* add BillingHistory, remove invoices, misc improvements

* refactor based on instanceStatus logic, add dialog

* fix: cleanup

* some refactoring and alignment with figma

* add extend, isBilling, refactoring and misc improvements

* fix: update tests

* refactor: reorganize billing into smaller components, misc improvements

* add STRIPE flag, some refactoring and adapting to comments and discussion

* adapt BillingHistory slightly, refactor TextCell

* Update src/hooks/api/getters/useInstanceStatus/useInstanceStatus.ts

Co-authored-by: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com>

* refactor: address PR comments

* fix: adjust divider color

* fix: update snaps

* refactor: address PR comments

* fix: update snaps

* fix: amountFormatted typo

Co-authored-by: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com>
Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
2022-05-25 23:26:05 +02:00
olav
2e367b3a04 feat: add trial expiration warning banner (#985)
* refactor: simplify useApiGetter cache keys

* refactor: simplify basePath helpers

* refactor: add UNLEASH_BASE_PATH frontend env var

* refactor: make sure AnnouncerElement does not affect the layout

* refactor: draw texture image above footer

* refactor: extract domain check helpers

* refactor: fix a few ts-expect-errors

* feat: add trial expiration warning banner

* refactor: fix IInstanceStatus interface prefix

* refactor: use ConditionallyRender in InstanceStatus

* refactor: simplify env helper functions

* refactor: use FC in InstanceStatus

* refactor: warn about expired trials

* refactor: fix eslint warnings

* refactor: disable banner outside of localhost

* refactor: use new instance state field name
2022-05-19 14:06:18 +02:00
olav
159c54ed37 fix: resolve issues around changing a toggle's project (#978)
* refactor: show save button before using the dropdown

* refactor: simplify FeatureSettingsProject toast message

* refactor: fix FeatureProjectSelect filter prop type

* refactor: hide change project page for non-enterprise

* refactor: derive move targets from projects list instead of from permissions

* refactor: align frontend project compat check with backend

* refactor: fix useProject object stability

* refactor: disable the save button for the current project

* refactor: require equal environments when moving toggles

* refactor: improve arraysHaveSameItems name
2022-05-18 11:07:19 +02:00
Tymoteusz Czech
b1166bb2f4 Project overview feature toggles list (#971)
* refactor: page container

* refactor: table page header

* feat: new feature toggles list in project overview

* feat: sortable enviromnents in project overview

* feat: project overview toggles search

* feat: project overview features column actions

* project overview table column sizing

* project overview feature actions permissions

* project overview archive feature action

* project overview toggle state strategy fallback

* remove previous project overview implementation

* fix: remove additional prop in sortable table

* fix: stale feature refetch

* improvements after review

* feat: manage visible columns in project overview

* improve project overview columns selection

* fix: simplify columns

* Revert "remove previous project overview implementation"

This reverts commit 98b051ff6a5a4fb8a9a0921b661514e15a00249a.

* restore legacy project overview table
2022-05-13 14:51:22 +02:00
Tymoteusz Czech
1772997d28 Feature list table (#908)
* experiment with generic table

* feat: example implementation of sortable table interfaces

* add enhanced table header

Co-authored-by: Nuno Góis <github@nunogois.com>

* table cleanup

Co-authored-by: Nuno Góis
Co-authored-by: Fredrik Strand Oseberg

* useSort hook interface surface

Co-authored-by: Nuno Góis <github@nunogois.com>

* sort handler initial implementation

Co-authored-by: Tymoteusz Czech <Tymek@users.noreply.github.com>

* new table unified components

* feature flags table components

Co-authored-by: Nuno Góis <github@nunogois.com>

* feat: new table sort hook

* feat: table sort

* useSearch hook implementation

* update new sort hook tests

* sortable headers hook

* feat: add sort to other table features

* move experimental table hooks to a directory

* update new table header styles

* fix: header, tableActions

* add some details like pagination and highlighter so we keep them in mind

* feature table cells

* update new table sort logic

* new pagination

* fix formatting and remove unused component

* fix: adapt useSearch default search to text instead of regex (PR #924)

* fix: update table title based on visible rows

* fix: remove test route

* refactor: move table experiment files

* features table experimentation

* feat: enhanced feature flags table

* fix: features default sort

* feat: enhanced table loading

* fix: table theme after mui5 update

* features list placeholder

* add react-table

* update snapshots after theme change

* remove unused files

* fix: improve features table after review

* refactor: rename feature type cell variables

Co-authored-by: Fredrik Oseberg <fredrik.no@gmail.com>
Co-authored-by: Nuno Góis <github@nunogois.com>
Co-authored-by: Tymoteusz Czech <Tymek@users.noreply.github.com>
2022-05-05 15:34:46 +02:00
olav
d8143c6ff4 chore: update react-router to v6 (#946)
* refactor: fix child selector warnings

* refactor: update react-router-dom

* refactor: use BrowserRouter as in react-router docs

* refactor: replace Redirect with Navigate

* refactor: replace Switch with Routes

* refactor: replace useHistory with useNavigate

* refactor: replace useParams types with useRequiredPathParam

* refactor: replace NavLink activeStyle with callback

* refactor: fix matchPath arg order

* refactor: Remove unused link state

* refactor: delete broken snapshot test

* refactor: render 404 page without redirect

* refactor: normalize path parameter names

* refactor: fix Route component usage
2022-05-05 13:42:18 +02:00
olav
35262e404b refactor: clean up strategy parameter types (#944)
* refactor: fix splash page button background color

* refactor: regenerate OpenAPI client

* refactor: clean up strategy parameter types

* refactor: remove index signature from IConstraint

* refactor: fix never-seen status in features list
2022-05-04 15:16:34 +02:00
olav
24c11332b5 chore: update MUI to v5 (#923)
* refactor: update mui packages

* refactor: run mui codemods

* refactor: format files after codemods

* refactor: fix broken types

* refactor: clean up theme

* refactor: fix broken tests

* refactor: replace @mui/styles with tss-react

* refactor: move breakpoints into classes for tss

* refactor: fix crash on missing feature description

* refactor: remove void classNames

* refactor: adjust styles to new defaults

* refactor: remove broken rollout slider e2e test

* refactor: fix duplicate e2e testid

* refactor: update makeStyles after rebase

* refactor: add missing snapshot after rebase

* refactor: fix TableCellSortable focus styles

* refactor: use 1.4 as the default line-height

* refactor: hide webkit search field icons

* refactor: fix select box label

* refactor: make AutocompleteBox smaller

* refactor: make heading smaller

* refactor: fix toast close icon color

* refactor: update snapshots

* refactor: add missing test event awaits

* refactor: fix default button line-height
2022-05-02 15:52:41 +02:00