Skip to content

Commit

Permalink
Merge pull request #7995 from ever-co/revert-7994-stage
Browse files Browse the repository at this point in the history
Revert "Release"
  • Loading branch information
EverTechDevOps authored Jul 22, 2024
2 parents 41e9b97 + 322b1ee commit 5ac7c02
Show file tree
Hide file tree
Showing 193 changed files with 2,976 additions and 4,336 deletions.
7 changes: 3 additions & 4 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,14 @@
"ui-config": {
"projectType": "library",
"root": "packages/ui-config",
"sourceRoot": "packages/ui-config/src",
"sourceRoot": "packages/ui-config",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "packages/ui-config/tsconfig.lib.json",
"project": "packages/ui-config/ng-package.json"
"project": "packages/ui-config/ng-package.json",
"tsConfig": "packages/ui-config/tsconfig.lib.json"
},
"configurations": {
"production": {
Expand All @@ -240,7 +240,6 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "packages/ui-config/src/test-setup.ts",
"tsConfig": "packages/ui-config/tsconfig.spec.json",
"polyfills": ["zone.js", "zone.js/testing"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,6 @@ export class AccountingComponent extends TranslationBaseComponent implements Aft
* @param employee - The selected employee information.
*/
async selectEmployee(employee: ISelectedEmployee) {
if (!employee.id) {
return;
}

// Fetch detailed information about the selected employee from the employeesService
const people = await firstValueFrom(this.employeesService.getEmployeeById(employee.id, ['user']));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,19 +418,16 @@ export class TimeTrackingComponent
async getTasks(): Promise<void> {
if (this._isWindowHidden(Windows.TASKS)) return;

// Set loading state to true
this.tasksLoading = true;

try {
this.tasksLoading = true;

const request: IGetTasksStatistics = this.payloads$.getValue();
const take = 5;

// Fetch tasks statistics
this.tasks = await this._timesheetStatisticsService.getTasksStatistics({ ...request, take });
this.tasks = await this._timesheetStatisticsService.getTasks({ ...request, take });
} catch (error) {
this._toastrService.error(error.message || 'An error occurred while fetching tasks.');
} finally {
// Set loading state to false
this.tasksLoading = false;
}
}
Expand Down Expand Up @@ -617,10 +614,7 @@ export class TimeTrackingComponent
return;
}
try {
const people: IEmployee = await firstValueFrom(
this._employeesService.getEmployeeById(employee.id, ['user'])
);

const people = await firstValueFrom(this._employeesService.getEmployeeById(employee.id, ['user']));
this._store.selectedEmployee = employee.id
? ({
id: people.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ export class EditEmployeeProfileComponent extends TranslationBaseComponent imple
private async _getEmployeeProfile() {
try {
const { id } = this.routeParams;
if (!id) {
return;
}

// Fetch employee data from the service
const employee = await firstValueFrom(
Expand All @@ -243,11 +240,12 @@ export class EditEmployeeProfileComponent extends TranslationBaseComponent imple
this.employeeStore.selectedEmployee = this.selectedEmployee = employee;

// Set the employee name for display
this.employeeName = employee?.user?.name || employee?.user?.username || 'Unknown Employee';
this.employeeName = employee?.user?.name || employee?.user?.username || 'Employee';
} catch (error) {
// Handle errors gracefully
console.error('Error fetching employee profile:', error);
// Optionally, navigate to a fallback route or show an error message
// this.router.navigate(['/error']);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ export class EditEmployeeResolver implements Resolve<Observable<IEmployee>> {
const employeeId = route.params.id; // Extract employee ID from route parameters
const relations = ['user', 'user.image', 'organizationPosition']; // Define relations to include in the query

if (!employeeId) {
of(null);
}

// Call the employeeService to fetch employee data by ID with specified relations
return this.employeeService.getEmployeeById(employeeId, relations).pipe(
catchError((error) => {
Expand Down
34 changes: 10 additions & 24 deletions apps/gauzy/src/app/pages/employees/employees.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,18 @@ <h4>
</div>
</nb-card-header>
<nb-card-body>
<ng-template [ngxPermissionsOnly]="['ORG_EMPLOYEES_VIEW']">
<ng-template
[ngTemplateOutlet]="dataLayoutStyle === componentLayoutStyleEnum.TABLE ? tableLayout : gridLayout"
></ng-template>
</ng-template>
<ng-template [ngxPermissionsExcept]="['ORG_EMPLOYEES_VIEW']">
<div>
<!-- Content to display if the user does not have 'canEditComponent' permission -->
</div>
</ng-template>
<ng-template
[ngTemplateOutlet]="dataLayoutStyle === componentLayoutStyleEnum.TABLE ? tableLayout : gridLayout"
></ng-template>
</nb-card-body>
</nb-card>

<ng-template #actionButtons let-selectedItem>
<div class="btn-group actions">
<ng-template [ngxPermissionsOnly]="['ORG_EMPLOYEES_EDIT', 'ORG_EMPLOYEES_VIEW']">
<ng-template ngxPermissionsOnly="ORG_EMPLOYEES_VIEW">
<button status="basic" class="action secondary" size="small" nbButton underConstruction>
<nb-icon icon="eye-outline" pack="eva"></nb-icon>
<span> {{ 'BUTTONS.VIEW' | translate }} </span>
</button>
</ng-template>
<ng-template ngxPermissionsOnly="ORG_EMPLOYEES_EDIT">
<button status="basic" class="action secondary" size="small" nbButton underConstruction>
<nb-icon icon="eye-outline" pack="eva"></nb-icon>
<span> {{ 'BUTTONS.VIEW' | translate }} </span>
</button>
<ng-container *ngIf="selectedItem && selectedItem?.isDeleted">
<button
nbButton
Expand Down Expand Up @@ -120,6 +110,7 @@ <h4>
}}
</button>
</ng-container>

<button
nbButton
[disabled]="disableButton"
Expand All @@ -128,8 +119,7 @@ <h4>
status="basic"
class="action primary"
>
<nb-icon class="mr-1" icon="edit-outline"></nb-icon>
{{ 'BUTTONS.EDIT' | translate }}
<nb-icon class="mr-1" icon="edit-outline"></nb-icon>{{ 'BUTTONS.EDIT' | translate }}
</button>
<ng-container *ngIf="selectedItem && !selectedItem?.isDeleted">
<button
Expand All @@ -146,7 +136,6 @@ <h4>
</ng-template>
</div>
</ng-template>

<ng-template #visibleButtons>
<ng-template ngxPermissionsOnly="ORG_EMPLOYEES_EDIT">
<ng-template ngxPermissionsOnly="ORG_INVITE_EDIT">
Expand All @@ -162,7 +151,6 @@ <h4>
</button>
</ng-template>
</ng-template>

<ng-template #tableLayout>
<div class="table-scroll-container">
<angular2-smart-table
Expand All @@ -178,7 +166,6 @@ <h4>
</ng-container>
</div>
</ng-template>

<ng-template #gridLayout>
<div class="grid">
<ga-card-grid
Expand All @@ -191,7 +178,6 @@ <h4>
></ga-card-grid>
</div>
</ng-template>

<ng-template #startWork>
<button (click)="startEmployeeWork()" class="action text-info" nbButton size="small" status="basic">
<nb-icon icon="person-done-outline"></nb-icon>
Expand Down
Loading

0 comments on commit 5ac7c02

Please sign in to comment.