Skip to content

Commit

Permalink
#645 :: Generic Operation props.
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-korchak committed Jun 8, 2020
1 parent 0427c99 commit 4bb9837
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,38 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<div *ngFor="let property of properties ;let i=index">
<mat-expansion-panel [expanded]="true">
<mat-expansion-panel-header>
<i class="fa fa-xs" aria-hidden="true" [style.color]=getColor()>{{getIcon()}}</i> <strong> {{property.type}}</strong>
</mat-expansion-panel-header>
<div id="property{{i}}" class="accordion-body collapse in show">
<ngx-json-viewer [json]="property.value"
[expanded]="false">
</ngx-json-viewer>
</div>
</mat-expansion-panel>

<!-- EXTRA PROPS :: PRIMITIVE -->
<div class="operation-info-section" *ngIf="extraProperties?.primitive?.length">

<!-- TITLE -->
<div class="operation-info-section__title">
<i [style.color]=getColor() aria-hidden="true" class="fa fa-xs">{{getIcon()}}</i>
Properties
</div>
<!-- ./TITLE -->

<!-- BODY -->
<div class="operation-info-section__body">

<ng-container>
<div *ngFor="let property of extraProperties.primitive" class="operation-property">
<span class="operation-property__label">{{property.label}}</span>:
<span class="operation-property__value">{{property.value}}</span>
</div>
</ng-container>

</div>
<!-- ./BODY -->

</div>
<!-- ./EXTRA PROPS :: PRIMITIVE -->

<!-- EXTRA PROPS :: JSON -->
<ng-container *ngIf="extraProperties?.json?.length">
<app-operation-property-json *ngFor="let property of extraProperties.json"
[label]="property.label"
[value]="property.value">
</app-operation-property-json>
</ng-container>
<!-- EXTRA PROPS :: JSON -->
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,28 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Component } from '@angular/core';
import { Component, Input } from '@angular/core'
import { PropertiesComponent } from '../properties/properties.component';
import { OperationProperty } from '../../../../../model/operation/operation-property.models'
import ExtraProperties = OperationProperty.ExtraProperties
import * as _ from 'lodash'
import NativeProperties = OperationProperty.NativeProperties


@Component({
selector: 'app-generic',
templateUrl: './generic.component.html'
})
export class GenericComponent extends PropertiesComponent { }
export class GenericComponent extends PropertiesComponent {

extraProperties: ExtraProperties

@Input() set nativeProperties(props: NativeProperties) {
const defaultProps = [
'name'
]
const noDefaultProps = _.omit(props, defaultProps)
this.extraProperties = OperationProperty.parseExtraOptions(noDefaultProps)
}

}

0 comments on commit 4bb9837

Please sign in to comment.