Skip to content

Commit b87fe01

Browse files
authored
Merge pull request ioet#101 from ioet/78-customers-administration-screen
closes ioet#78
2 parents 1abbdf4 + 996b857 commit b87fe01

File tree

56 files changed

+1131
-794
lines changed

Some content is hidden

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

56 files changed

+1131
-794
lines changed

package-lock.json

Lines changed: 449 additions & 213 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"jquery": "^3.4.1",
2828
"minimist": "^1.2.5",
2929
"msal": "^1.2.1",
30+
"ngx-pagination": "^5.0.0",
3031
"rxjs": "~6.5.4",
3132
"tslib": "^1.10.0",
3233
"zone.js": "~0.10.2"
@@ -51,7 +52,7 @@
5152
"husky": "^4.2.3",
5253
"jasmine-core": "~3.5.0",
5354
"jasmine-spec-reporter": "~4.2.1",
54-
"karma": "~4.3.0",
55+
"karma": "^5.0.1",
5556
"karma-chrome-launcher": "~3.1.0",
5657
"karma-coverage-istanbul-reporter": "~2.1.0",
5758
"karma-jasmine": "~2.0.1",

src/app/app-routing.module.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,30 @@ import { AzureGuardService } from './guards/azure-guard.service';
55
import { ReportsComponent } from './modules/reports/pages/reports.component';
66
import { TimeClockComponent } from './modules/time-clock/pages/time-clock.component';
77
import { TimeEntriesComponent } from './modules/time-entries/pages/time-entries.component';
8-
import { ProjectManagementComponent } from './modules/project-management/pages/project-management.component';
98
import { ActivitiesManagementComponent } from './modules/activities-management/pages/activities-management.component';
109
import { HomeComponent } from './modules/home/home.component';
1110
import { LoginComponent } from './modules/login/login.component';
11+
import { CustomerComponent } from './modules/customer-managment/pages/customer.component';
1212

1313
const routes: Routes = [
14-
15-
{ path: '', component: HomeComponent, canActivate: [AzureGuardService],
14+
{
15+
path: '',
16+
component: HomeComponent,
17+
canActivate: [AzureGuardService],
1618
children: [
1719
{ path: 'reports', component: ReportsComponent },
1820
{ path: 'time-clock', component: TimeClockComponent },
1921
{ path: 'time-entries', component: TimeEntriesComponent },
20-
{ path: 'project-management', component: ProjectManagementComponent },
2122
{ path: 'activities-management', component: ActivitiesManagementComponent },
22-
{path: '', pathMatch: 'full', redirectTo: 'time-clock'},
23-
]
23+
{ path: 'customers-management', component: CustomerComponent },
24+
{ path: '', pathMatch: 'full', redirectTo: 'time-clock' },
25+
],
2426
},
2527
{ path: 'login', component: LoginComponent },
2628
];
2729

2830
@NgModule({
2931
imports: [RouterModule.forRoot(routes)],
30-
exports: [RouterModule]
32+
exports: [RouterModule],
3133
})
32-
export class AppRoutingModule { }
34+
export class AppRoutingModule {}

src/app/app.module.ts

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@ import { StoreModule } from '@ngrx/store';
77
import { EffectsModule } from '@ngrx/effects';
88
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
99

10+
import { NgxPaginationModule } from 'ngx-pagination';
11+
1012
import { AppRoutingModule } from './app-routing.module';
1113
import { AppComponent } from './app.component';
1214
import { NavbarComponent } from './modules/shared/components/navbar/navbar.component';
1315
import { UserComponent } from './modules/shared/components/user/user.component';
1416
import { SidebarComponent } from './modules/shared/components/sidebar/sidebar.component';
1517
import { ClockComponent } from './modules/shared/components/clock/clock.component';
1618
import { TimeClockComponent } from './modules/time-clock/pages/time-clock.component';
17-
import { ProjectManagementComponent } from './modules/project-management/pages/project-management.component';
1819
import { TimeEntriesComponent } from './modules/time-entries/pages/time-entries.component';
19-
import { ProjectListComponent } from './modules/project-management/components/project-list/project-list.component';
20-
import { CreateProjectComponent } from './modules/project-management/components/create-project/create-project.component';
2120
import { DetailsFieldsComponent } from './modules/shared/components/details-fields/details-fields.component';
2221
import { ProjectListHoverComponent } from './modules/time-clock/components/project-list-hover/project-list-hover.component';
2322
import { ModalComponent } from './modules/shared/components/modal/modal.component';
@@ -35,6 +34,20 @@ import { ActivityEffects } from './modules/activities-management/store/activity-
3534
import { ProjectEffects } from './modules/project-management/store/project.effects';
3635
import { reducers, metaReducers } from './reducers';
3736
import { environment } from '../environments/environment';
37+
import { CustomerComponent } from './modules/customer-managment/pages/customer.component';
38+
// tslint:disable-next-line: max-line-length
39+
import { CustomerListComponent } from './modules/customer-managment/components/customer-info/components/customer-list/customer-list.component';
40+
import { SearchComponent } from './modules/customer-managment/components/search/search.component';
41+
// tslint:disable-next-line: max-line-length
42+
import { ManagementCustomerProjectsComponent } from './modules/customer-managment/components/management-customer-projects/management-customer-projects.component';
43+
import { CreateCustomerComponent } from './modules/customer-managment/components/customer-info/components/create-customer/create-customer';
44+
// tslint:disable-next-line: max-line-length
45+
import { CreateProjectComponent } from './modules/customer-managment/components/projects/components/create-project/create-project.component';
46+
import { ProjectListComponent } from './modules/customer-managment/components/projects/components/project-list/project-list.component';
47+
// tslint:disable-next-line: max-line-length
48+
import { ProjectTypeListComponent } from './modules/customer-managment/components/projects-type/components/project-type-list/project-type-list.component';
49+
// tslint:disable-next-line: max-line-length
50+
import { CreateProjectTypeComponent } from './modules/customer-managment/components/projects-type/components/create-project-type/create-project-type.component';
3851

3952
@NgModule({
4053
declarations: [
@@ -44,8 +57,6 @@ import { environment } from '../environments/environment';
4457
SidebarComponent,
4558
ClockComponent,
4659
TimeClockComponent,
47-
ProjectManagementComponent,
48-
ProjectListComponent,
4960
CreateProjectComponent,
5061
TimeClockComponent,
5162
DetailsFieldsComponent,
@@ -62,6 +73,15 @@ import { environment } from '../environments/environment';
6273
LoginComponent,
6374
FilterProjectPipe,
6475
SearchProjectComponent,
76+
CustomerComponent,
77+
CustomerListComponent,
78+
SearchComponent,
79+
ManagementCustomerProjectsComponent,
80+
CreateCustomerComponent,
81+
CreateProjectComponent,
82+
ProjectListComponent,
83+
ProjectTypeListComponent,
84+
CreateProjectTypeComponent,
6585
],
6686
imports: [
6787
CommonModule,
@@ -70,6 +90,7 @@ import { environment } from '../environments/environment';
7090
FormsModule,
7191
ReactiveFormsModule,
7292
HttpClientModule,
93+
NgxPaginationModule,
7394
StoreModule.forRoot(reducers, {
7495
metaReducers,
7596
}),
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<div class="container">
2+
<form style="width: 600px;">
3+
<div class="form-group">
4+
<input type="text" class="form-control form-control-sm" id="" aria-describedby="" placeholder="Customer name" />
5+
<textarea
6+
class="form-control form-control-sm mt-2"
7+
id="exampleFormControlTextarea1"
8+
rows="3"
9+
placeholder="Customer description"
10+
></textarea>
11+
<button type="submit" class="btn btn-sm btn-primary">Save</button>
12+
<button type="submit" class="btn btn-sm btn-secondary mb-2 ml-2 mt-2">Cancel</button>
13+
</div>
14+
</form>
15+
</div>

src/app/modules/customer-managment/components/customer-info/components/create-customer/create-customer.scss

Whitespace-only changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { CreateCustomerComponent } from './create-customer';
4+
5+
describe('InputCustomerComponent', () => {
6+
let component: CreateCustomerComponent;
7+
let fixture: ComponentFixture<CreateCustomerComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [CreateCustomerComponent],
12+
}).compileComponents();
13+
}));
14+
15+
beforeEach(() => {
16+
fixture = TestBed.createComponent(CreateCustomerComponent);
17+
component = fixture.componentInstance;
18+
fixture.detectChanges();
19+
});
20+
21+
it('component should be created', () => {
22+
expect(component).toBeTruthy();
23+
});
24+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-create-customer',
5+
templateUrl: './create-customer.html',
6+
styleUrls: ['./create-customer.scss'],
7+
})
8+
export class CreateCustomerComponent {
9+
constructor() {}
10+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<table class="table table-sm table-bordered table-striped mb-0">
2+
<thead class="thead-orange">
3+
<tr class="d-flex">
4+
<th class="col-9">Name</th>
5+
<th class="col-3 text-center"></th>
6+
</tr>
7+
</thead>
8+
<tbody>
9+
<tr
10+
class="d-flex"
11+
*ngFor="let customer of customers | paginate: { itemsPerPage: itemsPerPage, currentPage: initPage1, id: 'first' }"
12+
>
13+
<td class="col-sm-9">{{ customer.name }}</td>
14+
<td class="col-sm-3 text-center">
15+
<button type="button" class="btn btn-sm btn-secondary">
16+
<i class="fa fa-pencil fa-xs"></i>
17+
</button>
18+
<button type="button" class="btn btn-sm btn-danger ml-2">
19+
<i class="fas fa-trash-alt fa-xs"></i>
20+
</button>
21+
</td>
22+
</tr>
23+
</tbody>
24+
</table>
25+
<div class="d-flex align-items-end flex-column">
26+
<pagination-controls
27+
class="mt-auto p-2 custom-pagination"
28+
(pageChange)="initPage1 = $event"
29+
id="first"
30+
previousLabel=""
31+
nextLabel=""
32+
></pagination-controls>
33+
</div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import '../../../../../../../styles/themes/orange-theme';

0 commit comments

Comments
 (0)