Skip to content

Commit

Permalink
Merge pull request #557 from RetroRabbit/develop
Browse files Browse the repository at this point in the history
Develop To Main
  • Loading branch information
EduanO authored Jul 12, 2024
2 parents 9cf2aa3 + d5f84a7 commit 5f3e004
Show file tree
Hide file tree
Showing 70 changed files with 1,084 additions and 736 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class AtsDashboardComponent {
this.dataSource.data = this.allCandidates;
this.dataSource._updateChangeSubscription();
},
error: error => this.snackBarService.showSnackbar("Unable to Get All Candidates", "snack-error")
error: (er) => this.snackBarService.showError(er),
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { qualifications } from 'src/app/models/ats/constants/qualifications.cons
import { EmployeeService } from 'src/app/services/hris/employee/employee.service';
import { GenericDropDownObject } from 'src/app/models/hris/generic-drop-down-object.interface';
import { Observable, debounceTime, distinctUntilChanged, map, startWith, switchMap } from 'rxjs';
import { EmployeeProfile } from 'src/app/models/hris/employee-profile.interface';
import { Employee } from 'src/app/models/hris/employee.interface';

@Component({
Expand Down Expand Up @@ -94,7 +93,7 @@ export class NewCandidateComponent {
getAllEmployees() {
this.employeeService.getAll().subscribe({
next: data => this.allEmployees = data,
error: error => this.snackBarService.showSnackbar("Unable to Get All Employees", "snack-error")
error: (er) => this.snackBarService.showError(er),
})
}

Expand Down Expand Up @@ -271,7 +270,7 @@ export class NewCandidateComponent {
this.isBlacklisted = false;
}
},
error: (err) => { }
error: (er) => this.snackBarService.showError(er),
});
}
clearUpload() {
Expand Down Expand Up @@ -448,8 +447,7 @@ export class NewCandidateComponent {
this.candidateService.addCandidate(candidateDto).subscribe({
next: (data) =>
this.snackBarService.showSnackbar("Added", "snack-success"),
error: (error) =>
this.snackBarService.showSnackbar("Unable to Add Canididate", "snack-error"),
error: (er) => this.snackBarService.showError(er),
complete: () => {
this.router.navigateByUrl(nextPage);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,15 @@ div#results-container {
z-index: 99999;
}

.growthRatePositive{
color: #006E2B ;
margin-top: 10px;
}

.growthRateNegative{
color: #B3261E ;
margin-top: 10px;
}

#dialog-save>button {
background: #0029c6;
Expand Down Expand Up @@ -501,7 +510,7 @@ div#results-container {
}

.span-churn-rate {
font-size: 18px;
font-size: 14px;
font: Roboto;
font-weight: 500;
line-height: 20px;
Expand Down
554 changes: 390 additions & 164 deletions src/app/components/hris/admin-dashboard/admin-dashboard.component.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { AuthAccessService } from 'src/app/services/shared-services/auth-access/
import { EmployeeCountDataCard } from 'src/app/models/hris/employee-count-data-card.interface';
import { ChurnRateDataCard } from 'src/app/models/hris/churn-rate-data-card.interface';
import { EmployeeBankingandstarterkitService } from 'src/app/services/hris/employee/employee-bankingandstarterkit.service';
import { DashboardService } from 'src/app/services/hris/employee/dashboard.service';
@Component({
selector: 'app-admin-dashboard',
templateUrl: './admin-dashboard.component.html',
Expand Down Expand Up @@ -59,6 +60,7 @@ export class AdminDashboardComponent {
selectedTypes: string[] = [];
employeeProfiles: EmployeeProfile[] = [];
totalNumberOfEmployees: number = 0;
growthRate: number = 0;
roles: string[] = [];
searchQuery: string = '';
searchResults: EmployeeProfile[] = [];
Expand Down Expand Up @@ -92,6 +94,7 @@ export class AdminDashboardComponent {
constructor(
private employeeBankingandstarterkitService: EmployeeBankingandstarterkitService,
private employeeService: EmployeeService,
private dashboardService: DashboardService,
public chartService: ChartService,
private cookieService: CookieService,
private router: Router,
Expand Down Expand Up @@ -177,7 +180,7 @@ export class AdminDashboardComponent {
}
});

this.employeeService.getEmployeeCountData().subscribe({
this.dashboardService.getEmployeeCountData().subscribe({
next: (data: EmployeeCountDataCard) => {
this.employeeCount = data;
},
Expand All @@ -186,14 +189,23 @@ export class AdminDashboardComponent {
}
});

this.employeeService.getChurnRate().subscribe({
this.dashboardService.getChurnRate().subscribe({
next: (data: ChurnRateDataCard) => {
this.churnRate = data;
},
complete: () => {
this.isLoading = false;
}
});

this.dashboardService.getGrowthrate().subscribe({
next: (data: number ) => {
this.growthRate = data
},
complete: () => {
this.isLoading = false;
}
})
}

getEmployeeTableColumns() {
Expand All @@ -216,9 +228,7 @@ export class AdminDashboardComponent {
this.employeeProfiles = data;
this.searchResults = [];
},
error: () => {
this.snackBarService.showSnackbar('Unable to Fetch Employees', 'snack-error');
},
error: (er) => this.snackBarService.showError(er),
complete: () => {
this.loadCounter++;
},
Expand All @@ -231,9 +241,7 @@ export class AdminDashboardComponent {
next: (data) => {
this.charts = data;
},
error: () => {
this.snackBarService.showSnackbar('Unable to Fetch Charts', 'snack-error');
},
error: (er) => this.snackBarService.showError(er),
complete: () => {
this.loadCounter++;
},
Expand Down Expand Up @@ -360,9 +368,7 @@ export class AdminDashboardComponent {
this.chartService.isEditing = false
this.dialog.closeAll();
},
error: () => {
this.snackBarService.showSnackbar("Unable to Update Chart", "snack-error");
}
error: (er) => this.snackBarService.showError(er),
});
}
return
Expand Down Expand Up @@ -405,8 +411,8 @@ export class AdminDashboardComponent {
this.configureDashboardData();
this.isLoadingChart = false;
},
error: () => {
this.snackBarService.showSnackbar('Unable to Create Chart', 'snack-error');
error: (er) => {
this.snackBarService.showError(er);
this.isLoadingChart = false;
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export class ChartReportPdfComponent {
} else {
container.removeAttribute("style");
}
}).catch(() => {
this.snackBarService.showSnackbar("Unable to Generating PDF", "snack-error");
}).catch((er) => {
this.snackBarService.showError(er);

if (originalStyle !== null) {
container.setAttribute("style", originalStyle);
Expand Down
5 changes: 0 additions & 5 deletions src/app/components/hris/charts/charts.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,7 @@
width: 2.5rem;
}

#chart-icon-menu {
transform: rotate(180deg);
}

.icon-width-mobile {
/* width: 3rem !important; */
width: 65px !important;
height: 1rem !important;
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/hris/charts/charts.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ <h4 class="mt-3">{{chart.name}}</h4>
<button mat-button [matMenuTriggerFor]="menu" id="options-trigger" class="ms-sm-4 ms-lg-auto">
<mat-icon id="menu-icon">more_vert</mat-icon>
</button>
<mat-menu #menu="matMenu">
<mat-menu #menu="matMenu" class="rounded-4 p-2">
<button mat-menu-item (click)="pdfPreview(i)">
<mat-icon id="chart-icon-menu" class="pe-3">keyboard_backspace</mat-icon> Export Graph
<mat-icon class="pe-3">download-doc</mat-icon> Export Graph
</button>
<button mat-menu-item (click)="generateReport(i)">
<mat-icon class="pe-3">arrow_forward_ios</mat-icon> View Graph Details
Expand Down
19 changes: 6 additions & 13 deletions src/app/components/hris/charts/charts.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ export class ChartComponent implements OnInit {
this.captureCharts.emit(0);
}
},
error: () => {
this.snackBarService.showSnackbar("Unable to Display Chart", "snack-error");
}
error: (er) => this.snackBarService.showError(er),
});
}
}
Expand Down Expand Up @@ -167,10 +165,7 @@ export class ChartComponent implements OnInit {
this.resetPage();
this.createAndDisplayChart();
},
error: () => {
this.snackBarService.showSnackbar("Unable to Update Chart", "snack-error");

}
error: (er) => this.snackBarService.showError(er),
});
}
}
Expand Down Expand Up @@ -198,9 +193,7 @@ export class ChartComponent implements OnInit {
this.resetPage();
this.createAndDisplayChart();
},
error: () => {
this.snackBarService.showSnackbar("Unable to Delete Chart", "snack-error");
}
error: (er) => this.snackBarService.showError(er),
});
}
}
Expand All @@ -213,9 +206,9 @@ export class ChartComponent implements OnInit {
this.employeeNames[employee.id] = `${employee.name} ${employee.surname}`;
}
});
}, error: () => {
this.snackBarService.showSnackbar("Unable to Retrieve People Champion", "snack-error");
}, complete: () => {
},
error: (er) => this.snackBarService.showError(er),
complete: () => {
this.createAndDisplayChart();
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ export class CreateChartsComponent {
this.router.navigateByUrl('/charts')
this.cookieService.set('currentPage', "Charts");
},
error: () => {
this.snackBarService.showSnackbar("Unable to Create Chart", "snack-error");
}
error: (er) => this.snackBarService.showError(er),
}
);
}
Expand All @@ -69,9 +67,7 @@ export class CreateChartsComponent {
this.chartData = data.data;
this.chartLabels = data.labels;
},
error: () => {
this.snackBarService.showSnackbar("Unable to Get Chart Data", "snack-error");
}
error: (er) => this.snackBarService.showError(er),
});
} else {
this.snackBarService.showSnackbar("Data Items Not Selected", "snack-error");
Expand All @@ -85,9 +81,7 @@ export class CreateChartsComponent {
this.chartData = data.data;
this.chartLabels = data.labels;
},
error: () => {
this.snackBarService.showSnackbar("Unable to Get Chart Data", "snack-error");
}
error: (er) => this.snackBarService.showError(er),
});
} else {
this.snackBarService.showSnackbar("Data Items Not Selected", "snack-error");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="d-sm-flex flex-sm-column flex-lg-row flex-md-row justify-content-between ms-3" [ngClass]="navService.showSideBar ? 'interact-fields-mobile' : 'interact-fields-desktop'" >
<div id="search-container" class="row mt-3">
<div class="col-10 ps-2">
<input pInputText [(ngModel)]="filterText" (input)="filterData()" type="text" placeholder="Search custom field"
<input pInputText [(ngModel)]="filterText" (input)="filterData()" type="text" placeholder="Search"
class="w-100" id="search-field">
</div>
<div id="icon" class="col-1 pt-2 ps-4 me-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export class ManageFieldCodeComponent {
this.resetRunCounter();
}
},
error: () => {
this.snackBarService.showSnackbar("Unable to Fetch Field Codes", "snack-error");
error: (er) => {
this.snackBarService.showError(er);
this.isLoading = false;
}
})
Expand Down Expand Up @@ -175,12 +175,12 @@ export class ManageFieldCodeComponent {
this.snackBarService.showSnackbar("Saved", "snack-success");
this.newFieldCodeForm.disable();
},
error: (error) => {
if (error.error === "Field with that name found") {
error: (er) => {
if (er.error === "Field with that name found") {
this.isUnique = false;
}
else {
this.snackBarService.showSnackbar("Unable to Save Field Code", "snack-error");
this.snackBarService.showError(er);
}
}
});
Expand Down Expand Up @@ -348,9 +348,8 @@ export class ManageFieldCodeComponent {
next: (data) => {
this.snackBarService.showSnackbar("Updated", "snack-success");
this.fetchData(this.activeTab);
}, error: (error) => {
this.snackBarService.showSnackbar("Unable to Update Field Code", "snack-error");
}
},
error: (er) => this.snackBarService.showError(er),
});
}

Expand All @@ -373,17 +372,15 @@ export class ManageFieldCodeComponent {
this.fetchData(this.activeTab);
this.selectedCustomFields = [];
},
error: () => {
error: (er) => {
unsuccessfulSubmits++;
this.snackBarService.showError(er);
}
})
});
if (unsuccessfulSubmits == 0) {
this.snackBarService.showSnackbar("Updated", "snack-success");
}
else {
this.snackBarService.showSnackbar(`Unable to Move ${unsuccessfulSubmits}`, "snack-error");
}
}

showDialog(status: number) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ button[disabled],
padding: 10px 24px;
justify-content: center;
align-items: center;
flex-wrap: nowrap;
gap: 8px;
background: #0029c6;
border-radius: 30px;
Expand All @@ -150,6 +151,7 @@ button[disabled],
line-height: 20px;
letter-spacing: 0.1px;
width: 137px;
box-shadow: none;
}

#toggle-advanced {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ export class SaveCustomFieldComponent {
this.systemService.selectedField = undefined;
this.router.navigateByUrl('/system-settings');
},
error: (error) => {
this.snackBarService.showSnackbar("Unable to Save Field Code", "snack-error");
}
error: (er) => {
this.snackBarService.showError(er)
},
});
}
else {
Expand Down
Loading

0 comments on commit 5f3e004

Please sign in to comment.