_onCreateProjectButtonClicked() {
    // clear input fields of dialog
    this.resetCreateProjectDialog();

    // add statusbar to be able to get user infos for this step
    console.log(this.contactServiceURL);
    fetch(this.contactServiceURL + "/groups", {
      method: "GET",
      headers: Auth.getAuthHeaderWithSub()
    }).then(response => {
      if(!response.ok) throw Error(response.status);
      console.log(typeof response)
      console.log("ssssssss" + Object.keys(response));
      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);
      }

      console.log(this.groups);
      // only open popup once group loaded
      this.shadowRoot.getElementById("dialog-create-project").open();
      // disable create button until user entered a project name
      this.shadowRoot.getElementById("dialog-button-create").disabled = true;
    }).catch(error => {
      if(error.message == "401") {
        // user is not authorized
        // maybe the access token has expired
        Auth.removeAuthDataFromLocalStorage();
        //    location.reload();
      } else {
        console.log(error);
        // in case of contactservice not running, which should not happen in real deployment
        this.groups = [];
        // only open popup once group loaded
        this.shadowRoot.getElementById("dialog-create-project").open();
        // disable create button until user entered a project name
        this.shadowRoot.getElementById("dialog-button-create").disabled = true;
      }

    });
  }
/**
   * Gets called by the "Create Project" button. Opens the dialog for creating a project, which then lets the user
   * select a name for the project and a group that should be connected to the project.
   * @private
   */
Gets called by the "Create Project" button. Opens the dialog for creating a project, which then lets the user
select a name for the project and a group that should be connected to the project.
@private
Gets called by the " Create Project " button . Opens the dialog for creating a project which then lets the user select a name for the project and a group that should be connected to the project . @private
_onCreateProjectButtonClicked() {
    this.resetCreateProjectDialog();
    console.log(this.contactServiceURL);
    fetch(this.contactServiceURL + "/groups", {
      method: "GET",
      headers: Auth.getAuthHeaderWithSub()
    }).then(response => {
      if(!response.ok) throw Error(response.status);
      console.log(typeof response)
      console.log("ssssssss" + Object.keys(response));
      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);
      }
      console.log(this.groups);
      this.shadowRoot.getElementById("dialog-create-project").open();
      this.shadowRoot.getElementById("dialog-button-create").disabled = true;
    }).catch(error => {
      if(error.message == "401") {
        Auth.removeAuthDataFromLocalStorage();
      } else {
        console.log(error);
        this.groups = [];
        this.shadowRoot.getElementById("dialog-create-project").open();
        this.shadowRoot.getElementById("dialog-button-create").disabled = true;
      }
    });
  }
_onCreateProjectButtonClicked ( ) { this . resetCreateProjectDialog ( ) ; console . log ( this . contactServiceURL ) ; fetch ( this . contactServiceURL + "/groups" , { method : "GET" , headers : Auth . getAuthHeaderWithSub ( ) } ) . then ( response => { if ( ! response . ok ) throw Error ( response . status ) ; console . log ( typeof response ) console . log ( "ssssssss" + Object . keys ( response ) ) ; 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 ) ; } console . log ( this . groups ) ; this . shadowRoot . getElementById ( "dialog-create-project" ) . open ( ) ; this . shadowRoot . getElementById ( "dialog-button-create" ) . disabled = true ; } ) . catch ( error => { if ( error . message == "401" ) { Auth . removeAuthDataFromLocalStorage ( ) ; } else { console . log ( error ) ; this . groups = [ ] ; this . shadowRoot . getElementById ( "dialog-create-project" ) . open ( ) ; this . shadowRoot . getElementById ( "dialog-button-create" ) . disabled = true ; } } ) ; }
Gets called by the "Create Project" button.
Gets called by the " Create Project " button .
// clear input fields of dialog // add statusbar to be able to get user infos for this step // 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 // only open popup once group loaded // disable create button until user entered a project name // user is not authorized // maybe the access token has expired //    location.reload(); // in case of contactservice not running, which should not happen in real deployment // only open popup once group loaded // disable create button until user entered a project name