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

47 Commits

Author SHA1 Message Date
Gastón Fournier
ab4a6f5c92
chore: GA project specific segments (#3583)
## About the changes
General availability of project-specific segments 

Now new permissions can be assigned to non-admin users to allow them to
create segments specifically bounded to a project (note that unique
naming restriction applies across projects, this limitation can be
lifted later).

![image](https://user-images.githubusercontent.com/455064/233579161-40ab25c5-a306-4fbc-82e5-8d09b3cb6a5f.png)

This enables a section in the project configuration to add
project-specific segments

![image](https://user-images.githubusercontent.com/455064/233578924-7056c626-ff1f-4dad-b00c-7fbd851158a6.png)
2023-04-21 10:25:40 +02:00
Nuno Góis
27d48b3437
Feat segments project safeguards (#3359)
https://linear.app/unleash/issue/2-811/ability-to-move-project-specific-segments


![image](https://user-images.githubusercontent.com/14320932/226572047-19ed225c-13d5-4f2e-b10f-e17a7f7e6ae7.png)

Provides some safeguards to project-specific segments when managing them
on a global level (segments page):
- You can always promote a segment to global;
- You can't specify a project if the segment is currently in use in
multiple projects;
- You can't specify a different project if the segment is currently
already in use in a project;
2023-03-21 20:28:43 +00:00
Nuno Góis
2c2da4ad3f
Feat project segments permissions (#3346)
- Adds `UPDATE_PROJECT_SEGMENT` permission checks;
- Allows `PermissionIconButton` to evaluate multiple permissions, just
like `PermissionButton`;
- Also includes a possible fix for `hasAccess` in `AccessProvider`.
2023-03-17 17:43:48 +00:00
Nuno Góis
71f6b8e172
fix: revert form section 100 height (#3345)
Small fix that reverts
https://github.com/Unleash/unleash/pull/3335/files#r1138829014 - Turns
out it wasn't totally harmless and broke some modals that had more than
100% height and no overflow.

This approach maintains the original logic and adds a new prop for the
segment forms to make them proper modals when used in the project
context.
2023-03-17 13:59:46 +00:00
Nuno Góis
292d6a7f60
feat: implement project-scoped segments in project settings (#3335)
https://linear.app/unleash/issue/2-743/have-a-project-specific-configuration-section


![image](https://user-images.githubusercontent.com/14320932/225657038-1a385e6e-deb3-4229-a30d-e7ca28ef2b3c.png)

Adds the "segments" option to project settings, providing the usual CRUD
operations but scoped to the specific project.
2023-03-17 08:23:27 +00:00
Nuno Góis
fe1e3566ee
fix: assume undefined instead of null on segment project (#3304)
Assume `undefined` instead of `null` for project in terms of interfacing
with segments: If the `project` field is not present, that means that it
is not set, which means we're dealing with a "global" segment. If we
want to unset `project` and make a segment global, we simply don't send
the `project` property on our PUT method.
2023-03-13 10:25:48 +00:00
David Leek
792d0e42de
feat: add projectid to the segments table (#3287)
https://linear.app/unleash/issue/2-742/add-an-extra-column-in-global-segments-configuration-to-display-the

<!-- 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. -->

Adds projectid column to the segments table and defaults to the value
"Global" if none is set.


![image](https://user-images.githubusercontent.com/707867/224053267-e52a398a-6f89-4d27-bd52-72b73eedc99a.png)


<!-- (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? -->
SegmentTable.tsx

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

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
2023-03-10 14:45:10 +01:00
Nuno Góis
ff7185fe5b
feat: allow adding project to segment (#3290)
https://linear.app/unleash/issue/2-741/add-project-dropdown-into-creation-of-segments

Allows users to bind a segment to a project when creating or editing a
segment.

<img width="1051" alt="image"
src="https://user-images.githubusercontent.com/14320932/224103846-1fe1f849-496c-4a77-9831-53bcb36f822e.png">
2023-03-10 08:16:54 +00:00
NicolaeUnleash
23af7a3474
refactor: light theme colors (#3252)
## About the changes
Refactoring the colors for the light theme to be much easier to continue
with dark mode

This is the first step to finish dark mode

https://linear.app/unleash/project/[low][s][alpha]-dark-mode-in-unleash-admin-ui-31b407d13c4b/1

This PR uses `main-theme` as a placeholder for `dark-theme` for now due
to the new changes. Still need to set the correct values here.

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
2023-03-06 12:58:36 +02:00
Nuno Góis
6a8ed55c63
feat: better segment info (#3243)
## About the changes

- Updates the segment information on top to be clearer - No longer an
experimental feature, but we do have some limits in place;
- Also updates the documentation to better reflect this;

Co-authored-by: @thomasheartman


![image](https://user-images.githubusercontent.com/14320932/222380864-029e7eef-bcee-4576-b9af-22a591d494a9.png)

---------

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
Co-authored-by: Gastón Fournier <gaston@getunleash.ai>
2023-03-02 14:13:27 +00:00
Mateusz Kwasniewski
377e0e9d3e
fix: remove all warnings (#3055) 2023-02-07 11:20:44 +01:00
Nuno Góis
233e06ec6a
fix: disable autoResetHiddenColumns when useConditionallyHiddenColumns (#2851)
https://linear.app/unleash/issue/2-563/fix-issue-with-useconditionallyhiddencolumns-and-react-table

It seems like we should add `autoResetHiddenColumns: false` to
`useTable` whenever we use `useConditionallyHiddenColumns`.

Basically the thought is that, if we're controlling column visibility in
our own way, we should not want other things to change that state
unpredictably, otherwise this may make React go _brrrrrr_. And it can be
very hard to pinpoint what exactly may be causing React to go _brrrrrr_.


![image](https://user-images.githubusercontent.com/14320932/211332339-95918c5c-e3ea-40e9-b8b4-756a798a4702.png)

First detected this issue apparently randomly while developing the new
SA table. Around 10-20 page refreshes would eventually trigger it. Was
not easy to find, but hopefully this fixes it permanently. At least I
haven't been able to reproduce it since. Maybe someone has a better idea
of where the issue could be or if this is a pretty good guess. Doesn't
seem like this change hurts us anyways.

I love React, `useEffect` and these very to-the-point error messages.
Very fun and productive.

Reference: https://react-table-v7.tanstack.com/docs/api/useTable
2023-01-10 08:15:12 +00:00
Fredrik Strand Oseberg
94c90b7731
Refactor/make styles batch 6 part 3 (#2823)
Last set of components refactoring for batch 6
2023-01-05 09:45:17 +01:00
Tymoteusz Czech
f2eb96000e
fix: segment delete confirmation double dialog flash (#2819) 2023-01-04 15:58:30 +01:00
sjaanus
b631618532
Makestyles refactor #7/1 (#2805) 2023-01-03 16:30:59 +02:00
Nuno Góis
1d1219a055
Use new useConditionallyHiddenColumns hook (#2695)
https://linear.app/unleash/issue/2-515/adapt-tables-to-use-the-new-useconditionallyhiddencolumns-hook

Uses the new `useConditionallyHiddenColumns` hook, like mentioned here:
https://github.com/Unleash/unleash/pull/2691
Also includes small fixes for things I caught along the way. See
comments below.
2022-12-16 10:46:04 +01:00
Nuno Góis
fe2f2f5705
Update dialogue design (#2342)
https://linear.app/unleash/issue/2-509/update-dialogues-to-match-new-designs

Update dialogues to match the look on the new designs:

![image](https://user-images.githubusercontent.com/14320932/200525669-35525761-1c3e-4c60-94a7-e21b1de99ad7.png)
2022-12-14 15:16:58 +00:00
Nuno Góis
ce6d2e56bc
fix: only show link to create segment if you have permission (#2291) 2022-10-31 08:45:31 +00:00
Christopher Kolstad
4e08fcf365
feat: add count to segment table (#2025) 2022-08-31 14:14:45 +00:00
Fredrik Strand Oseberg
6818a82cd1 Feat/dark mode exp (#1137)
* feat: add dark mode theme

* fix: feature metrics

* fix: add color

* styling

* fix: add switch

* fix: form sidebar

* fix: remove console log

* fix: add properties

* fix: strategy container

* feat: feature flag

* fix: tests

* fix: build

* fix: logo

* fix: icon

* fix: update snapshots

* fix: CES operator

* fix: typography

* fix: input styling

* fix: remove initial load

* fix: change flag name

* fix: refactor to custom hook

* fix: remove unused import

* fix: dialog headers

* fix: use uiConfig flags instead of flags
2022-08-23 14:20:02 +02:00
Tymoteusz Czech
c0b52fa672 Fix: UI improvements (#1114)
* fix: segments table author column width

* fix: update feature form ui

* fix: strategies breadcrumbs

* fix: api token page title

* fix: deprecated strategy label color

* fix: project access remove user toast

* fix: addon enable toast message

* fix: ces from ui

* fix: ui improvements with dialog typography

* fix: revert ces

* fix: change password error type
2022-06-28 12:58:10 +02:00
olav
7a6321746c refactor: improve segment warning texts 2022-06-22 14:58:36 +02:00
Tymoteusz Czech
349106a2be fix: sort order across the app
discussed with Nicolae and Nuno
2022-06-14 11:14:56 +02:00
Nuno Góis
4761847ce5 feat: upgrade search to use the new search component (#1073)
* feat: upgrade project list search to use the new search field

* cleanup unused imports

* feat: add upgraded search to projects and applications, polish search UX

* refactor: TableSearch to new Search common component

Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
2022-06-10 15:23:12 +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
Nuno Góis
682921d5bf fix: misc ui fixes post tables upgrade (#1049)
* fix: misc ui fixes post tables upgrade

* fix: update snaps, small cleanup

* refactor: ReportCard to styled, misc improvements

* cleanup remaining styles file

* rename `Feature Toggle Name` to just `name`

* refactor: address PR comments
2022-06-02 08:21:51 +01:00
olav
36196ad6d5 refactor: port metrics list to react-table (#1035)
* refactor: port metrics list to react-table

* refactor: hide columns on small screens

* refactor: use disableSortBy instead of canSort

* refactor: fix text contrast

* refactor: fix metrics section ids
2022-05-31 10:26:30 +02:00
olav
504a4af274 refactor: port segments list to react-table (#1024)
* refactor: extract SegmentEmpty component

* refactor: extract CreateSegmentButton component

* refactor: extract EditSegmentButton component

* refactor: extract RemoveSegmentButton component

* refactor: normalize Created table header text

* refactor: port segments list to react-table

* fix: improve row text height in table row

* fix: update test snapshots

* refactor table cell with search highlight

* fix: update after review

Co-authored-by: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com>
Co-authored-by: Tymoteusz Czech <tymek+gpg@getunleash.ai>
2022-05-27 08:57:30 +02:00
Tymoteusz Czech
a11cb72d99 Persistent table query (#999)
* feat: persistent table query

* project overview sort query

* refactor: api methods as hook callbacks

* persitent columns in project overview

* enable new project overview

* fix: refactor feature state change in overview

* add type to sort

* update e2e tests

now takes 10% less time with use of cypress session

* prevent sort reset on features list

* fix feature toggle list loading

* fix: update column state saving

* update local storage hook test
2022-05-25 08:14:22 +00:00
Tymoteusz Czech
6d130f61f6 feat: new contexts table (#998)
* feat: new contexts table

* improve context list actions

* refactor: disabled icon colors

* fix: update snapshots

* fix: icons

* fix: context fields typo
2022-05-20 08:29:23 +00:00
Nuno Góis
cdfb1f2452 fix: feature toggle list and UI adjustments (#970)
* fix: add highlight and hover colors, fix them

* misc ui adjustments

* test isGrow prop in table cols

* fix: revert typography changes, update snaps

* Update src/themes/themeTypes.ts

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

* fix: misc ui adjustments

* fix: backButton color

* refactor: color not needed, can be inherited

* fix: project roles case, new borderRadius values

* fix: color green

* fix: feature form link

* update snaps

* fix: formatting

* update snap

Co-authored-by: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com>
2022-05-12 15:34:04 +02:00
olav
9902494f58 refactor: improve tooltip styles after MUI update (#966)
* refactor: add missing event arg type

* refactor: fix project card popup position

* refactor: add tooltip arrows

* refactor: update snapshot

* refactor: add missing tooltips

* refactor: use a custom Autocomplete size in AutocompleteBox
2022-05-09 15:17:20 +02:00
Tymoteusz Czech
44c579f7a8 Refactor: page container (#967)
* refactor: page container

* refactor: table page header
2022-05-09 14:38:12 +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
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
Tymoteusz Czech
23a874d051 Refactor: convert jsx files to typescript (#881)
* refactor: convert remaining js files to typescript

* refactor: conditionally render remove index

* refactor: dialog component to tsx

* refactor: migrate some files from jsx to tsx

* refactor: convert dropdown element to tsx

* refactor: feature toggle list to tsx

* refactor: update context name in use overrides

* refactor: variant overrides to tsx

refactor: remove unused strategy constraint file

* fix: tsx imports

* fix: update refectored components after rebase

* refactor: rename report list files to tsx

* fix: project health list types

* refactor: addon form - add types

* refactor: copy feature component types

* fix: projects toggle style after tsx refactor

* refactor: update ts types from openapi

* fix: ts refactor changes after review

* fix: header title prop

* fix: update after PR comments

* add test to useoverrides hook

* fix conditionally render time ago

* fix: toggle list empty tooltip

* fix: remove unused variable

* remove unused variable

* fix: remove faulty snapshot
2022-05-02 12:52:33 +02:00
olav
774157b8d7 refactor: fix segment permission checks (#930)
* refactor: use DELETE_SEGMENT permission in segments list

* refactor: clean up segment form mode prop

* refactor: format file

* refactor: fix ConstraintAccordion permission checks
2022-04-29 14:53:28 +02:00
olav
1fd6f2a60a refactor: improve the text for docs links (#904)
* refactor: improve the text for docs links

* Update src/component/admin/apiToken/CreateApiToken/CreateApiToken.tsx

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>

* Update src/component/admin/projectRoles/CreateProjectRole/CreateProjectRole.tsx

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>

* Update src/component/admin/projectRoles/EditProjectRole/EditProjectRole.tsx

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>

* Update src/component/admin/users/CreateUser/CreateUser.tsx

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>

* Update src/component/admin/users/EditUser/EditUser.tsx

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>

* Update src/component/context/CreateUnleashContext/CreateUnleashContext.tsx

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>

* Update src/component/context/EditContext/EditContext.tsx

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>

* Update src/component/strategies/CreateStrategy/CreateStrategy.tsx

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>

* Update src/component/strategies/EditStrategy/EditStrategy.tsx

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>

* refactor: improve docs link texts

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2022-04-25 09:36:23 +02:00
olav
2e5e25bfe5 refactor: improve icon labels and tooltips (#884) 2022-04-21 08:26:49 +02:00
olav
49b8e7329e refactor: convert auth tests from Cypress to Jest (#864)
* refactor: replace data-test with data-testid

* refactor: add Jest tests for auth pages

* refactor: remove Cypress tests for auth pages

* refactor: remove questionable snapshots

* refactor: share test server setup/teardown

* refactor: restore auth page flex layout

* refactor: use toBeInTheDocument

* refactor: change recent data-test attrs to data-testid
2022-04-08 13:13:45 +02:00
Nuno Góis
1132a79f6d fix: reject duplicate segment names (#855)
* fix: reject duplicate segment names

* fix: useSegmentValidation now takes into account initial value

* refactor: add segments e2e test

* refactor: add github action from segments e2e test

* refactor: use enterprise edition for all e2e tests

* refactor: use enterprise edition for all e2e tests
2022-04-08 11:34:59 +01:00
olav
f59ba567fb refactor: add segment limit warnings (#851)
* refactor: fix environment name text alignment

* refactor: use rounded corners for AutocompleteBox

* refactor: add tooltips to the strategy segment icons

* refactor: add segment limit warnings

* refactor: improve segments warning text
2022-04-07 14:47:24 +02:00
olav
43834be065 refactor: use onClose instead of hideSecondaryButton (#842) 2022-04-05 11:47:17 +02:00
olav
dbb62631a6 feat: add FeedbackCES component (#826)
* refactor: add screen-reader-only util class

* refactor: move FeedbackNPS component

* feat: add FeedbackCES component

* refactor: improve hidden checkbox styles

* refactor: fix IFeedbackEndpointRequestBody source type

* refactor: remove unnecessary event.persist() calls

* refactor: remove disableEscapeKeyDown from FeedbackCES modal

* refactor: make textarea label customizable

* refactor: store feedback state on the backend

* refactor: add FeedbackCESForm snapshot test

* refactor: use extant IAuthFeedback type

* refactor: fix showNPSFeedback logic for multiple feedback types
2022-03-31 09:23:46 +02:00
Youssef Khedher
eeda7ab5e4 feat: add segments (#780)
* feat: create segmentation structure and list

* feat: remove unused deps and change route

* feat: change header style and add renderNoSegments

* fix: style table header

* feat: create useSegments hook

* feat: add segmentApi hook

* feat: create segment

* fix: errors

* feat: add contextfields list

* fix: remove user from create segment api

* feat: add form structure

* feat: add SegmentFormStepOne

* fix: tests and routes

* feat: add constraint view

* feat: UI to match the sketch

* feat: add constraint on context select

* fix: duplication

* fix adding constraints

Co-authored-by: olav <mail@olav.io>

* fix: input date not showing up in constraint view

Co-authored-by: olav <mail@olav.io>

* fix: minor bugs

Co-authored-by: olav <mail@olav.io>

* fix: create context modal in segment page

Co-authored-by: olav <mail@olav.io>

* fix: validate constraint before create segment

Co-authored-by: olav <mail@olav.io>

* feat: create useSegment hook

Co-authored-by: olav <mail@olav.io>

* feat: create edit component

Co-authored-by: olav <mail@olav.io>

* refactor: move constraint validation endpoint

* refactor: add missing route snapshot

* refactor: fix segment constraints unsaved/editing state

* refactor: remove create segment from mobile header menu

* refactor: update segments form description

* refactor: extract SegmentFormStepList component

* refactor: add an optional FormTemplate docs link label

* refactor: fix update segment payload

* feat: finish edit component

Co-authored-by: olav <mail@olav.io>

* refactor: move step list above segment form

* fix: update PR based on feedback

Co-authored-by: olav <mail@olav.io>

* refactor: fix constraint validation endpoint path

* refactor: improve constraint state field name

* refactor: extract AutocompleteBox component

* feat: add strategy segment selection

* refactor: add strategy segment previews

* refactor: fix double section separator line

* feat: disable deleting a usable segment

* refactor: warn about segments without constraints

* refactor: update text in delete segment dialogue

* refactur: improve arg names

* refactor: improve index var name

* refactor: clarify steps list logic

* refactor: use a required prop for the segment name

* refactor: use ConditionallyRender for segment deletion

* refactor: fix segments refetch

* refactor: improve CreateUnleashContext component names

* refactor: adjust segment form styles

* refactor: adjust text

* refactor: fix info icon tooltip hover target

* refactor: add missing aria attrs to preview button

* refactor: add strat name to delete segment modal

* refactor: fix segment chip text alighment

* refactor: use bulk endpoint for strategy segments

* refactor: fix imports after merge

Co-authored-by: Fredrik Oseberg <fredrik.no@gmail.com>
Co-authored-by: olav <mail@olav.io>
2022-03-29 09:30:57 +02:00
olav
cfc2338e78 refactor: use camel case for files and dirs (#817) 2022-03-25 12:34:20 +01:00
Youssef Khedher
bee9fadbc9 feat: segments (#776)
* feat: create segmentation structure and list

* feat: remove unused deps and change route

* feat: change header style and add renderNoSegments

* fix: style table header

* feat: create useSegments hook

* feat: add segmentApi hook

* fix: ts and style errors

* feat: update PR based on feedback

* feat: add flag

* fix: test and formating

* fix: update PR based on feedback

* fix: add correct permission

* fix: mobile view for segments

Co-authored-by: Fredrik Strand Oseberg <fredrik.no@gmail.com>
2022-03-16 13:19:27 +01:00