tiledesk-dashboard icon indicating copy to clipboard operation
tiledesk-dashboard copied to clipboard

Unable to create new project.

Open Shailendrasnegi opened this issue 3 years ago • 2 comments

Hi,

Anyone please help me in troubleshooting. I am unable to create new project.

Code>> file>>Project.code.ts in tiledesk dashboard>>>

public createProject(name: string) { const headers = new Headers(); headers.append('Accept', 'application/json'); headers.append('Content-type', 'application/json'); headers.append('Authorization', this.TOKEN); const options = new RequestOptions({ headers });

// , 'id_user': this.currentUserID
const body = { 'name': name };

this.logger.log('[PROJECT-SERV] CREATE PROJECT POST REQUEST - BODY ', body);

const url = this.PROJECTS_URL;
this.logger.log('[PROJECT-SERV] CREATE PROJECT POST REQUEST - URL ', url);

return this.http
  .post(url, JSON.stringify(body), options)
  .map((res) => res.json());

}

file>>create-project.component.ts createNewProject() { this.DISPLAY_SPINNER_SECTION = true; this.DISPLAY_SPINNER = true; this.logger.log('[WIZARD - CREATE-PRJCT] CREATE NEW PROJECT - PROJECT-NAME DIGIT BY USER ', this.project_name);

this.projectService.createProject(this.project_name)
  .subscribe((project) => {
    this.logger.log('[WIZARD - CREATE-PRJCT] POST DATA PROJECT RESPONSE ', project);

    // WHEN THE USER SELECT A PROJECT ITS ID IS SEND IN THE PROJECT SERVICE THET PUBLISHES IT
    // THE SIDEBAR SIGNS UP FOR ITS PUBLICATION
    const newproject: Project = {
      _id: project._id,
      name: project.name,
      operatingHours: project.activeOperatingHours
      
    }
    

    // SENT THE NEW PROJECT TO THE AUTH SERVICE THAT PUBLISH
    this.auth.projectSelected(newproject)
    this.logger.log('[WIZARD - CREATE-PRJCT] CREATED PROJECT ', newproject)

    this.id_project = newproject._id

    /* !!! NO MORE USED - NOW THE ALL PROJECTS ARE SETTED IN THE STORAGE IN getProjectsAndSaveInStorage()
     * SET THE project_id IN THE LOCAL STORAGE
     * WHEN THE PAGE IS RELOADED THE SIDEBAR GET THE PROJECT ID FROM THE LOCAL STORAGE */
    // localStorage.setItem('project', JSON.stringify(newproject));

  }, (error) => {
    this.DISPLAY_SPINNER = false;
    this.logger.error('[WIZARD - CREATE-PRJCT] CREATE NEW PROJECT - POST REQUEST - ERROR ', error);

  }, () => {
    this.logger.log('[WIZARD - CREATE-PRJCT] CREATE NEW PROJECT - POST REQUEST * COMPLETE *');

    this.projectService.newProjectCreated(true)

    setTimeout(() => {
      this.DISPLAY_SPINNER = false;
    }, 2000);

    // 'getProjectsAndSaveInStorage()' was called only on the onInit lifehook, now recalling also after the creation 
    // of the new project resolve the bug  'the auth service not find the project in the storage'
    this.getProjectsAndSaveInStorage();

  });

}

dashboard-config.json file>>>>

{ "t2y12PruGU9wUtEGzBJfolMIgK": "PAY:T-ANA:T-ACT:T-TRI:T-GRO:T-DEP:T-OPH:T-MTL:T-DGF:T-NAT:T-CAR:T-V1L:T-PSA:T-MTT:T-SUP:T-LBS:T-APP:T-DEV:T-NOT:T", "widgetUrl": "http://100.100.10.76:4200/launch.js", "botcredendialsURL": "${BOT_CREDENTIAL_URL}", "SERVER_BASE_URL": "http://localhost:3000/", "CHAT_BASE_URL": "http://localhost:80/chat/", "testsiteBaseUrl": "http://100.100.10.76:4200/assets/test_widget_page/index.html", "wsUrl": "'ws://localhost:3000/ws'", "brandSrc": "", "globalRemoteJSSrc":"", "chatEngine": "mqtt", "firebaseAuth": "false", "uploadEngine": "native", "pushEngine": "", "logLevel": "INFO ", "firebase": { "apiKey": "AIzaSyDADNagIIyaPMhA8YdJWRfDcTUnd0e4OgE", "authDomain": "rasawidget.firebaseapp.com", "projectId": "rasawidget", "storageBucket": "rasawidget.appspot.com", "messagingSenderId": "347072642067", "appId": "1:347072642067:web:a7cc6794a069f6e37a13e6", "vapidKey": "G-BNSDDXJJE3" } }

error::>> image image

Shailendrasnegi avatar May 24 '22 08:05 Shailendrasnegi

Is Tiledesk-server running? I suggest you to use Docker Compose installation. Follow this guide: https://github.com/Tiledesk/tiledesk-deployment/blob/master/docker-compose/README.md

andrealeo83 avatar May 24 '22 10:05 andrealeo83

Yes. I have tried but still there is same issue.

Shailendrasnegi avatar May 25 '22 04:05 Shailendrasnegi