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 |
| 10 | * |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | * |
| 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'; |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 186 | |
| 187 | directiveModule.directive('menuListNg2', downgradeComponent({ |
| 188 | component: MenuListNg2Component, |
| 189 | inputs: ['props'] |
| 190 | }) as angular.IDirectiveFactory); |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 191 | |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 192 | directiveModule.directive('topNav', downgradeComponent({ |
| 193 | component: TopNavComponent, |
| 194 | inputs: ['version', 'menuModel', 'topLvlSelectedIndex', 'hideSearch', 'searchTerm', 'notificationIconCallback'], |
| 195 | outputs: ['searchTermChange'] |
| 196 | }) as ng.IDirectiveFactory); |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 197 | |
| 198 | directiveModule.directive('ng2ZoneContainer', downgradeComponent({ |
| 199 | component: ZoneContainerComponent, |
| 200 | inputs: ['title', 'count', 'class', 'showZone', 'minifyZone'], |
| 201 | outputs: [] |
| 202 | }) as angular.IDirectiveFactory); |
| 203 | |
| 204 | directiveModule.directive('ng2ZoneInstance', downgradeComponent({ |
| 205 | component: ZoneInstanceComponent, |
| 206 | inputs: ['config', 'isActive', 'activeInstanceMode', 'defaultIconText'], |
| 207 | outputs: ['modeChange'] |
| 208 | }) as angular.IDirectiveFactory); |
| 209 | |
| 210 | directiveModule.directive('propertiesAssignment', downgradeComponent({ |
| 211 | component: PropertiesAssignmentComponent |
| 212 | }) as angular.IDirectiveFactory); |
| 213 | |
| 214 | directiveModule.directive('ng2SearchWithAutocomplete', downgradeComponent({ |
| 215 | component: SearchWithAutoCompleteComponent, |
| 216 | inputs: ['searchPlaceholder', 'searchBarClass', 'autoCompleteValues'], |
| 217 | outputs: ['searchChanged', 'searchButtonClicked'] |
| 218 | }) as angular.IDirectiveFactory); |
| 219 | |
| 220 | directiveModule.directive('ng2PaletteAnimation', downgradeComponent({ |
| 221 | component: PaletteAnimationComponent, |
| 222 | inputs: ['from', 'to', 'icon' ], |
| 223 | outputs: [] |
| 224 | }) as angular.IDirectiveFactory); |
| 225 | |
| 226 | directiveModule.directive('ng2PalettePopupPanel', downgradeComponent({ |
| 227 | component: PalettePopupPanelComponent, |
| 228 | inputs: [], |
| 229 | outputs: [] |
| 230 | }) as angular.IDirectiveFactory); |
| 231 | |
| 232 | directiveModule.directive('ng2ServicePath', downgradeComponent({ |
| 233 | component: ServicePathComponent, |
| 234 | inputs: ['onCreate', 'service'], |
| 235 | outputs: [] |
| 236 | }) as angular.IDirectiveFactory); |
| 237 | |
| 238 | directiveModule.directive('ng2ServicePathSelector', downgradeComponent({ |
| 239 | component: ServicePathSelectorComponent, |
| 240 | inputs: ['drawPath', 'deletePaths', 'service', 'selectedPathId'], |
| 241 | outputs: [] |
| 242 | }) as angular.IDirectiveFactory); |