Skip to content

Commit

Permalink
Merge pull request #112 from ramkumar-pacewisdom/dev-ram0
Browse files Browse the repository at this point in the history
Dev ram0
  • Loading branch information
ramkumar-pacewisdom authored Jul 24, 2024
2 parents e40bb00 + 15726d6 commit dcc0d31
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class ProjectDetailsComponent implements OnDestroy, OnInit {
this.subscription.add(
this.route.queryParams.subscribe((params: any) => {
this.projectId = params.projectId;
this.libProjectService.projectData.id = params.projectId;
if (params.projectId) {
if (params.mode === 'edit') {
if (Object.keys(this.libProjectService.projectData).length) {
Expand All @@ -69,20 +70,6 @@ export class ProjectDetailsComponent implements OnDestroy, OnInit {
}
} else {
this.readProjectDeatilsAndMap(data.controls,this.libProjectService.projectData);
// this.libProjectService
// .createOrUpdateProject()
// .subscribe((res: any) => {
// (this.projectId = res.result.id),
// this.router.navigate([], {
// relativeTo: this.route,
// queryParams: {
// projectId: this.projectId,
// mode: 'edit',
// },
// queryParamsHandling: 'merge',
// replaceUrl: true,
// });
// });
}
})
);
Expand Down Expand Up @@ -146,6 +133,7 @@ export class ProjectDetailsComponent implements OnDestroy, OnInit {
queryParamsHandling: 'merge',
replaceUrl: true,
});
this.libProjectService.projectData.id = res.result.id;
})
}

Expand Down Expand Up @@ -227,7 +215,7 @@ export class ProjectDetailsComponent implements OnDestroy, OnInit {
clearInterval(this.intervalId);
this.intervalId = null;
}
if(this.projectId) {
if(this.projectId && this.libProjectService.projectData.length > 0) {
this.libProjectService.createOrUpdateProject(this.libProjectService.projectData,this.projectId).subscribe((res)=> console.log(res))
this.libProjectService.saveProjectFunc(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class SubTasksResourcesComponent implements OnInit,OnDestroy{
}
}
})
)
)
} else {
for (let i = 0; i < 2; i++) {
this.taskData.push(createTaskObject());
Expand Down Expand Up @@ -212,6 +212,8 @@ export class SubTasksResourcesComponent implements OnInit,OnDestroy{
if (this.autoSaveSubscription) {
this.autoSaveSubscription.unsubscribe();
}
if(this.libProjectService.projectData.length > 0) {
this.libProjectService.createOrUpdateProject(this.libProjectService.projectData,this.projectId).subscribe((res)=> console.log(res))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export class TasksComponent implements OnInit,OnDestroy {
this.subscription.add(
this.route.queryParams.subscribe((params:any) => {
this.projectId = params.projectId;
this.libProjectService.projectData.id = params.projectId;
console.log(this.route)
if(params.projectId){
if(params.mode === 'edit') {
Expand Down Expand Up @@ -121,6 +122,7 @@ export class TasksComponent implements OnInit,OnDestroy {
queryParamsHandling: 'merge',
replaceUrl: true,
});
this.libProjectService.projectData.id = res.result.id;
})
}
})
Expand Down Expand Up @@ -225,7 +227,9 @@ export class TasksComponent implements OnInit,OnDestroy {
if (this.autoSaveSubscription) {
this.autoSaveSubscription.unsubscribe();
}
if(this.libProjectService.projectData.length > 0) {
this.libProjectService.createOrUpdateProject(this.libProjectService.projectData,this.projectId).subscribe((res)=> console.log(res))
}
}

addingTask() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class LayoutComponent {
dialogRef.afterClosed().subscribe(result => {
if(result.sendForReview == "SEND_FOR_REVIEW"){
this.libProjectService
.createOrUpdateProject(this.libProjectService.projectData).subscribe((res) => {
.createOrUpdateProject(this.libProjectService.projectData,this.libProjectService.projectData.id).subscribe((res) => {
this.route.queryParams.subscribe((params: any) => {
if (params.projectId) {
const reviewer_ids = (result.selectedValues.length === list.result.data.length)? {} : { "reviewer_ids" : result.selectedValues.map((item:any) => item.id) } ;
Expand Down
10 changes: 9 additions & 1 deletion projects/self-creation-portal/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
import { provideTranslations } from './translation.providers';
import { LIBRARY_CONFIG, SlAuthLibModule } from 'authentication_frontend_library';
import { authInterceptor } from './services/interceptor/auth.interceptor';
import { environment } from 'environments';
import { switchMap, of } from 'rxjs';
// Create a loader for translation files
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
Expand All @@ -28,6 +30,12 @@ export const appConfig: ApplicationConfig = {
{ provide: LIBRARY_CONFIG, useFactory: configFactory, deps: [HttpClient] }
],
};
// export function configFactory(http: HttpClient): any {
// return http.get('assets/library.config.json');
// }
export function configFactory(http: HttpClient): any {
return http.get('assets/library.config.json');
return http.get("../assets/config/library-config.json").pipe(switchMap((data:any)=>{
data.baseUrl = environment.baseURL
return of(data)
}))
}

0 comments on commit dcc0d31

Please sign in to comment.