From d7b7963095d52c565757226403626e49611ff3d2 Mon Sep 17 00:00:00 2001 From: dipan dhali Date: Fri, 13 Sep 2024 02:45:29 +0530 Subject: [PATCH] added user-management including jbpm --- .gitignore | 1 + env.sample | 12 + .../authentication/authentication.service.ts | 2 +- .../keycloak/oauth-keycloak.service.ts | 12 + .../core/shell/content/content.component.html | 2 +- .../core/shell/content/content.component.scss | 20 +- src/app/core/shell/shell.component.html | 2 - src/app/core/shell/shell.component.scss | 9 +- .../core/shell/sidenav/sidenav.component.html | 54 ++- .../core/shell/sidenav/sidenav.component.scss | 187 +++------- .../core/shell/sidenav/sidenav.component.ts | 12 + .../core/shell/toolbar/toolbar.component.html | 19 +- .../core/shell/toolbar/toolbar.component.scss | 68 +--- src/app/core/utils/passwords-utility.ts | 37 ++ src/app/shared/icons.module.ts | 16 +- .../language-selector.component.scss | 5 +- .../language-selector.component.ts | 2 +- src/app/shared/material.module.ts | 4 +- src/app/shared/shared.module.ts | 10 +- .../success-dialog.component.html | 11 + .../success-dialog.component.scss | 21 ++ .../success-dialog.component.spec.ts | 21 ++ .../success-dialog.component.ts | 18 + .../update-password-dialog.component.html | 101 ++++++ .../update-password-dialog.component.scss | 38 +++ .../update-password-dialog.component.spec.ts | 21 ++ .../update-password-dialog.component.ts | 61 ++++ .../create-user/create-user.component.html | 246 ++++++++------ .../create-user/create-user.component.scss | 93 ++++- .../create-user/create-user.component.ts | 192 ++++++++--- src/app/users/models/jbpm.model.ts | 44 +++ src/app/users/models/user.model.ts | 27 ++ src/app/users/services/users-jbpm.service.ts | 162 +++++++++ .../users/services/users-keycloak.service.ts | 249 ++++++++++++++ src/app/users/services/users.service.ts | 321 ++++++++++++++++++ .../user-requests.component.html | 238 +++++++++++++ .../user-requests.component.scss | 59 ++++ .../user-requests.component.spec.ts | 21 ++ .../user-requests/user-requests.component.ts | 158 +++++++++ src/app/users/user.resolver.ts | 8 +- src/app/users/users-routing.module.ts | 16 +- src/app/users/users-template.resolver.ts | 2 +- src/app/users/users.module.ts | 6 +- src/app/users/users.resolver.ts | 8 +- src/app/users/users/users.component.html | 100 ++++++ src/app/users/users/users.component.scss | 49 +++ src/app/users/users/users.component.spec.ts | 25 ++ src/app/users/users/users.component.ts | 123 +++++++ .../users/view-user/view-user.component.html | 162 +++++---- .../users/view-user/view-user.component.scss | 66 +++- .../users/view-user/view-user.component.ts | 191 ++++++++++- src/assets/env.template.js | 8 + src/assets/styles/_content.scss | 14 +- src/assets/styles/_helper.scss | 71 +++- src/assets/translations/en.json | 113 +++++- src/assets/translations/es.json | 297 +++++++++------- src/assets/translations/fr.json | 296 ++++++++++------ src/environments/environment.prod.ts | 10 + src/environments/environment.ts | 10 + src/theme/theme.scss | 10 +- 60 files changed, 3409 insertions(+), 752 deletions(-) create mode 100644 src/app/core/utils/passwords-utility.ts create mode 100644 src/app/shared/success-dialog/success-dialog.component.html create mode 100644 src/app/shared/success-dialog/success-dialog.component.scss create mode 100644 src/app/shared/success-dialog/success-dialog.component.spec.ts create mode 100644 src/app/shared/success-dialog/success-dialog.component.ts create mode 100644 src/app/shared/update-password-dialog/update-password-dialog.component.html create mode 100644 src/app/shared/update-password-dialog/update-password-dialog.component.scss create mode 100644 src/app/shared/update-password-dialog/update-password-dialog.component.spec.ts create mode 100644 src/app/shared/update-password-dialog/update-password-dialog.component.ts create mode 100644 src/app/users/models/jbpm.model.ts create mode 100644 src/app/users/models/user.model.ts create mode 100644 src/app/users/services/users-jbpm.service.ts create mode 100644 src/app/users/services/users-keycloak.service.ts create mode 100644 src/app/users/services/users.service.ts create mode 100644 src/app/users/user-requests/user-requests.component.html create mode 100644 src/app/users/user-requests/user-requests.component.scss create mode 100644 src/app/users/user-requests/user-requests.component.spec.ts create mode 100644 src/app/users/user-requests/user-requests.component.ts create mode 100644 src/app/users/users/users.component.html create mode 100644 src/app/users/users/users.component.scss create mode 100644 src/app/users/users/users.component.spec.ts create mode 100644 src/app/users/users/users.component.ts diff --git a/.gitignore b/.gitignore index 174ed728..643d11aa 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ xcuserdata/ *.sublime-workspace # IDE - VSCode +.vscode .vscode/* !.vscode/settings.json !.vscode/tasks.json diff --git a/env.sample b/env.sample index 132e58cc..26fe4145 100644 --- a/env.sample +++ b/env.sample @@ -27,10 +27,22 @@ export PH_OAUTH_CLIENT_ID=opsapp export PH_OAUTH_CLIENT_SECRET=Y2xpZW50Og= +export PH_OAUTH_CLIENT_UUUID=Y2xpZW50Og= + export PH_OAUTH_BASIC_AUTH=true export PH_OAUTH_BASIC_AUTH_TOKEN=Y2xpZW50Og== +export PH_JBPM_API_URL=http://localhost:8180/kie-server/services/rest/server + +export PH_JBPM_CONTAINER_ID=PaymentHubEE_1.0.0-SNAPSHOT + +export PH_JBPM_CREDENTIALS_ADMIN_MAKER=Y2xpZW50Og== + +export PH_JBPM_CREDENTIALS_ADMIN_CHECKER=Y2xpZW50Og== + +export PH_JBPM_CREDENTIALS_BOTH=Y2xpZW50Og== + export PH_DEFAULT_LANGUAGE=en export PH_SUPPORTED_LANGUAGES=en,fr,es diff --git a/src/app/core/authentication/authentication.service.ts b/src/app/core/authentication/authentication.service.ts index 10792b68..5ce105bb 100644 --- a/src/app/core/authentication/authentication.service.ts +++ b/src/app/core/authentication/authentication.service.ts @@ -164,7 +164,7 @@ export class AuthenticationService { */ private getUserDetails(loginContext: LoginContext, tokenResponse: OAuth2Token) { if (this.isOauthKeyCloak()) { - this.oauthKeycloakService.introspect(tokenResponse).subscribe((userDetails: Introspect) => { + this.oauthKeycloakService.getUserInfo(tokenResponse).subscribe((userDetails: Introspect) => { this.storage.setItem(this.oAuthUserDetailsStorageKey, JSON.stringify(userDetails)); this.onLoginSuccess({ username: loginContext.username, accessToken: tokenResponse.access_token, authenticated: true, tenantId: loginContext.tenant } as any); diff --git a/src/app/core/authentication/keycloak/oauth-keycloak.service.ts b/src/app/core/authentication/keycloak/oauth-keycloak.service.ts index 92af2717..96e90cd7 100644 --- a/src/app/core/authentication/keycloak/oauth-keycloak.service.ts +++ b/src/app/core/authentication/keycloak/oauth-keycloak.service.ts @@ -91,6 +91,18 @@ export class OauthKeycloakService { return this.http.post(url, payload.toString(), httpOptions); } + getUserInfo(token: OAuth2Token): Observable { + + const httpOptions = { + headers: new HttpHeaders({ + Authorization: `Bearer ${token.access_token}`, + 'Content-Type': 'application/json' + }) + }; + const url: string = `${this.url()}/userinfo`; + return this.http.get(url, httpOptions); + } + private url(): string { return `${environment.oauth.serverUrl}/realms/${environment.oauth.realm}/protocol/openid-connect`; } diff --git a/src/app/core/shell/content/content.component.html b/src/app/core/shell/content/content.component.html index 4020fabe..9c0bf3fc 100644 --- a/src/app/core/shell/content/content.component.html +++ b/src/app/core/shell/content/content.component.html @@ -6,7 +6,7 @@ - chevron_right + diff --git a/src/app/core/shell/content/content.component.scss b/src/app/core/shell/content/content.component.scss index efe5f3b9..0271e766 100644 --- a/src/app/core/shell/content/content.component.scss +++ b/src/app/core/shell/content/content.component.scss @@ -1,9 +1,23 @@ -.container { - width: 80%; +@import 'theme/theme'; +.container { + width: 90%; + margin: 0 auto; .breadcrumb { padding-left: 18%; margin: 0; - font-size: x-large; + font-size: 1.6rem; + font-weight: 600; } } + +::ng-deep .xng-breadcrumb-link{ + color: $primary !important; + font-size:1.3rem; + font-weight: 400; + cursor: pointer; +} + +::ng-deep .xng-breadcrumb-link:hover{ + text-decoration: none !important; +} diff --git a/src/app/core/shell/shell.component.html b/src/app/core/shell/shell.component.html index d0a2a802..9926116f 100644 --- a/src/app/core/shell/shell.component.html +++ b/src/app/core/shell/shell.component.html @@ -26,10 +26,8 @@ -
-
diff --git a/src/app/core/shell/shell.component.scss b/src/app/core/shell/shell.component.scss index 5521eed4..97da48f6 100644 --- a/src/app/core/shell/shell.component.scss +++ b/src/app/core/shell/shell.component.scss @@ -9,15 +9,10 @@ } .sidebar-full { - width: 22rem; + width: 18rem; } .sidebar-compact { - width: 8rem; - } - - .vertical-space { - line-height: 40px; - height: 40px; + width: 6rem; } } diff --git a/src/app/core/shell/sidenav/sidenav.component.html b/src/app/core/shell/sidenav/sidenav.component.html index c0111d5f..d9ea5be6 100644 --- a/src/app/core/shell/sidenav/sidenav.component.html +++ b/src/app/core/shell/sidenav/sidenav.component.html @@ -8,10 +8,10 @@
-