Menu

#857 Add contact which is already available leads to rename

HTML UI 0.1
closed-migrated
nobody
HTML (7)
5
2018-03-27
2015-08-18
Bastian Sss
No

When you add a contact which is already in your contact list, the contact is renamed according to the name you chose while adding. Instead, there should be a prompt or so to say that the contact is already added.

Discussion

  • Mehmet Bayram

    Mehmet Bayram - 2015-11-03

    We are trying to fix the bug but we can not reproduce it. When we try to add a contact whose jabber ID
    is already in our contact list, it does not effect the contact list (See
    attached image). But when the new contact has a new jabber ID and a
    existing nickname, this new contact is added without renaming to the
    contact list and you have the nick name twice.

     
    • Franz Zieris

      Franz Zieris - 2015-11-03

      As already stated on the mailing list, this bug has the "HTML" tag, which means it refers to the new GUI rather than the old one. Your screenshot clearly shows the old SWT interface.

       
  • Mehmet Bayram

    Mehmet Bayram - 2015-11-08

    We have thought about a solution approach, which we would present you:

    This is the chain of calls, if you add a new contact with the HTML GUI:
    de.fu_berlin.inf.dpp.ui.frontend\html\js\views.js: addContact();
    → de.fu_berlin.inf.dpp.ui.frontend\html\js\models\contact.js: create()
    → de.fu_berlin.inf.dpp.ui.frontend\html\js\saros-api.js: addContact()
    → de.fu_berlin.inf.dpp.ui.core_facades.StateFacade.java: addContact()

    The last called function is a java function. Because the HTML code is written only for view and to add a contact is a business logic task, we fix the problem in the java function. There we ask if this contact is already existing. If yes, it would open a message dialog like "Contact exists already: " + [jid]" with the swing function JoptionPane.showMessageDialog(). If not, the contact will be added.

    If the approach fits to conventions and other rules of the project we would implement it. We will be also happy about suggestions for improvement.

     
  • Stefan Rossbach

    Stefan Rossbach - 2015-11-08

    You cannot open a JOptionsPane in Eclipse.

     
  • Franz Zieris

    Franz Zieris - 2015-11-09

    Indeed, you should not rely on Swing. But judging from its name, the DialogManager should be worth looking into.

     
  • Matthias Bohnstedt

    If you going to use the DialogManger to show a new window you would also need to provide a html page that only contain the information “the Contact name already exist, please chose another one to add” (or something similar). Therefor you would need to implement a BrowserPage that contain the location of this html document. For any interaction in this page (like a “close” or “okay” button” you also need to create a (very simple) BrowserFunctions.

    Long story short: It’s a lot of busy work to solve this with a new HTML page dialog (and this might also not be the best user expirence). The better, and probably easier, way would be to use the JavaScriptEvent "showError":

    Browser.run("SarosApi.trigger(‘showError’," + errorMessage + ")").

    This would show an message in the current browser (aka in the “open dialog” like the MainPage). You can find an example in the SessionWizardPageBrowserFunctions.java (line 64)

    If you want more information about this approach you can contact me. There is also a patch in the review (sadly not yet finished) which will make the usage of these JavaScriptEvents easier.

     

    Last edit: Matthias Bohnstedt 2015-11-09
    • Matthias Bohnstedt

      The patch for using the Javascript-API: http://saros-build.imp.fu-berlin.de/gerrit/#/c/2780/
      would make the call you looking for like "JavaScriptAPI.showError(String msg)";

       
  • tobous

    tobous - 2018-03-27
    • Status: open --> closed-migrated
     

Log in to post a comment.