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

Show Id in PasswordDialog #122

Open
theseal opened this issue Nov 14, 2016 · 0 comments
Open

Show Id in PasswordDialog #122

theseal opened this issue Nov 14, 2016 · 0 comments

Comments

@theseal
Copy link

theseal commented Nov 14, 2016

It would be very useful if the id of a password was shown in PasswordDialog.
This comes in handy when you are configuration clients that should access specific passwords thought the API.

I know that the Id can be found if you do a search though the API, but it would be much easier if it was readable in the dialog.

We have patch PasswordDialog.java with the following code, but I'm not sure if its made correctly and deserves a PR:

--- PasswordDialog.java.orig	2016-11-10 14:38:16.292451289 +0100
+++ PasswordDialog.java	2016-11-10 16:09:25.840637845 +0100
@@ -65,6 +65,7 @@
     private final static TextMessages textMessages = GWT.create(TextMessages.class);
     private Password password;
     private TextField<String> nameTextBox;
+    private TextField<String> idTextBox;
     private TextField<String> usernameTextBox;
     private TextField<String> passwordTextBox;
     private TextHelperComboBox<TagData> tagsComboBox;
@@ -84,7 +85,7 @@
         this.setHeading(textMessages.password());
         this.setModal(true);
         this.setLayout(new AbsoluteLayout());
-        this.setSize(430, 415);
+        this.setSize(430, 443);
         this.setResizable(false);
         
         LabelField lblfldName = new LabelField(textMessages.title_());
@@ -227,7 +228,15 @@
         setButtonAlign(HorizontalAlignment.CENTER);
         addButton(saveButton);
         addButton(cancelButton);
-        
+
+        LabelField lblfldId = new LabelField("Id:");
+        add(lblfldId, new AbsoluteData(7, 339));
+
+        idTextBox = new TextField<String>();
+        idTextBox.setReadOnly(true);
+        add(idTextBox, new AbsoluteData(82, 339));
+        idTextBox.setSize("76px", "22px");
+
         doLoadTags();
     }
 
@@ -433,6 +442,9 @@
     private void setFields()
     {
         nameTextBox.setValue(password.getName());
+        if (password.getId() > 0) {
+            idTextBox.setValue(password.getId() + "");
+        }
         usernameTextBox.setValue(password.getUsername());
         tagsComboBox.setRawValue(password.getTagsAsString());
         notesTextArea.setValue(password.getNotes());

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

1 participant