Skip to content

Commit

Permalink
Merge pull request ELEVATE-Project#46 from anudeep-ks/dev
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
kiranharidas187 authored Sep 30, 2024
2 parents bdb8286 + 0c683e6 commit a7c301e
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 28 deletions.
8 changes: 4 additions & 4 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
12 changes: 9 additions & 3 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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 { }
7 changes: 4 additions & 3 deletions src/app/modules/shared/services/template.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -17,7 +18,7 @@ export class TemplateService {
constructor(private dataService: DataService) {}

getEnvironmentUrl(): string {
return this.baseUrl;
return this.linkUrl;
}

selectTemplates() {
Expand Down Expand Up @@ -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}`;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down Expand Up @@ -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");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; */
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<div class="mat-elevation-z8">

<button mat-button (click)="goBack()" class="back-button">
<mat-icon>arrow_back</mat-icon> Back
</button>

<!-- Table Header -->
<div class="table-header">
<h2>List of Solutions</h2>
Expand All @@ -21,15 +26,20 @@ <h2>List of Solutions</h2>
<td mat-cell *matCellDef="let element"> {{element.solutionName}} </td>
</ng-container>

<ng-container matColumnDef="solution_created_date">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Solution Created Date </th>
<td mat-cell *matCellDef="let element"> {{element.solution_created_date}} </td>
</ng-container>

<!-- Start Date Column -->
<ng-container matColumnDef="startDate">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Start Date </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> Survey Start Date </th>
<td mat-cell *matCellDef="let element"> {{element.startDate | date:'medium'}} </td>
</ng-container>

<!-- End Date Column -->
<ng-container matColumnDef="endDate">
<th mat-header-cell *matHeaderCellDef mat-sort-header> End Date </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> Survey End Date </th>
<td mat-cell *matCellDef="let element"> {{element.endDate | date:'medium'}} </td>
</ng-container>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ 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',
styleUrls: ['template-solution-list.component.css'],
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<any>();
resourceType: string = ""

Expand All @@ -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() {
Expand All @@ -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
}));
Expand Down Expand Up @@ -73,4 +77,7 @@ export class TemplateSolutionListComponent implements AfterViewInit, OnInit {
(err) => this.toastr.error('Failed to copy link')
);
}
goBack() {
this.location.back();
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div class="template-success-container">
<button mat-button (click)="goBack()" class="back-button">
<mat-icon>arrow_back</mat-icon> Back
</button>
<div class="header-container">
<div class="header-image-container">
<img class="shiksha-logo" src="../../../../assets/Images/shikshalokam-logo.png" alt="">
</div>
<div class="log-out" *ngIf="isUserLogin && !customAuth" (click)="onLogout()">
<button mat-raised-button>Logout</button>
</div>
</div>
<div class="success-container">
<mat-card class="template-card">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; */
}
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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 {
Expand Down Expand Up @@ -59,6 +61,11 @@ export class TemplateSuccessComponent implements OnInit {
});
}

goBack() {
this.location.back();
}


onLogout() {
this.authService.logoutAccount();
this.isUserLogin = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/assets/env.js
Original file line number Diff line number Diff line change
@@ -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/"
};
Binary file added src/assets/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>TemplateValidationPortal</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="icon" type="image/x-icon" href="assets/favicon.ico">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
Expand Down

0 comments on commit a7c301e

Please sign in to comment.