From 37881f2ed1f364dab28dd132874325ac07722a3c Mon Sep 17 00:00:00 2001 From: Guan-Xin Wang Date: Mon, 1 Jul 2024 19:49:12 +0800 Subject: [PATCH 1/2] refactor: ignore local testing project --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5d49ba83..255ba3c1 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ testem.log Thumbs.db .env .angular +/tag_check_projects From 8fe5d288829d6a6350edab044209264d3d6fed3a Mon Sep 17 00:00:00 2001 From: Guan-Xin Wang Date: Mon, 1 Jul 2024 21:29:39 +0800 Subject: [PATCH 2/2] fix 1. After importing the project, routing to the home page and then reload the page. 2. Change the log from file to file.path. --- .../waiter/project-io/waiter-project-io.controller.ts | 2 +- .../project-import/project-import.component.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/nest-backend/src/waiter/project-io/waiter-project-io.controller.ts b/apps/nest-backend/src/waiter/project-io/waiter-project-io.controller.ts index 4b3af57a..0c698b84 100644 --- a/apps/nest-backend/src/waiter/project-io/waiter-project-io.controller.ts +++ b/apps/nest-backend/src/waiter/project-io/waiter-project-io.controller.ts @@ -54,7 +54,7 @@ export class WaiterProjectIoController { try { Logger.log('called importProject'); Logger.log('file', file); - Logger.log('file', file.path); + Logger.log('file.path', file.path); const rootProjectPath = await this.configurationSerivce.getRootProjectPath(); await this.waiterProjectIoService.importProject( diff --git a/apps/ng-frontend/src/app/shared/components/project-import/project-import.component.ts b/apps/ng-frontend/src/app/shared/components/project-import/project-import.component.ts index 01814cad..a996c7e9 100644 --- a/apps/ng-frontend/src/app/shared/components/project-import/project-import.component.ts +++ b/apps/ng-frontend/src/app/shared/components/project-import/project-import.component.ts @@ -1,7 +1,7 @@ import { MatCardModule } from '@angular/material/card'; import { Component, OnDestroy, ViewEncapsulation } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { catchError, Subject } from 'rxjs'; +import { catchError, Subject, Subscription } from 'rxjs'; import { ActivatedRoute, Router } from '@angular/router'; import { ProjectIoService } from '../../services/api/project-io/project-io.service'; @@ -37,7 +37,7 @@ export class ProjectImportComponent implements OnDestroy { const file: File | null = target.files?.[0] || null; if (file) { console.log('file', file); - this.projectIoService + return this.projectIoService .importProject(file) .pipe( catchError((err) => { @@ -50,11 +50,14 @@ export class ProjectImportComponent implements OnDestroy { if (event) { console.log('event', event); if (event.type === 1) { - this.router.navigate(['/']); + this.router.navigate(['/']).then(() => { + window.location.reload(); + }); } } }); } + return new Subscription(); } ngOnDestroy(): void {