_onEditConnectedGroupClicked() {
    
    fetch(this.contactServiceURL + "/groups", {
      method: "GET",
      headers: Auth.getAuthHeaderWithSub()
    }).then(response => {
      if(!response.ok) throw Error(response.status);
      return response.json();
    }).then(data => {
      // store loaded groups
      // groups given by contact service as a JSONObject with key = group agent id and value = group name
      // we create an array of objects with id and name attribute out of it
      this.groups = [];
      for(let key of Object.keys(data)) {
        let group = {
          "id": key,
          "name": data[key]
        };
        this.groups.push(group);
      }
        // hide current group name paragraph element
        this.shadowRoot.getElementById("connected-group-name").style.setProperty("display", "none");

        // show dropdown menu to select a different group, therefore remove display: none
        this.shadowRoot.getElementById("input-edit-group-name").style.removeProperty("display");
      });
    
    


    /*const projectName = this.shadowRoot.getElementById("connected-group-project-name").value;
    const newLinkedGroupName = this.shadowRoot.getElementById("input-edit-group-name").value;

    fetch(this.projectServiceURL + "/projects/changeGroup/", {
      method: "POST",
      headers: Auth.getAuthHeaderWithSub(),
      body: JSON.stringify({
        "name": projectName,
        "access_token": Auth.getAccessToken(),
        "newGroupNameId": newLinkedGroupName
      })
    }).then( response => {
        if(!response.ok) throw Error(response.status);
        console.log(typeof response)
        console.log("ssssssss" + Object.keys(response));
        return response.json();
    })*/

  }
/**
   * Gets called when the user clicks on the edit-button for the group name in the "connected-group" dialog.
   * @private
   */
Gets called when the user clicks on the edit-button for the group name in the "connected-group" dialog.
@private
Gets called when the user clicks on the edit - button for the group name in the " connected - group " dialog . @private
_onEditConnectedGroupClicked() {
    fetch(this.contactServiceURL + "/groups", {
      method: "GET",
      headers: Auth.getAuthHeaderWithSub()
    }).then(response => {
      if(!response.ok) throw Error(response.status);
      return response.json();
    }).then(data => {
      this.groups = [];
      for(let key of Object.keys(data)) {
        let group = {
          "id": key,
          "name": data[key]
        };
        this.groups.push(group);
      }
        this.shadowRoot.getElementById("connected-group-name").style.setProperty("display", "none");
        this.shadowRoot.getElementById("input-edit-group-name").style.removeProperty("display");
      });
  }
_onEditConnectedGroupClicked ( ) { fetch ( this . contactServiceURL + "/groups" , { method : "GET" , headers : Auth . getAuthHeaderWithSub ( ) } ) . then ( response => { if ( ! response . ok ) throw Error ( response . status ) ; return response . json ( ) ; } ) . then ( data => { this . groups = [ ] ; for ( let key of Object . keys ( data ) ) { let group = { "id" : key , "name" : data [ key ] } ; this . groups . push ( group ) ; } this . shadowRoot . getElementById ( "connected-group-name" ) . style . setProperty ( "display" , "none" ) ; this . shadowRoot . getElementById ( "input-edit-group-name" ) . style . removeProperty ( "display" ) ; } ) ; }
Gets called when the user clicks on the edit-button for the group name in the "connected-group" dialog.
Gets called when the user clicks on the edit - button for the group name in the " connected - group " dialog .
// store loaded groups // groups given by contact service as a JSONObject with key = group agent id and value = group name // we create an array of objects with id and name attribute out of it // hide current group name paragraph element // show dropdown menu to select a different group, therefore remove display: none /*const projectName = this.shadowRoot.getElementById("connected-group-project-name").value;
    const newLinkedGroupName = this.shadowRoot.getElementById("input-edit-group-name").value;

    fetch(this.projectServiceURL + "/projects/changeGroup/", {
      method: "POST",
      headers: Auth.getAuthHeaderWithSub(),
      body: JSON.stringify({
        "name": projectName,
        "access_token": Auth.getAccessToken(),
        "newGroupNameId": newLinkedGroupName
      })
    }).then( response => {
        if(!response.ok) throw Error(response.status);
        console.log(typeof response)
        console.log("ssssssss" + Object.keys(response));
        return response.json();
    })*/