-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature/show_Last_Service_Binding (#2)
* Add 'Last Service Binding' column to grid view and list view * Rename the components to remove redundant 'Service' in the naming * replace ServiceInstanceLastOpComponent in the last service binding tests
- Loading branch information
1 parent
4a66269
commit b9d00c3
Showing
14 changed files
with
351 additions
and
109 deletions.
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 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 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 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
3 changes: 3 additions & 0 deletions
3
...-instances/table-cell-last-service-binding/table-cell-last-service-binding.component.html
This file contains 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,3 @@ | ||
<app-service-instance-last-service-binding *ngIf="isUserProvidedServiceInstance === false; else upsi" [serviceInstance]="row" | ||
[alignRight]="false"></app-service-instance-last-service-binding > | ||
<ng-template #upsi>-</ng-template> |
Empty file.
58 changes: 58 additions & 0 deletions
58
...stances/table-cell-last-service-binding/table-cell-last-service-binding.component.spec.ts
This file contains 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,58 @@ | ||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; | ||
|
||
import { | ||
BooleanIndicatorComponent, | ||
} from '../../../../../../../../core/src/shared/components/boolean-indicator/boolean-indicator.component'; | ||
import { BaseTestModulesNoShared } from '../../../../../../../../core/test-framework/core-test.helper'; | ||
import { EntityMonitorFactory } from '../../../../../../../../store/src/monitors/entity-monitor.factory.service'; | ||
import { ServiceInstanceLastServiceBindingComponent } from '../../../../service-instance-last-service-binding/service-instance-last-service-binding.component'; | ||
import { TableCellLastServiceBindingComponent } from './table-cell-last-service-binding.component'; | ||
|
||
describe('TableCellLastServiceBindingComponent', () => { | ||
let component: TableCellLastServiceBindingComponent | ||
let fixture: ComponentFixture<TableCellLastServiceBindingComponent>; | ||
|
||
beforeEach(waitForAsync(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ | ||
TableCellLastServiceBindingComponent, | ||
ServiceInstanceLastServiceBindingComponent, | ||
BooleanIndicatorComponent | ||
], | ||
imports: [...BaseTestModulesNoShared], | ||
providers: [EntityMonitorFactory] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(TableCellLastServiceBindingComponent); | ||
component = fixture.componentInstance; | ||
component.row = { | ||
entity: { | ||
service_plan_guid: '', | ||
space_guid: '', | ||
dashboard_url: '', | ||
type: '', | ||
service_guid: '', | ||
service_plan_url: '', | ||
service_bindings_url: '', | ||
service_keys_url: '', | ||
routes_url: '', | ||
service_url: '', | ||
}, | ||
metadata: { | ||
created_at: '', | ||
guid: '', | ||
updated_at: '', | ||
url: '' | ||
} | ||
}; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); | ||
|
21 changes: 21 additions & 0 deletions
21
...ce-instances/table-cell-last-service-binding/table-cell-last-service-binding.component.ts
This file contains 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,21 @@ | ||
import { Component, Input, OnInit } from '@angular/core'; | ||
|
||
import { TableCellCustom } from '../../../../../../../../core/src/shared/components/list/list.types'; | ||
import { APIResource } from '../../../../../../../../store/src/types/api.types'; | ||
import { IServiceInstance } from '../../../../../../cf-api-svc.types'; | ||
import { userProvidedServiceInstanceEntityType } from '../../../../../../cf-entity-types'; | ||
|
||
@Component({ | ||
selector: 'app-table-cell-last-service-binding', | ||
templateUrl: './table-cell-last-service-binding.component.html', | ||
styleUrls: ['./table-cell-last-service-binding.component.scss'] | ||
}) | ||
export class TableCellLastServiceBindingComponent extends TableCellCustom<APIResource<IServiceInstance>> implements OnInit { | ||
// tslint:disable-next-line:ban-types | ||
isUserProvidedServiceInstance: Boolean; | ||
|
||
|
||
ngOnInit() { | ||
this.isUserProvidedServiceInstance = this.entityKey === userProvidedServiceInstanceEntityType; | ||
} | ||
} |
This file contains 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
20 changes: 20 additions & 0 deletions
20
...ervice-instance-last-service-binding/service-instance-last-service-binding.component.html
This file contains 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,20 @@ | ||
<div class="last-service-op" [ngClass]="{ 'align-right': alignRight}" *ngIf="serviceInstance.entity.service_bindings?.length > 0; else noServiceBinding"> | ||
<div *ngIf="serviceInstance.entity.service_bindings as sb"> | ||
<div *ngIf="sb[sb.length -1].entity.last_operation as sb_lo"> | ||
<div class="last-service-op--row1"> | ||
{{sb_lo.type | titlecase }} | ||
<app-boolean-indicator *ngIf="sb_lo.state==='in progress'; else normalIndicator" class="last-service-op--item" [isTrue]="true" | ||
type="progress-progress" [subtle]="false" [showText]="false"></app-boolean-indicator> | ||
<ng-template #normalIndicator> | ||
<app-boolean-indicator class="last-service-op--item" [isTrue]="sb_lo.state==='succeeded'" type="yes-no" [subtle]="false" | ||
[showText]="false"> | ||
</app-boolean-indicator> | ||
</ng-template> | ||
</div> | ||
<div class="last-service-op--row2">{{ sb_lo.created_at | date:'medium' }}</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<ng-template #noServiceBinding>-</ng-template> | ||
|
Oops, something went wrong.