diff --git a/angular.json b/angular.json index a44192b..c775040 100644 --- a/angular.json +++ b/angular.json @@ -23,7 +23,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "baseHref": "/validation/", + "baseHref": "/validation/", "deployUrl": "/validation/", "outputPath": "dist/template-validation-portal", "index": "src/index.html", @@ -32,9 +32,9 @@ "tsConfig": "tsconfig.app.json", "inlineStyleLanguage": "scss", "assets": [ - "src/favicon.ico", - "src/assets" - ], + "src/favicon.ico", + "src/assets" +], "styles": [ "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", "src/styles.scss", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index fb7b3fb..eee7553 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,8 +1,10 @@ import { NgModule } from '@angular/core'; +import { ToastrModule } from 'ngx-toastr'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterModule, Routes } from '@angular/router'; import { AuthGuard } from './modules/shared/guard/auth.guard'; -let routes: Routes = [ +const routes: Routes = [ { path: 'auth', loadChildren: () => import('./modules/auth/auth.module').then(m => m.AuthModule) @@ -25,7 +27,11 @@ let routes: Routes = [ ]; @NgModule({ - imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] + imports: [ + RouterModule.forRoot(routes), + BrowserAnimationsModule, + ToastrModule.forRoot() + ], + exports: [RouterModule], }) export class AppRoutingModule { } diff --git a/src/app/modules/shared/services/template.service.ts b/src/app/modules/shared/services/template.service.ts index 7956572..2a057e3 100644 --- a/src/app/modules/shared/services/template.service.ts +++ b/src/app/modules/shared/services/template.service.ts @@ -8,6 +8,7 @@ import { Observable } from 'rxjs'; }) export class TemplateService { private baseUrl: any = window['env' as any]['baseUrl' as any]; + private linkUrl: any = window['env' as any]['linkUrl' as any]; private apiBasePath: string = 'template/api/v1/'; // Global variable for API path templateFile: any; @@ -17,7 +18,7 @@ export class TemplateService { constructor(private dataService: DataService) {} getEnvironmentUrl(): string { - return this.baseUrl; + return this.linkUrl; } selectTemplates() { @@ -104,7 +105,7 @@ export class TemplateService { } getSolutionLink(solutionId: string): string { - const baseUrl = this.getEnvironmentUrl(); - return `${baseUrl}surveyml/${solutionId}`; + const linkUrl = this.getEnvironmentUrl(); + return `${this.linkUrl}surveyml/${solutionId}`; } } diff --git a/src/app/modules/template/template-selection/template-selection.component.ts b/src/app/modules/template/template-selection/template-selection.component.ts index 5c75b42..07cb14e 100644 --- a/src/app/modules/template/template-selection/template-selection.component.ts +++ b/src/app/modules/template/template-selection/template-selection.component.ts @@ -80,7 +80,7 @@ export class TemplateSelectionComponent implements OnInit { this.toaster.success('Downloaded successfully'); this.selectFile = ""; } else { - alert("Please select a file to download"); + this.toaster.error('No file found ', "Please select a file"); } } @@ -217,7 +217,7 @@ export class TemplateSelectionComponent implements OnInit { } ); } else { - alert(`Please select a file to ${action}`); + this.toaster.error('No file found ', "Please select a file"); } } diff --git a/src/app/modules/template/template-solution-list/template-solution-list.component.css b/src/app/modules/template/template-solution-list/template-solution-list.component.css index 3749236..8819e61 100644 --- a/src/app/modules/template/template-solution-list/template-solution-list.component.css +++ b/src/app/modules/template/template-solution-list/template-solution-list.component.css @@ -60,4 +60,8 @@ mat-icon-button:hover { mat-paginator { background-color: #fafafa; border-top: 1px solid #e0e0e0; +} +.back-button { + color: rgb(0, 116, 182, 1); + /* font-weight: bold; */ } \ No newline at end of file diff --git a/src/app/modules/template/template-solution-list/template-solution-list.component.html b/src/app/modules/template/template-solution-list/template-solution-list.component.html index 718ec7c..4704248 100644 --- a/src/app/modules/template/template-solution-list/template-solution-list.component.html +++ b/src/app/modules/template/template-solution-list/template-solution-list.component.html @@ -1,4 +1,9 @@
+ + +

List of Solutions

@@ -21,15 +26,20 @@

List of Solutions

{{element.solutionName}} + + Solution Created Date + {{element.solution_created_date}} + + - Start Date + Survey Start Date {{element.startDate | date:'medium'}} - End Date + Survey End Date {{element.endDate | date:'medium'}} diff --git a/src/app/modules/template/template-solution-list/template-solution-list.component.ts b/src/app/modules/template/template-solution-list/template-solution-list.component.ts index d81940a..df64b41 100644 --- a/src/app/modules/template/template-solution-list/template-solution-list.component.ts +++ b/src/app/modules/template/template-solution-list/template-solution-list.component.ts @@ -5,6 +5,7 @@ import { TemplateService } from '../../shared/services/template.service'; import { Router } from '@angular/router'; import { AuthenticationService } from '../../shared/services/authentication.service'; import { ToastrService } from 'ngx-toastr'; +import { Location } from '@angular/common'; @Component({ selector: 'table-pagination-example', @@ -12,7 +13,7 @@ import { ToastrService } from 'ngx-toastr'; templateUrl: 'template-solution-list.component.html', }) export class TemplateSolutionListComponent implements AfterViewInit, OnInit { - displayedColumns: string[] = ['solutionId', 'solutionName', 'startDate', 'endDate', 'action']; + displayedColumns: string[] = ['solutionId', 'solutionName','solution_created_date', 'startDate', 'endDate', 'action']; dataSource = new MatTableDataSource(); resourceType: string = "" @@ -22,7 +23,9 @@ export class TemplateSolutionListComponent implements AfterViewInit, OnInit { private templateService: TemplateService, private router: Router, private authService: AuthenticationService, - private toastr: ToastrService + private toastr: ToastrService, + private location: Location + ) {} ngOnInit() { @@ -36,6 +39,7 @@ export class TemplateSolutionListComponent implements AfterViewInit, OnInit { this.dataSource.data = response.SolutionList.map((item: any) => ({ solutionId: item.SOLUTION_ID, solutionName: item.SOLUTION_NAME, + solution_created_date: item.SOLUTION_CREATED_DATE, startDate: item.START_DATE, endDate: item.END_DATE })); @@ -73,4 +77,7 @@ export class TemplateSolutionListComponent implements AfterViewInit, OnInit { (err) => this.toastr.error('Failed to copy link') ); } + goBack() { + this.location.back(); + } } diff --git a/src/app/modules/template/template-success/template-success.component.html b/src/app/modules/template/template-success/template-success.component.html index 4fc02b7..7340929 100644 --- a/src/app/modules/template/template-success/template-success.component.html +++ b/src/app/modules/template/template-success/template-success.component.html @@ -1,11 +1,11 @@
+
-
- -
diff --git a/src/app/modules/template/template-success/template-success.component.scss b/src/app/modules/template/template-success/template-success.component.scss index c16cc38..3ec3722 100644 --- a/src/app/modules/template/template-success/template-success.component.scss +++ b/src/app/modules/template/template-success/template-success.component.scss @@ -88,4 +88,14 @@ p { margin-top: 10px; } +.congrats-message { + color: rgb(0, 116, 182, 1) !important; + font-weight: bold; + font-size: 2rem; + text-align: center; +} +.back-button { + color: rgb(0, 116, 182, 1); + /* font-weight: bold; */ +} \ No newline at end of file diff --git a/src/app/modules/template/template-success/template-success.component.ts b/src/app/modules/template/template-success/template-success.component.ts index dea88a2..7601796 100644 --- a/src/app/modules/template/template-success/template-success.component.ts +++ b/src/app/modules/template/template-success/template-success.component.ts @@ -4,6 +4,7 @@ import { TemplateService } from '../../shared/services/template.service'; import { ActivatedRoute, Router } from '@angular/router'; import { AuthenticationService } from '../../shared/services/authentication.service'; import { Observable, Subject } from 'rxjs'; +import { Location } from '@angular/common'; @Component({ selector: 'app-template-success', @@ -22,7 +23,8 @@ export class TemplateSuccessComponent implements OnInit { private authService: AuthenticationService, private route: ActivatedRoute, private router: Router, - private templateService: TemplateService + private templateService: TemplateService, + private location: Location ) { } ngOnInit(): void { @@ -59,6 +61,11 @@ export class TemplateSuccessComponent implements OnInit { }); } + goBack() { + this.location.back(); + } + + onLogout() { this.authService.logoutAccount(); this.isUserLogin = false; diff --git a/src/app/modules/template/validation-result/validation-result.component.scss b/src/app/modules/template/validation-result/validation-result.component.scss index c71dd4c..e0cea9b 100644 --- a/src/app/modules/template/validation-result/validation-result.component.scss +++ b/src/app/modules/template/validation-result/validation-result.component.scss @@ -29,18 +29,22 @@ cursor: pointer; } +.back-button-container p { + margin-top: 15px; + margin-left: 15px; + cursor: pointer; + color: rgb(0, 116, 182, 1) !important; /* Set the color */ + font-weight: bold; /* Optional: add bold for better visibility */ +} + .back-button-container mat-icon { padding: 10px; border-radius: 50%; - border: 1px solid; + border: 1px solid rgb(0, 116, 182, 1) !important; /* Change icon border color */ + color: rgb(0, 116, 182, 1) !important; /* Change icon color */ cursor: pointer; } -.back-button-container p { - margin-top: 15px; - margin-left: 15px; - cursor: pointer; -} .export_div { padding-bottom: 20px; diff --git a/src/assets/env.js b/src/assets/env.js index 61b6d5c..9cbf9f5 100644 --- a/src/assets/env.js +++ b/src/assets/env.js @@ -1,4 +1,5 @@ window["env"] = { customAuth: true, - baseUrl: 'http://localhost:5000/template/api/v1/' + baseUrl: 'http://localhost:5000/', + linkUrl: "https://portal.dev.karmayogibharat.net/" }; diff --git a/src/assets/favicon.ico b/src/assets/favicon.ico new file mode 100644 index 0000000..0e935f2 Binary files /dev/null and b/src/assets/favicon.ico differ diff --git a/src/index.html b/src/index.html index f293eaa..482438e 100644 --- a/src/index.html +++ b/src/index.html @@ -6,7 +6,7 @@ TemplateValidationPortal - +