summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.html
blob: e1d88a6960c6e4ead87df9d9589d419a8279517e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<error-msg></error-msg>
<div class="drawing-board-tree" style="height: calc(100vh - 55px);">
  <div *ngIf="nodes?.length == 0" style="text-align: center;    margin-top: 50px;">

    <no-content-message-and-icon *ngIf="objectToModelTreeService.numberOfPlusButton != 0" class="span-over"
                                 data-title="Please add objects (VNFs, network, modules etc.)"
                                 title2="from the left tree to design the service instance"
                                 subtitle="Once done, click Deploy to start instantiation"
                                 iconPath="./assets/img/UPLOAD.svg"
                                 iconClass="upload-icon-service-planing"></no-content-message-and-icon>

    <no-content-message-and-icon *ngIf="objectToModelTreeService.numberOfPlusButton == 0" class="span-over"
                                 data-title="No objects to add in this service instance."
                                 title2=""
                                 subtitle="Click Deploy to start instantiation"
                                 iconPath="./assets/img/UPLOAD.svg"
                                 iconClass="upload-icon-service-planing"></no-content-message-and-icon>
  </div>
  <div class="tree-header" *ngIf="nodes?.length > 0">
    <div class="title-tree">Instance:</div>
    <search-component (updateNodes)="updateNodes($event)"
                      [nodes]="nodes" [tree]="tree"
                      [inputTestId]="'search-right-tree'"
                      *ngIf="drawingBoardTreeService.isViewEditFlagTrue()"></search-component>
  </div>
  <tree-root [attr.data-tests-id]="'drawing-board-tree'" #tree [nodes]="nodes" [options]="options"
             id="drawing-board-tree">

    <ng-template #treeNodeTemplate let-node let-index="index">
      <div class="main-row" [attr.id]="getNodeId(node)" [attr.data-tests-id]="'node-'+node.data.modelId +'-' +node.data.modelName"
           (click)="selectNode(node)"
           [ngClass]="{'isLinked' : isLinkedInstance(node?.data)}">
        <custom-popover class="failed-popover-wrap" *ngIf="node?.data?.isFailed" [value]="node?.data?.statusMessage"
                        [placement]="'left'" [popoverType]="'error'">
          <div class="failed-msg" [attr.data-tests-id]="'failed-error-message'" *ngIf="node?.data?.isFailed">Failed
          </div>
        </custom-popover>
        <div class="instance-type" style="position: relative;border: 1px solid #D2D2CD;">
          <div *ngIf="node?.data?.action == 'Create'" class="notShowOnViewMode notShowOnCreateMode newIcon"></div>
          <div><span title="{{node.data.type}}"
                     [attr.data-tests-id]="'node-type-indicator'">{{node?.data?.typeName}}</span></div>
          <div *ngIf="isLinkedInstance(node?.data)">
            <svg-icon
              [ngClass]="'link'"
              class="icon-link"
              [size]="'small'"
              [name]="'link'">
            </svg-icon>
          </div>
        </div>
        <div class="model-info" [ngClass]="{'rightBorder' : pageMode === 'VIEW'}">
          <span class="header-info">
            <span class="property-name">
              <span class="auto-name"
                    [ngClass]="{'text_decoration' : drawingBoardTreeService.isTextDecoration(node)}"
                    [innerHtml]="getNodeName(node, filterValue) | safe : 'html'"
                    [attr.data-tests-id]="'node-name'"
              ></span>
            </span>
          </span>
          <tree-node-header-properties
            *ngIf="(node?.data?.action !== 'Create' || node?.data?.parentType === 'VnfGroup') && !node?.data?.isFailed"
            [properties]="node.data.statusProperties"></tree-node-header-properties>
        </div>
        <div class="scaling invalid" *ngIf="node?.data?.errors?.scalingError" [attr.data-tests-id]="'scaling-policy'">
          <span>Limit</span><span>{{node?.data?.limitMembers}}</span>
        </div>
        <div class="model-actions notShowOnViewMode ">
          <span class="icon-browse"
                [ngClass]="{'isLinked' : isLinkedInstance(node?.data)}"
                [attr.data-tests-id]="'node-'+node.data.modelId +'-' +node.data.modelName+'-menu-btn'"
                (click)="onContextMenu($event, node)">
          <context-menu>
            <ng-template *ngFor="let contextMenuOption of contextMenuOptions"
                         contextMenuItem (execute)="executeMenuAction(contextMenuOption.methodName)"
                         [visible]="isVisible(currentNode, contextMenuOption.methodName)"
                         [enabled]="isEnabled(currentNode, serviceModelId, contextMenuOption.methodName)">
              <div [attr.data-tests-id]="contextMenuOption.dataTestId">
                <div style="float: left;margin-top: 3px;">
                  <svg-icon
                    [ngClass]="contextMenuOption.iconClass"
                    class="icon-edit"
                    [size]="'small'"
                    [name]="contextMenuOption.iconClass">
                </svg-icon></div>
                <div style="padding-left: 25px;">{{contextMenuOption.label}}</div>
              </div>
            </ng-template>
          </context-menu>
          </span>
          <span
            *ngIf="drawingBoardTreeService.isVNFMissingData(node, serviceModelId)"
            tooltip="{{ missingDataTooltip }}"
            tooltipPlacement="left"
            [attr.data-tests-id]="'node-'+node.data.modelId +'-' +node.data.modelName+'-alert-icon'"
            class="icon-alert">
              <svg-icon
                [mode]="'warning'"
                [testId]="'icon-alert'"
                [size]="'medium'"
                [name]="'alert-triangle-o'">
              </svg-icon>
            </span>
          <span *ngIf="drawingBoardTreeService.isVFModuleMissingData(node, serviceModelId)" class="icon-alert"
                tooltip="{{ missingDataTooltip }}" tooltipPlacement="left"
                [attr.data-tests-id]="'node-'+node.data.modelId +'-' +node.data.modelName+'-alert-icon'"></span>
        </div>

        <div class="action-status">
          <span class="action-status-type delete" [attr.data-tests-id]="'delete-status-type'" [ngStyle]="{ 'opacity': node.data.action.split('_').pop() !== 'Delete' ? '0' : '1'}">Delete</span>
        </div>

      </div>
    </ng-template>
  </tree-root>
</div>