Skip to content

Commit

Permalink
integration of codeRabitai suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul-rocket committed Oct 25, 2024
1 parent 8ac0818 commit c94d342
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, OnInit, OnDestroy, ChangeDetectorRef, ViewChild } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, NgForm } from '@angular/forms';
import { filter, tap } from 'rxjs/operators';
import { FormBuilder, FormGroup, NgForm } from '@angular/forms';
import { filter, tap } from 'rxjs';
import { NbAccordionComponent, NbAccordionItemComponent } from '@nebular/theme';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import * as moment from 'moment';
Expand Down Expand Up @@ -37,12 +37,13 @@ export class EditEmployeeOtherSettingsComponent implements OnInit, OnDestroy {
/**
* Employee other settings settings
*/
public form: UntypedFormGroup = EditEmployeeOtherSettingsComponent.buildForm(this.fb);
static buildForm(fb: UntypedFormBuilder): UntypedFormGroup {
public form: FormGroup = EditEmployeeOtherSettingsComponent.buildForm(this.fb);
static buildForm(fb: FormBuilder): FormGroup {
return fb.group({
timeZone: [],
timeFormat: [],
upworkId: [],
linkedInId: [],
allowManualTime: [false],
allowModifyTime: [false],
allowDeleteTime: [false],
Expand All @@ -52,7 +53,7 @@ export class EditEmployeeOtherSettingsComponent implements OnInit, OnDestroy {

constructor(
private readonly cdr: ChangeDetectorRef,
private readonly fb: UntypedFormBuilder,
private readonly fb: FormBuilder,
private readonly employeeStore: EmployeeStore
) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,23 @@ import { Store } from '@gauzy/ui-core/core';
selector: '[ngxTimeTrackingAuthorized]'
})
export class TimeTrackingAuthorizedDirective implements OnInit {
/*
* Getter & Setter for dynamic permission
private _permission: string | string[] = []; // Default initialization
/**
* Setter for dynamic permission.
* @param permission - The permission(s) to be set.
*/
_permission: string | string[];
get permission(): string | string[] {
return this._permission;
}
@Input() set permission(permission: string | string[]) {
if (!permission) {
throw false;
throw new Error('Permission must be provided');
}
this._permission = permission;
}
/**
* Getter for dynamic permission.
*/
get permission(): string | string[] {
return this._permission;
}

@Input() permissionElse: TemplateRef<any>;

Expand Down

0 comments on commit c94d342

Please sign in to comment.