Skip to content

Disallow adding the same role multiple times in manage roles modals #1284

@vinc10

Description

@vinc10

Affected sprinkle or package

userfrosting/theme-adminlte

UserFrosting or package Version

5.1.4

Debug Data

docker compose exec app php bakery debug
WARN[0000] /home/Vincent/git/UF 5 skeleton/UserFrosting/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 

UserFrosting Environnement Information
======================================

 -------------------- ---------------- 
  Framework version    5.1.4           
  OS Name              Linux           
  Main Sprinkle        My Application  
  Main Sprinkle Path   /app/app/       
  Environment mode     default         
  PHP Version          8.2.25          
  Node Version         v18.20.4        
  NPM Version          10.7.0          
 -------------------- ---------------- 


Loaded Sprinkles
================

 ------------------ --------------------------------------- ------------------------------------------------------- 
  Sprinkle           Namespace                               Path                                                   
 ------------------ --------------------------------------- ------------------------------------------------------- 
  Core Sprinkle      UserFrosting\Sprinkle\Core\Core         /app/vendor/userfrosting/sprinkle-core/app/src/../     
  Account Sprinkle   UserFrosting\Sprinkle\Account\Account   /app/vendor/userfrosting/sprinkle-account/app/src/../  
  AdminLTE Theme     UserFrosting\Theme\AdminLTE\AdminLTE    /app/vendor/userfrosting/theme-adminlte/app/src/../    
  Admin Sprinkle     UserFrosting\Sprinkle\Admin\Admin       /app/vendor/userfrosting/sprinkle-admin/app/src/../    
  My Application     UserFrosting\App\MyApp                  /app/app/src/../                                       
 ------------------ --------------------------------------- ------------------------------------------------------- 


Database config
===============

 ------------ -------------- 
  CONNECTION   mysql         
 ------------ -------------- 
  DRIVER       mysql         
  HOST         mysql         
  PORT         3306          
  DATABASE     userfrosting  
  USERNAME     docker        
  PASSWORD     *********     
 ------------ -------------- 


Testing database connection...
==============================

                                                                                                                    
 [OK] Database connection successful

Chat Discussion (optional)

No response

Description

Tested on 5.1.4 skeleton and my custom application running 5.1.4

In the manage roles modal: It is possible to add the same roles over and over. Do this a few times and your modal will look like the one in the picture below. The backend cleans this up upon submit, but still, the client side experience of this can be improved.

Image

Steps To Reproduce

1: Go to the users page http://localhost:8080/users
2: Click actions and then manage roles
3: Assign new roles (that aren't the same as the bottom role in the table) a few times
4: You end up making the modal look like the picture in the Description.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    References

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions