summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/directives/graphs-v2/relation-menu
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/directives/graphs-v2/relation-menu')
-rw-r--r--catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.html63
-rw-r--r--catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.less118
-rw-r--r--catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.ts104
3 files changed, 0 insertions, 285 deletions
diff --git a/catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.html b/catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.html
deleted file mode 100644
index e1cdf499a0..0000000000
--- a/catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.html
+++ /dev/null
@@ -1,63 +0,0 @@
-<div class="link-menu-open" data-tests-id="link-menu-open" data-ng-show="isLinkMenuOpen" ng-style="{left: connectRelationModel.menuPosition.x, top: connectRelationModel.menuPosition.y}" clicked-outside="{onClickedOutside: 'hideRelationMatch()', clickedOutsideEnable: 'isLinkMenuOpen'}" >
- <h4 sdc-smart-tooltip>{{relationMenuDirectiveObj.leftSideLink.componentInstance.name | resourceName}}</h4>
- <h4 sdc-smart-tooltip>{{relationMenuDirectiveObj.rightSideLink.componentInstance.name | resourceName}}</h4>
-
- <p>Select one of the options below to connect</p>
-
- <perfect-scrollbar scroll-y-margin-offset="0" include-padding="true" class="scrollbar-container">
- <div class="inner-title" data-ng-show="hasMatchesToShow(connectRelationModel.leftSideLink.requirements, connectRelationModel.rightSideLink.selectedMatch)">Requirements</div>
- <div class="link-item" data-tests-id="link-item-requirements" data-ng-repeat="(req ,matchArr) in connectRelationModel.leftSideLink.requirements"
- data-ng-click="connectRelationModel.leftSideLink.selectMatchArr(matchArr); updateSelectionText()"
- data-ng-show="showMatch(connectRelationModel.rightSideLink.selectedMatch, matchArr)"
- data-ng-class="{ 'selected': connectRelationModel.leftSideLink.selectedMatch === matchArr}">
- <div sdc-smart-tooltip>{{matchArr[0].requirement.getFullTitle()}}</div>
- </div>
-
- <div class="inner-title" data-ng-show="hasMatchesToShow(connectRelationModel.leftSideLink.capabilities, connectRelationModel.rightSideLink.selectedMatch)">Capabilities</div>
- <div class="link-item" data-tests-id="link-item-capabilities" data-ng-repeat="(cap, matchArr) in connectRelationModel.leftSideLink.capabilities"
- data-ng-click="connectRelationModel.leftSideLink.selectMatchArr(matchArr); updateSelectionText()"
- data-ng-show="showMatch(connectRelationModel.rightSideLink.selectedMatch, matchArr)"
- data-ng-class="{ 'selected': connectRelationModel.leftSideLink.selectedMatch === matchArr}">
- <div sdc-smart-tooltip>{{matchArr[0].capability.getFullTitle()}}</div>
- </div>
- </perfect-scrollbar>
-
- <perfect-scrollbar scroll-y-margin-offset="0" include-padding="true" class="scrollbar-container">
- <div class="inner-title" data-ng-show="hasMatchesToShow(connectRelationModel.rightSideLink.requirements, connectRelationModel.leftSideLink.selectedMatch)">Requirements</div>
- <div class="link-item" data-tests-id="link-item-requirements" data-ng-repeat="(req, matchArr) in connectRelationModel.rightSideLink.requirements"
- data-ng-click="connectRelationModel.rightSideLink.selectMatchArr(matchArr); updateSelectionText()"
- data-ng-show="showMatch(connectRelationModel.leftSideLink.selectedMatch, matchArr)"
- data-ng-class="{ 'selected': connectRelationModel.rightSideLink.selectedMatch === matchArr}">
- <div sdc-smart-tooltip>{{matchArr[0].secondRequirement ? matchArr[0].secondRequirement.getFullTitle() : matchArr[0].requirement.getFullTitle()}}</div>
- </div>
-
- <div class="inner-title" data-ng-show="hasMatchesToShow(connectRelationModel.rightSideLink.capabilities, connectRelationModel.leftSideLink.selectedMatch)">Capabilities</div>
- <div class="link-item" data-tests-id="link-item-capabilities" data-ng-repeat="(cap, matchArr) in connectRelationModel.rightSideLink.capabilities"
- data-ng-click="connectRelationModel.rightSideLink.selectMatchArr(matchArr); updateSelectionText()"
- data-ng-show="showMatch(connectRelationModel.leftSideLink.selectedMatch, matchArr)"
- data-ng-class="{ 'selected': connectRelationModel.rightSideLink.selectedMatch === matchArr}">
- <div sdc-smart-tooltip>{{matchArr[0].capability.getFullTitle()}}</div>
- </div>
- </perfect-scrollbar>
-
- <div class="vl-type" data-ng-class="{'disabled': !connectRelationModel.leftSideLink.selectedMatch[0].secondRequirement || !connectRelationModel.rightSideLink.selectedMatch[0].secondRequirement}">
- <sdc-radio-button sdc-model="relationMenuDirectiveObj.vlType" value="ptp"
- disabled="!relationMenuDirectiveObj.leftSideLink.selectedMatch[0].secondRequirement || !relationMenuDirectiveObj.rightSideLink.selectedMatch[0].secondRequirement || !relationMenuDirectiveObj.p2pVL"
- text="Point to point" elem-id="radioPTP" elem-name="vlType"></sdc-radio-button>
-
- <sdc-radio-button sdc-model="relationMenuDirectiveObj.vlType" value="mptmp"
- disabled="!relationMenuDirectiveObj.leftSideLink.selectedMatch[0].secondRequirement || !relationMenuDirectiveObj.rightSideLink.selectedMatch[0].secondRequirement || !relationMenuDirectiveObj.mp2mpVL"
- text="Multi point" elem-id="radioMPTMP" elem-name="vlType"></sdc-radio-button>
-
- <span class="sprite-new info-icon" tooltips tooltip-content="You are required to choose the type of the Virtual Link."></span>
- </div>
-
- <div class="result" sdc-smart-tooltip>&#8203;{{relationMenuDirectiveObj.selectionText}}
-
- </div>
-
- <button class="tlv-btn grey" data-tests-id="link-menu-button-cancel" data-ng-click="hideRelationMatch()">Cancel</button>
- <button class="tlv-btn blue" data-tests-id="link-menu-button-connect" data-ng-disabled="!connectRelationModel.leftSideLink.selectedMatch || !connectRelationModel.rightSideLink.selectedMatch ||
- (connectRelationModel.leftSideLink.selectedMatch[0].secondRequirement && !connectRelationModel.vlType)"
- data-ng-click="saveRelation()">Connect</button>
-</div>
diff --git a/catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.less b/catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.less
deleted file mode 100644
index dea814dbec..0000000000
--- a/catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.less
+++ /dev/null
@@ -1,118 +0,0 @@
-.link-menu-open {
- display: block !important;
- color: @main_color_m;
- font-size: 14px;
- position: absolute;
- z-index: 99999;
- border-radius: 2px;
- background-color: #ffffff;
- box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.5);
- width: 460px;
- height: 418px;
-
- h4 {
- width: 50%;
- float: left;
- background-color: @tlv_color_u;
- font-size: 14px;
- font-weight: bold;
- line-height: 36px;
- margin: 0;
- padding: 0 15px;
-
- & + h4 {
- border-left: #d8d8d8 1px solid;
- }
- }
- p {
- clear: both;
- text-indent: 15px;
- border-bottom: #d8d8d8 1px solid;
- line-height: 34px;
- margin: 0;
- color: @func_color_s;
- }
-
- .scrollbar-container {
- height: 232px;
- width: 50%;
- float: left;
- margin-bottom: 5px;
- .perfect-scrollbar;
-
- & + .scrollbar-container {
- border-left: #d8d8d8 1px solid;
- }
-
- .inner-title {
- width: 189px;
- margin: 5px auto 3px auto;
- //text-indent: 10px;
- color: @func_color_s;
- text-transform: uppercase;
- font-weight: bold;
-
- //&:not(:first-child) {
- // margin-top: 10px;
- //}
- }
-
- .link-item {
- padding: 0 10px;
- line-height: 23px;
- height: 23px;
- text-indent: 5px;
- .hand;
-
- &.selected {
- background-color: @tlv_color_v;
- }
- }
- }
-
- .vl-type {
- height: 33px;
- border-top: #d8d8d8 solid 1px;
- clear: both;
- padding: 0 10px;
- line-height: 32px;
- color: @main_color_m;
-
- &.disabled {
- background-color: #f2f2f2;
- color: @color_m;
- }
- .info-icon {
- float:right;
- margin-top: 9px;
- }
- .tlv-radio {
- margin-right: 10px;
- }
- }
-
- .result {
- background-color: @main_color_m;
- line-height: 29px;
- color: #ffffff;
- padding: 0 15px;
- }
-
- button {
- float: right;
- margin-top: 9px;
- margin-right: 10px;
- }
-}
-.link-menu-item {
- cursor: pointer;
- line-height: 24px;
- padding: 0 10px;
- &:hover {
- color: @color_a;
- }
-}
-.link-menu::before {
- right: inherit !important;
- left: 50px;
-} \ No newline at end of file
diff --git a/catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.ts b/catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.ts
deleted file mode 100644
index 78a269ead1..0000000000
--- a/catalog-ui/src/app/directives/graphs-v2/relation-menu/relation-menu.ts
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed 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.
- * ============LICENSE_END=========================================================
- */
-'use strict'
-import * as _ from "lodash";
-import {Match, ConnectRelationModel} from "app/models";
-import {Component} from "../../../models/components/component";
-
-export interface IRelationMenuScope extends ng.IScope {
- relationMenuDirectiveObj:ConnectRelationModel;
- createRelation:Function;
- isLinkMenuOpen:boolean;
- hideRelationMatch:Function;
- cancel:Function;
-
- saveRelation();
- showMatch(arr1:Array<Match>, arr2:Array<Match>):boolean;
- hasMatchesToShow(matchesObj:Match, selectedMatch:Array<Match>);
- updateSelectionText():void;
-
-}
-
-
-export class RelationMenuDirective implements ng.IDirective {
-
- constructor(private $filter:ng.IFilterService) {
- }
-
- scope = {
- relationMenuDirectiveObj: '=',
- isLinkMenuOpen: '=',
- createRelation: '&',
- cancel: '&'
- };
-
- restrict = 'E';
- replace = true;
- template = ():string => {
- return require('./relation-menu.html');
- };
-
- link = (scope:IRelationMenuScope, element:JQuery, $attr:ng.IAttributes) => {
-
- scope.saveRelation = ():void=> {
- let chosenMatches:Array<any> = _.intersection(scope.relationMenuDirectiveObj.rightSideLink.selectedMatch, scope.relationMenuDirectiveObj.leftSideLink.selectedMatch);
- let chosenMatch:Match = chosenMatches[0];
- scope.createRelation()(chosenMatch);
- };
-
-
- scope.hideRelationMatch = () => {
- scope.isLinkMenuOpen = false;
- scope.cancel();
- };
-
- //to show options in link menu
- scope.showMatch = (arr1:Array<Match>, arr2:Array<Match>):boolean => {
- return !arr1 || !arr2 || _.intersection(arr1, arr2).length > 0;
- };
-
- //to show requirements/capabilities title
- scope.hasMatchesToShow = (matchesObj:Match, selectedMatch:Array<Match>):boolean => {
- let result:boolean = false;
- _.forEach(matchesObj, (matchesArr:Array<Match>) => {
- if (!result) {
- result = scope.showMatch(matchesArr, selectedMatch);
- }
- });
- return result;
- };
-
-
- scope.updateSelectionText = ():void => {
- let left:string = scope.relationMenuDirectiveObj.leftSideLink.selectedMatch ? this.$filter('resourceName')(scope.relationMenuDirectiveObj.leftSideLink.selectedMatch[0].getDisplayText('left')) : '';
- let both:string = scope.relationMenuDirectiveObj.leftSideLink.selectedMatch && scope.relationMenuDirectiveObj.rightSideLink.selectedMatch ? ' - ' +
- this.$filter('resourceName')(scope.relationMenuDirectiveObj.leftSideLink.selectedMatch[0].requirement.relationship) + ' - ' : '';
- let right:string = scope.relationMenuDirectiveObj.rightSideLink.selectedMatch ? this.$filter('resourceName')(scope.relationMenuDirectiveObj.rightSideLink.selectedMatch[0].getDisplayText('right')) : '';
- scope.relationMenuDirectiveObj.selectionText = left + both + right;
- };
-
-
- }
- public static factory = ($filter:ng.IFilterService)=> {
- return new RelationMenuDirective($filter);
- };
-}
-
-RelationMenuDirective.factory.$inject = ['$filter'];