Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#3 search active projects in view projects
  • Loading branch information
daros10 committed Apr 1, 2020
commit 541eeb85daf09a16fdc1385663a28d0f7fcd04b9
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import { SearchProjectComponent } from './modules/shared/components/search-proje
CreateActivityComponent,
ActivityListComponent,
FilterProjectPipe,
SearchProjectComponent,
SearchProjectComponent
],
imports: [
CommonModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@ <h1 class="card-title">Project</h1>

<div class="form-group">
<label for="name">Name:</label>
<input class="form-control" [class.is-invalid]="(name.invalid && name.touched)" id="name" type="text" formControlName="name" required>
<p class="text-form text-danger" *ngIf="(name.dirty || name.touched) && name.invalid && name.errors.required">Name project is required.</p>
<input class="form-control" id="name" type="text" formControlName="name" required>
<p class="alert alert-danger" *ngIf="(name.dirty || name.touched) && name.invalid && name.errors.required">NameProject is required.</p>
</div>

<div class="form-group">
<label for="details">Details:</label>
<textarea class="form-control" [class.is-invalid]="(details.invalid && details.touched)" rows="3" id="details" type="text" formControlName="details" required></textarea>
<p class="text-danger" *ngIf="(details.dirty || details.touched) && details.invalid && details.errors.required">Details project is required.</p>
<textarea class="form-control" rows="3" id="details" type="text" formControlName="details" required></textarea>
<p class="alert alert-danger" *ngIf="(details.dirty || details.touched) && details.invalid && details.errors.required">Details Project is
required.</p>
</div>

<div class="form-group">
<label for="status">Status:</label>
<select class="form-control" [class.is-invalid]="(status.invalid && status.touched)" formControlName="status">
<option *ngFor="let status of projectStatus" [value]="status">{{status}}</option>
</select>
<p class="text-danger" *ngIf="(status.dirty || status.touched) && status.invalid && status.errors.required">Status project is required.</p>
<p class="alert alert-danger" *ngIf="(status.dirty || status.touched) && status.invalid && status.errors.required">Status Project is required.
</p>
</div>

<div class="form-group form-check" [hidden]="!projectToEdit">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="form-group">
<input (keyup)="changeFilterValue()" type="text" class="form-control" placeholder="&#xF002; Search projects..." name="filterProject" [(ngModel)]="filterProject" style="font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, FontAwesome">
<input (keyup)="changeFilterValue()" type="text" class="form-control" placeholder="&#xF002; Search active projects..." name="filterProject" [(ngModel)]="filterProject" style="font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, FontAwesome">
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ describe('FilterProjectPipe', () => {
const pipe = new FilterProjectPipe();
expect(pipe).toBeTruthy();
});

it('test method of pipe', () => {
expect(new FilterProjectPipe().transform([], '')).toEqual([]);
});
});
15 changes: 1 addition & 14 deletions src/app/modules/time-clock/pages/time-clock.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { DebugElement, inject } from '@angular/core';
import { By } from '@angular/platform-browser';
import { TimeClockComponent } from './time-clock.component';
import { ProjectListHoverComponent } from '../components';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ProjectService } from '../../project-management/services/project.service';
import { FilterProjectPipe } from '../../shared/pipes/filter-project/filter-project.pipe';

describe('TimeClockComponent', () => {
Expand All @@ -14,9 +12,7 @@ describe('TimeClockComponent', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule],
declarations: [TimeClockComponent, ProjectListHoverComponent, FilterProjectPipe],
providers: [ProjectService]
declarations: [TimeClockComponent, ProjectListHoverComponent, FilterProjectPipe]
}).compileComponents();
}));

Expand All @@ -27,15 +23,6 @@ describe('TimeClockComponent', () => {
fixture.detectChanges();
});

it('service should be created', () => {
const service: ProjectService = TestBed.get(ProjectService);
expect(service).toBeTruthy();
});

it('should have getProject function', () => {
const service: ProjectService = TestBed.get(ProjectService);
expect(service.getProjects).toBeTruthy();
});

it('should be created', () => {
expect(component).toBeTruthy();
Expand Down