Michael Lando | dd60339 | 2017-07-12 00:54:52 +0300 | [diff] [blame] | 1 | /*- |
| 2 | * ============LICENSE_START======================================================= |
| 3 | * SDC |
| 4 | * ================================================================================ |
| 5 | * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. |
| 6 | * ================================================================================ |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | * you may not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
Idan Amit | 7363f3d | 2018-03-21 12:04:57 +0200 | [diff] [blame] | 10 | * |
Michael Lando | dd60339 | 2017-07-12 00:54:52 +0300 | [diff] [blame] | 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
Idan Amit | 7363f3d | 2018-03-21 12:04:57 +0200 | [diff] [blame] | 12 | * |
Michael Lando | dd60339 | 2017-07-12 00:54:52 +0300 | [diff] [blame] | 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
| 18 | * ============LICENSE_END========================================================= |
| 19 | */ |
| 20 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 21 | import {ClickedOutsideDirective} from "../directives/clicked-outside/clicked-outside-directive"; |
| 22 | import {LoaderDirective} from "../directives/loader/loader-directive"; |
| 23 | import {UserHeaderDetailsDirective} from "../directives/user-header-details/user-header-details-directive"; |
| 24 | import {FileTypeDirective} from "../directives/file-type/file-type"; |
| 25 | import {DownloadArtifactDirective} from "../directives/download-artifact/download-artifact"; |
| 26 | import {EllipsisDirective} from "../directives/ellipsis/ellipsis-directive"; |
| 27 | import {InvalidCharactersDirective} from "../directives/invalid-characters/invalid-characters"; |
| 28 | import {ExpandCollapseDirective} from "../directives/utils/expand-collapse/expand-collapse"; |
| 29 | import {PerfectScrollerDirective} from "../directives/perfect-scrollbar/angular-perfect-scrollbar"; |
| 30 | import {SdcModalDirective} from "../directives/modal/sdc-modal"; |
| 31 | import {FileOpenerDirective} from "../directives/file-opener/file-opener"; |
| 32 | import {FileUploadDirective} from "../directives/file-upload/file-upload"; |
| 33 | import {StructureTreeDirective} from "../directives/structure-tree/structure-tree-directive"; |
| 34 | import {SmartTooltipDirective} from "../directives/utils/smart-tooltip/smart-tooltip"; |
| 35 | import {PrintGraphScreenDirective} from "../directives/print-graph-screen/print-graph-screen"; |
| 36 | import {TagDirective} from "../directives/tag/tag-directive"; |
| 37 | import {SdcTagsDirective} from "../directives/utils/sdc-tags/sdc-tags"; |
| 38 | import {SdcKeyboardEventsDirective} from "../directives/utils/sdc-keyboard-events/sdc-keyboard-events"; |
| 39 | import {ExpandCollapseMenuBoxDirective} from "../directives/utils/expand-collapse-menu-box/expand-collaps-menu-box"; |
| 40 | import {PunchOutDirective} from "../directives/punch-out/punch-out"; |
| 41 | import {CustomValidationDirective} from "../directives/custom-validation/custom-validation"; |
| 42 | import {EcompHeaderDirective} from "../directives/ecomp-header/ecomp-header"; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 43 | import {EditNamePopoverDirective} from "../directives/edit-name-popover/edit-name-popover-directive"; |
| 44 | import {DataTypeFieldsStructureDirective} from "../directives/property-types/data-type-fields-structure/data-type-fields-structure"; |
| 45 | import {TypeMapDirective} from "../directives/property-types/type-map/type-map-directive"; |
| 46 | import {TypeListDirective} from "../directives/property-types/type-list/type-list-directive"; |
| 47 | import {SelectDataTypeFieldsStructureDirective} from "../directives/select-property-types/select-data-type-fields-structure/select-data-type-fields-structure"; |
| 48 | import {SelectTypeMapDirective} from "../directives/select-property-types/select-type-map/select-type-map-directive"; |
| 49 | import {SelectTypeListDirective} from "../directives/select-property-types/select-type-list/select-type-list-directive"; |
| 50 | import {ValidationOnLoadDirective} from "../directives/utils/validation-on-load/validation-on-load"; |
| 51 | import {InfoTooltipDirective} from "../directives/info-tooltip/info-tooltip"; |
| 52 | import {SdcTabsDirective} from "../directives/sdc-tabs/sdc-tabs-directive"; |
| 53 | import {SdcSingleTabDirective, InnerSdcSingleTabDirective} from "../directives/sdc-tabs/sdc-single-tab/sdc-single-tab-directive"; |
| 54 | import {ExpandCollapseListHeaderDirective} from "../directives/utils/expand-collapse-list-header/expand-collapse-list-header"; |
| 55 | import {JsonExportExcelDirective} from "../directives/export-json-to-excel/export-json-to-excel"; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 56 | import {TopProgressDirective} from "../directives/layout/top-progress/top-progress"; |
| 57 | import {CheckboxElementDirective} from "../directives/elements/checkbox/checkbox"; |
| 58 | import {RadiobuttonElementDirective} from "../directives/elements/radiobutton/radiobutton"; |
| 59 | import {OnLastRepeatDirective} from "../directives/events/on-last-repeat/on-last-repeat"; |
| 60 | import {InputRowDirective} from "../directives/inputs-and-properties/inputs/input-row-directive"; |
| 61 | import {PropertyRowDirective} from "../directives/inputs-and-properties/properties/property-row-directive"; |
| 62 | import {NodesFactory} from "../models/graph/nodes/nodes-factory"; |
| 63 | import {LinksFactory} from "../models/graph/graph-links/links-factory"; |
| 64 | import {ImageCreatorService} from "../directives/graphs-v2/image-creator/image-creator.service"; |
| 65 | import {Palette} from "../directives/graphs-v2/palette/palette.directive"; |
| 66 | import {CompositionGraph} from "../directives/graphs-v2/composition-graph/composition-graph.directive"; |
| 67 | import {RelationMenuDirective} from "../directives/graphs-v2/relation-menu/relation-menu"; |
| 68 | import {DeploymentGraph} from "../directives/graphs-v2/deployment-graph/deployment-graph.directive"; |
| 69 | import {CommonGraphUtils} from "../directives/graphs-v2/common/common-graph-utils"; |
| 70 | import {CompositionGraphNodesUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-nodes-utils"; |
| 71 | import {CompositionGraphGeneralUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-general-utils"; |
| 72 | import {CompositionGraphLinkUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-links-utils"; |
| 73 | import {DeploymentGraphGeneralUtils} from "../directives/graphs-v2/deployment-graph/deployment-utils/deployment-graph-general-utils"; |
| 74 | import {CompositionGraphPaletteUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-palette-utils"; |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 75 | import {CompositionGraphZoneUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-zone-utils"; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 76 | import {MatchCapabilitiesRequirementsUtils} from "../directives/graphs-v2/composition-graph/utils/match-capability-requierment-utils"; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 77 | import {CapabilitiesListDirective} from "../directives/capabilities-and-requirements/capability/capabilities-list-directive"; |
| 78 | import {RequirementsListDirective} from "../directives/capabilities-and-requirements/requirement/requirements-list-directive"; |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 79 | import {ServicePathGraphUtils} from "../directives/graphs-v2/composition-graph/utils/composition-graph-service-path-utils"; |
| 80 | import {PaletteAnimationComponent} from './../ng2/components/ui/palette-animation/palette-animation.component'; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 81 | |
| 82 | let moduleName:string = 'Sdc.Directives'; |
| 83 | let directiveModule:ng.IModule = angular.module(moduleName, []); |
| 84 | |
| 85 | directiveModule.directive('clickedOutside', ClickedOutsideDirective.factory); |
| 86 | directiveModule.directive('loader', LoaderDirective.factory); |
| 87 | directiveModule.directive('userHeaderDetails', UserHeaderDetailsDirective.factory); |
| 88 | directiveModule.directive('ellipsis', EllipsisDirective.factory); |
| 89 | directiveModule.directive('downloadArtifact', DownloadArtifactDirective.factory); |
| 90 | directiveModule.directive('fileType', FileTypeDirective.factory); |
| 91 | directiveModule.directive('invalidCharacters', InvalidCharactersDirective.factory); |
| 92 | directiveModule.directive('perfectScrollbar', PerfectScrollerDirective.factory); |
| 93 | directiveModule.directive('expandCollapse', ExpandCollapseDirective.factory); |
| 94 | directiveModule.directive('sdcModal', SdcModalDirective.factory); |
| 95 | directiveModule.directive('fileOpener', FileOpenerDirective.factory); |
| 96 | directiveModule.directive('fileUpload', FileUploadDirective.factory); |
| 97 | directiveModule.directive('structureTree', StructureTreeDirective.factory); |
| 98 | directiveModule.directive('sdcSmartTooltip', SmartTooltipDirective.factory); |
| 99 | directiveModule.directive('printGraphScreen', PrintGraphScreenDirective.factory); |
| 100 | directiveModule.directive('sdcTag', TagDirective.factory); |
| 101 | directiveModule.directive('sdcTags', SdcTagsDirective.factory); |
| 102 | directiveModule.directive('sdcKeyboardEvents', SdcKeyboardEventsDirective.factory); |
| 103 | directiveModule.directive('expandCollapseMenuBox', ExpandCollapseMenuBoxDirective.factory); |
| 104 | directiveModule.directive('punchOut', PunchOutDirective.factory); |
| 105 | directiveModule.directive('customValidation', CustomValidationDirective.factory); |
| 106 | directiveModule.directive('ecompHeader', EcompHeaderDirective.factory); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 107 | directiveModule.directive('editNamePopover', EditNamePopoverDirective.factory); |
| 108 | directiveModule.directive('fieldsStructure', DataTypeFieldsStructureDirective.factory); |
| 109 | directiveModule.directive('typeMap', TypeMapDirective.factory); |
| 110 | directiveModule.directive('typeList', TypeListDirective.factory); |
| 111 | directiveModule.directive('selectFieldsStructure', SelectDataTypeFieldsStructureDirective.factory); |
| 112 | directiveModule.directive('selectTypeMap', SelectTypeMapDirective.factory); |
| 113 | directiveModule.directive('selectTypeList', SelectTypeListDirective.factory); |
| 114 | directiveModule.directive('infoTooltip', InfoTooltipDirective.factory); |
| 115 | directiveModule.directive('validationOnLoad', ValidationOnLoadDirective.factory); |
| 116 | directiveModule.directive('sdcTabs', SdcTabsDirective.factory); |
| 117 | directiveModule.directive('sdcSingleTab', SdcSingleTabDirective.factory); |
| 118 | directiveModule.directive('innerSdcSingleTab', InnerSdcSingleTabDirective.factory); |
| 119 | directiveModule.directive('jsonExportExcel', JsonExportExcelDirective.factory); |
| 120 | directiveModule.directive('expandCollapseListHeader', ExpandCollapseListHeaderDirective.factory); |
| 121 | // |
| 122 | // // Layouts |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 123 | directiveModule.directive('topProgress', TopProgressDirective.factory); |
| 124 | // |
| 125 | // // Elements |
| 126 | directiveModule.directive('sdcCheckbox', CheckboxElementDirective.factory); |
| 127 | directiveModule.directive('sdcRadioButton', RadiobuttonElementDirective.factory); |
| 128 | // |
| 129 | // // Events |
| 130 | directiveModule.directive('onLastRepeat', OnLastRepeatDirective.factory); |
| 131 | // |
| 132 | // //Inputs & Properties |
| 133 | directiveModule.directive('inputRow', InputRowDirective.factory); |
| 134 | directiveModule.directive('propertyRow', PropertyRowDirective.factory); |
| 135 | // |
| 136 | // |
| 137 | // // ------------------------------------------- Composition & Deployment Graphs------------------------------------------// |
| 138 | // |
| 139 | // //Util service for Graph |
| 140 | directiveModule.service('NodesFactory', NodesFactory); |
| 141 | directiveModule.service('LinksFactory', LinksFactory); |
| 142 | directiveModule.service('ImageCreatorService', ImageCreatorService); |
| 143 | // |
| 144 | // //composition |
| 145 | directiveModule.directive('palette', Palette.factory); |
| 146 | directiveModule.directive('compositionGraph', CompositionGraph.factory); |
| 147 | directiveModule.directive('relationMenu', RelationMenuDirective.factory); |
| 148 | //directiveModule.directive('assetPopover', AssetPopoverDirective.factory); |
| 149 | // |
| 150 | // //deployment |
| 151 | directiveModule.directive('deploymentGraph', DeploymentGraph.factory); |
| 152 | // |
| 153 | // //Graph Utils - Common |
| 154 | directiveModule.service('CommonGraphUtils', CommonGraphUtils); |
| 155 | // |
| 156 | // //Composition Graph Utils |
| 157 | directiveModule.service('CompositionGraphNodesUtils', CompositionGraphNodesUtils); |
| 158 | directiveModule.service('CompositionGraphGeneralUtils', CompositionGraphGeneralUtils); |
| 159 | directiveModule.service('CompositionGraphLinkUtils', CompositionGraphLinkUtils); |
| 160 | directiveModule.service('CompositionGraphPaletteUtils', CompositionGraphPaletteUtils); |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 161 | directiveModule.service('CompositionGraphZoneUtils', CompositionGraphZoneUtils); |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 162 | directiveModule.service('MatchCapabilitiesRequirementsUtils', MatchCapabilitiesRequirementsUtils); |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 163 | directiveModule.service('ServicePathGraphUtils', ServicePathGraphUtils); |
| 164 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 165 | // |
| 166 | // //Deployment Graph Utils |
| 167 | directiveModule.service('DeploymentGraphGeneralUtils', DeploymentGraphGeneralUtils); |
| 168 | |
| 169 | |
| 170 | //Compoisiton right tab directives |
| 171 | directiveModule.directive('capabilitiesList', CapabilitiesListDirective.factory); |
| 172 | directiveModule.directive('requirementsList', RequirementsListDirective.factory); |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 173 | |
| 174 | |
| 175 | // *** NG2 Components (downgraded) *** // |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 176 | import { downgradeComponent } from "@angular/upgrade/static"; |
| 177 | import { MenuListNg2Component } from "../ng2/components/downgrade-wrappers/menu-list-ng2/menu-list-ng2.component"; |
| 178 | import { TopNavComponent } from "../ng2/components/layout/top-nav/top-nav.component"; |
| 179 | import { ZoneContainerComponent } from "../ng2/components/ui/canvas-zone/zone-container.component"; |
| 180 | import { ZoneInstanceComponent } from "../ng2/components/ui/canvas-zone/zone-instance/zone-instance.component"; |
| 181 | import { PropertiesAssignmentComponent } from "../ng2/pages/properties-assignment/properties-assignment.page.component"; |
| 182 | import { SearchWithAutoCompleteComponent } from "../ng2/components/ui/search-with-autocomplete/search-with-autocomplete.component"; |
| 183 | import { PalettePopupPanelComponent } from "../ng2/components/ui/palette-popup-panel/palette-popup-panel.component"; |
| 184 | import { ServicePathComponent } from '../ng2/components/logic/service-path/service-path.component'; |
| 185 | import { ServicePathSelectorComponent } from '../ng2/components/logic/service-path-selector/service-path-selector.component'; |
Arielk | 802bd2a | 2018-04-16 15:37:39 +0300 | [diff] [blame] | 186 | import { InterfaceOperationComponent } from '../ng2/pages/interface-operation/interface-operation.page.component'; |
| 187 | import { PluginFrameComponent } from "../ng2/components/ui/plugin/plugin-frame.component"; |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 188 | |
| 189 | directiveModule.directive('menuListNg2', downgradeComponent({ |
| 190 | component: MenuListNg2Component, |
| 191 | inputs: ['props'] |
| 192 | }) as angular.IDirectiveFactory); |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 193 | |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 194 | directiveModule.directive('topNav', downgradeComponent({ |
| 195 | component: TopNavComponent, |
| 196 | inputs: ['version', 'menuModel', 'topLvlSelectedIndex', 'hideSearch', 'searchTerm', 'notificationIconCallback'], |
| 197 | outputs: ['searchTermChange'] |
| 198 | }) as ng.IDirectiveFactory); |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 199 | |
| 200 | directiveModule.directive('ng2ZoneContainer', downgradeComponent({ |
| 201 | component: ZoneContainerComponent, |
| 202 | inputs: ['title', 'count', 'class', 'showZone', 'minifyZone'], |
| 203 | outputs: [] |
| 204 | }) as angular.IDirectiveFactory); |
| 205 | |
| 206 | directiveModule.directive('ng2ZoneInstance', downgradeComponent({ |
| 207 | component: ZoneInstanceComponent, |
| 208 | inputs: ['config', 'isActive', 'activeInstanceMode', 'defaultIconText'], |
| 209 | outputs: ['modeChange'] |
| 210 | }) as angular.IDirectiveFactory); |
| 211 | |
| 212 | directiveModule.directive('propertiesAssignment', downgradeComponent({ |
| 213 | component: PropertiesAssignmentComponent |
| 214 | }) as angular.IDirectiveFactory); |
| 215 | |
| 216 | directiveModule.directive('ng2SearchWithAutocomplete', downgradeComponent({ |
| 217 | component: SearchWithAutoCompleteComponent, |
| 218 | inputs: ['searchPlaceholder', 'searchBarClass', 'autoCompleteValues'], |
| 219 | outputs: ['searchChanged', 'searchButtonClicked'] |
| 220 | }) as angular.IDirectiveFactory); |
| 221 | |
| 222 | directiveModule.directive('ng2PaletteAnimation', downgradeComponent({ |
| 223 | component: PaletteAnimationComponent, |
| 224 | inputs: ['from', 'to', 'icon' ], |
| 225 | outputs: [] |
| 226 | }) as angular.IDirectiveFactory); |
| 227 | |
| 228 | directiveModule.directive('ng2PalettePopupPanel', downgradeComponent({ |
| 229 | component: PalettePopupPanelComponent, |
| 230 | inputs: [], |
| 231 | outputs: [] |
| 232 | }) as angular.IDirectiveFactory); |
| 233 | |
| 234 | directiveModule.directive('ng2ServicePath', downgradeComponent({ |
| 235 | component: ServicePathComponent, |
| 236 | inputs: ['onCreate', 'service'], |
| 237 | outputs: [] |
| 238 | }) as angular.IDirectiveFactory); |
| 239 | |
| 240 | directiveModule.directive('ng2ServicePathSelector', downgradeComponent({ |
| 241 | component: ServicePathSelectorComponent, |
| 242 | inputs: ['drawPath', 'deletePaths', 'service', 'selectedPathId'], |
| 243 | outputs: [] |
| 244 | }) as angular.IDirectiveFactory); |
Idan Amit | 7363f3d | 2018-03-21 12:04:57 +0200 | [diff] [blame] | 245 | |
Arielk | 802bd2a | 2018-04-16 15:37:39 +0300 | [diff] [blame] | 246 | directiveModule.directive('ng2InterfaceOperation', downgradeComponent({ |
| 247 | component: InterfaceOperationComponent, |
| 248 | inputs: ['component', 'readonly', 'state'], |
| 249 | outputs: [] |
| 250 | }) as angular.IDirectiveFactory); |
| 251 | |
Idan Amit | 7363f3d | 2018-03-21 12:04:57 +0200 | [diff] [blame] | 252 | directiveModule.directive('pluginFrame', downgradeComponent( { |
| 253 | component: PluginFrameComponent, |
| 254 | inputs: ['plugin', 'queryParams'], |
| 255 | outputs: ['onLoadingDone'] |
| 256 | }) as angular.IDirectiveFactory); |