aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.html
blob: 59905bd751d8d17b912536561d3c4657380f94e5 (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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<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 *ngIf= "node?.data?.type == 'VFmodule'" class="instance-type" style="position: relative;border: 1px solid #D2D2CD;">
          <div *ngIf="node?.data?.action == 'Create' && node?.data?.type == 'VFmodule'" class="notShowOnViewMode notShowOnCreateMode newIcon"></div>
          <div><span title="{{node.data.position}}"
                     [attr.data-tests-id]="'node-position-indicator'">{{node?.data?.position}}</span></div>
          <div *ngIf="isLinkedInstance(node?.data)">
            <custom-icon
              [ngClass]="'link'"
              class="icon-link"
              [size]="'small'"
              [name]="'link'">
            </custom-icon>
          </div>
        </div>
        <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)">
            <custom-icon
              [ngClass]="'link'"
              class="icon-link"
              [size]="'small'"
              [name]="'link'">
            </custom-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" *ngIf="isPaused(node)" style="border-right: none;">
          <custom-icon
            [size]="'large'"
            [name]="'pause-upon-completion'"
            [testId]="'pause-upon-completion'">
          </custom-icon>
        </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;">
                  <custom-icon
                    class="icon-edit"
                    [ngClass]="contextMenuOption.iconClass"
                    [size]="'small'"
                    [name]="contextMenuOption.iconClass">
                </custom-icon></div>
                <div style="padding-left: 25px;">{{getcontextMenuOptionLabel(contextMenuOption)}}</div>
              </div>
            </ng-template>
          </context-menu>
          </span>
          <span
            *ngIf="drawingBoardTreeService.isVNFMissingData(node, serviceModelId) || drawingBoardTreeService.isVFModuleMissingData(node, serviceModelId)"
            tooltip="{{ missingDataTooltip }}"
            tooltipPlacement="left"
            [attr.data-tests-id]="'node-'+ node.data.modelId + '-' + node.data.modelName +'-alert-icon'"
            class="icon-alert">
              <custom-icon
                [mode]="'warning'"
                [testId]="'icon-alert'"
                [size]="'medium'"
                [name]="'alert-triangle-o'">
              </custom-icon>
          </span>
        </div>

        <div class="action-status">
          <span
            [ngClass]="isUpgraded(node)?'action-status-type upgrade':'action-status-type delete'"
            [attr.data-tests-id]="isUpgraded(node)?'action-status-type':'delete-status-type'"
            [ngStyle]="{ 'opacity': isUpgraded(node) || isDeleted(node) ? '1' : '0'}">{{isUpgraded(node) ? "Upgrade" : "Delete"}}</span>
        </div>
      </div>
    </ng-template>
  </tree-root>
</div>