Feature #19203

FE - React - UserRole - Separate tab user profile

Added by chok yee fan 10 months ago. Updated 7 months ago.

Status:ResolvedStart date:19 December 2023
Priority:NormalDue date:
Assignee:Amirul Umar Pandai% Done:

100%

Category:-Spent time:-
Target version:-

Description

As per David:
- save role into db first, therefore function name checkbox will be in another tab call Function Name. This tab only enabled if role has been created
- ⁠the function name checkbox has an event call backend web service
- remove data access, this project not support this
- ⁠there will be another tab, call “User Profile”. This tab is like Function Name, except it is user ID

History

#1 Updated by Amirul Umar Pandai 10 months ago

  • Description updated (diff)

#2 Updated by Amirul Umar Pandai 10 months ago

Initial structure done. Pending ws

- fix org profile modify button does nothing
- move usePrompt hook to own file
- re-organise org profile + user role code

https://dev.silverlakemobility.com/gitlab/mleb-solution-domain/smesd100/mleb-iam/-/commit/b3c05da00efe3b92cf2c23f8f4134dfdcd251bb2

#3 Updated by Amirul Umar Pandai 10 months ago

  • Assignee changed from Amirul Umar Pandai to David Wong

Pending ws for Function Name and User Profile tab

#4 Updated by David Wong 10 months ago

DB View #1:

create or replace view mleb_iam.view_mleb_system_function as
    select null as pk, 0 as level, null as parent, 'ROOT' as child, 'Root' as name,  'A' as status
    union all
    select distinct null as pk, 1 as level, 'ROOT' as parent, 'MS-' || ms.system_code as child, ms.system_name as name, ms.status
    from mleb_iam.mleb_system ms
    union all
    select distinct null as pk, 2 as level, 'MS-' || mf.system_code as parent, 'MFG-' || mfg.group_code as child, mfg.group_name, mfg.status
    from mleb_iam.mleb_function_group mfg inner join mleb_iam.mleb_function mf on mfg.group_code = mf.group_code
    union all
    select mf.function_code as pk, 3 as level, 'MFG-' || mf.group_code as parent, 'MF-' || mf.function_code as child, mf.function_name, mf.status
    from mleb_iam.mleb_function_group mfg inner join mleb_iam.mleb_function mf on mfg.group_code = mf.group_code;

#5 Updated by David Wong 10 months ago

DB View #2

create or replace view mleb_iam.view_mleb_system_function_hierarchy_by_root as
with recursive recur as (
    select vmsf.*, 0 as depth, array[vmsf.seq] as path
    from (select row_number() over (order by qvmsf.level, qvmsf.child) seq, qvmsf.* from mleb_iam.view_mleb_system_function qvmsf) vmsf
    where 1=1 and child = 'ROOT'

    union

    select vmsf_main.*, recur.depth+1, recur.path || vmsf_main.seq
    from (select row_number() over (order by qvmsf.level, qvmsf.child) seq, qvmsf.* from mleb_iam.view_mleb_system_function qvmsf) vmsf_main
        inner join recur on vmsf_main.parent =  recur.child
    where 1=1 )
select recur.*
from recur
order by recur.path;

#6 Updated by chok yee fan 8 months ago

  • Assignee changed from David Wong to Zaid Haritsah

#7 Updated by Zaid Haritsah 8 months ago

  • Assignee changed from Zaid Haritsah to Farid Nazmi

#8 Updated by Farid Nazmi 8 months ago

  • % Done changed from 0 to 50

created view to display tree hierarchy for user role function. the view data is based on selected function group from organisation role function. view for user role function will display the function code to be selected by the user based on organisation role function selected function group.

view-user_role_function.xml and view-user_role_function-hierarchy-by-root.xml for liquibase also ready to be commited.

Pending git lab issues unable to pull / push the code.

#9 Updated by Farid Nazmi 8 months ago

  • % Done changed from 50 to 70

web services for view tree hierarchy user role function

ws name : viewFunctionCodeTreeAction
api path : /api/userRoleWs/viewFunctionCodeTreeAction

https://dev.silverlakemobility.com/gitlab/mleb-solution-domain/smesd100/mleb-iam/-/commit/e037bdd19540da9ceb36f76476716fc84137a77c

req body :

{
"userRoleBean" : {
"orgId" : 1
}

}

#10 Updated by Farid Nazmi 8 months ago

  • % Done changed from 70 to 80

web service for check/uncheck action (checkbox live fire)

ws name : saveFunctionCodeTempAction
api path : /api/userRoleWs/saveFunctionCodeTempAction

https://dev.silverlakemobility.com/gitlab/mleb-solution-domain/smesd100/mleb-iam/-/commit/e037bdd19540da9ceb36f76476716fc84137a77c

req body :

{
"userRoleFunctionBean": {
"userRoleName" : "",
"selected": true,
"functionCode": "FUNC_SAVE_USER_PROFILE",
"orgId": 1
}
}

#11 Updated by Farid Nazmi 8 months ago

  • Assignee changed from Farid Nazmi to Amirul Umar Pandai
  • % Done changed from 80 to 100

web services for save button ( final save into original user role function table )

ws name : saveFunctionCodeAction
api path : /api/userRoleWs/saveFunctionCodeAction

req body :

{
"userRoleFunctionTempEntity" : {
}
}

*Notes : the request body is blank because it already get from the security utils in the backend once login , no need to input

#12 Updated by Farid Nazmi 8 months ago

  • Status changed from New to In Progress

#14 Updated by Amirul Umar Pandai 7 months ago

  • Status changed from In Progress to Resolved

Applied change for all checkbox trees to use status key instead of appending "selected" key when checking field. Removed "Status" column in checkbox trees to reflect this change


- remove 'selected' from GenericTreeBean model
- tie checkbox selection to 'status' inside checkbox tree

https://dev.silverlakemobility.com/gitlab/mleb-solution-domain/smesd100/mleb-iam/-/commit/07ff523502170733af09feb5d05a47973190b501

Also available in: Atom PDF