Skip to content

Commit e15d20c

Browse files
committed
Merge branch 'master' of https://github.com/ioet/time-tracker-ui into Time-Clock-Timer-Component
2 parents 22b7119 + 3c0dc65 commit e15d20c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+743
-374
lines changed

.github/workflows/CI-time-tracker-ui.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
name: CI process for time-tracker app
22

33
on:
4-
# Trigger the workflow on push or pull request
5-
push:
6-
branches:
7-
- '*'
8-
- '*/*'
9-
- '!master'
10-
114
pull_request:
125
types: [opened, edited, reopened, synchronize]
136
branches:

src/app/app-routing.module.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
import { NgModule } from '@angular/core';
22
import { Routes, RouterModule } from '@angular/router';
3-
import { GettingStartedComponent } from './components/options-sidebar/getting-started/getting-started.component';
43
import { ReportsComponent } from './components/options-sidebar/reports/reports.component';
54
import { TimeClockComponent } from './components/options-sidebar/time-clock/time-clock.component';
65
import { TimeEntriesComponent } from './components/options-sidebar/time-entries/time-entries.component';
7-
import { TimeOffComponent } from './components/options-sidebar/time-off/time-off.component';
86
import { ProjectManagementComponent } from './components/options-sidebar/project-management/project-management.component';
97

108
const routes: Routes = [
11-
{path: 'getting-started', component: GettingStartedComponent},
129
{path: 'reports', component: ReportsComponent},
1310
{path: 'time-clock', component: TimeClockComponent},
1411
{path: 'time-entries', component: TimeEntriesComponent},
15-
{path: 'time-off', component: TimeOffComponent},
1612
{path: 'project-management', component: ProjectManagementComponent},
17-
{path: '', pathMatch: 'full', redirectTo: 'getting-started'},
18-
{path: '**', pathMatch: 'full', redirectTo: 'getting-started'},
13+
{path: '', pathMatch: 'full', redirectTo: 'time-clock'},
14+
{path: '**', pathMatch: 'full', redirectTo: 'time-clock'},
1915
];
2016

2117
@NgModule({

src/app/app.module.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,24 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
55
import { HttpClientModule } from '@angular/common/http';
66

77
import { AppRoutingModule } from './app-routing.module';
8-
98
import { AppComponent } from './app.component';
109
import { NavbarComponent } from './components/shared/navbar/navbar.component';
1110
import { UserComponent } from './components/shared/user/user.component';
1211
import { SidebarComponent } from './components/shared/sidebar/sidebar.component';
1312
import { ClockComponent } from './components/shared/clock/clock.component';
1413
import { TimeClockComponent } from './components/options-sidebar/time-clock/time-clock.component';
1514
import { ProjectManagementComponent } from './components/options-sidebar/project-management/project-management.component';
15+
import { TimeEntriesComponent } from './components/options-sidebar/time-entries/time-entries.component';
1616
import { ProjectListComponent } from './components/shared/project-list/project-list.component';
1717
import { CreateProjectComponent } from './components/shared/create-project/create-project.component';
1818
import { DetailsFieldsComponent } from './components/shared/details-fields/details-fields.component';
1919
import { ProjectListHoverComponent } from './components/shared/project-list-hover/project-list-hover.component';
2020
import { ModalComponent } from './components/shared/modal/modal.component';
21+
import { MonthPickerComponent } from './components/shared/month-picker/month-picker.component';
22+
import { EmptyStateComponent } from './components/shared/empty-state/empty-state.component';
23+
import { GroupByDatePipe } from './components/shared/pipes/group-by-date/group-by-date.pipe';
24+
25+
2126
@NgModule({
2227
declarations: [
2328
AppComponent,
@@ -32,7 +37,11 @@ import { ModalComponent } from './components/shared/modal/modal.component';
3237
TimeClockComponent,
3338
DetailsFieldsComponent,
3439
ProjectListHoverComponent,
35-
ModalComponent
40+
ModalComponent,
41+
TimeEntriesComponent,
42+
MonthPickerComponent,
43+
EmptyStateComponent,
44+
GroupByDatePipe
3645
],
3746
imports: [
3847
CommonModule,
@@ -46,4 +55,3 @@ import { ModalComponent } from './components/shared/modal/modal.component';
4655
bootstrap: [AppComponent]
4756
})
4857
export class AppModule { }
49-

src/app/components/options-sidebar/getting-started/getting-started.component.css

Whitespace-only changes.

src/app/components/options-sidebar/getting-started/getting-started.component.html

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/app/components/options-sidebar/getting-started/getting-started.component.spec.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/app/components/options-sidebar/getting-started/getting-started.component.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/app/components/options-sidebar/project-management/project-management.component.spec.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
import { async, ComponentFixture, TestBed, inject } from '@angular/core/testing';
2+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
3+
24
import { ProjectManagementComponent } from './project-management.component';
3-
import { Project } from '../../../interfaces/project';
5+
import { Project } from '../../../interfaces';
46
import { ProjectService } from '../../../services/project.service';
57
import { of } from 'rxjs';
68
import { CreateProjectComponent } from '../../../components/shared/create-project/create-project.component';
79
import { ProjectListComponent } from '../../../components/shared/project-list/project-list.component';
8-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
910

1011
describe('ProjectManagementComponent', () => {
1112
let component: ProjectManagementComponent;
1213
let fixture: ComponentFixture<ProjectManagementComponent>;
1314
let projectService: ProjectService;
1415

1516
const projects: Project[] = [{
16-
id: 1,
17+
id: '1',
1718
name: 'app 1',
1819
details: 'It is a good app',
1920
status: 'inactive',
2021
completed: true
2122
},
2223
{
23-
id: 2,
24+
id: '2',
2425
name: 'app 2',
2526
details: 'It is a good app',
2627
status: 'inactive',
2728
completed: false
2829
},
2930
{
30-
id: 3,
31+
id: '3',
3132
name: 'app 3',
3233
details: 'It is a good app',
3334
status: 'active',
@@ -89,14 +90,14 @@ describe('ProjectManagementComponent', () => {
8990

9091
it('should edit a project #updateProject', () => {
9192
const project = {
92-
id: 1,
93+
id: '1',
9394
name: 'app test',
9495
details: 'It is a excelent app',
9596
status: 'inactive',
9697
completed: true
9798
};
9899

99-
component.editedProjectId = 1;
100+
component.editedProjectId = '1';
100101
component.updateProject(project);
101102
expect(component.projects.length).toEqual(3);
102103
expect(component.projects[0].name).toBe('app test');
@@ -106,14 +107,14 @@ describe('ProjectManagementComponent', () => {
106107
});
107108

108109
it('should filter the project to edit #editProject', () => {
109-
const editProjectId = 2;
110+
const editProjectId = '2';
110111
component.editProject(editProjectId);
111112
expect(component.project.name).toBe('app 2');
112113
});
113114

114115
it('should clean the project #cancelForm', () => {
115116
const project = {
116-
id: 1,
117+
id: '1',
117118
name: 'app 1',
118119
details: 'It is a good app',
119120
status: 'inactive',
@@ -149,7 +150,7 @@ describe('ProjectManagementComponent', () => {
149150
}));
150151

151152
it('should delete a project #deleteProject', () => {
152-
const projectId = 1;
153+
const projectId = '1';
153154

154155
component.deleteProject(projectId);
155156
expect(component.projects.length).toEqual(2);

src/app/components/options-sidebar/project-management/project-management.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, OnInit } from '@angular/core';
2-
import { Project } from '../../../interfaces/project';
2+
import { Project } from '../../../interfaces';
33
import { ProjectService } from '../../../services/project.service';
44

55
@Component({
@@ -30,7 +30,7 @@ export class ProjectManagementComponent implements OnInit {
3030
this.projects[projectIndex].status = projectData.status;
3131
this.projects[projectIndex].completed = projectData.completed;
3232
} else {
33-
const newProject: Project = { id: this.projects.length + 1, name: projectData.name,
33+
const newProject: Project = { id: (this.projects.length + 1).toString(), name: projectData.name,
3434
details: projectData.details, status: projectData.status, completed: false
3535
};
3636
this.projects = this.projects.concat(newProject);

0 commit comments

Comments
 (0)