-
Notifications
You must be signed in to change notification settings - Fork 0
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 #4 from dhutchison/features/2-NodeDetail
Addition of node detail (method) capability on node selection. Includes deployment version
- Loading branch information
Showing
13 changed files
with
218 additions
and
11 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
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
2 changes: 1 addition & 1 deletion
2
docs/main.88f2fd7c2945d23e6062.js → docs/main.12f4031c93c1c8fa87dc.js
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
docs/styles.4963c1e1ffd00e7d57a1.css → docs/styles.a28a5002915fea04e4ea.css
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
<p-tree [value]="apiPathNodes" layout="horizontal"> | ||
<p-tree [value]="apiPathNodes" layout="horizontal" | ||
selectionMode="single" [(selection)]="selectedNode"> | ||
<ng-template let-node pTemplate="operation"> | ||
<span pTooltip="{{ node.tooltip }}">{{ node.label }}</span> | ||
</ng-template> | ||
</p-tree> | ||
|
||
<app-node-method-detail *ngIf="selectedNode" | ||
[(method)]="selectedNode.method" | ||
[(path)]="selectedNode.path" | ||
[(node)]="selectedNode.operation"> | ||
</app-node-method-detail> |
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
53 changes: 53 additions & 0 deletions
53
src/app/node-method-detail/node-method-detail.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,53 @@ | ||
<div *ngIf="node"> | ||
<p-panel styleClass="http-{{method | lowercase}}" [toggleable]="true"> | ||
<p-header> | ||
<p-button label="{{method | uppercase}}" style="display: inline-block" ></p-button> | ||
<p class="path" style="display: inline-block">{{path}}</p> | ||
<p style="display: inline-block">{{node.summary}}</p> | ||
</p-header> | ||
<p>{{node.description}}</p> | ||
|
||
<p-fieldset [toggleable]="true"> | ||
<p-header>Parameters</p-header> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr *ngFor="let p of node.parameters"> | ||
<td class="key"> | ||
<dl> | ||
<dt>{{p.name}} <span *ngIf="p.required" class="required">* <sup>required</sup></span></dt> | ||
<dd>({{p.in}})</dd> | ||
</dl> | ||
</td> | ||
<td>{{p.description}}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</p-fieldset> | ||
|
||
<p-fieldset [toggleable]="true"> | ||
<p-header> | ||
Responses | ||
</p-header> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Code</th> | ||
<th>Description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr class="key" *ngFor="let item of node.responses | keyvalue"> | ||
<td>{{item.key}}</td> | ||
<td>{{item.value.description}}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</p-fieldset> | ||
</p-panel> | ||
</div> |
35 changes: 35 additions & 0 deletions
35
src/app/node-method-detail/node-method-detail.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,35 @@ | ||
span.required { | ||
color: red; | ||
} | ||
|
||
.path { | ||
font-weight: bold; | ||
margin: 1em; | ||
} | ||
|
||
p-fieldset { | ||
margin:1em; | ||
} | ||
p-fieldset dt { | ||
font-weight: bold; | ||
} | ||
p-fieldset dd { | ||
font-style: italic; | ||
font-size: 0.8em; | ||
margin:0.5em; | ||
} | ||
|
||
table { | ||
width: 100%; | ||
} | ||
|
||
th { | ||
border-bottom: 1px solid #CCC; | ||
} | ||
|
||
th { | ||
text-align: left; | ||
} | ||
td { | ||
padding:0.5em; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/app/node-method-detail/node-method-detail.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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { NodeMethodDetailComponent } from './node-method-detail.component'; | ||
|
||
describe('NodeMethodDetailComponent', () => { | ||
let component: NodeMethodDetailComponent; | ||
let fixture: ComponentFixture<NodeMethodDetailComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ NodeMethodDetailComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(NodeMethodDetailComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
20 changes: 20 additions & 0 deletions
20
src/app/node-method-detail/node-method-detail.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,20 @@ | ||
import { Component, OnInit, Input } from '@angular/core'; | ||
import { TreeNode } from 'primeng/api'; | ||
|
||
@Component({ | ||
selector: 'app-node-method-detail', | ||
templateUrl: './node-method-detail.component.html', | ||
styleUrls: ['./node-method-detail.component.scss'] | ||
}) | ||
export class NodeMethodDetailComponent implements OnInit { | ||
|
||
@Input() method: String; | ||
@Input() path; | ||
@Input() node: TreeNode; | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
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