-
Notifications
You must be signed in to change notification settings - Fork 1
78 customer administration screens #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
fdbff24
customer administration screens
daros10 7d5d5e1
#78 added unit test
daros10 49cfc77
Merge branch 'master' into 78-customers-administration-screen
enriquezrene 254aa11
#78 fix lint suggestions
enriquezrene f8184b4
customer administration screens
daros10 15617dd
#78 added unit test
daros10 5a01b00
#78 fix lint suggestions
enriquezrene d178cf4
#78 get last changes of master
daros10 c41a001
#78 improve structure
daros10 6d6a4bb
Merge branch 'master' into 78-customers-administration-screen
enriquezrene 586535f
#78 improve typo and remove duplicated components
daros10 a7f3b53
Merge branch '78-customers-administration-screen' of https://github.c…
daros10 17026d3
#78 PR comments
enriquezrene c872c6e
#78 PR comments
enriquezrene 9df55d0
Merge branch 'master' into 78-customers-administration-screen
enriquezrene 825d379
#78 PR comments
enriquezrene 0fed631
fix: #78 PR comments
enriquezrene 996b857
fix: #78 customers management screen and solving dependency vulnerabi…
enriquezrene File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
customer administration screens
- Loading branch information
commit fdbff240db95b95b3d98c0676f8373cb317c3d70
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/app/modules/customer/components/customer-table-list/customer-table-list.component.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <table class="table table-sm table-bordered table-striped mb-0"> | ||
| <thead class="bg-header"> | ||
| <tr class="d-flex"> | ||
| <th class="col-9">Name</th> | ||
| <th class="col-3 text-center"></th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| <tr | ||
| class="d-flex" | ||
| *ngFor="let customer of customers | paginate: { itemsPerPage: 3, currentPage: initPage1, id: 'first' }" | ||
| > | ||
| <td class="col-sm-9">{{ customer.name }}</td> | ||
| <td class="col-sm-3 text-center"> | ||
| <button (click)="activateCustomerForm()" type="button" class="btn btn-sm btn-edit"> | ||
| <i class="fa fa-pencil fa-xs"></i> | ||
| </button> | ||
| <button type="button" class="btn btn-sm btn-delete ml-2"><i class="fas fa-trash-alt fa-xs"></i></button> | ||
| </td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
| <div class="d-flex align-items-end flex-column"> | ||
| <pagination-controls | ||
| class="mt-auto p-2 custom-pagination" | ||
| (pageChange)="initPage1 = $event" | ||
| id="first" | ||
| previousLabel="" | ||
| nextLabel="" | ||
| ></pagination-controls> | ||
| </div> |
26 changes: 26 additions & 0 deletions
26
src/app/modules/customer/components/customer-table-list/customer-table-list.component.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| @import '../../../../../styles/colors.scss'; | ||
|
|
||
| .bg-header { | ||
| background-image: $title-card-header-background; | ||
| color: white; | ||
| } | ||
|
|
||
| .btn-edit { | ||
| background-color: $modal-button-secondary; | ||
| color: white; | ||
| } | ||
|
|
||
| .btn-delete { | ||
| background-color: $danger-color; | ||
| color: white; | ||
| } | ||
|
|
||
| .scroll { | ||
| max-height: 165px; | ||
| overflow-y: auto; | ||
| } | ||
|
|
||
| .custom-pagination ::ng-deep .ngx-pagination .current { | ||
| background-image: $title-card-header-background; | ||
| border-radius: 8px; | ||
| } |
33 changes: 33 additions & 0 deletions
33
...app/modules/customer/components/customer-table-list/customer-table-list.component.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
|
||
| import { CustomerTableListComponent } from './customer-table-list.component'; | ||
| import { NgxPaginationModule } from 'ngx-pagination'; | ||
|
|
||
| describe('CustomerTableListComponent', () => { | ||
| let component: CustomerTableListComponent; | ||
| let fixture: ComponentFixture<CustomerTableListComponent>; | ||
|
|
||
| beforeEach(async(() => { | ||
| TestBed.configureTestingModule({ | ||
| imports: [NgxPaginationModule], | ||
| declarations: [CustomerTableListComponent], | ||
| }).compileComponents(); | ||
| })); | ||
|
|
||
| beforeEach(() => { | ||
| fixture = TestBed.createComponent(CustomerTableListComponent); | ||
| component = fixture.componentInstance; | ||
| fixture.detectChanges(); | ||
| }); | ||
|
|
||
| it('should create', () => { | ||
| expect(component).toBeTruthy(); | ||
| }); | ||
|
|
||
| it('changeShowCustomerForm should listen form changes', () => { | ||
| component.showCustomerForm = true; | ||
| spyOn(component.changeShowCustomerForm, 'emit'); | ||
| component.activateCustomerForm(); | ||
| expect(component.changeShowCustomerForm.emit).toHaveBeenCalled(); | ||
| }); | ||
| }); |
41 changes: 41 additions & 0 deletions
41
src/app/modules/customer/components/customer-table-list/customer-table-list.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-customer-table-list', | ||
| templateUrl: './customer-table-list.component.html', | ||
| styleUrls: ['./customer-table-list.component.scss'], | ||
| }) | ||
| export class CustomerTableListComponent implements OnInit { | ||
| initPage1: number = 1; | ||
|
|
||
| customers = [ | ||
| { | ||
| id: '1', | ||
| name: 'GoSpace', | ||
| }, | ||
| { | ||
| id: '2', | ||
| name: 'GruHub', | ||
| }, | ||
| { | ||
| id: '3', | ||
| name: 'e&y', | ||
| }, | ||
| { | ||
| id: '4', | ||
| name: 'Mido', | ||
| }, | ||
| ]; | ||
|
|
||
| @Input() showCustomerForm; | ||
| @Output() changeShowCustomerForm = new EventEmitter<boolean>(); | ||
|
|
||
| constructor() {} | ||
|
|
||
| ngOnInit(): void {} | ||
|
|
||
| activateCustomerForm() { | ||
| this.showCustomerForm = true; | ||
| this.changeShowCustomerForm.emit(this.showCustomerForm); | ||
| } | ||
| } |
15 changes: 15 additions & 0 deletions
15
src/app/modules/customer/components/input-customer/input-customer.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <div class="container"> | ||
| <form style="width: 600px;"> | ||
| <div class="form-group"> | ||
| <input type="text" class="form-control form-control-sm" id="" aria-describedby="" placeholder="Customer name" /> | ||
| <textarea | ||
| class="form-control form-control-sm mt-2" | ||
| id="exampleFormControlTextarea1" | ||
| rows="3" | ||
| placeholder="Customer description" | ||
| ></textarea> | ||
| <button type="submit" class="btn btn-sm btn-save mb-2 mt-2">Save</button> | ||
| <button type="submit" class="btn btn-sm btn-cancel mb-2 ml-2 mt-2">Cancel</button> | ||
| </div> | ||
| </form> | ||
| </div> |
11 changes: 11 additions & 0 deletions
11
src/app/modules/customer/components/input-customer/input-customer.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| @import '../../../../../styles/colors.scss'; | ||
|
|
||
| .btn-cancel { | ||
| background-color: $modal-button-secondary; | ||
| color: white; | ||
| } | ||
|
|
||
| .btn-save { | ||
| background-color: $danger-color; | ||
| color: white; | ||
| } |
24 changes: 24 additions & 0 deletions
24
src/app/modules/customer/components/input-customer/input-customer.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
|
||
| import { InputCustomerComponent } from './input-customer'; | ||
|
|
||
| describe('InputCustomerComponent', () => { | ||
| let component: InputCustomerComponent; | ||
| let fixture: ComponentFixture<InputCustomerComponent>; | ||
|
|
||
| beforeEach(async(() => { | ||
| TestBed.configureTestingModule({ | ||
| declarations: [InputCustomerComponent], | ||
| }).compileComponents(); | ||
| })); | ||
|
|
||
| beforeEach(() => { | ||
| fixture = TestBed.createComponent(InputCustomerComponent); | ||
| component = fixture.componentInstance; | ||
| fixture.detectChanges(); | ||
| }); | ||
|
|
||
| it('should create', () => { | ||
| expect(component).toBeTruthy(); | ||
| }); | ||
| }); |
12 changes: 12 additions & 0 deletions
12
src/app/modules/customer/components/input-customer/input-customer.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { Component, OnInit } from '@angular/core'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-input-customer', | ||
| templateUrl: './input-customer.html', | ||
| styleUrls: ['./input-customer.scss'], | ||
| }) | ||
| export class InputCustomerComponent implements OnInit { | ||
| constructor() {} | ||
|
|
||
| ngOnInit(): void {} | ||
| } |
17 changes: 17 additions & 0 deletions
17
src/app/modules/customer/components/input-project-type/input-project-type.component.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <div class="container"> | ||
| <form style="width: 600px;"> | ||
| <div class="form-group"> | ||
| <input type="text" class="form-control form-control-sm" id="" aria-describedby="" placeholder="Name" /> | ||
| <textarea | ||
| class="form-control form-control-sm mt-2" | ||
| id="exampleFormControlTextarea1" | ||
| rows="3" | ||
| placeholder="Description" | ||
| ></textarea> | ||
| <button type="submit" class="btn btn-sm btn-save mb-2 mt-2">Save</button> | ||
| <button type="submit" class="btn btn-sm btn-cancel mb-2 ml-2 mt-2">Cancel</button> | ||
| </div> | ||
| </form> | ||
| <hr /> | ||
| <app-project-type-table-list></app-project-type-table-list> | ||
| </div> |
11 changes: 11 additions & 0 deletions
11
src/app/modules/customer/components/input-project-type/input-project-type.component.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| @import '../../../../../styles/colors.scss'; | ||
|
|
||
| .btn-cancel { | ||
| background-color: $modal-button-secondary; | ||
| color: white; | ||
| } | ||
|
|
||
| .btn-save { | ||
| background-color: $danger-color; | ||
| color: white; | ||
| } |
25 changes: 25 additions & 0 deletions
25
src/app/modules/customer/components/input-project-type/input-project-type.component.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
|
||
| import { InputProjectTypeComponent } from './input-project-type.component'; | ||
|
|
||
| describe('InputProjectTypeComponent', () => { | ||
| let component: InputProjectTypeComponent; | ||
| let fixture: ComponentFixture<InputProjectTypeComponent>; | ||
|
|
||
| beforeEach(async(() => { | ||
| TestBed.configureTestingModule({ | ||
| declarations: [ InputProjectTypeComponent ] | ||
| }) | ||
| .compileComponents(); | ||
| })); | ||
|
|
||
| beforeEach(() => { | ||
| fixture = TestBed.createComponent(InputProjectTypeComponent); | ||
| component = fixture.componentInstance; | ||
| fixture.detectChanges(); | ||
| }); | ||
|
|
||
| it('should create', () => { | ||
| expect(component).toBeTruthy(); | ||
| }); | ||
| }); |
12 changes: 12 additions & 0 deletions
12
src/app/modules/customer/components/input-project-type/input-project-type.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { Component, OnInit } from '@angular/core'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-input-project-type', | ||
| templateUrl: './input-project-type.component.html', | ||
| styleUrls: ['./input-project-type.component.scss'], | ||
| }) | ||
| export class InputProjectTypeComponent implements OnInit { | ||
| constructor() {} | ||
|
|
||
| ngOnInit(): void {} | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path: 'customers-management'