-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat(#3212): Show input fields in customization dialog * Cleanup * Cleanup
- Loading branch information
1 parent
970ccf4
commit bf2266c
Showing
11 changed files
with
303 additions
and
33 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
61 changes: 61 additions & 0 deletions
61
ui/src/app/core-ui/pipeline-element-runtime-info/pipeline-element-schema.service.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,61 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
import { Injectable } from '@angular/core'; | ||
import { | ||
DataType, | ||
EventPropertyList, | ||
EventPropertyPrimitive, | ||
EventPropertyUnion, | ||
SemanticType, | ||
} from '@streampipes/platform-services'; | ||
|
||
@Injectable({ providedIn: 'root' }) | ||
export class PipelineElementSchemaService { | ||
getFriendlyRuntimeType(ep: EventPropertyUnion): string { | ||
if (ep instanceof EventPropertyPrimitive) { | ||
if (this.isTimestamp(ep)) { | ||
return 'Timestamp'; | ||
} else if (this.isImage(ep)) { | ||
return 'Image'; | ||
} else if (DataType.isNumberType(ep.runtimeType)) { | ||
return 'Number'; | ||
} else if (DataType.isBooleanType(ep.runtimeType)) { | ||
return 'Boolean'; | ||
} else { | ||
return 'Text'; | ||
} | ||
} else if (ep instanceof EventPropertyList) { | ||
return 'List'; | ||
} else { | ||
return 'Nested'; | ||
} | ||
} | ||
|
||
isImage(ep: EventPropertyUnion) { | ||
return SemanticType.isImage(ep); | ||
} | ||
|
||
isTimestamp(ep: EventPropertyUnion) { | ||
return SemanticType.isTimestamp(ep); | ||
} | ||
|
||
hasNoDomainProperty(ep: EventPropertyUnion) { | ||
return !(this.isTimestamp(ep) || this.isImage(ep)); | ||
} | ||
} |
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
48 changes: 48 additions & 0 deletions
48
ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-panel.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,48 @@ | ||
<!-- | ||
~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
~ contributor license agreements. See the NOTICE file distributed with | ||
~ this work for additional information regarding copyright ownership. | ||
~ The ASF licenses this file to You under the Apache License, Version 2.0 | ||
~ (the "License"); you may not use this file except in compliance with | ||
~ the License. You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
~ | ||
--> | ||
|
||
<div fxLayout="column" class="mb-10"> | ||
<mat-accordion> | ||
<mat-expansion-panel class="mat-expansion-panel mat-elevation-z0"> | ||
<mat-expansion-panel-header> | ||
<mat-panel-title | ||
><mat-icon color="accent">list</mat-icon | ||
><b> Show input fields</b></mat-panel-title | ||
> | ||
</mat-expansion-panel-header> | ||
@for ( | ||
inputStream of pipelineElement.inputStreams; | ||
track pipelineElement.elementId | ||
) { | ||
<div fxLayout="column"> | ||
<b>{{ inputStream.name }}</b> | ||
@for ( | ||
property of inputStream.eventSchema.eventProperties | ||
| sortByRuntimeName; | ||
track property.runtimeName | ||
) { | ||
<sp-input-schema-property | ||
[property]="property" | ||
class="property-row" | ||
></sp-input-schema-property> | ||
} | ||
</div> | ||
} | ||
</mat-expansion-panel> | ||
</mat-accordion> | ||
</div> |
31 changes: 31 additions & 0 deletions
31
ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-panel.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,31 @@ | ||
/*! | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
.mat-expansion-panel { | ||
box-shadow: none; | ||
border: 1px solid var(--color-bg-3); | ||
} | ||
|
||
.property-row { | ||
padding: 10px; | ||
background-color: var(--color-bg-1); | ||
} | ||
|
||
.property-row:nth-child(even) { | ||
background-color: var(--color-bg-2); | ||
} |
33 changes: 33 additions & 0 deletions
33
ui/src/app/editor/dialog/customize/input-schema-panel/input-schema-panel.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,33 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
import { Component, Input } from '@angular/core'; | ||
import { | ||
DataProcessorInvocation, | ||
DataSinkInvocation, | ||
} from '@streampipes/platform-services'; | ||
|
||
@Component({ | ||
selector: 'sp-input-schema-panel', | ||
templateUrl: './input-schema-panel.component.html', | ||
styleUrls: ['./input-schema-panel.component.scss'], | ||
}) | ||
export class InputSchemaPanelComponent { | ||
@Input() | ||
pipelineElement: DataProcessorInvocation | DataSinkInvocation; | ||
} |
30 changes: 30 additions & 0 deletions
30
...g/customize/input-schema-panel/input-schema-property/input-schema-property.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,30 @@ | ||
<!-- | ||
~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
~ contributor license agreements. See the NOTICE file distributed with | ||
~ this work for additional information regarding copyright ownership. | ||
~ The ASF licenses this file to You under the Apache License, Version 2.0 | ||
~ (the "License"); you may not use this file except in compliance with | ||
~ the License. You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
~ | ||
--> | ||
|
||
<div fxLayout="row" fxFlex="100"> | ||
<div fxFlex="30"> | ||
<b>{{ property.runtimeName }}</b> | ||
</div> | ||
<div fxFlex="55" fxLayout="column"> | ||
{{ property.label }} | ||
<small> {{ property.description }} </small> | ||
</div> | ||
<div fxFlex="15"> | ||
{{ runtimeType }} | ||
</div> | ||
</div> |
43 changes: 43 additions & 0 deletions
43
...log/customize/input-schema-panel/input-schema-property/input-schema-property.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,43 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
import { Component, Input, OnInit } from '@angular/core'; | ||
import { EventPropertyUnion } from '@streampipes/platform-services'; | ||
import { PipelineElementSchemaService } from '../../../../../core-ui/pipeline-element-runtime-info/pipeline-element-schema.service'; | ||
|
||
@Component({ | ||
selector: 'sp-input-schema-property', | ||
templateUrl: './input-schema-property.component.html', | ||
}) | ||
export class InputSchemaPropertyComponent implements OnInit { | ||
@Input() | ||
property: EventPropertyUnion; | ||
|
||
runtimeType: string; | ||
|
||
constructor( | ||
private pipelineElementSchemaService: PipelineElementSchemaService, | ||
) {} | ||
|
||
ngOnInit() { | ||
this.runtimeType = | ||
this.pipelineElementSchemaService.getFriendlyRuntimeType( | ||
this.property, | ||
); | ||
} | ||
} |
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.