Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot modify user settings via WebUI #129

Open
huyle-anh opened this issue Dec 4, 2024 · 6 comments
Open

Cannot modify user settings via WebUI #129

huyle-anh opened this issue Dec 4, 2024 · 6 comments

Comments

@huyle-anh
Copy link

Describe the bug
After pressing the edit button, the edit user window doesn't show, and the page hangs, can't switch to a different page.

To Reproduce :

  1. Log in BMC WebUI with root user
  2. Navigate to Security and Access → User management → Create a user: user1
  3. Click edit user button of user1 to edit user settings

Expected behavior :

  • At step#3, can edit user settings

Desktop:

  • OS: MACOS Ventura - Version 13.7
  • Browser: Chrome
  • Version: 130.0.6723.116
@huyle-anh
Copy link
Author

huyle-anh commented Dec 4, 2024

Debugging: The main cause is that it gets stuck when calling the password dependency, However, the exact reason for this is unknown, it is possible that during the upgrade from Vue2 to Vue3, we missed something, such as some package.json or other components.
Tested: to work now if remove:

     requirePassword() {
       if (this.newUser) return true;
-      if (this.v$.form.password.$dirty) return true;
-      if (this.v$.form.passwordConfirmation.$dirty) return true;
       return false; 

@huyle-anh
Copy link
Author

I created a local patch to bypass this issue, see it below. But I don't think it is a wise or proper solution to completely fix the problem.
Any suggestions for this issue will be helpful for me to complete my work well. Thank you!

   },
   watch: {
     user: function (value) {
@@ -298,6 +303,18 @@ export default {
       this.form.status = value.Enabled;
       this.form.privilege = value.privilege;
     },
+    computedForm: {
+      deep: true,
+      handler: function (n, o) {
+        let isDirty = false;
+        if (n.password !== o.password) {
+          isDirty = true;
+        } else if (n.passwordConfirmation !== o.passwordConfirmation) {
+          isDirty = true;
+        }
+        this.isDirty = isDirty;
+      },
+    },
   },
   validations() {
     return {
@@ -324,7 +341,7 @@ export default {
           required: requiredIf(function () {
             return this.requirePassword();
           }),
-          sameAsPassword: sameAs('password'),
+          sameAsPassword: sameAs(this.form.password),
         },
         manualUnlock: {},
       },
@@ -387,8 +404,7 @@ export default {
     },
     requirePassword() {
       if (this.newUser) return true;
-      if (this.v$.form.password.$dirty) return true;
-      if (this.v$.form.passwordConfirmation.$dirty) return true;
+      if (this.isDirty) return true;
       return false;
     },

@huyle-anh
Copy link
Author

Does anyone have any information or suggestions about this issue?

@kirankumarb07
Copy link
Contributor

Does anyone have any information or suggestions about this issue?

@suryav9724 Can you please check this issue and provide feedback.

@suryav9724
Copy link
Contributor

@huyle-anh Yes, your code is working fine except for the validation of sameAsPassword. Please use the below code for the validation; it will work.
sameAsPassword: sameAs('password'),

@huyle-anh
Copy link
Author

@suryav9724, the code is working fine on Chrome and Safari browsers. But it doesn't work on the Firefox browser. Can you double-check on Firefox browser?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants