blob: 56efcdc6832fe7927695dd2022b00f710a0084bc [file] [log] [blame]
Michael Landodd603392017-07-12 00:54:52 +03001/*-
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 Amit7363f3d2018-03-21 12:04:57 +020010 *
Michael Landodd603392017-07-12 00:54:52 +030011 * http://www.apache.org/licenses/LICENSE-2.0
Idan Amit7363f3d2018-03-21 12:04:57 +020012 *
Michael Landodd603392017-07-12 00:54:52 +030013 * 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 Landoed64b5e2017-06-09 03:19:04 +030021import {ClickedOutsideDirective} from "../directives/clicked-outside/clicked-outside-directive";
22import {LoaderDirective} from "../directives/loader/loader-directive";
23import {UserHeaderDetailsDirective} from "../directives/user-header-details/user-header-details-directive";
24import {FileTypeDirective} from "../directives/file-type/file-type";
25import {DownloadArtifactDirective} from "../directives/download-artifact/download-artifact";
26import {EllipsisDirective} from "../directives/ellipsis/ellipsis-directive";
27import {InvalidCharactersDirective} from "../directives/invalid-characters/invalid-characters";
28import {ExpandCollapseDirective} from "../directives/utils/expand-collapse/expand-collapse";
29import {PerfectScrollerDirective} from "../directives/perfect-scrollbar/angular-perfect-scrollbar";
30import {SdcModalDirective} from "../directives/modal/sdc-modal";
31import {FileOpenerDirective} from "../directives/file-opener/file-opener";
32import {FileUploadDirective} from "../directives/file-upload/file-upload";
33import {StructureTreeDirective} from "../directives/structure-tree/structure-tree-directive";
34import {SmartTooltipDirective} from "../directives/utils/smart-tooltip/smart-tooltip";
Michael Landoed64b5e2017-06-09 03:19:04 +030035import {TagDirective} from "../directives/tag/tag-directive";
36import {SdcTagsDirective} from "../directives/utils/sdc-tags/sdc-tags";
37import {SdcKeyboardEventsDirective} from "../directives/utils/sdc-keyboard-events/sdc-keyboard-events";
38import {ExpandCollapseMenuBoxDirective} from "../directives/utils/expand-collapse-menu-box/expand-collaps-menu-box";
39import {PunchOutDirective} from "../directives/punch-out/punch-out";
40import {CustomValidationDirective} from "../directives/custom-validation/custom-validation";
41import {EcompHeaderDirective} from "../directives/ecomp-header/ecomp-header";
Michael Landoed64b5e2017-06-09 03:19:04 +030042import {EditNamePopoverDirective} from "../directives/edit-name-popover/edit-name-popover-directive";
43import {DataTypeFieldsStructureDirective} from "../directives/property-types/data-type-fields-structure/data-type-fields-structure";
44import {TypeMapDirective} from "../directives/property-types/type-map/type-map-directive";
45import {TypeListDirective} from "../directives/property-types/type-list/type-list-directive";
46import {SelectDataTypeFieldsStructureDirective} from "../directives/select-property-types/select-data-type-fields-structure/select-data-type-fields-structure";
47import {SelectTypeMapDirective} from "../directives/select-property-types/select-type-map/select-type-map-directive";
48import {SelectTypeListDirective} from "../directives/select-property-types/select-type-list/select-type-list-directive";
49import {ValidationOnLoadDirective} from "../directives/utils/validation-on-load/validation-on-load";
50import {InfoTooltipDirective} from "../directives/info-tooltip/info-tooltip";
51import {SdcTabsDirective} from "../directives/sdc-tabs/sdc-tabs-directive";
ys969316a9fce2020-01-19 13:50:02 +020052import {
53 SdcSingleTabDirective,
54 InnerSdcSingleTabDirective
55} from "../directives/sdc-tabs/sdc-single-tab/sdc-single-tab-directive";
Michael Landoed64b5e2017-06-09 03:19:04 +030056import {ExpandCollapseListHeaderDirective} from "../directives/utils/expand-collapse-list-header/expand-collapse-list-header";
57import {JsonExportExcelDirective} from "../directives/export-json-to-excel/export-json-to-excel";
Michael Landoed64b5e2017-06-09 03:19:04 +030058import {TopProgressDirective} from "../directives/layout/top-progress/top-progress";
59import {CheckboxElementDirective} from "../directives/elements/checkbox/checkbox";
60import {RadiobuttonElementDirective} from "../directives/elements/radiobutton/radiobutton";
61import {OnLastRepeatDirective} from "../directives/events/on-last-repeat/on-last-repeat";
62import {InputRowDirective} from "../directives/inputs-and-properties/inputs/input-row-directive";
63import {PropertyRowDirective} from "../directives/inputs-and-properties/properties/property-row-directive";
64import {NodesFactory} from "../models/graph/nodes/nodes-factory";
65import {LinksFactory} from "../models/graph/graph-links/links-factory";
Michael Landoed64b5e2017-06-09 03:19:04 +030066import {CapabilitiesListDirective} from "../directives/capabilities-and-requirements/capability/capabilities-list-directive";
67import {RequirementsListDirective} from "../directives/capabilities-and-requirements/requirement/requirements-list-directive";
Michael Lando5b593492018-07-29 16:13:45 +030068import {PreventDoubleClickDirective} from "../directives/prevent-double-click/prevent-double-click";
Michael Landoed64b5e2017-06-09 03:19:04 +030069
70let moduleName:string = 'Sdc.Directives';
71let directiveModule:ng.IModule = angular.module(moduleName, []);
72
73directiveModule.directive('clickedOutside', ClickedOutsideDirective.factory);
74directiveModule.directive('loader', LoaderDirective.factory);
75directiveModule.directive('userHeaderDetails', UserHeaderDetailsDirective.factory);
76directiveModule.directive('ellipsis', EllipsisDirective.factory);
77directiveModule.directive('downloadArtifact', DownloadArtifactDirective.factory);
78directiveModule.directive('fileType', FileTypeDirective.factory);
79directiveModule.directive('invalidCharacters', InvalidCharactersDirective.factory);
80directiveModule.directive('perfectScrollbar', PerfectScrollerDirective.factory);
81directiveModule.directive('expandCollapse', ExpandCollapseDirective.factory);
Michael Lando5b593492018-07-29 16:13:45 +030082directiveModule.directive('ng1Modal', SdcModalDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +030083directiveModule.directive('fileOpener', FileOpenerDirective.factory);
84directiveModule.directive('fileUpload', FileUploadDirective.factory);
85directiveModule.directive('structureTree', StructureTreeDirective.factory);
86directiveModule.directive('sdcSmartTooltip', SmartTooltipDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +030087directiveModule.directive('sdcTag', TagDirective.factory);
88directiveModule.directive('sdcTags', SdcTagsDirective.factory);
89directiveModule.directive('sdcKeyboardEvents', SdcKeyboardEventsDirective.factory);
90directiveModule.directive('expandCollapseMenuBox', ExpandCollapseMenuBoxDirective.factory);
91directiveModule.directive('punchOut', PunchOutDirective.factory);
92directiveModule.directive('customValidation', CustomValidationDirective.factory);
93directiveModule.directive('ecompHeader', EcompHeaderDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +030094directiveModule.directive('editNamePopover', EditNamePopoverDirective.factory);
95directiveModule.directive('fieldsStructure', DataTypeFieldsStructureDirective.factory);
96directiveModule.directive('typeMap', TypeMapDirective.factory);
97directiveModule.directive('typeList', TypeListDirective.factory);
98directiveModule.directive('selectFieldsStructure', SelectDataTypeFieldsStructureDirective.factory);
99directiveModule.directive('selectTypeMap', SelectTypeMapDirective.factory);
100directiveModule.directive('selectTypeList', SelectTypeListDirective.factory);
101directiveModule.directive('infoTooltip', InfoTooltipDirective.factory);
102directiveModule.directive('validationOnLoad', ValidationOnLoadDirective.factory);
Michael Lando5b593492018-07-29 16:13:45 +0300103directiveModule.directive('ng1Tabs', SdcTabsDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300104directiveModule.directive('sdcSingleTab', SdcSingleTabDirective.factory);
105directiveModule.directive('innerSdcSingleTab', InnerSdcSingleTabDirective.factory);
106directiveModule.directive('jsonExportExcel', JsonExportExcelDirective.factory);
107directiveModule.directive('expandCollapseListHeader', ExpandCollapseListHeaderDirective.factory);
Michael Lando5b593492018-07-29 16:13:45 +0300108directiveModule.directive('preventDoubleClick', PreventDoubleClickDirective.factory);
109//
Michael Landoed64b5e2017-06-09 03:19:04 +0300110//
111// // Layouts
Michael Landoed64b5e2017-06-09 03:19:04 +0300112directiveModule.directive('topProgress', TopProgressDirective.factory);
113//
114// // Elements
Michael Lando5b593492018-07-29 16:13:45 +0300115directiveModule.directive('ng1Checkbox', CheckboxElementDirective.factory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300116directiveModule.directive('sdcRadioButton', RadiobuttonElementDirective.factory);
117//
118// // Events
119directiveModule.directive('onLastRepeat', OnLastRepeatDirective.factory);
120//
121// //Inputs & Properties
122directiveModule.directive('inputRow', InputRowDirective.factory);
123directiveModule.directive('propertyRow', PropertyRowDirective.factory);
124//
125//
126// // ------------------------------------------- Composition & Deployment Graphs------------------------------------------//
127//
128// //Util service for Graph
129directiveModule.service('NodesFactory', NodesFactory);
130directiveModule.service('LinksFactory', LinksFactory);
Michael Landoed64b5e2017-06-09 03:19:04 +0300131
132
133//Compoisiton right tab directives
134directiveModule.directive('capabilitiesList', CapabilitiesListDirective.factory);
135directiveModule.directive('requirementsList', RequirementsListDirective.factory);
Tal Gitelman51d50f02017-12-10 18:55:03 +0200136
137
138// *** NG2 Components (downgraded) *** //
ys969316a9fce2020-01-19 13:50:02 +0200139import {downgradeComponent} from "@angular/upgrade/static";
140import {MenuListNg2Component} from "../ng2/components/downgrade-wrappers/menu-list-ng2/menu-list-ng2.component";
141import {TopNavComponent} from "../ng2/components/layout/top-nav/top-nav.component";
142import {ZoneContainerComponent} from "../ng2/pages/composition/graph/canvas-zone/zone-container.component";
143import {ZoneInstanceComponent} from "../ng2/pages/composition/graph/canvas-zone/zone-instance/zone-instance.component";
144import {CompositionPanelComponent} from 'app/ng2/pages/composition/panel/composition-panel.component';
145import {PropertiesAssignmentComponent} from "../ng2/pages/properties-assignment/properties-assignment.page.component";
146import {SearchWithAutoCompleteComponent} from "../ng2/components/ui/search-with-autocomplete/search-with-autocomplete.component";
147import {PalettePopupPanelComponent} from "../ng2/pages/composition/palette/palette-popup-panel/palette-popup-panel.component";
148import {ServicePathSelectorComponent} from '../ng2/pages/composition/graph/service-path-selector/service-path-selector.component';
149import {MultilineEllipsisComponent} from "../ng2/shared/multiline-ellipsis/multiline-ellipsis.component";
Arielk802bd2a2018-04-16 15:37:39 +0300150import { InterfaceOperationComponent } from '../ng2/pages/interface-operation/interface-operation.page.component';
151import { PluginFrameComponent } from "../ng2/components/ui/plugin/plugin-frame.component";
ys969316a9fce2020-01-19 13:50:02 +0200152import {TileComponent} from "../ng2/components/ui/tile/tile.component";
153import {CompositionPageComponent} from "../ng2/pages/composition/composition-page.component";
154import {CatalogComponent} from "../ng2/pages/catalog/catalog.component";
155import {HomeComponent} from "../ng2/pages/home/home.component";
156import {PluginContextViewPageComponent} from "../ng2/pages/plugins/plugin-context-view/plugin-context-view.page.component";
157import {PluginTabViewPageComponent} from "../ng2/pages/plugins/plugin-tab-view/plugin-tab-view.page.component";
158import {CompositionGraphComponent} from "../ng2/pages/composition/graph/composition-graph.component";
159import {DeploymentPageComponent} from "../ng2/pages/workspace/deployment/deployment-page.component";
160import {ActivityLogComponent} from "../ng2/pages/workspace/activity-log/activity-log.component";
161import {ToscaArtifactPageComponent} from "../ng2/pages/workspace/tosca-artifacts/tosca-artifact-page.component";
162import {InformationArtifactPageComponent} from "../ng2/pages/workspace/information-artifact/information-artifact-page.component";
163import {AttributesComponent} from "../ng2/pages/workspace/attributes/attributes.component";
164import {DeploymentArtifactsPageComponent} from "../ng2/pages/workspace/deployment-artifacts/deployment-artifacts-page.component";
165import { ReqAndCapabilitiesComponent } from "../ng2/pages/workspace/req-and-capabilities/req-and-capabilities.component";
166import { DistributionComponent } from '../ng2/pages/workspace/disribution/distribution.component';
Tal Gitelman51d50f02017-12-10 18:55:03 +0200167
168directiveModule.directive('menuListNg2', downgradeComponent({
169 component: MenuListNg2Component,
170 inputs: ['props']
171}) as angular.IDirectiveFactory);
Michael Landoa5445102018-03-04 14:53:33 +0200172
Tal Gitelman51d50f02017-12-10 18:55:03 +0200173directiveModule.directive('topNav', downgradeComponent({
174 component: TopNavComponent,
Michael Lando5b593492018-07-29 16:13:45 +0300175 inputs: ['version', 'menuModel', 'topLvlSelectedIndex', 'hideSearch', 'searchTerm', 'notificationIconCallback', 'unsavedChanges', 'unsavedChangesCallback'],
Tal Gitelman51d50f02017-12-10 18:55:03 +0200176 outputs: ['searchTermChange']
177}) as ng.IDirectiveFactory);
Michael Landoa5445102018-03-04 14:53:33 +0200178
179directiveModule.directive('ng2ZoneContainer', downgradeComponent({
180 component: ZoneContainerComponent,
ys969316a9fce2020-01-19 13:50:02 +0200181 inputs: ['title', 'count', 'type', 'visible', 'minimized'],
Michael Lando5b593492018-07-29 16:13:45 +0300182 outputs: ['minimize', 'backgroundClick']
Michael Landoa5445102018-03-04 14:53:33 +0200183}) as angular.IDirectiveFactory);
184
185directiveModule.directive('ng2ZoneInstance', downgradeComponent({
ys969316a9fce2020-01-19 13:50:02 +0200186 component: ZoneInstanceComponent,
187 inputs: ['zoneInstance', 'isActive', 'activeInstanceMode', 'defaultIconText', 'isViewOnly', 'hidden', 'forceSave'],
188 outputs: ['modeChange', 'tagHandleClick', 'assignmentSaveStart', 'assignmentSaveComplete']
Michael Lando5b593492018-07-29 16:13:45 +0300189}) as angular.IDirectiveFactory);
190
191directiveModule.directive('ng2CompositionPanel', downgradeComponent({
192 component: CompositionPanelComponent,
193 inputs: ['isViewOnly', 'isLoading', 'isCertified', 'selectedZoneInstanceId', 'selectedZoneInstanceType', 'selectedZoneInstanceName', 'topologyTemplate'],
Michael Landoa5445102018-03-04 14:53:33 +0200194}) as angular.IDirectiveFactory);
195
196directiveModule.directive('propertiesAssignment', downgradeComponent({
197 component: PropertiesAssignmentComponent
198}) as angular.IDirectiveFactory);
199
ys969316a9fce2020-01-19 13:50:02 +0200200directiveModule.directive('compositionPage', downgradeComponent({
201 component: CompositionPageComponent
202}) as angular.IDirectiveFactory);
203
204directiveModule.directive('activityLog', downgradeComponent({
205 component: ActivityLogComponent
206}) as angular.IDirectiveFactory);
207
208directiveModule.directive('distribution', downgradeComponent({
209 component: DistributionComponent
210}) as angular.IDirectiveFactory);
211
212directiveModule.directive('attributes', downgradeComponent({
213 component: AttributesComponent
214}) as angular.IDirectiveFactory);
215
216directiveModule.directive('reqAndCapabilities', downgradeComponent({
217 component: ReqAndCapabilitiesComponent
218}) as angular.IDirectiveFactory);
219
Michael Landoa5445102018-03-04 14:53:33 +0200220directiveModule.directive('ng2SearchWithAutocomplete', downgradeComponent({
221 component: SearchWithAutoCompleteComponent,
222 inputs: ['searchPlaceholder', 'searchBarClass', 'autoCompleteValues'],
223 outputs: ['searchChanged', 'searchButtonClicked']
224}) as angular.IDirectiveFactory);
225
Michael Landoa5445102018-03-04 14:53:33 +0200226directiveModule.directive('ng2PalettePopupPanel', downgradeComponent({
227 component: PalettePopupPanelComponent,
228 inputs: [],
229 outputs: []
230}) as angular.IDirectiveFactory);
231
Michael Landoa5445102018-03-04 14:53:33 +0200232directiveModule.directive('ng2ServicePathSelector', downgradeComponent({
233 component: ServicePathSelectorComponent,
234 inputs: ['drawPath', 'deletePaths', 'service', 'selectedPathId'],
235 outputs: []
236}) as angular.IDirectiveFactory);
Idan Amit7363f3d2018-03-21 12:04:57 +0200237
Ofir Sonsino2c579cb2020-03-22 10:46:13 +0200238directiveModule.directive('interfaceOperation', downgradeComponent({
Arielk802bd2a2018-04-16 15:37:39 +0300239 component: InterfaceOperationComponent,
Arielkbce89862018-05-30 14:52:00 +0300240 inputs: ['component', 'readonly'],
Arielk802bd2a2018-04-16 15:37:39 +0300241 outputs: []
242}) as angular.IDirectiveFactory);
243
Michael Lando5b593492018-07-29 16:13:45 +0300244directiveModule.directive('ng2MultilineEllipsis', downgradeComponent({
245 component: MultilineEllipsisComponent,
246 inputs: ['lines', 'lineHeight', 'className'],
247 outputs: ['hasEllipsisChanged']
248}) as angular.IDirectiveFactory);
249
250directiveModule.directive('ng2UiTile', downgradeComponent({
251 component: TileComponent,
252 inputs: ['component'],
253 outputs: ['onTileClick']
254}) as angular.IDirectiveFactory);
255
ys969316a9fce2020-01-19 13:50:02 +0200256directiveModule.directive('pluginFrame', downgradeComponent({
Idan Amit7363f3d2018-03-21 12:04:57 +0200257 component: PluginFrameComponent,
258 inputs: ['plugin', 'queryParams'],
259 outputs: ['onLoadingDone']
260}) as angular.IDirectiveFactory);
ys969316a9fce2020-01-19 13:50:02 +0200261
262directiveModule.directive('catalogPage', downgradeComponent({
263 component: CatalogComponent,
264 inputs: [],
265 outputs: []
266}) as angular.IDirectiveFactory);
267
268directiveModule.directive('homePage', downgradeComponent({
269 component: HomeComponent,
270 inputs: [],
271 outputs: []
272}) as angular.IDirectiveFactory);
273
274directiveModule.directive('pluginContextView', downgradeComponent({
275 component: PluginContextViewPageComponent,
276 inputs: [],
277 outputs: []
278}) as angular.IDirectiveFactory);
279
280directiveModule.directive('pluginTabView', downgradeComponent({
281 component: PluginTabViewPageComponent,
282 inputs: [],
283 outputs: []
284}) as angular.IDirectiveFactory);
285
286directiveModule.directive('compositionGraph', downgradeComponent({
287 component: CompositionGraphComponent,
288 inputs: ['topologyTemplate', 'isViewOnly'],
289 outputs: []
290}) as angular.IDirectiveFactory);
291directiveModule.directive('toscaArtifactPage', downgradeComponent({
292 component: ToscaArtifactPageComponent,
293 inputs: [],
294 outputs: []
295}) as angular.IDirectiveFactory);
296
297directiveModule.directive('deploymentPage', downgradeComponent({
298 component: DeploymentPageComponent,
299 inputs: [],
300 outputs: []
301}) as angular.IDirectiveFactory);
302
303directiveModule.directive('informationArtifactPage', downgradeComponent({
304 component: InformationArtifactPageComponent,
305 inputs: [],
306 outputs: []
307}) as angular.IDirectiveFactory);
308directiveModule.directive('deploymentArtifactPage', downgradeComponent({
309 component: DeploymentArtifactsPageComponent,
310 inputs: [],
311 outputs: []
312}) as angular.IDirectiveFactory);