-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3422 from cloudfoundry-incubator/endpoint-list-cards
Add card view to endpoint list
- Loading branch information
Showing
67 changed files
with
1,005 additions
and
585 deletions.
There are no files selected for viewing
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
28 changes: 28 additions & 0 deletions
28
src/frontend/packages/cloud-foundry/src/cloud-foundry.module.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,28 @@ | ||
import { NgModule } from '@angular/core'; | ||
|
||
import { StratosExtension } from '../../core/src/core/extension/extension-service'; | ||
import { EndpointTypeConfig } from '../../core/src/core/extension/extension-types'; | ||
import { urlValidationExpression } from '../../core/src/core/utils.service'; | ||
import { CfEndpointDetailsComponent } from './shared/components/cf-endpoint-details/cf-endpoint-details.component'; | ||
import { CloudFoundryComponentsModule } from './shared/components/components.module'; | ||
|
||
const cloudFoundryEndpointTypes: EndpointTypeConfig[] = [{ | ||
value: 'cf', | ||
label: 'Cloud Foundry', | ||
urlValidation: urlValidationExpression, | ||
icon: 'cloud_foundry', | ||
iconFont: 'stratos-icons', | ||
imagePath: '/core/assets/endpoint-icons/cloudfoundry.png', | ||
homeLink: (guid) => ['/cloud-foundry', guid], | ||
listDetailsComponent: CfEndpointDetailsComponent | ||
}]; | ||
|
||
@StratosExtension({ | ||
endpointTypes: cloudFoundryEndpointTypes, | ||
}) | ||
@NgModule({ | ||
imports: [ | ||
CloudFoundryComponentsModule | ||
], | ||
}) | ||
export class CloudFoundryModule { } |
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
9 changes: 9 additions & 0 deletions
9
...loud-foundry/src/shared/components/cf-endpoint-details/cf-endpoint-details.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,9 @@ | ||
<div class="cf-details" *ngIf="row?.user as user else noUser"> | ||
<div class="cf-details__line"> | ||
<span class="cf-details__icon"> | ||
<mat-icon matTooltip="Username">person</mat-icon> | ||
</span> | ||
{{ user.name}} <ng-container *ngIf="user.admin">(Administrator)</ng-container> | ||
</div> | ||
</div> | ||
<ng-template #noUser>-</ng-template> |
16 changes: 16 additions & 0 deletions
16
...loud-foundry/src/shared/components/cf-endpoint-details/cf-endpoint-details.component.scss
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,16 @@ | ||
.cf-details { | ||
display: flex; | ||
flex-direction: column; | ||
|
||
&__line { | ||
align-items: center; | ||
display: flex; | ||
} | ||
|
||
&__icon { | ||
align-items: center; | ||
display: flex; | ||
justify-content: center; | ||
width: 32px; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...d-foundry/src/shared/components/cf-endpoint-details/cf-endpoint-details.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,31 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { CoreModule } from '../../../../../core/src/core/core.module'; | ||
import { SharedModule } from '../../../../../core/src/shared/shared.module'; | ||
import { CfEndpointDetailsComponent } from './cf-endpoint-details.component'; | ||
|
||
describe('CfEndpointDetailsComponent', () => { | ||
let component: CfEndpointDetailsComponent; | ||
let fixture: ComponentFixture<CfEndpointDetailsComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [CfEndpointDetailsComponent], | ||
imports: [ | ||
CoreModule, | ||
SharedModule | ||
] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(CfEndpointDetailsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
13 changes: 13 additions & 0 deletions
13
.../cloud-foundry/src/shared/components/cf-endpoint-details/cf-endpoint-details.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,13 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
import { | ||
EndpointListDetailsComponent, | ||
} from '../../../../../core/src/shared/components/list/list-types/endpoint/endpoint-list.helpers'; | ||
|
||
|
||
@Component({ | ||
selector: 'lib-cf-endpoint-details', | ||
templateUrl: './cf-endpoint-details.component.html', | ||
styleUrls: ['./cf-endpoint-details.component.scss'] | ||
}) | ||
export class CfEndpointDetailsComponent extends EndpointListDetailsComponent { } |
20 changes: 20 additions & 0 deletions
20
src/frontend/packages/cloud-foundry/src/shared/components/components.module.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,20 @@ | ||
import { NgModule } from '@angular/core'; | ||
|
||
import { CoreModule } from '../../../../core/src/core/core.module'; | ||
import { CfEndpointDetailsComponent } from './cf-endpoint-details/cf-endpoint-details.component'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CoreModule | ||
], | ||
declarations: [ | ||
CfEndpointDetailsComponent | ||
], | ||
exports: [ | ||
CfEndpointDetailsComponent | ||
], | ||
entryComponents: [ | ||
CfEndpointDetailsComponent | ||
] | ||
}) | ||
export class CloudFoundryComponentsModule { } |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions
50
src/frontend/packages/core/assets/endpoint-icons/metrics.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
32 changes: 32 additions & 0 deletions
32
src/frontend/packages/core/src/core/disable-router-link.directive.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,32 @@ | ||
import { Directive, Input, Optional } from '@angular/core'; | ||
import { RouterLink, RouterLinkWithHref } from '@angular/router'; | ||
|
||
@Directive({ | ||
selector: '[routerLink][appDisableRouterLink]' | ||
}) | ||
export class DisableRouterLinkDirective { | ||
|
||
@Input() appDisableRouterLink: boolean; | ||
|
||
constructor( | ||
// Inject routerLink | ||
@Optional() routerLink: RouterLink, | ||
@Optional() routerLinkWithHref: RouterLinkWithHref | ||
) { | ||
|
||
const link = routerLink || routerLinkWithHref; | ||
|
||
// Save original method | ||
const onClick = link.onClick; | ||
|
||
// Replace method | ||
link.onClick = (...args) => { | ||
if (this.appDisableRouterLink) { | ||
return routerLinkWithHref ? false : true; | ||
} else { | ||
return onClick.apply(link, args); | ||
} | ||
}; | ||
} | ||
|
||
} |
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
Oops, something went wrong.