zitadel/console
Luka Waymouth 33bff5a4b0
fix(console): bug fixes for ListProjectRoles and general pagination (#8938)
# Which Problems Are Solved

A number of small problems are fixed relating to the project roles
listed in various places in the UI:
- Fixes issue #8460
- Fixes an issue where the "Master checkbox" that's supposed to check
and uncheck all list items breaks when there's multiple pages of
results. Demonstration images are attached at the end of the PR.
- Fixes an issue where the "Edit Role" dialog opened by clicking on a
role in the list will not save any changes if the role's group is empty
even though empty groups are allowed during creation.
- Fixes issues where the list does not properly update after the user
modifies or deletes some of its entries.
- Fixes an issue for all paginated lists where the page number
information (like "0-25" specifying that items 0 through 25 are shown on
screen) was inaccurate, as described in #8460.


# How the Problems Are Solved

- Fixes buggy handling of pre-selected roles while editing a grant so
that all selected roles are saved instead of only the ones on the
current page.
- Triggers the entire page to be reloaded when a user modifies or
deletes a role to easily ensure the information on the screen is
accurate.
- Revises checkbox logic so that the "Master checkbox" will apply only
to rows on the current page. I think this is the correct behavior but
tell me if it should be changed.
- Other fixes to faulty logic.


# Additional Changes

- I made clicking on a group name toggle all the rows in that group on
the screen, instead of just turning them on. Tell me if this should be
changed back to what it was before.

# Additional Context

- Closes #8460

## An example of the broken checkboxes:


![2024-11-20_03-11-1732091377](https://github.com/user-attachments/assets/9f01f529-aac9-4669-92df-2abbe67e4983)

![2024-11-20_03-11-1732091365](https://github.com/user-attachments/assets/e7b8bed6-5cef-4c9f-9ecf-45ed41640dc6)

![2024-11-20_03-11-1732091357](https://github.com/user-attachments/assets/d404bc78-68fd-472d-b450-6578658f48ab)

![2024-11-20_03-11-1732091348](https://github.com/user-attachments/assets/a5976816-802b-4eab-bc61-58babc0b68f7)

---------

Co-authored-by: Max Peintner <max@caos.ch>
2024-11-26 09:00:21 +00:00
..
src fix(console): bug fixes for ListProjectRoles and general pagination (#8938) 2024-11-26 09:00:21 +00:00
.editorconfig feat(console): integrate frontend (#95) 2020-05-13 14:41:43 +02:00
.eslintrc.js fix(console): update eslint, redirect user without roles, private labeling save and icon (#4459) 2022-09-29 05:25:57 +00:00
.gitignore chore(console): buf stub build (#5215) 2023-02-17 14:09:11 +00:00
.prettierignore chore(e2e): formatting with prettier (#4385) 2022-09-19 19:49:46 +02:00
.prettierrc fix(console): use authService for auth user page (#5233) 2023-02-27 12:03:44 +01:00
angular.json refactor: copy only required frameworks icons from docs in console (#7538) 2024-03-11 08:33:05 +00:00
buf.gen.yaml chore(console): buf stub build (#5215) 2023-02-17 14:09:11 +00:00
karma.conf.js feat(console): integrate frontend (#95) 2020-05-13 14:41:43 +02:00
ngsw-config.json fix: update assets in ngsw-config.json (#1027) 2020-11-27 16:32:14 +01:00
package.json fix: update dependencies (#8713) 2024-10-03 11:03:44 +00:00
prebuild.development.js chore(dev): fix fetching http env json (#5921) 2023-05-24 13:07:55 +00:00
README.md docs(contributing): remove guides folder (#4603) 2022-10-24 08:43:24 +02:00
tsconfig.app.json fix(console): angular 15 (#4809) 2023-01-11 13:23:16 +00:00
tsconfig.json feat(console): integrate app (#7417) 2024-02-28 16:52:21 +00:00
tsconfig.spec.json chore(console): dependency update (#5653) 2023-04-18 15:42:29 +02:00
yarn.lock chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 in /console (#8941) 2024-11-25 09:04:30 +01:00

Console

This project was generated with Angular CLI version 8.3.20.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Please refer to the contributing guide

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.