Skip to content

Commit

Permalink
Display Labels for Annotated Plocies (winery#638)
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Harzenetter <[email protected]>
  • Loading branch information
lharzenetter authored Dec 15, 2021
1 parent bf5bcac commit d327761
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
</div>

<div *ngIf="policyIcons" class="policyIconsAnnotation">
<img *ngFor="let policyIcon of policyIcons" [src]="policyIcon" class="policyAnnotation"
alt="Policy icon">
<img *ngFor="let policyIcon of policyIcons" [src]="policyIcon.imageUrl" class="policyAnnotation"
alt="Policy icon" tooltip="{{ policyIcon.policyType }}">
</div>

<div *ngIf="newerVersions?.length !== 0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class NodeComponent implements OnInit, AfterViewInit, OnDestroy, DoCheck
artifactTypes: any;
removeZIndex: any;
propertyDefinitionType: PropertyDefinitionType;
policyIcons: string[];
policyIcons: { imageUrl: string, policyType: string }[];
configEnum = FeatureEnum;
policiesOfNode: TPolicy[];
groupDefinitions: TGroupDefinition[];
Expand Down Expand Up @@ -307,7 +307,8 @@ export class NodeComponent implements OnInit, AfterViewInit, OnDestroy, DoCheck
}

if (visual && visual.imageUrl) {
this.policyIcons.push(visual.imageUrl);
const type = value.policyType.replace(/{.*}/, '');
this.policyIcons.push({ imageUrl: visual.imageUrl, policyType: type });
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,24 @@
package org.eclipse.winery.repository.backend.consistencycheck;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;

import org.eclipse.jdt.annotation.NonNull;

public class ElementErrorList {

private List<String> errors = new ArrayList<>();
private List<String> warnings = new ArrayList<>();
private String toscaType;
private final List<String> errors = new ArrayList<>();
private final List<String> warnings = new ArrayList<>();
private final String toscaType;

public ElementErrorList(@NonNull String toscaType) {
this.toscaType = toscaType;
}

public void addError(@NonNull String message) {
this.errors.add(message);
this.errors.addAll(Arrays.asList(message.split("\n")));
}

public void addWarning(@NonNull String message) {
Expand Down

0 comments on commit d327761

Please sign in to comment.