From aee1e36a798f3e461c6a75f52519063c9133775e Mon Sep 17 00:00:00 2001 From: Bertrand Zuchuat Date: Mon, 5 Dec 2022 13:19:48 +0100 Subject: [PATCH] user: password validator The password is mandatory if the user is not loaded, otherwise it is optional * Adds validator on new password on change password dialog. * Fixes the identifier of the delete button so that it is unique. Co-Authored-by: Bertrand Zuchuat --- package-lock.json | 14 +++++++ package.json | 1 + .../user-id-editor.component.html | 4 +- .../user-id-editor.component.ts | 13 ++++++- .../src/app/api/user-api.service.ts | 13 ++++++- .../patron-profile-password.component.ts | 37 ++++++++++++++++--- 6 files changed, 73 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4106b2df7..400042b48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,6 +38,7 @@ "issn": "^1.0.6", "lodash-es": "^4.17.21", "luxon": "^3.1.1", + "js-generate-password": "^0.1.7", "marked": "^4.1.1", "moment": "^2.29.1", "ngx-bootstrap": "^9.0.0", @@ -8888,6 +8889,14 @@ "integrity": "sha512-bZ5Sy3YzKo9Fyc8wH2iIQK4JImJ6R0GWI9kL1/k7Z91ZBNgkRXE6U0JfHIizZbort8ZunhSI3jw9I6253ahKfg==", "peer": true }, + "node_modules/js-generate-password": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/js-generate-password/-/js-generate-password-0.1.7.tgz", + "integrity": "sha512-O2fTDgD2DSf4mnuTKO0rZ2DMgv/CkWvdboKzV5XDDLsUrmFQppbMtMkbLIEHiiXSsIdMcFdr/OAN+CXqc7TdTQ==", + "bin": { + "js-generate-password": "dist/index.js" + } + }, "node_modules/js-sdsl": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", @@ -20259,6 +20268,11 @@ "integrity": "sha512-bZ5Sy3YzKo9Fyc8wH2iIQK4JImJ6R0GWI9kL1/k7Z91ZBNgkRXE6U0JfHIizZbort8ZunhSI3jw9I6253ahKfg==", "peer": true }, + "js-generate-password": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/js-generate-password/-/js-generate-password-0.1.7.tgz", + "integrity": "sha512-O2fTDgD2DSf4mnuTKO0rZ2DMgv/CkWvdboKzV5XDDLsUrmFQppbMtMkbLIEHiiXSsIdMcFdr/OAN+CXqc7TdTQ==" + }, "js-sdsl": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", diff --git a/package.json b/package.json index 76740bc9e..3ab8beb51 100644 --- a/package.json +++ b/package.json @@ -92,6 +92,7 @@ "easymde": "^2.18.0", "font-awesome": "^4.7.0", "issn": "^1.0.6", + "js-generate-password": "^0.1.7", "lodash-es": "^4.17.21", "luxon": "^3.1.1", "marked": "^4.1.1", diff --git a/projects/admin/src/app/record/custom-editor/user-id-editor/user-id-editor.component.html b/projects/admin/src/app/record/custom-editor/user-id-editor/user-id-editor.component.html index eb13ea36c..fc6495ac2 100644 --- a/projects/admin/src/app/record/custom-editor/user-id-editor/user-id-editor.component.html +++ b/projects/admin/src/app/record/custom-editor/user-id-editor/user-id-editor.component.html @@ -24,12 +24,12 @@