verben-authentication-ui 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ng-package.json +8 -0
- package/package.json +8 -14
- package/src/lib/components/button/button.component.css +3 -0
- package/src/lib/components/button/button.component.html +13 -0
- package/src/lib/components/button/button.component.spec.ts +23 -0
- package/src/lib/components/button/button.component.ts +24 -0
- package/src/lib/components/button/button.module.ts +11 -0
- package/{lib/components/forgot-password/ForgotPasswordData.d.ts → src/lib/components/forgot-password/ForgotPasswordData.ts} +1 -1
- package/src/lib/components/forgot-password/forgot-password.component.css +29 -0
- package/src/lib/components/forgot-password/forgot-password.component.html +13 -0
- package/src/lib/components/forgot-password/forgot-password.component.spec.ts +23 -0
- package/src/lib/components/forgot-password/forgot-password.component.ts +86 -0
- package/src/lib/components/forgot-password/forgot-password.module.ts +18 -0
- package/src/lib/components/mail/mail.component.css +0 -0
- package/src/lib/components/mail/mail.component.html +11 -0
- package/src/lib/components/mail/mail.component.spec.ts +23 -0
- package/src/lib/components/mail/mail.component.ts +47 -0
- package/src/lib/components/mail/mail.module.ts +13 -0
- package/src/lib/components/mail-validation/mail-validation.component.css +59 -0
- package/src/lib/components/mail-validation/mail-validation.component.html +37 -0
- package/src/lib/components/mail-validation/mail-validation.component.spec.ts +23 -0
- package/src/lib/components/mail-validation/mail-validation.component.ts +66 -0
- package/src/lib/components/mail-validation/mail-validation.module.ts +18 -0
- package/src/lib/components/o-auth/o-auth.component.css +21 -0
- package/src/lib/components/o-auth/o-auth.component.html +60 -0
- package/src/lib/components/o-auth/o-auth.component.spec.ts +23 -0
- package/src/lib/components/o-auth/o-auth.component.ts +43 -0
- package/src/lib/components/o-auth/o-auth.module.ts +11 -0
- package/src/lib/components/otp-input/otp-input.component.css +19 -0
- package/src/lib/components/otp-input/otp-input.component.html +14 -0
- package/src/lib/components/otp-input/otp-input.component.spec.ts +23 -0
- package/src/lib/components/otp-input/otp-input.component.ts +73 -0
- package/src/lib/components/otp-input/otp-input.module.ts +15 -0
- package/src/lib/components/reset-password/ResetPasswordData.ts +5 -0
- package/src/lib/components/reset-password/reset-password.component.css +29 -0
- package/src/lib/components/reset-password/reset-password.component.html +22 -0
- package/src/lib/components/reset-password/reset-password.component.spec.ts +23 -0
- package/src/lib/components/reset-password/reset-password.component.ts +108 -0
- package/src/lib/components/reset-password/reset-password.module.ts +18 -0
- package/src/lib/components/sign-in/sign-in.component.css +21 -0
- package/src/lib/components/sign-in/sign-in.component.html +84 -0
- package/src/lib/components/sign-in/sign-in.component.spec.ts +23 -0
- package/src/lib/components/sign-in/sign-in.component.ts +184 -0
- package/src/lib/components/sign-in/sign-in.module.ts +17 -0
- package/src/lib/components/sign-up/sign-up.component.css +36 -0
- package/src/lib/components/sign-up/sign-up.component.html +132 -0
- package/src/lib/components/sign-up/sign-up.component.spec.ts +23 -0
- package/src/lib/components/sign-up/sign-up.component.ts +176 -0
- package/src/lib/components/sign-up/sign-up.module.ts +15 -0
- package/src/lib/components/sso/base-table-style.ts +52 -0
- package/src/lib/components/sso/helper.ts +15 -0
- package/src/lib/components/sso/sso-form/sso-form.component.css +13 -0
- package/src/lib/components/sso/sso-form/sso-form.component.html +109 -0
- package/src/lib/components/sso/sso-form/sso-form.component.spec.ts +23 -0
- package/src/lib/components/sso/sso-form/sso-form.component.ts +70 -0
- package/src/lib/components/sso/sso.columns.ts +32 -0
- package/src/lib/components/sso/sso.component.css +47 -0
- package/src/lib/components/sso/sso.component.html +208 -0
- package/src/lib/components/sso/sso.component.spec.ts +23 -0
- package/src/lib/components/sso/sso.component.ts +261 -0
- package/src/lib/components/sso/sso.module.ts +40 -0
- package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.css +8 -0
- package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.html +30 -0
- package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.spec.ts +23 -0
- package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.ts +183 -0
- package/src/lib/components/two-factor-auth-otp/two-factor-auth-otp.module.ts +15 -0
- package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.css +17 -0
- package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.html +45 -0
- package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.spec.ts +23 -0
- package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.ts +57 -0
- package/src/lib/components/two-factor-auth-setup/two-factor-auth-setup.module.ts +11 -0
- package/src/lib/components/user-management/base-table-style.ts +52 -0
- package/src/lib/components/user-management/helper.ts +29 -0
- package/src/lib/components/user-management/index.ts +4 -0
- package/src/lib/components/user-management/useer-management.module.ts +48 -0
- package/src/lib/components/user-management/user-management-form/use-management-form.component.ts +61 -0
- package/src/lib/components/user-management/user-management-form/user-management-form.component.css +0 -0
- package/src/lib/components/user-management/user-management-form/user-management-form.component.html +91 -0
- package/src/lib/components/user-management/user-management-form/user-management-form.component.spec.ts +23 -0
- package/src/lib/components/user-management/user-management.columns.ts +45 -0
- package/src/lib/components/user-management/user-management.component.css +26 -0
- package/src/lib/components/user-management/user-management.component.html +275 -0
- package/src/lib/components/user-management/user-management.component.spec.ts +23 -0
- package/src/lib/components/user-management/user-management.component.ts +380 -0
- package/src/lib/components/user-management/user-management.service.ts +42 -0
- package/src/lib/components/user-request/user-request.component.css +91 -0
- package/src/lib/components/user-request/user-request.component.html +165 -0
- package/src/lib/components/user-request/user-request.component.spec.ts +23 -0
- package/src/lib/components/user-request/user-request.component.ts +167 -0
- package/src/lib/components/user-request/user-request.module.ts +18 -0
- package/src/lib/components/user-request-approval/access-request.columns.ts +26 -0
- package/src/lib/components/user-request-approval/base-table-style.ts +52 -0
- package/src/lib/components/user-request-approval/facades/user-access-request.facade.ts +152 -0
- package/src/lib/components/user-request-approval/helper.ts +39 -0
- package/src/lib/components/user-request-approval/services/user-access-request.service.spec.ts +16 -0
- package/src/lib/components/user-request-approval/services/user-access-request.service.ts +87 -0
- package/src/lib/components/user-request-approval/states/user-access-request.state.ts +65 -0
- package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.css +0 -0
- package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.html +7 -0
- package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.spec.ts +23 -0
- package/src/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.ts +22 -0
- package/src/lib/components/user-request-approval/user-request-approval.component.css +1 -0
- package/src/lib/components/user-request-approval/user-request-approval.component.html +218 -0
- package/src/lib/components/user-request-approval/user-request-approval.component.spec.ts +23 -0
- package/src/lib/components/user-request-approval/user-request-approval.component.ts +301 -0
- package/src/lib/components/user-request-approval/user-request-approval.module.ts +52 -0
- package/src/lib/components/user-request-approval/user-request-approval.service.spec.ts +16 -0
- package/src/lib/components/user-request-approval/user-request-approval.service.ts +58 -0
- package/src/lib/components/user-request-approval/user-request-form/use-request-form.component.ts +66 -0
- package/src/lib/components/user-request-approval/user-request-form/user-request-form.component.css +0 -0
- package/src/lib/components/user-request-approval/user-request-form/user-request-form.component.html +97 -0
- package/src/lib/components/user-request-approval/user-request-form/user-request-form.component.spec.ts +23 -0
- package/src/lib/models/ErrorResponse.ts +7 -0
- package/src/lib/models/PasswordRequestParam.ts +5 -0
- package/src/lib/models/ResponseKeyValue.ts +5 -0
- package/src/lib/models/UserRequest.ts +28 -0
- package/src/lib/models/auth-mechanism.ts +14 -0
- package/src/lib/models/base.ts +11 -0
- package/src/lib/models/log-in.ts +7 -0
- package/{lib/models/mainUser.d.ts → src/lib/models/mainUser.ts} +3 -2
- package/src/lib/models/object-state.ts +6 -0
- package/{lib/models/otpValue.d.ts → src/lib/models/otpValue.ts} +3 -1
- package/src/lib/models/paged.ts +9 -0
- package/src/lib/models/query-params.ts +7 -0
- package/src/lib/models/request-status.ts +4 -0
- package/src/lib/models/resend-otp-data.ts +8 -0
- package/src/lib/models/resource.ts +27 -0
- package/src/lib/models/sign-up.ts +11 -0
- package/src/lib/models/single-sign-on.ts +9 -0
- package/src/lib/models/status.ts +5 -0
- package/src/lib/models/user-access-request-status.ts +5 -0
- package/{lib/models/user-access-request.d.ts → src/lib/models/user-access-request.ts} +4 -3
- package/src/lib/models/user.ts +24 -0
- package/src/lib/services/environment.service.spec.ts +16 -0
- package/src/lib/services/environment.service.ts +23 -0
- package/src/lib/services/http-web-request.service.spec.ts +16 -0
- package/src/lib/services/http-web-request.service.ts +101 -0
- package/src/lib/services/util.service.spec.ts +16 -0
- package/src/lib/services/util.service.ts +28 -0
- package/{public-api.d.ts → src/public-api.ts} +21 -0
- package/src/styles.css +96 -0
- package/src/theme/tailwind-setup.css +3 -0
- package/src/theme/tailwind.css +980 -0
- package/tailwind.config.js +20 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
- package/esm2022/lib/components/button/button.component.mjs +0 -46
- package/esm2022/lib/components/button/button.module.mjs +0 -20
- package/esm2022/lib/components/forgot-password/ForgotPasswordData.mjs +0 -2
- package/esm2022/lib/components/forgot-password/forgot-password.component.mjs +0 -86
- package/esm2022/lib/components/forgot-password/forgot-password.module.mjs +0 -34
- package/esm2022/lib/components/mail/mail.component.mjs +0 -69
- package/esm2022/lib/components/mail/mail.module.mjs +0 -21
- package/esm2022/lib/components/mail-validation/mail-validation.component.mjs +0 -108
- package/esm2022/lib/components/mail-validation/mail-validation.module.mjs +0 -34
- package/esm2022/lib/components/o-auth/o-auth.component.mjs +0 -25
- package/esm2022/lib/components/o-auth/o-auth.module.mjs +0 -19
- package/esm2022/lib/components/otp-input/otp-input.component.mjs +0 -75
- package/esm2022/lib/components/otp-input/otp-input.module.mjs +0 -23
- package/esm2022/lib/components/reset-password/ResetPasswordData.mjs +0 -2
- package/esm2022/lib/components/reset-password/reset-password.component.mjs +0 -107
- package/esm2022/lib/components/reset-password/reset-password.module.mjs +0 -34
- package/esm2022/lib/components/sign-in/sign-in.component.mjs +0 -214
- package/esm2022/lib/components/sign-in/sign-in.module.mjs +0 -24
- package/esm2022/lib/components/sign-up/sign-up.component.mjs +0 -223
- package/esm2022/lib/components/sign-up/sign-up.module.mjs +0 -24
- package/esm2022/lib/components/sso/base-table-style.mjs +0 -53
- package/esm2022/lib/components/sso/helper.mjs +0 -14
- package/esm2022/lib/components/sso/sso-form/sso-form.component.mjs +0 -74
- package/esm2022/lib/components/sso/sso.columns.mjs +0 -29
- package/esm2022/lib/components/sso/sso.component.mjs +0 -197
- package/esm2022/lib/components/sso/sso.module.mjs +0 -63
- package/esm2022/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.mjs +0 -201
- package/esm2022/lib/components/two-factor-auth-otp/two-factor-auth-otp.module.mjs +0 -22
- package/esm2022/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.mjs +0 -90
- package/esm2022/lib/components/two-factor-auth-setup/two-factor-auth-setup.module.mjs +0 -19
- package/esm2022/lib/components/user-management/base-table-style.mjs +0 -53
- package/esm2022/lib/components/user-management/helper.mjs +0 -26
- package/esm2022/lib/components/user-management/useer-management.module.mjs +0 -68
- package/esm2022/lib/components/user-management/user-management-form/use-management-form.component.mjs +0 -57
- package/esm2022/lib/components/user-management/user-management.columns.mjs +0 -43
- package/esm2022/lib/components/user-management/user-management.component.mjs +0 -323
- package/esm2022/lib/components/user-request/user-request.component.mjs +0 -180
- package/esm2022/lib/components/user-request/user-request.module.mjs +0 -34
- package/esm2022/lib/components/user-request-approval/access-request.columns.mjs +0 -24
- package/esm2022/lib/components/user-request-approval/base-table-style.mjs +0 -53
- package/esm2022/lib/components/user-request-approval/facades/user-access-request.facade.mjs +0 -128
- package/esm2022/lib/components/user-request-approval/helper.mjs +0 -35
- package/esm2022/lib/components/user-request-approval/services/user-access-request.service.mjs +0 -72
- package/esm2022/lib/components/user-request-approval/states/user-access-request.state.mjs +0 -59
- package/esm2022/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.mjs +0 -26
- package/esm2022/lib/components/user-request-approval/user-request-approval.component.mjs +0 -251
- package/esm2022/lib/components/user-request-approval/user-request-approval.module.mjs +0 -77
- package/esm2022/lib/components/user-request-approval/user-request-approval.service.mjs +0 -32
- package/esm2022/lib/components/user-request-approval/user-request-form/use-request-form.component.mjs +0 -64
- package/esm2022/lib/models/ErrorResponse.mjs +0 -11
- package/esm2022/lib/models/PasswordRequestParam.mjs +0 -2
- package/esm2022/lib/models/ResponseKeyValue.mjs +0 -2
- package/esm2022/lib/models/UserRequest.mjs +0 -2
- package/esm2022/lib/models/base.mjs +0 -2
- package/esm2022/lib/models/log-in.mjs +0 -2
- package/esm2022/lib/models/mainUser.mjs +0 -2
- package/esm2022/lib/models/object-state.mjs +0 -8
- package/esm2022/lib/models/otpValue.mjs +0 -2
- package/esm2022/lib/models/paged.mjs +0 -2
- package/esm2022/lib/models/query-params.mjs +0 -2
- package/esm2022/lib/models/request-status.mjs +0 -5
- package/esm2022/lib/models/sign-up.mjs +0 -2
- package/esm2022/lib/models/single-sign-on.mjs +0 -2
- package/esm2022/lib/models/status.mjs +0 -6
- package/esm2022/lib/models/user-access-request-status.mjs +0 -7
- package/esm2022/lib/models/user-access-request.mjs +0 -2
- package/esm2022/lib/models/user.mjs +0 -2
- package/esm2022/lib/services/environment.service.mjs +0 -26
- package/esm2022/lib/services/http-web-request.service.mjs +0 -83
- package/esm2022/lib/services/util.service.mjs +0 -32
- package/esm2022/public-api.mjs +0 -43
- package/esm2022/verben-authentication-ui.mjs +0 -5
- package/fesm2022/verben-authentication-ui.mjs +0 -3481
- package/fesm2022/verben-authentication-ui.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/components/button/button.component.d.ts +0 -17
- package/lib/components/button/button.module.d.ts +0 -10
- package/lib/components/forgot-password/forgot-password.component.d.ts +0 -28
- package/lib/components/forgot-password/forgot-password.module.d.ts +0 -10
- package/lib/components/mail/mail.component.d.ts +0 -32
- package/lib/components/mail/mail.module.d.ts +0 -11
- package/lib/components/mail-validation/mail-validation.component.d.ts +0 -42
- package/lib/components/mail-validation/mail-validation.module.d.ts +0 -10
- package/lib/components/o-auth/o-auth.component.d.ts +0 -10
- package/lib/components/o-auth/o-auth.module.d.ts +0 -9
- package/lib/components/otp-input/otp-input.component.d.ts +0 -20
- package/lib/components/otp-input/otp-input.module.d.ts +0 -13
- package/lib/components/reset-password/ResetPasswordData.d.ts +0 -5
- package/lib/components/reset-password/reset-password.component.d.ts +0 -30
- package/lib/components/reset-password/reset-password.module.d.ts +0 -10
- package/lib/components/sign-in/sign-in.component.d.ts +0 -77
- package/lib/components/sign-in/sign-in.module.d.ts +0 -13
- package/lib/components/sign-up/sign-up.component.d.ts +0 -66
- package/lib/components/sign-up/sign-up.module.d.ts +0 -13
- package/lib/components/sso/base-table-style.d.ts +0 -1
- package/lib/components/sso/helper.d.ts +0 -2
- package/lib/components/sso/sso-form/sso-form.component.d.ts +0 -21
- package/lib/components/sso/sso.columns.d.ts +0 -3
- package/lib/components/sso/sso.component.d.ts +0 -50
- package/lib/components/sso/sso.module.d.ts +0 -11
- package/lib/components/two-factor-auth-otp/two-factor-auth-otp.component.d.ts +0 -65
- package/lib/components/two-factor-auth-otp/two-factor-auth-otp.module.d.ts +0 -12
- package/lib/components/two-factor-auth-setup/two-factor-auth-setup.component.d.ts +0 -39
- package/lib/components/two-factor-auth-setup/two-factor-auth-setup.module.d.ts +0 -9
- package/lib/components/user-management/base-table-style.d.ts +0 -1
- package/lib/components/user-management/helper.d.ts +0 -2
- package/lib/components/user-management/useer-management.module.d.ts +0 -11
- package/lib/components/user-management/user-management-form/use-management-form.component.d.ts +0 -20
- package/lib/components/user-management/user-management.columns.d.ts +0 -3
- package/lib/components/user-management/user-management.component.d.ts +0 -60
- package/lib/components/user-request/user-request.component.d.ts +0 -56
- package/lib/components/user-request/user-request.module.d.ts +0 -10
- package/lib/components/user-request-approval/access-request.columns.d.ts +0 -3
- package/lib/components/user-request-approval/base-table-style.d.ts +0 -1
- package/lib/components/user-request-approval/facades/user-access-request.facade.d.ts +0 -23
- package/lib/components/user-request-approval/helper.d.ts +0 -6
- package/lib/components/user-request-approval/services/user-access-request.service.d.ts +0 -50
- package/lib/components/user-request-approval/states/user-access-request.state.d.ts +0 -21
- package/lib/components/user-request-approval/user-access-request-status-badge/user-access-request-status-badge.component.d.ts +0 -12
- package/lib/components/user-request-approval/user-request-approval.component.d.ts +0 -59
- package/lib/components/user-request-approval/user-request-approval.module.d.ts +0 -12
- package/lib/components/user-request-approval/user-request-approval.service.d.ts +0 -18
- package/lib/components/user-request-approval/user-request-form/use-request-form.component.d.ts +0 -21
- package/lib/models/ErrorResponse.d.ts +0 -6
- package/lib/models/PasswordRequestParam.d.ts +0 -5
- package/lib/models/ResponseKeyValue.d.ts +0 -5
- package/lib/models/UserRequest.d.ts +0 -24
- package/lib/models/base.d.ts +0 -10
- package/lib/models/log-in.d.ts +0 -7
- package/lib/models/object-state.d.ts +0 -6
- package/lib/models/paged.d.ts +0 -9
- package/lib/models/query-params.d.ts +0 -7
- package/lib/models/request-status.d.ts +0 -3
- package/lib/models/sign-up.d.ts +0 -9
- package/lib/models/single-sign-on.d.ts +0 -7
- package/lib/models/status.d.ts +0 -4
- package/lib/models/user-access-request-status.d.ts +0 -5
- package/lib/models/user.d.ts +0 -23
- package/lib/services/environment.service.d.ts +0 -16
- package/lib/services/http-web-request.service.d.ts +0 -23
- package/lib/services/util.service.d.ts +0 -8
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
<div class="space-y-1 h-full">
|
|
2
|
+
<verben-data-view
|
|
3
|
+
#vdv
|
|
4
|
+
[viewState]="{
|
|
5
|
+
isSearch: true,
|
|
6
|
+
isColumn: true,
|
|
7
|
+
isFilter: true,
|
|
8
|
+
isSort: true,
|
|
9
|
+
isExport: true,
|
|
10
|
+
isSelect: true,
|
|
11
|
+
isCreate: true,
|
|
12
|
+
isToggle:true
|
|
13
|
+
}"
|
|
14
|
+
[buttonClass]="'my-custom-button-class'"
|
|
15
|
+
[iconClass]="'my-icon-class'"
|
|
16
|
+
[activeIconClass]="'my-active-icon-class'"
|
|
17
|
+
[selectedColumnCount]="0"
|
|
18
|
+
[selectedSortCount]="0"
|
|
19
|
+
[selectedFilterTableCount]="0"
|
|
20
|
+
(viewChange)="onViewChange($event)"
|
|
21
|
+
(stateChange)="onStateChange($event)"
|
|
22
|
+
>
|
|
23
|
+
<div table-content>
|
|
24
|
+
<lib-data-table
|
|
25
|
+
[data]="data"
|
|
26
|
+
[columns]="columns"
|
|
27
|
+
[styleConfig]="styles"
|
|
28
|
+
(selectionChange)="onSelectionChange($event)"
|
|
29
|
+
>
|
|
30
|
+
<ng-container libColumn="createdAt">
|
|
31
|
+
<ng-template #cell let-value>
|
|
32
|
+
{{ value | date }}
|
|
33
|
+
</ng-template>
|
|
34
|
+
</ng-container>
|
|
35
|
+
<ng-container libColumn="actions">
|
|
36
|
+
<ng-template #cell let-value let-deleteRow >
|
|
37
|
+
<div class="flex gap-6">
|
|
38
|
+
<verben-svg
|
|
39
|
+
(click)="openDetailView(value)"
|
|
40
|
+
icon="edit"
|
|
41
|
+
[width]="15"
|
|
42
|
+
[height]="15"
|
|
43
|
+
class="cursor-pointer"
|
|
44
|
+
></verben-svg>
|
|
45
|
+
|
|
46
|
+
<verben-svg
|
|
47
|
+
icon="delete"
|
|
48
|
+
[width]="15"
|
|
49
|
+
[height]="15"
|
|
50
|
+
(click)="deleteRow()"
|
|
51
|
+
class="cursor-pointer"
|
|
52
|
+
></verben-svg>
|
|
53
|
+
</div>
|
|
54
|
+
</ng-template>
|
|
55
|
+
<ng-template #header>
|
|
56
|
+
<strong>Actions</strong>
|
|
57
|
+
</ng-template>
|
|
58
|
+
</ng-container>
|
|
59
|
+
<ng-container libColumn="status">
|
|
60
|
+
<ng-template
|
|
61
|
+
#cell
|
|
62
|
+
let-isEditing="isEditing"
|
|
63
|
+
let-toggleRowEdit="toggleRowEdit"
|
|
64
|
+
let-deleteRow="deleteRow"
|
|
65
|
+
let-value="value"
|
|
66
|
+
>
|
|
67
|
+
<verbena-badge
|
|
68
|
+
borderRadius="20px"
|
|
69
|
+
width="121px"
|
|
70
|
+
text="{{value}}"
|
|
71
|
+
bgColor="#D6F3E6"
|
|
72
|
+
textColor="#2DB76F"
|
|
73
|
+
pd="5px 15px"
|
|
74
|
+
fontSize="16px"
|
|
75
|
+
>
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
</verbena-badge>
|
|
79
|
+
</ng-template>
|
|
80
|
+
</ng-container>
|
|
81
|
+
<ng-container libColumn="role">
|
|
82
|
+
<ng-template
|
|
83
|
+
#cell
|
|
84
|
+
let-isEditing="isEditing"
|
|
85
|
+
let-toggleRowEdit="toggleRowEdit"
|
|
86
|
+
let-deleteRow="deleteRow"
|
|
87
|
+
let-value="value"
|
|
88
|
+
let-updateValue="updateValue"
|
|
89
|
+
>
|
|
90
|
+
<!-- <verben-drop-down [minChar]="3" [required]="true" placeholder="Select Parent"
|
|
91
|
+
[asyncLabel]="this.getParentLabel.bind(this)" invalidMessage="No value was provided"
|
|
92
|
+
width="120px"
|
|
93
|
+
(onChange)="onDropdownChange($event)" [(ngModel)]="selectedParent" optionLabel="Name" optionValue="Id"
|
|
94
|
+
[options]="testParents"></verben-drop-down> -->
|
|
95
|
+
|
|
96
|
+
<verben-drop-down
|
|
97
|
+
placeholder="Select Value"
|
|
98
|
+
width="120px"
|
|
99
|
+
(ngModelChange)="onDropdownChange($event)"
|
|
100
|
+
[options]="testParents"
|
|
101
|
+
optionLabel="Name"
|
|
102
|
+
optionValue="Name"
|
|
103
|
+
[ngModel]="value"
|
|
104
|
+
></verben-drop-down>
|
|
105
|
+
</ng-template>
|
|
106
|
+
</ng-container>
|
|
107
|
+
</lib-data-table>
|
|
108
|
+
</div>
|
|
109
|
+
<div card-content>
|
|
110
|
+
<verben-card-data-view
|
|
111
|
+
borderRadius="12px"
|
|
112
|
+
(loadMoreClick)="loadMore()"
|
|
113
|
+
#vdcv
|
|
114
|
+
dataId="MailAddress"
|
|
115
|
+
border="5px"
|
|
116
|
+
[cardDataList]="cardData"
|
|
117
|
+
rbgColor="#f5f6f9"
|
|
118
|
+
mg="0px"
|
|
119
|
+
class="gap-1"
|
|
120
|
+
>
|
|
121
|
+
<verben-left-card-data-view class="m-0 gap-2" >
|
|
122
|
+
<verben-left-card-data
|
|
123
|
+
#vlcd
|
|
124
|
+
[parent]="vdcv"
|
|
125
|
+
dataId="MailAddress"
|
|
126
|
+
class="bg-secondary-100 rounded-xl scroll-no border-primary border-[1px] gap-1 h-full justify-pp m-0 overflow-y-auto overflow-hidden"
|
|
127
|
+
[cardDataList]="cardData"
|
|
128
|
+
|
|
129
|
+
>
|
|
130
|
+
<ng-template #card let-item>
|
|
131
|
+
<div (click)="currentData = vdcv.onItemClick(item)" class="flex">
|
|
132
|
+
<verben-svg
|
|
133
|
+
[width]="15"
|
|
134
|
+
[height]="15"
|
|
135
|
+
(click)="vlcd.showChildren(item)"
|
|
136
|
+
[ngClass]="vlcd.showToggle(item) ? 'visible' : 'invisible'"
|
|
137
|
+
class="items-center flex cursor-pointer"
|
|
138
|
+
[icon]="item.isChildrenExpanded ? 'minus' : 'plus'"
|
|
139
|
+
/>
|
|
140
|
+
<div
|
|
141
|
+
(click)="currentData = vdcv.onItemClick(item)"
|
|
142
|
+
class="flex cursor-pointer bg-secondary rounded-xl overflow-hidden w-full"
|
|
143
|
+
>
|
|
144
|
+
<div
|
|
145
|
+
class="w-2 rounded-xl rounded-tr-none rounded-br-none overflow-hidden"
|
|
146
|
+
[ngClass]="
|
|
147
|
+
item.selected ? 'bg-primary' : 'bg-secondary-200'
|
|
148
|
+
"
|
|
149
|
+
></div>
|
|
150
|
+
<div class="flex flex-col py-[6px] pr-[3px] ">
|
|
151
|
+
<div class="flex items-center gap-4">
|
|
152
|
+
<div class="pl-[13px]">
|
|
153
|
+
<span class="font-semibold text-[16px] text-[#404040]">{{
|
|
154
|
+
item.title
|
|
155
|
+
}}</span>
|
|
156
|
+
<p class="flex items-center">
|
|
157
|
+
<label for="phone" class="text-[10px] font-light"
|
|
158
|
+
>Phone Number:</label
|
|
159
|
+
>
|
|
160
|
+
<span id="phone" class="text-[13px] font-medium truncate text-wrap">{{
|
|
161
|
+
item.data.PhoneNumber
|
|
162
|
+
}}</span>
|
|
163
|
+
</p>
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
<div class=" ">
|
|
167
|
+
<p class="grid">
|
|
168
|
+
<label for="phone" class="text-[10px] font-light"
|
|
169
|
+
>Role</label
|
|
170
|
+
>
|
|
171
|
+
<span id="phone" class="text-sm font-medium"
|
|
172
|
+
>Manager</span
|
|
173
|
+
>
|
|
174
|
+
<span class=" bg-[#CAE1CC] text-center text-[#4ABB54] text-[13px] mt-[8px] rounded-[9px]">
|
|
175
|
+
{{item.data.Status}}
|
|
176
|
+
</span>
|
|
177
|
+
</p>
|
|
178
|
+
<!-- <lib-user-access-request-status-badge
|
|
179
|
+
[status]="item.data.Status"
|
|
180
|
+
></lib-user-access-request-status-badge> -->
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
<!-- <div class="flex">
|
|
185
|
+
<span class="font-normal text-sm">{{ item.title }}</span>
|
|
186
|
+
</div>
|
|
187
|
+
@for (ciItem of item.body; track ciItem.value) {
|
|
188
|
+
<div class="">
|
|
189
|
+
<span class="text-muted font-light text-xs"
|
|
190
|
+
>{{ ciItem.title }}:</span
|
|
191
|
+
>
|
|
192
|
+
<span class="text-black">{{ ciItem.value }}</span>
|
|
193
|
+
</div>
|
|
194
|
+
} -->
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
</ng-template>
|
|
199
|
+
</verben-left-card-data>
|
|
200
|
+
</verben-left-card-data-view>
|
|
201
|
+
|
|
202
|
+
<verben-right-card-data-view>
|
|
203
|
+
<ng-template #parent>
|
|
204
|
+
<lib-user-request-form
|
|
205
|
+
[currentData]="currentData"
|
|
206
|
+
(switchView)="vdv.toggleView()"
|
|
207
|
+
></lib-user-request-form>
|
|
208
|
+
</ng-template>
|
|
209
|
+
</verben-right-card-data-view>
|
|
210
|
+
|
|
211
|
+
<verben-card-data-view-footer class="float-right">
|
|
212
|
+
<div class="flex gap-2">
|
|
213
|
+
<span class="paginator-text"
|
|
214
|
+
>{{ cardData.length }} records loaded</span
|
|
215
|
+
>
|
|
216
|
+
<button (click)="loadMore()" class="load-more">Load more</button>
|
|
217
|
+
</div>
|
|
218
|
+
</verben-card-data-view-footer>
|
|
219
|
+
</verben-card-data-view>
|
|
220
|
+
</div>
|
|
221
|
+
<div column-content>
|
|
222
|
+
<verben-visible-column
|
|
223
|
+
(columnsUpdated)="onColumnsUpdated($event)"
|
|
224
|
+
[border]="'1px solid rgba(212, 160, 7, 1)'"
|
|
225
|
+
borderRadius="10px"
|
|
226
|
+
boxShadow="2px 2px 2px 0px silver"
|
|
227
|
+
bgColor="white"
|
|
228
|
+
width="400px"
|
|
229
|
+
textColor="black"
|
|
230
|
+
pd="1rem"
|
|
231
|
+
primaryColor="#FFE681"
|
|
232
|
+
secondaryColor="#3479E9"
|
|
233
|
+
[columns]="visibleColumns"
|
|
234
|
+
[displayedColumns]="5"
|
|
235
|
+
></verben-visible-column>
|
|
236
|
+
</div>
|
|
237
|
+
<div filter-content>
|
|
238
|
+
<verben-table-filter
|
|
239
|
+
[border]="'1px solid rgba(212, 160, 7, 1)'"
|
|
240
|
+
borderRadius="10px"
|
|
241
|
+
boxShadow="2px 2px 2px 0px silver"
|
|
242
|
+
bgColor="white"
|
|
243
|
+
width="420px"
|
|
244
|
+
textColor="black"
|
|
245
|
+
pd="1rem"
|
|
246
|
+
primaryColor="#FFE681"
|
|
247
|
+
secondaryColor="#3479E9"
|
|
248
|
+
tertiaryColor="#404040"
|
|
249
|
+
[filterOptions]="filterArray"
|
|
250
|
+
[maxFilterLength]="3"
|
|
251
|
+
></verben-table-filter>
|
|
252
|
+
</div>
|
|
253
|
+
<div sort-content>
|
|
254
|
+
<verben-sort-table
|
|
255
|
+
(selectedOptions)="onSortUpdated($event)"
|
|
256
|
+
[border]="'1px solid rgba(212, 160, 7, 1)'"
|
|
257
|
+
borderRadius="10px"
|
|
258
|
+
boxShadow="2px 2px 2px 0px silver"
|
|
259
|
+
bgColor="white"
|
|
260
|
+
width="400px"
|
|
261
|
+
textColor="black"
|
|
262
|
+
pd="1rem"
|
|
263
|
+
primaryColor="#FFE681"
|
|
264
|
+
secondaryColor="#3479E9"
|
|
265
|
+
tertiaryColor="#404040"
|
|
266
|
+
[enableDragAndDrop]="true"
|
|
267
|
+
[sortOptions]="sortOptions"
|
|
268
|
+
></verben-sort-table>
|
|
269
|
+
</div>
|
|
270
|
+
<div export-content>
|
|
271
|
+
<lib-data-export [data]="data" (exportDataEvent)="handleExport($event)">
|
|
272
|
+
</lib-data-export>
|
|
273
|
+
</div>
|
|
274
|
+
</verben-data-view>
|
|
275
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { UserManagementComponent } from './UserManagementComponent';
|
|
4
|
+
|
|
5
|
+
describe('UserManagementComponent', () => {
|
|
6
|
+
let component: UserManagementComponent;
|
|
7
|
+
let fixture: ComponentFixture<UserManagementComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [UserManagementComponent]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(UserManagementComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import { Component, ViewChild } from '@angular/core';
|
|
2
|
+
import { columns } from './user-management.columns';
|
|
3
|
+
import { mockData } from './helper';
|
|
4
|
+
import { baseStyle } from './base-table-style';
|
|
5
|
+
import { UserAccessRequest } from '../../models/user-access-request';
|
|
6
|
+
import {
|
|
7
|
+
CardData,
|
|
8
|
+
DataFilterType,
|
|
9
|
+
IDataFilter,
|
|
10
|
+
DropdownLoadEvent,
|
|
11
|
+
DropdownChangeEvent,
|
|
12
|
+
CardDataViewComponent,
|
|
13
|
+
DataViewComponent,
|
|
14
|
+
} from 'verben-ng-ui';
|
|
15
|
+
import { UserAccessRequestStatus } from '../../models/user-access-request-status';
|
|
16
|
+
import { ObjectState } from '../../models/object-state';
|
|
17
|
+
|
|
18
|
+
interface TestParentObject {
|
|
19
|
+
Id: string;
|
|
20
|
+
Name: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@Component({
|
|
24
|
+
selector: 'lib-user-management',
|
|
25
|
+
templateUrl: './user-management.component.html',
|
|
26
|
+
styleUrl: './user-management.component.css',
|
|
27
|
+
})
|
|
28
|
+
export class UserManagementComponent {
|
|
29
|
+
@ViewChild('vdcv') cardDataView!: CardDataViewComponent;
|
|
30
|
+
@ViewChild('vdv') dataView!: DataViewComponent;
|
|
31
|
+
|
|
32
|
+
columns = columns;
|
|
33
|
+
data = mockData;
|
|
34
|
+
styles = baseStyle;
|
|
35
|
+
|
|
36
|
+
selectedParent?: string;
|
|
37
|
+
basicOption?: string;
|
|
38
|
+
selectedOption: string[] = [];
|
|
39
|
+
selectedOptionTwo: string[] = [];
|
|
40
|
+
selectedOptionThree?: string;
|
|
41
|
+
missingObject: any;
|
|
42
|
+
|
|
43
|
+
private generateNewUserAccessRequest(): UserAccessRequest {
|
|
44
|
+
const newId = this.data.length + 1; // Incremental ID based on current data length
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
FirstName: `First ${newId}`,
|
|
48
|
+
LastName: `Last ${newId}`,
|
|
49
|
+
OtherName: `Other ${newId}`,
|
|
50
|
+
Id: `${newId}`,
|
|
51
|
+
id: newId,
|
|
52
|
+
MailAddress: ` `,
|
|
53
|
+
PhoneNumber: ``,
|
|
54
|
+
RequestStatus: UserAccessRequestStatus.Pending,
|
|
55
|
+
Address: ` `,
|
|
56
|
+
Password: ' ',
|
|
57
|
+
ExpireOn: new Date(),
|
|
58
|
+
IsSeeded: false,
|
|
59
|
+
OTPExpireOn: new Date(),
|
|
60
|
+
Tenants: [`Tenant${newId}`],
|
|
61
|
+
Role: ['User'],
|
|
62
|
+
CreatedAt: new Date(),
|
|
63
|
+
UpdatedAt: new Date(),
|
|
64
|
+
DataState: ObjectState.New,
|
|
65
|
+
Tenant: `Tenant${newId}`
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Function to add a new user to mockData
|
|
70
|
+
addNewUserToMockData(): UserAccessRequest {
|
|
71
|
+
const newUser = this.generateNewUserAccessRequest();
|
|
72
|
+
this.data.push(newUser); // Adds the new user to the data array
|
|
73
|
+
|
|
74
|
+
// Optionally, update cardData with the new user entry for card display
|
|
75
|
+
|
|
76
|
+
const fullName = `${newUser.FirstName} ${newUser.LastName}`;
|
|
77
|
+
const newCardData: CardData = {
|
|
78
|
+
selected: false,
|
|
79
|
+
title: fullName,
|
|
80
|
+
data: {
|
|
81
|
+
Name: fullName,
|
|
82
|
+
MailAddress: newUser.MailAddress,
|
|
83
|
+
PhoneNumber: newUser.PhoneNumber,
|
|
84
|
+
RoleID: newUser.Role,
|
|
85
|
+
Status: newUser.Status,
|
|
86
|
+
} as Partial<UserAccessRequest>,
|
|
87
|
+
body: [
|
|
88
|
+
{ title: 'Name', value: fullName },
|
|
89
|
+
{ title: 'E-Mail Address', value: newUser.MailAddress },
|
|
90
|
+
{ title: 'Phone Number', value: newUser.PhoneNumber ?? '' },
|
|
91
|
+
],
|
|
92
|
+
children: [],
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
this.cardData.push(newCardData); // Update cardData array with the new user
|
|
96
|
+
return newUser;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Grid view properties
|
|
100
|
+
isGridView: boolean = true;
|
|
101
|
+
currentData!: CardData;
|
|
102
|
+
selectedColumnCount: number = 0;
|
|
103
|
+
selectedFilterTableCount: number = 0;
|
|
104
|
+
isOPen: boolean = true;
|
|
105
|
+
selectedSortCount: number = 0;
|
|
106
|
+
showColumn: boolean = false;
|
|
107
|
+
showSort: boolean = false;
|
|
108
|
+
selectedAll: boolean = false;
|
|
109
|
+
visibleColumns: IDataFilter[] = columns.map((col) => ({
|
|
110
|
+
checked: false,
|
|
111
|
+
name: typeof col.header === 'string' ? col.header : col.id,
|
|
112
|
+
type: DataFilterType.Bool,
|
|
113
|
+
}));
|
|
114
|
+
|
|
115
|
+
filterArray: IDataFilter[] = [
|
|
116
|
+
{ name: 'Name', type: DataFilterType.String, checked: false },
|
|
117
|
+
{ name: 'MailAddress', type: DataFilterType.String, checked: false },
|
|
118
|
+
{ name: 'PhoneNumber', type: DataFilterType.String, checked: false },
|
|
119
|
+
{ name: 'CreatedAt', type: DataFilterType.Date, checked: false },
|
|
120
|
+
];
|
|
121
|
+
|
|
122
|
+
sortOptions: IDataFilter[] = [
|
|
123
|
+
{ name: 'Name', type: DataFilterType.String, checked: false },
|
|
124
|
+
{ name: 'MailAddress', type: DataFilterType.String, checked: false },
|
|
125
|
+
{ name: 'PhoneNumber', type: DataFilterType.String, checked: false },
|
|
126
|
+
{ name: 'CreatedAt', type: DataFilterType.Date, checked: false },
|
|
127
|
+
];
|
|
128
|
+
|
|
129
|
+
testParents: TestParentObject[] = [
|
|
130
|
+
{ Id: '1', Name: 'Manager' },
|
|
131
|
+
{ Id: '2', Name: 'Administrator' },
|
|
132
|
+
{ Id: '3', Name: 'Jelom' },
|
|
133
|
+
];
|
|
134
|
+
|
|
135
|
+
cardData: CardData[] = mockData.map(
|
|
136
|
+
({ FirstName, LastName, MailAddress, PhoneNumber, RoleID, Status }) => ({
|
|
137
|
+
selected: false,
|
|
138
|
+
title: `${FirstName} ${LastName}`,
|
|
139
|
+
data: {
|
|
140
|
+
FirstName,
|
|
141
|
+
LastName,
|
|
142
|
+
MailAddress,
|
|
143
|
+
PhoneNumber,
|
|
144
|
+
RoleID,
|
|
145
|
+
Status,
|
|
146
|
+
} as Partial<UserAccessRequest>,
|
|
147
|
+
body: [
|
|
148
|
+
{ title: 'Name', value: `${FirstName} ${LastName}` },
|
|
149
|
+
{ title: 'E-Mail Address', value: MailAddress },
|
|
150
|
+
{ title: 'Phone Number', value: PhoneNumber ?? '' },
|
|
151
|
+
],
|
|
152
|
+
children: [],
|
|
153
|
+
})
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
ngOnInit(): void {
|
|
157
|
+
this.selectedParent = '1';
|
|
158
|
+
this.selectedOption = ['Opt 1'];
|
|
159
|
+
this.selectedOptionTwo = ['1'];
|
|
160
|
+
this.selectedOptionThree = '1';
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
getParentLabel(context: any): string {
|
|
164
|
+
console.log({ MissingObj: this.missingObject });
|
|
165
|
+
return this.missingObject.Name;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
async loadMoreParents(event: DropdownLoadEvent): Promise<TestParentObject[]> {
|
|
169
|
+
console.log({ ParentLoadEvent: JSON.parse(JSON.stringify(event)) });
|
|
170
|
+
return await new Promise((resolve) =>
|
|
171
|
+
setTimeout(
|
|
172
|
+
() =>
|
|
173
|
+
resolve([
|
|
174
|
+
{ Id: '1', Name: 'Jimly' },
|
|
175
|
+
{ Id: '2', Name: 'Jecil' },
|
|
176
|
+
{ Id: '3', Name: 'Jelom' },
|
|
177
|
+
{ Id: '4', Name: 'Jemima' },
|
|
178
|
+
{ Id: '5', Name: 'Akintunde' },
|
|
179
|
+
]),
|
|
180
|
+
3000
|
|
181
|
+
)
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
onDropdownChange(event: DropdownChangeEvent): void {
|
|
186
|
+
// console.log({
|
|
187
|
+
// 'Test Parent Value': this.selectedParent,
|
|
188
|
+
// ...
|
|
189
|
+
// });
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
onSelectionChange(selectedRows: UserAccessRequest[]) {
|
|
193
|
+
console.log('Selection changed:', selectedRows);
|
|
194
|
+
// Handle the selection change
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
handleExport(exportedData: Partial<any>[]) {
|
|
198
|
+
console.log('Exported data:', exportedData);
|
|
199
|
+
this.downloadCSV(exportedData);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
private downloadCSV(data: Partial<any>[]) {
|
|
203
|
+
const headers = Object.keys(data[0]);
|
|
204
|
+
const csvContent = [
|
|
205
|
+
headers.join(','),
|
|
206
|
+
...data.map((row) => headers.map((header) => row[header]).join(',')),
|
|
207
|
+
].join('\n');
|
|
208
|
+
|
|
209
|
+
const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
|
|
210
|
+
const link = document.createElement('a');
|
|
211
|
+
if (link.download !== undefined) {
|
|
212
|
+
const url = URL.createObjectURL(blob);
|
|
213
|
+
link.setAttribute('href', url);
|
|
214
|
+
link.setAttribute('download', 'export.csv');
|
|
215
|
+
link.style.visibility = 'hidden';
|
|
216
|
+
document.body.appendChild(link);
|
|
217
|
+
link.click();
|
|
218
|
+
document.body.removeChild(link);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// applyFilters() {
|
|
223
|
+
// this.filteredData = this.data.filter((item) => {
|
|
224
|
+
// return this.filterArray.every((filter) => {
|
|
225
|
+
// if (filter.checked) {
|
|
226
|
+
// switch (filter.type) {
|
|
227
|
+
// case DataFilterType.String:
|
|
228
|
+
// return item[filter.name].toLowerCase().includes(filter.name.toLowerCase());
|
|
229
|
+
// case DataFilterType.Date:
|
|
230
|
+
// return new Date(item[filter.name]) >= new Date(filter.name);
|
|
231
|
+
// default:
|
|
232
|
+
// return true;
|
|
233
|
+
// }
|
|
234
|
+
// }
|
|
235
|
+
// return true;
|
|
236
|
+
// });
|
|
237
|
+
// });
|
|
238
|
+
// }
|
|
239
|
+
getCardDataByMailAddress(mailAddress: string): CardData | undefined {
|
|
240
|
+
console.log('cardData array:', this.cardData);
|
|
241
|
+
console.log(mailAddress);
|
|
242
|
+
|
|
243
|
+
return this.cardData.find(({ data }) => data?.MailAddress === mailAddress);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
openDetailView(mailAddress: string) {
|
|
247
|
+
const cardItem = this.getCardDataByMailAddress(mailAddress);
|
|
248
|
+
console.log(cardItem);
|
|
249
|
+
|
|
250
|
+
if (cardItem && this.cardDataView) {
|
|
251
|
+
this.dataView.toggleView();
|
|
252
|
+
// First reset all selections
|
|
253
|
+
this.cardData.forEach((item) => {
|
|
254
|
+
item.selected = false;
|
|
255
|
+
if (item.children) {
|
|
256
|
+
item.children.forEach((child) => (child.selected = false));
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// Set the selected item
|
|
261
|
+
cardItem.selected = true;
|
|
262
|
+
this.currentData = this.cardDataView.onItemClick(cardItem);
|
|
263
|
+
|
|
264
|
+
// Force change detection if needed
|
|
265
|
+
// this.changeDetectorRef.detectChanges();
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
newItem() {
|
|
269
|
+
const newData = this.addNewUserToMockData();
|
|
270
|
+
const newCardData: CardData = {
|
|
271
|
+
selected: true,
|
|
272
|
+
title: `${newData.FirstName} ${newData.LastName}`,
|
|
273
|
+
data: {
|
|
274
|
+
...newData,
|
|
275
|
+
} as Partial<UserAccessRequest>,
|
|
276
|
+
body: [
|
|
277
|
+
{ title: 'Name', value: `${newData.FirstName} ${newData.LastName}` },
|
|
278
|
+
{ title: 'E-Mail Address', value: newData.MailAddress },
|
|
279
|
+
{ title: 'Phone Number', value: newData.PhoneNumber ?? '' },
|
|
280
|
+
],
|
|
281
|
+
children: [],
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
if (this.dataView.isTableView) {
|
|
285
|
+
this.dataView.toggleView();
|
|
286
|
+
}
|
|
287
|
+
// First reset all selections
|
|
288
|
+
this.cardData.forEach((item) => {
|
|
289
|
+
item.selected = false;
|
|
290
|
+
if (item.children) {
|
|
291
|
+
item.children.forEach((child) => (child.selected = false));
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
// this.cardData = [newCardData].concat(this.cardData);
|
|
295
|
+
// this.cardDataView.onItemClick(newCardData)
|
|
296
|
+
|
|
297
|
+
this.cardData = [newCardData, ...this.cardData];
|
|
298
|
+
|
|
299
|
+
this.currentData = this.cardDataView.onItemClick(newCardData);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
// toggleChildView(action: string) {
|
|
304
|
+
// if (action === 'create') {
|
|
305
|
+
// const newCard: CardData = {
|
|
306
|
+
// selected: false,
|
|
307
|
+
// title: 'New Card', // Default title, change as needed
|
|
308
|
+
// data: { Name: '', MailAddress: '', PhoneNumber: '' },
|
|
309
|
+
// body: [
|
|
310
|
+
// { title: 'Name', value: '' },
|
|
311
|
+
// { title: 'E-Mail Address', value: '' },
|
|
312
|
+
// { title: 'Phone Number', value: '' }
|
|
313
|
+
// ],
|
|
314
|
+
// children: []
|
|
315
|
+
// };
|
|
316
|
+
|
|
317
|
+
// this.cardData.push(newCard);
|
|
318
|
+
// }
|
|
319
|
+
// }
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
clearData() {
|
|
323
|
+
this.currentData = {} as CardData;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
loadMore() {
|
|
327
|
+
this.cardData = this.cardData.concat(this.cardData);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
onColumnChange(event: boolean) {
|
|
331
|
+
this.showColumn = event;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
onSortChange(event: boolean) {
|
|
335
|
+
this.showSort = event;
|
|
336
|
+
console.log(event);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
onColumnsUpdated(updatedColumns: IDataFilter[]) {
|
|
340
|
+
this.onColumnChange(false);
|
|
341
|
+
this.selectedColumnCount = updatedColumns.length;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
onSortUpdated(updatedSorts: IDataFilter[]) {
|
|
345
|
+
this.onSortChange(false);
|
|
346
|
+
this.selectedSortCount = updatedSorts.length;
|
|
347
|
+
console.log(updatedSorts);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
onViewChange(isGridView: boolean): void {
|
|
351
|
+
console.log('View changed to:', isGridView ? 'Grid View' : 'List View');
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
onStateChange(event: { key: string; value: boolean }): void {
|
|
355
|
+
console.log(`State changed for ${event.key}:`, event.value);
|
|
356
|
+
if (event.key === 'create') {
|
|
357
|
+
console.log('peace is a boy');
|
|
358
|
+
|
|
359
|
+
this.newItem();
|
|
360
|
+
|
|
361
|
+
// const newUser = this.newItem()
|
|
362
|
+
|
|
363
|
+
// if ( newUser && this.cardDataView) {
|
|
364
|
+
// this.dataView.toggleView();
|
|
365
|
+
// // First reset all selections
|
|
366
|
+
// this.cardData.forEach((item) => {
|
|
367
|
+
// item.selected = false;
|
|
368
|
+
// if (item.children) {
|
|
369
|
+
// item.children.forEach((child) => (child.selected = false));
|
|
370
|
+
// }
|
|
371
|
+
// });
|
|
372
|
+
|
|
373
|
+
// this.currentData = this.cardDataView.onItemClick(newUser);
|
|
374
|
+
|
|
375
|
+
// // Force change detection if needed
|
|
376
|
+
// // this.changeDetectorRef.detectChanges();
|
|
377
|
+
// }
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|