From 451a3400b76511393c62a444f588a4ed15f4a549 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Sun, 19 Feb 2017 10:28:42 +0200 Subject: Initial OpenECOMP SDC commit Change-Id: I0924d5a6ae9cdc161ae17c68d3689a30d10f407b Signed-off-by: Michael Lando --- catalog-ui/Gruntfile.js | 807 + catalog-ui/SETTING-ENVIRONMENT.md | 36 + catalog-ui/SETTING-MOCK-SERVER.md | 53 + catalog-ui/app/_favicon.png | Bin 0 -> 6364 bytes catalog-ui/app/index.html | 392 + catalog-ui/app/languages/en_US_OS.json | 420 + catalog-ui/app/scripts/app.ts | 936 + .../clicked-outside/clicked-outside-directive.ts | 131 + .../custom-validation/custom-validation.ts | 55 + .../download-artifact/download-artifact.ts | 141 + .../directives/ecomp-header/ecomp-header.html | 73 + .../directives/ecomp-header/ecomp-header.less | 296 + .../directives/ecomp-header/ecomp-header.ts | 235 + .../edit-module-name-popover.html | 31 + .../edit-name-popover-directive.ts | 98 + .../edit-name-popover/edit-name-popover-view.html | 1 + .../edit-name-popover/edit-name-popover.less | 71 + .../directives/elements/checkbox/checkbox.html | 13 + .../directives/elements/checkbox/checkbox.less | 35 + .../directives/elements/checkbox/checkbox.ts | 66 + .../elements/radiobutton/radiobutton.html | 5 + .../elements/radiobutton/radiobutton.less | 0 .../directives/elements/radiobutton/radiobutton.ts | 71 + .../directives/ellipsis/ellipsis-directive.html | 7 + .../directives/ellipsis/ellipsis-directive.less | 10 + .../directives/ellipsis/ellipsis-directive.ts | 80 + .../events/on-last-repeat/on-last-repeat.ts | 61 + .../directives/file-opener/file-opener.html | 3 + .../scripts/directives/file-opener/file-opener.ts | 77 + .../app/scripts/directives/file-type/file-type.ts | 66 + .../directives/file-upload/file-upload.html | 22 + .../directives/file-upload/file-upload.less | 75 + .../scripts/directives/file-upload/file-upload.ts | 134 + .../graphs-v2/common/common-graph-utils.ts | 361 + .../style/component-instances-nodes-style.ts | 259 + .../graphs-v2/common/style/module-node-style.ts | 92 + .../composition-graph.directive.ts | 555 + .../composition-graph/composition-graph.html | 22 + .../composition-graph/composition-graph.less | 14 + .../utils/composition-graph-general-utils.ts | 243 + .../utils/composition-graph-links-utils.ts | 347 + .../utils/composition-graph-nodes-utils.ts | 220 + .../utils/match-capability-requierment-utils.ts | 265 + .../deployment-graph/deployment-graph.directive.ts | 114 + .../deployment-graph/deployment-graph.html | 2 + .../deployment-graph/deployment-graph.less | 14 + .../deployment-graph-general-utils.ts | 24 + .../image-creator/image-creator.service.ts | 46 + .../palette/interfaces/i-dragdrop-event.d.ts | 7 + .../graphs-v2/palette/palette.directive.ts | 327 + .../directives/graphs-v2/palette/palette.html | 59 + .../directives/graphs-v2/palette/palette.less | 92 + .../graphs-v2/relation-menu/relation-menu.html | 63 + .../graphs-v2/relation-menu/relation-menu.less | 118 + .../graphs-v2/relation-menu/relation-menu.ts | 113 + .../directives/info-tooltip/info-tooltip.html | 10 + .../directives/info-tooltip/info-tooltip.less | 39 + .../directives/info-tooltip/info-tooltip.ts | 60 + .../invalid-characters/invalid-characters.ts | 72 + .../scripts/directives/layout/top-nav/top-nav.html | 54 + .../scripts/directives/layout/top-nav/top-nav.less | 218 + .../scripts/directives/layout/top-nav/top-nav.ts | 155 + .../layout/top-progress/top-progress.html | 22 + .../layout/top-progress/top-progress.less | 58 + .../directives/layout/top-progress/top-progress.ts | 57 + .../directives/loader/loader-directive.html | 4 + .../directives/loader/loader-directive.less | 74 + .../scripts/directives/loader/loader-directive.ts | 155 + .../app/scripts/directives/modal/sdc-modal.html | 18 + .../app/scripts/directives/modal/sdc-modal.less | 10 + .../app/scripts/directives/modal/sdc-modal.ts | 103 + .../directives/page-scroller/page-scroller.html | 22 + .../directives/page-scroller/page-scroller.less | 98 + .../directives/page-scroller/page-scroller.ts | 247 + .../perfect-scrollbar/angular-perfect-scrollbar.ts | 159 + .../print-graph-screen/print-graph-screen.ts | 211 + .../data-type-fields-structure.html | 82 + .../data-type-fields-structure.less | 90 + .../data-type-fields-structure.ts | 165 + .../type-list/type-list-directive.html | 57 + .../type-list/type-list-directive.less | 85 + .../type-list/type-list-directive.ts | 130 + .../type-map/type-map-directive.html | 70 + .../type-map/type-map-directive.less | 83 + .../property-types/type-map/type-map-directive.ts | 157 + .../app/scripts/directives/punch-out/punch-out.ts | 99 + .../sdc-single-tab/sdc-single-tab-directive.ts | 67 + .../sdc-tabs/sdc-single-tab/sdc-single-tab.less | 1 + .../sdc-tabs/sdc-tabs-directive-view.html | 17 + .../directives/sdc-tabs/sdc-tabs-directive.ts | 69 + .../app/scripts/directives/sdc-tabs/sdc-tabs.less | 68 + .../structure-tree/structure-tree-directive.html | 54 + .../structure-tree/structure-tree-directive.less | 68 + .../structure-tree/structure-tree-directive.ts | 197 + .../app/scripts/directives/tag/tag-directive.html | 10 + .../app/scripts/directives/tag/tag-directive.less | 51 + .../app/scripts/directives/tag/tag-directive.ts | 71 + .../directives/tutorial/image-template.html | 7 + .../scripts/directives/tutorial/text-template.html | 4 + .../directives/tutorial/tutorial-directive.html | 22 + .../directives/tutorial/tutorial-directive.less | 213 + .../directives/tutorial/tutorial-directive.ts | 147 + .../user-header-details-directive.html | 9 + .../user-header-details-directive.less | 62 + .../user-header-details-directive.ts | 72 + .../expand-collaps-menu-box.ts | 66 + .../expand-collapse-menu-box.html | 15 + .../expand-collapse-menu-box.less | 55 + .../utils/expand-collapse/expand-collapse.html | 1 + .../utils/expand-collapse/expand-collapse.less | 10 + .../utils/expand-collapse/expand-collapse.ts | 136 + .../utils/page-selector/page-selector.html | 9 + .../utils/page-selector/page-selector.less | 51 + .../utils/page-selector/page-selector.ts | 106 + .../sdc-keyboard-events/sdc-keyboard-events.ts | 106 + .../directives/utils/sdc-tags/sdc-tags.html | 27 + .../directives/utils/sdc-tags/sdc-tags.less | 61 + .../scripts/directives/utils/sdc-tags/sdc-tags.ts | 97 + .../utils/sdc_error_tooltip/sdc_error_tooltip.html | 6 + .../utils/sdc_error_tooltip/sdc_error_tooltip.ts | 109 + .../directives/utils/sdc_messages/sdc-message.ts | 179 + .../utils/sdc_messages/sdc-messages.less | 10 + .../directives/utils/sdc_messages/sdc-messages.ts | 245 + .../utils/sdc_messages/sdc_messages.html | 1 + .../utils/smart-tooltip/smart-tooltip.ts | 85 + .../utils/wizard_steps/sdc-wizard-steps.html | 16 + .../utils/wizard_steps/sdc-wizard-steps.less | 69 + .../utils/wizard_steps/sdc-wizard-steps.ts | 139 + .../app/scripts/filters/_category-name-filter.ts | 40 + .../app/scripts/filters/capitalize-filter.ts | 43 + .../app/scripts/filters/catalog-status-filter.ts | 41 + .../app/scripts/filters/category-icon-filter.ts | 54 + .../app/scripts/filters/category-type-filter.ts | 45 + .../scripts/filters/clear-whitespaces-filter.ts | 39 + catalog-ui/app/scripts/filters/entity-filter.ts | 117 + .../scripts/filters/graph-resource-name-filter.ts | 47 + .../filters/product-category-name-filter.ts | 39 + .../filters/product-subcategory-name-filter.ts | 39 + .../app/scripts/filters/relation-name-fllter.ts | 53 + .../app/scripts/filters/resource-name-filter.ts | 45 + .../app/scripts/filters/resource-type-filter.ts | 38 + .../app/scripts/filters/string-to-date-filter.ts | 34 + catalog-ui/app/scripts/filters/tests-id-filter.ts | 33 + catalog-ui/app/scripts/filters/trim-filter.ts | 39 + catalog-ui/app/scripts/filters/truncate-filter.ts | 48 + .../app/scripts/filters/underscoreless-filter.ts | 33 + catalog-ui/app/scripts/models/activity.ts | 48 + .../app/scripts/models/additional-information.ts | 44 + catalog-ui/app/scripts/models/app-config.ts | 232 + catalog-ui/app/scripts/models/artifacts.ts | 115 + catalog-ui/app/scripts/models/aschema-property.ts | 63 + catalog-ui/app/scripts/models/attributes.ts | 139 + catalog-ui/app/scripts/models/capability.ts | 116 + catalog-ui/app/scripts/models/category.ts | 67 + catalog-ui/app/scripts/models/comments.ts | 33 + .../app/scripts/models/components/component.ts | 828 + .../scripts/models/components/displayComponent.ts | 98 + .../app/scripts/models/components/product.ts | 109 + .../app/scripts/models/components/resource.ts | 185 + .../app/scripts/models/components/service.ts | 147 + .../componentsInstances/componentInstance.ts | 126 + .../models/componentsInstances/productInstance.ts | 34 + .../models/componentsInstances/resourceInstance.ts | 36 + .../models/componentsInstances/serviceInstance.ts | 35 + catalog-ui/app/scripts/models/csar-component.ts | 36 + .../app/scripts/models/data-type-properties.ts | 65 + catalog-ui/app/scripts/models/data-types-map.ts | 39 + catalog-ui/app/scripts/models/data-types.ts | 55 + catalog-ui/app/scripts/models/distribution.ts | 66 + catalog-ui/app/scripts/models/file-download.ts | 28 + catalog-ui/app/scripts/models/graph/d2-node.ts | 31 + .../models/graph/graph-links/common-base-link.ts | 53 + .../graph/graph-links/common-ci-link-base.ts | 50 + .../composition-ci-link-base.ts | 46 + .../composition-ci-simple-link.ts | 31 + .../composition-ci-ucpe-host-link.ts | 33 + .../composition-ci-ucpe-link.ts | 37 + .../composition-ci-vl-link.ts | 34 + .../composition-ci-vl-ucpe-link.ts | 33 + .../models/graph/graph-links/links-factory.ts | 80 + .../module-graph-links/module-ci-link-base.ts | 38 + .../module-graph-links/module-ci-vl-link.ts | 37 + .../app/scripts/models/graph/graphTooltip.ts | 38 + catalog-ui/app/scripts/models/graph/link-menu.ts | 38 + .../app/scripts/models/graph/match-relation.ts | 109 + .../scripts/models/graph/nodes/base-common-node.ts | 73 + .../models/graph/nodes/common-ci-node-base.ts | 46 + .../composition-ci-node-base.ts | 72 + .../composition-ci-node-cp.ts | 48 + .../composition-ci-node-service.ts | 42 + .../composition-ci-node-ucpe-cp.ts | 39 + .../composition-ci-node-ucpe.ts | 50 + .../composition-ci-node-vf.ts | 41 + .../composition-ci-node-vfc.ts | 33 + .../composition-ci-node-vl.ts | 54 + .../nodes/modules-graph-nodes/module-node-base.ts | 52 + .../scripts/models/graph/nodes/nodes-factory.ts | 63 + catalog-ui/app/scripts/models/graph/point.ts | 26 + .../scripts/models/graph/relationMenuObjects.ts | 138 + .../app/scripts/models/graph/relationship.ts | 107 + catalog-ui/app/scripts/models/inputs.ts | 74 + .../models/instance-inputs-properties-map.ts | 39 + .../app/scripts/models/instances-inputs-map.ts | 39 + catalog-ui/app/scripts/models/left-panel.ts | 33 + catalog-ui/app/scripts/models/member.ts | 39 + .../app/scripts/models/modules/base-module.ts | 108 + catalog-ui/app/scripts/models/properties.ts | 176 + catalog-ui/app/scripts/models/requirement.ts | 91 + catalog-ui/app/scripts/models/schema-attribute.ts | 37 + catalog-ui/app/scripts/models/tab.ts | 47 + catalog-ui/app/scripts/models/tooltip-data.ts | 28 + catalog-ui/app/scripts/models/user.ts | 117 + catalog-ui/app/scripts/models/validate.ts | 29 + catalog-ui/app/scripts/modules/directive-module.ts | 106 + catalog-ui/app/scripts/modules/filters.ts | 44 + catalog-ui/app/scripts/modules/service-module.ts | 64 + catalog-ui/app/scripts/modules/utils.ts | 39 + .../app/scripts/modules/view-model-module.ts | 96 + .../app/scripts/services/activity-log-service.ts | 48 + .../scripts/services/angular-js-bridge-service.ts | 22 + .../scripts/services/available-icons-service.ts | 105 + catalog-ui/app/scripts/services/cache-service.ts | 58 + .../scripts/services/category-resource-service.ts | 83 + .../services/components/component-service.ts | 698 + .../scripts/services/components/product-service.ts | 61 + .../services/components/resource-service.ts | 61 + .../scripts/services/components/service-service.ts | 97 + .../utils/composition-left-palette-service.ts | 248 + .../scripts/services/configuration-ui-service.ts | 49 + catalog-ui/app/scripts/services/cookie-service.ts | 95 + .../app/scripts/services/data-types-service.ts | 129 + catalog-ui/app/scripts/services/ecomp-service.ts | 54 + catalog-ui/app/scripts/services/entity-service.ts | 114 + .../app/scripts/services/event-listener-service.ts | 78 + .../app/scripts/services/header-interceptor.ts | 93 + .../app/scripts/services/http-error-interceptor.ts | 118 + catalog-ui/app/scripts/services/loader-service.ts | 26 + .../app/scripts/services/onboarding-service.ts | 103 + .../app/scripts/services/progress-service.ts | 112 + .../app/scripts/services/relation-icons-service.ts | 61 + .../app/scripts/services/sdc-version-service.ts | 48 + catalog-ui/app/scripts/services/sharing-service.ts | 41 + .../app/scripts/services/url-tobase64-service.ts | 52 + .../app/scripts/services/user-resource-service.ts | 123 + catalog-ui/app/scripts/utils/artifacts-utils.ts | 121 + .../utils/change-lifecycle-state-handler.ts | 151 + catalog-ui/app/scripts/utils/common-utils.ts | 81 + catalog-ui/app/scripts/utils/component-factory.ts | 181 + .../scripts/utils/component-instance-factory.ts | 85 + catalog-ui/app/scripts/utils/constants.ts | 247 + .../app/scripts/utils/dictionary/dictionary.ts | 257 + catalog-ui/app/scripts/utils/file-utils.ts | 73 + catalog-ui/app/scripts/utils/functions.ts | 58 + catalog-ui/app/scripts/utils/menu-handler.ts | 145 + catalog-ui/app/scripts/utils/modals-handler.ts | 275 + catalog-ui/app/scripts/utils/prototypes.ts | 155 + catalog-ui/app/scripts/utils/validation-utils.ts | 173 + .../add-category-modal-view-model.ts | 94 + .../add-category-modal-view.html | 41 + .../add-category-modal-view.less | 3 + .../admin-dashboard/admin-dashboard-view-model.ts | 82 + .../admin-dashboard/admin-dashboard-view.html | 24 + .../admin-dashboard/admin-dashboard.less | 49 + .../category-management-view-model.ts | 197 + .../category-management-view.html | 53 + .../category-management/category-management.less | 118 + .../admin-dashboard/ecomp/ecomp-view.html | 1 + .../user-management/user-management-view-model.ts | 220 + .../user-management/user-management-view.html | 102 + .../user-management/user-management.less | 251 + .../view-models/catalog/catalog-view-model.ts | 312 + .../view-models/catalog/catalog-view-tests.ts | 309 + .../scripts/view-models/catalog/catalog-view.html | 190 + .../app/scripts/view-models/catalog/catalog.less | 304 + .../activity-log/activity-log-view.html | 16 + .../activity-log/activity-log-view.less | 18 + .../component-viewer-view-model.ts | 211 + .../component-viewer/component-viewer.html | 55 + .../component-viewer/component-viewer.less | 148 + .../properties/product-properties-view.html | 76 + .../properties/properties-view.less | 128 + .../properties/resource-properties-view.html | 169 + .../properties/service-properties-view.html | 167 + .../dashboard/cover/dashboard-cover-view-model.ts | 91 + .../dashboard/cover/dashboard-cover-view.html | 1 + .../dashboard/dashboard-view-model-tests.ts | 276 + .../view-models/dashboard/dashboard-view-model.ts | 415 + .../view-models/dashboard/dashboard-view.html | 106 + .../scripts/view-models/dashboard/dashboard.less | 420 + .../artifact-form/artifact-form-view-model.ts | 354 + .../forms/artifact-form/artifact-form-view.html | 169 + .../forms/artifact-form/artifact-form.less | 44 + .../forms/attribute-form/attribute-form-view.html | 153 + .../attribute-form/attribute-from-view-model.ts | 255 + .../env-parameters-form/env-parameters-form.html | 39 + .../env-parameters-form/env-parameters-form.less | 74 + .../env-parameters-form/env-parameters-form.ts | 149 + .../property-form/property-form-view-model.ts | 330 + .../forms/property-form/property-form-view.html | 219 + .../forms/property-form/property-form.less | 63 + .../resource-instance-name-model.ts | 105 + .../resource-instance-name-view.html | 72 + .../resource-instance-name.less | 29 + .../confirmation-modal-view-model.ts | 96 + .../confirmation-modal-view.html | 29 + .../confirmation-modal/confirmation-modal.less | 30 + .../modals/email-modal/email-modal-view-model.ts | 117 + .../modals/email-modal/email-modal-view.html | 79 + .../modals/email-modal/email-modal.less | 56 + .../modals/error-modal/error-403-view.html | 4 + .../modals/error-modal/error-view-model.ts | 43 + .../view-models/modals/error-modal/error.less | 13 + .../message-modal/message-base-modal-model.ts | 64 + .../client-message-modal-view-model.ts | 43 + .../client-message-modal-view.html | 16 + .../message-client-modal/client-message-modal.less | 0 .../server-message-modal-view-model.ts | 45 + .../server-message-modal-view.html | 17 + .../message-server-modal/server-message-modal.less | 0 .../onboarding-modal-view-model.ts | 249 + .../onboarding-modal/onboarding-modal-view.html | 142 + .../modals/onboarding-modal/onboarding-modal.less | 148 + .../onboard-vendor/onboard-vendor-view-model.ts | 148 + .../onboard-vendor/onboard-vendor-view.html | 14 + .../view-models/onboard-vendor/onboard-vendor.less | 303 + .../view-models/preloading/preloading-view.html | 9 + .../view-models/preloading/preloading-view.less | 107 + .../view-models/preloading/preloading-view.ts | 47 + .../view-models/support/support-view-model.ts | 38 + .../scripts/view-models/support/support-view.html | 33 + .../app/scripts/view-models/support/support.less | 8 + .../app/scripts/view-models/tabs/general-tab.less | 131 + .../tabs/hierarchy/hierarchy-view-model.ts | 99 + .../view-models/tabs/hierarchy/hierarchy-view.html | 57 + .../view-models/tabs/hierarchy/hierarchy.less | 71 + .../view-models/tutorial-end/tutorial-end.html | 10 + .../view-models/tutorial-end/tutorial-end.less | 41 + .../view-models/tutorial-end/tutorial-end.ts | 42 + .../app/scripts/view-models/welcome/slide0.html | 50 + .../app/scripts/view-models/welcome/slide1.html | 34 + .../app/scripts/view-models/welcome/slide2.html | 26 + .../app/scripts/view-models/welcome/slide3.html | 27 + .../app/scripts/view-models/welcome/slide4.html | 29 + .../app/scripts/view-models/welcome/slide5.html | 27 + .../app/scripts/view-models/welcome/slide6.html | 26 + .../welcome/welcome-steps-controller.ts | 74 + .../scripts/view-models/welcome/welcome-view.html | 22 + .../scripts/view-models/welcome/welcome-view.ts | 267 + .../app/scripts/view-models/wizard/ReadMe.txt | 54 + .../artifact-deployment-step.html | 137 + .../artifact-deployment-step.less | 107 + .../artifact-deployment-step.ts | 228 + .../artifact-form-step-view-model.ts | 304 + .../artifact-form-step-view.html | 147 + .../artifact-form-step/artifact-form-step.less | 45 + .../artifact-information-step.html | 48 + .../artifact-information-step.less | 50 + .../artifact-information-step.ts | 168 + .../wizard/general-step/general-step.html | 270 + .../wizard/general-step/general-step.less | 34 + .../wizard/general-step/general-step.ts | 381 + .../wizard/hierarchy-step/hierarchy-step.html | 40 + .../wizard/hierarchy-step/hierarchy-step.less | 125 + .../wizard/hierarchy-step/hierarchy-step.ts | 149 + .../view-models/wizard/icons-step/icons-step.html | 26 + .../view-models/wizard/icons-step/icons-step.less | 55 + .../view-models/wizard/icons-step/icons-step.ts | 150 + .../wizard/properties-step/properties-step.html | 57 + .../wizard/properties-step/properties-step.less | 55 + .../wizard/properties-step/properties-step.ts | 123 + .../property-form-view-model-tests.ts | 163 + .../property-form/property-form-view-model.ts | 250 + .../wizard/property-form/property-form.html | 133 + .../wizard/property-form/property-form.less | 7 + .../view-models/wizard/wizard-creation-base.html | 12 + .../view-models/wizard/wizard-creation-base.less | 60 + .../view-models/wizard/wizard-creation-base.ts | 399 + .../wizard/wizard-state/create-wizard.ts | 114 + .../view-models/wizard/wizard-state/edit-wizard.ts | 164 + .../wizard/wizard-state/import-wizard.ts | 64 + .../workspace/tabs/activity-log/activity-log.html | 85 + .../workspace/tabs/activity-log/activity-log.less | 83 + .../workspace/tabs/activity-log/activity-log.ts | 122 + .../tabs/attributes/attributes-view-model.ts | 107 + .../workspace/tabs/attributes/attributes-view.html | 52 + .../workspace/tabs/attributes/attributes.less | 54 + .../tabs/composition/composition-view-model.ts | 232 + .../tabs/composition/composition-view.html | 99 + .../workspace/tabs/composition/composition.less | 864 + .../tabs/artifacts/artifacts-view-model.ts | 255 + .../composition/tabs/artifacts/artifacts-view.html | 55 + .../tabs/composition/tabs/artifacts/artifacts.less | 172 + .../composition/tabs/details/details-view-model.ts | 132 + .../composition/tabs/details/details-view.html | 129 + .../tabs/composition/tabs/details/details.less | 68 + .../properties-view-model.ts | 228 + .../properties-and-attributes/properties-view.html | 81 + .../tabs/properties-and-attributes/properties.less | 16 + .../tabs/relations/relations-view-model.ts | 81 + .../composition/tabs/relations/relations-view.html | 57 + .../tabs/composition/tabs/relations/relations.less | 116 + .../composition/tabs/structure/structure-view.html | 13 + .../composition/tabs/structure/structure-view.ts | 34 + .../deployment-artifacts-view-model.ts | 253 + .../deployment-artifacts-view.html | 149 + .../deployment-artifacts/deployment-artifacts.less | 102 + .../tabs/deployment/deployment-view-model.ts | 127 + .../workspace/tabs/deployment/deployment-view.html | 10 + .../workspace/tabs/deployment/deployment.less | 33 + .../disribution-status-modal-view-model.ts | 67 + .../disribution-status-modal-view.html | 126 + .../disribution-status-modal.less | 33 + .../tabs/distribution/distribution-view-model.ts | 135 + .../tabs/distribution/distribution-view.html | 171 + .../workspace/tabs/distribution/distribution.less | 361 + .../workspace/tabs/general/general-view-model.ts | 379 + .../workspace/tabs/general/general-view.html | 307 + .../workspace/tabs/general/general.less | 64 + .../workspace/tabs/icons/icons-view-model.ts | 131 + .../workspace/tabs/icons/icons-view.html | 26 + .../view-models/workspace/tabs/icons/icons.less | 65 + .../information-artifacts-view-model.ts | 150 + .../information-artifacts-view.html | 57 + .../information-artifacts.less | 47 + .../view-models/workspace/tabs/inputs/inputs.less | 286 + .../resource-input/resource-inputs-view-model.ts | 145 + .../resource-input/resource-inputs-view.html | 136 + .../inputs/resource-input/resource-inputs.less | 9 + .../service-input/service-inputs-view-model.ts | 246 + .../inputs/service-input/service-inputs-view.html | 205 + .../tabs/inputs/service-input/service-inputs.less | 54 + .../management-workflow-view-model.ts | 128 + .../management-workflow-view.html | 3 + .../network-call-flow-view-model.ts | 80 + .../network-call-flow/network-call-flow-view.html | 3 + .../product-hierarchy-view-model.ts | 134 + .../product-hierarchy/product-hierarchy-view.html | 40 + .../tabs/product-hierarchy/product-hierarchy.less | 130 + .../tabs/properties/properties-view-model.ts | 114 + .../workspace/tabs/properties/properties-view.html | 62 + .../workspace/tabs/properties/properties.less | 115 + .../req-and-capabilities-view-model.ts | 165 + .../req-and-capabilities-view.html | 144 + .../req-and-capabilities/req-and-capabilities.less | 196 + .../tosca-artifacts/tosca-artifacts-view-model.ts | 87 + .../tabs/tosca-artifacts/tosca-artifacts-view.html | 45 + .../tabs/tosca-artifacts/tosca-artifacts.less | 74 + .../view-models/workspace/workspace-view-model.ts | 703 + .../view-models/workspace/workspace-view.html | 86 + .../scripts/view-models/workspace/workspace.less | 144 + catalog-ui/app/styles/animation.less | 51 + catalog-ui/app/styles/app.less | 122 + catalog-ui/app/styles/buttons.less | 274 + catalog-ui/app/styles/dark-header.less | 51 + catalog-ui/app/styles/fonts.less | 72 + .../styles/fonts/ClearviewATT/ClearviewATT-Bd.eot | Bin 0 -> 92160 bytes .../styles/fonts/ClearviewATT/ClearviewATT-Bd.svg | 424 + .../styles/fonts/ClearviewATT/ClearviewATT-Bd.ttf | Bin 0 -> 93916 bytes .../styles/fonts/ClearviewATT/ClearviewATT-Bd.woff | Bin 0 -> 42192 bytes .../fonts/ClearviewATT/ClearviewATT-BdIt.eot | Bin 0 -> 104184 bytes .../fonts/ClearviewATT/ClearviewATT-BdIt.svg | 425 + .../fonts/ClearviewATT/ClearviewATT-BdIt.ttf | Bin 0 -> 105932 bytes .../fonts/ClearviewATT/ClearviewATT-BdIt.woff | Bin 0 -> 46444 bytes .../styles/fonts/ClearviewATT/ClearviewATT-Bk.eot | Bin 0 -> 86088 bytes .../styles/fonts/ClearviewATT/ClearviewATT-Bk.svg | 425 + .../styles/fonts/ClearviewATT/ClearviewATT-Bk.ttf | Bin 0 -> 88696 bytes .../styles/fonts/ClearviewATT/ClearviewATT-Bk.woff | Bin 0 -> 39280 bytes .../fonts/ClearviewATT/ClearviewATT-BkIt.eot | Bin 0 -> 104224 bytes .../fonts/ClearviewATT/ClearviewATT-BkIt.svg | 425 + .../fonts/ClearviewATT/ClearviewATT-BkIt.ttf | Bin 0 -> 105972 bytes .../fonts/ClearviewATT/ClearviewATT-BkIt.woff | Bin 0 -> 46676 bytes .../styles/fonts/ClearviewATT/ClearviewATT-Lt.eot | Bin 0 -> 89640 bytes .../styles/fonts/ClearviewATT/ClearviewATT-Lt.svg | 425 + .../styles/fonts/ClearviewATT/ClearviewATT-Lt.ttf | Bin 0 -> 92288 bytes .../styles/fonts/ClearviewATT/ClearviewATT-Lt.woff | Bin 0 -> 40332 bytes .../fonts/ClearviewATT/ClearviewATT-LtIt.eot | Bin 0 -> 108396 bytes .../fonts/ClearviewATT/ClearviewATT-LtIt.svg | 424 + .../fonts/ClearviewATT/ClearviewATT-LtIt.ttf | Bin 0 -> 110192 bytes .../fonts/ClearviewATT/ClearviewATT-LtIt.woff | Bin 0 -> 48120 bytes .../styles/fonts/OmnesATT/AT&T Variation ID.tab | 9 + .../fonts/OmnesATT/OmnesATTW02BoldItalic.eot | Bin 0 -> 31322 bytes .../fonts/OmnesATT/OmnesATTW02BoldItalic.svg | 3671 +++ .../fonts/OmnesATT/OmnesATTW02BoldItalic.ttf | Bin 0 -> 68660 bytes .../fonts/OmnesATT/OmnesATTW02BoldItalic.woff | Bin 0 -> 35986 bytes .../app/styles/fonts/OmnesATT/Omnes_ATTW02.eot | Bin 0 -> 30321 bytes .../app/styles/fonts/OmnesATT/Omnes_ATTW02.svg | 3694 +++ .../app/styles/fonts/OmnesATT/Omnes_ATTW02.ttf | Bin 0 -> 71692 bytes .../app/styles/fonts/OmnesATT/Omnes_ATTW02.woff | Bin 0 -> 35610 bytes .../app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.eot | Bin 0 -> 32077 bytes .../app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.svg | 4365 ++++ .../app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.ttf | Bin 0 -> 71564 bytes .../styles/fonts/OmnesATT/Omnes_ATTW02Bold.woff | Bin 0 -> 37149 bytes .../styles/fonts/OmnesATT/Omnes_ATTW02Italic.eot | Bin 0 -> 32079 bytes .../styles/fonts/OmnesATT/Omnes_ATTW02Italic.svg | 3799 +++ .../styles/fonts/OmnesATT/Omnes_ATTW02Italic.ttf | Bin 0 -> 76564 bytes .../styles/fonts/OmnesATT/Omnes_ATTW02Italic.woff | Bin 0 -> 37872 bytes .../styles/fonts/OmnesATT/Omnes_ATTW02Light.eot | Bin 0 -> 32072 bytes .../styles/fonts/OmnesATT/Omnes_ATTW02Light.svg | 3872 ++++ .../styles/fonts/OmnesATT/Omnes_ATTW02Light.ttf | Bin 0 -> 73968 bytes .../styles/fonts/OmnesATT/Omnes_ATTW02Light.woff | Bin 0 -> 37342 bytes .../fonts/OmnesATT/Omnes_ATTW02LightItalic.eot | Bin 0 -> 30983 bytes .../fonts/OmnesATT/Omnes_ATTW02LightItalic.svg | 3030 +++ .../fonts/OmnesATT/Omnes_ATTW02LightItalic.ttf | Bin 0 -> 70088 bytes .../fonts/OmnesATT/Omnes_ATTW02LightItalic.woff | Bin 0 -> 36261 bytes .../styles/fonts/OmnesATT/Omnes_ATTW02Medium.eot | Bin 0 -> 28695 bytes .../styles/fonts/OmnesATT/Omnes_ATTW02Medium.svg | 2473 ++ .../styles/fonts/OmnesATT/Omnes_ATTW02Medium.ttf | Bin 0 -> 65152 bytes .../styles/fonts/OmnesATT/Omnes_ATTW02Medium.woff | Bin 0 -> 33641 bytes .../fonts/OmnesATT/Omnes_ATTW02MediumItalic.eot | Bin 0 -> 33730 bytes .../fonts/OmnesATT/Omnes_ATTW02MediumItalic.svg | 3837 ++++ .../fonts/OmnesATT/Omnes_ATTW02MediumItalic.ttf | Bin 0 -> 77508 bytes .../fonts/OmnesATT/Omnes_ATTW02MediumItalic.woff | Bin 0 -> 39182 bytes .../app/styles/fonts/OmnesATT/demo-async.htm | 169 + catalog-ui/app/styles/fonts/OmnesATT/demo.htm | 155 + catalog-ui/app/styles/form-elements.less | 199 + catalog-ui/app/styles/global.less | 52 + catalog-ui/app/styles/images/anonymous.jpg | Bin 0 -> 1150 bytes catalog-ui/app/styles/images/att_logo_white.png | Bin 0 -> 2827 bytes .../images/relationship-icons/AttachesTo.svg | 37 + .../styles/images/relationship-icons/BindsTo.svg | 19 + .../images/relationship-icons/ConnectedTo.svg | 19 + .../styles/images/relationship-icons/DependsOn.svg | 34 + .../styles/images/relationship-icons/HostedOn.svg | 25 + .../styles/images/relationship-icons/LinksTo.svg | 22 + .../styles/images/relationship-icons/RoutesTo.svg | 19 + .../app/styles/images/relationship-icons/arrow.png | Bin 0 -> 1111 bytes .../app/styles/images/relationship-icons/arrow.svg | 11 + .../relationship-icons/arrow_connection_right.svg | 11 + .../styles/images/relationship-icons/attach.png | Bin 0 -> 1485 bytes .../styles/images/relationship-icons/binding.png | Bin 0 -> 1385 bytes .../styles/images/relationship-icons/conected.png | Bin 0 -> 1481 bytes .../styles/images/relationship-icons/conected.svg | 19 + .../images/relationship-icons/dependency.png | Bin 0 -> 1632 bytes .../app/styles/images/relationship-icons/host.png | Bin 0 -> 1836 bytes .../app/styles/images/relationship-icons/link.png | Bin 0 -> 1628 bytes .../images/relationship-icons/local_storage.png | Bin 0 -> 1485 bytes .../images/relationship-icons/local_storage.svg | 37 + .../app/styles/images/relationship-icons/rout.png | Bin 0 -> 1630 bytes .../images/resource-icons/Red_PLUS_HOVER.png | Bin 0 -> 1456 bytes .../Resource_Icons_NB_COLLABORATION-.png | Bin 0 -> 3898 bytes .../Resource_Icons_NB_COMPUTE-AS-SERVICE-.png | Bin 0 -> 3129 bytes .../Resource_Icons_NB_MESSAGING-.png | Bin 0 -> 2376 bytes .../resource-icons/Resource_Icons_NB_MOBILITY.png | Bin 0 -> 3396 bytes .../resource-icons/Resource_Icons_NB_NETWORK-.png | Bin 0 -> 4190 bytes .../Resource_Icons_NB_NETWORK-CLOUD-.png | Bin 0 -> 2908 bytes .../Resource_Icons_NB_NETWORK-L-1-3.png | Bin 0 -> 3239 bytes .../Resource_Icons_NB_NETWORK-L-4.png | Bin 0 -> 3104 bytes .../Resource_Icons_NB_NOTIFICATION-.png | Bin 0 -> 2818 bytes .../resource-icons/Resource_Icons_NB_ORPHAN.png | Bin 0 -> 3831 bytes .../Resource_Icons_NB_PLATFORM-AS-SERVICE-.png | Bin 0 -> 3728 bytes .../resource-icons/Resource_Icons_NB_SECURITY-.png | Bin 0 -> 3523 bytes .../resource-icons/Resource_Icons_NB_SETTING-.png | Bin 0 -> 4019 bytes .../resource-icons/Resource_Icons_NB_avater.png | Bin 0 -> 3818 bytes .../Resource_Icons_STORAGE-AS-SERVICE.png | Bin 0 -> 3106 bytes .../styles/images/resource-icons/alcatelLucent.png | Bin 0 -> 3301 bytes .../images/resource-icons/applicationServer.png | Bin 0 -> 2152 bytes .../app/styles/images/resource-icons/aricent.png | Bin 0 -> 2407 bytes .../app/styles/images/resource-icons/att.png | Bin 0 -> 3241 bytes .../styles/images/resource-icons/borderElement.png | Bin 0 -> 3744 bytes .../app/styles/images/resource-icons/broadsoft.png | Bin 0 -> 2725 bytes .../app/styles/images/resource-icons/brocade.png | Bin 0 -> 3601 bytes .../styles/images/resource-icons/call_controll.png | Bin 0 -> 3146 bytes .../images/resource-icons/canvasPlusIcon-red.png | Bin 0 -> 1434 bytes .../images/resource-icons/canvasPlusIcon.png | Bin 0 -> 1455 bytes .../app/styles/images/resource-icons/cisco.png | Bin 0 -> 2702 bytes .../styles/images/resource-icons/closeModule.png | Bin 0 -> 15427 bytes .../images/resource-icons/closeModuleHover.png | Bin 0 -> 14979 bytes .../app/styles/images/resource-icons/cloud.png | Bin 0 -> 3561 bytes .../app/styles/images/resource-icons/cloudep.png | Bin 0 -> 2944 bytes .../images/resource-icons/compute-uncertified.png | Bin 0 -> 2598 bytes .../app/styles/images/resource-icons/compute.png | Bin 0 -> 2212 bytes .../app/styles/images/resource-icons/connector.png | Bin 0 -> 2040 bytes catalog-ui/app/styles/images/resource-icons/cp.png | Bin 0 -> 1507 bytes .../app/styles/images/resource-icons/database.png | Bin 0 -> 2447 bytes .../images/resource-icons/dcae_analytics.png | Bin 0 -> 2501 bytes .../images/resource-icons/dcae_collector.png | Bin 0 -> 2582 bytes .../styles/images/resource-icons/dcae_database.png | Bin 0 -> 2447 bytes .../images/resource-icons/dcae_microservice.png | Bin 0 -> 2485 bytes .../styles/images/resource-icons/dcae_policy.png | Bin 0 -> 2492 bytes .../styles/images/resource-icons/dcae_source.png | Bin 0 -> 3451 bytes .../styles/images/resource-icons/dcae_utilty.png | Bin 0 -> 3840 bytes .../app/styles/images/resource-icons/default.png | Bin 0 -> 3831 bytes .../styles/images/resource-icons/defaulticon.png | Bin 0 -> 2132 bytes .../app/styles/images/resource-icons/ericsson.png | Bin 0 -> 3606 bytes .../app/styles/images/resource-icons/firewall.png | Bin 0 -> 3348 bytes .../app/styles/images/resource-icons/fortinet.png | Bin 0 -> 2016 bytes .../app/styles/images/resource-icons/gateway.png | Bin 0 -> 2647 bytes .../app/styles/images/resource-icons/juniper.png | Bin 0 -> 3505 bytes .../styles/images/resource-icons/loadBalancer.png | Bin 0 -> 2949 bytes .../styles/images/resource-icons/metaswitch.png | Bin 0 -> 3141 bytes .../app/styles/images/resource-icons/module.png | Bin 0 -> 1216 bytes .../app/styles/images/resource-icons/mysql.png | Bin 0 -> 3033 bytes .../app/styles/images/resource-icons/network.png | Bin 0 -> 4214 bytes .../styles/images/resource-icons/networkrules.png | Bin 0 -> 2920 bytes .../styles/images/resource-icons/nokia_siemens.png | Bin 0 -> 2615 bytes .../styles/images/resource-icons/objectStorage.png | Bin 0 -> 3031 bytes .../styles/images/resource-icons/openModule.png | Bin 0 -> 14990 bytes .../images/resource-icons/openModuleHover.png | Bin 0 -> 14989 bytes .../app/styles/images/resource-icons/oracle.png | Bin 0 -> 2432 bytes .../app/styles/images/resource-icons/ossep.png | Bin 0 -> 3768 bytes .../app/styles/images/resource-icons/personep.png | Bin 0 -> 3419 bytes .../app/styles/images/resource-icons/port.png | Bin 0 -> 2359 bytes .../styles/images/resource-icons/premisesep.png | Bin 0 -> 2822 bytes .../app/styles/images/resource-icons/router.png | Bin 0 -> 4031 bytes .../styles/images/resource-icons/securityrules.png | Bin 0 -> 2965 bytes .../images/resource-icons/selectedCPInstance.png | Bin 0 -> 1090 bytes .../images/resource-icons/selectedInstance.png | Bin 0 -> 1143 bytes .../images/resource-icons/selectedUcpeInstance.png | Bin 0 -> 3850 bytes .../images/resource-icons/selectedVLInstance.png | Bin 0 -> 1072 bytes .../app/styles/images/resource-icons/server.png | Bin 0 -> 2078 bytes .../app/styles/images/resource-icons/tropo.png | Bin 0 -> 3558 bytes .../app/styles/images/resource-icons/ucpe.png | Bin 0 -> 3983 bytes .../styles/images/resource-icons/uncertified.png | Bin 0 -> 1503 bytes .../app/styles/images/resource-icons/vfw.png | Bin 0 -> 3730 bytes catalog-ui/app/styles/images/resource-icons/vl.png | Bin 0 -> 3376741 bytes .../app/styles/images/resource-icons/vrouter.png | Bin 0 -> 3088 bytes .../app/styles/images/resource-icons/wanx.png | Bin 0 -> 3166 bytes .../styles/images/service-icons/call_controll.png | Bin 0 -> 3238 bytes .../styles/images/service-icons/collaboration.png | Bin 0 -> 3804 bytes .../styles/images/service-icons/collaboration1.png | Bin 0 -> 3194 bytes .../app/styles/images/service-icons/compute.png | Bin 0 -> 3201 bytes .../styles/images/service-icons/defaulticon.png | Bin 0 -> 2168 bytes .../app/styles/images/service-icons/messaging.png | Bin 0 -> 2458 bytes .../app/styles/images/service-icons/mobility.png | Bin 0 -> 3333 bytes .../styles/images/service-icons/network_l_1-3.png | Bin 0 -> 3030 bytes .../styles/images/service-icons/network_l_4.png | Bin 0 -> 2961 bytes .../styles/images/service-icons/notification.png | Bin 0 -> 2714 bytes .../app/styles/images/service-icons/platform.png | Bin 0 -> 3762 bytes .../app/styles/images/service-icons/storage.png | Bin 0 -> 3136 bytes .../styles/images/service-icons/uncertified.png | Bin 0 -> 1503 bytes .../styles/images/sprites/sprite-global-old.png | Bin 0 -> 84465 bytes .../app/styles/images/sprites/sprite-global.png | Bin 0 -> 71883 bytes .../styles/images/sprites/sprite-product-icons.png | Bin 0 -> 132122 bytes .../images/sprites/sprite-resource-icons.png | Bin 0 -> 469610 bytes .../images/sprites/sprite-services-icons.png | Bin 0 -> 127233 bytes .../app/styles/images/sprites/tlv-sprite.png | Bin 0 -> 14677 bytes catalog-ui/app/styles/images/tutorial/10.png | Bin 0 -> 6707 bytes catalog-ui/app/styles/images/tutorial/11.png | Bin 0 -> 7697 bytes catalog-ui/app/styles/images/tutorial/13.png | Bin 0 -> 11072 bytes catalog-ui/app/styles/images/tutorial/14.png | Bin 0 -> 2768 bytes catalog-ui/app/styles/images/tutorial/15.png | Bin 0 -> 8250 bytes catalog-ui/app/styles/images/tutorial/16.png | Bin 0 -> 11421 bytes catalog-ui/app/styles/images/tutorial/17.png | Bin 0 -> 12030 bytes catalog-ui/app/styles/images/tutorial/18.png | Bin 0 -> 10696 bytes catalog-ui/app/styles/images/tutorial/19.png | Bin 0 -> 7678 bytes catalog-ui/app/styles/images/tutorial/2.png | Bin 0 -> 5480 bytes catalog-ui/app/styles/images/tutorial/20.png | Bin 0 -> 8421 bytes catalog-ui/app/styles/images/tutorial/21.png | Bin 0 -> 11205 bytes catalog-ui/app/styles/images/tutorial/22.png | Bin 0 -> 9610 bytes catalog-ui/app/styles/images/tutorial/23.png | Bin 0 -> 9229 bytes catalog-ui/app/styles/images/tutorial/24.png | Bin 0 -> 7842 bytes catalog-ui/app/styles/images/tutorial/25.png | Bin 0 -> 7579 bytes catalog-ui/app/styles/images/tutorial/26.png | Bin 0 -> 8364 bytes catalog-ui/app/styles/images/tutorial/27.png | Bin 0 -> 10243 bytes catalog-ui/app/styles/images/tutorial/28.png | Bin 0 -> 6838 bytes catalog-ui/app/styles/images/tutorial/29.png | Bin 0 -> 9140 bytes catalog-ui/app/styles/images/tutorial/3.png | Bin 0 -> 6717 bytes catalog-ui/app/styles/images/tutorial/30.png | Bin 0 -> 8680 bytes catalog-ui/app/styles/images/tutorial/4.png | Bin 0 -> 3154 bytes catalog-ui/app/styles/images/tutorial/5.png | Bin 0 -> 3233 bytes catalog-ui/app/styles/images/tutorial/6.png | Bin 0 -> 6294 bytes catalog-ui/app/styles/images/tutorial/7.png | Bin 0 -> 6574 bytes catalog-ui/app/styles/images/tutorial/8.png | Bin 0 -> 8534 bytes catalog-ui/app/styles/images/welcome.png | Bin 0 -> 44721 bytes .../app/styles/images/welcome/SD&C_Welcome15.jpg | Bin 0 -> 3088201 bytes .../app/styles/images/welcome/SD&C_Welcome15_b.jpg | Bin 0 -> 3082618 bytes catalog-ui/app/styles/images/welcome/bg/001.jpg | Bin 0 -> 278335 bytes catalog-ui/app/styles/images/welcome/bg/002.jpg | Bin 0 -> 503913 bytes catalog-ui/app/styles/images/welcome/bg/002.png | Bin 0 -> 2804026 bytes catalog-ui/app/styles/images/welcome/bg/003.png | Bin 0 -> 1470296 bytes catalog-ui/app/styles/images/welcome/bg/004.png | Bin 0 -> 2906163 bytes catalog-ui/app/styles/images/welcome/bg/bg02.png | Bin 0 -> 141906 bytes catalog-ui/app/styles/images/welcome/bg/bg03.png | Bin 0 -> 148913 bytes .../app/styles/images/welcome/bg/connection02.png | Bin 0 -> 2735 bytes .../app/styles/images/welcome/bg/connection03.png | Bin 0 -> 7056 bytes .../app/styles/images/welcome/bg/connection04.png | Bin 0 -> 2712 bytes catalog-ui/app/styles/images/welcome/bg/global.png | Bin 0 -> 58238 bytes .../app/styles/images/welcome/bg/shape02.png | Bin 0 -> 163714 bytes .../app/styles/images/welcome/bg/shape03.png | Bin 0 -> 89805 bytes .../app/styles/images/welcome/bg/shape04.png | Bin 0 -> 127232 bytes .../app/styles/images/welcome/bg/shape05.png | Bin 0 -> 299086 bytes catalog-ui/app/styles/images/welcome/laptop.png | Bin 0 -> 83877 bytes catalog-ui/app/styles/images/welcome/logo_att.png | Bin 0 -> 19214 bytes catalog-ui/app/styles/images/welcome/sprite.png | Bin 0 -> 3386285 bytes catalog-ui/app/styles/images/welcome/ss-01.png | Bin 0 -> 3413794 bytes catalog-ui/app/styles/images/welcome/ss-02.png | Bin 0 -> 67191 bytes catalog-ui/app/styles/images/welcome/ss-03.png | Bin 0 -> 46870 bytes catalog-ui/app/styles/layout/header.less | 78 + catalog-ui/app/styles/layout/main.less | 124 + catalog-ui/app/styles/layout/sidebar.less | 163 + catalog-ui/app/styles/mixins.less | 217 + catalog-ui/app/styles/mixins_old.less | 558 + catalog-ui/app/styles/modal.less | 356 + catalog-ui/app/styles/scroller.less | 15 + catalog-ui/app/styles/sprite-old.less | 132 + catalog-ui/app/styles/sprite-product-icons.less | 71 + catalog-ui/app/styles/sprite-resource-icons.less | 258 + catalog-ui/app/styles/sprite-services-icons.less | 66 + catalog-ui/app/styles/sprite.html | 65 + catalog-ui/app/styles/sprite.less | 212 + catalog-ui/app/styles/table-flex.less | 178 + catalog-ui/app/styles/tlv-buttons.less | 234 + catalog-ui/app/styles/tlv-checkbox.less | 87 + catalog-ui/app/styles/tlv-loader.less | 164 + catalog-ui/app/styles/tlv-sprite.less | 138 + catalog-ui/app/styles/tooltips.less | 110 + catalog-ui/app/styles/variables-old.less | 77 + catalog-ui/app/styles/variables.less | 48 + catalog-ui/app/styles/welcome-sprite.less | 57 + catalog-ui/app/styles/welcome-style.less | 651 + catalog-ui/app/third-party/PunchOutRegistry.js | 98 + .../app/third-party/ng-infinite-scroll/.npmignore | 3 + .../app/third-party/ng-infinite-scroll/.travis.yml | 12 + .../ng-infinite-scroll/Gruntfile.coffee | 110 + .../app/third-party/ng-infinite-scroll/LICENSE | 22 + .../app/third-party/ng-infinite-scroll/README.md | 71 + .../app/third-party/ng-infinite-scroll/bower.json | 16 + .../ng-infinite-scroll/build/ng-infinite-scroll.js | 209 + .../build/ng-infinite-scroll.min.js | 22 + .../third-party/ng-infinite-scroll/package.json | 80 + .../ng-infinite-scroll/src/infinite-scroll.coffee | 209 + .../test/protractor-local.conf.js | 27 + .../test/protractor-shared.conf.js | 26 + .../test/protractor-travis.conf.js | 32 + .../test/spec/ng-infinite-scroll.spec.coffee | 221 + catalog-ui/bower dependecies | 29 + catalog-ui/bower.json | 42 + catalog-ui/build_catalog_ui.bat | 29 + catalog-ui/build_catalog_ui.sh | 84 + catalog-ui/configurations/MenuReadMe.txt | 60 + catalog-ui/configurations/dev.json | 430 + catalog-ui/configurations/menu.json | 576 + catalog-ui/configurations/mock.json | 192 + catalog-ui/configurations/prod.json | 432 + catalog-ui/docs/colors.jpg | Bin 0 -> 80399 bytes .../CytoscapeEdgeEditation.js | 554 + .../cytoscape.js-edge-editation/README.md | 58 + .../cytoscape.js-edge-editation/index.html | 169 + catalog-ui/package.json | 67 + catalog-ui/pom.xml | 231 + .../mock-data/artifact/artifact-types.json | 23 + .../server-mock/mock-data/category/category.json | 65 + .../server-mock/mock-data/element/element.json | 2915 +++ .../server-mock/mock-data/resource/properties.json | 35 + .../server-mock/mock-data/resource/resource.json | 153 + .../mock-data/resources/resourcesAbstract.json | 284 + .../mock-data/resources/resourcesNotAbstract.json | 510 + .../server-mock/mock-data/template/template.json | 37 + catalog-ui/server-mock/mock-data/user/user.json | 7 + catalog-ui/server-mock/mock-server.js | 140 + catalog-ui/server-mock/routes/property.js | 45 + catalog-ui/server-mock/routes/resource.js | 60 + catalog-ui/server-mock/routes/resources.js | 38 + catalog-ui/server-mock/routes/template.js | 45 + catalog-ui/server-mock/routes/user.js | 45 + catalog-ui/tests/karma.unit.conf.js | 149 + catalog-ui/tsd.json | 15 + catalog-ui/tslint.json | 58 + .../angular-ui-bootstrap/angular-ui-bootstrap.d.ts | 658 + .../angular-ui-router/angular-ui-router.d.ts | 207 + catalog-ui/typings/angularjs/angular-mocks.d.ts | 337 + catalog-ui/typings/angularjs/angular-resource.d.ts | 183 + catalog-ui/typings/angularjs/angular.d.ts | 1613 ++ catalog-ui/typings/angularjs/restangular.d.ts | 156 + .../typings/cytoscape/cytoscape-extension.js | 1 + .../typings/cytoscape/cytoscape-extension.js.map | 1 + .../typings/cytoscape/cytoscape-extension.ts | 40 + catalog-ui/typings/cytoscape/cytoscape.d.ts | 3095 +++ catalog-ui/typings/cytoscape/edge-editation.d.ts | 28 + catalog-ui/typings/d3/d3.d.ts | 3308 +++ catalog-ui/typings/jasmine/jasmine.d.ts | 515 + catalog-ui/typings/jquery/jquery.d.ts | 3181 +++ catalog-ui/typings/jsMd5/md5.d.ts | 55 + catalog-ui/typings/lodash/lodash.d.ts | 22949 +++++++++++++++++++ catalog-ui/typings/notifyjs/notifyjs.d.ts | 125 + catalog-ui/typings/tsd.d.ts | 21 + 776 files changed, 129835 insertions(+) create mode 100644 catalog-ui/Gruntfile.js create mode 100644 catalog-ui/SETTING-ENVIRONMENT.md create mode 100644 catalog-ui/SETTING-MOCK-SERVER.md create mode 100644 catalog-ui/app/_favicon.png create mode 100644 catalog-ui/app/index.html create mode 100644 catalog-ui/app/languages/en_US_OS.json create mode 100644 catalog-ui/app/scripts/app.ts create mode 100644 catalog-ui/app/scripts/directives/clicked-outside/clicked-outside-directive.ts create mode 100644 catalog-ui/app/scripts/directives/custom-validation/custom-validation.ts create mode 100644 catalog-ui/app/scripts/directives/download-artifact/download-artifact.ts create mode 100644 catalog-ui/app/scripts/directives/ecomp-header/ecomp-header.html create mode 100644 catalog-ui/app/scripts/directives/ecomp-header/ecomp-header.less create mode 100644 catalog-ui/app/scripts/directives/ecomp-header/ecomp-header.ts create mode 100644 catalog-ui/app/scripts/directives/edit-name-popover/edit-module-name-popover.html create mode 100644 catalog-ui/app/scripts/directives/edit-name-popover/edit-name-popover-directive.ts create mode 100644 catalog-ui/app/scripts/directives/edit-name-popover/edit-name-popover-view.html create mode 100644 catalog-ui/app/scripts/directives/edit-name-popover/edit-name-popover.less create mode 100644 catalog-ui/app/scripts/directives/elements/checkbox/checkbox.html create mode 100644 catalog-ui/app/scripts/directives/elements/checkbox/checkbox.less create mode 100644 catalog-ui/app/scripts/directives/elements/checkbox/checkbox.ts create mode 100644 catalog-ui/app/scripts/directives/elements/radiobutton/radiobutton.html create mode 100644 catalog-ui/app/scripts/directives/elements/radiobutton/radiobutton.less create mode 100644 catalog-ui/app/scripts/directives/elements/radiobutton/radiobutton.ts create mode 100644 catalog-ui/app/scripts/directives/ellipsis/ellipsis-directive.html create mode 100644 catalog-ui/app/scripts/directives/ellipsis/ellipsis-directive.less create mode 100644 catalog-ui/app/scripts/directives/ellipsis/ellipsis-directive.ts create mode 100644 catalog-ui/app/scripts/directives/events/on-last-repeat/on-last-repeat.ts create mode 100644 catalog-ui/app/scripts/directives/file-opener/file-opener.html create mode 100644 catalog-ui/app/scripts/directives/file-opener/file-opener.ts create mode 100644 catalog-ui/app/scripts/directives/file-type/file-type.ts create mode 100644 catalog-ui/app/scripts/directives/file-upload/file-upload.html create mode 100644 catalog-ui/app/scripts/directives/file-upload/file-upload.less create mode 100644 catalog-ui/app/scripts/directives/file-upload/file-upload.ts create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/common/common-graph-utils.ts create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/common/style/component-instances-nodes-style.ts create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/common/style/module-node-style.ts create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/composition-graph/composition-graph.directive.ts create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/composition-graph/composition-graph.html create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/composition-graph/composition-graph.less create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/composition-graph/utils/composition-graph-general-utils.ts create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/composition-graph/utils/composition-graph-links-utils.ts create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/composition-graph/utils/composition-graph-nodes-utils.ts create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/composition-graph/utils/match-capability-requierment-utils.ts create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-graph.directive.ts create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-graph.html create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-graph.less create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-utils/deployment-graph-general-utils.ts create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/image-creator/image-creator.service.ts create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/palette/interfaces/i-dragdrop-event.d.ts create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/palette/palette.directive.ts create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/palette/palette.html create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/palette/palette.less create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/relation-menu/relation-menu.html create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/relation-menu/relation-menu.less create mode 100644 catalog-ui/app/scripts/directives/graphs-v2/relation-menu/relation-menu.ts create mode 100644 catalog-ui/app/scripts/directives/info-tooltip/info-tooltip.html create mode 100644 catalog-ui/app/scripts/directives/info-tooltip/info-tooltip.less create mode 100644 catalog-ui/app/scripts/directives/info-tooltip/info-tooltip.ts create mode 100644 catalog-ui/app/scripts/directives/invalid-characters/invalid-characters.ts create mode 100644 catalog-ui/app/scripts/directives/layout/top-nav/top-nav.html create mode 100644 catalog-ui/app/scripts/directives/layout/top-nav/top-nav.less create mode 100644 catalog-ui/app/scripts/directives/layout/top-nav/top-nav.ts create mode 100644 catalog-ui/app/scripts/directives/layout/top-progress/top-progress.html create mode 100644 catalog-ui/app/scripts/directives/layout/top-progress/top-progress.less create mode 100644 catalog-ui/app/scripts/directives/layout/top-progress/top-progress.ts create mode 100644 catalog-ui/app/scripts/directives/loader/loader-directive.html create mode 100644 catalog-ui/app/scripts/directives/loader/loader-directive.less create mode 100644 catalog-ui/app/scripts/directives/loader/loader-directive.ts create mode 100644 catalog-ui/app/scripts/directives/modal/sdc-modal.html create mode 100644 catalog-ui/app/scripts/directives/modal/sdc-modal.less create mode 100644 catalog-ui/app/scripts/directives/modal/sdc-modal.ts create mode 100644 catalog-ui/app/scripts/directives/page-scroller/page-scroller.html create mode 100644 catalog-ui/app/scripts/directives/page-scroller/page-scroller.less create mode 100644 catalog-ui/app/scripts/directives/page-scroller/page-scroller.ts create mode 100644 catalog-ui/app/scripts/directives/perfect-scrollbar/angular-perfect-scrollbar.ts create mode 100644 catalog-ui/app/scripts/directives/print-graph-screen/print-graph-screen.ts create mode 100644 catalog-ui/app/scripts/directives/property-types/data-type-fields-structure/data-type-fields-structure.html create mode 100644 catalog-ui/app/scripts/directives/property-types/data-type-fields-structure/data-type-fields-structure.less create mode 100644 catalog-ui/app/scripts/directives/property-types/data-type-fields-structure/data-type-fields-structure.ts create mode 100644 catalog-ui/app/scripts/directives/property-types/type-list/type-list-directive.html create mode 100644 catalog-ui/app/scripts/directives/property-types/type-list/type-list-directive.less create mode 100644 catalog-ui/app/scripts/directives/property-types/type-list/type-list-directive.ts create mode 100644 catalog-ui/app/scripts/directives/property-types/type-map/type-map-directive.html create mode 100644 catalog-ui/app/scripts/directives/property-types/type-map/type-map-directive.less create mode 100644 catalog-ui/app/scripts/directives/property-types/type-map/type-map-directive.ts create mode 100644 catalog-ui/app/scripts/directives/punch-out/punch-out.ts create mode 100644 catalog-ui/app/scripts/directives/sdc-tabs/sdc-single-tab/sdc-single-tab-directive.ts create mode 100644 catalog-ui/app/scripts/directives/sdc-tabs/sdc-single-tab/sdc-single-tab.less create mode 100644 catalog-ui/app/scripts/directives/sdc-tabs/sdc-tabs-directive-view.html create mode 100644 catalog-ui/app/scripts/directives/sdc-tabs/sdc-tabs-directive.ts create mode 100644 catalog-ui/app/scripts/directives/sdc-tabs/sdc-tabs.less create mode 100644 catalog-ui/app/scripts/directives/structure-tree/structure-tree-directive.html create mode 100644 catalog-ui/app/scripts/directives/structure-tree/structure-tree-directive.less create mode 100644 catalog-ui/app/scripts/directives/structure-tree/structure-tree-directive.ts create mode 100644 catalog-ui/app/scripts/directives/tag/tag-directive.html create mode 100644 catalog-ui/app/scripts/directives/tag/tag-directive.less create mode 100644 catalog-ui/app/scripts/directives/tag/tag-directive.ts create mode 100644 catalog-ui/app/scripts/directives/tutorial/image-template.html create mode 100644 catalog-ui/app/scripts/directives/tutorial/text-template.html create mode 100644 catalog-ui/app/scripts/directives/tutorial/tutorial-directive.html create mode 100644 catalog-ui/app/scripts/directives/tutorial/tutorial-directive.less create mode 100644 catalog-ui/app/scripts/directives/tutorial/tutorial-directive.ts create mode 100644 catalog-ui/app/scripts/directives/user-header-details/user-header-details-directive.html create mode 100644 catalog-ui/app/scripts/directives/user-header-details/user-header-details-directive.less create mode 100644 catalog-ui/app/scripts/directives/user-header-details/user-header-details-directive.ts create mode 100644 catalog-ui/app/scripts/directives/utils/expand-collapse-menu-box/expand-collaps-menu-box.ts create mode 100644 catalog-ui/app/scripts/directives/utils/expand-collapse-menu-box/expand-collapse-menu-box.html create mode 100644 catalog-ui/app/scripts/directives/utils/expand-collapse-menu-box/expand-collapse-menu-box.less create mode 100644 catalog-ui/app/scripts/directives/utils/expand-collapse/expand-collapse.html create mode 100644 catalog-ui/app/scripts/directives/utils/expand-collapse/expand-collapse.less create mode 100644 catalog-ui/app/scripts/directives/utils/expand-collapse/expand-collapse.ts create mode 100644 catalog-ui/app/scripts/directives/utils/page-selector/page-selector.html create mode 100644 catalog-ui/app/scripts/directives/utils/page-selector/page-selector.less create mode 100644 catalog-ui/app/scripts/directives/utils/page-selector/page-selector.ts create mode 100644 catalog-ui/app/scripts/directives/utils/sdc-keyboard-events/sdc-keyboard-events.ts create mode 100644 catalog-ui/app/scripts/directives/utils/sdc-tags/sdc-tags.html create mode 100644 catalog-ui/app/scripts/directives/utils/sdc-tags/sdc-tags.less create mode 100644 catalog-ui/app/scripts/directives/utils/sdc-tags/sdc-tags.ts create mode 100644 catalog-ui/app/scripts/directives/utils/sdc_error_tooltip/sdc_error_tooltip.html create mode 100644 catalog-ui/app/scripts/directives/utils/sdc_error_tooltip/sdc_error_tooltip.ts create mode 100644 catalog-ui/app/scripts/directives/utils/sdc_messages/sdc-message.ts create mode 100644 catalog-ui/app/scripts/directives/utils/sdc_messages/sdc-messages.less create mode 100644 catalog-ui/app/scripts/directives/utils/sdc_messages/sdc-messages.ts create mode 100644 catalog-ui/app/scripts/directives/utils/sdc_messages/sdc_messages.html create mode 100644 catalog-ui/app/scripts/directives/utils/smart-tooltip/smart-tooltip.ts create mode 100644 catalog-ui/app/scripts/directives/utils/wizard_steps/sdc-wizard-steps.html create mode 100644 catalog-ui/app/scripts/directives/utils/wizard_steps/sdc-wizard-steps.less create mode 100644 catalog-ui/app/scripts/directives/utils/wizard_steps/sdc-wizard-steps.ts create mode 100644 catalog-ui/app/scripts/filters/_category-name-filter.ts create mode 100644 catalog-ui/app/scripts/filters/capitalize-filter.ts create mode 100644 catalog-ui/app/scripts/filters/catalog-status-filter.ts create mode 100644 catalog-ui/app/scripts/filters/category-icon-filter.ts create mode 100644 catalog-ui/app/scripts/filters/category-type-filter.ts create mode 100644 catalog-ui/app/scripts/filters/clear-whitespaces-filter.ts create mode 100644 catalog-ui/app/scripts/filters/entity-filter.ts create mode 100644 catalog-ui/app/scripts/filters/graph-resource-name-filter.ts create mode 100644 catalog-ui/app/scripts/filters/product-category-name-filter.ts create mode 100644 catalog-ui/app/scripts/filters/product-subcategory-name-filter.ts create mode 100644 catalog-ui/app/scripts/filters/relation-name-fllter.ts create mode 100644 catalog-ui/app/scripts/filters/resource-name-filter.ts create mode 100644 catalog-ui/app/scripts/filters/resource-type-filter.ts create mode 100644 catalog-ui/app/scripts/filters/string-to-date-filter.ts create mode 100644 catalog-ui/app/scripts/filters/tests-id-filter.ts create mode 100644 catalog-ui/app/scripts/filters/trim-filter.ts create mode 100644 catalog-ui/app/scripts/filters/truncate-filter.ts create mode 100644 catalog-ui/app/scripts/filters/underscoreless-filter.ts create mode 100644 catalog-ui/app/scripts/models/activity.ts create mode 100644 catalog-ui/app/scripts/models/additional-information.ts create mode 100644 catalog-ui/app/scripts/models/app-config.ts create mode 100644 catalog-ui/app/scripts/models/artifacts.ts create mode 100644 catalog-ui/app/scripts/models/aschema-property.ts create mode 100644 catalog-ui/app/scripts/models/attributes.ts create mode 100644 catalog-ui/app/scripts/models/capability.ts create mode 100644 catalog-ui/app/scripts/models/category.ts create mode 100644 catalog-ui/app/scripts/models/comments.ts create mode 100644 catalog-ui/app/scripts/models/components/component.ts create mode 100644 catalog-ui/app/scripts/models/components/displayComponent.ts create mode 100644 catalog-ui/app/scripts/models/components/product.ts create mode 100644 catalog-ui/app/scripts/models/components/resource.ts create mode 100644 catalog-ui/app/scripts/models/components/service.ts create mode 100644 catalog-ui/app/scripts/models/componentsInstances/componentInstance.ts create mode 100644 catalog-ui/app/scripts/models/componentsInstances/productInstance.ts create mode 100644 catalog-ui/app/scripts/models/componentsInstances/resourceInstance.ts create mode 100644 catalog-ui/app/scripts/models/componentsInstances/serviceInstance.ts create mode 100644 catalog-ui/app/scripts/models/csar-component.ts create mode 100644 catalog-ui/app/scripts/models/data-type-properties.ts create mode 100644 catalog-ui/app/scripts/models/data-types-map.ts create mode 100644 catalog-ui/app/scripts/models/data-types.ts create mode 100644 catalog-ui/app/scripts/models/distribution.ts create mode 100644 catalog-ui/app/scripts/models/file-download.ts create mode 100644 catalog-ui/app/scripts/models/graph/d2-node.ts create mode 100644 catalog-ui/app/scripts/models/graph/graph-links/common-base-link.ts create mode 100644 catalog-ui/app/scripts/models/graph/graph-links/common-ci-link-base.ts create mode 100644 catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-link-base.ts create mode 100644 catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-simple-link.ts create mode 100644 catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-ucpe-host-link.ts create mode 100644 catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-ucpe-link.ts create mode 100644 catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-vl-link.ts create mode 100644 catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-vl-ucpe-link.ts create mode 100644 catalog-ui/app/scripts/models/graph/graph-links/links-factory.ts create mode 100644 catalog-ui/app/scripts/models/graph/graph-links/module-graph-links/module-ci-link-base.ts create mode 100644 catalog-ui/app/scripts/models/graph/graph-links/module-graph-links/module-ci-vl-link.ts create mode 100644 catalog-ui/app/scripts/models/graph/graphTooltip.ts create mode 100644 catalog-ui/app/scripts/models/graph/link-menu.ts create mode 100644 catalog-ui/app/scripts/models/graph/match-relation.ts create mode 100644 catalog-ui/app/scripts/models/graph/nodes/base-common-node.ts create mode 100644 catalog-ui/app/scripts/models/graph/nodes/common-ci-node-base.ts create mode 100644 catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-base.ts create mode 100644 catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-cp.ts create mode 100644 catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-service.ts create mode 100644 catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe-cp.ts create mode 100644 catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe.ts create mode 100644 catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-vf.ts create mode 100644 catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-vfc.ts create mode 100644 catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-vl.ts create mode 100644 catalog-ui/app/scripts/models/graph/nodes/modules-graph-nodes/module-node-base.ts create mode 100644 catalog-ui/app/scripts/models/graph/nodes/nodes-factory.ts create mode 100644 catalog-ui/app/scripts/models/graph/point.ts create mode 100644 catalog-ui/app/scripts/models/graph/relationMenuObjects.ts create mode 100644 catalog-ui/app/scripts/models/graph/relationship.ts create mode 100644 catalog-ui/app/scripts/models/inputs.ts create mode 100644 catalog-ui/app/scripts/models/instance-inputs-properties-map.ts create mode 100644 catalog-ui/app/scripts/models/instances-inputs-map.ts create mode 100644 catalog-ui/app/scripts/models/left-panel.ts create mode 100644 catalog-ui/app/scripts/models/member.ts create mode 100644 catalog-ui/app/scripts/models/modules/base-module.ts create mode 100644 catalog-ui/app/scripts/models/properties.ts create mode 100644 catalog-ui/app/scripts/models/requirement.ts create mode 100644 catalog-ui/app/scripts/models/schema-attribute.ts create mode 100644 catalog-ui/app/scripts/models/tab.ts create mode 100644 catalog-ui/app/scripts/models/tooltip-data.ts create mode 100644 catalog-ui/app/scripts/models/user.ts create mode 100644 catalog-ui/app/scripts/models/validate.ts create mode 100644 catalog-ui/app/scripts/modules/directive-module.ts create mode 100644 catalog-ui/app/scripts/modules/filters.ts create mode 100644 catalog-ui/app/scripts/modules/service-module.ts create mode 100644 catalog-ui/app/scripts/modules/utils.ts create mode 100644 catalog-ui/app/scripts/modules/view-model-module.ts create mode 100644 catalog-ui/app/scripts/services/activity-log-service.ts create mode 100644 catalog-ui/app/scripts/services/angular-js-bridge-service.ts create mode 100644 catalog-ui/app/scripts/services/available-icons-service.ts create mode 100644 catalog-ui/app/scripts/services/cache-service.ts create mode 100644 catalog-ui/app/scripts/services/category-resource-service.ts create mode 100644 catalog-ui/app/scripts/services/components/component-service.ts create mode 100644 catalog-ui/app/scripts/services/components/product-service.ts create mode 100644 catalog-ui/app/scripts/services/components/resource-service.ts create mode 100644 catalog-ui/app/scripts/services/components/service-service.ts create mode 100644 catalog-ui/app/scripts/services/components/utils/composition-left-palette-service.ts create mode 100644 catalog-ui/app/scripts/services/configuration-ui-service.ts create mode 100644 catalog-ui/app/scripts/services/cookie-service.ts create mode 100644 catalog-ui/app/scripts/services/data-types-service.ts create mode 100644 catalog-ui/app/scripts/services/ecomp-service.ts create mode 100644 catalog-ui/app/scripts/services/entity-service.ts create mode 100644 catalog-ui/app/scripts/services/event-listener-service.ts create mode 100644 catalog-ui/app/scripts/services/header-interceptor.ts create mode 100644 catalog-ui/app/scripts/services/http-error-interceptor.ts create mode 100644 catalog-ui/app/scripts/services/loader-service.ts create mode 100644 catalog-ui/app/scripts/services/onboarding-service.ts create mode 100644 catalog-ui/app/scripts/services/progress-service.ts create mode 100644 catalog-ui/app/scripts/services/relation-icons-service.ts create mode 100644 catalog-ui/app/scripts/services/sdc-version-service.ts create mode 100644 catalog-ui/app/scripts/services/sharing-service.ts create mode 100644 catalog-ui/app/scripts/services/url-tobase64-service.ts create mode 100644 catalog-ui/app/scripts/services/user-resource-service.ts create mode 100644 catalog-ui/app/scripts/utils/artifacts-utils.ts create mode 100644 catalog-ui/app/scripts/utils/change-lifecycle-state-handler.ts create mode 100644 catalog-ui/app/scripts/utils/common-utils.ts create mode 100644 catalog-ui/app/scripts/utils/component-factory.ts create mode 100644 catalog-ui/app/scripts/utils/component-instance-factory.ts create mode 100644 catalog-ui/app/scripts/utils/constants.ts create mode 100644 catalog-ui/app/scripts/utils/dictionary/dictionary.ts create mode 100644 catalog-ui/app/scripts/utils/file-utils.ts create mode 100644 catalog-ui/app/scripts/utils/functions.ts create mode 100644 catalog-ui/app/scripts/utils/menu-handler.ts create mode 100644 catalog-ui/app/scripts/utils/modals-handler.ts create mode 100644 catalog-ui/app/scripts/utils/prototypes.ts create mode 100644 catalog-ui/app/scripts/utils/validation-utils.ts create mode 100644 catalog-ui/app/scripts/view-models/admin-dashboard/add-category-modal/add-category-modal-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/admin-dashboard/add-category-modal/add-category-modal-view.html create mode 100644 catalog-ui/app/scripts/view-models/admin-dashboard/add-category-modal/add-category-modal-view.less create mode 100644 catalog-ui/app/scripts/view-models/admin-dashboard/admin-dashboard-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/admin-dashboard/admin-dashboard-view.html create mode 100644 catalog-ui/app/scripts/view-models/admin-dashboard/admin-dashboard.less create mode 100644 catalog-ui/app/scripts/view-models/admin-dashboard/category-management/category-management-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/admin-dashboard/category-management/category-management-view.html create mode 100644 catalog-ui/app/scripts/view-models/admin-dashboard/category-management/category-management.less create mode 100644 catalog-ui/app/scripts/view-models/admin-dashboard/ecomp/ecomp-view.html create mode 100644 catalog-ui/app/scripts/view-models/admin-dashboard/user-management/user-management-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/admin-dashboard/user-management/user-management-view.html create mode 100644 catalog-ui/app/scripts/view-models/admin-dashboard/user-management/user-management.less create mode 100644 catalog-ui/app/scripts/view-models/catalog/catalog-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/catalog/catalog-view-tests.ts create mode 100644 catalog-ui/app/scripts/view-models/catalog/catalog-view.html create mode 100644 catalog-ui/app/scripts/view-models/catalog/catalog.less create mode 100644 catalog-ui/app/scripts/view-models/component-viewer/activity-log/activity-log-view.html create mode 100644 catalog-ui/app/scripts/view-models/component-viewer/activity-log/activity-log-view.less create mode 100644 catalog-ui/app/scripts/view-models/component-viewer/component-viewer-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/component-viewer/component-viewer.html create mode 100644 catalog-ui/app/scripts/view-models/component-viewer/component-viewer.less create mode 100644 catalog-ui/app/scripts/view-models/component-viewer/properties/product-properties-view.html create mode 100644 catalog-ui/app/scripts/view-models/component-viewer/properties/properties-view.less create mode 100644 catalog-ui/app/scripts/view-models/component-viewer/properties/resource-properties-view.html create mode 100644 catalog-ui/app/scripts/view-models/component-viewer/properties/service-properties-view.html create mode 100644 catalog-ui/app/scripts/view-models/dashboard/cover/dashboard-cover-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/dashboard/cover/dashboard-cover-view.html create mode 100644 catalog-ui/app/scripts/view-models/dashboard/dashboard-view-model-tests.ts create mode 100644 catalog-ui/app/scripts/view-models/dashboard/dashboard-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/dashboard/dashboard-view.html create mode 100644 catalog-ui/app/scripts/view-models/dashboard/dashboard.less create mode 100644 catalog-ui/app/scripts/view-models/forms/artifact-form/artifact-form-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/forms/artifact-form/artifact-form-view.html create mode 100644 catalog-ui/app/scripts/view-models/forms/artifact-form/artifact-form.less create mode 100644 catalog-ui/app/scripts/view-models/forms/attribute-form/attribute-form-view.html create mode 100644 catalog-ui/app/scripts/view-models/forms/attribute-form/attribute-from-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/forms/env-parameters-form/env-parameters-form.html create mode 100644 catalog-ui/app/scripts/view-models/forms/env-parameters-form/env-parameters-form.less create mode 100644 catalog-ui/app/scripts/view-models/forms/env-parameters-form/env-parameters-form.ts create mode 100644 catalog-ui/app/scripts/view-models/forms/property-form/property-form-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/forms/property-form/property-form-view.html create mode 100644 catalog-ui/app/scripts/view-models/forms/property-form/property-form.less create mode 100644 catalog-ui/app/scripts/view-models/forms/resource-instance-name-form/resource-instance-name-model.ts create mode 100644 catalog-ui/app/scripts/view-models/forms/resource-instance-name-form/resource-instance-name-view.html create mode 100644 catalog-ui/app/scripts/view-models/forms/resource-instance-name-form/resource-instance-name.less create mode 100644 catalog-ui/app/scripts/view-models/modals/confirmation-modal/confirmation-modal-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/modals/confirmation-modal/confirmation-modal-view.html create mode 100644 catalog-ui/app/scripts/view-models/modals/confirmation-modal/confirmation-modal.less create mode 100644 catalog-ui/app/scripts/view-models/modals/email-modal/email-modal-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/modals/email-modal/email-modal-view.html create mode 100644 catalog-ui/app/scripts/view-models/modals/email-modal/email-modal.less create mode 100644 catalog-ui/app/scripts/view-models/modals/error-modal/error-403-view.html create mode 100644 catalog-ui/app/scripts/view-models/modals/error-modal/error-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/modals/error-modal/error.less create mode 100644 catalog-ui/app/scripts/view-models/modals/message-modal/message-base-modal-model.ts create mode 100644 catalog-ui/app/scripts/view-models/modals/message-modal/message-client-modal/client-message-modal-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/modals/message-modal/message-client-modal/client-message-modal-view.html create mode 100644 catalog-ui/app/scripts/view-models/modals/message-modal/message-client-modal/client-message-modal.less create mode 100644 catalog-ui/app/scripts/view-models/modals/message-modal/message-server-modal/server-message-modal-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/modals/message-modal/message-server-modal/server-message-modal-view.html create mode 100644 catalog-ui/app/scripts/view-models/modals/message-modal/message-server-modal/server-message-modal.less create mode 100644 catalog-ui/app/scripts/view-models/modals/onboarding-modal/onboarding-modal-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/modals/onboarding-modal/onboarding-modal-view.html create mode 100644 catalog-ui/app/scripts/view-models/modals/onboarding-modal/onboarding-modal.less create mode 100644 catalog-ui/app/scripts/view-models/onboard-vendor/onboard-vendor-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/onboard-vendor/onboard-vendor-view.html create mode 100644 catalog-ui/app/scripts/view-models/onboard-vendor/onboard-vendor.less create mode 100644 catalog-ui/app/scripts/view-models/preloading/preloading-view.html create mode 100644 catalog-ui/app/scripts/view-models/preloading/preloading-view.less create mode 100644 catalog-ui/app/scripts/view-models/preloading/preloading-view.ts create mode 100644 catalog-ui/app/scripts/view-models/support/support-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/support/support-view.html create mode 100644 catalog-ui/app/scripts/view-models/support/support.less create mode 100644 catalog-ui/app/scripts/view-models/tabs/general-tab.less create mode 100644 catalog-ui/app/scripts/view-models/tabs/hierarchy/hierarchy-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/tabs/hierarchy/hierarchy-view.html create mode 100644 catalog-ui/app/scripts/view-models/tabs/hierarchy/hierarchy.less create mode 100644 catalog-ui/app/scripts/view-models/tutorial-end/tutorial-end.html create mode 100644 catalog-ui/app/scripts/view-models/tutorial-end/tutorial-end.less create mode 100644 catalog-ui/app/scripts/view-models/tutorial-end/tutorial-end.ts create mode 100644 catalog-ui/app/scripts/view-models/welcome/slide0.html create mode 100644 catalog-ui/app/scripts/view-models/welcome/slide1.html create mode 100644 catalog-ui/app/scripts/view-models/welcome/slide2.html create mode 100644 catalog-ui/app/scripts/view-models/welcome/slide3.html create mode 100644 catalog-ui/app/scripts/view-models/welcome/slide4.html create mode 100644 catalog-ui/app/scripts/view-models/welcome/slide5.html create mode 100644 catalog-ui/app/scripts/view-models/welcome/slide6.html create mode 100644 catalog-ui/app/scripts/view-models/welcome/welcome-steps-controller.ts create mode 100644 catalog-ui/app/scripts/view-models/welcome/welcome-view.html create mode 100644 catalog-ui/app/scripts/view-models/welcome/welcome-view.ts create mode 100644 catalog-ui/app/scripts/view-models/wizard/ReadMe.txt create mode 100644 catalog-ui/app/scripts/view-models/wizard/artifact-deployment-step/artifact-deployment-step.html create mode 100644 catalog-ui/app/scripts/view-models/wizard/artifact-deployment-step/artifact-deployment-step.less create mode 100644 catalog-ui/app/scripts/view-models/wizard/artifact-deployment-step/artifact-deployment-step.ts create mode 100644 catalog-ui/app/scripts/view-models/wizard/artifact-form-step/artifact-form-step-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/wizard/artifact-form-step/artifact-form-step-view.html create mode 100644 catalog-ui/app/scripts/view-models/wizard/artifact-form-step/artifact-form-step.less create mode 100644 catalog-ui/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.html create mode 100644 catalog-ui/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.less create mode 100644 catalog-ui/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.ts create mode 100644 catalog-ui/app/scripts/view-models/wizard/general-step/general-step.html create mode 100644 catalog-ui/app/scripts/view-models/wizard/general-step/general-step.less create mode 100644 catalog-ui/app/scripts/view-models/wizard/general-step/general-step.ts create mode 100644 catalog-ui/app/scripts/view-models/wizard/hierarchy-step/hierarchy-step.html create mode 100644 catalog-ui/app/scripts/view-models/wizard/hierarchy-step/hierarchy-step.less create mode 100644 catalog-ui/app/scripts/view-models/wizard/hierarchy-step/hierarchy-step.ts create mode 100644 catalog-ui/app/scripts/view-models/wizard/icons-step/icons-step.html create mode 100644 catalog-ui/app/scripts/view-models/wizard/icons-step/icons-step.less create mode 100644 catalog-ui/app/scripts/view-models/wizard/icons-step/icons-step.ts create mode 100644 catalog-ui/app/scripts/view-models/wizard/properties-step/properties-step.html create mode 100644 catalog-ui/app/scripts/view-models/wizard/properties-step/properties-step.less create mode 100644 catalog-ui/app/scripts/view-models/wizard/properties-step/properties-step.ts create mode 100644 catalog-ui/app/scripts/view-models/wizard/property-form/property-form-view-model-tests.ts create mode 100644 catalog-ui/app/scripts/view-models/wizard/property-form/property-form-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/wizard/property-form/property-form.html create mode 100644 catalog-ui/app/scripts/view-models/wizard/property-form/property-form.less create mode 100644 catalog-ui/app/scripts/view-models/wizard/wizard-creation-base.html create mode 100644 catalog-ui/app/scripts/view-models/wizard/wizard-creation-base.less create mode 100644 catalog-ui/app/scripts/view-models/wizard/wizard-creation-base.ts create mode 100644 catalog-ui/app/scripts/view-models/wizard/wizard-state/create-wizard.ts create mode 100644 catalog-ui/app/scripts/view-models/wizard/wizard-state/edit-wizard.ts create mode 100644 catalog-ui/app/scripts/view-models/wizard/wizard-state/import-wizard.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/activity-log/activity-log.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/activity-log/activity-log.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/activity-log/activity-log.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/attributes/attributes-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/attributes/attributes-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/attributes/attributes.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/composition-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/composition-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/composition.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/artifacts/artifacts.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/details/details-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/details/details-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/details/details.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/properties-and-attributes/properties-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/properties-and-attributes/properties-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/properties-and-attributes/properties.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/relations/relations-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/relations/relations-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/relations/relations.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/structure/structure-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/structure/structure-view.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/deployment/deployment-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/deployment/deployment-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/deployment/deployment.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/distribution/disribution-status-modal/disribution-status-modal-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/distribution/disribution-status-modal/disribution-status-modal-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/distribution/disribution-status-modal/disribution-status-modal.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/distribution/distribution-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/distribution/distribution-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/distribution/distribution.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/general/general-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/general/general-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/general/general.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/icons/icons-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/icons/icons-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/icons/icons.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/information-artifacts/information-artifacts-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/information-artifacts/information-artifacts-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/information-artifacts/information-artifacts.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/inputs/inputs.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/inputs/resource-input/resource-inputs-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/inputs/resource-input/resource-inputs-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/inputs/resource-input/resource-inputs.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/inputs/service-input/service-inputs-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/inputs/service-input/service-inputs-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/inputs/service-input/service-inputs.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/management-workflow/management-workflow-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/management-workflow/management-workflow-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/network-call-flow/network-call-flow-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/network-call-flow/network-call-flow-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/product-hierarchy/product-hierarchy-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/product-hierarchy/product-hierarchy-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/product-hierarchy/product-hierarchy.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/properties/properties-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/properties/properties-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/properties/properties.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts.less create mode 100644 catalog-ui/app/scripts/view-models/workspace/workspace-view-model.ts create mode 100644 catalog-ui/app/scripts/view-models/workspace/workspace-view.html create mode 100644 catalog-ui/app/scripts/view-models/workspace/workspace.less create mode 100644 catalog-ui/app/styles/animation.less create mode 100644 catalog-ui/app/styles/app.less create mode 100644 catalog-ui/app/styles/buttons.less create mode 100644 catalog-ui/app/styles/dark-header.less create mode 100644 catalog-ui/app/styles/fonts.less create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.eot create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.svg create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.ttf create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.woff create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.eot create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.svg create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.ttf create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.woff create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.eot create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.svg create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.ttf create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.woff create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.eot create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.svg create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.ttf create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.woff create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.eot create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.svg create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.ttf create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.woff create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.eot create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.svg create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.ttf create mode 100644 catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.woff create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/AT&T Variation ID.tab create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.eot create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.svg create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.ttf create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.woff create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.eot create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.svg create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.ttf create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.woff create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.eot create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.svg create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.ttf create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.woff create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.eot create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.svg create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.ttf create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.woff create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.eot create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.svg create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.ttf create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.woff create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.eot create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.svg create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.ttf create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.woff create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.eot create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.svg create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.ttf create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.woff create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.eot create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.svg create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.ttf create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.woff create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/demo-async.htm create mode 100644 catalog-ui/app/styles/fonts/OmnesATT/demo.htm create mode 100644 catalog-ui/app/styles/form-elements.less create mode 100644 catalog-ui/app/styles/global.less create mode 100644 catalog-ui/app/styles/images/anonymous.jpg create mode 100644 catalog-ui/app/styles/images/att_logo_white.png create mode 100644 catalog-ui/app/styles/images/relationship-icons/AttachesTo.svg create mode 100644 catalog-ui/app/styles/images/relationship-icons/BindsTo.svg create mode 100644 catalog-ui/app/styles/images/relationship-icons/ConnectedTo.svg create mode 100644 catalog-ui/app/styles/images/relationship-icons/DependsOn.svg create mode 100644 catalog-ui/app/styles/images/relationship-icons/HostedOn.svg create mode 100644 catalog-ui/app/styles/images/relationship-icons/LinksTo.svg create mode 100644 catalog-ui/app/styles/images/relationship-icons/RoutesTo.svg create mode 100644 catalog-ui/app/styles/images/relationship-icons/arrow.png create mode 100644 catalog-ui/app/styles/images/relationship-icons/arrow.svg create mode 100644 catalog-ui/app/styles/images/relationship-icons/arrow_connection_right.svg create mode 100644 catalog-ui/app/styles/images/relationship-icons/attach.png create mode 100644 catalog-ui/app/styles/images/relationship-icons/binding.png create mode 100644 catalog-ui/app/styles/images/relationship-icons/conected.png create mode 100644 catalog-ui/app/styles/images/relationship-icons/conected.svg create mode 100644 catalog-ui/app/styles/images/relationship-icons/dependency.png create mode 100644 catalog-ui/app/styles/images/relationship-icons/host.png create mode 100644 catalog-ui/app/styles/images/relationship-icons/link.png create mode 100644 catalog-ui/app/styles/images/relationship-icons/local_storage.png create mode 100644 catalog-ui/app/styles/images/relationship-icons/local_storage.svg create mode 100644 catalog-ui/app/styles/images/relationship-icons/rout.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Red_PLUS_HOVER.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_COLLABORATION-.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_COMPUTE-AS-SERVICE-.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_MESSAGING-.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_MOBILITY.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-CLOUD-.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-L-1-3.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-L-4.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NOTIFICATION-.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_ORPHAN.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_PLATFORM-AS-SERVICE-.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_SECURITY-.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_SETTING-.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_avater.png create mode 100644 catalog-ui/app/styles/images/resource-icons/Resource_Icons_STORAGE-AS-SERVICE.png create mode 100644 catalog-ui/app/styles/images/resource-icons/alcatelLucent.png create mode 100644 catalog-ui/app/styles/images/resource-icons/applicationServer.png create mode 100644 catalog-ui/app/styles/images/resource-icons/aricent.png create mode 100644 catalog-ui/app/styles/images/resource-icons/att.png create mode 100644 catalog-ui/app/styles/images/resource-icons/borderElement.png create mode 100644 catalog-ui/app/styles/images/resource-icons/broadsoft.png create mode 100644 catalog-ui/app/styles/images/resource-icons/brocade.png create mode 100644 catalog-ui/app/styles/images/resource-icons/call_controll.png create mode 100644 catalog-ui/app/styles/images/resource-icons/canvasPlusIcon-red.png create mode 100644 catalog-ui/app/styles/images/resource-icons/canvasPlusIcon.png create mode 100644 catalog-ui/app/styles/images/resource-icons/cisco.png create mode 100644 catalog-ui/app/styles/images/resource-icons/closeModule.png create mode 100644 catalog-ui/app/styles/images/resource-icons/closeModuleHover.png create mode 100644 catalog-ui/app/styles/images/resource-icons/cloud.png create mode 100644 catalog-ui/app/styles/images/resource-icons/cloudep.png create mode 100644 catalog-ui/app/styles/images/resource-icons/compute-uncertified.png create mode 100644 catalog-ui/app/styles/images/resource-icons/compute.png create mode 100644 catalog-ui/app/styles/images/resource-icons/connector.png create mode 100644 catalog-ui/app/styles/images/resource-icons/cp.png create mode 100644 catalog-ui/app/styles/images/resource-icons/database.png create mode 100644 catalog-ui/app/styles/images/resource-icons/dcae_analytics.png create mode 100644 catalog-ui/app/styles/images/resource-icons/dcae_collector.png create mode 100644 catalog-ui/app/styles/images/resource-icons/dcae_database.png create mode 100644 catalog-ui/app/styles/images/resource-icons/dcae_microservice.png create mode 100644 catalog-ui/app/styles/images/resource-icons/dcae_policy.png create mode 100644 catalog-ui/app/styles/images/resource-icons/dcae_source.png create mode 100644 catalog-ui/app/styles/images/resource-icons/dcae_utilty.png create mode 100644 catalog-ui/app/styles/images/resource-icons/default.png create mode 100644 catalog-ui/app/styles/images/resource-icons/defaulticon.png create mode 100644 catalog-ui/app/styles/images/resource-icons/ericsson.png create mode 100644 catalog-ui/app/styles/images/resource-icons/firewall.png create mode 100644 catalog-ui/app/styles/images/resource-icons/fortinet.png create mode 100644 catalog-ui/app/styles/images/resource-icons/gateway.png create mode 100644 catalog-ui/app/styles/images/resource-icons/juniper.png create mode 100644 catalog-ui/app/styles/images/resource-icons/loadBalancer.png create mode 100644 catalog-ui/app/styles/images/resource-icons/metaswitch.png create mode 100644 catalog-ui/app/styles/images/resource-icons/module.png create mode 100644 catalog-ui/app/styles/images/resource-icons/mysql.png create mode 100644 catalog-ui/app/styles/images/resource-icons/network.png create mode 100644 catalog-ui/app/styles/images/resource-icons/networkrules.png create mode 100644 catalog-ui/app/styles/images/resource-icons/nokia_siemens.png create mode 100644 catalog-ui/app/styles/images/resource-icons/objectStorage.png create mode 100644 catalog-ui/app/styles/images/resource-icons/openModule.png create mode 100644 catalog-ui/app/styles/images/resource-icons/openModuleHover.png create mode 100644 catalog-ui/app/styles/images/resource-icons/oracle.png create mode 100644 catalog-ui/app/styles/images/resource-icons/ossep.png create mode 100644 catalog-ui/app/styles/images/resource-icons/personep.png create mode 100644 catalog-ui/app/styles/images/resource-icons/port.png create mode 100644 catalog-ui/app/styles/images/resource-icons/premisesep.png create mode 100644 catalog-ui/app/styles/images/resource-icons/router.png create mode 100644 catalog-ui/app/styles/images/resource-icons/securityrules.png create mode 100644 catalog-ui/app/styles/images/resource-icons/selectedCPInstance.png create mode 100644 catalog-ui/app/styles/images/resource-icons/selectedInstance.png create mode 100644 catalog-ui/app/styles/images/resource-icons/selectedUcpeInstance.png create mode 100644 catalog-ui/app/styles/images/resource-icons/selectedVLInstance.png create mode 100644 catalog-ui/app/styles/images/resource-icons/server.png create mode 100644 catalog-ui/app/styles/images/resource-icons/tropo.png create mode 100644 catalog-ui/app/styles/images/resource-icons/ucpe.png create mode 100644 catalog-ui/app/styles/images/resource-icons/uncertified.png create mode 100644 catalog-ui/app/styles/images/resource-icons/vfw.png create mode 100644 catalog-ui/app/styles/images/resource-icons/vl.png create mode 100644 catalog-ui/app/styles/images/resource-icons/vrouter.png create mode 100644 catalog-ui/app/styles/images/resource-icons/wanx.png create mode 100644 catalog-ui/app/styles/images/service-icons/call_controll.png create mode 100644 catalog-ui/app/styles/images/service-icons/collaboration.png create mode 100644 catalog-ui/app/styles/images/service-icons/collaboration1.png create mode 100644 catalog-ui/app/styles/images/service-icons/compute.png create mode 100644 catalog-ui/app/styles/images/service-icons/defaulticon.png create mode 100644 catalog-ui/app/styles/images/service-icons/messaging.png create mode 100644 catalog-ui/app/styles/images/service-icons/mobility.png create mode 100644 catalog-ui/app/styles/images/service-icons/network_l_1-3.png create mode 100644 catalog-ui/app/styles/images/service-icons/network_l_4.png create mode 100644 catalog-ui/app/styles/images/service-icons/notification.png create mode 100644 catalog-ui/app/styles/images/service-icons/platform.png create mode 100644 catalog-ui/app/styles/images/service-icons/storage.png create mode 100644 catalog-ui/app/styles/images/service-icons/uncertified.png create mode 100644 catalog-ui/app/styles/images/sprites/sprite-global-old.png create mode 100644 catalog-ui/app/styles/images/sprites/sprite-global.png create mode 100644 catalog-ui/app/styles/images/sprites/sprite-product-icons.png create mode 100644 catalog-ui/app/styles/images/sprites/sprite-resource-icons.png create mode 100644 catalog-ui/app/styles/images/sprites/sprite-services-icons.png create mode 100644 catalog-ui/app/styles/images/sprites/tlv-sprite.png create mode 100644 catalog-ui/app/styles/images/tutorial/10.png create mode 100644 catalog-ui/app/styles/images/tutorial/11.png create mode 100644 catalog-ui/app/styles/images/tutorial/13.png create mode 100644 catalog-ui/app/styles/images/tutorial/14.png create mode 100644 catalog-ui/app/styles/images/tutorial/15.png create mode 100644 catalog-ui/app/styles/images/tutorial/16.png create mode 100644 catalog-ui/app/styles/images/tutorial/17.png create mode 100644 catalog-ui/app/styles/images/tutorial/18.png create mode 100644 catalog-ui/app/styles/images/tutorial/19.png create mode 100644 catalog-ui/app/styles/images/tutorial/2.png create mode 100644 catalog-ui/app/styles/images/tutorial/20.png create mode 100644 catalog-ui/app/styles/images/tutorial/21.png create mode 100644 catalog-ui/app/styles/images/tutorial/22.png create mode 100644 catalog-ui/app/styles/images/tutorial/23.png create mode 100644 catalog-ui/app/styles/images/tutorial/24.png create mode 100644 catalog-ui/app/styles/images/tutorial/25.png create mode 100644 catalog-ui/app/styles/images/tutorial/26.png create mode 100644 catalog-ui/app/styles/images/tutorial/27.png create mode 100644 catalog-ui/app/styles/images/tutorial/28.png create mode 100644 catalog-ui/app/styles/images/tutorial/29.png create mode 100644 catalog-ui/app/styles/images/tutorial/3.png create mode 100644 catalog-ui/app/styles/images/tutorial/30.png create mode 100644 catalog-ui/app/styles/images/tutorial/4.png create mode 100644 catalog-ui/app/styles/images/tutorial/5.png create mode 100644 catalog-ui/app/styles/images/tutorial/6.png create mode 100644 catalog-ui/app/styles/images/tutorial/7.png create mode 100644 catalog-ui/app/styles/images/tutorial/8.png create mode 100644 catalog-ui/app/styles/images/welcome.png create mode 100644 catalog-ui/app/styles/images/welcome/SD&C_Welcome15.jpg create mode 100644 catalog-ui/app/styles/images/welcome/SD&C_Welcome15_b.jpg create mode 100644 catalog-ui/app/styles/images/welcome/bg/001.jpg create mode 100644 catalog-ui/app/styles/images/welcome/bg/002.jpg create mode 100644 catalog-ui/app/styles/images/welcome/bg/002.png create mode 100644 catalog-ui/app/styles/images/welcome/bg/003.png create mode 100644 catalog-ui/app/styles/images/welcome/bg/004.png create mode 100644 catalog-ui/app/styles/images/welcome/bg/bg02.png create mode 100644 catalog-ui/app/styles/images/welcome/bg/bg03.png create mode 100644 catalog-ui/app/styles/images/welcome/bg/connection02.png create mode 100644 catalog-ui/app/styles/images/welcome/bg/connection03.png create mode 100644 catalog-ui/app/styles/images/welcome/bg/connection04.png create mode 100644 catalog-ui/app/styles/images/welcome/bg/global.png create mode 100644 catalog-ui/app/styles/images/welcome/bg/shape02.png create mode 100644 catalog-ui/app/styles/images/welcome/bg/shape03.png create mode 100644 catalog-ui/app/styles/images/welcome/bg/shape04.png create mode 100644 catalog-ui/app/styles/images/welcome/bg/shape05.png create mode 100644 catalog-ui/app/styles/images/welcome/laptop.png create mode 100644 catalog-ui/app/styles/images/welcome/logo_att.png create mode 100644 catalog-ui/app/styles/images/welcome/sprite.png create mode 100644 catalog-ui/app/styles/images/welcome/ss-01.png create mode 100644 catalog-ui/app/styles/images/welcome/ss-02.png create mode 100644 catalog-ui/app/styles/images/welcome/ss-03.png create mode 100644 catalog-ui/app/styles/layout/header.less create mode 100644 catalog-ui/app/styles/layout/main.less create mode 100644 catalog-ui/app/styles/layout/sidebar.less create mode 100644 catalog-ui/app/styles/mixins.less create mode 100644 catalog-ui/app/styles/mixins_old.less create mode 100644 catalog-ui/app/styles/modal.less create mode 100644 catalog-ui/app/styles/scroller.less create mode 100644 catalog-ui/app/styles/sprite-old.less create mode 100644 catalog-ui/app/styles/sprite-product-icons.less create mode 100644 catalog-ui/app/styles/sprite-resource-icons.less create mode 100644 catalog-ui/app/styles/sprite-services-icons.less create mode 100644 catalog-ui/app/styles/sprite.html create mode 100644 catalog-ui/app/styles/sprite.less create mode 100644 catalog-ui/app/styles/table-flex.less create mode 100644 catalog-ui/app/styles/tlv-buttons.less create mode 100644 catalog-ui/app/styles/tlv-checkbox.less create mode 100644 catalog-ui/app/styles/tlv-loader.less create mode 100644 catalog-ui/app/styles/tlv-sprite.less create mode 100644 catalog-ui/app/styles/tooltips.less create mode 100644 catalog-ui/app/styles/variables-old.less create mode 100644 catalog-ui/app/styles/variables.less create mode 100644 catalog-ui/app/styles/welcome-sprite.less create mode 100644 catalog-ui/app/styles/welcome-style.less create mode 100644 catalog-ui/app/third-party/PunchOutRegistry.js create mode 100644 catalog-ui/app/third-party/ng-infinite-scroll/.npmignore create mode 100644 catalog-ui/app/third-party/ng-infinite-scroll/.travis.yml create mode 100644 catalog-ui/app/third-party/ng-infinite-scroll/Gruntfile.coffee create mode 100644 catalog-ui/app/third-party/ng-infinite-scroll/LICENSE create mode 100644 catalog-ui/app/third-party/ng-infinite-scroll/README.md create mode 100644 catalog-ui/app/third-party/ng-infinite-scroll/bower.json create mode 100644 catalog-ui/app/third-party/ng-infinite-scroll/build/ng-infinite-scroll.js create mode 100644 catalog-ui/app/third-party/ng-infinite-scroll/build/ng-infinite-scroll.min.js create mode 100644 catalog-ui/app/third-party/ng-infinite-scroll/package.json create mode 100644 catalog-ui/app/third-party/ng-infinite-scroll/src/infinite-scroll.coffee create mode 100644 catalog-ui/app/third-party/ng-infinite-scroll/test/protractor-local.conf.js create mode 100644 catalog-ui/app/third-party/ng-infinite-scroll/test/protractor-shared.conf.js create mode 100644 catalog-ui/app/third-party/ng-infinite-scroll/test/protractor-travis.conf.js create mode 100644 catalog-ui/app/third-party/ng-infinite-scroll/test/spec/ng-infinite-scroll.spec.coffee create mode 100644 catalog-ui/bower dependecies create mode 100644 catalog-ui/bower.json create mode 100644 catalog-ui/build_catalog_ui.bat create mode 100644 catalog-ui/build_catalog_ui.sh create mode 100644 catalog-ui/configurations/MenuReadMe.txt create mode 100644 catalog-ui/configurations/dev.json create mode 100644 catalog-ui/configurations/menu.json create mode 100644 catalog-ui/configurations/mock.json create mode 100644 catalog-ui/configurations/prod.json create mode 100644 catalog-ui/docs/colors.jpg create mode 100644 catalog-ui/non_bower_components/cytoscape.js-edge-editation/CytoscapeEdgeEditation.js create mode 100644 catalog-ui/non_bower_components/cytoscape.js-edge-editation/README.md create mode 100644 catalog-ui/non_bower_components/cytoscape.js-edge-editation/index.html create mode 100644 catalog-ui/package.json create mode 100644 catalog-ui/pom.xml create mode 100644 catalog-ui/server-mock/mock-data/artifact/artifact-types.json create mode 100644 catalog-ui/server-mock/mock-data/category/category.json create mode 100644 catalog-ui/server-mock/mock-data/element/element.json create mode 100644 catalog-ui/server-mock/mock-data/resource/properties.json create mode 100644 catalog-ui/server-mock/mock-data/resource/resource.json create mode 100644 catalog-ui/server-mock/mock-data/resources/resourcesAbstract.json create mode 100644 catalog-ui/server-mock/mock-data/resources/resourcesNotAbstract.json create mode 100644 catalog-ui/server-mock/mock-data/template/template.json create mode 100644 catalog-ui/server-mock/mock-data/user/user.json create mode 100644 catalog-ui/server-mock/mock-server.js create mode 100644 catalog-ui/server-mock/routes/property.js create mode 100644 catalog-ui/server-mock/routes/resource.js create mode 100644 catalog-ui/server-mock/routes/resources.js create mode 100644 catalog-ui/server-mock/routes/template.js create mode 100644 catalog-ui/server-mock/routes/user.js create mode 100644 catalog-ui/tests/karma.unit.conf.js create mode 100644 catalog-ui/tsd.json create mode 100644 catalog-ui/tslint.json create mode 100644 catalog-ui/typings/angular-ui-bootstrap/angular-ui-bootstrap.d.ts create mode 100644 catalog-ui/typings/angular-ui-router/angular-ui-router.d.ts create mode 100644 catalog-ui/typings/angularjs/angular-mocks.d.ts create mode 100644 catalog-ui/typings/angularjs/angular-resource.d.ts create mode 100644 catalog-ui/typings/angularjs/angular.d.ts create mode 100644 catalog-ui/typings/angularjs/restangular.d.ts create mode 100644 catalog-ui/typings/cytoscape/cytoscape-extension.js create mode 100644 catalog-ui/typings/cytoscape/cytoscape-extension.js.map create mode 100644 catalog-ui/typings/cytoscape/cytoscape-extension.ts create mode 100644 catalog-ui/typings/cytoscape/cytoscape.d.ts create mode 100644 catalog-ui/typings/cytoscape/edge-editation.d.ts create mode 100644 catalog-ui/typings/d3/d3.d.ts create mode 100644 catalog-ui/typings/jasmine/jasmine.d.ts create mode 100644 catalog-ui/typings/jquery/jquery.d.ts create mode 100644 catalog-ui/typings/jsMd5/md5.d.ts create mode 100644 catalog-ui/typings/lodash/lodash.d.ts create mode 100644 catalog-ui/typings/notifyjs/notifyjs.d.ts create mode 100644 catalog-ui/typings/tsd.d.ts (limited to 'catalog-ui') diff --git a/catalog-ui/Gruntfile.js b/catalog-ui/Gruntfile.js new file mode 100644 index 0000000000..619d8316a1 --- /dev/null +++ b/catalog-ui/Gruntfile.js @@ -0,0 +1,807 @@ +// Generated on 2015-04-28 using +// generator-webapp 0.5.1 +'use strict'; + +// # Globbing +// for performance reasons we're only matching one level down: +// 'test/spec/{,*/}*.js' +// If you want to recursively match all subfolders, use: +// 'test/spec/**/*.js' + +module.exports = function (grunt) { + + // Time how long tasks take. Can help when optimizing build times + require('time-grunt')(grunt); + + // Load grunt tasks automatically + require('load-grunt-tasks')(grunt); + + // Configurable paths + var config = { + app: 'app', + appModuleName: 'sdcApp', + dist: 'app/dist' + }; + + // Define the configuration for all the tasks + grunt.initConfig({ + + // Project settings + config: config, + + // Watches files for changes and runs tasks based on the changed files + watch: { + html: { + files: ['<%= config.app %>/scripts/**/*.html'], + tasks: ['ngtemplates:app'] + }, + less: { + files: ['<%= config.app %>/**/*.less'], + tasks: ['less:all'] + }, + ts: { + files: ['<%= config.app %>/scripts/**/*.ts'], + tasks: ['ts:all'] + }, + bower: { + files: ['bower.json'], + tasks: ['wiredep'] + }, + + gruntfile: { + files: ['Gruntfile.js'] + }, + + livereload: { + options: { + livereload: '<%= connect.options.livereload %>' + }, + files: [ + '<%= config.app %>/{,*/}*.html', + '<%= config.app %>/scripts/**/*.html', + '<%= config.app %>/scripts/**/*.css', + '.tmp/styles/{,*/}*.css', + '<%= config.app %>/images/{,*/}*' + ] + }, + configurations: { + files: [ + 'configurations/*.json' + ], + tasks: ['ngconstant'] + } + }, + + ngconstant: { + options: { + dest: 'app/scripts/modules/configurations.js', + name: 'Sdc.Config' + }, + main: { + constants: { + sdcConfig: grunt.file.readJSON(grunt.option('env') ? 'configurations/' + grunt.option('env') + '.json' : 'configurations/prod.json'), + sdcMenu: grunt.file.readJSON('configurations/menu.json') + } + } + }, + + express: { + options: { + port: process.env.PORT || 9000 + }, + mock: { + options: { + script: 'server-mock/mock-server.js' + } + } + }, + + ts: { + all: { + src: [ + 'app/scripts/**/*.ts', + 'typings/**/*.ts' + ], + reference: 'app/scripts/references.ts' + }, + single: { + src: [] + } + }, + ngtemplates: { + app: { + options: { + module: '<%= config.appModuleName %>', + prefix: '/' + }, + src: [ + '<%= config.app %>/scripts/**/*.html', + '!index.html' + ], + dest: '<%= config.app %>/scripts/templates.js' + } + }, + less: { + all: { + options: { + paths: ['<%= config.app %>/scripts', + '<%= config.app %>/styles'] + }, + files: { + '<%= config.app %>/styles/app.css': '<%= config.app %>/styles/app.less' + } + }, + single: { + paths: ['<%= config.app %>/scripts', + '<%= config.app %>/styles'], + files: [] + } + }, + + injector: { + options: {}, + // Inject application script files into index.html (doesn't include bower) + scripts_models: { + options: { + transform: function (filePath) { + filePath = filePath.replace('/app/', ''); + return ''; + }, + starttag: '', + endtag: '' + }, + files: { + '<%= config.app %>/index.html': [ + [ + '<%= config.app %>/scripts/models/**/*.js', + '!<%= config.app %>/scripts/models/**/*-tests.js' + ] + ] + } + }, + + scripts_utils: { + options: { + transform: function (filePath) { + filePath = filePath.replace('/app/', ''); + return ''; + }, + starttag: '', + endtag: '' + }, + files: { + '<%= config.app %>/index.html': [ + [ + '<%= config.app %>/scripts/utils/**/*.js', + '!<%= config.app %>/scripts/models/**/*-tests.js' + ] + ] + } + }, + + scripts_filters: { + options: { + transform: function (filePath) { + filePath = filePath.replace('/app/', ''); + return ''; + }, + starttag: '', + endtag: '' + }, + files: { + '<%= config.app %>/index.html': [ + ['<%= config.app %>/scripts/filters/**/*.js', + '!<%= config.app %>/scripts/filters/**/*-tests.js' + ] + ] + } + }, + + scripts_directives: { + options: { + transform: function (filePath) { + filePath = filePath.replace('/app/', ''); + return ''; + }, + starttag: '', + endtag: '' + }, + files: { + '<%= config.app %>/index.html': [ + ['<%= config.app %>/scripts/directives/**/*.js', + '!<%= config.app %>/scripts/directives/**/*-tests.js' + ] + ] + } + }, + + scripts_services: { + options: { + transform: function (filePath) { + filePath = filePath.replace('/app/', ''); + return ''; + }, + starttag: '', + endtag: '' + }, + files: { + '<%= config.app %>/index.html': [ + ['<%= config.app %>/scripts/services/**/*.js', + '!<%= config.app %>/scripts/services/**/*-tests.js' + ] + ] + } + }, + + scripts_view_models: { + options: { + transform: function (filePath) { + filePath = filePath.replace('/app/', ''); + return ''; + }, + starttag: '', + endtag: '' + }, + files: { + '<%= config.app %>/index.html': [ + ['<%= config.app %>/scripts/view-models/**/*.js', + '!<%= config.app %>/scripts/view-models/**/*-tests.js'] + ] + } + }, + + // Inject component less into app.less + less: { + options: { + transform: function (filePath) { + filePath = filePath.replace('/app/scripts/', '../scripts/'); + filePath = filePath.replace('/app/styles/', ''); + return '@import \'' + filePath + '\';'; + }, + starttag: '// injector:less', + endtag: '// endinjector:less' + }, + files: { + '<%= config.app %>/styles/app.less': [ + '<%= config.app %>/styles/**/*.less', + '<%= config.app %>/scripts/**/*.less', + '!<%= config.app %>/styles/app.less' + ] + } + }, + + // Inject component css into index.html + css: { + options: { + transform: function (filePath) { + filePath = filePath.replace('/app/', ''); + filePath = filePath.replace('/.tmp/', ''); + return ''; + }, + starttag: '', + endtag: '' + }, + files: { + '<%= config.app %>/index.html': [ + '<%= config.app %>/scripts/**/*.css', + '<%= config.app %>/styles/**/*.css', + '!<%= config.app %>/styles/app.css' + ] + } + } + }, + + // The actual grunt server settings + connect: { + options: { + port: 9000, + open: true, + livereload: 35729, + // Change this to '0.0.0.0' to access the server from outside + hostname: 'localhost' + }, + livereload: { + options: { + middleware: function (connect) { + return [ + connect().use(function (req, res, next) { + var mockApis = require('./configurations/mock.json').sdcConfig; + var userType; + switch (grunt.option('role')) { + case "admin": + userType = mockApis.userTypes.admin; + break; + case "tester": + userType = mockApis.userTypes.tester; + break; + case "governor": + userType = mockApis.userTypes.governor; + break; + case "ops": + userType = mockApis.userTypes.ops; + break; + case "designer": + userType = mockApis.userTypes.designer; + break; + case "product_strategist": + userType = mockApis.userTypes.product_strategist; + break; + case "product_manager": + userType = mockApis.userTypes.product_manager; + break; + default: + userType = mockApis.userTypes.designer; + } + res.cookie(mockApis.cookie.userIdSuffix, req.headers[mockApis.cookie.userIdSuffix] || userType.userId); + res.cookie(mockApis.cookie.userEmail, req.headers[mockApis.cookie.userEmail] || userType.email); + res.cookie(mockApis.cookie.userFirstName, req.headers[mockApis.cookie.userFirstName] || userType.firstName); + res.cookie(mockApis.cookie.userLastName, req.headers[mockApis.cookie.userLastName] || userType.lastName); + next(); + }), + connect().use(require('http-proxy-middleware')(['/onboarding', '/onboarding-api'], { + target: 'http://feHost:8181/', + changeOrigin: true, + secure: false + })), + connect().use('/bower_components', connect.static('./bower_components')), + connect().use('/non_bower_components', connect.static('./non_bower_components')), + connect.static(config.app) + ]; + } + } + }, + dist: { + options: { + base: '<%= config.dist %>', + livereload: false + } + } + }, + + // Empties folders to start fresh + clean: { + generated: { + files: [{ + dot: true, + src: [ + '<%= config.app %>/scripts/**/*.js', + '<%= config.app %>/scripts/**/*.css', + '!<%= config.app %>/scripts/**/welcome/styles/*.css', + '<%= config.app %>/styles/**/*.css', + '<%= config.app %>/scripts/**/*.js.map' + ] + }] + }, + dist: { + files: [{ + dot: true, + src: [ + '.tmp', + '<%= config.dist %>/*', + '!<%= config.dist %>/.git*' + ] + }] + }, + server: '.tmp' + }, + // Add vendor prefixed styles + autoprefixer: { + options: { + browsers: ['> 1%', 'last 2 versions', 'Firefox ESR', 'Opera 12.1'] + }, + dist: { + files: [{ + expand: true, + cwd: '.tmp/css/', + src: '{,*/**/}*.css', + dest: '.tmp/css/' + }] + } + }, + + // Automatically inject Bower components into the HTML file + wiredep: { + app: { + ignorePath: /^\/|\.\.\//, + src: ['<%= config.app %>/index.html'] + } + }, + + // Renames files for browser caching purposes + rev: { + dist: { + files: { + src: [ + '<%= config.dist %>/scripts/{,*/}*.js', + '<%= config.dist %>/styles/{,*/}*.css', + '<%= config.dist %>/images/{,*/}*.*', + '!<%= config.dist %>/images/resource-icons/{,*/}*.*', + '!<%= config.dist %>/images/service-icons/{,*/}*.*', + '!<%= config.dist %>/images/relationship-icons/{,*/}*.*', + '<%= config.dist %>/*.{ico,png}' + ] + } + } + }, + + // Reads HTML for usemin blocks to enable smart builds that automatically + // concat, minify and revision files. Creates configurations in memory so + // additional tasks can operate on them + useminPrepare: { + options: { + dest: '<%= config.dist %>' + }, + sdc: { + src: ['<%= config.app %>/index.html'] + }, + html: '<%= config.app %>/index.html' + }, + + // Performs rewrites based on rev and the useminPrepare configuration + usemin: { + options: { + assetsDirs: [ + '<%= config.dist %>', + '<%= config.dist %>/images', + '<%= config.dist %>/styles' + ], + // This is so we update image references in our ng-templates + patterns: { + js: [ + [/(assets\/images\/.*?\.(?:gif|jpeg|jpg|png|webp|svg))/gm, 'Update the JS to reference our revved images'] + ] + } + }, + html: ['<%= config.dist %>/{,*/}*.html'], + css: ['<%= config.dist %>/styles/{,*/}*.css'], + js: ['<%= config.dist %>/public/{,*/}*.js'] + }, + + // The following *-min tasks produce minified files in the dist folder + imagemin: { + dist: { + files: [{ + expand: true, + cwd: '<%= config.app %>/images', + src: '<%= config.app %>/**/*.{gif,jpeg,jpg,png}', + dest: '<%= config.dist %>/images' + }] + } + }, + + svgmin: { + dist: { + files: [{ + expand: true, + cwd: '<%= config.app %>/images', + src: '{,*/}*.svg', + dest: '<%= config.dist %>/images' + }] + } + }, + + htmlmin: { + dist: { + options: { + collapseBooleanAttributes: true, + collapseWhitespace: true, + conservativeCollapse: true, + removeAttributeQuotes: true, + removeCommentsFromCDATA: true, + removeEmptyAttributes: true, + removeOptionalTags: true, + removeRedundantAttributes: true, + useShortDoctype: true + }, + files: [{ + expand: true, + cwd: '<%= config.dist %>', + src: '{,*/}*.html', + dest: '<%= config.dist %>' + }] + } + }, + +// By default, your `index.html`'s will take care +// of minification. These next options are pre-configured if you do not +// wish to use the Usemin blocks. + cssmin: { + dist: { + files: { + '<%= config.dist %>/styles/main.css': [ + '.tmp/css/{,*/**/}*.css', + '<%= config.app %>/scripts/{,*/**/}*.css', + '<%= config.app %>/styles/app.css' + ] + } + } + }, + uglify: { + dist: { + files: { + '<%= config.dist %>/scripts/scripts.js': [ + '<%= config.dist %>/scripts/scripts.js' + ] + } + } + }, + replace: { + cssReplace: { + src: ['<%= config.app %>/scripts/{,*/**/}*.css', + '<%= config.app %>/styles/{,*/**/}*.css'], + overwrite: true, + replacements: [ + { + from: '../../../images/', + to: '../images/' + }, + { + from: '../../images/', + to: '../images/' + }, + { + from: '../../../fonts/', + to: '../fonts/' + }, + { + from: '../../fonts/', + to: '../fonts/' + }, + { + from: '../../../styles/images/', + to: 'images/' + } + ] + }, + }, + concat: { + dist: { + options: { + separator: ';\n' + }, + src: ['<%= config.app %>/scripts/{,*/**/}*.js'], + dest: '.tmp/concat/scripts/scripts.js' + }, + generated: { + options: { + separator: '\n' + } + } + }, + + // Copies remaining files to places other tasks can use + copy: { + dist: { + files: [{ + expand: true, + dot: true, + cwd: '<%= config.app %>', + dest: '<%= config.dist %>', + src: [ + '*.{ico,png,txt}', + '.htaccess', + // 'bower_components/**/*', + 'styles/images/**/*', + 'styles/fonts/**/*', + 'languages/**/*', + 'index.html' + ] + }, { + src: 'node_modules/apache-server-configs/dist/.htaccess', + dest: '<%= config.dist %>/.htaccess' + }, + { + expand: true, + cwd: '.tmp/images', + dest: '<%= config.dist %>/images', + src: ['generated/*'] + }, + //TODO to remove this section after integration onboard finished + { + expand: true, + cwd: '<%= config.app %>/third-party', + dest: '<%= config.dist %>/third-party', + src: ['onboard_bundle_full.js'] + }, + { + expand: true, + dest: '<%= config.dist %>', + src: [ + 'package.json' + ] + } + ] + }, + styles: { + expand: true, + cwd: '<%= config.app %>/styles', + dest: '.tmp/css/', + src: '{,*/**/}*.css' + } + }, + + // Run some tasks in parallel to speed up build process + concurrent: { + server: ['copy:styles'], + test: ['copy:styles'], + dist: [ + 'copy:styles', + 'imagemin' + ] + }, + + // Test settings + karma: { + dev: { + configFile: "tests/karma.unit.conf.js", + singleRun: true, + options: { + browsers: ['Chrome'], + coverageReporter: { + type: 'html', + dir: 'tests/Coverage' + } + } + }, + debug: { + configFile: "tests/karma.unit.conf.js", + singleRun: false, + //comment out this line if you want to cancel the watch and see the UT log + background: true, + options: { + browsers: ['Chrome'], + reporters: [ + 'junit', + 'dots', + 'progress' + ] + } + }, + jenkins: { + configFile: "tests/karma.unit.conf.js", + singleRun: true, + options: { + browsers: ['PhantomJS'], + coverageReporter: { + type: 'text-summary', + dir: 'tests/Coverage', + file: 'coverage.txt' + } + } + } + }, + + tslint: { + options: { + configuration: 'tslint.json' + }, + files: { + src: ['<%= config.app %>/**/*.ts'] + } + } + }); + + grunt.registerTask('serve', 'start the server and preview your app, --allow-remote for remote access', function (target) { + + var env = grunt.option('env'); + + if (grunt.option('allow-remote')) { + grunt.config.set('connect.options.hostname', '0.0.0.0'); + } + if (target === 'dist') { + return grunt.task.run(['build', 'connect:dist:keepalive']); + } + + + if (env === 'mock') { + grunt.task.run([ + 'express:mock', + 'clean:generated', + 'ts:all', + 'ngtemplates:app', + 'injector', + 'less:all', + 'ngconstant', + 'wiredep', + 'concurrent:server', + 'autoprefixer', + 'connect:livereload', + 'watch:html', + 'watch:less' + ]); + } + + grunt.task.run([ + 'clean:generated', + 'ts:all', + 'ngtemplates:app', + 'injector', + 'less:all', + 'ngconstant', + 'wiredep', + 'concurrent:server', + 'autoprefixer', + 'connect:livereload', + 'watch' + ]); + }); + + grunt.registerTask('build', [ + 'clean:generated', + 'less:all', + 'ts:all', + 'ngconstant', + 'ngtemplates:app', + 'wiredep', + 'replace', + 'clean:dist', + 'useminPrepare:sdc', + 'concurrent:dist', + 'autoprefixer:dist', + 'concat', + 'copy:dist', + 'cssmin', + 'uglify', + 'rev', + 'usemin' + ]); + + grunt.registerTask("test", function (target) { + + if (!(target === 'debug' || target === 'dev' || target === 'jenkins')) { + throw new Error("target available for test are "); + } + var tasks = [ + // "tslint:karma", + // "ngconstant", + //// "concurrent:test", + // "servicesIconConstants", + // "autoprefixer", + // "ngtemplates:testsTemplates", + // "connect:test" + ]; + + tasks.push('karma:' + target); + if (target === 'debug') { + if (grunt.config.get('watch.ts')) { + tasks.push("watch:ts"); + } else { + throw new Error("target watch:ts is not available, verify that it exists in your Gruntfile"); + } + } + grunt.task.run(tasks); + }); + + + var lessSingleTask = function (filePath) { + var lessSingleFiles = [{ + expand: true, + src: [filePath.replace(/\\/g, '/')], + ext: '.css' + }]; + grunt.config('less.single.files', lessSingleFiles); + grunt.config('watch.less.tasks', 'less:single'); + + }; + + var tsSingleTask = function (filePath) { + + var tsSingleData = { + src: [filePath.replace(/\\/g, '/')] + }; + // grunt.config('ts.single', tsSingleData); + + }; + + var singleTaskByTaskName = { + //less: lessSingleTask, + ts: tsSingleTask + }; + + var onGruntWatchEvent = function (action, filepath, target) { + if (singleTaskByTaskName[target]) { + singleTaskByTaskName[target].call(undefined, filepath); + } + }; + grunt.event.on('watch', onGruntWatchEvent); +}; diff --git a/catalog-ui/SETTING-ENVIRONMENT.md b/catalog-ui/SETTING-ENVIRONMENT.md new file mode 100644 index 0000000000..edccca1304 --- /dev/null +++ b/catalog-ui/SETTING-ENVIRONMENT.md @@ -0,0 +1,36 @@ +# Prerequisites + +1. install [node.js](http://nodejs.org/download/) +2. install [git](http://git-scm.com/). __Make sure to select the option to add git into $PATH__ +3. install grunt with dependencies `npm install -g bower grunt-cli` + + if running on MacOS/Linux the command should be run with `sudo` + +# Running the server + +Make sure all the client and npm dependencies installed by running the following commands: + +1. `npm install` +2. `bower install` + + + +You are then presented with 3 options `ngnix`, `test`, `build` + +1. `grunt serve --env=mock` will setup a dev(nginx) server under `http://localhost:9000` with mock configurations. The are also `grunt serve:test` and `grunt serve:prod` options +2. `grunt test` will run all the unit tests in the project +3. `grunt build` will run a build process resulting with a `dist/` folder including the version ready to be deployed (this task should be mainly run on the CI server) +3. `grunt build:dev` will deploy to nginx a production artifact, (minify files) + +# Webstorm + +Although any text editor can be used to write angular applications Webstorm is the most convenient for the task. In case Webstorm is chosen make sure it has the following plugins: + +* `.editorconfig` - this plugin will keep line indentation same across all developers +* `angular.js` - this plugin will help autocompleting angular syntax +* `markdown` - this one will give nice support to write .md files such as this one you are reading right now + +These can be found in plugins settings section by pressing PC: `CTRL + SHIFT + A` MAC: `CMD + SHIFT + A` and typing addons + + +--> DO NOT COMMIT ANYTHING BEFORE RUNNING grunt build / grunt nginx / grunt nginx:mock --env=mock <-- diff --git a/catalog-ui/SETTING-MOCK-SERVER.md b/catalog-ui/SETTING-MOCK-SERVER.md new file mode 100644 index 0000000000..5db508f225 --- /dev/null +++ b/catalog-ui/SETTING-MOCK-SERVER.md @@ -0,0 +1,53 @@ +# Prerequisites + +1. install [node.js](http://nodejs.org/download/) +2. install [git](http://git-scm.com/). __Make sure to select the option to add git into $PATH__ +3. install dependencies [express,cors] npm install express, npm install cors + + + +# Create the server file +Example: + +############################################# +ar express = require('express'); +var mockUris = require('../configurations/mock.json'); +var cors = require('cors'); + + +var app = express(); + +// declare server cross browser +app.use(cors({ + origin: '*', + methods: 'GET, POST, PUT, DELETE', + allowedHeaders: 'Content-Type,Authorization,If-Modified-Since' +})); + +/******************************************* MOCKS ENPOINTS *************************************************/ +/* poiFind */ +app.get('/v1' + mockUris.generalConf.getPoiFind.split('v1')[1], function (req, res) { + var pois = require('./data/poi/poi-search.json'); // the json response for the api call + res.send(pois); +}); + +/**************************************************** *******************************************************/ +// declare server listener port +var server = app.listen(9999, function () { + console.log('mock server listening on port %d', server.address().port); +}); + +################################ + +#create mockDate + +1. create json file with the response. +2. add the api end point in the server file and declare the json file for the response/ + + + +# Running the server + +1. go to server file folder +2. run command : node + diff --git a/catalog-ui/app/_favicon.png b/catalog-ui/app/_favicon.png new file mode 100644 index 0000000000..6e9f04df69 Binary files /dev/null and b/catalog-ui/app/_favicon.png differ diff --git a/catalog-ui/app/index.html b/catalog-ui/app/index.html new file mode 100644 index 0000000000..f56fdfd256 --- /dev/null +++ b/catalog-ui/app/index.html @@ -0,0 +1,392 @@ + + + + + SDC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Signing in

+

Please wait. If you are using Internet Explorer, please reattempt access using Chrome or + Firefox.

+ +

+ +
+
+ + + +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/catalog-ui/app/languages/en_US_OS.json b/catalog-ui/app/languages/en_US_OS.json new file mode 100644 index 0000000000..d7f639e076 --- /dev/null +++ b/catalog-ui/app/languages/en_US_OS.json @@ -0,0 +1,420 @@ +{ + "=========== VALIDATION ===========": "", + "VALIDATION_ERROR_MAX_LENGTH": "Max length {{max}} characters.", + "VALIDATION_ERROR_MIN_LENGTH": "Min length {{min}} characters.", + "VALIDATION_ERROR_REQUIRED": "{{field}} is required.", + "VALIDATION_ERROR_SPECIAL_CHARS_NOT_ALLOWED": "Special characters not allowed.", + "LABEL_MAX_SIZE_XX": "Max size is up to {{size}}", + "LABEL_ALL_FIELDS_ARE_MANDATORY": "All fields are mandatory.", + "VALIDATION_ERROR_BOOLEAN": "Value should be 'TRUE' or 'FALSE'.", + "VALIDATION_ERROR_TYPE": "Value should be of type {{type}}.", + "VALIDATION_ERROR_MAX_LENGTH_NOT_INCLUDING_NAME": "Max length {{max}} characters (including name length).", + "VALIDATION_ERROR_MAX_FILE_SIZE": "Max file size is 10 MB.", + "VALIDATION_ERROR_EMPTY_FILE": "The file you uploaded was empty, please upload a valid file.", + "VALIDATION_ERROR_VALUE_MUST_BE_CHANGED": "Value must be changed", + + "=========== GENERAL ===========": "", + "GENERAL_LABEL_TYPE": "Type:", + "GENERAL_LABEL_VERSION": "Version:", + "GENERAL_LABEL_CATEGORY": "Category:", + "GENERAL_LABEL_SUB_CATEGORY": "Sub Category:", + "GENERAL_LABEL_CREATION_DATE": "Creation Date:", + "GENERAL_LABEL_AUTHOR": "Author:", + "GENERAL_LABEL_CONTACT_ID": "Contact ID:", + "GENERAL_LABEL_STATUS": "Status:", + "GENERAL_LABEL_PROJECT_CODE": "Project code:", + "GENERAL_LABEL_DESCRIPTION": "Description:", + "GENERAL_LABEL_TAGS": "Tags:", + "GENERAL_LABEL_RESOURCE_TYPE": "Resource Type:", + "GENERAL_LABEL_VENDOR_NAME": "Vendor Name:", + "GENERAL_LABEL_VENDOR_RELEASE": "Vendor Release:", + "GENERAL_LABEL_LICENSE_TYPE": "License Type:", + "GENERAL_LABEL_SERVICE": "Service:", + "GENERAL_LABEL_RESOURCE": "Resource:", + "GENERAL_LABEL_PRODUCT": "Product:", + + "=========== GENERAL ERROR PAGES ===========": "", + "GENERAL_ERROR_403_TITLE": "SDC", + "GENERAL_ERROR_403_DESCRIPTION": "Sorry, You are not authorized to view this page, Please contact the Service Design and Creation administrator for access permission.", + + "=========== ERROR VIEW MODEL ===========": "", + "ADMIN_EMAIL": "", + "EMAIL_SUBJECT_PREFIX": "SDC Access Request for", + + "=========== TOP MENU ===========": "", + "TOP_MENU_HOME_BUTTON": "HOME", + "TOP_MENU_CATALOG_BUTTON": "CATALOG", + "TOP_MENU_ON_BOARD_BUTTON": "ONBOARD", + + "=========== SIGN IN PAGE ===========": "", + "SIGN_IN_CAPTION": "Signing in", + "SIGN_IN_DESCRIPTION": "Please wait. If you are using Internet Explorer, please reattempt access using Chrome or Firefox.", + + "=========== TUTORIAL PAGE ===========": "", + "TUTRIAL_GENERAL_PREVIOUS_BUTTON": "prev", + "TUTRIAL_GENERAL_NEXT_BUTTON": "next", + "TUTRIAL_GENERAL_SKIP_BUTTON": "skip", + "TUTRIAL_GENERAL_CLOSE_BUTTON": "close", + "TUTRIAL_GENERAL_NEXT_BUTTON_END": "done", + + "TUTRIAL_GENERAL_TAB_1": "Workspace", + "TUTRIAL_GENERAL_TAB_2": "Catalog", + "TUTRIAL_GENERAL_TAB_3": "Design Studio", + + "TUTORIAL_PAGE1_TITLE": "Your Personal Workspace", + "TUTORIAL_PAGE1_TEXT": "SDC keeps track of the Resources and Services you are assigned to work on. You access these assets directly from your Workspace.", + + "TUTORIAL_PAGE2_TITLE": "Folders", + "TUTORIAL_PAGE2_TEXT": "Your personal Workspace shows the Resources and Services on which you have recently worked. To view a subset, filter by selecting a folder from the left pane.", + + "TUTORIAL_PAGE3_TITLE": "Assets Status and Type", + "TUTORIAL_PAGE3_TEXT": "Each of your assets is represented as an item on your Workspace.", + + "TUTORIAL_PAGE4_TITLE": "Asset Type", + "TUTORIAL_PAGE4_TEXT": "At the top left corner, R indicates a Resource and S indicates a Service.", + + "TUTORIAL_PAGE5_TITLE": "Asset Name", + "TUTORIAL_PAGE5_TEXT": "At the bottom, Resource or Service name and version number are displayed.", + + "TUTORIAL_PAGE6_TITLE": "Asset Icon", + "TUTORIAL_PAGE6_TEXT": "A Resource or Service is represented by an icon chosen by the Designer.", + + "TUTORIAL_PAGE7_TITLE": "Asset Status", + "TUTORIAL_PAGE7_TEXT": "In the top right corner, an indication of the asset's current status is displayed.", + + "TUTORIAL_PAGE8_TITLE": "Asset Menu", + "TUTORIAL_PAGE8_TEXT": "Hover over the three vertical dots to view a menu of actions you can request for the Resource or Service.", + + "TUTORIAL_PAGE9_TITLE": "SDC Catalog", + "TUTORIAL_PAGE9_TEXT": "In the SDC Catalog you can view all available Resources and Services. Access the Catalog by clicking Catalog in the left pane.", + + "TUTORIAL_PAGE10_TITLE": "Catalog Filtering", + "TUTORIAL_PAGE10_TEXT": "You can filter the Resources and Services displayed in the Catalog. Click on combinations of the Type, Category, and State criteria displayed in the left pane to filter by those criteria.", + + "TUTORIAL_PAGE11_TITLE": "Catalog Search", + "TUTORIAL_PAGE11_TEXT": "You can also filter by using the search bar. Type a term, or multiple terms separated by commas. All Resources and Services with a Name, Tag, or Description containing the search term(s) will be displayed.", + + "TUTORIAL_PAGE12_TITLE": "Design Studio", + "TUTORIAL_PAGE12_TEXT": "As a Designer, you have access to the Design Studio. You can add, change, and delete information related to a Resource or Service.", + + "TUTORIAL_PAGE13_TITLE": "Create & Modify Asset", + "TUTORIAL_PAGE13_TEXT": "From your personal Workspace you can:
  • Create a New Resource or Service (Click Create New)
  • Modify an existing Service or Resource (using the menu actions)
", + + "TUTORIAL_PAGE14_TITLE": "Create New Asset", + "TUTORIAL_PAGE14_TEXT": "When you create a new Resource or Service, you need to fill in profile data to create a new Catalog entry.", + + "TUTORIAL_PAGE15_TITLE": "Left Pane", + "TUTORIAL_PAGE15_TEXT": "In creating or editing a Service, you can choose elements from the left pane to add to your Service. You can enter search criteria to change the visible elements in the left pane.", + + "TUTORIAL_PAGE16_TITLE": "Drag & Drop", + "TUTORIAL_PAGE16_TEXT": "To include an element in your Service, drag it onto the Design Studio. If a green guide indication appears, drop the element near the guide and the Design Studio will automatically connect the two elements for you.", + + "TUTORIAL_PAGE17_TITLE": "Relationship Selection", + "TUTORIAL_PAGE17_TEXT": "When you connect two elements, you can define the relationship between the two. Design Studio will display the allowed relationships from which you can choose.", + + "TUTORIAL_PAGE18_TITLE": "View & Delete Relationship", + "TUTORIAL_PAGE18_TEXT": "You can view or delete the relationship between the two elements by selecting the relationship icon on the connecting line.", + + "TUTORIAL_PAGE19_TITLE": "Information tab", + "TUTORIAL_PAGE19_TEXT": "Here you can review general information about the Resource, such as version, category, author, and description.", + + "TUTORIAL_PAGE20_TITLE": "Structure tab", + "TUTORIAL_PAGE20_TEXT": "Here you can review the structural components of the Resource in a hierarchical tree diagram, including any connected Resources.", + + "TUTORIAL_PAGE21_TITLE": "Deployment Artifacts tab", + "TUTORIAL_PAGE21_TEXT": "Here you can view and manage the Artifact files associated with the Resource. You can download existing files, upload additional files, and manage HEAT template parameters.", + + "TUTORIAL_PAGE22_TITLE": "Properties tab", + "TUTORIAL_PAGE22_TEXT": "Here you can manage the properties of the Resource. You can view, edit, add and delete properties.", + + "TUTORIAL_PAGE23_TITLE": "Information Artifacts tab", + "TUTORIAL_PAGE23_TEXT": "Here you can manage documents associated with the Resource (such as test scripts, features, and capacity).", + + "TUTORIAL_PAGE24_TITLE": "Requirements and Capabilities tab", + "TUTORIAL_PAGE24_TEXT": "Here you can view the Resource capabilities and requirements, and from where the requirements are derived. If a Resource is connected to other Resources, the relationship associated with this connection is reflected (in the Requirements section) of this tab.", + + "TUTORIAL_PAGE25_TITLE": "Information tab", + "TUTORIAL_PAGE25_TEXT": "Here you can view general information about the Service, such as version, category, author, and description.", + + "TUTORIAL_PAGE26_TITLE": "Structure tab", + "TUTORIAL_PAGE26_TEXT": "Here you can view the Service structure in a hierarchical tree diagram, including the component Resources.", + + "TUTORIAL_PAGE27_TITLE": "Deployment Artifacts tab", + "TUTORIAL_PAGE27_TEXT": "Here you can view and manage the Artifact files associated with the Service. You can download existing files, upload additional files, and manage HEAT template parameters.", + + "TUTORIAL_PAGE28_TITLE": "Inputs tab", + "TUTORIAL_PAGE28_TEXT": "Here you can view and edit the properties of the Service, and see from which Resource the parameters originated. Properties are grouped by Resource instance.", + + "TUTORIAL_PAGE29_TITLE": "Information Artifacts tab", + "TUTORIAL_PAGE29_TEXT": "Here you can manage documents associated with the Service (such as service topology, message flows, and management flows). Some of these documents are created by embedded tools, such as ASE tools.", + + "TUTORIAL_PAGE30_TITLE": "API tab", + "TUTORIAL_PAGE30_TEXT": "Here you can manage the Service API (such as monitoring and instantiation), and you can upload an archive containing the HTML pages and the API URL.", + + "TUTORIAL_LAST_PAGE_TITLE": "Great!", + "TUTORIAL_LAST_PAGE_TEXT": "Now that you are familiar with the system, you can begin building!", + "TUTORIAL_LAST_PAGE_BTN_ACTION_MY_DASHBOARD": "My Dashboard", + + "=========== CATALOG PAGE ===========": "", + "HEADER_CAPTION_CATALOG": "Catalog", + "SORT_CAPTION": "Order By:", + "SORT_BY_UPDATE_DATE": "Last updated", + "SORT_ALPHABETICAL": "Alphabetical order", + + + "=========== HEADER PAGE ===========": "", + "HEADER_HELP_TEXT_CATALOG_TUTORIAL": "Catalog Tutorial", + "HEADER_HELP_TEXT_DESIGNER_TUTORIAL": "Design Studio Tutorial", + "HEADER_HELP_TEXT_WORKSPACE_TUTORIAL": "Workspace Tutorial", + + "=========== WELCOME PAGE ===========": "", + "WELCOME_HELLO": "Hello {{username}},", + "WELCOME_MESSAGE_1": "Welcome to Service Design and Creation (SDC) Portal. SDC supports Domain 2.0 Resource Onboarding and Service Creation.", + "WELCOME_MESSAGE_2": "This tutorial walks first-time users through the SDC portal components. Future logins directly access the SDC work platform without displaying the tutorial. To see the tutorial, click the Tutorial link on each SDC page.", + "WELCOME_MESSAGE_CURRENT_VERSION": "Current Version {{version}}", + "WELCOME_MESSAGE_SEE_WHATS_NEW": "See what's new", + "WELCOME_BTN_START_TUTORIAL": "Let's start", + "WELCOME_BTN_SKIP": "skip for now", + "WELCOME_BTN_ACTION_DESIGN_STUDIO": "Design Studio", + "WELCOME_BTN_ACTION_CERTIFICATION_STUDIO": "Tester's Workspace", + "WELCOME_BTN_ACTION_GOVERNOR_BOARD": "Governance Board", + "WELCOME_BTN_ACTION_DISTRIBUTION_STUDIO": "Distribution Studio", + "WELCOME_BTN_ACTION_CATALOG": "Catalog", + + "=========== ONBOARD VENDOR PAGE ===========": "", + "HEADER_CAPTION_ONBOARD":"On Board", + + "=========== NEW RESOURCE SERVICE ===========": "", + "NEW_SERVICE_RESOURCE_WRAPPER_TAB_GENERAL_INFORMATION": "General Information", + "NEW_SERVICE_RESOURCE_WRAPPER_TAB_ASSIGN_PRODUCT_HIERARCHY": "Assign Product Hierarchy", + "NEW_SERVICE_RESOURCE_WRAPPER_TAB_ADDITIONAL_INFO": "Additional Information", + "NEW_SERVICE_RESOURCE_WRAPPER_TAB_BILLING_AND_ORDERING": "Order Attributes & Rules", + "NEW_SERVICE_RESOURCE_WRAPPER_TAB_PRODUCT_COMPOSITION": "Bill Attributes & Rules", + "NEW_SERVICE_RESOURCE_SAVE_BUTTON": "Save", + "NEW_SERVICE_RESOURCE_DONE_BUTTON": "Done", + + "=========== NEW RESOURCE SERVICE ERRORS ===========": "", + "NEW_SERVICE_RESOURCE_ERROR_SERVICE_NAME_REQUIRED": "Service name is required.", + "NEW_SERVICE_RESOURCE_ERROR_MAX_LENGTH_25": "Max length 25 characters.", + "NEW_SERVICE_RESOURCE_ERROR_MAX_LENGTH_50": "Max length 50 characters.", + "NEW_SERVICE_RESOURCE_ERROR_MAX_LENGTH_128": "Max length 128 characters.", + "NEW_SERVICE_RESOURCE_ERROR_MAX_LENGTH_1024": "Max length 1024 characters.", + "NEW_SERVICE_RESOURCE_ERROR_NAME_EXISTS": "Name already exists.", + "NEW_SERVICE_RESOURCE_ERROR_SPECIAL_CHARS": "Special characters not allowed.", + "NEW_SERVICE_RESOURCE_ERROR_CATEGORY_REQUIRED": "category is required.", + "NEW_SERVICE_RESOURCE_ERROR_PROJECT_CODE_REQUIRED": "Project code is required.", + "NEW_SERVICE_RESOURCE_ERROR_PROJECT_CODE_NOT_VALID": "Project code is not valid.", + "NEW_SERVICE_RESOURCE_ERROR_CONTACT_REQUIRED": "Contact is required.", + "NEW_SERVICE_RESOURCE_ERROR_CONTACT_NOT_VALID": "Contact is not valid.", + "NEW_SERVICE_RESOURCE_ERROR_SERVICE_DESCRIPTION_REQUIRED": "Service description is required.", + "NEW_SERVICE_RESOURCE_ERROR_MIN_ONE_TAG": "Enter at least one tag.", + "NEW_SERVICE_RESOURCE_ERROR_TAG_NAME_EXIST": "Tag name already exists.", + "NEW_SERVICE_RESOURCE_ERROR_SERVICE_ICON": "Icon required.", + "NEW_SERVICE_RESOURCE_ERROR_RESOURCE_ICON": "Icon required.", + "NEW_SERVICE_RESOURCE_ERROR_RESOURCE_NAME_REQUIRED": "Name is required.", + "NEW_SERVICE_RESOURCE_ERROR_PRODUCT_NAME_REQUIRED": "Name is required.", + "NEW_SERVICE_RESOURCE_ERROR_RESOURCE_DESCRIPTION_REQUIRED": "Description is required.", + "NEW_SERVICE_RESOURCE_ERROR_PRODUCT_DESCRIPTION_REQUIRED": "Description is required.", + "NEW_SERVICE_RESOURCE_ERROR_VENDOR_NAME_REQUIRED": "Vendor name is required.", + "NEW_SERVICE_RESOURCE_ERROR_VENDOR_RELEASE_REQUIRED": "Vendor Release is required.", + "NEW_SERVICE_RESOURCE_ERROR_TEMPLATE_REQUIRED": "Template is required.", + "NEW_SERVICE_RESOURCE_ERROR_TAG_PATTERN": "{{text}}", + "NEW_SERVICE_RESOURCE_ERROR_VALID_TOSCA_EXTENSIONS_TITLE": "Invalid Tosca file", + "NEW_SERVICE_RESOURCE_ERROR_VALID_TOSCA_EXTENSIONS": "File extension should be {{extensions}}.", + "NEW_SERVICE_RESOURCE_ERROR_TOSCA_FILE_REQUIRED": "Tosca file is required.", + "NEW_SERVICE_RESOURCE_ERROR_VALID_CSAR_EXTENSIONS_TITLE": "Invalid csar file", + "NEW_SERVICE_RESOURCE_ERROR_VALID_CSAR_EXTENSIONS": "File extension should be {{extensions}}.", + "NEW_PRODUCT_NO_CATEGORIES_TO_DISPLAY": "Your product is not assigned to any group yet.
To select/find a group, begin typing above and select group to add", + + "=========== SUGGESTED ICONS TOOLTIP ===========": "", + "call_controll": "Call Control", + "mobility": "Mobility", + "network_l_1-3": "Network L 1-3", + "network_l_4": "Network L 4+", + "router": "Router", + "database": "Database", + "network": "Network", + "objectStorage": "Object Storage", + "connector": "Connector", + "brocade": "Brocade", + "cisco": "Cisco", + "ericsson": "Ericsson", + "tropo": "Tropo", + "fortinet": "Fortinet", + "att": "AT&T", + "broadsoft": "BroadSoft", + "alcatelLucent": "Alcatel-Lucent", + "metaswitch": "Metaswitch", + "aricent": "Aricent", + "mySql": "MySQL", + "juniper": "Juniper Networks", + "oracle": "Oracle Corporation", + "nokia_siemens": "Nokia Networks", + "borderElement": "Border Element", + "applicationServer": "Application Server", + "server": "Server", + "port": "Port", + "loadBalancer": "Load Balancer", + "compute": "Compute", + "gateway": "Gateway", + "defaulticon": "Default Icon", + + "=========== ADD ARTIFACT FROM ===========": "", + "ADD_ARTIFACT_ERROR_VALID_EXTENSIONS": "File extension should be {{extensions}}.", + "ADD_ARTIFACT_ERROR_FILE_REQUIRED": "Artifact file is required.", + "ADD_ARTIFACT_ERROR_LABEL_REQUIRED": "Artifact label is required.", + "ADD_ARTIFACT_ERROR_LABEL_MAXLENGTH": "Max length 25 characters.", + "ADD_ARTIFACT_ERROR_LABEL_PATTERN": "not allowed special characters.", + "ADD_ARTIFACT_ERROR_TYPE_REQUIRED": "type is required.", + "ADD_ARTIFACT_ERROR_TIMEOUT_MIN": "Timeout can't be set to zero.", + "ADD_ARTIFACT_ERROR_TIMEOUT_MAXLENGTH": "Max length 25 characters.", + "ADD_ARTIFACT_ERROR_TIMEOUT_PATTERN": "Invalid value.", + "ADD_ARTIFACT_ERROR_APIURL_REQUIRED": "Artifact URL is required.", + "ADD_ARTIFACT_ERROR_APIURL_MAXLENGTH": "Max length 100 characters.", + "ADD_ARTIFACT_ERROR_APIURL_URL": "Url not valid", + "ADD_ARTIFACT_ERROR_DESCRIPTION_REQUIRED": "Description is required.", + "ADD_ARTIFACT_ERROR_DESCRIPTION_MAXLENGTH": "Max length 256 characters.", + "ADD_ARTIFACT_ERROR_DESCRIPTION_PATTERN": "not allowed special characters.", + + "=========== ARTIFACT VIEW ===========": "", + "ARTIFACT_VIEW_DELETE_MODAL_TITLE": "Delete Artifact Confirmation", + "ARTIFACT_VIEW_DELETE_MODAL_TEXT": "Are you sure you want to delete '{{name}}'?", + + "=========== PROPERTY VIEW ===========": "", + "PROPERTY_VIEW_DELETE_MODAL_TITLE": "Delete Property Confirmation", + "PROPERTY_VIEW_DELETE_MODAL_TEXT": "Are you sure you want to delete '{{name}}'?", + "PROPERTY_EDIT_PATTERN": "Invalid value.", + "PROPERTY_EDIT_LIST_STRING": "Invalid value. The correct value is \"X\",\"Y\"", + "PROPERTY_EDIT_MAP_STRING": "Invalid value. The correct value is \"Key\":\"value\"", + "PROPERTY_EDIT_LIST_GENERIC": "Invalid value. The correct value is X, Y", + "PROPERTY_EDIT_MAP_GENERIC": "Invalid value. The correct value is \"Key\":value", + "PROPERTY_EDIT_MAP_UNIQUE_KEYS": "Key must be unique.", + + "=========== ATTRIBUTE VIEW ===========": "", + "ATTRIBUTE_VIEW_DELETE_MODAL_TITLE": "Delete Attribute Confirmation", + "ATTRIBUTE_VIEW_DELETE_MODAL_TEXT": "Are you sure you want to delete '{{name}}'?", + "ATTRIBUTE_EDIT_PATTERN": "Invalid value.", + "NEW_ATTRIBUTE_ERROR_NAME_EXISTS":"Name already exists.", + "ATTRIBUTE_EDIT_LIST_STRING": "Invalid value. The correct value is \"X\",\"Y\".", + "ATTRIBUTE_EDIT_MAP_STRING": "Invalid value. The correct value is \"Key\":\"value\".", + "ATTRIBUTE_EDIT_LIST_BOOLEAN": "Invalid value. The correct value is true,false.", + "ATTRIBUTE_EDIT_MAP_BOOLEAN": "Invalid value. The correct value is \"Key\":true.", + "ATTRIBUTE_EDIT_LIST_GENERIC": "Invalid value. The correct value is X, Y.", + "ATTRIBUTE_EDIT_MAP_GENERIC": "Invalid value. The correct value is \"Key\":value.", + "ATTRIBUTE_EDIT_MAP_UNIQUE_KEYS": "Key must be unique.", + + "=========== UPDATE PARAMETERS FROM ===========": "", + "UPDATE_PARAMETERS_TEXT": "Review the parameters and their default values. If necessary, you can modify the values by editing the text fields.", + "ENV_FILE_GENERATION": "Please notice: empty fields will not be included in the ENV file", + + "=========== ENTITY VIEWER ===========": "", + "ENTITY_VIEWER_PROPERTIES_TAB": "Properties", + "ENTITY_VIEWER_ACTIVITY_LOG_TAB": "Activity Log", + + "=========== WHATS NEW ===========": "", + "WHATS_NEW_ON": "What's new on {{version}}", + "WHATS_NEW_LIST": "", + "WHATS_NEW_1_TITLE": "VNF On-Boarding", + "WHATS_NEW_1_BODY": "Vendors can upload VNF HEAT files & License artifacts
  • Upload VNF HEAT files
  • Licensing
  • Questionnaire
  • ", + "WHATS_NEW_2_TITLE": "Call & Network Flow-Tool", + "WHATS_NEW_2_BODY": "Introduced the ability to host a 3rd party
    Enhance VF and Service design with Call and Network flows; Call & Network Flows created and stored as Information Artifacts.", + "WHATS_NEW_3_TITLE": "Import VF from On-Boarded VNF", + "WHATS_NEW_3_BODY": "Import VF Metadata from vendor supplied CSAR file
    Create the VF based on data included in the CSAR file. Includes; VF topology and deployment artifacts
    Once checked in the VF is Displayed in the Catalog", + "WHATS_NEW_4_TITLE": "App Navigation", + "WHATS_NEW_4_BODY": "This release introduces View and Edit modes
    1. Use the view mode when:
      • User does not have authorization to edit an Asset
      • Asset is in Check-In Mode
    2. Use the Edit Mode when:
      • User has authorization to edit an Asset
      • Asset is in Check-out Mode
    ", + "WHATS_NEW_5_TITLE": "Certification Studio", + "WHATS_NEW_5_BODY": "Tester, Governor and Ops roles can view VF and Service Composition.
    They can also download the asset’s artifacts, and download the asset’s resource instance artifacts", + "WHATS_NEW_6_TITLE": "Composition: Virtual Link", + "WHATS_NEW_6_BODY": "The ability to link VFs via a Virtual link has been expanded. Now a Virtual link can be defined as having either Point-to-Point connectivity or Multi-point connectivity. Additionally from within a Virtual Link, Point-to-Point connectivity can be dynamically changed to Multi-Point connectivity.", + "WHATS_NEW_7_TITLE": "Distribution", + "WHATS_NEW_7_BODY": "
    • Distribution of artifact to App-C
    • Distribution of artifact to ALTS
    • Distribution of artifact to A&AI
    ", + "WHATS_NEW_8_TITLE": "New Brand", + "WHATS_NEW_8_BODY": "Effort was invested in improving the overall application Usability, and the User Interface was modified to better reflect branding standards.", + + "=========== USER_MANAGEMENT SCREEN ===========": "", + "USER_MANAGEMENT": "User Management", + "USER_MANAGEMENT_TABLE_HEADER_USER_ID": "User id", + "USER_MANAGEMENT_SEARCH_LABEL": "Search user by name, user id, email or role", + "USER_MANAGEMENT_SEARCH_TEXT": "Enter user id", + "CATEGORY_MANAGEMENT": "Category Management", + "ECOMP": "ECOMP", + "MONITOR": "Monitor", + "USER_MANAGEMENT_VIEW_DELETE_MODAL_TITLE": "Delete User Confirmation", + "USER_MANAGEMENT_VIEW_DELETE_MODAL_TEXT": "Are you sure you want to delete the user?", + "NEW_USER_ERROR_USER_ID_REQUIRED": "User id is required.", + "NEW_USER_ERROR_USER_ID_NOT_VALID": "User id not valid.", + "NEW_USER_ERROR_ROLE_REQUIRED": "User role is required.", + + "=========== EMAIL_MODAL ===========": "", + "EMAIL_MODAL_TITLE": "Submit For Testing", + "EMAIL_MODAL_SUBJECT": "{{entityName}}; version {{entityVersion}}", + "EMAIL_MODAL_MESSAGE": "Enter your message here...", + "EMAIL_OUTLOOK_MESSAGE": "mailto:{{to}}?subject={{subject}} is now ready for testing&body={{message}}%0D%0A%0D%0AClick on the link below to open {{entityNameAndVersion}} that is ready for testing. %0D%0A{{link}}%0D%0A", + + "=========== CATEGORY_MANAGEMENT SCREEN ===========": "", + "RESOURCE_CATEGORY_HEADER": "Resource Category", + "SERVICE_CATEGORY_HEADER": "Service Category", + "SUBCATEGORY_HEADER": "Sub Category", + "ADD_CATEGORY": "New", + "ADD_SUBCATEGORY": "New", + "DELETE_CATEGORY_MODAL_HEADER": "Delete {{modelType}}", + "DELETE_CATEGORY_MODAL_CATEGORY_NAME": "Are you sure you want to delete the {{modelType}}?", + "CREATE_CATEGORY_MODAL_HEADER": "Create new {{modelType}}", + "CREATE_CATEGORY_MODAL_CATEGORY_NAME": "Enter {{modelType}} name", + "CREATE_CATEGORY_MODAL_REQUIRED": "{{modelType}} name is mandatory", + "CREATE_CATEGORY_MODAL_MINLENGTH": "{{modelType}} name should be at least {{minlength}} characters", + "CREATE_CATEGORY_MODAL_PATTERN": "{{modelType}} name is not valid" + +,"=========== PDF FILE ===========": "", + "PDF_FILE_DECLARATION_BOLD": "AT&T Proprietary (Restricted)", + "PDF_FILE_DECLARATION": "Only for use by authorized individuals or any above-designated team(s) within the AT&T companies and not for general distribution" + +,"=========== DEPLOYMENT ARTIFACTS ===========": "", + "DEPLOYMENT_ARTIFACT_NO_ARTIFACTS_TO_DISPLAY": "There are no deployment artifacts to display", + "DEPLOYMENT_ARTIFACT_BUTTON_ADD_HEAT": "Add {{name}}", + "DEPLOYMENT_ARTIFACT_BUTTON_ADD_BASE_HEAT": "Add Base HEAT Artifact", + "DEPLOYMENT_ARTIFACT_BUTTON_ADD_NETWORK_HEAT": "Add Network HEAT Artifact", + "DEPLOYMENT_ARTIFACT_BUTTON_ADD_VOLUME_HEAT": "Add Volume HEAT Artifact", + "DEPLOYMENT_ARTIFACT_BUTTON_ADD_OTHER": "Add Other Artifact" + +,"=========== IMPORT VF ===========": "", + "IMPORT_VF_MESSAGE_CREATE_TAKES_LONG_TIME_TITLE": "Create VF", + "IMPORT_VF_MESSAGE_CREATE_TAKES_LONG_TIME_DESCRIPTION": "Your VF is being created.
    It can take up to 10 minutes.
    When done, you can view it in SDC Catalog.", + "IMPORT_VF_MESSAGE_CREATE_FINISHED_TITLE": "Create/Update", + "IMPORT_VF_MESSAGE_CREATE_FINISHED_DESCRIPTION": "saved successfully", + "IMPORT_VF_ALREADY_EXISTS_TITLE": "Create VF", + "IMPORT_VF_ALREADY_EXISTS_DESCRIPTION": "The VF {{vfName}} is already certified.
    When updating a VF that was already certified, the values for several parameters will not be changed.
    These parameters are: Name, Category and Icon.", + + "=========== TABS TITLE ===========": "", + "HIERARCHY_TAB_TITLE": "HIERARCHY", + + "=========== DISTRIBUTION VIEW ===========": "", + "DISTRIBUTION_VIEW_TITLE_USER_ID": "User id:", + + "=========== SUCCESS MESSAGES ===========": "", + "CHECKIN_SUCCESS_MESSAGE_TEXT": "Checked in successfully", + "CHECKIN_SUCCESS_MESSAGE_TITLE": "Check in", + "CHECKOUT_SUCCESS_MESSAGE_TEXT": "Checked out successfully", + "CHECKOUT_SUCCESS_MESSAGE_TITLE": "Check out", + "DELETE_SUCCESS_MESSAGE_TEXT": "Deleted successfully", + "DELETE_SUCCESS_MESSAGE_TITLE": "Delete", + "SUBMIT_FOR_TESTING_SUCCESS_MESSAGE_TEXT": "Submitted successfully for testing", + "SUBMIT_FOR_TESTING_SUCCESS_MESSAGE_TITLE": "Submit For Testing", + "START_TESTING_SUCCESS_MESSAGE_TEXT": "Tested successfully", + "START_TESTING_SUCCESS_MESSAGE_TITLE": "Start Testing", + "CANCEL_TESTING_SUCCESS_MESSAGE_TEXT": "Cancelled successfully", + "CANCEL_TESTING_SUCCESS_MESSAGE_TITLE": "Cancel", + "REJECT_SUCCESS_MESSAGE_TEXT": "Rejected successfully", + "REJECT_SUCCESS_MESSAGE_TITLE": "Reject", + "ACCEPT_TESTING_SUCCESS_MESSAGE_TEXT": "Accepted successfully", + "ACCEPT_TESTING_SUCCESS_MESSAGE_TITLE": "Accept", + "APPROVE_SUCCESS_MESSAGE_TEXT": "Approved successfully", + "APPROVE_SUCCESS_MESSAGE_TITLE": "Approve", + "DISTRIBUTE_SUCCESS_MESSAGE_TEXT": "Distributed successfully", + "DISTRIBUTE_SUCCESS_MESSAGE_TITLE": "Distribute", + + "=========== ON BOARDING MODAL INFO MESSAGES ===========": "", + "ON_BOARDING_GENERAL_INFO": "Displays a table of VSPs created using Onboarding.
    Each row displays details for a single VSP.
    When expanded you can either import CSAR files that are yet to be imported or update CSAR files that were previously imported.", + "ON_BOARDING_IMPORT_INFO": "Displays the Onboarding repository and supports importing on-boarded CSAR files.
    Select an imported CSAR file to create a VF from the on-boarded and imported information.", + "ON_BOARDING_UPDATE_INFO": "Displays the Onboarding repository and supports updating on-boarded and previously imported CSAR files.
    Clicking Update, updates the existing VF with information available from a new version of the CSAR file." +} diff --git a/catalog-ui/app/scripts/app.ts b/catalog-ui/app/scripts/app.ts new file mode 100644 index 0000000000..513810595b --- /dev/null +++ b/catalog-ui/app/scripts/app.ts @@ -0,0 +1,936 @@ +/*- + * ============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========================================================= + */ +/// +/* + SD&C Web Portal Wireframes – Designer Home Page and Create New Service Flow + */ +//libraries variables to prevent compile errors +declare let jsPDF:any; + +module Sdc { + import User = Sdc.Models.User; + import UserResourceService = Sdc.Services.UserResourceService; + + 'use strict'; + import Resource = Sdc.Models.Components.Resource; + let moduleName:string = 'sdcApp'; + let viewModelsModuleName:string = 'Sdc.ViewModels'; + let directivesModuleName:string = 'Sdc.Directives'; + let servicesModuleName:string = 'Sdc.Services'; + let filtersModuleName:string = 'Sdc.Filters'; + let utilsModuleName: string = 'Sdc.Utils'; + let dependentModules:Array = [ + 'ui.router', + 'ui.bootstrap', + 'ngDragDrop', + 'ui-notification', + 'ngResource', + 'ngSanitize', + 'Sdc.Config', + 'naif.base64', + 'base64', + 'uuid4', + 'checklist-model', + 'angular.filter', + 'pascalprecht.translate', + '720kb.tooltips', + 'restangular', + 'angular-clipboard', + 'angularResizable', + 'infinite-scroll', + viewModelsModuleName, + directivesModuleName, + servicesModuleName, + filtersModuleName, + utilsModuleName + ]; + + let appModule:ng.IModule = angular.module(moduleName, dependentModules); + + appModule.config([ + '$stateProvider', + '$translateProvider', + '$urlRouterProvider', + '$httpProvider', + 'tooltipsConfigProvider', + 'NotificationProvider', + ($stateProvider:any, + $translateProvider:any, + $urlRouterProvider:ng.ui.IUrlRouterProvider, + $httpProvider:ng.IHttpProvider, + tooltipsConfigProvider:any, + NotificationProvider:any):void => { + + NotificationProvider.setOptions({ + delay: 10000, + startTop: 10, + startRight: 10, + closeOnClick: true, + verticalSpacing: 20, + horizontalSpacing: 20, + positionX: 'right', + positionY: 'top' + }); + + let viewModelsHtmlBasePath:string = '/app/scripts/view-models/'; + console.info('appModule.config: ', viewModelsHtmlBasePath); + + $translateProvider.useStaticFilesLoader({ + prefix: 'languages/', + langKey: '', + suffix: '.json?d=' + (new Date()).getTime() + }); + $translateProvider.useSanitizeValueStrategy('escaped'); + $translateProvider.preferredLanguage('en_US_OS'); // For open source changed to en_US_OS + + $httpProvider.interceptors.push('Sdc.Services.HeaderInterceptor'); + $httpProvider.interceptors.push('Sdc.Services.HttpErrorInterceptor'); + + $urlRouterProvider.otherwise('welcome'); + + $stateProvider.state( + 'dashboard', { + url: '/dashboard?show&folder', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'dashboard/dashboard-view.html'); + }], + controller: viewModelsModuleName + '.DashboardViewModel', + + } + ); + + $stateProvider.state( + 'welcome', { + url: '/welcome', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'welcome/welcome-view.html'); + }], + controller: viewModelsModuleName + '.WelcomeViewModel' + } + ); + + $stateProvider.state( + 'dashboard.cover', { + url: '/cover', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'dashboard/cover/dashboard-cover-view.html'); + }], + controller: viewModelsModuleName + '.DashboardCoverViewModel' + } + ); + + $stateProvider.state( + 'dashboard.tutorial-end', { + url: '/tutorial-end', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'tutorial-end/tutorial-end.html'); + }], + controller: viewModelsModuleName + '.TutorialEndViewModel' + } + ); + + $stateProvider.state( + 'additionalInformation', { + url: '/additionalInformation', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'additional-information/additional-information-view.html'); + }], + controller: viewModelsModuleName + '.AdditionalInformationViewModel' + } + ); + + let componentsParam:Array = ['$stateParams', 'Sdc.Services.EntityService','Sdc.Services.CacheService' , ($stateParams:any, EntityService:Sdc.Services.EntityService, cacheService:Services.CacheService) => { + if(cacheService.get('breadcrumbsComponents')){ + return cacheService.get('breadcrumbsComponents'); + } else { + return EntityService.getCatalog(); //getAllComponents() doesnt return components from catalog + } + }]; + + + $stateProvider.state ( + 'workspace', { + url: '/workspace/:id/:type/', + params: {'importedFile':null,'componentCsar':null,'resourceType': null, 'disableButtons': null}, //'vspComponent': null, + templateProvider: ['$templateCache', ($templateCache:ng.ITemplateCacheService):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/workspace-view.html'); + }], + controller: viewModelsModuleName + '.WorkspaceViewModel', + resolve: { + injectComponent: ['$stateParams', 'ComponentFactory' , function ($stateParams, ComponentFactory) { + /* + if($stateParams.vspComponent){ + return $stateParams.vspComponent; + } else + */ + if($stateParams.id){ + return ComponentFactory.getComponentFromServer($stateParams.type.toUpperCase(), $stateParams.id); + } else if ($stateParams.componentCsar && $stateParams.componentCsar.csarUUID) { + return $stateParams.componentCsar; + } else { + let emptyComponent = ComponentFactory.createEmptyComponent($stateParams.type.toUpperCase()); + if (emptyComponent.isResource() && $stateParams.resourceType){ + // Set the resource type + (emptyComponent).resourceType = $stateParams.resourceType; + } + if($stateParams.importedFile){ + (emptyComponent).importedFile = $stateParams.importedFile; + } + return emptyComponent; + } + }], + components: componentsParam + } + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_GENERAL, { + url: 'general', + parent: 'workspace', + controller: viewModelsModuleName + '.GeneralViewModel', + templateProvider: ['$templateCache', ($templateCache:ng.ITemplateCacheService):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/general/general-view.html'); + }], + data: {unsavedChanges:false,bodyClass:'general'} + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_ICONS, { + url: 'icons', + parent: 'workspace', + controller: viewModelsModuleName + '.IconsViewModel', + templateProvider: ['$templateCache', ($templateCache:ng.ITemplateCacheService):string => { + + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/icons/icons-view.html'); + }], + data: {unsavedChanges:false,bodyClass:'icons'} + + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_ACTIVITY_LOG, { + url: 'activity_log', + parent: 'workspace', + controller: viewModelsModuleName + '.ActivityLogViewModel', + templateProvider: ['$templateCache', ($templateCache:ng.ITemplateCacheService):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/activity-log/activity-log.html'); + }], + data: {unsavedChanges:false} + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_DEPLOYMENT_ARTIFACTS, { + url: 'deployment_artifacts', + parent: 'workspace', + controller: viewModelsModuleName + '.DeploymentArtifactsViewModel', + templateProvider: ['$templateCache', ($templateCache:ng.ITemplateCacheService):string => { + + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/deployment-artifacts/deployment-artifacts-view.html'); + }], + data:{ + bodyClass:'deployment_artifacts' + } + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_HIERARCHY, { + url: 'hierarchy', + parent: 'workspace', + controller: viewModelsModuleName + '.ProductHierarchyViewModel', + templateProvider: ['$templateCache', ($templateCache:ng.ITemplateCacheService):string => { + + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/product-hierarchy/product-hierarchy-view.html'); + }] + + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_INFORMATION_ARTIFACTS, { + url: 'information_artifacts', + parent: 'workspace', + controller: viewModelsModuleName + '.InformationArtifactsViewModel', + templateProvider: ['$templateCache', ($templateCache:ng.ITemplateCacheService):string => { + + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/information-artifacts/information-artifacts-view.html'); + }], + data:{ + bodyClass:'information_artifacts' + } + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_TOSCA_ARTIFACTS, { + url: 'tosca_artifacts', + parent: 'workspace', + controller: viewModelsModuleName + '.ToscaArtifactsViewModel', + templateProvider: ['$templateCache', ($templateCache:ng.ITemplateCacheService):string => { + + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/tosca-artifacts/tosca-artifacts-view.html'); + }], + data:{ + bodyClass:'tosca_artifacts' + } + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_PROPERTIES, { + url: 'properties', + parent: 'workspace', + controller: viewModelsModuleName + '.PropertiesViewModel', + templateProvider: ['$templateCache', ($templateCache:ng.ITemplateCacheService):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/properties/properties-view.html'); + }], + data:{ + bodyClass:'properties' + } + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_SERVICE_INPUTS, { + url: 'service_inputs', + parent: 'workspace', + controller: viewModelsModuleName + '.ServiceInputsViewModel', + templateProvider: ['$templateCache', ($templateCache:ng.ITemplateCacheService):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/inputs/service-input/service-inputs-view.html'); + }], + data:{ + bodyClass:'workspace-inputs' + } + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_RESOURCE_INPUTS, { + url: 'resource_inputs', + parent: 'workspace', + controller: viewModelsModuleName + '.ResourceInputsViewModel', + templateProvider: ['$templateCache', ($templateCache:ng.ITemplateCacheService):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/inputs/resource-input/resource-inputs-view.html'); + }], + data:{ + bodyClass:'workspace-inputs' + } + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_ATTRIBUTES, { + url: 'attributes', + parent: 'workspace', + controller: viewModelsModuleName + '.AttributesViewModel', + templateProvider: ['$templateCache', ($templateCache:ng.ITemplateCacheService):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/attributes/attributes-view.html'); + }], + data:{ + bodyClass:'attributes' + } + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_REQUIREMENTS_AND_CAPABILITIES, { + url: 'req_and_capabilities', + parent: 'workspace', + controller: viewModelsModuleName + '.ReqAndCapabilitiesViewModel', + templateProvider: ['$templateCache', ($templateCache:ng.ITemplateCacheService):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/req-and-capabilities/req-and-capabilities-view.html'); + }], + data:{ + bodyClass:'attributes' + } + } + ); + + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_MANAGEMENT_WORKFLOW, { + parent: 'workspace', + url: 'management_workflow', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/management-workflow/management-workflow-view.html'); + }], + controller: viewModelsModuleName + '.ManagementWorkflowViewModel' + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_NETWORK_CALL_FLOW, { + parent: 'workspace', + url: 'network_call_flow', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/network-call-flow/network-call-flow-view.html'); + }], + controller: viewModelsModuleName + '.NetworkCallFlowViewModel' + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_DISTRIBUTION, { + parent: 'workspace', + url: 'distribution', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/distribution/distribution-view.html'); + }], + controller: viewModelsModuleName + '.DistributionViewModel' + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_COMPOSITION, { + url: 'composition/', + parent: 'workspace', + controller: viewModelsModuleName + '.CompositionViewModel', + templateProvider: ['$templateCache', ($templateCache:ng.ITemplateCacheService):string => { + + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/composition/composition-view.html'); + }], + data:{ + bodyClass:'composition' + } + } + ); + + $stateProvider.state( + Utils.Constants.States.WORKSPACE_DEPLOYMENT, { + url: 'deployment/', + parent: 'workspace', + controller: viewModelsModuleName + '.DeploymentViewModel', + templateProvider: ['$templateCache', ($templateCache:ng.ITemplateCacheService):string => { + + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/deployment/deployment-view.html'); + }], + data:{ + bodyClass:'composition' + } + } + ); + + $stateProvider.state( + 'workspace.composition.details', { + url: 'details', + parent: 'workspace.composition', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/composition/tabs/details/details-view.html'); + }], + controller: viewModelsModuleName + '.DetailsViewModel' + } + ); + + $stateProvider.state( + 'workspace.composition.properties', { + url: 'properties', + parent: 'workspace.composition', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/composition/tabs/properties-and-attributes/properties-view.html'); + }], + controller: viewModelsModuleName + '.ResourcePropertiesViewModel' + } + ); + + $stateProvider.state( + 'workspace.composition.artifacts', { + url: 'artifacts', + parent: 'workspace.composition', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/composition/tabs/artifacts/artifacts-view.html'); + }], + controller: viewModelsModuleName + '.ResourceArtifactsViewModel' + } + ); + + $stateProvider.state( + 'workspace.composition.relations', { + url: 'relations', + parent: 'workspace.composition', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/composition/tabs/relations/relations-view.html'); + }], + controller: viewModelsModuleName + '.RelationsViewModel' + } + ); + + $stateProvider.state( + 'workspace.composition.relationships', { + url: 'relationships', + parent: 'workspace.composition', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'resource-relationships/resource-relationships-view.html'); + }], + controller: viewModelsModuleName + '.ResourceRelationshipsViewModel' + } + ); + + $stateProvider.state( + 'workspace.composition.structure', { + url: 'structure', + parent: 'workspace.composition', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/composition/tabs/structure/structure-view.html'); + }], + controller: viewModelsModuleName + '.StructureViewModel' + } + ); + $stateProvider.state( + 'workspace.composition.lifecycle', { + url: 'lifecycle', + parent: 'workspace.composition', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/composition/tabs/artifacts/artifacts-view.html'); + }], + controller: viewModelsModuleName + '.ResourceArtifactsViewModel' + } + ); + + $stateProvider.state( + 'workspace.composition.api', { + url: 'api', + parent: 'workspace.composition', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/composition/tabs/artifacts/artifacts-view.html'); + }], + controller: viewModelsModuleName + '.ResourceArtifactsViewModel' + } + ); + $stateProvider.state( + 'workspace.composition.deployment', { + url: 'deployment', + parent: 'workspace.composition', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'workspace/tabs/composition/tabs/artifacts/artifacts-view.html'); + }], + controller: viewModelsModuleName + '.ResourceArtifactsViewModel' + } + ); + + $stateProvider.state( + 'edit-resource', { + url: '/edit-resource/:id', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'entity-handler/resource-form/resource-form-view.html'); + }], + controller: viewModelsModuleName + '.ResourceFormViewModel' + } + ); + + $stateProvider.state( + 'edit-product', { + url: '/edit-product/:id', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'entity-handler/product-form/product-form-view.html'); + }], + controller: viewModelsModuleName + '.ProductFormViewModel' + } + ); + + $stateProvider.state( + 'adminDashboard', { + url: '/adminDashboard', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'admin-dashboard/admin-dashboard-view.html'); + }], + controller: viewModelsModuleName + '.AdminDashboardViewModel', + permissions: ['ADMIN'] + } + ); + + $stateProvider.state( + 'onboardVendor', { + url: '/onboardVendor', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'onboard-vendor/onboard-vendor-view.html'); + }], + controller: viewModelsModuleName + '.OnboardVendorViewModel'//, + //resolve: { + // auth: ["$q", "Sdc.Services.UserResourceService", function ($q:any, userResourceService:Sdc.Services.IUserResourceClass) { + // let userInfo:Sdc.Services.IUserResource = userResourceService.getLoggedinUser(); + // if (userInfo) { + // return $q.when(userInfo); + // } else { + // return $q.reject({authenticated: false}); + // } + // }] + //} + } + ); + + $stateProvider.state( + 'catalog', { + url: '/catalog', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'catalog/catalog-view.html'); + }], + controller: viewModelsModuleName + '.CatalogViewModel', + resolve: { + auth: ["$q", "Sdc.Services.UserResourceService", function ($q:any, userResourceService:Sdc.Services.IUserResourceClass) { + let userInfo:Sdc.Services.IUserResource = userResourceService.getLoggedinUser(); + if (userInfo) { + return $q.when(userInfo); + } else { + return $q.reject({authenticated: false}); + } + }] + } + } + ); + + $stateProvider.state( + 'distribution', { + url: '/distribution', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'distribution/distribution-view.html'); + }], + controller: viewModelsModuleName + '.DistributionViewModel' + } + ); + + $stateProvider.state( + 'support', { + url: '/support', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'support/support-view.html'); + }], + controller: viewModelsModuleName + '.SupportViewModel' + } + ); + + $stateProvider.state( + 'error-403', { + url: '/error-403', + templateProvider: ['$templateCache', ($templateCache):string => { + return $templateCache.get(viewModelsHtmlBasePath + 'modals/error-modal/error-403-view.html'); + }], + controller: viewModelsModuleName + '.ErrorViewModel' + } + ); + + tooltipsConfigProvider.options({ + + side:'bottom', + delay: '600', + class: 'tooltip-custom', + lazy:0, + try:0 + + }); + + } + ]) + .run(['AngularJSBridge', (AngularJSBridge)=>{ + + }]); + appModule.value('ValidationPattern', /^[\s\w\&_.:-]{1,1024}$/); + appModule.value('PropertyNameValidationPattern', /^[a-zA-Z0-9_:-]{1,50}$/);// DE210977 + appModule.value('TagValidationPattern', /^[\s\w_.-]{1,50}$/); + // appModule.value('VendorValidationPattern', /^[^?\\<>:"/|*]{1,25}$/); + appModule.value('VendorValidationPattern', /^[\x20-\x21\x23-\x29\x2B-\x2E\x30-\x39\x3B\x3D\x40-\x5B\x5D-\x7B\x7D-\xFF]{1,25}$/); + appModule.value('ContactIdValidationPattern', /^[\s\w-]{1,50}$/); + appModule.value('UserIdValidationPattern',/^[\s\w-]{1,50}$/); + appModule.value('ProjectCodeValidationPattern', /^[\s\w-]{1,50}$/); + appModule.value('LabelValidationPattern', /^[\sa-zA-Z0-9+-]{1,25}$/); + appModule.value('UrlValidationPattern', /^(https?|ftp):\/\/(((([A-Za-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([A-Za-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([A-Za-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([A-Za-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([A-Za-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([A-Za-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([A-Za-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([A-Za-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([A-Za-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([A-Za-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([A-Za-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([A-Za-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/); + appModule.value('IntegerValidationPattern', /^(([-+]?\d+)|([-+]?0x[0-9a-fA-F]+))$/); + appModule.value('IntegerNoLeadingZeroValidationPattern', /^(0|[-+]?[1-9][0-9]*|[-+]?0x[0-9a-fA-F]+|[-+]?0o[0-7]+)$/); + appModule.value('FloatValidationPattern', /^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?f?$/); + appModule.value('NumberValidationPattern', /^((([-+]?\d+)|([-+]?0x[0-9a-fA-F]+))|([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?))$/); + appModule.value('KeyValidationPattern', /^[\s\w-]{1,50}$/); + appModule.value('CommentValidationPattern', /^[\u0000-\u00BF]*$/); + appModule.value('BooleanValidationPattern', /^([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])$/); + + + appModule.run([ + '$http', + 'Sdc.Services.CacheService', + 'Sdc.Services.CookieService', + 'Sdc.Services.ConfigurationUiService', + 'Sdc.Services.UserResourceService', + 'Sdc.Services.CategoryResourceService', + 'Sdc.Services.SdcVersionService', + '$state', + '$rootScope', + '$location', + 'sdcConfig', + 'sdcMenu', + 'ModalsHandler', + 'Sdc.Services.EcompHeaderService', + 'LeftPaletteLoaderService', + ($http:ng.IHttpService, + cacheService:Services.CacheService, + cookieService:Services.CookieService, + ConfigurationUi:Services.ConfigurationUiService, + UserResourceClass:Services.IUserResourceClass, + categoryResourceService:Sdc.Services.ICategoryResourceClass, + sdcVersionService:Services.SdcVersionService, + $state:ng.ui.IStateService, + $rootScope:ng.IRootScopeService, + $location: ng.ILocationService, + sdcConfig: Models.IAppConfigurtaion, + sdcMenu: Models.IAppMenu, + ModalsHandler:Utils.ModalsHandler, + ecompHeaderService:Sdc.Services.EcompHeaderService, + LeftPaletteLoaderService:Services.Components.LeftPaletteLoaderService + ):void => { + + //handle cache data - version + let initSdcVersion:Function = ():void => { + + let onFailed = (response) => { + console.info('onFailed initSdcVersion', response); + cacheService.set('version', 'N/A'); + }; + + let onSuccess = (version:any) => { + console.log("Version returned from server: " + version); + let tmpVerArray = version.version.split("."); + let ver = tmpVerArray[0] + "." + tmpVerArray[1] + "." + tmpVerArray[2]; + cacheService.set('version', ver); + }; + + sdcVersionService.getVersion().then(onSuccess, onFailed); + + }; + + let initEcompMenu:Function = (user):void => { + ecompHeaderService.getMenuItems(user.userId).then((data)=> { + $rootScope['menuItems'] = data; + }); + }; + + let initConfigurationUi:Function = ():void => { + ConfigurationUi + .getConfigurationUi() + .then((configurationUi:any) => { + cacheService.set('UIConfiguration', configurationUi); + }); + }; + + let initCategories:Function = ():void => { + let onError = ():void => { + console.log('Failed to init categories'); + }; + + categoryResourceService.getAllCategories({types: 'services'}, (categories:Array):void => { + cacheService.set('serviceCategories', categories); + }, onError); + + categoryResourceService.getAllCategories({types: 'resources'}, (categories:Array):void => { + cacheService.set('resourceCategories', categories); + }, onError); + + categoryResourceService.getAllCategories({types: 'products'}, (categories:Array):void => { + cacheService.set('productCategories', categories); + }, onError); + }; + + let initBaseUrl:Function = ():void => { + let env:string = sdcConfig.environment; + let baseUrl:string = $location.absUrl(); + console.log("baseUrl="+baseUrl); + + if(baseUrl) { + sdcConfig.api.baseUrl = baseUrl; + + if(env==='prod'){ + //let tempUrl = $location.absUrl().split('/sdc1/'); + var mainUrl = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: ''); + console.log("mainUrl="+mainUrl); + sdcConfig.api.root = mainUrl + sdcConfig.api.root; + console.log("sdcConfig.api.root="+sdcConfig.api.root); + } + } + }; + + let initLeftPalette:Function = ():void => { + LeftPaletteLoaderService.loadLeftPanel(); + }; + + //handle http config + $http.defaults.withCredentials = true; + $http.defaults.headers.common[cookieService.getUserIdSuffix()] = cookieService.getUserId(); + + initBaseUrl(); + initSdcVersion(); + initConfigurationUi(); + Utils.Constants.IMAGE_PATH = sdcConfig.imagesPath; + initLeftPalette(); + + //handle stateChangeStart + let internalDeregisterStateChangeStartWatcher:Function = ():void => { + if (deregisterStateChangeStartWatcher) { + deregisterStateChangeStartWatcher(); + deregisterStateChangeStartWatcher = null; + } + }; + + let removeLoader:Function = ():void => { + $(".sdc-loading-page .main-loader").addClass("animated fadeOut"); + $(".sdc-loading-page .caption1").addClass("animated fadeOut"); + $(".sdc-loading-page .caption2").addClass("animated fadeOut"); + window.setTimeout(():void=>{ + $(".sdc-loading-page .main-loader").css("display", "none"); + $(".sdc-loading-page .caption1").css("display", "none"); + $(".sdc-loading-page .caption2").css("display", "none"); + $(".sdc-loading-page").addClass("animated fadeOut"); + },1000); + }; + + let onNavigateOut:Function = (toState, toParams):void => { + let onOk = ():void => { + $state.current.data.unsavedChanges = false; + $state.go(toState.name, toParams); + }; + + let data = sdcMenu.alertMessages.exitWithoutSaving; + //open notify to user if changes are not saved + ModalsHandler.openAlertModal(data.title, data.message).then(onOk); + }; + + let onStateChangeStart:Function = (event, toState, toParams, fromState, fromParams):void => { + console.info((new Date()).getTime()); + console.info('$stateChangeStart', toState.name); + //set body class + $rootScope['bodyClass'] = 'default-class'; + if(toState.data && toState.data.bodyClass){ + $rootScope['bodyClass'] = toState.data.bodyClass; + } + + // Workaround in case we are entering other state then workspace (user move to catalog) + // remove the changeComponentCsarVersion, user should open again the VSP list and select one for update. + if (toState.name.indexOf('workspace') === -1) { + if (cacheService.contains(Utils.Constants.CHANGE_COMPONENT_CSAR_VERSION_FLAG)){ + cacheService.remove(Utils.Constants.CHANGE_COMPONENT_CSAR_VERSION_FLAG); + } + } + + //saving last state to params , for breadcrumbs + if (['dashboard', 'catalog', 'onboardVendor'].indexOf(fromState.name) > -1) { + toParams.previousState = fromState.name; + } else { + toParams.previousState = fromParams.previousState; + } + + if (toState.name !== 'error-403' && !UserResourceClass.getLoggedinUser()) { + internalDeregisterStateChangeStartWatcher(); + event.preventDefault(); + + UserResourceClass.authorize().$promise.then((user:Services.IUserResource) => { + if(!doesUserHasAccess(toState, user)){ + $state.go('error-403'); + console.info('User has no permissions'); + registerStateChangeStartWatcher(); + return; + } + UserResourceClass.setLoggedinUser(user); + cacheService.set('user', user); + initCategories(); + // initEcompMenu(user); + setTimeout(function () { + + removeLoader(); + + // initCategories(); + if(UserResourceClass.getLoggedinUser().role === 'ADMIN'){ + // toState.name = "adminDashboard"; + $state.go("adminDashboard", toParams); + registerStateChangeStartWatcher(); + return; + } + + // After user authorized init categories + window.setTimeout(():void=>{ + //if ($state.current.name==='' || $state.current.name==='preloading') { + if ($state.current.name === "welcome" && sdcConfig.openSource) { + event.preventDefault(); + $state.go("dashboard"); + registerStateChangeStartWatcher(); + } + else if ($state.current.name==='') { + $state.go(toState.name, toParams); + } + + console.log("------$state.current.name=" + $state.current.name); + console.info('-----registerStateChangeStartWatcher authorize $stateChangeStart'); + registerStateChangeStartWatcher(); + + },1000); + + }, 0); + + }, () => { + $state.go('error-403'); + + console.info('registerStateChangeStartWatcher error-403 $stateChangeStart'); + registerStateChangeStartWatcher(); + }); + } + else if(UserResourceClass.getLoggedinUser()){ + internalDeregisterStateChangeStartWatcher(); + if(!doesUserHasAccess(toState, UserResourceClass.getLoggedinUser())){ + event.preventDefault(); + $state.go('error-403'); + console.info('User has no permissions'); + } + if(toState.name === "welcome") { + $state.go("dashboard"); + } + registerStateChangeStartWatcher(); + //if form is dirty and not save - notify to user + if(fromState.data && fromState.data.unsavedChanges && fromParams.id != toParams.id){ + event.preventDefault(); + onNavigateOut(toState, toParams); + } + } + + }; + + let doesUserHasAccess:Function = (toState, user):boolean =>{ + + let isUserHasAccess = true; + if(toState.permissions && toState.permissions.length > 0) { + isUserHasAccess = _.includes(toState.permissions, user.role); + } + return isUserHasAccess; + }; + let deregisterStateChangeStartWatcher:Function; + + let registerStateChangeStartWatcher:Function = ():void => { + internalDeregisterStateChangeStartWatcher(); + console.info('registerStateChangeStartWatcher $stateChangeStart'); + deregisterStateChangeStartWatcher = $rootScope.$on('$stateChangeStart', (event, toState, toParams, fromState, fromParams):void => { + onStateChangeStart(event, toState, toParams, fromState, fromParams); + }); + }; + + registerStateChangeStartWatcher(); + + }]); + + + +} + diff --git a/catalog-ui/app/scripts/directives/clicked-outside/clicked-outside-directive.ts b/catalog-ui/app/scripts/directives/clicked-outside/clicked-outside-directive.ts new file mode 100644 index 0000000000..1b0af4ef99 --- /dev/null +++ b/catalog-ui/app/scripts/directives/clicked-outside/clicked-outside-directive.ts @@ -0,0 +1,131 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + + class ClickedOutsideModel{ + + private clickedOutsideContainerSelector: string; + private onClickedOutsideGetter: Function; + private clickedOutsideEnableGetter: Function; + + constructor(clickedOutsideData: any) { + this.clickedOutsideContainerSelector = clickedOutsideData.clickedOutsideContainerSelector; + this.onClickedOutsideGetter = clickedOutsideData.onClickedOutsideGetter; + this.clickedOutsideEnableGetter = clickedOutsideData.clickedOutsideEnableGetter; + } + + public getClickedOutsideContainerSelector = (): string => { + return this.clickedOutsideContainerSelector; + } + + public getOnClickedOutsideGetter = (): Function => { + return this.onClickedOutsideGetter; + } + + public getClickedOutsideEnableGetter = (): Function => { + return this.clickedOutsideEnableGetter; + } + } + + export interface IClickedOutsideDirectiveScope extends ng.IScope{} + + export class ClickedOutsideDirective implements ng.IDirective { + + constructor(private $document: JQuery, private $parse: ng.IParseService) {} + + restrict = 'A'; + + link = (scope:IClickedOutsideDirectiveScope, element: JQuery, attrs) => { + + let container: HTMLElement; + let attrsAfterEval = scope.$eval(attrs.clickedOutside); + attrsAfterEval.onClickedOutsideGetter = this.$parse(attrsAfterEval.onClickedOutside); + attrsAfterEval.clickedOutsideEnableGetter = this.$parse(attrsAfterEval.clickedOutsideEnable); + + let clickedOutsideModel: ClickedOutsideModel = new ClickedOutsideModel(attrsAfterEval); + + + let getContainer: Function = ():HTMLElement => { + if(!container){ + let clickedOutsideContainerSelector: string = clickedOutsideModel.getClickedOutsideContainerSelector(); + if(!angular.isUndefined(clickedOutsideContainerSelector) && clickedOutsideContainerSelector !== ''){ + container = element.parents(clickedOutsideContainerSelector+':first')[0]; + if(!container){ + container = element[0]; + } + }else{ + container = element[0]; + } + } + return container; + }; + + + let onClickedOutside = (event: JQueryEventObject) => { + let containerDomElement: HTMLElement = getContainer(); + let targetDomElementJq: JQuery = angular.element(event.target); + if(targetDomElementJq.hasClass('tooltip') || targetDomElementJq.parents('.tooltip:first').length){ + return; + } + let targetDomElement: HTMLElement = targetDomElementJq[0]; + if (!containerDomElement.contains(targetDomElement)){ + scope.$apply(() => { + let onClickedOutsideGetter:Function = clickedOutsideModel.getOnClickedOutsideGetter(); + onClickedOutsideGetter(scope); + }); + } + }; + + let attachDomEvents: Function = () => { + this.$document.on('mousedown', onClickedOutside); + }; + + let detachDomEvents: Function = () => { + this.$document.off('mousedown', onClickedOutside); + }; + + // + scope.$on('$destroy', () => { + detachDomEvents(); + }); + + + scope.$watch(() => { + let clickedOutsideEnableGetter: Function = clickedOutsideModel.getClickedOutsideEnableGetter(); + return clickedOutsideEnableGetter(scope); + }, (newValue: boolean) => { + if(newValue){ + attachDomEvents(); + return; + } + detachDomEvents(); + }); + + + } + + public static factory = ($document: JQuery, $parse: ng.IParseService) => { + return new ClickedOutsideDirective($document, $parse); + } + } + + ClickedOutsideDirective.factory.$inject = ['$document', '$parse']; +} diff --git a/catalog-ui/app/scripts/directives/custom-validation/custom-validation.ts b/catalog-ui/app/scripts/directives/custom-validation/custom-validation.ts new file mode 100644 index 0000000000..e2f831ed53 --- /dev/null +++ b/catalog-ui/app/scripts/directives/custom-validation/custom-validation.ts @@ -0,0 +1,55 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + + export interface ICustomValidationScope extends ng.IScope { + validationFunc: Function; + } + + export class CustomValidationDirective implements ng.IDirective { + + constructor() {} + + require = 'ngModel'; + restrict = 'A'; + + scope = { + validationFunc: '=' + }; + + link = (scope:ICustomValidationScope, elem, attrs, ngModel) => { + + ngModel.$validators.customValidation = (modelValue, viewValue) :boolean => { + return scope.validationFunc(viewValue); + }; + + }; + + public static factory = ()=> { + return new CustomValidationDirective(); + }; + + } + + CustomValidationDirective.factory.$inject = []; +} diff --git a/catalog-ui/app/scripts/directives/download-artifact/download-artifact.ts b/catalog-ui/app/scripts/directives/download-artifact/download-artifact.ts new file mode 100644 index 0000000000..49bf14618c --- /dev/null +++ b/catalog-ui/app/scripts/directives/download-artifact/download-artifact.ts @@ -0,0 +1,141 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export class DOWNLOAD_CSS_CLASSES { + static DOWNLOAD_ICON = "table-download-btn tosca"; + static LOADER_ICON = "tlv-loader small loader"; + } + + export interface IDownloadArtifactScope extends ng.IScope { + $window:any; + artifact: Models.ArtifactModel; + component: Models.Components.Component; + instance:boolean; + download: Function; + showLoader:boolean; + updateDownloadIcon:Function; + } + + export class DownloadArtifactDirective implements ng.IDirective { + + constructor(private $window:any,private cacheService:Services.CacheService, private EventListenerService:Services.EventListenerService, private fileUtils:Sdc.Utils.FileUtils) {} + + scope = { + artifact: '=', + component: '=', + instance:'=', + showLoader:'=' + }; + restrict = 'EA'; + + link = (scope:IDownloadArtifactScope, element:any) => { + scope.$window = this.$window; + + element.on("click", function() { + scope.download(scope.artifact); + }); + + + let initDownloadLoader = ()=>{ + //if the artifact is in a middle of download progress register form callBack & change icon from download to loader + if(scope.showLoader && this.cacheService.get(scope.artifact.uniqueId)){ + this.EventListenerService.registerObserverCallback(Utils.Constants.EVENTS.DOWNLOAD_ARTIFACT_FINISH_EVENT + scope.artifact.uniqueId, scope.updateDownloadIcon); + window.setTimeout(():void => { + if(this.cacheService.get(scope.artifact.uniqueId)){ + element[0].className = DOWNLOAD_CSS_CLASSES.LOADER_ICON; + } + },1000); + + } + }; + + let setDownloadedFileLoader = ()=> { + if(scope.showLoader){ + //set in cache service thet the artifact is in download progress + this.cacheService.set(scope.artifact.uniqueId,true); + initDownloadLoader(); + } + }; + + let removeDownloadedFileLoader = ()=> { + if (scope.showLoader) { + this.cacheService.set(scope.artifact.uniqueId, false); + this.EventListenerService.notifyObservers(Utils.Constants.EVENTS.DOWNLOAD_ARTIFACT_FINISH_EVENT + scope.artifact.uniqueId); + } + }; + + + //replace the loader to download icon + scope.updateDownloadIcon = () =>{ + element[0].className = DOWNLOAD_CSS_CLASSES.DOWNLOAD_ICON; + }; + + + initDownloadLoader(); + + scope.download = (artifact:Models.ArtifactModel):void => { + + let onFaild = (response):void => { + console.info('onFaild', response); + removeDownloadedFileLoader(); + }; + + let onSuccess = (data:Models.IFileDownload):void => { + downloadFile(data); + removeDownloadedFileLoader(); + }; + + setDownloadedFileLoader(); + + if(scope.instance){ + scope.component.downloadInstanceArtifact(artifact.uniqueId).then(onSuccess, onFaild); + }else { + scope.component.downloadArtifact(artifact.uniqueId).then(onSuccess, onFaild); + } + }; + + let downloadFile = (file:Models.IFileDownload):void => { + if (file){ + let blob = this.fileUtils.base64toBlob(file.base64Contents,''); + let fileName = file.artifactName; + this.fileUtils.downloadFile(blob, fileName); + } + }; + + element.on('$destroy', ()=>{ + //remove listener of download event + if(scope.artifact && scope.artifact.uniqueId){ + this.EventListenerService.unRegisterObserver(Utils.Constants.EVENTS.DOWNLOAD_ARTIFACT_FINISH_EVENT + scope.artifact.uniqueId); + } + }); + + }; + + public static factory = ($window:any,cacheService:Sdc.Services.CacheService,EventListenerService:Services.EventListenerService, fileUtils:Sdc.Utils.FileUtils)=> { + return new DownloadArtifactDirective($window,cacheService,EventListenerService, fileUtils); + }; + + } + + DownloadArtifactDirective.factory.$inject = ['$window', 'Sdc.Services.CacheService', 'EventListenerService', 'FileUtils']; +} diff --git a/catalog-ui/app/scripts/directives/ecomp-header/ecomp-header.html b/catalog-ui/app/scripts/directives/ecomp-header/ecomp-header.html new file mode 100644 index 0000000000..e86f9df8b0 --- /dev/null +++ b/catalog-ui/app/scripts/directives/ecomp-header/ecomp-header.html @@ -0,0 +1,73 @@ +
    + +
    + +
    + ASDC + ASDC +
    v.{{version}}
    +
    + +
    + + + + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    diff --git a/catalog-ui/app/scripts/directives/ecomp-header/ecomp-header.less b/catalog-ui/app/scripts/directives/ecomp-header/ecomp-header.less new file mode 100644 index 0000000000..a6f7e9b5a2 --- /dev/null +++ b/catalog-ui/app/scripts/directives/ecomp-header/ecomp-header.less @@ -0,0 +1,296 @@ +@first-level-color: #067ab4; +@second-level-color: #f8f8f8; + +@first-level-height: 60px; +@second-level-height: 60px; +@third-four-level-height: 370px; + +@max-item-width: 250px; + +.sdc-ecomp-header-wrapper { + + position: absolute; + top: 0; + right: 0; + left: 0; + z-index: 999; + + ul { + margin: 0; + padding: 0; + } + + .sdc-ecomp-header { + + background-color: @first-level-color; + height: @first-level-height; + line-height: @first-level-height; + vertical-align: middle; + display: flex; + flex-direction: row; + padding: 0 20px; + + .sdc-ecomp-menu { + flex-grow: 98; + } + + } + + /* LEVEL 1 */ + .sdc-ecomp-menu-top-level { + list-style: none; + + .sdc-ecomp-menu-top-level-item:first-child { + margin-left: 0; + } + + .sdc-ecomp-menu-top-level-item { + display: inline-block; + margin: 0 20px; + position: relative; + a { + .p_14_m; + text-decoration: none; + } + + span { + &.selected { + position: absolute; + bottom: 0; + width: 0; + height: 0; + border-left: 15px solid transparent; + border-right: 15px solid transparent; + border-bottom: 15px solid @second-level-color; + } + } + } + } + + /* LEVEL 2 */ + .sdc-ecomp-menu-second-level { + background-color: @second-level-color; + box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.33); + height: @second-level-height; + list-style: none; + line-height: @second-level-height; + vertical-align: middle; + display: flex; + flex-direction: row; + padding: 0 20px; + position: fixed; + left: 0; + right: 0; + + .sdc-ecomp-menu-second-level-item:first-child { + margin-left: 0; + } + + .sdc-ecomp-menu-second-level-item { + display: inline-block; + height: @second-level-height; + line-height: @second-level-height; + + &.sdc-ecomp-menu-item-hover { + border-bottom: 4px solid #067ab4; + } + + a { + .m_14_r; + text-decoration: none; + text-align:center; + padding: 0 20px; + display: block; + + &:hover { + .s_14_r; + font-weight:bold; + } + + &:active { + font-weight: bold; + } + + /* fix jump when hovering text */ + &:after { + display:block; + content:attr(title); + font-weight:bold; + height:1px; + color:transparent; + overflow:hidden; + visibility:hidden; + } + } + + } + + } + + /* LEVEL 3 */ + ul.sdc-ecomp-menu-third-level { + background-color: #ffffff; + box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1); + min-height: @third-four-level-height; + list-style: none; + + display: flex; + flex-direction: row; + /*flex-wrap: wrap;*/ + position: fixed; + top: @first-level-height + @second-level-height; + left: 0; + right: 0; + padding: 0 40px; + + li.sdc-ecomp-menu-third-level-item { + height: 40px; + line-height: 40px; + position: relative; + /*width: @max-item-width;*/ + max-width: @max-item-width; + + .sdc-ecomp-menu-third-level-title { + .m_14_m; + text-decoration: none; + text-align: left; + display: block; + padding: 0 20px; + line-height: 20px; + margin-top: 20px; + font-weight: bold; + cursor: pointer; + } + + .sdc-ecomp-menu-four-level-seperator { + position: absolute; + border-right: solid 1px #e5e5e5; + height: @third-four-level-height - 20; + top: 10px; + } + } + + li.sdc-ecomp-menu-third-level-item:first-child { + .sdc-ecomp-menu-four-level-seperator { + border: none; + } + } + } + + /* LEVEL 4 */ + ul.sdc-ecomp-menu-four-level { + display: flex; + flex-direction: column; + margin-top: 10px; + + li.sdc-ecomp-menu-four-level-item { + display: block; + /*width: @max-item-width;*/ + max-width: @max-item-width; + line-height: 20px; + + a { + .m_14_r; + text-decoration: none; + text-align: left; + display: block; + + &:hover { + .s_14_r; + font-weight: bold; + } + } + } + } + +} + +.sdc-ecomp-logo-wrapper { + flex-grow: 1; + .p_18_m; + white-space: nowrap; + min-width: 210px; + text-align: left; + position: relative; + + .sdc-ecomp-logo { + background-image: url("images/att_logo_white.png"); + background-repeat: no-repeat; + display: inline-block; + vertical-align: middle; + width: 55px; + height: 55px; + } + + .sdc-ecomp-header-version { + .c_16; + .opacity(0.8); + position: absolute; + top: 34px; + line-height: 20px; + left: 56px; + } + + a.sdc-ecomp-header-title { + .p_24; + text-decoration: none; + } +} + + +.sdc-ecomp-user-wrapper { + + flex-grow: 1; + .p_14_m; + white-space: nowrap; + display: flex; + flex-direction: row; + align-items: center; + height: @first-level-height; + + .sdc-ecomp-user-icon { + margin-right: 20px; + .tlv-sprite; + .tlv-sprite.user; + } + + .sdc-ecomp-user-details { + display: flex; + flex-direction: column; + } + + .sdc-ecomp-user-details-name-role { + line-height: 20px; + + .sdc-ecomp-user-details-name { + max-width: 160px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + vertical-align: bottom; + + .bold; + display: inline-block; + } + + .sdc-ecomp-user-details-role { + .bold; + display: inline-block; + margin-left: 6px; + + &:before { + content: ''; + margin-right: 8px; + border-left: 1px solid @color_m; + } + } + } + + .sdc-ecomp-user-details-last-login { + .font-type._3; + display: block; + line-height: 20px; + height: 20px; + } + +} diff --git a/catalog-ui/app/scripts/directives/ecomp-header/ecomp-header.ts b/catalog-ui/app/scripts/directives/ecomp-header/ecomp-header.ts new file mode 100644 index 0000000000..7102c810ba --- /dev/null +++ b/catalog-ui/app/scripts/directives/ecomp-header/ecomp-header.ts @@ -0,0 +1,235 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export class MenuItem { + menuId:number; + column:number; + text:string; + parentMenuId:number; + url:string; + children:Array + } + + export interface IEcompHeaderDirectiveScope extends ng.IScope { + menuData:Array; + version:string; + clickableLogo:string; + contactUsUrl:string; + getAccessUrl:string; + megaMenuDataObjectTemp:Array; + megaMenuDataObject:Array; + + selectedTopMenu:MenuItem; + selectedSubMenu:MenuItem; + + firstMenuLevelClick:Function; + subMenuEnterAction:Function; + subMenuLeaveAction:Function; + + memuItemClick:Function; + user: Models.IUser; + } + + export class EcompHeaderDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService, + private $http:ng.IHttpService, + private sdcConfig:Models.IAppConfigurtaion, + private UserResourceClass:Services.IUserResourceClass) { + + } + + scope = { + menuData: '=', + version: '@', + clickableLogo: '@?' + }; + + public replace = true; + public restrict = 'E'; + public controller = EcompHeaderController; + + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/ecomp-header/ecomp-header.html'); + }; + + link = ($scope:IEcompHeaderDirectiveScope, $elem:JQuery, attr:any) => { + + if (!$scope.clickableLogo){ + $scope.clickableLogo="true"; + } + + let findMenuItemById = (menuId):MenuItem => { + let selectedMenuItem:MenuItem = _.find($scope.menuData, (item:MenuItem)=>{ + if (item.menuId === menuId){ + return item; + } + }); + return selectedMenuItem; + }; + + let initUser = ():void => { + let defaultUserId:string; + let user:Services.IUserResource = this.UserResourceClass.getLoggedinUser(); + if (!user) { + defaultUserId = this.$http.defaults.headers.common[this.sdcConfig.cookie.userIdSuffix]; + user = this.UserResourceClass.get({id: defaultUserId}, ():void => { + $scope.user = new Models.User(user); + }); + } else { + $scope.user = new Models.User(user); + } + }; + + $scope.firstMenuLevelClick = (menuId:number):void => { + let selectedMenuItem:MenuItem = _.find($scope.megaMenuDataObjectTemp, (item:MenuItem)=>{ + if (item.menuId === menuId){ + return item; + } + }); + if (selectedMenuItem) { + $scope.selectedTopMenu = selectedMenuItem; + //console.log("Selected menu item: " + selectedMenuItem.text); + } + }; + + $scope.subMenuEnterAction = (menuId:number):void => { + $scope.selectedSubMenu = findMenuItemById(menuId); + }; + + $scope.subMenuLeaveAction = (menuId:number):void => { + $scope.selectedTopMenu = undefined; + }; + + $scope.memuItemClick = (menuItem:MenuItem):void => { + if (menuItem.url){ + window.location.href=menuItem.url; + } else { + console.log("Menu item: " + menuItem.text + " does not have defined URL!"); + } + }; + + initUser(); + + }; + + public static factory = ($templateCache:ng.ITemplateCacheService, + $http:ng.IHttpService, + sdcConfig:Models.IAppConfigurtaion, + UserResourceClass:Services.IUserResourceClass)=> { + return new EcompHeaderDirective($templateCache, $http, sdcConfig, UserResourceClass); + }; + + } + + export class EcompHeaderController { + + messages:any; + getAttachId:Function; + render:any; + reRender:Function; + register:Function; + deregister:Function; + head:any; + + static '$inject' = [ + '$element', + '$scope', + '$attrs', + '$animate' + ]; + + constructor(private $element:JQuery, + private $scope:IEcompHeaderDirectiveScope, + private $attrs:ng.IAttributes, + private $animate:any) { + + this.$scope = $scope; + + this.$scope.$watch('menuData', (newVal, oldVal) => { + if (newVal){ + this.init(); + } + }); + + } + + init = ():void => { + + this.$scope.contactUsUrl = "https://wiki.web.att.com/display/EcompPortal/ECOMP+Portal+Home"; + this.$scope.getAccessUrl = "http://ecomp-tlv-dev2.uccentral.att.com:8080/ecompportal/get_access"; + + let unflatten = ( array, parent?, tree? ) => { + tree = typeof tree !== 'undefined' ? tree : []; + parent = typeof parent !== 'undefined' ? parent : { menuId: null }; + let children = _.filter( array, function(child){ return child["parentMenuId"] == parent.menuId; }); + if( !_.isEmpty( children ) ){ + if( parent.menuId === null ){ + tree = children; + }else{ + parent['children'] = children + } + _.each( children, function( child ){ unflatten( array, child ) } ); + } + return tree; + }; + + let menuStructureConvert = (menuItems) => { + console.log(menuItems); + this.$scope.megaMenuDataObjectTemp = [ + { + menuId: 1001, + text: "ECOMP", + children: menuItems + }, + { + menuId: 1002, + text: "Help", + children: [ + { + text:"Contact Us", + url: this.$scope.contactUsUrl + }] + } + ]; + + /*{ + text:"Get Access", + url: this.$scope.getAccessUrl + }*/ + return this.$scope.megaMenuDataObjectTemp; + }; + + let a = unflatten(this.$scope.menuData); + this.$scope.megaMenuDataObject = menuStructureConvert(a); + //console.log(this.$scope.megaMenuDataObject); + }; + } + + EcompHeaderDirective.factory.$inject = ['$templateCache', '$http', 'sdcConfig', 'Sdc.Services.UserResourceService']; + +} + + + + diff --git a/catalog-ui/app/scripts/directives/edit-name-popover/edit-module-name-popover.html b/catalog-ui/app/scripts/directives/edit-name-popover/edit-module-name-popover.html new file mode 100644 index 0000000000..d90c52d9a6 --- /dev/null +++ b/catalog-ui/app/scripts/directives/edit-name-popover/edit-module-name-popover.html @@ -0,0 +1,31 @@ +
    +
    + +
    + {{module.vfInstanceName}} +
    +
    + +
    +
    + + +
    +
    + {{module.moduleName}} + + +
    +
    +
    diff --git a/catalog-ui/app/scripts/directives/edit-name-popover/edit-name-popover-directive.ts b/catalog-ui/app/scripts/directives/edit-name-popover/edit-name-popover-directive.ts new file mode 100644 index 0000000000..a033df054b --- /dev/null +++ b/catalog-ui/app/scripts/directives/edit-name-popover/edit-name-popover-directive.ts @@ -0,0 +1,98 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface IEditNamePopoverDirectiveScope extends ng.IScope { + isOpen: boolean; + templateUrl: string; + module: any; + direction: string; + header: string; + heatNameValidationPattern:RegExp; + originalName:string; + onSave:any; + + closePopover(isCancel:boolean):void; + validateField(field:any, originalName:string):boolean; + updateHeatName(heatName:string):void; + onInit():void; + } + + export class EditNamePopoverDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService, private ValidationPattern:RegExp) { + } + + scope = { + direction: "@?", + module: "=", + header: "@?", + onSave: "&" + }; + + link = (scope:IEditNamePopoverDirectiveScope) => { + if(!scope.direction) { + scope.direction = 'top'; + } + + scope.originalName = ''; + scope.templateUrl = "/app/scripts/directives/edit-name-popover/edit-module-name-popover.html"; + scope.isOpen = false; + + scope.closePopover = (isCancel:boolean = true) => { + scope.isOpen = !scope.isOpen; + + if(isCancel) { + scope.module.heatName = scope.originalName; + } + }; + + scope.onInit = () => { + scope.originalName = scope.module.heatName; + }; + + scope.validateField = (field:any):boolean => { + return !!(field && field.$dirty && field.$invalid); + }; + + scope.heatNameValidationPattern = this.ValidationPattern; + + scope.updateHeatName = () => { + scope.closePopover(false); + scope.onSave(); + } + + }; + + replace = true; + restrict = 'E'; + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/edit-name-popover/edit-name-popover-view.html'); + }; + + public static factory = ($templateCache:ng.ITemplateCacheService, ValidationPattern:RegExp)=> { + return new EditNamePopoverDirective($templateCache, ValidationPattern); + } + } + + EditNamePopoverDirective.factory.$inject = ['$templateCache', 'ValidationPattern']; +} diff --git a/catalog-ui/app/scripts/directives/edit-name-popover/edit-name-popover-view.html b/catalog-ui/app/scripts/directives/edit-name-popover/edit-name-popover-view.html new file mode 100644 index 0000000000..17beead6b3 --- /dev/null +++ b/catalog-ui/app/scripts/directives/edit-name-popover/edit-name-popover-view.html @@ -0,0 +1 @@ +
    diff --git a/catalog-ui/app/scripts/directives/edit-name-popover/edit-name-popover.less b/catalog-ui/app/scripts/directives/edit-name-popover/edit-name-popover.less new file mode 100644 index 0000000000..3d76a352ce --- /dev/null +++ b/catalog-ui/app/scripts/directives/edit-name-popover/edit-name-popover.less @@ -0,0 +1,71 @@ +.popover { + max-width: none; + width: 310px; + left: initial !important; + right: 10px; + z-index: 100; + border-radius: 0; + + .top > .arrow { + bottom: -8px !important; + } + + .popover-title { + background-color: transparent; + border-bottom: 2px solid #40b7e4; + margin-left: 20px; + margin-right: 20px; + padding: 8px 14px 8px 0px; + font-family: @font-omnes-medium; + font-weight: bold; + } + + .arrow { + left: 95% !important; + border-width: 7px; + bottom: -8px !important; + } + + .popover-content { + width: inherit; + padding: 9px 20px; + } + + .form-group { + margin-top: 9px; + } + + .popover-btn { + float:right; + margin-left: 10px; + margin-bottom: 20px; + } + + .close-popover-btn { + position: absolute; + top: 11px; + right: 25px; + } + + .close-popover-btn:hover { + cursor: pointer; + } + + .popover-input { + height: 47px; + margin-bottom:5px; + } + + .popover-label { + text-overflow: ellipsis; + display: block; + white-space: nowrap; + margin-bottom: 10px; + font-family: @font-omnes-medium; + color: @main_color_l; + } + + .w-sdc-form .i-sdc-form-item { + margin-bottom: 0px; + } +} diff --git a/catalog-ui/app/scripts/directives/elements/checkbox/checkbox.html b/catalog-ui/app/scripts/directives/elements/checkbox/checkbox.html new file mode 100644 index 0000000000..daf2a89ac2 --- /dev/null +++ b/catalog-ui/app/scripts/directives/elements/checkbox/checkbox.html @@ -0,0 +1,13 @@ + diff --git a/catalog-ui/app/scripts/directives/elements/checkbox/checkbox.less b/catalog-ui/app/scripts/directives/elements/checkbox/checkbox.less new file mode 100644 index 0000000000..0747a680a9 --- /dev/null +++ b/catalog-ui/app/scripts/directives/elements/checkbox/checkbox.less @@ -0,0 +1,35 @@ +label.tlv-checkbox { + font-weight: normal; +} + +/* +input[type="checkbox"] { + display:none; +} + +input[type="checkbox"] + label span { + margin-right: 6px; + vertical-align: text-bottom; + .sprite-new; + .checkbox_unchecked; + cursor:pointer; +} + +input[type="checkbox"]:checked + label span { + vertical-align: text-bottom; + .sprite-new; + .checkbox_checked; +} + +input[type="checkbox"]:focus + label span { + vertical-align: text-bottom; + .sprite-new; + .checkbox_focus; +} + +input[type="checkbox"][disabled] + label{ + vertical-align: text-bottom; + .sprite-new; + .checkbox_disabled; +} +*/ diff --git a/catalog-ui/app/scripts/directives/elements/checkbox/checkbox.ts b/catalog-ui/app/scripts/directives/elements/checkbox/checkbox.ts new file mode 100644 index 0000000000..c45a9d92e1 --- /dev/null +++ b/catalog-ui/app/scripts/directives/elements/checkbox/checkbox.ts @@ -0,0 +1,66 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface ICheckboxElementScope extends ng.IScope { + elemId: string; + text: string; + sdcChecklistModel: any; + sdcChecklistValue: string; + disabled:boolean; + } + + export class CheckboxElementDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService, + private $filter:ng.IFilterService) { + } + + public replace = true; + public restrict = 'E'; + public transclude = false; + + scope = { + elemId: '@', + text: '@', + disabled: '=', + sdcChecklistModel: '=', + sdcChecklistValue: '=' + }; + + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/elements/checkbox/checkbox.html'); + }; + + public link = (scope:ICheckboxElementScope, $elem:ng.IAugmentedJQuery, $attrs:angular.IAttributes) => { + //$elem.removeAttr("id") + //console.log(scope.sdcChecklistValue); + }; + + public static factory = ($templateCache:ng.ITemplateCacheService, $filter:ng.IFilterService)=> { + return new CheckboxElementDirective($templateCache, $filter); + }; + + } + + CheckboxElementDirective.factory.$inject = ['$templateCache', '$filter']; +} diff --git a/catalog-ui/app/scripts/directives/elements/radiobutton/radiobutton.html b/catalog-ui/app/scripts/directives/elements/radiobutton/radiobutton.html new file mode 100644 index 0000000000..b31fae5d73 --- /dev/null +++ b/catalog-ui/app/scripts/directives/elements/radiobutton/radiobutton.html @@ -0,0 +1,5 @@ +
    + + +
    diff --git a/catalog-ui/app/scripts/directives/elements/radiobutton/radiobutton.less b/catalog-ui/app/scripts/directives/elements/radiobutton/radiobutton.less new file mode 100644 index 0000000000..e69de29bb2 diff --git a/catalog-ui/app/scripts/directives/elements/radiobutton/radiobutton.ts b/catalog-ui/app/scripts/directives/elements/radiobutton/radiobutton.ts new file mode 100644 index 0000000000..9fe58d8f8b --- /dev/null +++ b/catalog-ui/app/scripts/directives/elements/radiobutton/radiobutton.ts @@ -0,0 +1,71 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + import INgModelController = angular.INgModelController; + 'use strict'; + + export interface IRadiobuttonElementScope extends ng.IScope { + elemId: string; + elemName: string; + text: string; + sdcModel: any; + value: any; + disabled: boolean; + onValueChange:Function; + } + + export class RadiobuttonElementDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService, + private $filter:ng.IFilterService) { + } + + public replace = true; + public restrict = 'E'; + public transclude = false; + + scope = { + elemId: '@', + elemName: '@', + text: '@', + sdcModel: '=', + value: '@', + disabled: '=', + onValueChange: '&' + }; + + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/elements/radiobutton/radiobutton.html'); + }; + + public link = (scope:IRadiobuttonElementScope, $elem:ng.IAugmentedJQuery, $attrs:angular.IAttributes) => { + //$elem.removeAttr("id") + //console.log(scope.sdcChecklistValue); + }; + + public static factory = ($templateCache:ng.ITemplateCacheService, $filter:ng.IFilterService)=> { + return new RadiobuttonElementDirective($templateCache, $filter); + }; + + } + + RadiobuttonElementDirective.factory.$inject = ['$templateCache', '$filter']; +} diff --git a/catalog-ui/app/scripts/directives/ellipsis/ellipsis-directive.html b/catalog-ui/app/scripts/directives/ellipsis/ellipsis-directive.html new file mode 100644 index 0000000000..31fa06adda --- /dev/null +++ b/catalog-ui/app/scripts/directives/ellipsis/ellipsis-directive.html @@ -0,0 +1,7 @@ +{{actualText}} + + + {{collapsed ? "More" : "Less"}} + diff --git a/catalog-ui/app/scripts/directives/ellipsis/ellipsis-directive.less b/catalog-ui/app/scripts/directives/ellipsis/ellipsis-directive.less new file mode 100644 index 0000000000..d8dfdbb73b --- /dev/null +++ b/catalog-ui/app/scripts/directives/ellipsis/ellipsis-directive.less @@ -0,0 +1,10 @@ +.ellipsis-directive-more-less { + .a_9; + .bold; + .hand; + float: right; + margin-right: 17px; + line-height: 23px; + text-decoration: underline; + text-align: left; +} diff --git a/catalog-ui/app/scripts/directives/ellipsis/ellipsis-directive.ts b/catalog-ui/app/scripts/directives/ellipsis/ellipsis-directive.ts new file mode 100644 index 0000000000..a5ccf248e0 --- /dev/null +++ b/catalog-ui/app/scripts/directives/ellipsis/ellipsis-directive.ts @@ -0,0 +1,80 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + export interface IEllipsisScope extends ng.IScope { + ellipsis: string; + maxChars: number; + toggleText(): void; + collapsed: boolean; + actualText: string; + + } + + export class EllipsisDirective implements ng.IDirective { + + constructor(private $templateCache: ng.ITemplateCacheService) {} + + scope = { + ellipsis: '=', + moreClass: '@', + maxChars: '=' + }; + + replace = false; + restrict = 'A'; + template = (): string => { + return this.$templateCache.get('/app/scripts/directives/ellipsis/ellipsis-directive.html'); + }; + + link = (scope:IEllipsisScope, $elem:any) => { + + + scope.collapsed = true; + + scope.toggleText = (): void => { + if(scope.ellipsis && scope.collapsed) { + scope.actualText = scope.ellipsis.substr(0, scope.maxChars); + scope.actualText += scope.ellipsis.length > scope.maxChars ? '...' : ''; + } + else + { + scope.actualText = scope.ellipsis; + } + }; + + scope.$watch("ellipsis", function(){ + scope.collapsed = true; + scope.toggleText(); + }); + + + + }; + + public static factory = ($templateCache: ng.ITemplateCacheService)=> { + return new EllipsisDirective($templateCache); + }; + + } + + EllipsisDirective.factory.$inject = ['$templateCache']; +} diff --git a/catalog-ui/app/scripts/directives/events/on-last-repeat/on-last-repeat.ts b/catalog-ui/app/scripts/directives/events/on-last-repeat/on-last-repeat.ts new file mode 100644 index 0000000000..0fb682d202 --- /dev/null +++ b/catalog-ui/app/scripts/directives/events/on-last-repeat/on-last-repeat.ts @@ -0,0 +1,61 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + /** + * Usage: + * In data-ng-repeat html:
      + * In the controller, catch the last repeat: + * $scope.$on('onRepeatLast', function(scope, element, attrs){ + * //work your magic + * }); + */ + export interface IOnLastRepeatDirectiveScope extends ng.IScope { + $last:any; + } + + export class OnLastRepeatDirective implements ng.IDirective { + + constructor() {} + + scope = {}; + + restrict = 'AE'; + replace = true; + + link = (scope:IOnLastRepeatDirectiveScope, element:any, attrs:any) => { + let s:any = scope.$parent; // repeat scope + if (s.$last) { + setTimeout(function(){ + s.$emit('onRepeatLast', element, attrs); + }, 1); + } + }; + + public static factory = ()=> { + return new OnLastRepeatDirective(); + }; + + } + + OnLastRepeatDirective.factory.$inject = []; +} diff --git a/catalog-ui/app/scripts/directives/file-opener/file-opener.html b/catalog-ui/app/scripts/directives/file-opener/file-opener.html new file mode 100644 index 0000000000..38f82554e9 --- /dev/null +++ b/catalog-ui/app/scripts/directives/file-opener/file-opener.html @@ -0,0 +1,3 @@ +
      + +
      diff --git a/catalog-ui/app/scripts/directives/file-opener/file-opener.ts b/catalog-ui/app/scripts/directives/file-opener/file-opener.ts new file mode 100644 index 0000000000..b7e3e1804c --- /dev/null +++ b/catalog-ui/app/scripts/directives/file-opener/file-opener.ts @@ -0,0 +1,77 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface IFileOpenerScope extends ng.IScope { + importFile:any; + testsId:any; + extensions:string; + + onFileSelect():void; + onFileUpload(file:any):void; + getExtensionsWithDot():string; + } + + export class FileOpenerDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService, + private $compile:ng.ICompileService) { + } + + scope = { + onFileUpload: '&', + testsId: '@', + extensions: '@' + }; + + restrict = 'AE'; + replace = true; + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/file-opener/file-opener.html'); + }; + + link = (scope:IFileOpenerScope, element:any) => { + + scope.onFileSelect = () => { + scope.onFileUpload({file: scope.importFile}); + element.html(this.$templateCache.get('/app/scripts/directives/file-opener/file-opener.html')); + this.$compile(element.contents())(scope); + }; + + scope.getExtensionsWithDot = ():string => { + let ret = []; + _.each(scope.extensions.split(','), function(item){ + ret.push("." + item.toString()); + }); + return ret.join(","); + }; + + }; + + public static factory = ($templateCache:ng.ITemplateCacheService, $compile:ng.ICompileService)=> { + return new FileOpenerDirective($templateCache, $compile); + }; + + } + + FileOpenerDirective.factory.$inject = ['$templateCache', '$compile']; +} diff --git a/catalog-ui/app/scripts/directives/file-type/file-type.ts b/catalog-ui/app/scripts/directives/file-type/file-type.ts new file mode 100644 index 0000000000..e7dee17960 --- /dev/null +++ b/catalog-ui/app/scripts/directives/file-type/file-type.ts @@ -0,0 +1,66 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export class FileTypeDirective implements ng.IDirective { + + constructor() {} + + require = 'ngModel'; + + link = (scope, elem, attrs, ngModel) => { + + let typesToApprove = ""; + + attrs.$observe('fileType', (val:string) => { + typesToApprove = val; + validate(ngModel.$viewValue); + }); + + let validate: Function = function (value) { + let fileName:string = elem.val(), valid:boolean = true; + + if (fileName && value && typesToApprove) { + let extension:string = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase(); + valid = typesToApprove.split(',').indexOf(extension) > -1; + } + + ngModel.$setValidity('filetype', valid); + if(!value) { + ngModel.$setPristine(); + } + return value; + }; + + //For DOM -> model validation + ngModel.$parsers.unshift(validate); + + }; + + public static factory = ()=> { + return new FileTypeDirective(); + }; + + } + + FileTypeDirective.factory.$inject = []; +} diff --git a/catalog-ui/app/scripts/directives/file-upload/file-upload.html b/catalog-ui/app/scripts/directives/file-upload/file-upload.html new file mode 100644 index 0000000000..7cbc8d25f3 --- /dev/null +++ b/catalog-ui/app/scripts/directives/file-upload/file-upload.html @@ -0,0 +1,22 @@ +
      + {{(fileModel && fileModel.filename) || defaultText}} +
      + +
      diff --git a/catalog-ui/app/scripts/directives/file-upload/file-upload.less b/catalog-ui/app/scripts/directives/file-upload/file-upload.less new file mode 100644 index 0000000000..1c4b010853 --- /dev/null +++ b/catalog-ui/app/scripts/directives/file-upload/file-upload.less @@ -0,0 +1,75 @@ +.i-sdc-form-file-upload { + + display: flex; + margin-top: 0; + width: 100%; + .p_1; + .bg_c; + .border-radius(2px); + border: solid 1px @border_color_f; + height: 30px; + + input[type="file"] { + cursor: inherit; + display: block; + filter: alpha(opacity=0); + width: 100px; + height: 30px; + opacity: 0; + position: absolute; + right: 0; + text-align: right; + top: 0; + } + + .i-sdc-form-file-name{ + flex-grow: 999; + text-align: left; + padding: 3px 10px; + opacity: 0.6; + width: 80%; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + + } + + .i-sdc-form-file-upload-x-btn{ + flex-grow: 1; + .sprite; + .sprite.small-x-btn-black; + cursor: pointer; + top: 10px; + right: 9px; + width: 10px; + position: relative; + } + .i-sdc-form-file-upload-label { + float: right; + width: 100px; + height: 100%; + .bg_n; + .b_9; + + .file-upload-browse-btn { + .noselect; + padding: 4px 6px; + cursor: pointer; + z-index: 999; + position: absolute; + width: 100px; + height: 28px; + text-align: center; + + &.disabled { + cursor: default; + } + } + } + + &.error { + border-color: #da1f3d; + outline: none; + box-sizing: border-box; + } +} diff --git a/catalog-ui/app/scripts/directives/file-upload/file-upload.ts b/catalog-ui/app/scripts/directives/file-upload/file-upload.ts new file mode 100644 index 0000000000..16db3e7e21 --- /dev/null +++ b/catalog-ui/app/scripts/directives/file-upload/file-upload.ts @@ -0,0 +1,134 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 1/27/2016. + */ +/// +module Sdc.Directives { + 'use strict'; + + export class FileUploadModel { + filetype: string; + filename: string; + filesize: number; + base64: string; + } + + export interface IFileUploadScope extends ng.IScope { + fileModel: FileUploadModel; + formElement:ng.IFormController; + extensions: string; + elementDisabled: string; + elementName: string; + elementRequired: string; + myFileModel: any; // From the ng bind to { + return this.$templateCache.get('/app/scripts/directives/file-upload/file-upload.html'); + }; + + link = (scope:IFileUploadScope, element:any, $attr:any) => { + + // In case the browse has filename, set it valid. + // When editing artifact the file is not sent again, so if we have filename I do not want to show error. + if (scope.fileModel && scope.fileModel.filename && scope.fileModel.filename!==''){ + scope.formElement[scope.elementName].$setValidity('required', true); + } + + scope.getExtensionsWithDot = ():string => { + let ret = []; + if(scope.extensions) { + _.each(scope.extensions.split(','), function (item) { + ret.push("." + item.toString()); + }); + } + return ret.join(","); + }; + + scope.onFileChange = ():void => { + if (scope.onFileChangedInDirective) { + scope.onFileChangedInDirective(); + } + if (scope.myFileModel) { + scope.fileModel = scope.myFileModel; + scope.formElement[scope.elementName].$setValidity('required', true); + } + }; + + scope.setEmptyError = (element):void => { + if(element.files[0].size){ + scope.formElement[scope.elementName].$setValidity('emptyFile', true); + }else{ + scope.formElement[scope.elementName].$setValidity('emptyFile', false); + scope.fileModel = undefined; + } + + }; + + // Workaround, in case user select a file then cancel (X) then select the file again, the event onChange is not fired. + // This is a workaround to fix this issue. + scope.onFileClick = (element:any):void => { + element.value = null; + }; + + scope.cancel = ():void => { + scope.fileModel.filename = ''; + scope.formElement[scope.elementName].$pristine; + scope.formElement[scope.elementName].$setValidity('required', false); + } + }; + + public static factory = ($templateCache:ng.ITemplateCacheService, sdcConfig:Models.IAppConfigurtaion)=> { + return new FileUploadDirective($templateCache, sdcConfig); + }; + + } + + FileUploadDirective.factory.$inject = ['$templateCache', 'sdcConfig']; +} diff --git a/catalog-ui/app/scripts/directives/graphs-v2/common/common-graph-utils.ts b/catalog-ui/app/scripts/directives/graphs-v2/common/common-graph-utils.ts new file mode 100644 index 0000000000..e01e455e93 --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/common/common-graph-utils.ts @@ -0,0 +1,361 @@ +/** + * Created by obarda on 12/21/2016. + */ +/** + * Created by obarda on 12/13/2016. + */ +/// +module Sdc.Graph.Utils { + + export class CommonGraphUtils { + + constructor(private NodesFactory:Sdc.Utils.NodesFactory, private LinksFactory:Sdc.Utils.LinksFactory) { + + } + + public safeApply = (scope:ng.IScope, fn:any) => { //todo remove to general utils + let phase = scope.$root.$$phase; + if (phase == '$apply' || phase == '$digest') { + if (fn && (typeof(fn) === 'function')) { + fn(); + } + } else { + scope.$apply(fn); + } + }; + + /** + * Draw node on the graph + * @param cy + * @param compositionGraphNode + * @param position + * @returns {CollectionElements} + */ + public addNodeToGraph(cy:Cy.Instance, compositionGraphNode:Models.Graph.CommonNodeBase, position?:Cy.Position):Cy.CollectionElements { + + var node = cy.add( { + group: 'nodes', + position: position, + data: compositionGraphNode, + classes: compositionGraphNode.classes + }); + + if(!node.data().isUcpe) { //ucpe should not have tooltip + this.initNodeTooltip(node); + } + return node; + }; + + /** + * The function will create a component instance node by the componentInstance position. + * If the node is UCPE the function will create all cp lan&wan for the ucpe + * @param cy + * @param compositionGraphNode + * @returns {Cy.CollectionElements} + */ + public addComponentInstanceNodeToGraph(cy:Cy.Instance, compositionGraphNode:Models.Graph.CompositionCiNodeBase):Cy.CollectionElements { + + let nodePosition = { + x: +compositionGraphNode.componentInstance.posX, + y: +compositionGraphNode.componentInstance.posY + }; + + let node = this.addNodeToGraph(cy, compositionGraphNode, nodePosition); + if (compositionGraphNode.isUcpe) { + this.createUcpeCpNodes(cy, node); + } + return node; + }; + + /** + * This function will create CP_WAN & CP_LAN for the UCPE. this is a special node on the group that will behave like ports on the ucpe + * @param cy + * @param ucpeGraphNode + */ + private createUcpeCpNodes(cy:Cy.Instance, ucpeGraphNode:Cy.CollectionNodes):void { + + let requirementsArray:Array = ucpeGraphNode.data().componentInstance.requirements["tosca.capabilities.Node"]; + //show only LAN or WAN requirements + requirementsArray = _.reject(requirementsArray, (requirement:any) => { + let name:string = requirement.ownerName.toLowerCase(); + return name.indexOf('lan') === -1 && name.indexOf('wan') === -1; + }); + requirementsArray.sort(function (a, b) { + let nameA = a.ownerName.toLowerCase().match(/[^ ]+/)[0]; + let nameB = b.ownerName.toLowerCase().match(/[^ ]+/)[0]; + let numA = _.last(a.ownerName.toLowerCase().split(' ')); + let numB = _.last(b.ownerName.toLowerCase().split(' ')); + + if (nameA === nameB) return numA > numB ? 1 : -1; + return nameA < nameB ? 1 : -1; + }); + let position = angular.copy(ucpeGraphNode.boundingbox()); + //add CP nodes to group + let topCps:number = 0; + for (let i = 0; i < requirementsArray.length; i++) { + + let cpNode = this.NodesFactory.createUcpeCpNode(angular.copy(ucpeGraphNode.data().componentInstance)); + cpNode.componentInstance.capabilities = requirementsArray[i]; + cpNode.id = requirementsArray[i].ownerId; + cpNode.group = ucpeGraphNode.data().componentInstance.uniqueId; + cpNode.name = requirementsArray[i].ownerName; //for tooltip + cpNode.displayName = requirementsArray[i].ownerName; + cpNode.displayName = cpNode.displayName.length > 5 ? cpNode.displayName.substring(0, 5) + '...' : cpNode.displayName; + + + if (cpNode.name.toLowerCase().indexOf('lan') > -1) { + cpNode.textPosition = "top"; + cpNode.componentInstance.posX = position.x1 + (i * 90) - (topCps * 90) + 53; + cpNode.componentInstance.posY = position.y1 + 400 + 27; + } else { + cpNode.textPosition = "bottom"; + cpNode.componentInstance.posX = position.x1 + (topCps * 90) + 53; + cpNode.componentInstance.posY = position.y1 + 27; + topCps++; + } + let cyCpNode = this.addComponentInstanceNodeToGraph(cy, cpNode); + cyCpNode.lock(); + } + }; + + /** + * + * @param nodes - all nodes in graph in order to find the edge connecting the two nodes + * @param fromNodeId + * @param toNodeId + * @returns {boolean} true/false if the edge is certified (from node and to node are certified) + */ + public isRelationCertified(nodes:Cy.CollectionNodes, fromNodeId:string, toNodeId:string):boolean { + let resourceTemp = _.filter(nodes, function (node:Cy.CollectionFirst) { + return node.data().id === fromNodeId || node.data().id === toNodeId; + }); + let certified:boolean = true; + + _.forEach(resourceTemp, (item) => { + certified = certified && item.data().certified; + }); + + return certified; + } + + /** + * Add link to graph - only draw the link + * @param cy + * @param link + */ + public insertLinkToGraph = (cy:Cy.Instance, link:Models.CompositionCiLinkBase) => { + + if (!this.isRelationCertified(cy.nodes(), link.source, link.target)) { + link.classes = 'not-certified-link'; + } + cy.add({ + group: 'edges', + data: link, + classes: link.classes + }); + + }; + + /** + * go over the relations and draw links on the graph + * @param cy + * @param instancesRelations + */ + public initGraphLinks(cy:Cy.Instance, instancesRelations:Array) { + + if (instancesRelations) { + _.forEach(instancesRelations, (relationshipModel:Models.RelationshipModel) => { + _.forEach(relationshipModel.relationships, (relationship:Models.Relationship) => { + let linkToCreate = this.LinksFactory.createGraphLink(cy, relationshipModel, relationship); + this.insertLinkToGraph(cy, linkToCreate); + }); + }); + } + } + + /** + * Determine which nodes are in the UCPE and set child data for them. + * @param cy + */ + public initUcpeChildren(cy:Cy.Instance){ + let ucpe:Cy.CollectionNodes = cy.nodes('[?isUcpe]'); // Get ucpe on graph if exist + _.each(cy.edges('.ucpe-host-link'), (link)=>{ + + let ucpeChild:Cy.CollectionNodes = (link.source().id() == ucpe.id())? link.target() : link.source(); + this.initUcpeChildData(ucpeChild, ucpe); + + //vls dont have ucpe-host-link connection, so need to find them and iterate separately + let connectedVLs = ucpeChild.connectedEdges().connectedNodes('.vl-node'); + _.forEach(connectedVLs, (vl)=>{ //all connected vls must be UCPE children because not allowed to connect to a VL outside of the UCPE + this.initUcpeChildData(vl, ucpe); + }); + }); + } + + /** + * Set properties for nodes contained by the UCPE + * @param childNode- node contained in UCPE + * @param ucpe- ucpe container node + */ + public initUcpeChildData(childNode:Cy.CollectionNodes, ucpe:Cy.CollectionNodes){ + + if(!childNode.data('isInsideGroup')){ + this.updateUcpeChildPosition(childNode, ucpe); + childNode.data({isInsideGroup: true}); + } + + } + + /** + * Updates UCPE child node offset, which allows child nodes to be dragged in synchronization with ucpe + * @param childNode- node contained in UCPE + * @param ucpe- ucpe container node + */ + public updateUcpeChildPosition(childNode:Cy.CollectionNodes, ucpe:Cy.CollectionNodes){ + let childPos:Cy.Position = childNode.relativePosition(); + let ucpePos:Cy.Position = ucpe.relativePosition(); + let offset:Cy.Position = { + x: childPos.x - ucpePos.x, + y: childPos.y - ucpePos.y + }; + childNode.data("ucpeOffset", offset); + } + + /** + * Removes ucpe-child properties from the node + * @param childNode- node being removed from UCPE + */ + public removeUcpeChildData(childNode:Cy.CollectionNodes){ + childNode.removeData("ucpeOffset"); + childNode.data({isInsideGroup: false}); + + } + + + public HTMLCoordsToCytoscapeCoords(cytoscapeBoundingBox:Cy.Extent, mousePos:Cy.Position):Cy.Position { + return {x: mousePos.x + cytoscapeBoundingBox.x1, y: mousePos.y + cytoscapeBoundingBox.y1} + }; + + + public getCytoscapeNodePosition = (cy: Cy.Instance, event:IDragDropEvent):Cy.Position => { + let targetOffset = $(event.target).offset(); + let x = event.pageX - targetOffset.left; + let y = event.pageY - targetOffset.top; + + return this.HTMLCoordsToCytoscapeCoords(cy.extent(), { + x: x, + y: y + }); + }; + + + public getNodePosition(node:Cy.CollectionFirstNode):Cy.Position{ + let nodePosition = node.relativePoint(); + if(node.data().isUcpe){ //UCPEs use bounding box and not relative point. + nodePosition = {x: node.boundingbox().x1, y: node.boundingbox().y1}; + } + + return nodePosition; + } + + /** + * return true/false if first node contains in second - this used in order to verify is node is entirely inside ucpe + * @param firstBox + * @param secondBox + * @returns {boolean} + */ + public isFirstBoxContainsInSecondBox(firstBox:Cy.BoundingBox, secondBox:Cy.BoundingBox) { + + return firstBox.x1 > secondBox.x1 && firstBox.x2 < secondBox.x2 && firstBox.y1 > secondBox.y1 && firstBox.y2 < secondBox.y2; + + }; + + + /** + * Check if node node bounds position is inside any ucpe on graph, and return the ucpe + * @param {diagram} the diagram. + * @param {nodeActualBounds} the actual bound position of the node. + * @return the ucpe if found else return null + */ + public isInUcpe = (cy: Cy.Instance, nodeBounds: Cy.BoundingBox): Cy.CollectionElements => { + + let ucpeNodes = cy.nodes('[?isUcpe]').filterFn((ucpeNode) => { + return this.isFirstBoxContainsInSecondBox(nodeBounds, ucpeNode.boundingbox()); + }); + return ucpeNodes; + }; + + /** + * + * @param cy + * @param node + * @returns {Array} + */ + public getLinkableNodes(cy:Cy.Instance, node:Cy.CollectionFirstNode):Array{ + let compatibleNodes = []; + _.each(cy.nodes(), (tempNode)=>{ + if(this.nodeLocationsCompatible(cy, node, tempNode)){ + compatibleNodes.push(tempNode.data()); + } + }); + return compatibleNodes; + } + + /** + * Checks whether node locations are compatible in reference to UCPEs. + * Returns true if both nodes are in UCPE or both nodes out, or one node is UCPEpart. + * @param node1 + * @param node2 + */ + public nodeLocationsCompatible(cy:Cy.Instance, node1:Cy.CollectionFirstNode, node2:Cy.CollectionFirstNode){ + + let ucpe = cy.nodes('[?isUcpe]'); + if(!ucpe.length){ return true; } + if(node1.data().isUcpePart || node2.data().isUcpePart) { return true; } + + return (this.isFirstBoxContainsInSecondBox(node1.boundingbox(), ucpe.boundingbox()) == this.isFirstBoxContainsInSecondBox(node2.boundingbox(), ucpe.boundingbox())); + + } + + /** + * This function will init qtip tooltip on the node + * @param node - the node we want the tooltip to apply on + */ + public initNodeTooltip(node:Cy.CollectionNodes) { + + let opts = { + content: function () { + return this.data('name'); + }, + position: { + my: 'top center', + at: 'bottom center', + adjust: {x:0, y:-5} + }, + style: { + classes: 'qtip-dark qtip-rounded qtip-custom', + tip: { + width: 16, + height: 8 + } + }, + show: { + event: 'mouseover', + delay: 1000 + }, + hide: {event: 'mouseout mousedown'}, + includeLabels: true + }; + + if (node.data().isUcpePart){ //fix tooltip positioning for UCPE-cps + opts.position.adjust = {x:0, y:20}; + } + + node.qtip(opts); + }; + }; + + + + CommonGraphUtils.$inject = ['NodesFactory', 'LinksFactory']; +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/common/style/component-instances-nodes-style.ts b/catalog-ui/app/scripts/directives/graphs-v2/common/style/component-instances-nodes-style.ts new file mode 100644 index 0000000000..2ec0174aa9 --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/common/style/component-instances-nodes-style.ts @@ -0,0 +1,259 @@ +/** + * Created by obarda on 12/18/2016. + */ +/** + * Created by obarda on 12/13/2016. + */ +/// +module Sdc.Graph.Utils.ComponentIntanceNodesStyle { + + export function getCompositionGraphStyle():Array { + return [ + { + selector: 'core', + css: { + 'shape': 'rectangle', + 'active-bg-size': 0, + 'selection-box-color': 'rgb(0, 159, 219)', + 'selection-box-opacity': 0.2, + 'selection-box-border-color': '#009fdb', + 'selection-box-border-width': 1 + + } + }, + { + selector: 'node', + css: { + 'font-family': 'omnes-regular,sans-serif', + 'font-size': 14, + 'events': 'yes', + 'text-events': 'yes', + 'text-border-width': 15, + 'text-border-color': Sdc.Utils.Constants.GraphColors.NODE_UCPE, + 'text-margin-y': 5 + } + }, + { + selector: '.vf-node', + css: { + 'background-color': 'transparent', + 'shape': 'rectangle', + 'label': 'data(displayName)', + 'background-image': 'data(img)', + 'width': 65, + 'height': 65, + 'background-opacity': 0, + "background-width": 65, + "background-height": 65, + 'text-valign': 'bottom', + 'text-halign': 'center', + 'background-fit': 'cover', + 'background-clip': 'node', + 'overlay-color': Sdc.Utils.Constants.GraphColors.NODE_BACKGROUND_COLOR, + 'overlay-opacity': 0 + } + }, + + { + selector: '.service-node', + css: { + 'background-color': 'transparent', + 'label': 'data(displayName)', + 'events': 'yes', + 'text-events': 'yes', + 'background-image': 'data(img)', + 'width': 64, + 'height': 64, + "border-width": 0, + 'text-valign': 'bottom', + 'text-halign': 'center', + 'background-opacity': 0, + 'overlay-color': Sdc.Utils.Constants.GraphColors.NODE_BACKGROUND_COLOR, + 'overlay-opacity': 0 + } + }, + { + selector: '.cp-node', + css: { + 'background-color': 'rgb(255,255,255)', + 'shape': 'rectangle', + 'label': 'data(displayName)', + 'background-image': 'data(img)', + 'background-width': 21, + 'background-height': 21, + 'width': 21, + 'height': 21, + 'text-valign': 'bottom', + 'text-halign': 'center', + 'background-opacity': 0, + 'overlay-color': Sdc.Utils.Constants.GraphColors.NODE_BACKGROUND_COLOR, + 'overlay-opacity': 0 + } + }, + { + selector: '.vl-node', + css: { + 'background-color': 'rgb(255,255,255)', + 'shape': 'rectangle', + 'label': 'data(displayName)', + 'background-image': 'data(img)', + 'background-width': 21, + 'background-height': 21, + 'width': 21, + 'height': 21, + 'text-valign': 'bottom', + 'text-halign': 'center', + 'background-opacity': 0, + 'overlay-color': Sdc.Utils.Constants.GraphColors.NODE_BACKGROUND_COLOR, + 'overlay-opacity': 0 + } + }, + { + selector: '.ucpe-cp', + css: { + 'background-color': Sdc.Utils.Constants.GraphColors.NODE_UCPE_CP, + 'background-width': 15, + 'background-height': 15, + 'width': 15, + 'height': 15, + 'text-halign': 'center', + 'overlay-opacity': 0, + 'label': 'data(displayName)', + 'text-valign': 'data(textPosition)', + 'text-margin-y': (ele:Cy.Collection) => { + return (ele.data('textPosition') == 'top')? -5 : 5; + }, + 'font-size': 12 + } + }, + { + selector: '.ucpe-node', + css: { + 'background-fit': 'cover', + 'padding-bottom': 0, + 'padding-top': 0 + } + }, + { + selector: '.simple-link', + css: { + 'width': 1, + 'line-color': Sdc.Utils.Constants.GraphColors.BASE_LINK, + 'target-arrow-color': '#3b7b9b', + 'target-arrow-shape': 'triangle', + 'curve-style': 'bezier', + 'control-point-step-size': 30 + } + }, + { + selector: '.vl-link', + css: { + 'width': 3, + 'line-color': Sdc.Utils.Constants.GraphColors.VL_LINK, + 'curve-style': 'bezier', + 'control-point-step-size': 30 + } + }, + { + selector: '.ucpe-host-link', + css: { + 'width': 0 + } + }, + { + selector: '.not-certified-link', + css: { + 'width': 1, + 'line-color': Sdc.Utils.Constants.GraphColors.NOT_CERTIFIED_LINK, + 'curve-style': 'bezier', + 'control-point-step-size': 30, + 'line-style': 'dashed', + 'target-arrow-color': '#3b7b9b', + 'target-arrow-shape': 'triangle' + + } + }, + + { + selector: '.not-certified', + css: { + 'shape': 'rectangle', + 'background-image': (ele:Cy.Collection) => { + return ele.data().initImage(ele) + }, + "border-width": 0 + } + }, + { + selector: 'node:selected', + css: { + "border-width": 2, + "border-color": Sdc.Utils.Constants.GraphColors.NODE_SELECTED_BORDER_COLOR, + 'shape': 'rectangle' + } + }, + { + selector: 'edge:selected', + css: { + 'line-color': Sdc.Utils.Constants.GraphColors.ACTIVE_LINK + + } + }, + { + selector: 'edge:active', + css: { + 'overlay-opacity': 0 + } + } + ] + } + + export function getBasicNodeHanlde() { + return { + positionX: "center", + positionY: "top", + offsetX: 15, + offsetY: -20, + color: "#27a337", + type: "default", + single: false, + nodeTypeNames: ["basic-node"], + imageUrl: Sdc.Utils.Constants.IMAGE_PATH + '/styles/images/resource-icons/' + 'canvasPlusIcon.png', + lineWidth: 2, + lineStyle: 'dashed' + + } + } + + export function getBasicSmallNodeHandle() { + return { + positionX: "center", + positionY: "top", + offsetX: 3, + offsetY: -25, + color: "#27a337", + type: "default", + single: false, + nodeTypeNames: ["basic-small-node"], + imageUrl: Sdc.Utils.Constants.IMAGE_PATH + '/styles/images/resource-icons/' + 'canvasPlusIcon.png', + lineWidth: 2, + lineStyle: 'dashed' + } + } + + export function getUcpeCpNodeHandle() { + return { + positionX: "center", + positionY: "center", + offsetX: -8, + offsetY: -10, + color: "#27a337", + type: "default", + single: false, + nodeTypeNames: ["ucpe-cp-node"], + imageUrl: Sdc.Utils.Constants.IMAGE_PATH + '/styles/images/resource-icons/' + 'canvasPlusIcon.png', + lineWidth: 2, + lineStyle: 'dashed' + } + } +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/common/style/module-node-style.ts b/catalog-ui/app/scripts/directives/graphs-v2/common/style/module-node-style.ts new file mode 100644 index 0000000000..62436fbf74 --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/common/style/module-node-style.ts @@ -0,0 +1,92 @@ +/** + * Created by obarda on 1/1/2017. + */ +/** + * Created by obarda on 12/18/2016. + */ +/** + * Created by obarda on 12/13/2016. + */ +/// +module Sdc.Graph.Utils.ModulesNodesStyle { + + export function getModuleGraphStyle():Array { + + return [ + { + selector: '.cy-expand-collapse-collapsed-node', + css: { + 'background-image': 'data(img)', + 'width': 34, + 'height': 32, + 'background-opacity': 0, + 'shape': 'rectangle', + 'label': 'data(displayName)', + 'events': 'yes', + 'text-events': 'yes', + 'text-valign': 'bottom', + 'text-halign': 'center', + 'text-margin-y': 5, + 'border-opacity': 0 + } + }, + { + selector: '.module-node', + css: { + 'background-color': 'transparent', + 'background-opacity': 0, + "border-width": 2, + "border-color": Sdc.Utils.Constants.GraphColors.NODE_SELECTED_BORDER_COLOR, + 'border-style': 'dashed', + 'label': 'data(displayName)', + 'events': 'yes', + 'text-events': 'yes', + 'text-valign': 'bottom', + 'text-halign': 'center', + 'text-margin-y': 8 + } + }, + { + selector: 'node:selected', + css: { + "border-opacity": 0 + } + }, + { + selector: '.simple-link:selected', + css: { + 'line-color': Sdc.Utils.Constants.GraphColors.BASE_LINK, + } + }, + { + selector: '.vl-link:selected', + css: { + 'line-color': Sdc.Utils.Constants.GraphColors.VL_LINK, + } + }, + { + selector: '.cy-expand-collapse-collapsed-node:selected', + css: { + "border-color": Sdc.Utils.Constants.GraphColors.NODE_SELECTED_BORDER_COLOR, + 'border-opacity': 1, + 'border-style': 'solid', + 'border-width': 2 + } + }, + { + selector: '.module-node:selected', + css: { + "border-color": Sdc.Utils.Constants.GraphColors.NODE_SELECTED_BORDER_COLOR, + 'border-opacity': 1 + } + }, + { + selector: '.dummy-node', + css: { + 'width': 20, + 'height': 20 + } + }, + ] + } +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/composition-graph.directive.ts b/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/composition-graph.directive.ts new file mode 100644 index 0000000000..708f1d091a --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/composition-graph.directive.ts @@ -0,0 +1,555 @@ +/// +module Sdc.Directives { + + import ComponentFactory = Sdc.Utils.ComponentFactory; + import LoaderService = Sdc.Services.LoaderService; + import GRAPH_EVENTS = Sdc.Utils.Constants.GRAPH_EVENTS; + + interface ICompositionGraphScope extends ng.IScope { + + component:Models.Components.Component; + isViewOnly:boolean; + // Link menu - create link menu + relationMenuDirectiveObj:Models.RelationMenuDirectiveObj; + isLinkMenuOpen:boolean; + createLinkFromMenu:(chosenMatch:Models.MatchBase, vl:Models.Components.Component)=>void; + + //modify link menu - for now only delete menu + relationMenuTimeout:ng.IPromise; + linkMenuObject:Models.LinkMenu; + + //left palette functions callbacks + dropCallback(event:JQueryEventObject, ui:any):void; + beforeDropCallback(event:IDragDropEvent):void; + verifyDrop(event:JQueryEventObject, ui:any):void; + + //Links menus + deleteRelation(link:Cy.CollectionEdges):void; + hideRelationMenu(); + } + + export class CompositionGraph implements ng.IDirective { + private _cy:Cy.Instance; + private _currentlyCLickedNodePosition:Cy.Position; + private $document:JQuery = $(document); + private dragElement:JQuery; + private dragComponent: Sdc.Models.ComponentsInstances.ComponentInstance; + + constructor(private $q:ng.IQService, + private $filter:ng.IFilterService, + private $log:ng.ILogService, + private $timeout:ng.ITimeoutService, + private NodesFactory:Sdc.Utils.NodesFactory, + private CompositionGraphLinkUtils:Sdc.Graph.Utils.CompositionGraphLinkUtils, + private GeneralGraphUtils:Graph.Utils.CompositionGraphGeneralUtils, + private ComponentInstanceFactory:Utils.ComponentInstanceFactory, + private NodesGraphUtils:Sdc.Graph.Utils.CompositionGraphNodesUtils, + private eventListenerService:Services.EventListenerService, + private ComponentFactory:ComponentFactory, + private LoaderService:LoaderService, + private commonGraphUtils:Graph.Utils.CommonGraphUtils, + private matchCapabilitiesRequirementsUtils:Graph.Utils.MatchCapabilitiesRequirementsUtils) { + + } + + restrict = 'E'; + templateUrl = '/app/scripts/directives/graphs-v2/composition-graph/composition-graph.html'; + scope = { + component: '=', + isViewOnly: '=' + }; + + link = (scope:ICompositionGraphScope, el:JQuery) => { + this.loadGraph(scope, el); + + scope.$on('$destroy', () => { + this._cy.destroy(); + _.forEach(GRAPH_EVENTS, (event) => { + this.eventListenerService.unRegisterObserver(event); + }); + }); + + }; + + private loadGraph = (scope:ICompositionGraphScope, el:JQuery) => { + + + let graphEl = el.find('.sdc-composition-graph-wrapper'); + this.initGraph(graphEl, scope.isViewOnly); + this.initGraphNodes(scope.component.componentInstances, scope.isViewOnly); + this.commonGraphUtils.initGraphLinks(this._cy, scope.component.componentInstancesRelations); + this.commonGraphUtils.initUcpeChildren(this._cy); + this.initDropZone(scope); + this.registerCytoscapeGraphEvents(scope); + this.registerCustomEvents(scope, el); + this.initViewMode(scope.isViewOnly); + + }; + + private initGraph(graphEl:JQuery, isViewOnly:boolean) { + + this._cy = cytoscape({ + container: graphEl, + style: Sdc.Graph.Utils.ComponentIntanceNodesStyle.getCompositionGraphStyle(), + zoomingEnabled: false, + selectionType: 'single', + boxSelectionEnabled: true, + autolock: isViewOnly, + autoungrabify: isViewOnly + }); + } + + private initViewMode(isViewOnly:boolean) { + + if (isViewOnly) { + //remove event listeners + this._cy.off('drag'); + this._cy.off('handlemouseout'); + this._cy.off('handlemouseover'); + this._cy.edges().unselectify(); + } + }; + + private registerCustomEvents(scope:ICompositionGraphScope, el:JQuery) { + + this.eventListenerService.registerObserverCallback(GRAPH_EVENTS.ON_PALETTE_COMPONENT_HOVER_IN, (component:Models.DisplayComponent) => { + this.$log.info(`composition-graph::registerEventServiceEvents:: palette hover on component: ${component.uniqueId}`); + + let nodesData = this.NodesGraphUtils.getAllNodesData(this._cy.nodes()); + let nodesLinks = this.GeneralGraphUtils.getAllCompositionCiLinks(this._cy); + + if (this.GeneralGraphUtils.componentRequirementsAndCapabilitiesCaching.containsKey(component.uniqueId)) { + let cacheComponent = this.GeneralGraphUtils.componentRequirementsAndCapabilitiesCaching.getValue(component.uniqueId); + let filteredNodesData = this.matchCapabilitiesRequirementsUtils.findByMatchingCapabilitiesToRequirements(cacheComponent, nodesData, nodesLinks); + + this.matchCapabilitiesRequirementsUtils.highlightMatchingComponents(filteredNodesData, this._cy); + this.matchCapabilitiesRequirementsUtils.fadeNonMachingComponents(filteredNodesData, nodesData, this._cy); + + return; + } + + component.component.updateRequirementsCapabilities() + .then((res) => { + component.component.capabilities = res.capabilities; + component.component.requirements = res.requirements; + + let filteredNodesData = this.matchCapabilitiesRequirementsUtils.findByMatchingCapabilitiesToRequirements(component.component, nodesData, nodesLinks); + this.matchCapabilitiesRequirementsUtils.fadeNonMachingComponents(filteredNodesData, nodesData, this._cy); + this.matchCapabilitiesRequirementsUtils.highlightMatchingComponents(filteredNodesData, this._cy) + }); + }); + + this.eventListenerService.registerObserverCallback(GRAPH_EVENTS.ON_PALETTE_COMPONENT_HOVER_OUT, () => { + this._cy.emit('hidehandles'); + this.matchCapabilitiesRequirementsUtils.resetFadedNodes(this._cy); + }); + + this.eventListenerService.registerObserverCallback(GRAPH_EVENTS.ON_PALETTE_COMPONENT_DRAG_START, (dragElement, dragComponent) => { + + this.dragElement = dragElement; + this.dragComponent = this.ComponentInstanceFactory.createComponentInstanceFromComponent(dragComponent); + }); + + this.eventListenerService.registerObserverCallback(GRAPH_EVENTS.ON_PALETTE_COMPONENT_DRAG_ACTION, (event:IDragDropEvent) => { + this._onComponentDrag(event); + + }); + + this.eventListenerService.registerObserverCallback(GRAPH_EVENTS.ON_COMPONENT_INSTANCE_NAME_CHANGED, (component:Models.ComponentsInstances.ComponentInstance) => { + + let selectedNode = this._cy.getElementById(component.uniqueId); + selectedNode.data().componentInstance.name = component.name; + selectedNode.data('displayName', selectedNode.data().getDisplayName()); + + }); + + this.eventListenerService.registerObserverCallback(GRAPH_EVENTS.ON_DELETE_COMPONENT_INSTANCE, (componentInstance:Models.ComponentsInstances.ComponentInstance) => { + let nodeToDelete = this._cy.getElementById(componentInstance.uniqueId); + this.NodesGraphUtils.deleteNode(this._cy, scope.component, nodeToDelete); + }); + + this.eventListenerService.registerObserverCallback(GRAPH_EVENTS.ON_DELETE_MULTIPLE_COMPONENTS, () => { + + this._cy.$('node:selected').each((i:number, node:Cy.CollectionNodes) => { + this.NodesGraphUtils.deleteNode(this._cy, scope.component, node); + }); + + }); + + this.eventListenerService.registerObserverCallback(GRAPH_EVENTS.ON_DELETE_EDGE, (releaseLoading:boolean, linksToDelete:Cy.CollectionEdges) => { + this.CompositionGraphLinkUtils.deleteLink(this._cy, scope.component, releaseLoading, linksToDelete); + }); + + this.eventListenerService.registerObserverCallback(GRAPH_EVENTS.ON_INSERT_NODE_TO_UCPE, (node:Cy.CollectionNodes, ucpe:Cy.CollectionNodes, updateExistingNode: boolean) => { + + this.commonGraphUtils.initUcpeChildData(node, ucpe); + //check if item is a VL, and if so, skip adding the binding to ucpe + if(!(node.data() instanceof Sdc.Models.Graph.CompositionCiNodeVl)){ + this.CompositionGraphLinkUtils.createVfToUcpeLink(scope.component, this._cy, ucpe.data(), node.data()); //create link from the node to the ucpe + } + + if(updateExistingNode){ + let vlsPendingDeletion:Cy.CollectionNodes = this.NodesGraphUtils.deleteNodeVLsUponMoveToOrFromUCPE(scope.component, node.cy(), node); //delete connected VLs that no longer have 2 links + this.CompositionGraphLinkUtils.deleteLinksWhenNodeMovedFromOrToUCPE(scope.component, node.cy(), node, vlsPendingDeletion); //delete all connected links if needed + this.GeneralGraphUtils.pushUpdateComponentInstanceActionToQueue(scope.component, true, node.data().componentInstance); //update componentInstance position + } + + }); + + this.eventListenerService.registerObserverCallback(GRAPH_EVENTS.ON_REMOVE_NODE_FROM_UCPE, (node:Cy.CollectionNodes, ucpe:Cy.CollectionNodes) => { + this.commonGraphUtils.removeUcpeChildData(node); + let vlsPendingDeletion:Cy.CollectionNodes = this.NodesGraphUtils.deleteNodeVLsUponMoveToOrFromUCPE(scope.component, node.cy(), node); + this.CompositionGraphLinkUtils.deleteLinksWhenNodeMovedFromOrToUCPE(scope.component, node.cy(), node, vlsPendingDeletion); //delete all connected links if needed + this.GeneralGraphUtils.pushUpdateComponentInstanceActionToQueue(scope.component, true, node.data().componentInstance); //update componentInstance position + }); + + this.eventListenerService.registerObserverCallback(GRAPH_EVENTS.ON_VERSION_CHANGED, (component:Models.Components.Component) => { + scope.component = component; + this.loadGraph(scope, el); + }); + + + scope.createLinkFromMenu = (chosenMatch:Models.MatchBase, vl:Models.Components.Component):void => { + scope.isLinkMenuOpen = false; + + this.CompositionGraphLinkUtils.createLinkFromMenu(this._cy, chosenMatch, vl, scope.component); + }; + + scope.hideRelationMenu = () => { + this.commonGraphUtils.safeApply(scope, () => { + scope.linkMenuObject = null; + this.$timeout.cancel(scope.relationMenuTimeout); + }); + }; + + + scope.deleteRelation = (link:Cy.CollectionEdges) => { + scope.hideRelationMenu(); + + //if multiple edges selected, delete the VL itself so edges get deleted automatically + if (this._cy.$('edge:selected').length > 1) { + this.NodesGraphUtils.deleteNode(this._cy, scope.component, this._cy.$('node:selected')); + } else { + this.CompositionGraphLinkUtils.deleteLink(this._cy, scope.component, true, link); + } + }; + } + + + private registerCytoscapeGraphEvents(scope:ICompositionGraphScope) { + + this._cy.on('addedgemouseup', (event, data) => { + scope.relationMenuDirectiveObj = this.CompositionGraphLinkUtils.onLinkDrawn(this._cy, data.source, data.target); + if (scope.relationMenuDirectiveObj != null) { + scope.$apply(() => { + scope.isLinkMenuOpen = true; + }); + } + }); + this._cy.on('tapstart', 'node', (event:Cy.EventObject) => { + this._currentlyCLickedNodePosition = angular.copy(event.cyTarget[0].position()); //update node position on drag + if(event.cyTarget.data().isUcpe){ + this._cy.nodes('.ucpe-cp').unlock(); + event.cyTarget.style('opacity', 0.5); + } + }); + + this._cy.on('drag', 'node', (event:Cy.EventObject) => { + + if (event.cyTarget.data().isDraggable) { + event.cyTarget.style({'overlay-opacity': 0.24}); + if (this.GeneralGraphUtils.isValidDrop(this._cy, event.cyTarget)) { + event.cyTarget.style({'overlay-color': Utils.Constants.GraphColors.NODE_BACKGROUND_COLOR}); + } else { + event.cyTarget.style({'overlay-color': Utils.Constants.GraphColors.NODE_OVERLAPPING_BACKGROUND_COLOR}); + } + } + + if(event.cyTarget.data().isUcpe){ + let pos = event.cyTarget.position(); + + this._cy.nodes('[?isInsideGroup]').positions((i, node)=>{ + return { + x: pos.x + node.data("ucpeOffset").x, + y: pos.y + node.data("ucpeOffset").y + } + }); + } + }); + + + this._cy.on('handlemouseover', (event, payload) => { + + if (payload.node.grabbed()) { //no need to add opacity while we are dragging and hovering othe nodes + return; + } + + let nodesData = this.NodesGraphUtils.getAllNodesData(this._cy.nodes()); + let nodesLinks = this.GeneralGraphUtils.getAllCompositionCiLinks(this._cy); + + let linkableNodes = this.commonGraphUtils.getLinkableNodes(this._cy, payload.node); + let filteredNodesData = this.matchCapabilitiesRequirementsUtils.findByMatchingCapabilitiesToRequirements(payload.node.data().componentInstance, linkableNodes, nodesLinks); + this.matchCapabilitiesRequirementsUtils.highlightMatchingComponents(filteredNodesData, this._cy); + this.matchCapabilitiesRequirementsUtils.fadeNonMachingComponents(filteredNodesData, nodesData, this._cy, payload.node.data()); + + }); + + this._cy.on('handlemouseout', () => { + this._cy.emit('hidehandles'); + this.matchCapabilitiesRequirementsUtils.resetFadedNodes(this._cy); + }); + + + this._cy.on('tapend', (event:Cy.EventObject) => { + + if (event.cyTarget === this._cy) { //On Background clicked + if (this._cy.$('node:selected').length === 0) { //if the background click but not dragged + this.eventListenerService.notifyObservers(Sdc.Utils.Constants.GRAPH_EVENTS.ON_GRAPH_BACKGROUND_CLICKED); + } + scope.hideRelationMenu(); + } + + else if (event.cyTarget.isEdge()) { //On Edge clicked + if (scope.isViewOnly) return; + this.CompositionGraphLinkUtils.handleLinkClick(this._cy, event); + this.openModifyLinkMenu(scope, this.CompositionGraphLinkUtils.getModifyLinkMenu(event.cyTarget[0], event), 6000); + } + + else { //On Node clicked + this._cy.nodes(':grabbed').style({'overlay-opacity': 0}); + + let isUcpe:boolean = event.cyTarget.data().isUcpe; + let newPosition = event.cyTarget[0].position(); + //node position changed (drop after drag event) - we need to update position + if (this._currentlyCLickedNodePosition.x !== newPosition.x || this._currentlyCLickedNodePosition.y !== newPosition.y) { + let nodesMoved:Cy.CollectionNodes = this._cy.$(':grabbed'); + if(isUcpe){ + nodesMoved = nodesMoved.add(this._cy.nodes('[?isInsideGroup]:free')); //'child' nodes will not be recognized as "grabbed" elements within cytoscape. manually add them to collection of nodes moved. + } + this.NodesGraphUtils.onNodesPositionChanged(this._cy, scope.component, nodesMoved); + } else { + this.$log.debug('composition-graph::onNodeSelectedEvent:: fired'); + scope.$apply(() => { + this.eventListenerService.notifyObservers(Sdc.Utils.Constants.GRAPH_EVENTS.ON_NODE_SELECTED, event.cyTarget.data().componentInstance); + }); + } + + if(isUcpe){ + this._cy.nodes('.ucpe-cp').lock(); + event.cyTarget.style('opacity', 1); + } + + } + }); + + this._cy.on('boxselect', 'node', (event:Cy.EventObject) => { + this.eventListenerService.notifyObservers(Utils.Constants.GRAPH_EVENTS.ON_NODE_SELECTED, event.cyTarget.data().componentInstance); + }); + } + + private openModifyLinkMenu = (scope:ICompositionGraphScope, linkMenuObject:Models.LinkMenu, timeOutInMilliseconds?:number) => { + + this.commonGraphUtils.safeApply(scope, () => { + scope.linkMenuObject = linkMenuObject; + }); + + scope.relationMenuTimeout = this.$timeout(() => { + scope.hideRelationMenu(); + }, timeOutInMilliseconds ? timeOutInMilliseconds : 6000); + }; + + private initGraphNodes(componentInstances:Models.ComponentsInstances.ComponentInstance[], isViewOnly:boolean) { + + if (!isViewOnly) { //Init nodes handle extension - enable dynamic links + setTimeout(()=> { + let handles = new CytoscapeEdgeEditation; + handles.init(this._cy, 18); + handles.registerHandle(Sdc.Graph.Utils.ComponentIntanceNodesStyle.getBasicNodeHanlde()); + handles.registerHandle(Sdc.Graph.Utils.ComponentIntanceNodesStyle.getBasicSmallNodeHandle()); + handles.registerHandle(Sdc.Graph.Utils.ComponentIntanceNodesStyle.getUcpeCpNodeHandle()); + }, 0); + } + + _.each(componentInstances, (instance) => { + let compositionGraphNode:Models.Graph.CompositionCiNodeBase = this.NodesFactory.createNode(instance); + this.commonGraphUtils.addComponentInstanceNodeToGraph(this._cy, compositionGraphNode); + }); + + + + } + + + private initDropZone(scope:ICompositionGraphScope) { + + if (scope.isViewOnly) { + return; + } + scope.dropCallback = (event:IDragDropEvent) => { + this.$log.debug(`composition-graph::dropCallback:: fired`); + this.addNode(event, scope); + }; + + scope.verifyDrop = (event:JQueryEventObject) => { + + if(this.dragElement.hasClass('red')){ + return false; + } + return true; + }; + + scope.beforeDropCallback = (event:IDragDropEvent): ng.IPromise => { + let deferred: ng.IDeferred = this.$q.defer(); + if(this.dragElement.hasClass('red')){ + deferred.reject(); + } else { + deferred.resolve(); + } + + return deferred.promise; + } + } + + private _getNodeBBox(event:IDragDropEvent, position?:Cy.Position) { + let bbox = {}; + if (!position) { + position = this.commonGraphUtils.getCytoscapeNodePosition(this._cy, event); + } + let cushionWidth:number = 40; + let cushionHeight:number = 40; + + bbox.x1 = position.x - cushionWidth / 2; + bbox.y1 = position.y - cushionHeight / 2; + bbox.x2 = position.x + cushionWidth / 2; + bbox.y2 = position.y + cushionHeight / 2; + return bbox; + } + + private createComponentInstanceOnGraphFromComponent(fullComponent:Models.Components.Component, event:IDragDropEvent, scope:ICompositionGraphScope) { + + let componentInstanceToCreate:Models.ComponentsInstances.ComponentInstance = this.ComponentInstanceFactory.createComponentInstanceFromComponent(fullComponent); + let cytoscapePosition:Cy.Position = this.commonGraphUtils.getCytoscapeNodePosition(this._cy, event); + + componentInstanceToCreate.posX = cytoscapePosition.x; + componentInstanceToCreate.posY = cytoscapePosition.y; + + + let onFailedCreatingInstance:(error:any) => void = (error:any) => { + this.LoaderService.hideLoader('composition-graph'); + }; + + //on success - update node data + let onSuccessCreatingInstance = (createInstance:Models.ComponentsInstances.ComponentInstance):void => { + + this.LoaderService.hideLoader('composition-graph'); + + createInstance.name = this.$filter('resourceName')(createInstance.name); + createInstance.requirements = new Models.RequirementsGroup(fullComponent.requirements); + createInstance.capabilities = new Models.CapabilitiesGroup(fullComponent.capabilities); + createInstance.componentVersion = fullComponent.version; + createInstance.icon = fullComponent.icon; + createInstance.setInstanceRC(); + + let newNode:Models.Graph.CompositionCiNodeBase = this.NodesFactory.createNode(createInstance); + let cyNode:Cy.CollectionNodes = this.commonGraphUtils.addComponentInstanceNodeToGraph(this._cy, newNode); + + //check if node was dropped into a UCPE + let ucpe:Cy.CollectionElements = this.commonGraphUtils.isInUcpe(this._cy, cyNode.boundingbox()); + if (ucpe.length > 0) { + this.eventListenerService.notifyObservers(Utils.Constants.GRAPH_EVENTS.ON_INSERT_NODE_TO_UCPE, cyNode, ucpe, false); + } + + }; + + // Create the component instance on server + this.GeneralGraphUtils.getGraphUtilsServerUpdateQueue().addBlockingUIAction(() => { + scope.component.createComponentInstance(componentInstanceToCreate).then(onSuccessCreatingInstance, onFailedCreatingInstance); + }); + } + + private _onComponentDrag(event:IDragDropEvent) { + + if(event.clientX < Sdc.Utils.Constants.GraphUIObjects.DIAGRAM_PALETTE_WIDTH_OFFSET || event.clientY < Sdc.Utils.Constants.GraphUIObjects.DIAGRAM_HEADER_OFFSET){ //hovering over palette. Dont bother computing validity of drop + this.dragElement.removeClass('red'); + return; + } + + let offsetPosition = {x: event.clientX - Sdc.Utils.Constants.GraphUIObjects.DIAGRAM_PALETTE_WIDTH_OFFSET, y: event.clientY - Sdc.Utils.Constants.GraphUIObjects.DIAGRAM_HEADER_OFFSET} + let bbox = this._getNodeBBox(event, offsetPosition); + + if (this.GeneralGraphUtils.isPaletteDropValid(this._cy, bbox, this.dragComponent)) { + this.dragElement.removeClass('red'); + } else { + this.dragElement.addClass('red'); + } + } + + private addNode(event:IDragDropEvent, scope:ICompositionGraphScope) { + this.LoaderService.showLoader('composition-graph'); + + this.$log.debug('composition-graph::addNode:: fired'); + let draggedComponent:Models.Components.Component = event.dataTransfer.component; + + if (this.GeneralGraphUtils.componentRequirementsAndCapabilitiesCaching.containsKey(draggedComponent.uniqueId)) { + this.$log.debug('composition-graph::addNode:: capabilities found in cache, creating component'); + let fullComponent = this.GeneralGraphUtils.componentRequirementsAndCapabilitiesCaching.getValue(draggedComponent.uniqueId); + this.createComponentInstanceOnGraphFromComponent(fullComponent, event, scope); + return; + } + + this.$log.debug('composition-graph::addNode:: capabilities not found, requesting from server'); + this.ComponentFactory.getComponentFromServer(draggedComponent.getComponentSubType(), draggedComponent.uniqueId) + .then((fullComponent:Models.Components.Component) => { + this.createComponentInstanceOnGraphFromComponent(fullComponent, event, scope); + }); + } + + public static factory = ($q, + $filter, + $log, + $timeout, + NodesFactory, + LinksGraphUtils, + GeneralGraphUtils, + ComponentInstanceFactory, + NodesGraphUtils, + EventListenerService, + ComponentFactory, + LoaderService, + CommonGraphUtils, + MatchCapabilitiesRequirementsUtils) => { + return new CompositionGraph( + $q, + $filter, + $log, + $timeout, + NodesFactory, + LinksGraphUtils, + GeneralGraphUtils, + ComponentInstanceFactory, + NodesGraphUtils, + EventListenerService, + ComponentFactory, + LoaderService, + CommonGraphUtils, + MatchCapabilitiesRequirementsUtils); + } + } + + CompositionGraph.factory.$inject = [ + '$q', + '$filter', + '$log', + '$timeout', + 'NodesFactory', + 'CompositionGraphLinkUtils', + 'CompositionGraphGeneralUtils', + 'ComponentInstanceFactory', + 'CompositionGraphNodesUtils', + 'EventListenerService', + 'ComponentFactory', + 'LoaderService', + 'CommonGraphUtils', + 'MatchCapabilitiesRequirementsUtils' + ]; +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/composition-graph.html b/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/composition-graph.html new file mode 100644 index 0000000000..5f2c488341 --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/composition-graph.html @@ -0,0 +1,22 @@ + +
      +
      + + + + +
      + +
      +
      + + Delete +
      + +
      diff --git a/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/composition-graph.less b/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/composition-graph.less new file mode 100644 index 0000000000..7b999967b7 --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/composition-graph.less @@ -0,0 +1,14 @@ +composition-graph { + display: block; + + height:100%; + width: 100%; + .sdc-composition-graph-wrapper{ + height:100%; + width: 100%; + } + + &.view-only{ + background-color:rgb(248, 248, 248); + } +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/utils/composition-graph-general-utils.ts b/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/utils/composition-graph-general-utils.ts new file mode 100644 index 0000000000..495a243d75 --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/utils/composition-graph-general-utils.ts @@ -0,0 +1,243 @@ +/// +module Sdc.Graph.Utils { + + import Dictionary = Sdc.Utils.Dictionary; + + export class CompositionGraphGeneralUtils { + + public componentRequirementsAndCapabilitiesCaching = new Dictionary(); + protected static graphUtilsUpdateQueue: Sdc.Utils.Functions.QueueUtils; + + constructor(private $q: ng.IQService, + private LoaderService: Services.LoaderService, + private commonGraphUtils: Sdc.Graph.Utils.CommonGraphUtils, + private matchCapabilitiesRequirementsUtils: Graph.Utils.MatchCapabilitiesRequirementsUtils) { + CompositionGraphGeneralUtils.graphUtilsUpdateQueue = new Sdc.Utils.Functions.QueueUtils(this.$q); + } + + + /** + * Get the offset for the link creation Menu + * @param point + * @returns {Cy.Position} + */ + public calcMenuOffset: Function = (point: Cy.Position): Cy.Position => { + point.x = point.x + 60; + point.y = point.y + 105; + return point; + }; + + /** + * return the top left position of the link menu + * @param cy + * @param targetNodePosition + * @returns {Cy.Position} + */ + public getLinkMenuPosition = (cy: Cy.Instance, targetNodePosition: Cy.Position) => { + let menuPosition: Cy.Position = this.calcMenuOffset(targetNodePosition); //get the link mid point + if (document.body.scrollHeight < menuPosition.y + Sdc.Utils.Constants.GraphUIObjects.LINK_MENU_HEIGHT + $(document.getElementsByClassName('sdc-composition-graph-wrapper')).offset().top) { // if position menu is overflow bottom + menuPosition.y = document.body.scrollHeight - Sdc.Utils.Constants.GraphUIObjects.TOP_HEADER_HEIGHT - Sdc.Utils.Constants.GraphUIObjects.LINK_MENU_HEIGHT; + } + return menuPosition; + }; + + + /** + * will return true/false if two nodes overlapping + * + * @param graph node + */ + private isNodesOverlapping(node: Cy.CollectionFirstNode, draggedNode: Cy.CollectionFirstNode): boolean { + + let nodeBoundingBox: Cy.BoundingBox = node.renderedBoundingBox(); + let secondNodeBoundingBox: Cy.BoundingBox = draggedNode.renderedBoundingBox(); + + return this.isBBoxOverlapping(nodeBoundingBox, secondNodeBoundingBox); + } + + /** + * Checks whether the bounding boxes of two nodes are overlapping on any side + * @param nodeOneBBox + * @param nodeTwoBBox + * @returns {boolean} + */ + private isBBoxOverlapping(nodeOneBBox: Cy.BoundingBox, nodeTwoBBox: Cy.BoundingBox) { + return (((nodeOneBBox.x1 < nodeTwoBBox.x1 && nodeOneBBox.x2 > nodeTwoBBox.x1) || + (nodeOneBBox.x1 < nodeTwoBBox.x2 && nodeOneBBox.x2 > nodeTwoBBox.x2) || + (nodeTwoBBox.x1 < nodeOneBBox.x1 && nodeTwoBBox.x2 > nodeOneBBox.x2)) && + ((nodeOneBBox.y1 < nodeTwoBBox.y1 && nodeOneBBox.y2 > nodeTwoBBox.y1) || + (nodeOneBBox.y1 < nodeTwoBBox.y2 && nodeOneBBox.y2 > nodeTwoBBox.y2) || + (nodeTwoBBox.y1 < nodeOneBBox.y1 && nodeTwoBBox.y2 > nodeOneBBox.y2))) + } + + + /** + * Checks whether a specific component instance can be hosted on the UCPE instance + * @param cy - Cytoscape instance + * @param fromUcpeInstance + * @param toComponentInstance + * @returns {Models.MatchReqToCapability} + */ + public canBeHostedOn(cy: Cy.Instance, fromUcpeInstance: Models.ComponentsInstances.ComponentInstance, toComponentInstance: Models.ComponentsInstances.ComponentInstance): Models.MatchReqToCapability { + + let matches: Array = this.matchCapabilitiesRequirementsUtils.getMatchedRequirementsCapabilities(fromUcpeInstance, toComponentInstance, this.getAllCompositionCiLinks(cy)); + let hostedOnMatch: Models.MatchBase = _.find(matches, (match: Models.MatchReqToCapability) => { + return match.requirement.capability.toLowerCase() === 'tosca.capabilities.container'; + }); + + return hostedOnMatch; + }; + + + /** + * Checks whether node can be dropped into UCPE + * @param cy + * @param nodeToInsert + * @param ucpeNode + * @returns {boolean} + */ + private isValidDropInsideUCPE(cy: Cy.Instance, nodeToInsert: Models.ComponentsInstances.ComponentInstance, ucpeNode: Models.ComponentsInstances.ComponentInstance): boolean { + + let hostedOnMatch: Models.MatchReqToCapability = this.canBeHostedOn(cy, ucpeNode, nodeToInsert); + let result: boolean = !angular.isUndefined(hostedOnMatch) || nodeToInsert.isVl(); //group validation + return result; + + }; + + + /** + * For drops from palette, checks whether the node can be dropped. If node is being held over another node, check if capable of hosting + * @param cy + * @param pseudoNodeBBox + * @param paletteComponentInstance + * @returns {boolean} + */ + public isPaletteDropValid(cy: Cy.Instance, pseudoNodeBBox: Cy.BoundingBox, paletteComponentInstance:Sdc.Models.ComponentsInstances.ComponentInstance) { + + let componentIsUCPE:boolean = (paletteComponentInstance.capabilities && paletteComponentInstance.capabilities['tosca.capabilities.Container'] && paletteComponentInstance.name.toLowerCase().indexOf('ucpe') > -1); + + if(componentIsUCPE && cy.nodes('[?isUcpe]').length > 0) { //second UCPE not allowed + return false; + } + + let illegalOverlappingNodes = _.filter(cy.nodes("[isSdcElement]"), (graphNode: Cy.CollectionFirstNode) => { + + if(this.isBBoxOverlapping(pseudoNodeBBox, graphNode.renderedBoundingBox())){ + if (!componentIsUCPE && graphNode.data().isUcpe) { + return !this.isValidDropInsideUCPE(cy, paletteComponentInstance, graphNode.data().componentInstance); //if this is valid insert into ucpe, we return false - no illegal overlapping nodes + } + return true; + } + + return false; + }); + + return illegalOverlappingNodes.length === 0; + } + + /** + * will return true/false if a drop of a single node is valid + * + * @param graph node + */ + public isValidDrop(cy: Cy.Instance, draggedNode: Cy.CollectionFirstNode): boolean { + + let illegalOverlappingNodes = _.filter(cy.nodes("[isSdcElement]"), (graphNode: Cy.CollectionFirstNode) => { //all sdc nodes, removing child nodes (childe node allways collaps + + if (draggedNode.data().isUcpe && (graphNode.isChild() || graphNode.data().isInsideGroup)) { //ucpe cps always inside ucpe, no overlapping + return false; + } + if(draggedNode.data().isInsideGroup && (!draggedNode.active() || graphNode.data().isUcpe)) { + return false; + } + + if (!draggedNode.data().isUcpe && !(draggedNode.data() instanceof Sdc.Models.Graph.CompositionCiNodeUcpeCp) && graphNode.data().isUcpe) { //case we are dragging a node into UCPE + let isEntirelyInUCPE:boolean = this.commonGraphUtils.isFirstBoxContainsInSecondBox(draggedNode.renderedBoundingBox(), graphNode.renderedBoundingBox()); + if (isEntirelyInUCPE){ + if(this.isValidDropInsideUCPE(cy, draggedNode.data().componentInstance, graphNode.data().componentInstance)){ //if this is valid insert into ucpe, we return false - no illegal overlapping nodes + return false; + } + } + } + return graphNode.data().id !== draggedNode.data().id && this.isNodesOverlapping(draggedNode, graphNode); + + }); + // return false; + return illegalOverlappingNodes.length === 0; + }; + + /** + * will return true/false if the move of the nodes is valid (no node overlapping and verifying if insert into UCPE is valid) + * + * @param nodesArray - the selected drags nodes + */ + public isGroupValidDrop(cy: Cy.Instance, nodesArray: Cy.CollectionNodes): boolean { + var filterDraggedNodes = nodesArray.filter('[?isDraggable]'); + let isValidDrop = _.every(filterDraggedNodes, (node: Cy.CollectionFirstNode) => { + return this.isValidDrop(cy, node); + + }); + return isValidDrop; + }; + + /** + * get all links in diagram + * @param cy + * @returns {any[]|boolean[]} + */ + public getAllCompositionCiLinks = (cy: Cy.Instance): Array => { + return _.map(cy.edges("[isSdcElement]"), (edge: Cy.CollectionEdges) => { + return edge.data(); + }); + }; + + + /** + * Get Graph Utils server queue + * @returns {Sdc.Utils.Functions.QueueUtils} + */ + public getGraphUtilsServerUpdateQueue(): Sdc.Utils.Functions.QueueUtils { + return CompositionGraphGeneralUtils.graphUtilsUpdateQueue; + } + ; + + /** + * + * @param blockAction - true/false if this is a block action + * @param instances + * @param component + */ + public pushMultipleUpdateComponentInstancesRequestToQueue = (blockAction: boolean, instances: Array, component: Models.Components.Component): void => { + if (blockAction) { + this.getGraphUtilsServerUpdateQueue().addBlockingUIAction( + () => component.updateMultipleComponentInstances(instances) + ); + } else { + this.getGraphUtilsServerUpdateQueue().addNonBlockingUIAction( + () => component.updateMultipleComponentInstances(instances), + () => this.LoaderService.hideLoader('composition-graph')); + } + }; + + /** + * this function will update component instance data + * @param blockAction - true/false if this is a block action + * @param updatedInstance + */ + public pushUpdateComponentInstanceActionToQueue = (component: Models.Components.Component, blockAction: boolean, updatedInstance: Models.ComponentsInstances.ComponentInstance): void => { + + if (blockAction) { + this.LoaderService.showLoader('composition-graph'); + this.getGraphUtilsServerUpdateQueue().addBlockingUIAction( + () => component.updateComponentInstance(updatedInstance) + ); + } else { + this.getGraphUtilsServerUpdateQueue().addNonBlockingUIAction( + () => component.updateComponentInstance(updatedInstance), + () => this.LoaderService.hideLoader('composition-graph')); + } + }; + } + + CompositionGraphGeneralUtils.$inject = ['$q', 'LoaderService', 'CommonGraphUtils', 'MatchCapabilitiesRequirementsUtils']; +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/utils/composition-graph-links-utils.ts b/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/utils/composition-graph-links-utils.ts new file mode 100644 index 0000000000..602e6b6def --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/utils/composition-graph-links-utils.ts @@ -0,0 +1,347 @@ +/** + * Created by obarda on 6/28/2016. + */ +/// +module Sdc.Graph.Utils { + + import ImageCreatorService = Sdc.Utils.ImageCreatorService; + import Module = Sdc.Models.Module; + export class CompositionGraphLinkUtils { + + private p2pVL:Models.Components.Component; + private mp2mpVL:Models.Components.Component; + + constructor(private linksFactory:Sdc.Utils.LinksFactory, + private loaderService:Services.LoaderService, + private generalGraphUtils:Sdc.Graph.Utils.CompositionGraphGeneralUtils, + private leftPaletteLoaderService:Services.Components.LeftPaletteLoaderService, + private componentInstanceFactory:Sdc.Utils.ComponentInstanceFactory, + private nodesFactory:Sdc.Utils.NodesFactory, + private commonGraphUtils: Sdc.Graph.Utils.CommonGraphUtils, + private matchCapabilitiesRequirementsUtils: Graph.Utils.MatchCapabilitiesRequirementsUtils) { + + this.initScopeVls(); + + } + + + /** + * Delete the link on server and then remove it from graph + * @param component + * @param releaseLoading - true/false release the loader when finished + * @param link - the link to delete + */ + public deleteLink = (cy:Cy.Instance, component:Models.Components.Component, releaseLoading:boolean, link:Cy.CollectionEdges) => { + + this.loaderService.showLoader('composition-graph'); + let onSuccessDeleteRelation = (response) => { + cy.remove(link); + }; + + if (!releaseLoading) { + this.generalGraphUtils.getGraphUtilsServerUpdateQueue().addBlockingUIAction( + () => component.deleteRelation(link.data().relation).then(onSuccessDeleteRelation) + ); + } else { + this.generalGraphUtils.getGraphUtilsServerUpdateQueue().addBlockingUIActionWithReleaseCallback( + () => component.deleteRelation(link.data().relation).then(onSuccessDeleteRelation), + () => this.loaderService.hideLoader('composition-graph')); + } + }; + + /** + * create the link on server and than draw it on graph + * @param link - the link to create + * @param cy + * @param component + */ + public createLink = (link:Models.CompositionCiLinkBase, cy:Cy.Instance, component:Models.Components.Component):void => { + + this.loaderService.showLoader('composition-graph'); + + let onSuccess:(response:Models.RelationshipModel) => void = (relation:Models.RelationshipModel) => { + link.setRelation(relation); + this.commonGraphUtils.insertLinkToGraph(cy, link); + }; + + link.updateLinkDirection(); + + this.generalGraphUtils.getGraphUtilsServerUpdateQueue().addBlockingUIActionWithReleaseCallback( + () => component.createRelation(link.relation).then(onSuccess), + () => this.loaderService.hideLoader('composition-graph') + ); + }; + + + public initScopeVls = ():void => { + + let vls = this.leftPaletteLoaderService.getFullDataComponentList(Sdc.Utils.Constants.ResourceType.VL); + vls.forEach((item) => { + let key = _.find(Object.keys(item.capabilities), (key) => { + return _.includes(key.toLowerCase(), 'linkable'); + }); + let linkable = item.capabilities[key]; + if (linkable) { + if (linkable[0].maxOccurrences == '2') { + this.p2pVL = _.find(vls, (component:Models.Components.Component) => { + return component.uniqueId === item.uniqueId; + }); + + } else {//assuming unbounded occurrences + this.mp2mpVL = _.find(vls, (component:Models.Components.Component) => { + return component.uniqueId === item.uniqueId; + }); + } + } + }); + }; + + private setVLlinks = (match:Models.MatchReqToReq, vl:Models.ComponentsInstances.ComponentInstance):Array => { + + let relationship1 = new Models.Relationship(); + let relationship2 = new Models.Relationship(); + let newRelationshipModel1 = new Models.RelationshipModel(); + let newRelationshipModel2 = new Models.RelationshipModel(); + + let capability:Models.Capability = vl.capabilities.findValueByKey('linkable')[0]; + relationship1.setRelationProperties(capability, match.requirement); + relationship2.setRelationProperties(capability, match.secondRequirement); + + newRelationshipModel1.setRelationshipModelParams(match.fromNode, vl.uniqueId, [relationship1]); + newRelationshipModel2.setRelationshipModelParams(match.toNode, vl.uniqueId, [relationship2]); + + return [newRelationshipModel1, newRelationshipModel2]; + }; + + private createVlinks = (cy:Cy.Instance, component:Models.Components.Component, matchReqToReq:Models.MatchReqToReq, vl:Models.Components.Component):void => { + + let componentInstance:Models.ComponentsInstances.ComponentInstance = this.componentInstanceFactory.createComponentInstanceFromComponent(vl); + let fromNodePosition:Cy.Position = cy.getElementById(matchReqToReq.fromNode).relativePosition(); + let toNodePosition:Cy.Position = cy.getElementById(matchReqToReq.toNode).relativePosition(); + let location:Cy.Position = { + x: 0.5 * (fromNodePosition.x + toNodePosition.x), + y: 0.5 * (fromNodePosition.y + toNodePosition.y) + } + + componentInstance.posX = location.x; + componentInstance.posY = location.y; + + let onFailed:(error:any) => void = (error:any) => { + this.loaderService.hideLoader('composition-graph'); + console.info('onFailed', error); + }; + + let onSuccess = (response:Models.ComponentsInstances.ComponentInstance):void => { + + console.info('onSuccses', response); + response.requirements = new Models.RequirementsGroup(vl.requirements); + response.capabilities = new Models.CapabilitiesGroup(vl.capabilities); + response.componentVersion = vl.version; + response.setInstanceRC(); + + let newLinks = this.setVLlinks(matchReqToReq, response); + let newNode = this.nodesFactory.createNode(response); + + this.commonGraphUtils.addComponentInstanceNodeToGraph(cy, newNode); + + _.forEach(newLinks, (link) => { + let linkObg:Models.CompositionCiLinkBase = this.linksFactory.createGraphLink(cy, link, link.relationships[0]); + this.createLink(linkObg, cy, component); + }); + }; + component.createComponentInstance(componentInstance).then(onSuccess, onFailed); + }; + + private createSimpleLink = (match:Models.MatchReqToCapability, cy:Cy.Instance, component:Models.Components.Component):void => { + let newRelation:Models.RelationshipModel = match.matchToRelationModel(); + let linkObg:Models.CompositionCiLinkBase = this.linksFactory.createGraphLink(cy,newRelation, newRelation.relationships[0]); + this.createLink(linkObg, cy, component); + }; + + public createLinkFromMenu = (cy:Cy.Instance, chosenMatch:Models.MatchBase, vl:Models.Components.Component, component:Models.Components.Component):void => { + + if (chosenMatch) { + if (chosenMatch && chosenMatch instanceof Models.MatchReqToReq) { + this.createVlinks(cy, component, chosenMatch, vl); //TODO orit implement + } + if (chosenMatch && chosenMatch instanceof Models.MatchReqToCapability) { + this.createSimpleLink(chosenMatch, cy, component); + } + } + }; + + + /** + * Filters the matches for UCPE links so that shown requirements and capabilites are only related to the selected ucpe-cp + * @param fromNode + * @param toNode + * @param matchesArray + * @returns {Array} + */ + public filterUcpeLinks(fromNode: Models.Graph.CompositionCiNodeBase, toNode: Models.Graph.CompositionCiNodeBase, matchesArray: Array): any { + + let matchLink: Array; + + if (fromNode.isUcpePart) { + matchLink = _.filter(matchesArray, (match: Models.MatchBase) => { + return match.isOwner(fromNode.id); + }); + } + + if (toNode.isUcpePart) { + matchLink = _.filter(matchesArray, (match: Models.MatchBase) => { + return match.isOwner(toNode.id); + }); + } + return matchLink ? matchLink : matchesArray; + } + + + /** + * open the connect link menu if the link drawn is valid - match requirements & capabilities + * @param cy + * @param fromNode + * @param toNode + * @returns {any} + */ + public onLinkDrawn(cy:Cy.Instance, fromNode:Cy.CollectionFirstNode, toNode:Cy.CollectionFirstNode):Models.RelationMenuDirectiveObj { + + if(!this.commonGraphUtils.nodeLocationsCompatible(cy, fromNode, toNode)){ return null; } + let linkModel:Array = this.generalGraphUtils.getAllCompositionCiLinks(cy); + + let possibleRelations:Array = this.matchCapabilitiesRequirementsUtils.getMatchedRequirementsCapabilities(fromNode.data().componentInstance, + toNode.data().componentInstance, linkModel, this.mp2mpVL); //TODO orit - add p2p and mp2mp + + //filter relations found to limit to specific ucpe-cp + possibleRelations = this.filterUcpeLinks(fromNode.data(), toNode.data(), possibleRelations); + + //if found possibleRelations between the nodes we create relation menu directive and open the link menu + if (possibleRelations.length) { + let menuPosition = this.generalGraphUtils.getLinkMenuPosition(cy, toNode.renderedPoint()); + return new Models.RelationMenuDirectiveObj(fromNode.data(), toNode.data(), this.mp2mpVL, this.p2pVL, menuPosition, possibleRelations); + } + return null; + }; + + + /** + * when we drag instance in to UCPE or out of UCPE - get all links we need to delete - one node in ucpe and one node outside of ucpe + * @param node - the node we dragged into or out of the ucpe + */ + public deleteLinksWhenNodeMovedFromOrToUCPE(component:Models.Components.Component, cy:Cy.Instance, nodeMoved:Cy.CollectionNodes, vlsPendingDeletion?:Cy.CollectionNodes):void { + + + let linksToDelete:Cy.CollectionElements = cy.collection(); + _.forEach(nodeMoved.neighborhood('node'), (neighborNode)=>{ + + if(neighborNode.data().isUcpePart){ //existing connections to ucpe or ucpe-cp - we want to delete even though nodeLocationsCompatible will technically return true + linksToDelete = linksToDelete.add(nodeMoved.edgesWith(neighborNode)); // This will delete the ucpe-host-link, or the vl-ucpe-link if nodeMoved is vl + } else if(!this.commonGraphUtils.nodeLocationsCompatible(cy, nodeMoved, neighborNode)){ //connection to regular node or vl - check if locations are compatible + if(!vlsPendingDeletion || !vlsPendingDeletion.intersect(neighborNode).length){ //Check if this is a link to a VL pending deletion, to prevent double deletion of between the node moved and vl + linksToDelete = linksToDelete.add(nodeMoved.edgesWith(neighborNode)); + } + } + }); + + + + linksToDelete.each((i, link)=>{ + this.deleteLink(cy, component, false, link); + }); + + }; + + + /** + * Creates a hostedOn link between a VF and UCPE + * @param component + * @param cy + * @param ucpeNode + * @param vfNode + */ + public createVfToUcpeLink = (component: Models.Components.Component, cy:Cy.Instance, ucpeNode:Models.Graph.NodeUcpe, vfNode:Models.Graph.CompositionCiNodeVf):void => { + let hostedOnMatch:Models.MatchReqToCapability = this.generalGraphUtils.canBeHostedOn(cy, ucpeNode.componentInstance, vfNode.componentInstance); + /* create relation */ + let newRelation = new Models.RelationshipModel(); + newRelation.fromNode = ucpeNode.id; + newRelation.toNode = vfNode.id; + + let link:Models.CompositionCiLinkBase = this.linksFactory.createUcpeHostLink(newRelation); + link.relation = hostedOnMatch.matchToRelationModel(); + this.createLink(link, cy, component); + }; + + + /** + * Handles click event on links. + * If one edge selected: do nothing. + /*Two edges selected - always select all + /* Three or more edges: first click - select all, secondary click - select single. + * @param cy + * @param event + */ + public handleLinkClick(cy:Cy.Instance, event : Cy.EventObject) { + if(cy.$('edge:selected').length > 2 && event.cyTarget[0].selected()) { + cy.$(':selected').unselect(); + } else { + + let vl: Cy.CollectionNodes = event.cyTarget[0].target('.vl-node'); + let connectedEdges:Cy.CollectionEdges = vl.connectedEdges(); + if (vl.length && connectedEdges.length > 1) { + + setTimeout(() => { + vl.select(); + connectedEdges.select(); + }, 0); + } + } + + } + + + /** + * Calculates the position for the menu that modifies an existing link + * @param event + * @param elementWidth + * @param elementHeight + * @returns {Sdc.Models.Graph.Point} + */ + public calculateLinkMenuPosition(event, elementWidth, elementHeight): Sdc.Models.Graph.Point { + let point: Sdc.Models.Graph.Point = new Sdc.Models.Graph.Point(event.originalEvent.x,event.originalEvent.y); + if(event.originalEvent.view.screen.height-elementHeight +module Sdc.Graph.Utils { + + export class CompositionGraphNodesUtils { + constructor(private NodesFactory:Sdc.Utils.NodesFactory, private $log:ng.ILogService, + private GeneralGraphUtils:Graph.Utils.CompositionGraphGeneralUtils, + private commonGraphUtils: Sdc.Graph.Utils.CommonGraphUtils, + private eventListenerService: Services.EventListenerService, + private loaderService:Services.LoaderService) { + + } + + /** + * Returns component instances for all nodes passed in + * @param nodes - Cy nodes + * @returns {any[]} + */ + public getAllNodesData(nodes:Cy.CollectionNodes) { + return _.map(nodes, (node:Cy.CollectionFirstNode)=> { + return node.data(); + }) + }; + + /** + * Deletes component instances on server and then removes it from the graph as well + * @param cy + * @param component + * @param nodeToDelete + */ + public deleteNode(cy: Cy.Instance, component:Models.Components.Component, nodeToDelete:Cy.CollectionNodes):void { + + this.loaderService.showLoader('composition-graph'); + let onSuccess:(response:Models.ComponentsInstances.ComponentInstance) => void = (response:Models.ComponentsInstances.ComponentInstance) => { + console.info('onSuccess', response); + + //if node to delete is a UCPE, remove all children (except UCPE-CPs) and remove their "hostedOn" links + if (nodeToDelete.data().isUcpe){ + _.each(cy.nodes('[?isInsideGroup]'), (node)=>{ + this.eventListenerService.notifyObservers(Sdc.Utils.Constants.GRAPH_EVENTS.ON_REMOVE_NODE_FROM_UCPE, node, nodeToDelete); + }); + } + + //check whether the node is connected to any VLs that only have one other connection. If so, delete that VL as well + if(!(nodeToDelete.data() instanceof Sdc.Models.Graph.CompositionCiNodeVl)){ + let connectedVls:Array = this.getConnectedVlToNode(nodeToDelete); + this.handleConnectedVlsToDelete(connectedVls); + } + + //update UI + cy.remove(nodeToDelete); + + }; + + let onFailed:(response:any) => void = (response:any) => { + console.info('onFailed', response); + }; + + + this.GeneralGraphUtils.getGraphUtilsServerUpdateQueue().addBlockingUIActionWithReleaseCallback( + () => component.deleteComponentInstance(nodeToDelete.data().componentInstance.uniqueId).then(onSuccess, onFailed), + () => this.loaderService.hideLoader('composition-graph') + ); + + }; + + + /** + * Finds all VLs connected to a single node + * @param node + * @returns {Array} + */ + public getConnectedVlToNode = (node: Cy.CollectionNodes): Array => { + let connectedVls: Array = new Array(); + _.forEach(node.connectedEdges().connectedNodes(), (node: Cy.CollectionFirstNode) => { + if (node.data() instanceof Models.Graph.CompositionCiNodeVl) { + connectedVls.push(node); + } + }); + return connectedVls; + }; + + + /** + * Delete all VLs that have only two connected nodes (this function is called when deleting a node) + * @param connectedVls + */ + public handleConnectedVlsToDelete = (connectedVls: Array) => { + _.forEach(connectedVls, (vlToDelete: Cy.CollectionNodes) => { + + if (vlToDelete.connectedEdges().length === 2) { // if vl connected only to 2 nodes need to delete the vl + this.eventListenerService.notifyObservers(Sdc.Utils.Constants.GRAPH_EVENTS.ON_DELETE_COMPONENT_INSTANCE, vlToDelete.data().componentInstance); + } + }); + }; + + + /** + * This function is called when moving a node in or out of UCPE. + * Deletes all connected VLs that have less than 2 valid connections remaining after the move + * Returns the collection of vls that are in the process of deletion (async) to prevent duplicate calls while deletion is in progress + * @param component + * @param cy + * @param node - node that was moved in/out of ucpe + */ + public deleteNodeVLsUponMoveToOrFromUCPE = (component:Models.Components.Component, cy:Cy.Instance, node:Cy.CollectionNodes):Cy.CollectionNodes =>{ + if(node.data() instanceof Models.Graph.CompositionCiNodeVl){ return;} + + let connectedVLsToDelete:Cy.CollectionNodes = cy.collection(); + _.forEach(node.neighborhood('node'), (connectedNode) => { + + //Find all neighboring nodes that are VLs + if(connectedNode.data() instanceof Models.Graph.CompositionCiNodeVl){ + + //check VL's neighbors to see if it has 2 or more nodes whose location is compatible with VL (regardless of whether VL is in or out of UCPE) + let compatibleNodeCount = 0; + let vlNeighborhood = connectedNode.neighborhood('node'); + _.forEach(vlNeighborhood, (vlNeighborNode)=>{ + if(this.commonGraphUtils.nodeLocationsCompatible(cy, connectedNode, vlNeighborNode)) { + compatibleNodeCount ++; + } + }); + + if(compatibleNodeCount < 2) { + connectedVLsToDelete = connectedVLsToDelete.add(connectedNode); + } + } + }); + + connectedVLsToDelete.each((i, vlToDelete:Cy.CollectionNodes)=>{ + this.deleteNode(cy, component, vlToDelete); + }); + return connectedVLsToDelete; + }; + + /** + * This function will update nodes position. if the new position is into or out of ucpe, the node will trigger the ucpe events + * @param cy + * @param component + * @param nodesMoved - the node/multiple nodes now moved by the user + */ + public onNodesPositionChanged = (cy: Cy.Instance, component:Models.Components.Component, nodesMoved: Cy.CollectionNodes): void => { + + if (nodesMoved.length === 0) { + return; + } + + let isValidMove:boolean = this.GeneralGraphUtils.isGroupValidDrop(cy, nodesMoved); + if (isValidMove) { + + this.$log.debug(`composition-graph::ValidDrop:: updating node position`); + let instancesToUpdateInNonBlockingAction:Array = new Array(); + + _.each(nodesMoved, (node:Cy.CollectionFirstNode)=> { //update all nodes new position + + if(node.data().isUcpePart && !node.data().isUcpe){ return; }//No need to update UCPE-CPs + + //update position + let newPosition:Cy.Position = this.commonGraphUtils.getNodePosition(node); + node.data().componentInstance.updatePosition(newPosition.x, newPosition.y); + + //check if node moved to or from UCPE + let ucpe = this.commonGraphUtils.isInUcpe(node.cy(), node.boundingbox()); + if(node.data().isInsideGroup || ucpe.length) { + this.handleUcpeChildMove(node, ucpe, instancesToUpdateInNonBlockingAction); + } else { + instancesToUpdateInNonBlockingAction.push(node.data().componentInstance); + } + + }); + + if (instancesToUpdateInNonBlockingAction.length > 0) { + this.GeneralGraphUtils.pushMultipleUpdateComponentInstancesRequestToQueue(false, instancesToUpdateInNonBlockingAction, component); + } + } else { + this.$log.debug(`composition-graph::notValidDrop:: node return to latest position`); + //reset nodes position + nodesMoved.positions((i, node) => { + return { + x: +node.data().componentInstance.posX, + y: +node.data().componentInstance.posY + }; + }) + } + + this.GeneralGraphUtils.getGraphUtilsServerUpdateQueue().addBlockingUIActionWithReleaseCallback(() => { + }, () => { + this.loaderService.hideLoader('composition-graph'); + }); + + }; + + /** + * Checks whether the node has been added or removed from UCPE and triggers appropriate events + * @param node - node moved + * @param ucpeContainer - UCPE container that the node has been moved to. When moving a node out of ucpe, param will be empty + * @param instancesToUpdateInNonBlockingAction + */ + public handleUcpeChildMove(node:Cy.CollectionFirstNode, ucpeContainer:Cy.CollectionElements, instancesToUpdateInNonBlockingAction:Array){ + + if(node.data().isInsideGroup){ + if(ucpeContainer.length){ //moving node within UCPE. Simply update position + this.commonGraphUtils.updateUcpeChildPosition(node, ucpeContainer); + instancesToUpdateInNonBlockingAction.push(node.data().componentInstance); + } else { //removing node from UCPE. Notify observers + this.eventListenerService.notifyObservers(Sdc.Utils.Constants.GRAPH_EVENTS.ON_REMOVE_NODE_FROM_UCPE, node, ucpeContainer); + } + } else if(!node.data().isInsideGroup && ucpeContainer.length && !node.data().isUcpePart){ //adding node to UCPE + this.eventListenerService.notifyObservers(Sdc.Utils.Constants.GRAPH_EVENTS.ON_INSERT_NODE_TO_UCPE, node, ucpeContainer, true); + } + } + + } + + + CompositionGraphNodesUtils.$inject = ['NodesFactory', '$log', 'CompositionGraphGeneralUtils', 'CommonGraphUtils', 'EventListenerService', 'LoaderService']; +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/utils/match-capability-requierment-utils.ts b/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/utils/match-capability-requierment-utils.ts new file mode 100644 index 0000000000..5a401df317 --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/composition-graph/utils/match-capability-requierment-utils.ts @@ -0,0 +1,265 @@ +/** + * Created by obarda on 1/1/2017. + */ +/// +module Sdc.Graph.Utils { + + export class MatchCapabilitiesRequirementsUtils { + + constructor() { + } + + + + public static linkable(requirement1:Models.Requirement, requirement2:Models.Requirement, vlCapability:Models.Capability):boolean { + return MatchCapabilitiesRequirementsUtils.isMatch(requirement1, vlCapability) && MatchCapabilitiesRequirementsUtils.isMatch(requirement2, vlCapability); + }; + + + /** + * Shows + icon in corner of each node passed in + * @param filteredNodesData + * @param cy + */ + public highlightMatchingComponents(filteredNodesData, cy:Cy.Instance) { + _.each(filteredNodesData, (data:any) => { + let node = cy.getElementById(data.id); + cy.emit('showhandle', [node]); + }); + } + + /** + * Adds opacity to each node that cannot be linked to hovered node + * @param filteredNodesData + * @param nodesData + * @param cy + * @param hoveredNodeData + */ + public fadeNonMachingComponents(filteredNodesData, nodesData, cy:Cy.Instance, hoveredNodeData?) { + let fadeNodes = _.xorWith(nodesData, filteredNodesData, (node1, node2) => { + return node1.id === node2.id; + }); + if (hoveredNodeData) { + _.remove(fadeNodes, hoveredNodeData); + } + cy.batch(()=> { + _.each(fadeNodes, (node) => { + cy.getElementById(node.id).style({'background-image-opacity': 0.4}); + }); + }) + } + + /** + * Resets all nodes to regular opacity + * @param cy + */ + public resetFadedNodes(cy:Cy.Instance) { + cy.batch(()=> { + cy.nodes().style({'background-image-opacity': 1}); + }) + } + + // -------------------------------------------ALL FUNCTIONS NEED REFACTORING---------------------------------------------------------------// + + private static requirementFulfilled(fromNodeId:string, requirement:any, links:Array):boolean { + return _.some(links, { + 'relation': { + 'fromNode': fromNodeId, + 'relationships': [{ + 'requirementOwnerId': requirement.ownerId, + 'requirement': requirement.name, + 'relationship': { + 'type': requirement.relationship + } + } + ] + } + }); + }; + + private static isMatch(requirement:Models.Requirement, capability:Models.Capability):boolean { + if (capability.type === requirement.capability) { + if (requirement.node) { + if (_.includes(capability.capabilitySources, requirement.node)) { + return true; + } + } else { + return true; + } + } + return false; + }; + + private getFromToMatches(requirements1:Models.RequirementsGroup, + requirements2:Models.RequirementsGroup, + capabilities:Models.CapabilitiesGroup, + links:Array, + fromId:string, + toId:string, + vlCapability?:Models.Capability):Array { + let matches:Array = new Array(); + _.forEach(requirements1, (requirementValue:Array, key) => { + _.forEach(requirementValue, (requirement:Models.Requirement) => { + if (requirement.name !== "dependency" && !MatchCapabilitiesRequirementsUtils.requirementFulfilled(fromId, requirement, links)) { + _.forEach(capabilities, (capabilityValue:Array, key) => { + _.forEach(capabilityValue, (capability:Models.Capability) => { + if (MatchCapabilitiesRequirementsUtils.isMatch(requirement, capability)) { + let match:Models.MatchReqToCapability = new Models.MatchReqToCapability(requirement, capability, true, fromId, toId); + matches.push(match); + } + }); + }); + if (vlCapability) { + _.forEach(requirements2, (requirement2Value:Array, key) => { + _.forEach(requirement2Value, (requirement2:Models.Requirement) => { + if (!MatchCapabilitiesRequirementsUtils.requirementFulfilled(toId, requirement2, links) && MatchCapabilitiesRequirementsUtils.linkable(requirement, requirement2, vlCapability)) { + let match:Models.MatchReqToReq = new Models.MatchReqToReq(requirement, requirement2, true, fromId, toId); + matches.push(match); + } + }); + }); + } + } + }); + }); + return matches; + } + + private getToFromMatches(requirements:Models.RequirementsGroup, capabilities:Models.CapabilitiesGroup, links:Array, fromId:string, toId:string):Array { + let matches:Array = []; + _.forEach(requirements, (requirementValue:Array, key) => { + _.forEach(requirementValue, (requirement:Models.Requirement) => { + if (requirement.name !== "dependency" && !MatchCapabilitiesRequirementsUtils.requirementFulfilled(toId, requirement, links)) { + _.forEach(capabilities, (capabilityValue:Array, key) => { + _.forEach(capabilityValue, (capability:Models.Capability) => { + if (MatchCapabilitiesRequirementsUtils.isMatch(requirement, capability)) { + let match:Models.MatchReqToCapability = new Models.MatchReqToCapability(requirement, capability, false, toId, fromId); + matches.push(match); + } + }); + }); + } + }); + }); + return matches; + } + + public getMatchedRequirementsCapabilities(fromComponentInstance:Models.ComponentsInstances.ComponentInstance, + toComponentInstance:Models.ComponentsInstances.ComponentInstance, + links:Array, + vl?:Models.Components.Component):Array {//TODO allow for VL array + let linkCapability; + if (vl) { + let linkCapabilities:Array = vl.capabilities.findValueByKey('linkable'); + if (linkCapabilities) { + linkCapability = linkCapabilities[0]; + } + } + let fromToMatches:Array = this.getFromToMatches(fromComponentInstance.requirements, + toComponentInstance.requirements, + toComponentInstance.capabilities, + links, + fromComponentInstance.uniqueId, + toComponentInstance.uniqueId, + linkCapability); + let toFromMatches:Array = this.getToFromMatches(toComponentInstance.requirements, + fromComponentInstance.capabilities, + links, + fromComponentInstance.uniqueId, + toComponentInstance.uniqueId); + + return fromToMatches.concat(toFromMatches); + } + + + + + + /** + * Step I: Check if capabilities of component match requirements of nodeDataArray + * 1. Get component capabilities and loop on each capability + * 2. Inside the loop, perform another loop on all nodeDataArray, and fetch the requirements for each one + * 3. Loop on the requirements, and verify match (see in code the rules) + * + * Step II: Check if requirements of component match capabilities of nodeDataArray + * 1. Get component requirements and loop on each requirement + * 2. + * + * @param component - this is the hovered resource of the left panel of composition screen + * @param nodeDataArray - Array of resource instances that are on the canvas + * @param links -getMatchedRequirementsCapabilities + * @param vl - + * @returns {any[]|T[]} + */ + public findByMatchingCapabilitiesToRequirements(component:Models.Components.Component, + nodeDataArray:Array, + links:Array, + vl?:Models.Components.Component):Array {//TODO allow for VL array + let res = []; + + // STEP I + { + let capabilities:any = component.capabilities; + _.forEach(capabilities, (capabilityValue:Array, capabilityKey)=> { + _.forEach(capabilityValue, (capability)=> { + _.forEach(nodeDataArray, (node:Models.Graph.CompositionCiNodeBase)=> { + if (node && node.componentInstance) { + let requirements:any = node.componentInstance.requirements; + let fromNodeId:string = node.componentInstance.uniqueId; + _.forEach(requirements, (requirementValue:Array, requirementKey)=> { + _.forEach(requirementValue, (requirement)=> { + if (requirement.name !== "dependency" && MatchCapabilitiesRequirementsUtils.isMatch(requirement, capability) + && !MatchCapabilitiesRequirementsUtils.requirementFulfilled(fromNodeId, requirement, links)) { + res.push(node); + } + }); + }); + } + }); + }); + }); + } + + // STEP II + { + let requirements:any = component.requirements; + let fromNodeId:string = component.uniqueId; + let linkCapability:Array = vl ? vl.capabilities.findValueByKey('linkable') : undefined; + + _.forEach(requirements, (requirementValue:Array, requirementKey)=> { + _.forEach(requirementValue, (requirement)=> { + if (requirement.name !== "dependency" && !MatchCapabilitiesRequirementsUtils.requirementFulfilled(fromNodeId, requirement, links)) { + _.forEach(nodeDataArray, (node:any)=> { + if (node && node.componentInstance && node.category !== 'groupCp') { + let capabilities:any = node.componentInstance.capabilities; + _.forEach(capabilities, (capabilityValue:Array, capabilityKey)=> { + _.forEach(capabilityValue, (capability)=> { + if (MatchCapabilitiesRequirementsUtils.isMatch(requirement, capability)) { + res.push(node); + } + }); + }); + if (linkCapability) { + let linkRequirements = node.componentInstance.requirements; + _.forEach(linkRequirements, (value:Array, key)=> { + _.forEach(value, (linkRequirement)=> { + if (!MatchCapabilitiesRequirementsUtils.requirementFulfilled(node.componentInstance.uniqueId, linkRequirement, links) + && MatchCapabilitiesRequirementsUtils.linkable(requirement, linkRequirement, linkCapability[0])) { + res.push(node); + } + }); + }); + } + } + }); + } + }); + }); + } + + return _.uniq(res); + }; + } + + MatchCapabilitiesRequirementsUtils.$inject = []; +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-graph.directive.ts b/catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-graph.directive.ts new file mode 100644 index 0000000000..d6d4aef374 --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-graph.directive.ts @@ -0,0 +1,114 @@ +/** + * Created by obarda on 12/19/2016. + */ +/// +module Sdc.Directives { + + import Util = jasmine.Util; + + interface IDeploymentGraphScope extends ng.IScope { + component:Models.Components.Component; + } + + export class DeploymentGraph implements ng.IDirective { + private _cy:Cy.Instance; + + constructor(private NodesFactory:Utils.NodesFactory, private commonGraphUtils:Graph.Utils.CommonGraphUtils, + private deploymentGraphGeneralUtils:Graph.Utils.DeploymentGraphGeneralUtils, private ComponentInstanceFactory: Sdc.Utils.ComponentInstanceFactory) { + } + + restrict = 'E'; + templateUrl = '/app/scripts/directives/graphs-v2/deployment-graph/deployment-graph.html'; + scope = { + component: '=', + isViewOnly: '=' + }; + + link = (scope:IDeploymentGraphScope, el:JQuery) => { + if(scope.component.isResource()) { + this.loadGraph(scope, el); + this.registerGraphEvents(); + } + }; + + + public initGraphNodes = (cy:Cy.Instance, component:Models.Components.Component):void => { + if (component.groups) { // Init module nodes + _.each(component.groups, (groupModule:Models.Module) => { + let moduleNode = this.NodesFactory.createModuleNode(groupModule); + this.commonGraphUtils.addNodeToGraph(cy, moduleNode); + + }); + } + _.each(component.componentInstances, (instance:Models.ComponentsInstances.ComponentInstance) => { // Init component instance nodes + let componentInstanceNode = this.NodesFactory.createNode(instance); + componentInstanceNode.parent = this.deploymentGraphGeneralUtils.findInstanceModule(component.groups, instance.uniqueId); + if (componentInstanceNode.parent) { // we are not drawing instances that are not a part of a module + this.commonGraphUtils.addComponentInstanceNodeToGraph(cy, componentInstanceNode); + } + }); + + // This is a special functionality to pass the cytoscape default behavior - we can't create Parent module node without children's + // so we must add an empty dummy child node + _.each(this._cy.nodes('[?isGroup]'), (moduleNode: Cy.CollectionFirstNode) => { + if (!moduleNode.isParent()) { + let dummyInstance = this.ComponentInstanceFactory.createEmptyComponentInstance(); + let componentInstanceNode = this.NodesFactory.createNode(dummyInstance); + componentInstanceNode.parent = moduleNode.id(); + let dummyNode = this.commonGraphUtils.addNodeToGraph(cy, componentInstanceNode, moduleNode.position()); + dummyNode.addClass('dummy-node'); + } + }) + }; + + private registerGraphEvents() { + + this._cy.on('afterExpand', (event) => { + event.cyTarget.qtip({}); + }); + + this._cy.on('afterCollapse', (event) => { + this.commonGraphUtils.initNodeTooltip(event.cyTarget); + }); + } + + private loadGraph = (scope:IDeploymentGraphScope, el:JQuery) => { + + let graphEl = el.find('.sdc-deployment-graph-wrapper'); + this._cy = cytoscape({ + container: graphEl, + style: Sdc.Graph.Utils.ComponentIntanceNodesStyle.getCompositionGraphStyle().concat(Sdc.Graph.Utils.ModulesNodesStyle.getModuleGraphStyle()), + zoomingEnabled: false, + selectionType: 'single', + + }); + + //adding expand collapse extension + this._cy.expandCollapse({ + layoutBy: { + name: "grid", + animate: true, + randomize: false, + fit: true + }, + fisheye: false, + undoable: false, + expandCollapseCueSize: 18, + expandCueImage: Sdc.Utils.Constants.IMAGE_PATH + '/styles/images/resource-icons/' + 'closeModule.png', + collapseCueImage: Sdc.Utils.Constants.IMAGE_PATH + '/styles/images/resource-icons/' + 'openModule.png', + expandCollapseCueSensitivity: 2, + cueOffset: -20 + }); + + this.initGraphNodes(this._cy, scope.component); //creating instances nodes + this.commonGraphUtils.initGraphLinks(this._cy, scope.component.componentInstancesRelations); + this._cy.collapseAll(); + }; + + public static factory = (NodesFactory:Utils.NodesFactory, CommonGraphUtils:Graph.Utils.CommonGraphUtils, DeploymentGraphGeneralUtils:Graph.Utils.DeploymentGraphGeneralUtils, ComponentInstanceFactory: Utils.ComponentInstanceFactory) => { + return new DeploymentGraph(NodesFactory, CommonGraphUtils, DeploymentGraphGeneralUtils, ComponentInstanceFactory) + } + } + + DeploymentGraph.factory.$inject = ['NodesFactory', 'CommonGraphUtils', 'DeploymentGraphGeneralUtils', 'ComponentInstanceFactory']; +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-graph.html b/catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-graph.html new file mode 100644 index 0000000000..55e1c131f4 --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-graph.html @@ -0,0 +1,2 @@ +
      +
      \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-graph.less b/catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-graph.less new file mode 100644 index 0000000000..ff8fc46380 --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-graph.less @@ -0,0 +1,14 @@ +deployment-graph { + display: block; + height:100%; + width: 100%; + + .sdc-deployment-graph-wrapper { + height:100%; + width: 100%; + } + + .view-only{ + background-color:rgb(248, 248, 248); + } +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-utils/deployment-graph-general-utils.ts b/catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-utils/deployment-graph-general-utils.ts new file mode 100644 index 0000000000..3ad9da56be --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/deployment-graph/deployment-utils/deployment-graph-general-utils.ts @@ -0,0 +1,24 @@ +/** + * Created by obarda on 12/21/2016. + */ +/// +module Sdc.Graph.Utils { + + export class DeploymentGraphGeneralUtils { + + constructor() { + + } + + public findInstanceModule = (groupsArray:Array, componentInstanceId:string):string => { + let parentGroup:Sdc.Models.Module = _.find(groupsArray, (group:Sdc.Models.Module) => { + return _.find(group.members, (member) => { + return member === componentInstanceId; + }); + }); + return parentGroup ? parentGroup.uniqueId : ""; + }; + } + + DeploymentGraphGeneralUtils.$inject = []; +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/image-creator/image-creator.service.ts b/catalog-ui/app/scripts/directives/graphs-v2/image-creator/image-creator.service.ts new file mode 100644 index 0000000000..e3b17e163d --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/image-creator/image-creator.service.ts @@ -0,0 +1,46 @@ +module Sdc.Utils { + export class ImageCreatorService { + static '$inject' = ['$q']; + private _canvas: HTMLCanvasElement; + + constructor(private $q: ng.IQService) { + this._canvas = $('')[0]; + this._canvas.setAttribute('style', 'display:none'); + + let body = document.getElementsByTagName('body')[0]; + body.appendChild(this._canvas); + } + + getImageBase64(imageBaseUri: string, imageLayerUri: string): ng.IPromise { + let deferred = this.$q.defer(); + let imageBase = new Image(); + let imageLayer = new Image(); + let imagesLoaded = 0; + let onImageLoaded = () => { + imagesLoaded++; + + if (imagesLoaded < 2) { + return; + } + this._canvas.setAttribute('width', imageBase.width.toString()); + this._canvas.setAttribute('height', imageBase.height.toString()); + + let canvasCtx = this._canvas.getContext('2d'); + canvasCtx.clearRect(0, 0, this._canvas.width, this._canvas.height); + + canvasCtx.drawImage(imageBase, 0, 0, imageBase.width, imageBase.height); + canvasCtx.drawImage(imageLayer, imageBase.width - imageLayer.width, 0, imageLayer.width, imageLayer.height); + + let base64Image = this._canvas.toDataURL(); + deferred.resolve(base64Image); + }; + + imageBase.onload = onImageLoaded; + imageLayer.onload = onImageLoaded; + imageBase.src = imageBaseUri; + imageLayer.src = imageLayerUri; + + return deferred.promise; + } + } +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/palette/interfaces/i-dragdrop-event.d.ts b/catalog-ui/app/scripts/directives/graphs-v2/palette/interfaces/i-dragdrop-event.d.ts new file mode 100644 index 0000000000..26c042611c --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/palette/interfaces/i-dragdrop-event.d.ts @@ -0,0 +1,7 @@ +interface IDragDropEvent extends JQueryEventObject { + dataTransfer: any; + toElement: { + naturalWidth: number; + naturalHeight: number; + } +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/palette/palette.directive.ts b/catalog-ui/app/scripts/directives/graphs-v2/palette/palette.directive.ts new file mode 100644 index 0000000000..c00da6d1df --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/palette/palette.directive.ts @@ -0,0 +1,327 @@ +/// + +module Sdc.Directives { + import Dictionary = Sdc.Utils.Dictionary; + import GRAPH_EVENTS = Sdc.Utils.Constants.GRAPH_EVENTS; + import ImageCreatorService = Sdc.Utils.ImageCreatorService; + interface IPaletteScope { + components: any; + currentComponent: any; + model: any; + displaySortedCategories: any; + expandedSection: string; + + p2pVL: Models.Components.Component; + mp2mpVL: Models.Components.Component; + vlType: string; + dragElement: JQuery; + dragbleNode: { + event: JQueryEventObject, + components: Models.DisplayComponent, + ui: any + } + + sectionClick: (section: string)=>void; + searchComponents: (searchText: string)=>void; + onMouseOver: (displayComponent: Models.DisplayComponent)=>void; + onMouseOut: (displayComponent: Models.DisplayComponent)=>void; + dragStartCallback: (event: JQueryEventObject, ui, displayComponent: Models.DisplayComponent)=>void; + dragStopCallback: ()=>void; + onDragCallback: (event:JQueryEventObject) => void; + setElementTemplate: (e: JQueryEventObject)=>void; + + isOnDrag: boolean; + isDragable: boolean; + isLoading: boolean; + isViewOnly: boolean; + } + + export class Palette implements ng.IDirective { + constructor(private $log: ng.ILogService, + private LeftPaletteLoaderService, + private sdcConfig, + private ComponentFactory, + private ComponentInstanceFactory: Utils.ComponentInstanceFactory, + private NodesFactory: Utils.NodesFactory, + private CompositionGraphGeneralUtils: Graph.Utils.CompositionGraphGeneralUtils, + private EventListenerService: Services.EventListenerService, + private sdcMenu: Models.IAppMenu) { + + } + + private fetchingComponentFromServer: boolean = false; + private nodeHtmlSubstitute: JQuery; + + scope = { + components: '=', + currentComponent: '=', + isViewOnly: '=', + isLoading: '=' + }; + restrict = 'E'; + templateUrl = '/app/scripts/directives/graphs-v2/palette/palette.html'; + + link = (scope: IPaletteScope, el: JQuery) => { + this.nodeHtmlSubstitute = $('
      '); + el.append(this.nodeHtmlSubstitute); + + this.initComponents(scope); + this.initScopeVls(scope); + this.initEvents(scope); + this.initDragEvents(scope); + this._initExpandedSection(scope, ''); + }; + + private leftPanelResourceFilter(resourcesNotAbstract: Array, resourceFilterTypes: Array): Array { + let filterResources = _.filter(resourcesNotAbstract, (component) => { + return resourceFilterTypes.indexOf(component.getComponentSubType()) > -1; + }); + return filterResources; + } + + private initLeftPanel(leftPanelComponents: Array, resourceFilterTypes: Array): Models.LeftPanelModel { + let leftPanelModel = new Models.LeftPanelModel(); + + if (resourceFilterTypes && resourceFilterTypes.length) { + leftPanelComponents = this.leftPanelResourceFilter(leftPanelComponents, resourceFilterTypes); + } + leftPanelModel.numberOfElements = leftPanelComponents && leftPanelComponents.length || 0; + + if (leftPanelComponents && leftPanelComponents.length) { + + let categories: any = _.groupBy(leftPanelComponents, 'mainCategory'); + for (let category in categories) + categories[category] = _.groupBy(categories[category], 'subCategory'); + + leftPanelModel.sortedCategories = categories; + } + return leftPanelModel; + } + + private initScopeVls(scope: IPaletteScope): void { + let vls = this.LeftPaletteLoaderService.getFullDataComponentList(Utils.Constants.ResourceType.VL); + scope.vlType = null; + vls.forEach((item) => { + let key = _.find(Object.keys(item.capabilities), (key) => { + return _.includes(key.toLowerCase(), 'linkable'); + }); + let linkable = item.capabilities[key]; + if (linkable) { + if (linkable[0].maxOccurrences == '2') { + scope.p2pVL = _.find(vls, (component: Models.Components.Component) => { + return component.uniqueId === item.uniqueId; + }); + + } else {//assuming unbounded occurrences + scope.mp2mpVL = _.find(vls, (component: Models.Components.Component) => { + return component.uniqueId === item.uniqueId; + }); + } + } + }); + }; + + private initEvents(scope: IPaletteScope) { + /** + * + * @param section + */ + scope.sectionClick = (section: string) => { + if (section === scope.expandedSection) { + scope.expandedSection = ''; + return; + } + scope.expandedSection = section; + }; + + scope.onMouseOver = (displayComponent: Models.DisplayComponent) => { + if (scope.isOnDrag) { + return; + } + scope.isOnDrag = true; + + this.EventListenerService.notifyObservers(GRAPH_EVENTS.ON_PALETTE_COMPONENT_HOVER_IN, displayComponent); + this.$log.debug('palette::onMouseOver:: fired'); + + if (this.CompositionGraphGeneralUtils.componentRequirementsAndCapabilitiesCaching.containsKey(displayComponent.uniqueId)) { + this.$log.debug(`palette::onMouseOver:: component id ${displayComponent.uniqueId} found in cache`); + let cacheComponent: Models.Components.Component = this.CompositionGraphGeneralUtils.componentRequirementsAndCapabilitiesCaching.getValue(displayComponent.uniqueId); + + //TODO: Danny: fire event to highlight matching nodes + //showMatchingNodes(cacheComponent); + return; + } + + this.$log.debug(`palette::onMouseOver:: component id ${displayComponent.uniqueId} not found in cache, initiating server get`); + // This will bring the component from the server including requirements and capabilities + // Check that we do not fetch many times, because only in the success we add the component to componentRequirementsAndCapabilitiesCaching + if (this.fetchingComponentFromServer) { + return; + } + + this.fetchingComponentFromServer = true; + this.ComponentFactory.getComponentFromServer(displayComponent.componentSubType, displayComponent.uniqueId) + .then((component: Models.Components.Component) => { + this.$log.debug(`palette::onMouseOver:: component id ${displayComponent.uniqueId} fetch success`); + this.LeftPaletteLoaderService.updateSpecificComponentLeftPalette(component, scope.currentComponent.componentType); + this.CompositionGraphGeneralUtils.componentRequirementsAndCapabilitiesCaching.setValue(component.uniqueId, component); + this.fetchingComponentFromServer = false; + + //TODO: Danny: fire event to highlight matching nodes + //showMatchingNodes(component); + }) + .catch(() => { + this.$log.debug('palette::onMouseOver:: component id fetch error'); + this.fetchingComponentFromServer = false; + }); + + + }; + + scope.onMouseOut = () => { + scope.isOnDrag = false; + this.EventListenerService.notifyObservers(GRAPH_EVENTS.ON_PALETTE_COMPONENT_HOVER_OUT); + } + } + + private initComponents(scope: IPaletteScope) { + scope.searchComponents = (searchText: any): void => { + scope.displaySortedCategories = this._searchComponents(searchText, scope.model.sortedCategories); + this._initExpandedSection(scope, searchText); + }; + + scope.isDragable = scope.currentComponent.isComplex(); + let entityType: string = scope.currentComponent.componentType.toLowerCase(); + let resourceFilterTypes: Array = this.sdcConfig.resourceTypesFilter[entityType]; + + scope.components = this.LeftPaletteLoaderService.getLeftPanelComponentsForDisplay(scope.currentComponent.componentType); + scope.model = this.initLeftPanel(scope.components, resourceFilterTypes); + scope.displaySortedCategories = angular.copy(scope.model.sortedCategories); + } + + private _initExpandedSection(scope: IPaletteScope, searchText: string): void { + if (searchText == '') { + let isContainingCategory: boolean = false; + let categoryToExpand: string; + if (scope.currentComponent && scope.currentComponent.categories && scope.currentComponent.categories[0]) { + categoryToExpand = this.sdcMenu.categoriesDictionary[scope.currentComponent.categories[0].name]; + for (let category in scope.model.sortedCategories) { + if (categoryToExpand == category) { + isContainingCategory = true; + break; + } + } + } + isContainingCategory ? scope.expandedSection = categoryToExpand : scope.expandedSection = 'Generic'; + } + else { + scope.expandedSection = Object.keys(scope.displaySortedCategories).sort()[0]; + } + }; + + private initDragEvents(scope: IPaletteScope) { + scope.dragStartCallback = (event: IDragDropEvent, ui, displayComponent: Models.DisplayComponent): void => { + if (scope.isLoading || !scope.isDragable || scope.isViewOnly) { + return; + } + + let component = _.find(this.LeftPaletteLoaderService.getFullDataComponentListWithVls(scope.currentComponent.componentType), (componentFullData: Models.DisplayComponent) => { + return displayComponent.uniqueId === componentFullData.uniqueId; + }); + this.EventListenerService.notifyObservers(GRAPH_EVENTS.ON_PALETTE_COMPONENT_DRAG_START, scope.dragElement, component); + + scope.isOnDrag = true; + + + + // this.graphUtils.showMatchingNodes(component, myDiagram, scope.sdcConfig.imagesPath); + // document.addEventListener('mousemove', moveOnDocument); + event.dataTransfer.component = component; + }; + + scope.dragStopCallback = () => { + scope.isOnDrag = false; + }; + + scope.onDragCallback = (event:IDragDropEvent): void => { + this.EventListenerService.notifyObservers(GRAPH_EVENTS.ON_PALETTE_COMPONENT_DRAG_ACTION, event); + }; + scope.setElementTemplate = (e) => { + let dragComponent: Models.Components.Component = _.find(this.LeftPaletteLoaderService.getFullDataComponentListWithVls(scope.currentComponent.componentType), + (fullComponent: Models.Components.Component) => { + return (angular.element(e.currentTarget).scope()).component.uniqueId === fullComponent.uniqueId; + }); + let componentInstance: Models.ComponentsInstances.ComponentInstance = this.ComponentInstanceFactory.createComponentInstanceFromComponent(dragComponent); + let node: Models.Graph.CompositionCiNodeBase = this.NodesFactory.createNode(componentInstance); + + // myDiagram.dragFromPalette = node; + this.nodeHtmlSubstitute.find("img").attr('src', node.img); + scope.dragElement = this.nodeHtmlSubstitute.clone().show(); + + return scope.dragElement; + }; + } + + private _searchComponents = (searchText: string, categories: any): void => { + let displaySortedCategories = angular.copy(categories); + if (searchText != '') { + angular.forEach(categories, function (category: any, categoryKey) { + + angular.forEach(category, function (subcategory: Array, subcategoryKey) { + let filteredResources = []; + angular.forEach(subcategory, function (component: Models.DisplayComponent) { + + let resourceFilterTerm: string = component.searchFilterTerms; + if (resourceFilterTerm.indexOf(searchText.toLowerCase()) >= 0) { + filteredResources.push(component); + } + }); + if (filteredResources.length > 0) { + displaySortedCategories[categoryKey][subcategoryKey] = filteredResources; + } + else { + delete displaySortedCategories[categoryKey][subcategoryKey]; + } + }); + if (!(Object.keys(displaySortedCategories[categoryKey]).length > 0)) { + delete displaySortedCategories[categoryKey]; + } + + }); + } + return displaySortedCategories; + }; + + public static factory = ($log, + LeftPaletteLoaderService, + sdcConfig, + ComponentFactory, + ComponentInstanceFactory, + NodesFactory, + CompositionGraphGeneralUtils, + EventListenerService, + sdcMenu) => { + return new Palette($log, + LeftPaletteLoaderService, + sdcConfig, + ComponentFactory, + ComponentInstanceFactory, + NodesFactory, + CompositionGraphGeneralUtils, + EventListenerService, + sdcMenu); + }; + } + + Palette.factory.$inject = [ + '$log', + 'LeftPaletteLoaderService', + 'sdcConfig', + 'ComponentFactory', + 'ComponentInstanceFactory', + 'NodesFactory', + 'CompositionGraphGeneralUtils', + 'EventListenerService', + 'sdcMenu' + ]; +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/palette/palette.html b/catalog-ui/app/scripts/directives/graphs-v2/palette/palette.html new file mode 100644 index 0000000000..a8dd827927 --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/palette/palette.html @@ -0,0 +1,59 @@ +
      +
      Elements {{model.numberOfElements}} +
      + + +
      +
      + {{entityCategory}} +
      +
      +
      +
      + {{subCategory}} +
      +
      +
      +
      +
      +
      +
      +
      +
      + + {{component.displayName}} +
      + V.{{component.version}} +
      +
      Type: + {{component.componentSubType}} + More +
      +
      +
      +
      +
      +
      \ No newline at end of file diff --git a/catalog-ui/app/scripts/directives/graphs-v2/palette/palette.less b/catalog-ui/app/scripts/directives/graphs-v2/palette/palette.less new file mode 100644 index 0000000000..85657a43a5 --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/palette/palette.less @@ -0,0 +1,92 @@ +.drag-icon-border{ + border: 7px solid red; + border-radius: 500px; + -webkit-border-radius: 500px; + -moz-border-radius: 500px; + width: 53px; + height: 53px; +} + +.drag-icon-circle{ + width: 60px; + height: 60px; + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + border-radius: 50%; + position: relative; + +} + + +@green-shadow: rgba(29, 154, 149, 0.3); +@red-shadow: rgba(218, 31, 61, 0.3); +.drag-icon-circle .sprite-resource-icons { + position: absolute; + top: 10px; + left: 10px; +} + +.drag-icon-circle.red { + background: @red-shadow; +} + +.drag-icon-circle.green { + background: @green-shadow; +} + + +.node-substitute { + display: none; + position: absolute; + z-index: 9999; + height: 80px; + width: 80px; + border-radius: 50%; + text-align: center; + + span { + display: inline-block; + vertical-align: middle; + height: 100%; + } + + img { + height: 40px; + width: 40px; + box-shadow: 0 0 0 10px @green-shadow; + border-radius: 50%; + + -webkit-user-drag: none; + -moz-user-drag: none; + user-drag: none; + } + &.red img { + box-shadow: 0 0 0 10px @red-shadow; + } + &.bounce img { + -moz-animation:bounceOut 0.3s linear; + -webkit-animation:bounceOut 0.3s linear; + animation:bounceOut 0.3s linear; + } +} + +@keyframes bounceOut { + 0%{ box-shadow: 0 0 0 10px @green-shadow; width: 40px; height: 40px; } + 60%{ box-shadow: 0 0 0 0px @green-shadow; width: 60px; height: 60px; } + 85%{ box-shadow: 0 0 0 0px @green-shadow; width: 75px; height: 75px; } + 100%{ box-shadow: 0 0 0 0px @green-shadow; width: 60px; height: 60px; } +} + +@-moz-keyframes bounceOut { + 0%{ box-shadow: 0 0 0 10px @green-shadow; width: 40px; height: 40px; } + 60%{ box-shadow: 0 0 0 0px @green-shadow; width: 60px; height: 60px; } + 85%{ box-shadow: 0 0 0 0px @green-shadow; width: 75px; height: 75px; } + 100%{ box-shadow: 0 0 0 0px @green-shadow; width: 60px; height: 60px; } +} + +@-webkit-keyframes bounceOut { + 0%{ box-shadow: 0 0 0 10px @green-shadow; width: 40px; height: 40px; } + 60%{ box-shadow: 0 0 0 0px @green-shadow; width: 60px; height: 60px; } + 85%{ box-shadow: 0 0 0 0px @green-shadow; width: 75px; height: 75px; } + 100%{ box-shadow: 0 0 0 0px @green-shadow; width: 60px; height: 60px; } +} diff --git a/catalog-ui/app/scripts/directives/graphs-v2/relation-menu/relation-menu.html b/catalog-ui/app/scripts/directives/graphs-v2/relation-menu/relation-menu.html new file mode 100644 index 0000000000..a0a9e4af27 --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/relation-menu/relation-menu.html @@ -0,0 +1,63 @@ + diff --git a/catalog-ui/app/scripts/directives/graphs-v2/relation-menu/relation-menu.less b/catalog-ui/app/scripts/directives/graphs-v2/relation-menu/relation-menu.less new file mode 100644 index 0000000000..dea814dbec --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/relation-menu/relation-menu.less @@ -0,0 +1,118 @@ +.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/app/scripts/directives/graphs-v2/relation-menu/relation-menu.ts b/catalog-ui/app/scripts/directives/graphs-v2/relation-menu/relation-menu.ts new file mode 100644 index 0000000000..22a2d078b7 --- /dev/null +++ b/catalog-ui/app/scripts/directives/graphs-v2/relation-menu/relation-menu.ts @@ -0,0 +1,113 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + + export interface IRelationMenuScope extends ng.IScope { + relationMenuDirectiveObj:Models.RelationMenuDirectiveObj; + createRelation:Function; + isLinkMenuOpen:boolean; + hideRelationMatch:Function; + cancel:Function; + + saveRelation(); + showMatch(arr1:Array, arr2:Array):boolean; + hasMatchesToShow(matchesObj:Models.MatchBase, selectedMatch:Array); + updateSelectionText():void; + + } + + + export class RelationMenuDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService, + private $filter:ng.IFilterService + ) { + } + + scope = { + relationMenuDirectiveObj: '=', + isLinkMenuOpen: '=', + createRelation: '&', + cancel:'&' + }; + + restrict = 'E'; + replace = true; + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/graphs-v2/relation-menu/relation-menu.html'); + }; + + link = (scope:IRelationMenuScope, element:JQuery, $attr:ng.IAttributes) => { + + scope.saveRelation = ():void=> { + let chosenMatches:Array = _.intersection(scope.relationMenuDirectiveObj.rightSideLink.selectedMatch, scope.relationMenuDirectiveObj.leftSideLink.selectedMatch); + let chosenMatch:Models.MatchBase = chosenMatches[0]; + let chosenVL:Models.Components.Component; + if ("mptmp" === scope.relationMenuDirectiveObj.vlType) { + chosenVL = scope.relationMenuDirectiveObj.mp2mpVL; + } else { + chosenVL = scope.relationMenuDirectiveObj.p2pVL; + } + scope.createRelation()(chosenMatch,chosenVL); + }; + + + scope.hideRelationMatch = () => { + scope.isLinkMenuOpen = false; + scope.cancel(); + }; + + //to show options in link menu + scope.showMatch = (arr1:Array, arr2:Array):boolean => { + return !arr1 || !arr2 || _.intersection(arr1, arr2).length > 0; + }; + + //to show requirements/capabilities title + scope.hasMatchesToShow = (matchesObj:Models.MatchBase, selectedMatch:Array):boolean => { + let result:boolean = false; + _.forEach(matchesObj, (matchesArr:Array) => { + 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 = ($templateCache:ng.ITemplateCacheService , $filter:ng.IFilterService)=> { + return new RelationMenuDirective($templateCache, $filter); + }; + } + + RelationMenuDirective.factory.$inject = ['$templateCache', '$filter']; +} diff --git a/catalog-ui/app/scripts/directives/info-tooltip/info-tooltip.html b/catalog-ui/app/scripts/directives/info-tooltip/info-tooltip.html new file mode 100644 index 0000000000..5c2bdcf5f1 --- /dev/null +++ b/catalog-ui/app/scripts/directives/info-tooltip/info-tooltip.html @@ -0,0 +1,10 @@ +
      + +
      +
      +
      + +

      +
      +
      +
      diff --git a/catalog-ui/app/scripts/directives/info-tooltip/info-tooltip.less b/catalog-ui/app/scripts/directives/info-tooltip/info-tooltip.less new file mode 100644 index 0000000000..8811af16a4 --- /dev/null +++ b/catalog-ui/app/scripts/directives/info-tooltip/info-tooltip.less @@ -0,0 +1,39 @@ +.info-tooltip { + position: fixed; + z-index: 1070; + display: block; + width: 250px; + .info-tooltip-arrow { + width: 0; + height: 0; + border-style: solid; + border-width: 0 5px 5px 5px; + border-color: transparent transparent @main_color_a transparent; + position: relative; + left: 2px; + } + .info-tooltip-content { + box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.5); + border: 1px solid @main_color_o; + border-radius: 3px; + border-top: 3px solid @main_color_a; + position: relative; + background-color: white; + &.right{ + left: -13px; + } + &.left{ + left: -223px; + } + .close-tooltip{ + float: right; + margin: 5px; + } + + .info-tooltip-message{ + margin: 15px; + word-break: normal; + font-size: 14px; + } + } +} diff --git a/catalog-ui/app/scripts/directives/info-tooltip/info-tooltip.ts b/catalog-ui/app/scripts/directives/info-tooltip/info-tooltip.ts new file mode 100644 index 0000000000..cd81b14ce8 --- /dev/null +++ b/catalog-ui/app/scripts/directives/info-tooltip/info-tooltip.ts @@ -0,0 +1,60 @@ +/*- + * ============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========================================================= + */ +/** + * Created by rcohen on 9/25/2016. + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface IInfoTooltipScope extends ng.IScope { + infoMessageTranslate:string; + direction:string; + } + + + export class InfoTooltipDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService) { + } + + scope = { + infoMessageTranslate:'@', + direction:'@'//get 'right' or 'left', the default is 'right' + }; + + restrict = 'E'; + replace = true; + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/info-tooltip/info-tooltip.html'); + }; + + link = (scope:IInfoTooltipScope, element:any, $attr:any) => { + scope.direction = scope.direction || 'right'; + }; + + public static factory = ($templateCache:ng.ITemplateCacheService)=> { + return new InfoTooltipDirective($templateCache); + }; + + } + + InfoTooltipDirective.factory.$inject = ['$templateCache']; +} diff --git a/catalog-ui/app/scripts/directives/invalid-characters/invalid-characters.ts b/catalog-ui/app/scripts/directives/invalid-characters/invalid-characters.ts new file mode 100644 index 0000000000..7ab98b0d23 --- /dev/null +++ b/catalog-ui/app/scripts/directives/invalid-characters/invalid-characters.ts @@ -0,0 +1,72 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export class InvalidCharactersDirective implements ng.IDirective { + + constructor() {} + + require = 'ngModel'; + + link = (scope, elem, attrs, ngModel) => { + + let invalidCharacters = []; + + attrs.$observe('invalidCharacters', (val:string) => { + invalidCharacters = val.split(''); + validate(ngModel.$viewValue); + }); + + let validate: Function = function (value) { + + let valid:boolean = true; + + if(value) { + for (let i = 0; i < invalidCharacters.length; i++) { + if (value.indexOf(invalidCharacters[i]) != - 1) { + valid = false; + } + } + } + + ngModel.$setValidity('invalidCharacters', valid); + if(!value) { + ngModel.$setPristine(); + } + return value; + }; + + //For DOM -> model validation + ngModel.$parsers.unshift(validate); + //For model -> DOM validation + ngModel.$formatters.unshift(validate); + + }; + + public static factory = ()=> { + return new InvalidCharactersDirective(); + }; + + } + + InvalidCharactersDirective.factory.$inject = []; +} diff --git a/catalog-ui/app/scripts/directives/layout/top-nav/top-nav.html b/catalog-ui/app/scripts/directives/layout/top-nav/top-nav.html new file mode 100644 index 0000000000..40b1e86d90 --- /dev/null +++ b/catalog-ui/app/scripts/directives/layout/top-nav/top-nav.html @@ -0,0 +1,54 @@ + diff --git a/catalog-ui/app/scripts/directives/layout/top-nav/top-nav.less b/catalog-ui/app/scripts/directives/layout/top-nav/top-nav.less new file mode 100644 index 0000000000..65021bdc4d --- /dev/null +++ b/catalog-ui/app/scripts/directives/layout/top-nav/top-nav.less @@ -0,0 +1,218 @@ +.top-nav { + position: fixed; + top: @header_height; + background-color: @main_color_p; + .box-shadow(0px 1px 3px 0px rgba(0, 0, 0, 0.33)); + width: 100%; + height: @top_nav_height; + line-height: @top_nav_height; + z-index: 10; + display: flex; + flex-direction: row; + align-items: center; + + .asdc-app-title-wrapper { + flex-grow: 1; + line-height: 16px; + margin: 0 20px; + + a.asdc-app-title { + .m_18_r; + text-decoration: none; + } + + .asdc-version { + .m_12_r; + .opacity(0.8); + line-height: 14px; + flex-grow: 1; + } + + } + + ul.top-menu { + list-style-type: none; + margin: 0 0 0 20px; + padding: 0; + flex-grow: 999; + + & > li { + float: left; + cursor: pointer; + line-height: 50px; + height: 50px; + padding: 0 20px; + + &.selected { + border-bottom: solid 4px @main_color_a; + + a { + color: @func_color_s; + } + } + + /*&:hover { + border-bottom: solid 4px @main_color_a; + }*/ + + a { + font-family: @font-omnes-medium; + color: @main_color_m; + font-size: 18px; + display: block; + text-align: center; + text-decoration: none; + } + + &.triangle-dropdown { + padding: 0; + position: relative; + + div.triangle { + margin-top: 15px; + border-radius: 2px; + width: 17px; + height: 18px; + + //temp use - until new triangle gets in + line-height: 18px; + text-align: center; + font-size: 10px; + + &:hover { + background-color: rgba(156, 156, 156, 0.2); + + span { + .arrow-right-hover; + } + } + } + + + li a { + font-size: 16px; + } + + .ps-container { + .perfect-scrollbar; + position: absolute; + left: 0; + top: 40px; + z-index: 1; + + overflow: hidden; + max-height: 0; + -webkit-transition: max-height 200ms ease-in; + -moz-transition: max-height 200ms ease-in; + -o-transition: max-height 200ms ease-in; + transition: max-height 200ms ease-in; + + div ul { + + padding: 0; + background-color: white; + + li { + + height: 35px; + background-color: white; + font-size: 13px; + width: 150px; + line-height: 35px; + padding: 0 10px; + + &.disabled { + opacity: 1; + } + &.selected { + background-color: @tlv_color_v; + font-weight: bold; + } + &:hover { + color: @main_color_a; + } + span { + height: 35px; + width: 130px; + display: inline-block; + } + } + } + } + &.item-click:hover .ps-container, + &.item-click:active .ps-container { + max-height: 500px; + border: 1px solid @func_color_b; + border-radius: 2px; + box-shadow: 0px 2px 2px 0px rgba(24, 24, 25, 0.1); + + div ul { + + } + } + } + } + + } + + .top-search { + position: relative; + flex-grow: 1; + padding: 0 20px; + + input.search-text { + .border-radius(2px); + width: 245px; + height: 32px; + line-height: 32px; + border: 1px solid @main_color_o; + outline: none; + text-indent: 10px; + + &::-webkit-input-placeholder { font-style: italic; } /* Safari, Chrome and Opera */ + &:-moz-placeholder { font-style: italic; } /* Firefox 18- */ + &::-moz-placeholder { font-style: italic; } /* Firefox 19+ */ + &:-ms-input-placeholder { font-style: italic; } /* IE 10+ */ + &:-ms-input-placeholder { font-style: italic; } /* Edge */ + /* font-style: italic; + }*/ + /* Firefox 18- */ + &::-moz-placeholder { + font-style: italic; + } + /* Firefox 19+ */ + &:-ms-input-placeholder { + font-style: italic; + } + /* IE 10+ */ + &:-ms-input-placeholder { + font-style: italic; + } + /* Edge */ + } + + .magnification { + position: absolute; + top: 19px; + right: 26px; + } + + } + + .notification-icon { + cursor: pointer; + flex-grow: 1; + margin: 0 10px 6px 0; + .sprite-new; + .vsp-list-icon; + + &:hover { + .vsp-list-icon-hover; + } + + &:active { + .vsp-list-icon-active; + } + + } + +} diff --git a/catalog-ui/app/scripts/directives/layout/top-nav/top-nav.ts b/catalog-ui/app/scripts/directives/layout/top-nav/top-nav.ts new file mode 100644 index 0000000000..356e43b7f7 --- /dev/null +++ b/catalog-ui/app/scripts/directives/layout/top-nav/top-nav.ts @@ -0,0 +1,155 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface ITopNavScope extends ng.IScope { + topLvlSelectedIndex: number; + hideSearch: boolean; + searchBind: any; + menuModel: Array; + + topLvlMenu: Utils.MenuItemGroup; + goToState(state:string, params:Array):ng.IPromise; + menuItemClick: Function; + user: Models.IUserProperties; + version:string; + } + + + export class TopNavDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService, + private $filter:ng.IFilterService, + private $state:ng.ui.IStateService, + private $q: ng.IQService, + private userResourceService: Sdc.Services.IUserResourceClass + ) { + } + + public replace = true; + public restrict = 'E'; + public transclude = false; + + + scope = { + topLvlSelectedIndex: '@?', + hideSearch: '=', + searchBind: '=', + version: '@', + notificationIconCallback: '=', + menuModel: '=?', + }; + + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/layout/top-nav/top-nav.html'); + }; + + public link = (scope:ITopNavScope, $elem:ng.IAugmentedJQuery, $attrs:angular.IAttributes) => { + + let getTopLvlSelectedIndexByState = ():number => { + if (!scope.topLvlMenu.menuItems) { + return 0; + } + + let result = -1; + + //set result to current state + scope.topLvlMenu.menuItems.forEach((item:Utils.MenuItem, index:number)=> { + if (item.state === this.$state.current.name) { + result = index; + } + }); + + //if it's a different state , checking previous state param + if (result === -1) { + scope.topLvlMenu.menuItems.forEach((item:Utils.MenuItem, index:number)=> { + if (item.state === this.$state.params['previousState']) { + result = index; + } + }); + } + + if (result === -1) { + result = 0; + } + + return result; + }; + + scope.user = this.userResourceService.getLoggedinUser(); + + let tmpArray:Array = [ + new Utils.MenuItem(this.$filter('translate')("TOP_MENU_HOME_BUTTON"), null, "dashboard", "goToState", null, null), + new Utils.MenuItem(this.$filter('translate')("TOP_MENU_CATALOG_BUTTON"), null, "catalog", "goToState", null, null) + ]; + + // Only designer can perform onboarding + if (scope.user && scope.user.role === 'DESIGNER'){ + tmpArray.push(new Utils.MenuItem(this.$filter('translate')("TOP_MENU_ON_BOARD_BUTTON"), null, "onboardVendor", "goToState", null, null)); + } + + scope.topLvlMenu = new Utils.MenuItemGroup(0, tmpArray , true ); + scope.topLvlMenu.selectedIndex = isNaN(scope.topLvlSelectedIndex) ? getTopLvlSelectedIndexByState() : scope.topLvlSelectedIndex; + + let generateMenu = () => { + if (scope.menuModel && scope.menuModel[0] !== scope.topLvlMenu) { + scope.menuModel.unshift(scope.topLvlMenu); + } + }; + scope.$watch('menuModel', generateMenu); + + generateMenu(); + + /////scope functions//// + + scope.goToState = (state:string, params:Array):ng.IPromise => { + let deferred = this.$q.defer(); + this.$state.go(state, params && params.length > 0 ? [0] : undefined); + deferred.resolve(true); + return deferred.promise; + }; + + scope.menuItemClick = (itemGroup:Utils.MenuItemGroup, item:Utils.MenuItem) => { + + itemGroup.itemClick = false; + + let onSuccess = ():void => { + itemGroup.selectedIndex = itemGroup.menuItems.indexOf(item); + }; + let onFailed = ():void => {}; + + if (item.callback) { + (item.callback.apply(undefined, item.params)).then(onSuccess, onFailed); + } else { + scope[item.action](item.state, item.params).then(onSuccess, onFailed); + } + }; + }; + + public static factory = ($templateCache:ng.ITemplateCacheService, $filter:ng.IFilterService, $state:ng.ui.IStateService, $q: ng.IQService, userResourceService: Sdc.Services.IUserResourceClass)=> { + return new TopNavDirective($templateCache, $filter, $state,$q, userResourceService); + }; + + } + + TopNavDirective.factory.$inject = ['$templateCache', '$filter', '$state','$q', 'Sdc.Services.UserResourceService']; +} diff --git a/catalog-ui/app/scripts/directives/layout/top-progress/top-progress.html b/catalog-ui/app/scripts/directives/layout/top-progress/top-progress.html new file mode 100644 index 0000000000..ab2c8e364e --- /dev/null +++ b/catalog-ui/app/scripts/directives/layout/top-progress/top-progress.html @@ -0,0 +1,22 @@ +
      + + +
      + {{progressMessage}}{{progressValue}} % +
      +
      +
      +
      + +
      + + {{progressMessage}} +
      + +
      + + {{progressMessage}} +
      + + +
      diff --git a/catalog-ui/app/scripts/directives/layout/top-progress/top-progress.less b/catalog-ui/app/scripts/directives/layout/top-progress/top-progress.less new file mode 100644 index 0000000000..acce826f80 --- /dev/null +++ b/catalog-ui/app/scripts/directives/layout/top-progress/top-progress.less @@ -0,0 +1,58 @@ +.top-progress { + text-align: left; + + .sdc-progress-title { + .n_12_r; + + .progress-percentage { + float: right; + } + } + + .sdc-progress { + position: relative; + display: block; + height: 6px; + background-color: @main_color_o; + border-radius: 3px; + box-shadow: inset 0 1px 2px rgba(0,0,0,.1); + + .progress-bar { + border-radius: 3px; + background-color: @main_color_a; + } + + } + + .sdc-progress-success-wrapper { + display: flex; + align-items: flex-end; + + .sdc-progress-success-title { + .d_12_r; + margin-left: 10px; + } + + .sdc-progress-success { + .sprite-new; + .success-circle; + } + } + + .sdc-progress-error-wrapper { + display: flex; + align-items: flex-end; + + .sdc-progress-error-title { + .q_12_r; + margin-left: 10px; + } + + .sdc-progress-error { + .sprite-new; + .error-icon; + } + + } + +} diff --git a/catalog-ui/app/scripts/directives/layout/top-progress/top-progress.ts b/catalog-ui/app/scripts/directives/layout/top-progress/top-progress.ts new file mode 100644 index 0000000000..8e8a289281 --- /dev/null +++ b/catalog-ui/app/scripts/directives/layout/top-progress/top-progress.ts @@ -0,0 +1,57 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface ITopProgressScope extends ng.IScope { + progressValue:number; + progressMessage:string; + } + + export class TopProgressDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService) {} + + public replace = true; + public restrict = 'E'; + public transclude = false; + + scope = { + progressValue: '=', + progressMessage: '=' + }; + + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/layout/top-progress/top-progress.html'); + }; + + public link = (scope:ITopProgressScope, $elem:ng.IAugmentedJQuery, $attrs:angular.IAttributes) => { + + }; + + public static factory = ($templateCache:ng.ITemplateCacheService)=> { + return new TopProgressDirective($templateCache); + }; + + } + + TopProgressDirective.factory.$inject = ['$templateCache']; +} diff --git a/catalog-ui/app/scripts/directives/loader/loader-directive.html b/catalog-ui/app/scripts/directives/loader/loader-directive.html new file mode 100644 index 0000000000..e40b059a57 --- /dev/null +++ b/catalog-ui/app/scripts/directives/loader/loader-directive.html @@ -0,0 +1,4 @@ +
      +
      +
      +
      diff --git a/catalog-ui/app/scripts/directives/loader/loader-directive.less b/catalog-ui/app/scripts/directives/loader/loader-directive.less new file mode 100644 index 0000000000..ae0b41aab1 --- /dev/null +++ b/catalog-ui/app/scripts/directives/loader/loader-directive.less @@ -0,0 +1,74 @@ +.tlv-loader-back { + background-color: @main_color_p; + position: fixed; + top: 50px; + left: 0; + right: 0; + bottom: 0; + z-index: 9999; + opacity: 0.5; +} + +.tlv-loader-relative { position: absolute; top: 0;} + +.tlv-loader { + z-index: 10002; +} + +@keyframes fadein { + from { opacity: 0; } + to { opacity: 0.8; } +} + +/* Firefox < 16 */ +@-moz-keyframes fadein { + from { opacity: 0; } + to { opacity: 0.8; } +} + +/* Safari, Chrome and Opera > 12.1 */ +@-webkit-keyframes fadein { + from { opacity: 0; } + to { opacity: 0.8; } +} + +/* Internet Explorer */ +@-ms-keyframes fadein { + from { opacity: 0; } + to { opacity: 0.8; } +} + +/* Opera < 12.1 */ +@-o-keyframes fadein { + from { opacity: 0; } + to { opacity: 0.8; } +} + +@keyframes fadeout { + from { opacity: 0.8; } + to { opacity: 0; } +} + +/* Firefox < 16 */ +@-moz-keyframes fadeout { + from { opacity: 0.8; } + to { opacity: 0; } +} + +/* Safari, Chrome and Opera > 12.1 */ +@-webkit-keyframes fadeout { + from { opacity: 0.8; } + to { opacity: 0; } +} + +/* Internet Explorer */ +@-ms-keyframes fadeout { + from { opacity: 0.8; } + to { opacity: 0; } +} + +/* Opera < 12.1 */ +@-o-keyframes fadeout { + from { opacity: 0.8; } + to { opacity: 0; } +} diff --git a/catalog-ui/app/scripts/directives/loader/loader-directive.ts b/catalog-ui/app/scripts/directives/loader/loader-directive.ts new file mode 100644 index 0000000000..77c8977ac5 --- /dev/null +++ b/catalog-ui/app/scripts/directives/loader/loader-directive.ts @@ -0,0 +1,155 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + export interface ILoaderScope extends ng.IScope { + display: boolean; // Toggle show || hide scroll + size: string; // small || medium || large + elementSelector: string; // Jquery selector to hide and scroll inside + relative: boolean; // Will use the parent of element and hide it and scroll inside + loaderType: string; + } + + export class LoaderDirective implements ng.IDirective { + + constructor(private $templateCache: ng.ITemplateCacheService, private EventListenerService: Services.EventListenerService) { + } + + /* + * relative is used when inserting the HTML loader inside some div + * elementSelector when we want to pass the Jquery selector of the loader. + */ + scope = { + display: '=', + size: '@?', + elementSelector: '@?', + relative: '=?', + loaderType: '@?' + }; + + public replace = false; + public restrict = 'E'; + template = (): string => { + return this.$templateCache.get('/app/scripts/directives/loader/loader-directive.html'); + }; + + link = (scope: ILoaderScope, element: any) => { + + let interval; + + this.EventListenerService.registerObserverCallback(Utils.Constants.EVENTS.SHOW_LOADER_EVENT, (loaderType)=> { + if (scope.loaderType !== loaderType) { + return; + } + scope.display = true; + }); + this.EventListenerService.registerObserverCallback(Utils.Constants.EVENTS.HIDE_LOADER_EVENT, (loaderType)=> { + if (scope.loaderType !== loaderType) { + return; + } + scope.display = false; + }); + + let calculateSizesForFixPosition = (positionStyle: string): void => { + // This is problematic, I do not want to change the parent position. + // set the loader on all the screen + let parentPosition = element.parent().position(); + let parentWidth = element.parent().width(); + let parentHeight = element.parent().height(); + element.css('position', positionStyle); + element.css('top', parentPosition.top); + element.css('left', parentPosition.left); + element.css('width', parentWidth); + element.css('height', parentHeight); + }; + + let setStyle = (positionStyle: string): void => { + + switch (positionStyle) { + case 'absolute': + case 'fixed': + // The parent size is not set yet, still loading, so need to use interval to update the size. + interval = window.setInterval(()=> { + calculateSizesForFixPosition(positionStyle); + }, 2000); + break; + default: + // Can change the parent position to relative without causing style issues. + element.parent().css('position', 'relative'); + break; + } + }; + + // This should be executed after the dom loaded + window.setTimeout((): void => { + + element.css('display', 'none'); + + if (scope.elementSelector) { + let elemParent = angular.element(scope.elementSelector); + let positionStyle: string = elemParent.css('position'); + setStyle(positionStyle); + } + + if (scope.relative === true) { + let positionStyle: string = element.parent().css('position'); + setStyle(positionStyle); + } + + if (!scope.size) { + scope.size = 'large'; + } + + }, 0); + + if (scope.elementSelector) { + + } + + function cleanUp() { + clearInterval(interval); + } + + scope.$watch("display", (newVal, oldVal) => { + element.css('display', 'none'); + if (newVal === true) { + window.setTimeout((): void => { + element.css('display', 'block'); + }, 500); + } else { + window.setTimeout((): void => { + element.css('display', 'none'); + }, 0); + } + }); + + scope.$on('$destroy', cleanUp); + + }; + + public static factory = ($templateCache: ng.ITemplateCacheService, EventListenerService: Services.EventListenerService)=> { + return new LoaderDirective($templateCache, EventListenerService); + }; + + } + + LoaderDirective.factory.$inject = ['$templateCache', 'EventListenerService']; +} diff --git a/catalog-ui/app/scripts/directives/modal/sdc-modal.html b/catalog-ui/app/scripts/directives/modal/sdc-modal.html new file mode 100644 index 0000000000..a8419f162d --- /dev/null +++ b/catalog-ui/app/scripts/directives/modal/sdc-modal.html @@ -0,0 +1,18 @@ +
      +
      + {{header}} + +
      +
      +
      + +
      + +
      diff --git a/catalog-ui/app/scripts/directives/modal/sdc-modal.less b/catalog-ui/app/scripts/directives/modal/sdc-modal.less new file mode 100644 index 0000000000..d8dfdbb73b --- /dev/null +++ b/catalog-ui/app/scripts/directives/modal/sdc-modal.less @@ -0,0 +1,10 @@ +.ellipsis-directive-more-less { + .a_9; + .bold; + .hand; + float: right; + margin-right: 17px; + line-height: 23px; + text-decoration: underline; + text-align: left; +} diff --git a/catalog-ui/app/scripts/directives/modal/sdc-modal.ts b/catalog-ui/app/scripts/directives/modal/sdc-modal.ts new file mode 100644 index 0000000000..338035c9f1 --- /dev/null +++ b/catalog-ui/app/scripts/directives/modal/sdc-modal.ts @@ -0,0 +1,103 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface ISdcModalScope extends ng.IScope { + modal:ng.ui.bootstrap.IModalServiceInstance; + hideBackground:string; + ok():void; + close(result:any):void; + cancel(reason:any):void; + } + + export interface ISdcModalButton { + name:string; + css:string; + disabled?:boolean; + callback:Function; + } + + export class SdcModalDirective implements ng.IDirective { + + constructor( + private $templateCache: ng.ITemplateCacheService + ) {} + + scope = { + modal: '=', + type: '@', + header: '@', + headerTranslate: '@', + headerTranslateValues: '@', + showCloseButton: '@', + hideBackground: '@', + buttons: '=', + getCloseModalResponse: '=' + }; + + public replace = true; + public restrict = 'E'; + public transclude = true; + + template = (): string => { + return this.$templateCache.get('/app/scripts/directives/modal/sdc-modal.html'); + }; + + link = (scope:ISdcModalScope, $elem:any) => { + + if (scope.hideBackground==="true"){ + $(".modal-backdrop").css('opacity','0'); + } + + scope.close = function (result:any) { + scope.modal.close(result); + }; + + scope.ok = function () { + scope.modal.close(); + }; + + scope.cancel = function (reason:any) { + if(this.getCloseModalResponse) + scope.modal.dismiss(this.getCloseModalResponse()); + else { + scope.modal.dismiss(); + } + }; + + if (scope.modal) { + scope.modal.result.then(function (selectedItem) { + //$scope.selected = selectedItem; + }, function () { + //console.info('Modal dismissed at: ' + new Date()); + }); + } + } + + public static factory = ($templateCache: ng.ITemplateCacheService)=> { + return new SdcModalDirective($templateCache); + }; + + } + + SdcModalDirective.factory.$inject = ['$templateCache']; +} diff --git a/catalog-ui/app/scripts/directives/page-scroller/page-scroller.html b/catalog-ui/app/scripts/directives/page-scroller/page-scroller.html new file mode 100644 index 0000000000..7359386901 --- /dev/null +++ b/catalog-ui/app/scripts/directives/page-scroller/page-scroller.html @@ -0,0 +1,22 @@ +
      + + + + + +
      +
      + +
      +
      + +
      + diff --git a/catalog-ui/app/scripts/directives/page-scroller/page-scroller.less b/catalog-ui/app/scripts/directives/page-scroller/page-scroller.less new file mode 100644 index 0000000000..14f8568f07 --- /dev/null +++ b/catalog-ui/app/scripts/directives/page-scroller/page-scroller.less @@ -0,0 +1,98 @@ +.sdc-page-scroller { + + /****************** Navigation ***************/ + nav { + position: fixed; + top: 0; + right: 0; + z-index: 100; + display: flex; + flex-direction: column; + width: 100px; + bottom: 0; + background-color: #000; + align-items: center; + justify-content: center; + } + + nav ul { + list-style: none; + text-align: center; + margin-top: 0; + padding: 0; + } + + nav ul li { + display: block; + margin-bottom: 15px; + + } + + nav ul li:last-child { + + } + + nav a { + display: block; + height: 6px; + width: 6px; + border-radius: 50%; + background-color: #4a4c4d; + } + + nav a.active { + position: relative; + } + + nav a.active::after { + content: ''; + display: block; + position: absolute; + border: 2px solid #0198d1; + width: 16px; + height: 16px; + border-radius: 50%; + top: -5px; + left: -5px; + } + + /****************** Previous Next navigation ***************/ + .go-prev, .go-next { + cursor: pointer; + font-weight: bold; + text-decoration: underline; + } + + .slides-container { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow-y: hidden; + z-index: 10; + } + + .slide { + position: relative; + width: 100%; + height: 100%; + overflow: hidden; + } + + .slide .centered { + width: 60%; + margin: 200px auto 0; + } + + .slide .centered h1 { + text-align: center; + } + + .slide .centered p { + text-align: center; + margin-top: 20px; + font-size: 20px; + } + +} diff --git a/catalog-ui/app/scripts/directives/page-scroller/page-scroller.ts b/catalog-ui/app/scripts/directives/page-scroller/page-scroller.ts new file mode 100644 index 0000000000..bb89f9a55a --- /dev/null +++ b/catalog-ui/app/scripts/directives/page-scroller/page-scroller.ts @@ -0,0 +1,247 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface SlideData { + url: string; + id: string; + index: number; + callback: Function; + } + + export interface ISdcPageScrollDirectiveScope extends ng.IScope { + slidesData:Array; + showNav: boolean; + showPreviousNext: boolean; + currentSlide:SlideData; + showCloseButton:boolean; + closeButtonCallback:Function; + startSlideIndex:number; + + onNavButtonClick(slideName):void; + onCloseButtonClick():void; + goToPrevSlide():void; + goToNextSlide():void; + goToSlide(slide:SlideData):void; + onSlideChangeEnd():void; + onMouseWheel(event):void; + onKeyDown(event):void; + onResize(event):void; + gotoSlideIndex(index):void; + } + + export class SdcPageScrollDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService) { + + } + + scope = { + slidesData: '=', + showNav: '=', + showPreviousNext: '=', + showCloseButton: '=', + closeButtonCallback: '=', + startSlideIndex: '=?' + }; + + public replace = true; + public restrict = 'E'; + private delayExec:any; + + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/page-scroller/page-scroller.html'); + }; + + link = ($scope:ISdcPageScrollDirectiveScope, $elem:JQuery, attr:any) => { + let isAnimating = false; //Animating flag - is our app animating + let pageHeight = $(window).innerHeight(); //The height of the window + let slidesContainer; + let navButtons; + let slides:any; //Only graph-links that starts with + + //Key codes for up and down arrows on keyboard. We'll be using this to navigate change slides using the keyboard + let keyCodes = { + UP : 38, + DOWN: 40 + }; + + $scope.onCloseButtonClick = ():void => { + if ($scope.closeButtonCallback){ + $scope.closeButtonCallback(); + }; + }; + + // Wait for the dom to load (after ngRepeat). + $scope.$on('onRepeatLast', (scope, element, attrs) => { + slides = $(".slide", slidesContainer); + slidesContainer = $(".slides-container"); + navButtons = $("nav a").filter("[href^='#']"); + + // Adding event listeners + $(window).on("resize", (e) => {$scope.onResize(e);}).resize(); + $(window).on("mousewheel DOMMouseScroll", (e) => {$scope.onMouseWheel(e);}); + $(document).on("keydown", (e) => {$scope.onKeyDown(e);}); + + //Going to the first slide + if ($scope.startSlideIndex){ + $scope.gotoSlideIndex($scope.startSlideIndex); + } else { + $scope.gotoSlideIndex(0); + } + + }); + + $scope.gotoSlideIndex = (index) => { + $scope.goToSlide($scope.slidesData[index]); + }; + + // When a button is clicked - first get the button href, and then slide to the container, if there's such a container + $scope.onNavButtonClick = (slide:SlideData):void => { + $scope.goToSlide(slide); + }; + + // If there's a previous slide, slide to it + $scope.goToPrevSlide = ():void => { + let previousSlide = $scope.slidesData[$scope.currentSlide.index-1]; + if (previousSlide) { + $scope.goToSlide(previousSlide); + } + }; + + // If there's a next slide, slide to it + $scope.goToNextSlide = ():void => { + let nextSlide = $scope.slidesData[$scope.currentSlide.index+1]; + if (nextSlide) { + $scope.goToSlide(nextSlide); + } + }; + + // Actual transition between slides + $scope.goToSlide = (slide:SlideData):void => { + //console.log("start goToSlide"); + //If the slides are not changing and there's such a slide + if(!isAnimating && slide) { + //setting animating flag to true + isAnimating = true; + $scope.currentSlide = slide; + $scope.currentSlide.callback(); + + //Sliding to current slide + let calculatedY = pageHeight * ($scope.currentSlide.index); + //console.log("$scope.currentSlide.index: " + $scope.currentSlide.index + " | calculatedY: " + calculatedY); + + $('.slides-container').animate( + { + scrollTop: calculatedY + 'px' + }, + { + duration: 1000, + specialEasing: { + width: "linear", + height: "easeInOutQuart" + }, + complete: function() { + $scope.onSlideChangeEnd(); + } + } + ); + + //Animating menu items + $(".sdc-page-scroller nav a.active").removeClass("active"); + $(".sdc-page-scroller nav [href='#" + $scope.currentSlide.id + "']").addClass("active"); + } + }; + + // Once the sliding is finished, we need to restore "isAnimating" flag. + // You can also do other things in this function, such as changing page title + $scope.onSlideChangeEnd = ():void => { + + + + isAnimating = false; + }; + + // When user scrolls with the mouse, we have to change slides + $scope.onMouseWheel = (event):void => { + //Normalize event wheel delta + let delta = event.originalEvent.wheelDelta / 30 || -event.originalEvent.detail; + + //If the user scrolled up, it goes to previous slide, otherwise - to next slide + if(delta < -1) { + this.delayAction($scope.goToNextSlide); + } else if(delta > 1) { + this.delayAction($scope.goToPrevSlide); + } + event.preventDefault(); + }; + + // Getting the pressed key. Only if it's up or down arrow, we go to prev or next slide and prevent default behaviour + // This way, if there's text input, the user is still able to fill it + $scope.onKeyDown = (event):void => { + let PRESSED_KEY = event.keyCode; + + if(PRESSED_KEY == keyCodes.UP){ + $scope.goToPrevSlide(); + event.preventDefault(); + } else if(PRESSED_KEY == keyCodes.DOWN){ + $scope.goToNextSlide(); + event.preventDefault(); + } + }; + + // When user resize it's browser we need to know the new height, so we can properly align the current slide + $scope.onResize = (event):void => { + //This will give us the new height of the window + let newPageHeight = $(window).innerHeight(); + + // If the new height is different from the old height ( the browser is resized vertically ), the slides are resized + if(pageHeight !== newPageHeight) { + pageHeight = newPageHeight; + } + }; + }; + + private initSlides = ():void => { + //pageHeight + }; + + private delayAction = (action:Function):void => { + clearTimeout(this.delayExec); + this.delayExec = setTimeout(function () { + action(); + }, 100); + }; + + public static factory = ($templateCache:ng.ITemplateCacheService)=> { + return new SdcPageScrollDirective($templateCache); + }; + + } + + SdcPageScrollDirective.factory.$inject = ['$templateCache']; + +} + + + + diff --git a/catalog-ui/app/scripts/directives/perfect-scrollbar/angular-perfect-scrollbar.ts b/catalog-ui/app/scripts/directives/perfect-scrollbar/angular-perfect-scrollbar.ts new file mode 100644 index 0000000000..b53a059a40 --- /dev/null +++ b/catalog-ui/app/scripts/directives/perfect-scrollbar/angular-perfect-scrollbar.ts @@ -0,0 +1,159 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + + 'use strict'; + + export interface IPerfectScrollerScope extends ng.IScope { + //update(event:string): void; + } + + export class PerfectScrollerDirective implements ng.IDirective { + + constructor( + private $templateCache: ng.ITemplateCacheService, + private $parse:any, + private $window:any) { + + } + + replace = true; + restrict = 'EA'; + transclude = true; + + template = (): string => { + return '
      '; + }; + + link = ($scope:IPerfectScrollerScope, $elem, $attr) => { + let self = this; + let options = {}; + + let psOptions = [ + 'wheelSpeed', 'wheelPropagation', 'minScrollbarLength', 'useBothWheelAxes', + 'useKeyboard', 'suppressScrollX', 'suppressScrollY', 'scrollXMarginOffset', + 'scrollYMarginOffset', 'includePadding'//, 'onScroll', 'scrollDown' + ]; + + for (let i=0, l=psOptions.length; i { + $scope.$evalAsync(function() { + //if ($attr.scrollDown == 'true' && event != 'mouseenter') { + if (event != 'mouseenter') { + setTimeout(function () { + $($elem).scrollTop($($elem).prop("scrollHeight")); + }, 100); + } + $elem.perfectScrollbar('update'); + }); + }; + */ + + // This is necessary when you don't watch anything with the scrollbar + $elem.bind('mouseenter', function(){ + //console.log("mouseenter"); + $elem.perfectScrollbar('update'); + }); + + $elem.bind('mouseleave', function(){ + //console.log("mouseleave"); + setTimeout(function () { + $(window).trigger('mouseup'); + $elem.perfectScrollbar('update'); + }, 10); + }); + + $elem.bind('click', function(){ + //console.log("click"); + // Wait 500 milliseconds until the collapse finish closing and update. + setTimeout(function () { + $elem.perfectScrollbar('update'); + }, 500); + }); + + /** + * Check if the content of the scroller was changed, and if changed update the scroller. + * Because DOMSubtreeModified event is fire many time (while filling the content), I'm checking that + * there is at least 100 milliseconds between DOMSubtreeModified events to update the scrollbar. + * @type {boolean} + */ + let insideDOMSubtreeModified=false; + $elem.bind('DOMSubtreeModified', function(){ + if (insideDOMSubtreeModified==false) { + insideDOMSubtreeModified=true; + setTimeout(function () { + insideDOMSubtreeModified=false; + $elem.perfectScrollbar('update'); + }, 100); + } + }); + + // Possible future improvement - check the type here and use the appropriate watch for non-arrays + if ($attr.refreshOnChange) { + $scope.$watchCollection($attr.refreshOnChange, function() { + $elem.perfectScrollbar('update'); + }); + } + + /* + // this is from a pull request - I am not totally sure what the original issue is but seems harmless + if ($attr.refreshOnResize) { + self.$window.on('resize', function(e){$scope.update(e)}); + } + */ + + $elem.bind('$destroy', function() { + //self.$window.off('resize', function(e){$scope.update(e)}); + $elem.perfectScrollbar('destroy'); + }); + + }; + + public static factory = ($templateCache: ng.ITemplateCacheService, $parse:any, $window:any)=> { + return new PerfectScrollerDirective($templateCache, $parse, $window); + }; + + } + + PerfectScrollerDirective.factory.$inject = ['$templateCache','$parse','$window']; +} diff --git a/catalog-ui/app/scripts/directives/print-graph-screen/print-graph-screen.ts b/catalog-ui/app/scripts/directives/print-graph-screen/print-graph-screen.ts new file mode 100644 index 0000000000..8204928e6f --- /dev/null +++ b/catalog-ui/app/scripts/directives/print-graph-screen/print-graph-screen.ts @@ -0,0 +1,211 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface IPrintGraphScreenScope extends ng.IScope { + entity:Models.Components.Component; + } + + + export class PrintGraphScreenDirective implements ng.IDirective { + + constructor( + private $filter: ng.IFilterService, + private sdcMenu:Models.IAppMenu, + private sdcConfig:Models.IAppConfigurtaion, + private urlToBase64Service:Sdc.Services.UrlToBase64Service + ) {} + + scope = { + entity: '=' + }; + restrict = 'A'; + link = (scope:IPrintGraphScreenScope, element:any) => { + + + element.bind('click', function() { + printScreen(); + }); + + + // TODO we need to implement export to PDF in cytoscape + let printScreen = ():void => { + + // + // let pdf :any = new jsPDF('landscape', 'mm', 'a4'); + // pdf.setProperties({ + // title: scope.entity.name, + // subject: 'Design Snapshot for ' + scope.entity.name, + // author: scope.entity.creatorFullName, + // keywords: scope.entity.tags.join(', '), + // creator: scope.entity.creatorFullName + // }); + // + // // A4 measures is 210 × 297 millimeters + // let pdfWidth :number = 297, + // pdfHeight :number = 210, + // leftColumnWidth :number = 80; + // + // //left bar background + // pdf.setDrawColor(0); + // pdf.setFillColor(248, 249, 251); + // pdf.rect(0, 0, leftColumnWidth, pdfHeight, 'F'); + // + // //entity name + // pdf.setFontSize(12); + // pdf.setTextColor(38, 61, 77); + // let splitTitle :any = pdf.splitTextToSize(scope.entity.name, 50); + // pdf.text(22, 15 - (splitTitle.length - 1) * 2, splitTitle); + // + // //line + // pdf.setLineWidth(0.2); + // pdf.setDrawColor(208, 209, 213); + // pdf.line(0, 28, leftColumnWidth, 28); + // + // + // pdf.setFontSize(10); + // let properties :any = getPdfProperties(); + // + // let topOffset :number = 39, lines; + // properties.forEach( (item:any) => { + // if (!item.value) { + // return; + // } + // if (item.title === 'Description:') { + // topOffset += 5; + // } + // + // pdf.setTextColor(38, 61, 77); + // pdf.text(5, topOffset, item.title); + // pdf.setTextColor(102, 102, 102); + // lines = pdf.splitTextToSize(item.value, 49); + // pdf.text(5 + item.offset, topOffset, lines[0]); + // if (lines.length > 1) { + // lines = pdf.splitTextToSize(item.value.substring(lines[0].length + 1), 65); + // if (lines.length > 8) { + // lines = lines.slice(0, 7); + // lines[lines.length - 1] += '...'; + // } + // pdf.text(5, topOffset + 4, lines); + // topOffset += 4 * (lines.length); + // } + // + // topOffset += 6; + // }); + // + // + // //another background in case the text was too long + // let declarationLineOffset :number = 176; + // pdf.setDrawColor(0); + // pdf.setFillColor(248, 249, 251); + // pdf.rect(0, declarationLineOffset, leftColumnWidth, pdfHeight - declarationLineOffset, 'F'); + // //line + // pdf.setLineWidth(0.2); + // pdf.setDrawColor(208, 209, 213); + // pdf.line(0, declarationLineOffset, leftColumnWidth, declarationLineOffset); + // + // //declaration + // pdf.setFontSize(10.5); + // pdf.setTextColor(38, 61, 77); + // pdf.text(5, 185, 'Declaration'); + // pdf.setFontSize(9); + // pdf.setTextColor(102, 102, 102); + // pdf.setFontType('bold'); + // pdf.text(5, 190, this.$filter('translate')('PDF_FILE_DECLARATION_BOLD')); + // pdf.setFontType('normal'); + // pdf.text(5, 194, pdf.splitTextToSize(this.$filter('translate')('PDF_FILE_DECLARATION'), 65)); + // + // //entity icon + // let self = this; + // let addEntityIcon:Function = () => { + // let iconPath:string = self.sdcConfig.imagesPath + '/styles/images/'; + // if (scope.entity.isService()) { + // iconPath += 'service-icons/' + scope.entity.icon + '.png'; + // } else { + // iconPath += 'resource-icons/' + scope.entity.icon + '.png'; + // } + // self.urlToBase64Service.downloadUrl(iconPath, (base64string:string):void => { + // if (base64string) { + // pdf.addImage(base64string, 'JPEG', 5, 7, 15, 15); + // } + // pdf.save(scope.entity.name + '.pdf'); + // }); + // }; + // + // //actual snapshop of canvas + // + // let diagramDiv :any = document.getElementById('myDiagram'); + // let diagram :any = null;// Sdc.Graph.Diagram.fromDiv(diagramDiv), canvasImg = new Image(); + // diagram.startTransaction('print screen'); + // let canvasImgBase64:any = diagram.makeImageData({ + // //scale: 1, + // // size: new Sdc.Graph.Size(pdfHeight * 5, NaN), + // background: 'white', + // type: 'image/jpeg' + // }); + // diagramDiv.firstElementChild.toDataURL(); + // diagram.commitTransaction('print screen'); + // + // canvasImg.onload = () => { + // if (canvasImg.height > 0) { + // let canvasImgRatio:number = Math.min((pdfWidth - leftColumnWidth - 15) / canvasImg.width, pdfHeight / canvasImg.height); + // let canvasImgWidth:number = canvasImg.width * canvasImgRatio, + // canvasImgHeight:number = canvasImg.height * canvasImgRatio; + // let canvasImgOffset:number = (pdfHeight - canvasImgHeight) / 2; + // pdf.addImage(canvasImg, 'JPEG', leftColumnWidth, canvasImgOffset, canvasImgWidth, canvasImgHeight); + // + // addEntityIcon(); + // } + // }; + // + // if(canvasImg.src === 'data:,') { //empty canvas + // addEntityIcon(); + // } else { + // canvasImg.src = canvasImgBase64; + // } + }; + + let getPdfProperties = ():Array => { + return [ + {title: this.$filter('translate')('GENERAL_LABEL_TYPE'), value: scope.entity.getComponentSubType(), offset: 10}, + {title: this.$filter('translate')('GENERAL_LABEL_VERSION'), value: scope.entity.version, offset: 15}, + {title: this.$filter('translate')('GENERAL_LABEL_CATEGORY'), value: scope.entity.categories.length ? scope.entity.categories[0].name : '', offset: 16}, + {title: this.$filter('translate')('GENERAL_LABEL_CREATION_DATE'), value: this.$filter('date')(scope.entity.creationDate, 'MM/dd/yyyy'), offset: 24}, + {title: this.$filter('translate')('GENERAL_LABEL_AUTHOR'), value: scope.entity.creatorFullName, offset: 13}, + {title: this.$filter('translate')('GENERAL_LABEL_CONTACT_ID'), value: scope.entity.contactId, offset: 41}, + {title: this.$filter('translate')('GENERAL_LABEL_STATUS'), value: (this.sdcMenu).LifeCycleStatuses[scope.entity.lifecycleState].text, offset: 13}, + {title: this.$filter('translate')('GENERAL_LABEL_PROJECT_CODE'), value: scope.entity.projectCode, offset: 15}, + {title: this.$filter('translate')('GENERAL_LABEL_DESCRIPTION'), value: scope.entity.description, offset: 20}, + {title: this.$filter('translate')('GENERAL_LABEL_TAGS'), value: scope.entity.tags.join(', '), offset: 10} + ]; + }; + + }; + + public static factory = ($filter:ng.IFilterService, sdcMenu:Models.IAppMenu, sdcConfig:Models.IAppConfigurtaion, urlToBase64Service:Sdc.Services.UrlToBase64Service)=> { + return new PrintGraphScreenDirective($filter, sdcMenu, sdcConfig, urlToBase64Service); + }; + + } + + PrintGraphScreenDirective.factory.$inject = ['$filter', 'sdcMenu', 'sdcConfig', 'Sdc.Services.UrlToBase64Service']; +} diff --git a/catalog-ui/app/scripts/directives/property-types/data-type-fields-structure/data-type-fields-structure.html b/catalog-ui/app/scripts/directives/property-types/data-type-fields-structure/data-type-fields-structure.html new file mode 100644 index 0000000000..b4583fd304 --- /dev/null +++ b/catalog-ui/app/scripts/directives/property-types/data-type-fields-structure/data-type-fields-structure.html @@ -0,0 +1,82 @@ +
      +
      +
      + {{typeName.replace("org.openecomp.datatypes.heat.","")}} +
      +
      +
      +
      + +
      +
      + +
      + +
      +
      +
      + +
      +
      + +
      +
      +
      + + + +
      + + + +
      +
      +
      +
      + + +
      +
      + + diff --git a/catalog-ui/app/scripts/directives/property-types/data-type-fields-structure/data-type-fields-structure.less b/catalog-ui/app/scripts/directives/property-types/data-type-fields-structure/data-type-fields-structure.less new file mode 100644 index 0000000000..5c65fdc9dc --- /dev/null +++ b/catalog-ui/app/scripts/directives/property-types/data-type-fields-structure/data-type-fields-structure.less @@ -0,0 +1,90 @@ +.data-type-fields-structure{ + background-color: @tlv_color_v; + padding:10px; + display: table-caption; + .open-close{ + position: relative; + .open-close-button{ + position: absolute; + top: 50%; + margin-top: -7px; + &.expand{ + .sprite-new; + .expand-collapse-minus-icon; + } + &.collapse{ + .sprite-new; + .expand-collapse-plus-icon; + } + } + + } + + + .data-type-name{ + .m_16_m; + margin-left: 22px; + } + + .i-sdc-form-input:disabled{ + .disabled; + } + + .property{ + display: flex; + min-width: 365px; + min-height: 46px; + input[type="text"],select{ + width: 170px; + } + .property-name{ + float: left; + margin-top: 8px; + } + .primitive-value-field{ + float: right; + margin-top: 8px; + margin-left: 10px; + } + .inner-structure{ + display: -webkit-box; + } + } + + [ng-switch-when="map"]{ + margin-top: 8px; + margin-left: 10px; + .map-item{ + border: solid 1px @main_color_o; + min-width: 401px; + min-height: 69px; + float: none !important; + } + .add-map-item{ + width: auto; + float: none; + &:nth-child(1){ + position: relative; + top: 6px; + } + .add-btn{ + float: none; + } + } + + } + + [ng-switch-when="list"]{ + float: left; + margin-top: 8px; + margin-left: 10px; + min-width: 280px; + .dt-list-item { + border: solid 1px @main_color_o; + } + .list-value-items{ + width:280px; + } + } +} + diff --git a/catalog-ui/app/scripts/directives/property-types/data-type-fields-structure/data-type-fields-structure.ts b/catalog-ui/app/scripts/directives/property-types/data-type-fields-structure/data-type-fields-structure.ts new file mode 100644 index 0000000000..94567ca36b --- /dev/null +++ b/catalog-ui/app/scripts/directives/property-types/data-type-fields-structure/data-type-fields-structure.ts @@ -0,0 +1,165 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 1/27/2016. + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface IDataTypeFieldsStructureScope extends ng.IScope { + parentFormObj:ng.IFormController; + dataTypeProperties:Array; + typeName:string; + valueObjRef:any; + propertyNameValidationPattern: RegExp; + fieldsPrefixName:string; + readOnly:boolean; + currentTypeDefaultValue:any; + types:Models.DataTypesMap; + expandByDefault:boolean; + expand:boolean; + expanded:boolean; + dataTypesService:Sdc.Services.DataTypesService; + + expandAndCollapse():void; + getValidationPattern(type:string):RegExp; + validateIntRange(value:string):boolean; + onValueChange(propertyName:string, type:string):void + } + + + export class DataTypeFieldsStructureDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService, + private DataTypesService:Sdc.Services.DataTypesService, + private PropertyNameValidationPattern: RegExp, + private ValidationUtils:Sdc.Utils.ValidationUtils) { + } + + scope = { + valueObjRef: '=', + typeName: '=', + parentFormObj: '=', + fieldsPrefixName: '=', + readOnly: '=', + defaultValue: '@', + types: '=', + expandByDefault: '=' + }; + + restrict = 'E'; + replace = true; + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/property-types/data-type-fields-structure/data-type-fields-structure.html'); + }; + public types=Utils.Constants.PROPERTY_DATA.TYPES; + + //get data type properties array and return object with the properties and their default value + //(for example: get: [{name:"prop1",defaultValue:1 ...},{name:"prop2", defaultValue:"bla bla" ...}] + // return: {prop1: 1, prop2: "bla bla"} + private getDefaultValue = (dataTypeProperties:Array):any => { + let defaultValue = {}; + for(let i=0; i < dataTypeProperties.length; i++){ + if(dataTypeProperties[i].type!='string'){ + if(dataTypeProperties[i].defaultValue){ + defaultValue[dataTypeProperties[i].name] = JSON.parse(dataTypeProperties[i].defaultValue); + } + }else{ + defaultValue[dataTypeProperties[i].name] = dataTypeProperties[i].defaultValue; + } + } + return defaultValue; + }; + + private initDataOnScope = (scope:any, $attr:any):void =>{ + scope.dataTypesService = this.DataTypesService; + scope.dataTypeProperties = this.DataTypesService.getFirsLevelOfDataTypeProperties(scope.typeName,scope.types); + if($attr.defaultValue){ + scope.currentTypeDefaultValue = JSON.parse($attr.defaultValue); + }else{ + scope.currentTypeDefaultValue = this.getDefaultValue(scope.dataTypeProperties); + } + + if(!scope.valueObjRef) { + scope.valueObjRef = {}; + } + + _.forEach(scope.currentTypeDefaultValue, (value, key)=> { + if(!scope.valueObjRef[key]){ + if(typeof scope.currentTypeDefaultValue[key] == 'object'){ + angular.copy(scope.currentTypeDefaultValue[key], scope.valueObjRef[key]); + }else{ + scope.valueObjRef[key] = scope.currentTypeDefaultValue[key]; + } + } + }); + }; + + private rerender = (scope:any):void =>{ + scope.expanded = false; + scope.expand = false; + if(scope.expandByDefault){ + scope.expandAndCollapse(); + } + }; + + link = (scope:IDataTypeFieldsStructureScope, element:any, $attr:any) => { + scope.propertyNameValidationPattern = this.PropertyNameValidationPattern; + + scope.$watchCollection('[typeName,fieldsPrefixName]', (newData:any):void => { + this.rerender(scope); + }); + + + scope.expandAndCollapse = ():void => { + if(!scope.expanded){ + this.initDataOnScope(scope,$attr); + scope.expanded=true; + } + scope.expand=!scope.expand; + }; + + scope.getValidationPattern = (type:string):RegExp => { + return this.ValidationUtils.getValidationPattern(type); + }; + + scope.validateIntRange = (value:string):boolean => { + return !value || this.ValidationUtils.validateIntRange(value); + }; + + scope.onValueChange = (propertyName:string, type:string):void => { + scope.valueObjRef[propertyName] = !angular.isUndefined(scope.valueObjRef[propertyName]) ? scope.valueObjRef[propertyName] : scope.currentTypeDefaultValue[propertyName]; + if(scope.valueObjRef[propertyName] && type != 'string'){ + scope.valueObjRef[propertyName] = JSON.parse(scope.valueObjRef[propertyName]); + } + }; + }; + + public static factory = ($templateCache:ng.ITemplateCacheService, + DataTypesService:Sdc.Services.DataTypesService, + PropertyNameValidationPattern:RegExp, + ValidationUtils:Sdc.Utils.ValidationUtils)=> { + return new DataTypeFieldsStructureDirective($templateCache,DataTypesService,PropertyNameValidationPattern,ValidationUtils); + }; + } + + DataTypeFieldsStructureDirective.factory.$inject = ['$templateCache','Sdc.Services.DataTypesService','PropertyNameValidationPattern','ValidationUtils']; +} diff --git a/catalog-ui/app/scripts/directives/property-types/type-list/type-list-directive.html b/catalog-ui/app/scripts/directives/property-types/type-list/type-list-directive.html new file mode 100644 index 0000000000..410a24e62b --- /dev/null +++ b/catalog-ui/app/scripts/directives/property-types/type-list/type-list-directive.html @@ -0,0 +1,57 @@ +
      +
      +
      + + +
      + + +
      +
      +
      Add
      +
      + + {{value}} + + +
      +
      +
      +
      +
      + + +
      +
      Add
      +
      + +
      +
      diff --git a/catalog-ui/app/scripts/directives/property-types/type-list/type-list-directive.less b/catalog-ui/app/scripts/directives/property-types/type-list/type-list-directive.less new file mode 100644 index 0000000000..eb4214e135 --- /dev/null +++ b/catalog-ui/app/scripts/directives/property-types/type-list/type-list-directive.less @@ -0,0 +1,85 @@ +.list-new-item{ + float: left; + width: 50%; + min-width: 221px; + margin-right: 15px; + input{ + min-width: 221px; + } +} + +.list-value-items{ + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + border: 1px solid @main_color_o; + padding-bottom: 10px; + min-height: 100px; + clear: both; + background-color: white; + .list-value-item{ + display: inline-block; + background-color: @tlv_color_v; + margin: 10px 0 0 10px; + padding-left: 8px; + .delete-list-item{ + margin: 0 6px 0 10px; + .hand; + } + } +} + +.add-btn { + .f-color.a; + .f-type._14_m; + .hand; + + &.add-list-item { + float: left; + margin-top: 5px; + width: 44px; + } + + &:before { + .sprite-new; + .plus-icon; + margin-right: 5px; + content: ""; + + } + &:hover { + .f-color.b; + &:before { + .sprite-new; + .plus-icon-hover; + } + } + +} + +.dt-list{ + display: table-caption; + .dt-list-item { + border-radius: 3px; + background-color: @tlv_color_v; + display: inline-block; + .delete-dt-list-item{ + float: right; + position: relative; + top: 5px; + right: 5px; + .sprite-new; + .delete-icon; + &:hover{ + .delete-icon-hover; + } + } + .data-type-name{ + margin-right: 16px; + } + } + &>.add-list-item{ + float:none; + } +} + diff --git a/catalog-ui/app/scripts/directives/property-types/type-list/type-list-directive.ts b/catalog-ui/app/scripts/directives/property-types/type-list/type-list-directive.ts new file mode 100644 index 0000000000..ce5ee1ffa6 --- /dev/null +++ b/catalog-ui/app/scripts/directives/property-types/type-list/type-list-directive.ts @@ -0,0 +1,130 @@ +/*- + * ============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========================================================= + */ +/** + * Created by rcohen on 9/15/2016. + */ +/// +module Sdc.Directives { + 'use strict'; + /// import Model = go.Model; + + export interface ITypeListScope extends ng.IScope { + parentFormObj:ng.IFormController; + schemaProperty:Models.SchemaProperty; + isSchemaTypeDataType:boolean; + valueObjRef:any; + propertyNameValidationPattern: RegExp; + fieldsPrefixName:string; + readOnly:boolean; + listDefaultValue:any; + types:Models.DataTypesMap; + listNewItem:any; + maxLength:number; + + getValidationPattern(type:string):RegExp; + validateIntRange(value:string):boolean; + addListItem():void; + deleteListItem(listItemIndex:number):void + } + + + export class TypeListDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService, + private DataTypesService:Sdc.Services.DataTypesService, + private PropertyNameValidationPattern: RegExp, + private ValidationUtils:Sdc.Utils.ValidationUtils) { + } + + scope = { + valueObjRef: '=',//ref to list object in the parent value object + schemaProperty: '=',//get the schema.property object + parentFormObj: '=',//ref to parent form (get angular form object) + fieldsPrefixName: '=',//prefix for form fields names + readOnly: '=',//is form read only + defaultValue: '@',//this list default value + types: '=',//data types list + maxLength: '=' + }; + + restrict = 'E'; + replace = true; + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/property-types/type-list/type-list-directive.html'); + }; + + link = (scope:ITypeListScope, element:any, $attr:any) => { + scope.propertyNameValidationPattern = this.PropertyNameValidationPattern; + + //reset valueObjRef when schema type is changed + scope.$watchCollection('schemaProperty.type', (newData:any):void => { + scope.isSchemaTypeDataType = this.DataTypesService.isDataTypeForSchemaType(scope.schemaProperty,scope.types); + //insert 1 empty item dt by default + if(scope.isSchemaTypeDataType && (!scope.valueObjRef||!scope.valueObjRef.length)){ + scope.valueObjRef = scope.valueObjRef ||[]; + scope.valueObjRef.push({}); + } + }); + + //when user brows between properties in "edit property form" + scope.$watchCollection('fieldsPrefixName', (newData:any):void => { + scope.listNewItem={value:''}; + + if($attr.defaultValue){ + scope.listDefaultValue = JSON.parse($attr.defaultValue); + } + }); + + scope.getValidationPattern = (type:string):RegExp => { + return this.ValidationUtils.getValidationPattern(type); + }; + + scope.validateIntRange = (value:string):boolean => { + return !value || this.ValidationUtils.validateIntRange(value); + }; + + scope.addListItem = ():void => { + scope.valueObjRef = scope.valueObjRef ||[]; + let newVal = ((scope.schemaProperty.simpleType||scope.schemaProperty.type)==Utils.Constants.PROPERTY_TYPES.STRING?scope.listNewItem.value:JSON.parse(scope.listNewItem.value)); + scope.valueObjRef.push(newVal); + scope.listNewItem.value = ""; + }; + + scope.deleteListItem = (listItemIndex:number):void => { + scope.valueObjRef.splice(listItemIndex,1); + if (!scope.valueObjRef.length) { + if (scope.listDefaultValue ) { + angular.copy(scope.listDefaultValue, scope.valueObjRef); + } + } + }; + }; + + public static factory = ($templateCache:ng.ITemplateCacheService, + DataTypesService:Sdc.Services.DataTypesService, + PropertyNameValidationPattern:RegExp, + ValidationUtils:Sdc.Utils.ValidationUtils)=> { + return new TypeListDirective($templateCache,DataTypesService,PropertyNameValidationPattern,ValidationUtils); + }; + } + + TypeListDirective.factory.$inject = ['$templateCache','Sdc.Services.DataTypesService','PropertyNameValidationPattern','ValidationUtils']; +} + diff --git a/catalog-ui/app/scripts/directives/property-types/type-map/type-map-directive.html b/catalog-ui/app/scripts/directives/property-types/type-map/type-map-directive.html new file mode 100644 index 0000000000..ed82b840dc --- /dev/null +++ b/catalog-ui/app/scripts/directives/property-types/type-map/type-map-directive.html @@ -0,0 +1,70 @@ +
      +
      +
      + + +
      + + +
      +
      +
      + + + +
      + + + +
      +
      +
      + + +
      + +
      +
      +
      Add
      +
      +
      + diff --git a/catalog-ui/app/scripts/directives/property-types/type-map/type-map-directive.less b/catalog-ui/app/scripts/directives/property-types/type-map/type-map-directive.less new file mode 100644 index 0000000000..2480b626f2 --- /dev/null +++ b/catalog-ui/app/scripts/directives/property-types/type-map/type-map-directive.less @@ -0,0 +1,83 @@ +.add-map-item{ + &:nth-child(odd){ + float: right; + } + &:nth-child(1){ + float: none; + .add-btn{ + float: none; + } + } + width: 400px; + .add-btn{ + width: 44px; + float: right; + } + &.schema-data-type{ + float:none; + .add-btn{ + float: none; + } + } +} + +.add-btn { + .f-color.a; + .f-type._14_m; + .hand; + + &:before { + .sprite-new; + .plus-icon; + margin-right: 5px; + content: ""; + + } + &:hover { + .f-color.b; + &:before { + .sprite-new; + .plus-icon-hover; + } + } + +} + +.map-item{ + min-width: 389px; + min-height: 65px; + background-color: @tlv_color_v; + border-radius: 3px; + margin-bottom: 8px; + float: left; + display: flex; + &:nth-child(even).primitive-value-map{ + float: right; + } + .delete-map-item { + float: right; + position: relative; + top: 5px; + right: 5px; + .sprite-new; + .delete-icon; + &:hover{ + .delete-icon-hover; + } + } + .map-item-field { + margin: 7px 12px !important; + float: left; + min-width: 170px; + min-height: 50px; + select{ + width:171px; + } + input[type="text"]{ + width: 170px; + } + &>.data-type-fields-structure{ + padding: 0; + } + } +} diff --git a/catalog-ui/app/scripts/directives/property-types/type-map/type-map-directive.ts b/catalog-ui/app/scripts/directives/property-types/type-map/type-map-directive.ts new file mode 100644 index 0000000000..d94ccf3886 --- /dev/null +++ b/catalog-ui/app/scripts/directives/property-types/type-map/type-map-directive.ts @@ -0,0 +1,157 @@ +/*- + * ============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========================================================= + */ +/** + * Created by rcohen on 9/15/2016. + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface ITypeMapScope extends ng.IScope { + parentFormObj:ng.IFormController; + schemaProperty:Models.SchemaProperty; + isSchemaTypeDataType:boolean; + valueObjRef:any; + mapKeys:Array;//array of map keys + propertyNameValidationPattern: RegExp; + fieldsPrefixName:string; + readOnly:boolean; + mapDefaultValue:any; + types:Models.DataTypesMap; + maxLength:number; + + getValidationPattern(type:string):RegExp; + validateIntRange(value:string):boolean; + changeKeyOfMap(newKey:string, index:number, fieldName:string):void; + deleteMapItem(index:number):void; + addMapItemFields():void; + parseToCorrectType(objectOfValues:any, locationInObj:string, type:string):void; + getNumber(num:number):Array; + } + + + export class TypeMapDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService, + private DataTypesService:Sdc.Services.DataTypesService, + private PropertyNameValidationPattern: RegExp, + private ValidationUtils:Sdc.Utils.ValidationUtils, + private $timeout: ng.ITimeoutService) { + } + + scope = { + valueObjRef: '=',//ref to map object in the parent value object + schemaProperty: '=',//get the schema.property object + parentFormObj: '=',//ref to parent form (get angular form object) + fieldsPrefixName: '=',//prefix for form fields names + readOnly: '=',//is form read only + defaultValue: '@',//this map default value + types: '=',//data types list + maxLength: '=' + }; + + restrict = 'E'; + replace = true; + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/property-types/type-map/type-map-directive.html'); + }; + + link = (scope:ITypeMapScope, element:any, $attr:any) => { + scope.propertyNameValidationPattern = this.PropertyNameValidationPattern; + + //reset valueObjRef and mapKeys when schema type is changed + scope.$watchCollection('schemaProperty.type', (newData:any):void => { + scope.isSchemaTypeDataType = this.DataTypesService.isDataTypeForSchemaType(scope.schemaProperty,scope.types); + if(scope.valueObjRef){ + scope.mapKeys = Object.keys(scope.valueObjRef); + } + }); + + //when user brows between properties in "edit property form" + scope.$watchCollection('fieldsPrefixName', (newData:any):void => { + if(!scope.valueObjRef) { + scope.valueObjRef={}; + } + scope.mapKeys = Object.keys(scope.valueObjRef); + + if($attr.defaultValue){ + scope.mapDefaultValue = JSON.parse($attr.defaultValue); + } + }); + + //return dummy array in order to prevent rendering map-keys ng-repeat again when a map key is changed + scope.getNumber = (num:number):Array => { + return new Array(num); + }; + + scope.getValidationPattern = (type:string):RegExp => { + return this.ValidationUtils.getValidationPattern(type); + }; + + scope.validateIntRange = (value:string):boolean => { + return !value || this.ValidationUtils.validateIntRange(value); + }; + + scope.changeKeyOfMap = (newKey:string, index:number, fieldName:string) : void => { + let oldKey = Object.keys(scope.valueObjRef)[index]; + if(Object.keys(scope.valueObjRef).indexOf(newKey)>-1){ + scope.parentFormObj[fieldName].$setValidity('keyExist', false); + }else{ + scope.parentFormObj[fieldName].$setValidity('keyExist', true); + if(!scope.parentFormObj[fieldName].$invalid){ + angular.copy(JSON.parse(JSON.stringify(scope.valueObjRef).replace('"'+oldKey+'":', '"'+newKey+'":')),scope.valueObjRef);//update key + } + } + }; + + scope.deleteMapItem=(index:number):void=>{ + delete scope.valueObjRef[scope.mapKeys[index]]; + scope.mapKeys.splice(index,1); + if (!scope.mapKeys.length) {//only when user removes all pairs of key-value fields - put the default + if ( scope.mapDefaultValue ) { + angular.copy(scope.mapDefaultValue, scope.valueObjRef); + scope.mapKeys = Object.keys(scope.valueObjRef); + } + } + }; + + scope.addMapItemFields = ():void => { + scope.valueObjRef['']= null; + scope.mapKeys = Object.keys(scope.valueObjRef); + }; + + scope.parseToCorrectType = (objectOfValues:any, locationInObj:string, type:string):void => { + if(objectOfValues[locationInObj] && type != Utils.Constants.PROPERTY_TYPES.STRING){ + objectOfValues[locationInObj] = JSON.parse(objectOfValues[locationInObj]); + } + } + }; + + public static factory = ($templateCache:ng.ITemplateCacheService, + DataTypesService:Sdc.Services.DataTypesService, + PropertyNameValidationPattern:RegExp, + ValidationUtils:Sdc.Utils.ValidationUtils, + $timeout: ng.ITimeoutService)=> { + return new TypeMapDirective($templateCache,DataTypesService,PropertyNameValidationPattern,ValidationUtils,$timeout); + }; + } + + TypeMapDirective.factory.$inject = ['$templateCache','Sdc.Services.DataTypesService','PropertyNameValidationPattern','ValidationUtils','$timeout']; +} diff --git a/catalog-ui/app/scripts/directives/punch-out/punch-out.ts b/catalog-ui/app/scripts/directives/punch-out/punch-out.ts new file mode 100644 index 0000000000..f00b7971a9 --- /dev/null +++ b/catalog-ui/app/scripts/directives/punch-out/punch-out.ts @@ -0,0 +1,99 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + export interface IPunchOutScope extends ng.IScope { + name: string; + data: any; + user: Models.IUserProperties; + onEvent: Function; + } + + export class PunchOutDirective implements ng.IDirective { + + constructor( + private sdcConfig: Sdc.Models.IAppConfigurtaion) {} + + scope = { + name: '=', + data: '=', + user: '=', + onEvent: '&' + }; + + replace = false; + restrict = 'E'; + + link = (scope: IPunchOutScope, element: ng.IAugmentedJQuery):void => { + // global registry object + let PunchOutRegistry = window['PunchOutRegistry']; + + let render = ():void => { + let cookieConfig = this.sdcConfig.cookie; + let props = { + name: scope.name, + options: { + data: scope.data, + apiRoot: this.sdcConfig.api.root, + apiHeaders: { + userId: { + name: cookieConfig.userIdSuffix, + value: scope.user.userId + }, + userFirstName: { + name: cookieConfig.userFirstName, + value: scope.user.firstName + }, + userLastName: { + name: cookieConfig.userLastName, + value: scope.user.lastName + }, + userEmail: { + name: cookieConfig.userEmail, + value: scope.user.email + } + } + }, + onEvent: (...args) => { + scope.$apply(() => { + scope.onEvent().apply(null, args); + }); + } + }; + PunchOutRegistry.render(props, element[0]); + }; + + let unmount = ():void => { + PunchOutRegistry.unmount(element[0]); + }; + + scope.$watch('data', render); + element.on('$destroy', unmount); + }; + + public static factory = (sdcConfig: Sdc.Models.IAppConfigurtaion) => { + return new PunchOutDirective(sdcConfig); + }; + + } + + PunchOutDirective.factory.$inject = ['sdcConfig']; +} diff --git a/catalog-ui/app/scripts/directives/sdc-tabs/sdc-single-tab/sdc-single-tab-directive.ts b/catalog-ui/app/scripts/directives/sdc-tabs/sdc-single-tab/sdc-single-tab-directive.ts new file mode 100644 index 0000000000..26390a7501 --- /dev/null +++ b/catalog-ui/app/scripts/directives/sdc-tabs/sdc-single-tab/sdc-single-tab-directive.ts @@ -0,0 +1,67 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export class SdcSingleTabDirective implements ng.IDirective { + + constructor(private $compile:ng.ICompileService, private $parse:ng.IParseService) { + } + restrict = 'E'; + + link = (scope, elem:any, attrs:any, ctrl:any) => { + if(!elem.attr('inner-sdc-single-tab')) { + let name = this.$parse(elem.attr('ctrl'))(scope); + elem = elem.removeAttr('ctrl'); + elem.attr('inner-sdc-single-tab', name); + this.$compile(elem)(scope); + } + }; + + public static factory = ($compile:ng.ICompileService, $parse:ng.IParseService)=> { + return new SdcSingleTabDirective($compile, $parse); + }; + } + + export class InnerSdcSingleTabDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService) { + } + + scope = { + singleTab: "=", + isViewOnly: "=" + }; + + replace = true; + restrict = 'A'; + controller = '@'; + template = '
      '; + + public static factory = ($templateCache:ng.ITemplateCacheService)=> { + return new InnerSdcSingleTabDirective($templateCache); + }; + } + + SdcSingleTabDirective.factory.$inject = ['$compile', '$parse']; + InnerSdcSingleTabDirective.factory.$inject = ['$templateCache']; + +} diff --git a/catalog-ui/app/scripts/directives/sdc-tabs/sdc-single-tab/sdc-single-tab.less b/catalog-ui/app/scripts/directives/sdc-tabs/sdc-single-tab/sdc-single-tab.less new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/catalog-ui/app/scripts/directives/sdc-tabs/sdc-single-tab/sdc-single-tab.less @@ -0,0 +1 @@ + diff --git a/catalog-ui/app/scripts/directives/sdc-tabs/sdc-tabs-directive-view.html b/catalog-ui/app/scripts/directives/sdc-tabs/sdc-tabs-directive-view.html new file mode 100644 index 0000000000..d51d221922 --- /dev/null +++ b/catalog-ui/app/scripts/directives/sdc-tabs/sdc-tabs-directive-view.html @@ -0,0 +1,17 @@ +
      +
      +
      + +
      +
      +
      +
      +
      +
      +
      +
      + +
      +
      diff --git a/catalog-ui/app/scripts/directives/sdc-tabs/sdc-tabs-directive.ts b/catalog-ui/app/scripts/directives/sdc-tabs/sdc-tabs-directive.ts new file mode 100644 index 0000000000..91d1744ae5 --- /dev/null +++ b/catalog-ui/app/scripts/directives/sdc-tabs/sdc-tabs-directive.ts @@ -0,0 +1,69 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 7/28/2016. + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface ISdcTabsDirectiveScope extends ng.IScope { + tabs:Array; + selectedTab: Models.Tab; + isActive: boolean; + onTabSelected(selectedTab: Models.Tab); + } + + export class SdcTabsDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService) { + } + + scope = { + tabs: "=", + selectedTab: "=?", + isViewOnly: "=" + }; + + replace = true; + restrict = 'E'; + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/sdc-tabs/sdc-tabs-directive-view.html'); + }; + + link = (scope:ISdcTabsDirectiveScope) => { + scope.isActive = true; + + if(!scope.selectedTab){ + scope.selectedTab = scope.tabs[0]; + } + + scope.onTabSelected = (selectedTab: Models.Tab) => { + scope.selectedTab = selectedTab; + } + }; + + public static factory = ($templateCache:ng.ITemplateCacheService)=> { + return new SdcTabsDirective($templateCache); + }; + } + + SdcTabsDirective.factory.$inject = ['$templateCache']; +} diff --git a/catalog-ui/app/scripts/directives/sdc-tabs/sdc-tabs.less b/catalog-ui/app/scripts/directives/sdc-tabs/sdc-tabs.less new file mode 100644 index 0000000000..ad390010ed --- /dev/null +++ b/catalog-ui/app/scripts/directives/sdc-tabs/sdc-tabs.less @@ -0,0 +1,68 @@ +.sdc-tabs-body { + height: 100%; + width: 330px; + position: absolute; + .sdc-tabs { + display: inline-block; + width: 40px; + vertical-align: top; + position: relative; + z-index: 99; + right: 332px; + .sdc-tab-arrow { + cursor: pointer; + width: 40px; + height: 20px; + background-color: @tlv_color_u; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.17); + text-align: center; + padding: 1px 4px 0px 0px; + + &:hover { + background-color: @main_color_o; + } + + } + .sdc-tab { + cursor: pointer; + width: 40px; + height: 43px; + background-color: @tlv_color_u; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.17); + text-align: center; + + .sdc-tab-icon { + margin-top: 12px; + } + } + .selected { + background-color: @tlv_color_t; + } + + .last-tab { + border-bottom-left-radius: 12px; + } + } + + .not-active { + // position: absolute; + right: 41px; + } + + .sdc-single-tab-content { + padding: 15px 0px 0px 0px; + width: 290px; + background-color: @tlv_color_t; + height: 100%; + display: inline-block; + bottom: 0; + top: 0; + position: absolute; + box-shadow: 0.3px 1px 3px rgba(24, 24, 25, 0.42); + right: 331px; + .sdc-single-tab-content-body { + height: 100%; + display: flex; + } + } +} diff --git a/catalog-ui/app/scripts/directives/structure-tree/structure-tree-directive.html b/catalog-ui/app/scripts/directives/structure-tree/structure-tree-directive.html new file mode 100644 index 0000000000..7d8a883b33 --- /dev/null +++ b/catalog-ui/app/scripts/directives/structure-tree/structure-tree-directive.html @@ -0,0 +1,54 @@ +
      +
      +
      +
      {{structureTree.serviceRoot.name}}
      +
      +
        +
      • +
        +
        +
        +
        +
        +
        {{firstLevelResourcesInstances.name}}
        +
        +
          +
        • +
          +
          +
          +
          +
          +
          {{secondLevelResourcesInstances.name}}
          +
          +
            +
          • +
            +
            +
            +
            +
            +
            {{thirdLevelResourcesInstances.name}}
            +
            +
              +
            • +
              +
              +
              +
              +
              +
              {{forthLevelResourcesInstances.name}}
              +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
      diff --git a/catalog-ui/app/scripts/directives/structure-tree/structure-tree-directive.less b/catalog-ui/app/scripts/directives/structure-tree/structure-tree-directive.less new file mode 100644 index 0000000000..094c3f70ba --- /dev/null +++ b/catalog-ui/app/scripts/directives/structure-tree/structure-tree-directive.less @@ -0,0 +1,68 @@ +.structure-tree{ + padding: 9px 0px 10px 30px; + position: relative; + ul{ + position: relative; + list-style: none; + padding-left:25px; + ::before{ + content: ""; + position: absolute; + left: -27px; + } + ::after{ + content: ""; + position: absolute; + left: -27px; + } + li{ + position: relative; + &::before{ + border-top: 1px solid #666666; + top: 20px; + width: 10px; + height: 0; + } + &::after{ + border-left: 1px solid #666666; + height: 100%; + width: 0px; + top: -2px; + } + &:last-child::after{ + height: 23px + } + } + } + .component-container{ + display: inline-block; + margin: 6px 0px 0px -16px; + } + .component-container-icon{ + display: inline-block; + } + .component-container-text{ + padding-left: 8px; + float: right; + + text-overflow: ellipsis; + max-width:120px; + display: inline-block; + white-space: nowrap; + font-size: 13px; + color: #666666;; + overflow: hidden; + line-height: 28px; + float: none; + } + + .non-certified{ + position: relative; + left: 18px; + bottom: 8px; + .sprite; + .s-sdc-state-non-certified; + display:block; + } + +} diff --git a/catalog-ui/app/scripts/directives/structure-tree/structure-tree-directive.ts b/catalog-ui/app/scripts/directives/structure-tree/structure-tree-directive.ts new file mode 100644 index 0000000000..1edce6f36e --- /dev/null +++ b/catalog-ui/app/scripts/directives/structure-tree/structure-tree-directive.ts @@ -0,0 +1,197 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + + export interface IStructureTreeScope extends ng.IScope { + + component: Models.Components.Component; + structureTree: StructureTree; + } + + class StructureTree { + + serviceRoot:ResourceInstanceNode; + + constructor(private uniqueId:string, private resourceInstanceName:string, private resourceInstanceIcon:string, private certified:boolean) { + this.serviceRoot = new ResourceInstanceNode(uniqueId, resourceInstanceName, resourceInstanceIcon, certified); + } + + } + + class ResourceInstanceNode { + id:string; + icon:string; + name:string; + resourceInstancesList:Array; + isAlreadyInTree:boolean; + certified:boolean; + + + constructor(private uniqueId:string, private resourceInstanceName:string, private resourceInstanceIcon:string, certified:boolean) { + this.id = uniqueId; + this.name = resourceInstanceName; + this.icon = resourceInstanceIcon; + this.resourceInstancesList = []; + this.isAlreadyInTree = false; + this.certified = certified; + } + } + + export class StructureTreeDirective implements ng.IDirective { + + + constructor(private $templateCache:ng.ITemplateCacheService) { + } + + scope = { + component: '=', + }; + restrict = 'E'; + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/structure-tree/structure-tree-directive.html'); + }; + + link = (scope:IStructureTreeScope, $elem:any) => { + + let RESOURCE_INSTANCE_LIST:string = "resourceInstancesChildesList"; + let resourceInstanceMap:Utils.Dictionary; + let relations:Array; + //************* Start Building Tree Functions *******************// + + //remove unnecessary instances + let initResourceInstanceMap = ():void => { + + resourceInstanceMap = new Utils.Dictionary(); + + _.forEach(scope.component.componentInstances, (resourceInstance:Models.ComponentsInstances.ComponentInstance)=> { + if (_.some(Object.keys(resourceInstance.capabilities), (key:string)=> { + return 'tosca.capabilities.container' == key.toLowerCase(); + }) || _.some(Object.keys(resourceInstance.requirements),(key:string)=> { + return 'tosca.capabilities.container' == key.toLowerCase(); + })) { + + let isCertified = 0 === (parseFloat(resourceInstance.componentVersion) % 1); + let node:ResourceInstanceNode = new ResourceInstanceNode(resourceInstance.uniqueId, + resourceInstance.name, + resourceInstance.icon, + isCertified); + resourceInstanceMap.setValue(resourceInstance.uniqueId, node); + } + }); + }; + + //remove unnecessary relations + let initRelations = ():void => { + relations = _.filter(scope.component.componentInstancesRelations, (relation:Models.RelationshipModel)=> { + return resourceInstanceMap.containsKey(relation.fromNode) && resourceInstanceMap.containsKey(relation.toNode); + }); + }; + + let buildTree = ():void => { + if (scope.component) { + scope.structureTree = new StructureTree(scope.component.uniqueId, scope.component.name, scope.component.icon, 'CERTIFIED' === scope.component.lifecycleState); + initResourceInstanceMap(); + initRelations(); + + let parentNodesList = _.groupBy(relations, (node:any)=> { + return node.fromNode; + }); + + for (let parent in parentNodesList) { + _.forEach(parentNodesList[parent], (childNode)=> { + parentNodesList[parent][RESOURCE_INSTANCE_LIST] = []; + parentNodesList[parent][RESOURCE_INSTANCE_LIST].push(mergeAllSubtrees(childNode, parentNodesList)); + }); + } + + //add the resourceInstanceList for the service root node + for (let parent in parentNodesList) { + let resourceInstanceNode:ResourceInstanceNode = resourceInstanceMap.getValue(parent); + resourceInstanceNode.resourceInstancesList = parentNodesList[parent]; + resourceInstanceNode.resourceInstancesList = parentNodesList[parent][RESOURCE_INSTANCE_LIST]; + resourceInstanceNode.isAlreadyInTree = true; + scope.structureTree.serviceRoot.resourceInstancesList.push(resourceInstanceNode); + } + + // Add all node that have no connection to the rootNode + resourceInstanceMap.forEach((key:string, value:ResourceInstanceNode) => { + if (!value.isAlreadyInTree) { + scope.structureTree.serviceRoot.resourceInstancesList.push(value); + } + }); + } + }; + + //this recursion is merging all the subtrees + let mergeAllSubtrees = (connectionData:any, parentNodesList:any):ResourceInstanceNode => { + let resourceInstanceNode:ResourceInstanceNode = resourceInstanceMap.getValue(connectionData.toNode); + resourceInstanceNode.isAlreadyInTree = true; + if (parentNodesList[resourceInstanceNode.id]) { + if (parentNodesList[resourceInstanceNode.id][RESOURCE_INSTANCE_LIST]) { + resourceInstanceNode.resourceInstancesList = parentNodesList[resourceInstanceNode.id][RESOURCE_INSTANCE_LIST]; + } + else { + _.forEach(parentNodesList[resourceInstanceNode.id], (children)=> { + resourceInstanceNode.resourceInstancesList.push(mergeAllSubtrees(children, parentNodesList)); + }); + } + delete parentNodesList[resourceInstanceNode.id]; + } + return resourceInstanceNode; + }; + //************* End Building Tree Functions *******************// + + //************* Start Watchers *******************// + scope.$watch('component.name', ():void => { + if (scope.structureTree) + scope.structureTree.serviceRoot.name = scope.component.name; + }); + + scope.$watch('component.icon', ():void => { + if (scope.structureTree) + scope.structureTree.serviceRoot.icon = scope.component.icon; + }); + + scope.$watchCollection('component.componentInstancesRelations', ():void => { + buildTree(); + }); + + scope.$watchCollection('component.componentInstances', ():void => { + buildTree(); + }); + + //************* End Watchers *******************// + + buildTree(); + + }; + + + public static factory = ($templateCache:ng.ITemplateCacheService) => { + return new StructureTreeDirective($templateCache); + }; + } + + StructureTreeDirective.factory.$inject = ['$templateCache']; + +} diff --git a/catalog-ui/app/scripts/directives/tag/tag-directive.html b/catalog-ui/app/scripts/directives/tag/tag-directive.html new file mode 100644 index 0000000000..28c22a7978 --- /dev/null +++ b/catalog-ui/app/scripts/directives/tag/tag-directive.html @@ -0,0 +1,10 @@ +
      +
      +
      + +
      + +
      + +
      +
      diff --git a/catalog-ui/app/scripts/directives/tag/tag-directive.less b/catalog-ui/app/scripts/directives/tag/tag-directive.less new file mode 100644 index 0000000000..f72e366ac6 --- /dev/null +++ b/catalog-ui/app/scripts/directives/tag/tag-directive.less @@ -0,0 +1,51 @@ +.sdc-tag{ + + background-color:#F2F2F2 ; + .border-radius(4px); + min-width:150px; + height:30px; + display: flex; + align-items: center; + padding: 0 10px; + margin: 2px; + + .tag{ + display: inline-block; + } + + .category{ + margin-right: 4px; + margin-left: 25px; + width: 25px; + + } + .relation-categoty-icon{ + .sprite; + .sprite.relation-icon; + .hand; + vertical-align: middle; + + } + + .relation-categoty-icon:hover{ + .sprite; + .sprite.relation-icon-hover; + } + + .delete{ + + } + .delete-icon{ + .sprite; + .sprite.x-btn-black; + .hand; + vertical-align: middle; + } +} + +.tag-tooltip-wrap { + background-color: rgba(80, 99, 113, 0.9); + position: relative; + display: inline-block; + margin: -5px -14px 0px -14px; +} diff --git a/catalog-ui/app/scripts/directives/tag/tag-directive.ts b/catalog-ui/app/scripts/directives/tag/tag-directive.ts new file mode 100644 index 0000000000..64d245e242 --- /dev/null +++ b/catalog-ui/app/scripts/directives/tag/tag-directive.ts @@ -0,0 +1,71 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export class TagData { + tag:string; + tooltip:string; + id: string; + } + + export interface ITagScope extends ng.IScope { + tagData: TagData; + onDelete: Function; + delete:Function; + hideTooltip:boolean; + hideDelete:boolean; + sdcDisable: boolean; + } + + export class TagDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService) { + } + + scope = { + tagData: '=', + onDelete: '&', + hideTooltip: '=', + hideDelete: '=', + sdcDisable: '=' + }; + + replace = true; + restrict = 'EA'; + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/tag/tag-directive.html'); + }; + + link = (scope:ITagScope) => { + scope.delete = ()=>{ + scope.onDelete({'uniqueId':scope.tagData.id}); + } + }; + + public static factory = ($templateCache:ng.ITemplateCacheService)=> { + return new TagDirective($templateCache); + }; + + } + + TagDirective.factory.$inject = ['$templateCache']; +} diff --git a/catalog-ui/app/scripts/directives/tutorial/image-template.html b/catalog-ui/app/scripts/directives/tutorial/image-template.html new file mode 100644 index 0000000000..7e7f7af356 --- /dev/null +++ b/catalog-ui/app/scripts/directives/tutorial/image-template.html @@ -0,0 +1,7 @@ + +
      +
      +

      +

      +
      +
      diff --git a/catalog-ui/app/scripts/directives/tutorial/text-template.html b/catalog-ui/app/scripts/directives/tutorial/text-template.html new file mode 100644 index 0000000000..dc1173be64 --- /dev/null +++ b/catalog-ui/app/scripts/directives/tutorial/text-template.html @@ -0,0 +1,4 @@ + +

      +

      +
      diff --git a/catalog-ui/app/scripts/directives/tutorial/tutorial-directive.html b/catalog-ui/app/scripts/directives/tutorial/tutorial-directive.html new file mode 100644 index 0000000000..191752fc1f --- /dev/null +++ b/catalog-ui/app/scripts/directives/tutorial/tutorial-directive.html @@ -0,0 +1,22 @@ +
      +
      +
      +
      +
      +
      + +
      +
      + +
      + + +
      +
      diff --git a/catalog-ui/app/scripts/directives/tutorial/tutorial-directive.less b/catalog-ui/app/scripts/directives/tutorial/tutorial-directive.less new file mode 100644 index 0000000000..410a54e9c1 --- /dev/null +++ b/catalog-ui/app/scripts/directives/tutorial/tutorial-directive.less @@ -0,0 +1,213 @@ +.sdc-tutorial-page { + + width: 100%; + height: 100%; + background-color: rgba(0,0,0,0.8); + + display: flex; + align-items: center; + justify-content: center; + position: absolute; + top: 0; + left: 0; + z-index: 3000; + + .sdc-tutorial-container-wrapper { + display: flex; + flex-direction: column; + } + + .sdc-tutorial-container { + .bg_c; + width: 830px; + height: 466px; + box-shadow: 1px 2px 2px 0px rgba(0, 0, 0, 0.35); + } + + .sdc-tutorial-container-tabs { + height: 56px; + display: flex; + flex-direction: row; + } + + .sdc-tutorial-container-tab { + .a_6; + flex-grow: 1; + align-items: center; + justify-content: center; + display: flex; + height: 56px; + position: relative; + opacity: 0.8; + + span { + .hand; + } + + &::after { + content: ''; + display: block; + border-right: solid 1px ; + border-color: rgba(59, 123, 155, 0.31); + height: 28px; + right: 0; + position: absolute; + top: 14px; //(56-28)/2 + width: 1px; + } + + &:last-child:after { + display: none; + } + + &.selected { + opacity: 1; + .bold; + } + + } + + .sdc-tutorial-container-content { + .bg_a; + .perfect-scrollbar; + display: flex; + align-items: center; + height: 410px; + } + + .sdc-tutorial-skip { + .c_1; + .hand; + text-align: right; + margin-bottom: 9px; + } + + .sdc-tutorial-footer { + .c_4; + margin-top: 9px; + + .sdc-tutorial-footer-prev-button { + float: left; + position: relative; + padding-left: 14px; + .noselect; + + span { + .hand; + &::before { + content: '<'; + display: block; + position: absolute; + left: 0; + top: 0; + } + } + } + + .sdc-tutorial-footer-page-counter { + .e_3; + position: absolute; + left: 50%; + margin-top: 2px; + cursor: default; + .noselect; + + .selected { + .c_3; + .bold; + margin-right: 2px; + } + + .total { + margin-left: 2px; + } + } + + .sdc-tutorial-footer-next-button { + float: right; + position: relative; + padding-right: 14px; + .noselect; + + span { + .hand; + + &::after { + content: '>'; + display: block; + position: absolute; + right: 0; + top: 0; + } + } + } + + } + +} + +///////////////// TEXT TEMPLATE +.sdc-tutorial-text-template { + + padding: 20px 65px; + + h1 { + .c_15; + margin-top: 0; + } + + p { + .c_10; + } +} + +///////////////// IMAGE TEMPLATE +.sdc-tutorial-image-template { + + .sdc-tutorial-image-template-text { + padding: 16px 38px; + height: 118px; + h1 { + .c_11; + margin: 0 0 4px 0; + } + + p { + .c_4; + font-weight: 300; + line-height: 21px; + } + + } + + .sdc-tutorial-page-2-image { background: transparent url('../../../styles/images/tutorial/2.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-3-image { background: transparent url('../../../styles/images/tutorial/3.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-4-image { background: transparent url('../../../styles/images/tutorial/4.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-5-image { background: transparent url('../../../styles/images/tutorial/5.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-6-image { background: transparent url('../../../styles/images/tutorial/6.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-7-image { background: transparent url('../../../styles/images/tutorial/7.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-8-image { background: transparent url('../../../styles/images/tutorial/8.png') no-repeat 0 0; width: 830px; height: 292px;} + + .sdc-tutorial-page-10-image { background: transparent url('../../../styles/images/tutorial/10.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-11-image { background: transparent url('../../../styles/images/tutorial/11.png') no-repeat 0 0; width: 830px; height: 292px;} + + .sdc-tutorial-page-13-image { background: transparent url('../../../styles/images/tutorial/13.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-14-image { background: transparent url('../../../styles/images/tutorial/14.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-15-image { background: transparent url('../../../styles/images/tutorial/15.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-16-image { background: transparent url('../../../styles/images/tutorial/16.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-17-image { background: transparent url('../../../styles/images/tutorial/17.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-18-image { background: transparent url('../../../styles/images/tutorial/18.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-19-image { background: transparent url('../../../styles/images/tutorial/19.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-20-image { background: transparent url('../../../styles/images/tutorial/20.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-21-image { background: transparent url('../../../styles/images/tutorial/21.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-22-image { background: transparent url('../../../styles/images/tutorial/22.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-23-image { background: transparent url('../../../styles/images/tutorial/23.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-24-image { background: transparent url('../../../styles/images/tutorial/24.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-25-image { background: transparent url('../../../styles/images/tutorial/25.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-26-image { background: transparent url('../../../styles/images/tutorial/26.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-27-image { background: transparent url('../../../styles/images/tutorial/27.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-28-image { background: transparent url('../../../styles/images/tutorial/28.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-29-image { background: transparent url('../../../styles/images/tutorial/29.png') no-repeat 0 0; width: 830px; height: 292px;} + .sdc-tutorial-page-30-image { background: transparent url('../../../styles/images/tutorial/30.png') no-repeat 0 0; width: 830px; height: 292px;} + +} diff --git a/catalog-ui/app/scripts/directives/tutorial/tutorial-directive.ts b/catalog-ui/app/scripts/directives/tutorial/tutorial-directive.ts new file mode 100644 index 0000000000..7df35cade9 --- /dev/null +++ b/catalog-ui/app/scripts/directives/tutorial/tutorial-directive.ts @@ -0,0 +1,147 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + export interface ITutorialScope extends ng.IScope { + showTutorial:boolean; + isFirstTime:boolean; + templateUrl:string; + totalPages: number; + currentPageIndex: number; + page:number; + tabs:Array; + tutorialData:any; + pageObject:any; + + initPage:Function; + next:Function; + previous:Function; + hasNext():boolean; + hasPrevious():boolean; + closeTutorial:Function; + closeAndShowLastPage:Function; + } + + export class TutorialDirective implements ng.IDirective { + + constructor( + private $templateCache:ng.ITemplateCacheService, + private sdcConfig:Models.IAppConfigurtaion, + private $state:ng.ui.IStateService + ) { + } + + scope = { + page: '=', + showTutorial: '=', + isFirstTime: '=' + }; + + replace = false; + restrict = 'EA'; + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/tutorial/tutorial-directive.html'); + }; + + link = (scope:ITutorialScope, $elem:any) => { + + let findPageIndex:Function = (pageId:number):number=> { + for (let i:number=0;i { + scope.pageObject = scope.tutorialData.pages[scope.currentPageIndex]; + scope.templateUrl = '/app/scripts/directives/tutorial/' + scope.pageObject.template + '.html'; + } + + scope.tutorialData = this.sdcConfig.tutorial; + + scope.closeTutorial = ()=> { + scope.showTutorial = false; + if(scope.isFirstTime){ + scope.isFirstTime=false; + } + } + + scope.closeAndShowLastPage = ()=> { + if(scope.isFirstTime){ + this.$state.go('dashboard.tutorial-end'); + } + scope.closeTutorial(); + } + + let init:Function = ():void => { + scope.tabs = scope.tutorialData.tabs; + scope.totalPages = scope.tutorialData.pages.length; + scope.initPage(scope.page); + + } + + scope.initPage = (pageId) => { + scope.currentPageIndex = findPageIndex(pageId); + showCurrentPage(); + } + + scope.next = ():void => { + if (scope.hasNext()){ + scope.currentPageIndex++; + showCurrentPage(); + } + } + + scope.previous = ():void => { + if (scope.hasPrevious()){ + scope.currentPageIndex--; + showCurrentPage(); + } + } + + scope.hasNext = ():boolean => { + return (scope.currentPageIndex+1) < scope.totalPages; + } + + scope.hasPrevious = ():boolean => { + return scope.currentPageIndex>0; + } + + angular.element(document).ready(function () { + init(); + }); + + scope.$watch('showTutorial', (showTutorial:any):void => { + scope.initPage(scope.page); + }); + + }; + + public static factory = ($templateCache:ng.ITemplateCacheService, sdcConfig:Models.IAppConfigurtaion, $state:ng.ui.IStateService)=> { + return new TutorialDirective($templateCache, sdcConfig, $state); + }; + + } + + TutorialDirective.factory.$inject = ['$templateCache', 'sdcConfig', '$state']; +} diff --git a/catalog-ui/app/scripts/directives/user-header-details/user-header-details-directive.html b/catalog-ui/app/scripts/directives/user-header-details/user-header-details-directive.html new file mode 100644 index 0000000000..1c99a18ab5 --- /dev/null +++ b/catalog-ui/app/scripts/directives/user-header-details/user-header-details-directive.html @@ -0,0 +1,9 @@ +
      +
      +
      +
      +
      + +
      + +
      diff --git a/catalog-ui/app/scripts/directives/user-header-details/user-header-details-directive.less b/catalog-ui/app/scripts/directives/user-header-details/user-header-details-directive.less new file mode 100644 index 0000000000..a14db7c6ee --- /dev/null +++ b/catalog-ui/app/scripts/directives/user-header-details/user-header-details-directive.less @@ -0,0 +1,62 @@ +.w-sdc-header-user-container { + .b_7; + width: 400px; + .flex-fixed(400px); + padding: 0 23px; + display: flex; + justify-content: flex-end; +} + +.w-sdc-header-user-icon { + background: no-repeat url('../../../styles/images/anonymous.jpg'); + border-radius: 50%; + height: 47px; + width: 47px; + background-size: cover; + border: solid 2px @color_m; + .flex-fixed(47px); +} + +.w-sdc-header-user-details { + padding: 4px 4px 4px 14px; + .vcenter; +} + +.w-sdc-header-user-name { + max-width: 160px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + vertical-align: bottom; + + .bold; + display: inline-block; +} + +.w-sdc-header-user-role { + .bold; + display: inline-block; + margin-left: 6px; + + &:before { + content: ''; + margin-right: 8px; + border-left: 1px solid @color_m; + } +} + +.w-sdc-header-user-last-login { + .font-type._3; + display: block; +} + +.w-sdc-header-logout-icon { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAUCAYAAACAl21KAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjE5RjgxM0QxMDgzQTExRTVBQzA2OTg5ODlFNDVBNTZDIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjE5RjgxM0QyMDgzQTExRTVBQzA2OTg5ODlFNDVBNTZDIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MTlGODEzQ0YwODNBMTFFNUFDMDY5ODk4OUU0NUE1NkMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MTlGODEzRDAwODNBMTFFNUFDMDY5ODk4OUU0NUE1NkMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6Riq1bAAAA20lEQVR42mJ0CUv+z0Aa+AvEertXzrmGLMgCpZcD8S4iDfoDxHfQBWEGnQLasICBAsDEQCUwcAa5hqeEAHEKNVykB8SzgYZVUGpQPRDPAOJ2oGHNZBsEjF1QussC4mlAXAM0rAM5+tHDwQJIVRBh7m0gLgeql6ZarLHgcP4JIBWAJ+YYgdQUIPYH4k6g+gpyop8RGj6gcGoGGYLTRQRAIxBnAHEl0JAOvF4jAC4BcSrQkDkEw4hA9K8ZGpkW5jUzYGwkkFCwrQJ68Rc2gyKhmNii9hwQoxS1AAEGAO5PP/+ClIDAAAAAAElFTkSuQmCC'); + height: 20px; + width: 18px; + position: absolute; + right: 20px; + top: 29px; +} + + diff --git a/catalog-ui/app/scripts/directives/user-header-details/user-header-details-directive.ts b/catalog-ui/app/scripts/directives/user-header-details/user-header-details-directive.ts new file mode 100644 index 0000000000..46c43a266b --- /dev/null +++ b/catalog-ui/app/scripts/directives/user-header-details/user-header-details-directive.ts @@ -0,0 +1,72 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + export interface IUserHeaderDetailsScope extends ng.IScope { + name: string; + role: string; + iconUrl: string; + UserResourceClass:Services.IUserResourceClass; + user: Models.IUser; + sdcConfig:Models.IAppConfigurtaion; + initUser:Function; + } + + export class UserHeaderDetailsDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService, private $http:ng.IHttpService, private sdcConfig:Models.IAppConfigurtaion, private UserResourceClass:Services.IUserResourceClass) { + } + + scope = { + iconUrl: '=?' + }; + + replace = true; + restrict = 'E'; + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/user-header-details/user-header-details-directive.html'); + }; + + link = (scope:IUserHeaderDetailsScope) => { + + scope.initUser = ():void => { + let defaultUserId:string; + let user:Services.IUserResource = this.UserResourceClass.getLoggedinUser(); + if (!user) { + defaultUserId = this.$http.defaults.headers.common[this.sdcConfig.cookie.userIdSuffix]; + user = this.UserResourceClass.get({id: defaultUserId}, ():void => { + scope.user = new Models.User(user); + }); + } else { + scope.user = new Models.User(user); + } + }; + scope.initUser(); + }; + + public static factory = ($templateCache:ng.ITemplateCacheService, $http:ng.IHttpService, sdcConfig:Models.IAppConfigurtaion, UserResourceClass:Services.IUserResourceClass)=> { + return new UserHeaderDetailsDirective($templateCache, $http, sdcConfig, UserResourceClass); + }; + + } + + UserHeaderDetailsDirective.factory.$inject = ['$templateCache', '$http', 'sdcConfig', 'Sdc.Services.UserResourceService']; +} diff --git a/catalog-ui/app/scripts/directives/utils/expand-collapse-menu-box/expand-collaps-menu-box.ts b/catalog-ui/app/scripts/directives/utils/expand-collapse-menu-box/expand-collaps-menu-box.ts new file mode 100644 index 0000000000..9756ff9e49 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/expand-collapse-menu-box/expand-collaps-menu-box.ts @@ -0,0 +1,66 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + export interface IExpandCollapseMenuBoxDirectiveScope extends ng.IScope { + menuItemsGroup: Utils.MenuItemGroup; + menuTitle: string; + parentScope: ng.IScope; + onMenuItemClick(menuItem: Utils.MenuItem):void; + } + + export class ExpandCollapseMenuBoxDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService) { + } + + scope = { + menuTitle: '@', + menuItemsGroup: '=', + parentScope: '=' + }; + + public replace = false; + public restrict = 'AE'; + public transclude = true; + + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/utils/expand-collapse-menu-box/expand-collapse-menu-box.html'); + }; + + link = (scope:IExpandCollapseMenuBoxDirectiveScope, $elem:any) => { + scope.onMenuItemClick = (menuItem: Utils.MenuItem):void => { + let onSuccess = ():void => { + scope.menuItemsGroup.selectedIndex = scope.menuItemsGroup.menuItems.indexOf(menuItem); + }; + let onFailed = ():void => {}; + scope.parentScope[menuItem.action](menuItem.state).then(onSuccess, onFailed); + } + }; + + public static factory = ($templateCache:ng.ITemplateCacheService)=> { + return new ExpandCollapseMenuBoxDirective($templateCache); + }; + + } + + ExpandCollapseMenuBoxDirective.factory.$inject = ['$templateCache']; +} diff --git a/catalog-ui/app/scripts/directives/utils/expand-collapse-menu-box/expand-collapse-menu-box.html b/catalog-ui/app/scripts/directives/utils/expand-collapse-menu-box/expand-collapse-menu-box.html new file mode 100644 index 0000000000..bbd7e59e7c --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/expand-collapse-menu-box/expand-collapse-menu-box.html @@ -0,0 +1,15 @@ +
      + +
      + +
      + +
      +
      +
      {{menuItem.text}}
      +
      +
      + +
      + diff --git a/catalog-ui/app/scripts/directives/utils/expand-collapse-menu-box/expand-collapse-menu-box.less b/catalog-ui/app/scripts/directives/utils/expand-collapse-menu-box/expand-collapse-menu-box.less new file mode 100644 index 0000000000..d8ceeaea71 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/expand-collapse-menu-box/expand-collapse-menu-box.less @@ -0,0 +1,55 @@ +.expand-collapse-menu-box { + line-height: 20px; + padding: 13px 0px 5px 10px; + background-color: @func_color_r; + margin: 3px 3px 5px 0px; + + + .expand-collapse-menu-box-title { + .f-type._18_m; + color: @main_color_m; + font-weight: bold; + .hand; + .w-sdc-designer-sidebar-section-title-text{ + max-width: 185px; + overflow: hidden; + text-overflow: ellipsis; + display: inline-block; + white-space: nowrap; + } + + &.expanded { + .expand-collapse-menu-box-title-icon { + transform: rotate(180deg); + } + } + } + .expand-collapse-menu-box-title-icon { + .hand; + .sprite-new; + .arrow-up; + margin-right: 6px; + transition: .3s all; + position: relative; + + } + .w-sdc-designer-sidebar-section-content { + overflow: hidden; + padding-top: 13px; + .expand-collapse-menu-box-item { + .hand; + padding-left: 14px; + margin: 0px 0px 10px 10px; + font-family: @font-omnes-medium; + color: @main_color_m; + + line-height: 18px; + &.selected { + padding-left: 10px; + font-weight: bold; + border-left: 4px solid @main_color_a; + } + + } + } +} diff --git a/catalog-ui/app/scripts/directives/utils/expand-collapse/expand-collapse.html b/catalog-ui/app/scripts/directives/utils/expand-collapse/expand-collapse.html new file mode 100644 index 0000000000..a2358ea2b7 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/expand-collapse/expand-collapse.html @@ -0,0 +1 @@ + diff --git a/catalog-ui/app/scripts/directives/utils/expand-collapse/expand-collapse.less b/catalog-ui/app/scripts/directives/utils/expand-collapse/expand-collapse.less new file mode 100644 index 0000000000..d0d8fa3251 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/expand-collapse/expand-collapse.less @@ -0,0 +1,10 @@ +.ellipsis-directive-more-less { + .a_9; + .bold; + .hand; + float: right; + margin-right: 10px; + line-height: 23px; + text-decoration: underline; + text-align: left; +} diff --git a/catalog-ui/app/scripts/directives/utils/expand-collapse/expand-collapse.ts b/catalog-ui/app/scripts/directives/utils/expand-collapse/expand-collapse.ts new file mode 100644 index 0000000000..b294da6c13 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/expand-collapse/expand-collapse.ts @@ -0,0 +1,136 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + export interface IExpandCollapseScope extends ng.IScope { + toggle(): void; + collapsed: boolean; + expandedSelector: string; + content:string; + isCloseOnInit:boolean; + loadDataFunction: Function; + isLoadingData: boolean; + } + + export class ExpandCollapseDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService) { + } + + scope = { + expandedSelector: '@', + loadDataFunction: '&?', + isCloseOnInit: '=?' + }; + + public replace = false; + public restrict = 'AE'; + public transclude = true; + + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/utils/expand-collapse/expand-collapse.html'); + }; + + link = (scope:IExpandCollapseScope, $elem:any) => { + scope.collapsed = false; + scope.isLoadingData = false; + $elem.addClass('expanded'); + + + if(scope.isCloseOnInit) { + window.setTimeout(function () { + toggle(); + },0); + } + + $elem.click(function(){ + toggle(); + }); + + let expand = ():void => { + $elem.addClass('expanded'); + scope.collapsed = false; + + let element = $(scope.expandedSelector)[0]; + let prevWidth = element.style.height; + element.style.height = 'auto'; + let endWidth = getComputedStyle(element).height; + element.style.height = prevWidth; + element.offsetHeight; // force repaint + element.style.transition = 'height .3s ease-in-out'; + element.style.height = endWidth; + element.hidden = false; + element.addEventListener('transitionend', function transitionEnd(event) { + if (event['propertyName'] == 'height') { + element.style.transition = ''; + element.style.height = 'auto'; + element.removeEventListener('transitionend', transitionEnd, false); + } + }, false) + }; + + let collapse = ():void => { + $elem.removeClass('expanded'); + scope.collapsed = true; + + let element = $(scope.expandedSelector)[0]; + element.style.height = getComputedStyle(element).height; + element.style.transition = 'height .5s ease-in-out'; + element.offsetHeight; // force repaint + element.style.height = '0px'; + element.hidden = true; + }; + + let toggle = ():void => { + if (scope.collapsed === true){ + if(scope.loadDataFunction) { + scope.isLoadingData = true; + let onSuccess = () => { + window.setTimeout(function () { + expand(); + scope.isLoadingData = false; + },0); + }; + scope.loadDataFunction().then(onSuccess); + } + else { + if(scope.isLoadingData === false) { + expand(); + } + } + + } else { + if(scope.isLoadingData === false) { + collapse(); + } + } + } + + }; + + public static factory = ($templateCache:ng.ITemplateCacheService)=> { + return new ExpandCollapseDirective($templateCache); + }; + + } + + ExpandCollapseDirective.factory.$inject = ['$templateCache']; +} diff --git a/catalog-ui/app/scripts/directives/utils/page-selector/page-selector.html b/catalog-ui/app/scripts/directives/utils/page-selector/page-selector.html new file mode 100644 index 0000000000..4fbea447e2 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/page-selector/page-selector.html @@ -0,0 +1,9 @@ +
      +
        + +
      + +
      diff --git a/catalog-ui/app/scripts/directives/utils/page-selector/page-selector.less b/catalog-ui/app/scripts/directives/utils/page-selector/page-selector.less new file mode 100644 index 0000000000..da70218263 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/page-selector/page-selector.less @@ -0,0 +1,51 @@ +.i-sdc-left-sidebar-page-nav { + + height: 64px; + + .sidebar-page-nav-item-selected, + .sidebar-page-nav-item { + .i_11; + background-color: #e0e5e9; + width: 100%; + height: 64px; + border-bottom: solid 1px #cccccc; + line-height: 64px; + text-align: center; + cursor: pointer; + vertical-align: middle; + list-style: none; + padding: 0; + margin: 0; + } + + .sidebar-page-nav-item-selected { + z-index: 1010; + position: absolute; + top: 0px; + } + + .sidebar-page-nav-item-selected span { + .sprite; + .sprite.table-arrow; + position: absolute; + top: 28px; + margin-left: 10px; + + &.expanded { + .sprite; + .sprite.table-arrow.opened; + top: 30px; + } + } + + ul { + position: absolute; + top: 0px; + padding: 0; + width: 100%; + z-index: 99; + visibility: hidden; //Need this and not display none, so I can use the function: getComputedStyle + .box-shadow(0px 4px 2px -2px rgba(0, 0, 0, 0.36)); + } + +} diff --git a/catalog-ui/app/scripts/directives/utils/page-selector/page-selector.ts b/catalog-ui/app/scripts/directives/utils/page-selector/page-selector.ts new file mode 100644 index 0000000000..c185fe1c15 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/page-selector/page-selector.ts @@ -0,0 +1,106 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + class ListItem { + name; + url; + } + + export interface IPageSelectorScope extends ng.IScope { + selected:string; + expanded: boolean; + list:Array; + exceptSelectedComparator(actual, expected):boolean; + openCollapse(); + } + + export class PageSelectorDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService) { + } + + scope = { + list: '=', + selected: '@', + }; + + public replace = true; + public restrict = 'E'; + public transclude = false; + + private ulElement:HTMLElement; + private itemHeight:number = 64; + + private getUlHeight = ():number => { + let tmp:string = getComputedStyle(this.ulElement).height; + //console.log("tmp: " + tmp); + let ulHeight:number = parseInt(tmp.substr(0,tmp.length-2)); + //console.log("ulHeight: " + ulHeight); + return ulHeight; + }; + + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/utils/page-selector/page-selector.html'); + }; + + link = (scope:IPageSelectorScope, $elem:any) => { + scope.expanded=false; + + window.setTimeout(() => { + this.ulElement = angular.element(".i-sdc-left-sidebar-page-nav ul")[0]; + console.log("this.ulElement: " + this.ulElement); + console.log("this.itemHeight: " + this.itemHeight); + this.ulElement.style.top = (this.itemHeight - this.getUlHeight() - 5) + 'px'; + this.ulElement.style.visibility = 'visible'; + },10); + + this.ulElement = angular.element(".i-sdc-left-sidebar-page-nav ul")[0]; + + scope.exceptSelectedComparator = (actual) => { + if (actual.name===scope.selected) { + return false; + } + return true; + }; + + scope.openCollapse = ():void => { + scope.expanded=!scope.expanded; + if (scope.expanded===true) { + this.ulElement.style.transition = 'top 0.4s ease-out'; + this.ulElement.style.top = this.itemHeight + 'px'; + } else { + this.ulElement.style.transition = 'top 0.4s ease-in'; + this.ulElement.style.top = (this.itemHeight - this.getUlHeight() - 5) + 'px'; + } + }; + + }; + + public static factory = ($templateCache:ng.ITemplateCacheService)=> { + return new PageSelectorDirective($templateCache); + }; + + } + + PageSelectorDirective.factory.$inject = ['$templateCache']; +} diff --git a/catalog-ui/app/scripts/directives/utils/sdc-keyboard-events/sdc-keyboard-events.ts b/catalog-ui/app/scripts/directives/utils/sdc-keyboard-events/sdc-keyboard-events.ts new file mode 100644 index 0000000000..9e61caa812 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/sdc-keyboard-events/sdc-keyboard-events.ts @@ -0,0 +1,106 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface ISdcKeyboardEventsScope extends ng.IScope { + keyEnter:Function; + keyShift:Function; + keyCtrl:Function; + keyEscape:Function; + keySpace:Function; + } + + export class SdcKeyboardEventsDirective implements ng.IDirective { + + constructor() { + } + + scope = { + keyEnter: '=', + keyShift: '=', + keyCtrl: '=', + keyEscape: '=', + keySpace: '=' + }; + + public replace = false; + public restrict = 'A'; + public transclude = false; + + link = (scope:ISdcKeyboardEventsScope, element:ng.IAugmentedJQuery, attrs:angular.IAttributes) => { + + element.bind("keydown keypress", function (event) { + //console.log(event.which); + switch (event.which) { + case 13: // enter key + scope.$apply(function (){ + if (scope.keyEnter) { + scope.keyEnter(); + event.preventDefault(); + } + }); + break; + case 16: // shift key + scope.$apply(function (){ + if (scope.keyShift) { + scope.keyShift(); + event.preventDefault(); + } + }); + break; + case 17: // ctrl key + scope.$apply(function (){ + if (scope.keyCtrl) { + scope.keyCtrl(); + event.preventDefault(); + } + }); + break; + case 27: // escape key + scope.$apply(function (){ + if (scope.keyEscape) { + scope.keyEscape(); + event.preventDefault(); + } + }); + break; + case 32: // space key + scope.$apply(function (){ + if (scope.keySpace) { + scope.keySpace(); + event.preventDefault(); + } + }); + break; + } + }); + + }; + + public static factory = ()=> { + return new SdcKeyboardEventsDirective(); + }; + + } + + SdcKeyboardEventsDirective.factory.$inject = []; +} diff --git a/catalog-ui/app/scripts/directives/utils/sdc-tags/sdc-tags.html b/catalog-ui/app/scripts/directives/utils/sdc-tags/sdc-tags.html new file mode 100644 index 0000000000..fb1ada69c3 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/sdc-tags/sdc-tags.html @@ -0,0 +1,27 @@ +
      + + +
      +
      + +
      +
      + +
      +
      +
      +
      diff --git a/catalog-ui/app/scripts/directives/utils/sdc-tags/sdc-tags.less b/catalog-ui/app/scripts/directives/utils/sdc-tags/sdc-tags.less new file mode 100644 index 0000000000..942196e663 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/sdc-tags/sdc-tags.less @@ -0,0 +1,61 @@ +.tags-box { + + height: 297px; + .bg_c; + + .perfect-scrollbar { + height: 265px; + } + + .new-tag-input { + display: block; + + -webkit-border-bottom-left-radius: 0 !important; + -moz-border-radius-bottomleft: 0 !important; + -khtml-border-bottom-left-radius: 0 !important; + border-bottom-left-radius: 0 !important; + + -webkit-border-bottom-right-radius: 0 !important; + -moz-border-radius-bottomright: 0 !important; + -khtml-border-bottom-right-radius: 0 !important; + border-bottom-right-radius: 0 !important; + + border: solid 1px #d8d8d8; + width: 100%; + height: 30px; + line-height: 30px; + padding: 2px 10px; + outline: none; + } + + .tags-wrapper { + padding: 10px; + .border-radius-bottom-left(2px); + .border-radius-bottom-right(2px); + border: solid 1px #d8d8d8; + border-top: none; + + .group-tag { + display: inline-block; + + .sdc-tag { + border: solid 1px @main_color_n; + background-color: @main_color_p; + min-width: auto; + .tag { + margin-right: 10px; + } + } + } + &.view-mode .group-tag { + opacity: 1; + background-color: #f8f8f8 !important; + .sdc-tag { + background: none; + border-color: @main_color_o; + } + } + } + +} + diff --git a/catalog-ui/app/scripts/directives/utils/sdc-tags/sdc-tags.ts b/catalog-ui/app/scripts/directives/utils/sdc-tags/sdc-tags.ts new file mode 100644 index 0000000000..3f4147c920 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/sdc-tags/sdc-tags.ts @@ -0,0 +1,97 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface ISdcTagsScope extends ng.IScope { + tags:Array; + specialTag:string; + newTag:string; + formElement:ng.IFormController; + elementName:string; + pattern:any; + sdcDisabled:boolean; + maxTags:number; + deleteTag(tag:string):void; + addTag(tag:string):void; + validateName():void; + } + + export class SdcTagsDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService) { + } + + scope = { + tags: '=', + specialTag: '=', + pattern: '=', + sdcDisabled: '=', + formElement: '=', + elementName: '@', + maxTags: '@' + }; + + public replace = false; + public restrict = 'E'; + public transclude = false; + + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/utils/sdc-tags/sdc-tags.html'); + }; + + link = (scope:ISdcTagsScope, element:ng.INgModelController) => { + + scope.deleteTag = (tag:string):void => { + scope.tags.splice(scope.tags.indexOf(tag),1); + }; + + scope.addTag = ():void => { + let valid = scope.formElement[scope.elementName].$valid; + if (valid && + scope.tags.length { + if (scope.tags.indexOf(scope.newTag)>-1) { + scope.formElement[scope.elementName].$setValidity('nameExist', false); + }else{ + scope.formElement[scope.elementName].$setValidity('nameExist', true); + } + } + + }; + + public static factory = ($templateCache:ng.ITemplateCacheService)=> { + return new SdcTagsDirective($templateCache); + }; + + } + + SdcTagsDirective.factory.$inject = ['$templateCache']; +} diff --git a/catalog-ui/app/scripts/directives/utils/sdc_error_tooltip/sdc_error_tooltip.html b/catalog-ui/app/scripts/directives/utils/sdc_error_tooltip/sdc_error_tooltip.html new file mode 100644 index 0000000000..376381b8af --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/sdc_error_tooltip/sdc_error_tooltip.html @@ -0,0 +1,6 @@ + diff --git a/catalog-ui/app/scripts/directives/utils/sdc_error_tooltip/sdc_error_tooltip.ts b/catalog-ui/app/scripts/directives/utils/sdc_error_tooltip/sdc_error_tooltip.ts new file mode 100644 index 0000000000..dc30ea7f41 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/sdc_error_tooltip/sdc_error_tooltip.ts @@ -0,0 +1,109 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface ISdcErrorTooltipScope extends ng.IScope { + alignToSelector: string; + topMargin: string; + } + + export class SdcErrorTooltipDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService) { + } + + scope = { + alignToSelector: '@', // Jquery selector to align to + topMargin: '@' // The margin from the top, in case there is label or not the top margin is different. + }; + + public replace = false; + public restrict = 'E'; + public transclude = true; + + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/utils/sdc_error_tooltip/sdc_error_tooltip.html'); + }; + + link = (scope:ISdcErrorTooltipScope, $elem:any) => { + let _self = this; + + $elem.addClass("i-sdc-form-item-error-icon"); + + // Calculate the position of the elements after they loaded to the dom. + window.setTimeout(function(){ + _self.calculatePosition(scope, $elem); + },100); + + $elem.bind('mouseover', function(){ + $(".i-sdc-form-item-error-message",$elem).css("display", "block"); + }); + + $elem.bind('mouseleave', function(){ + $(".i-sdc-form-item-error-message",$elem).css("display", "none"); + }); + + } + + private calculatePosition(scope:ISdcErrorTooltipScope, $elem:any):void { + let leftMargin = 13; + let topMargin = scope.topMargin? parseInt(scope.topMargin) : 10; + + if (scope.alignToSelector) { + // Set the position of the error, in case user add align-to-selector attribute + let jObj = $(scope.alignToSelector); + if (jObj.length > 0) { + let height1 = jObj.outerHeight(); + $elem.css('left', jObj.position().left + jObj.outerWidth() + leftMargin); + //$elem.css('top', jObj.position().top + topMargin + (height1 / 2)); + $elem.css('top', jObj.position().top + (height1 / 2) - 5); // Label margin is: 2 + } + } else { + // Set the position of the error, according to the input element. + let inputElm = $elem.siblings('input'); + let textareaElm = $elem.siblings('textarea'); + let selectElm = $elem.siblings('select'); + if (inputElm.length > 0) { + $elem.css('left', inputElm.outerWidth() + leftMargin); + $elem.css('top', inputElm.position().top + topMargin); + } else if (textareaElm.length > 0) { + $elem.css('left', textareaElm.outerWidth() + leftMargin); + let height2 = textareaElm.outerHeight(); + let elmHeight2 = $elem.outerHeight(); + //let top = textareaElm.position().top; + $elem.css('bottom', (height2 - (elmHeight2 / 2)) / 2); + } else if (selectElm.length > 0) { + $elem.css('left', selectElm.outerWidth() + leftMargin); + $elem.css('top', selectElm.position().top + topMargin); + } + } + } + + public static factory = ($templateCache:ng.ITemplateCacheService)=> { + return new SdcErrorTooltipDirective($templateCache); + }; + + } + + SdcErrorTooltipDirective.factory.$inject = ['$templateCache']; + +} diff --git a/catalog-ui/app/scripts/directives/utils/sdc_messages/sdc-message.ts b/catalog-ui/app/scripts/directives/utils/sdc_messages/sdc-message.ts new file mode 100644 index 0000000000..d41ef1ce04 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/sdc_messages/sdc-message.ts @@ -0,0 +1,179 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + export interface ISdcMessageScope extends ng.IScope { + sdcTranslate: string; + sdcTranslateValues:string; + sdcAlign:string; + } + + export class SdcMessageDirective implements ng.IDirective { + + constructor(private $animate:any, private $filter:any, private $parse:any) { + } + + scope = { + field: '=', + required: '@', + pattern: '@', + sdcTranslate: '@', + sdcTranslateValues: '@', + sdcAlign: '@' + }; + + public terminal = true; + public restrict = 'A'; + public transclude = 'element'; + public require = '^^sdcMessages'; + + link = (scope:ISdcMessageScope, $element:any, $attrs:any,sdcMessagesCtrl:any, $transclude:any) => { + let self = this; + + let commentNode = $element[0]; + + let records; + let staticExp = $attrs.sdcMessage || $attrs.when; + let dynamicExp = $attrs.sdcMessageExp || $attrs.whenExp; + let assignRecords = function(items) { + records = items + ? (angular.isArray(items) + ? items + : items.split(/[\s,]+/)) + : null; + sdcMessagesCtrl.reRender(); + }; + + if (dynamicExp) { + assignRecords(scope.$eval(dynamicExp)); + scope.$watchCollection(dynamicExp, assignRecords); + } else { + assignRecords(staticExp); + } + + let currentElement, messageCtrl; + sdcMessagesCtrl.register(commentNode, messageCtrl = { + test: function (name) { + return self.contains(records, name); + }, + attach: function () { + if (!currentElement) { + $transclude(scope, function (elm) { + + self.$animate.enter(elm, null, $element); + currentElement = elm; + + elm.addClass("i-sdc-form-item-error-message"); + + //$compile + let text; + if (scope.sdcTranslate) { + text = self.$filter('translate')(scope.sdcTranslate, scope.sdcTranslateValues); + } else { + //TODO: Need to handle this + //let t = elm.html(); + //let t = angular.element("" + elm.html() + ""); + //text = self.$parse(t); + } + + //scope.sdcTranslateValues + elm.html(text); + + elm.prepend(""); + + // Adding OK to close the message + //let okElm = $('').attr('class', 'ok').html('OK'); + //okElm.click(function(e){ + // messageCtrl.detach(); + //}); + //elm.append(okElm); + + // Handle the position + if (scope.sdcAlign){ + let choosenElm = $(scope.sdcAlign); + if (choosenElm.length > 0) { + let height1 = choosenElm.outerHeight(); + let elmHeight1 = elm.outerHeight(); + elm.css('left', choosenElm.outerWidth()); + elm.css('bottom', (height1 - (elmHeight1 / 2)) / 2); + } + } else { + // Set the position of the error, according to the input element. + let inputElm = elm.parent().siblings('input'); + let textareaElm = elm.parent().siblings('textarea'); + let selectElm = elm.parent().siblings('select'); + if (inputElm.length > 0) { + elm.css('left', inputElm.outerWidth()); + elm.css('top', inputElm.position().top); + } else if (textareaElm.length > 0) { + elm.css('left', textareaElm.outerWidth()); + let height = textareaElm.outerHeight(); + let elmHeight = elm.outerHeight(); + //let top = textareaElm.position().top; + elm.css('bottom', (height - (elmHeight / 2)) / 2); + } else if (selectElm.length > 0) { + elm.css('left', selectElm.outerWidth()); + elm.css('top', selectElm.position().top); + } + } + + // Each time we attach this node to a message we get a new id that we can match + // when we are destroying the node later. + let $$attachId = currentElement.$$attachId = sdcMessagesCtrl.getAttachId(); + + // in the event that the parent element is destroyed + // by any other structural directive then it's time + // to deregister the message from the controller + currentElement.on('$destroy', function () { + if (currentElement && currentElement.$$attachId === $$attachId) { + sdcMessagesCtrl.deregister(commentNode); + messageCtrl.detach(); + } + }); + }); + } + }, + detach: function () { + if (currentElement) { + let elm = currentElement; + currentElement = null; + self.$animate.leave(elm); + } + } + }); + } + + contains = (collection, key):any => { + if (collection) { + return angular.isArray(collection) + ? collection.indexOf(key) >= 0 + : collection.hasOwnProperty(key); + } + } + + public static factory = ($animate:any, $filter:any, $parse:any)=> { + return new SdcMessageDirective($animate, $filter, $parse); + }; + + } + + SdcMessageDirective.factory.$inject = ['$animate', '$filter', '$parse']; +} diff --git a/catalog-ui/app/scripts/directives/utils/sdc_messages/sdc-messages.less b/catalog-ui/app/scripts/directives/utils/sdc_messages/sdc-messages.less new file mode 100644 index 0000000000..d8dfdbb73b --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/sdc_messages/sdc-messages.less @@ -0,0 +1,10 @@ +.ellipsis-directive-more-less { + .a_9; + .bold; + .hand; + float: right; + margin-right: 17px; + line-height: 23px; + text-decoration: underline; + text-align: left; +} diff --git a/catalog-ui/app/scripts/directives/utils/sdc_messages/sdc-messages.ts b/catalog-ui/app/scripts/directives/utils/sdc_messages/sdc-messages.ts new file mode 100644 index 0000000000..f8b435b1fa --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/sdc_messages/sdc-messages.ts @@ -0,0 +1,245 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + export interface ISdcMessagesScope extends ng.IScope { + sdcMessages: any; + editForm:ng.IFormController; + } + + export class SdcMessagesDirective implements ng.IDirective { + + constructor() {} + + scope = { + sdcMessages: '=' + }; + + public restrict = 'AE'; + public require = 'sdcMessages'; + public controller = SdcMessagesController; + + /*template = ():string => { + return this.$templateCache.get('/app/scripts/directives/utils/sdc-messages/sdc-messages.html'); + }; + + public static factory = ($templateCache:ng.ITemplateCacheService)=> { + return new SdcMessagesDirective($templateCache); + };*/ + + public static factory = ()=> { + return new SdcMessagesDirective(); + } + + } + + export class SdcMessagesController { + + messages:any; + getAttachId:Function; + render:any; + reRender:Function; + register:Function; + deregister:Function; + head:any; + + static '$inject' = [ + '$element', + '$scope', + '$attrs', + '$animate' + ]; + + constructor(private $element:JQuery, + private $scope:ISdcMessagesScope, + private $attrs:ng.IAttributes, + private $animate:any + ) { + + this.init(); + + } + + init=():void => { + let self = this; + + let ACTIVE_CLASS:string = 'ng-active'; + let INACTIVE_CLASS:string = 'ng-inactive'; + + let ctrl = this; + let latestKey = 0; + let nextAttachId = 0; + + this.getAttachId = function getAttachId() { return nextAttachId++; }; + + let messages = this.messages = {}; + let renderLater, cachedCollection; + + this.render = function(collection) { + collection = collection || {}; + + renderLater = false; + cachedCollection = collection; + + // this is true if the attribute is empty or if the attribute value is truthy + let multiple = self.isAttrTruthy(self.$scope, self.$attrs['sdcMessagesMultiple']) || self.isAttrTruthy(self.$scope, self.$attrs['multiple']); + + let unmatchedMessages = []; + let matchedKeys = {}; + let messageItem = ctrl.head; + let messageFound = false; + let totalMessages = 0; + + // we use != instead of !== to allow for both undefined and null values + while (messageItem != null) { + totalMessages++; + let messageCtrl = messageItem.message; + + let messageUsed = false; + if (!messageFound) { + _.each(collection, function(value, key) { + if (!messageUsed && self.truthy(value) && messageCtrl.test(key)) { + // this is to prevent the same error name from showing up twice + if (matchedKeys[key]) return; + matchedKeys[key] = true; + + messageUsed = true; + messageCtrl.attach(); + } + }); + } + + if (messageUsed) { + // unless we want to display multiple messages then we should + // set a flag here to avoid displaying the next message in the list + messageFound = !multiple; + } else { + unmatchedMessages.push(messageCtrl); + } + + messageItem = messageItem.next; + } + + _.each(unmatchedMessages, function(messageCtrl) { + messageCtrl.detach(); + }); + + unmatchedMessages.length !== totalMessages + ? ctrl.$animate.setClass(self.$element, ACTIVE_CLASS, INACTIVE_CLASS) + : ctrl.$animate.setClass(self.$element, INACTIVE_CLASS, ACTIVE_CLASS); + }; + + self.$scope.$watchCollection('sdcMessages' || self.$attrs['for'], function(newVal:any, oldVal:any){ + ctrl.render(newVal); + }); + + this.reRender = function() { + if (!renderLater) { + renderLater = true; + self.$scope.$evalAsync(function() { + if (renderLater) { + cachedCollection && ctrl.render(cachedCollection); + } + }); + } + }; + + this.register = function(comment, messageCtrl) { + let nextKey = latestKey.toString(); + messages[nextKey] = { + message: messageCtrl + }; + insertMessageNode(self.$element[0], comment, nextKey); + comment.$$sdcMessageNode = nextKey; + latestKey++; + + ctrl.reRender(); + }; + + this.deregister = function(comment) { + let key = comment.$$sdcMessageNode; + delete comment.$$sdcMessageNode; + removeMessageNode(self.$element[0], comment, key); + delete messages[key]; + ctrl.reRender(); + }; + + function findPreviousMessage(parent, comment) { + let prevNode = comment; + let parentLookup = []; + while (prevNode && prevNode !== parent) { + let prevKey = prevNode.$$sdcMessageNode; + if (prevKey && prevKey.length) { + return messages[prevKey]; + } + + // dive deeper into the DOM and examine its children for any sdcMessage + // comments that may be in an element that appears deeper in the list + if (prevNode.childNodes.length && parentLookup.indexOf(prevNode) == -1) { + parentLookup.push(prevNode); + prevNode = prevNode.childNodes[prevNode.childNodes.length - 1]; + } else { + prevNode = prevNode.previousSibling || prevNode.parentNode; + } + } + } + + function insertMessageNode(parent, comment, key) { + let messageNode = messages[key]; + if (!ctrl.head) { + ctrl.head = messageNode; + } else { + let match = findPreviousMessage(parent, comment); + if (match) { + messageNode.next = match.next; + match.next = messageNode; + } else { + messageNode.next = ctrl.head; + ctrl.head = messageNode; + } + } + } + + function removeMessageNode(parent, comment, key) { + let messageNode = messages[key]; + + let match = findPreviousMessage(parent, comment); + if (match) { + match.next = messageNode.next; + } else { + ctrl.head = messageNode.next; + } + } + } + + isAttrTruthy = (scope, attr):any => { + return (angular.isString(attr) && attr.length === 0) || //empty attribute + this.truthy(scope.$eval(attr)); + } + + truthy = (val):any => { + return angular.isString(val) ? val.length : !!val; + } + + } + + SdcMessagesDirective.factory.$inject = ['$templateCache','$animate']; +} diff --git a/catalog-ui/app/scripts/directives/utils/sdc_messages/sdc_messages.html b/catalog-ui/app/scripts/directives/utils/sdc_messages/sdc_messages.html new file mode 100644 index 0000000000..09b1cad4d2 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/sdc_messages/sdc_messages.html @@ -0,0 +1 @@ +aaa diff --git a/catalog-ui/app/scripts/directives/utils/smart-tooltip/smart-tooltip.ts b/catalog-ui/app/scripts/directives/utils/smart-tooltip/smart-tooltip.ts new file mode 100644 index 0000000000..49a57245e7 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/smart-tooltip/smart-tooltip.ts @@ -0,0 +1,85 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + 'use strict'; + + export interface ISmartTooltipScope extends ng.IScope { + sdcSmartToolip; + } + + export class SmartTooltipDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService, + private $compile:ng.ICompileService) { + } + + public replace = false; + public restrict = 'A'; + public transclude = false; + + public link = (scope:ISmartTooltipScope, $elem:ng.IAugmentedJQuery, $attrs:angular.IAttributes) => { + + if ($elem[0].hasAttribute('style')===false){ + $elem[0].setAttribute("style", "overflow: hidden; white-space: nowrap; text-overflow: ellipsis;"); + } else { + let styles = $elem.attr('style'); + $elem[0].setAttribute("style", styles + ";overflow: hidden; white-space: nowrap; text-overflow: ellipsis;"); + } + + $elem.bind('mouseenter', () => { + if($elem[0].offsetWidth < $elem[0].scrollWidth && !$elem.attr('tooltips')){ + $attrs.$set('tooltips', 'tooltips'); + if ($attrs['sdcSmartTooltip'] && $attrs['sdcSmartTooltip'].length>0){ + $elem.attr('tooltip-content', $attrs['sdcSmartTooltip']); + } else { + $attrs.$set('tooltip-content', $elem.text()); + } + + //One possible problem arises when the ngIf is placed on the root element of the template. + //ngIf removes the node and places a comment in it's place. Then it watches over the expression and adds/removes the actual HTML element as necessary. + //The problem seems to be that if it is placed on the root element of the template, then a single comment is what is left from the + //whole template (even if only temporarily), which gets ignored (I am not sure if this is browser-specific behaviour), resulting in an empty template. + + // Remove ng-if attribute and its value (if we reach here, we pass ng-if (ng-if===true), so we can remove it). + $elem.removeAttr('ng-if'); + $elem.removeAttr('data-ng-if'); + + // Remove me (the directive from the element) + let template = $elem[0].outerHTML; + template = template.replace('sdc-smart-tooltip=""',''); + template = template.replace('sdc-smart-tooltip="' + $elem.text() + '"',''); + //console.log(template); + + let el = this.$compile(template)(scope); + console.log(el); + $elem.replaceWith(el); + } + }); + }; + + public static factory = ($templateCache:ng.ITemplateCacheService, $compile:ng.ICompileService)=> { + return new SmartTooltipDirective($templateCache, $compile); + }; + + } + + SmartTooltipDirective.factory.$inject = ['$templateCache', '$compile']; +} diff --git a/catalog-ui/app/scripts/directives/utils/wizard_steps/sdc-wizard-steps.html b/catalog-ui/app/scripts/directives/utils/wizard_steps/sdc-wizard-steps.html new file mode 100644 index 0000000000..0c9b97a58c --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/wizard_steps/sdc-wizard-steps.html @@ -0,0 +1,16 @@ +
        +
      • +
        + + {{step.name}} + +
        +
        +
      • +
      + diff --git a/catalog-ui/app/scripts/directives/utils/wizard_steps/sdc-wizard-steps.less b/catalog-ui/app/scripts/directives/utils/wizard_steps/sdc-wizard-steps.less new file mode 100644 index 0000000000..8b777923a0 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/wizard_steps/sdc-wizard-steps.less @@ -0,0 +1,69 @@ +@circle-radius: 18px; +@gap: 70px; +@gap-width: 2px; +@valid-width: 2px; + +ul.sdc-wizard-step { + padding: 0; + margin: 0; + + li.step { + position: relative; + list-style: none; + + .step-wrapper { + line-height: @circle-radius*2; + height: @circle-radius*2; + margin-bottom: @gap; + + button.step-index { + ._w-sdc-wizard-step-btn(@circle-radius); + z-index: 99; + display: inline-block; + + &.valid { + display: inline-block; + } + + } + + span.step-name { + .b_7; + line-height: @circle-radius; + display: inline-block; + word-wrap: break-word; + width: calc(~"100%" - @circle-radius*2 + 4); + vertical-align: middle; + padding-left: 10px; + white-space: normal; + + &.selected { + .a_7; + font-weight: bold; + } + + &.disabled { + border: none; + background-color: transparent; + } + + } + } + + .step-seperator { + border-right: @gap-width solid @color_n; + height: @gap + @circle-radius*2; + position: absolute; + top: @circle-radius*2-@circle-radius; + left: @circle-radius - @gap-width/2; + } + + } + + li.step:last-child { + .step-seperator { + display: none; + } + } + +} diff --git a/catalog-ui/app/scripts/directives/utils/wizard_steps/sdc-wizard-steps.ts b/catalog-ui/app/scripts/directives/utils/wizard_steps/sdc-wizard-steps.ts new file mode 100644 index 0000000000..9cad36ab78 --- /dev/null +++ b/catalog-ui/app/scripts/directives/utils/wizard_steps/sdc-wizard-steps.ts @@ -0,0 +1,139 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Directives { + + 'use strict'; + + export interface IWizardStep { + name: string; + selected?: boolean; + valid?:boolean; + enabled?:boolean; + callback: Function; + } + + export interface ISdcWizardStepScope extends ng.IScope { + steps:Array; + control:any; + internalControl:any; + + stepClicked(stepName:string):void; + controllerStepClicked(stepName:string):void; + + setStepValidity(stepName:string, valid:boolean):void; + controllerSetStepValidity(step:IWizardStep, valid:boolean):void; + } + + export interface SdcWizardStepMethods { + unSelectAllSteps():void; + selectStep(step:IWizardStep):void; + } + + export class SdcWizardStepDirective implements ng.IDirective { + + constructor(private $templateCache:ng.ITemplateCacheService) { + } + + scope = { + steps: '=', + control: '=' + }; + + public replace = false; + public restrict = 'E'; + public transclude = true; + public controller = SdcWizardStepDirectiveController; + + template = ():string => { + return this.$templateCache.get('/app/scripts/directives/utils/wizard_steps/sdc-wizard-steps.html'); + }; + + link = (scope:ISdcWizardStepScope, $elem:JQuery, attr:any, controller:SdcWizardStepDirectiveController) => { + scope.internalControl = scope.control || {}; + scope.internalControl.stepClicked = (step:string):void => { + scope.controllerStepClicked(step); + }; + + scope.internalControl.setStepValidity = (step:IWizardStep, valid:boolean):void => { + scope.controllerSetStepValidity(step, valid); + }; + } + + public static factory = ($templateCache:ng.ITemplateCacheService)=> { + return new SdcWizardStepDirective($templateCache); + }; + + } + + SdcWizardStepDirective.factory.$inject = ['$templateCache']; + + export class SdcWizardStepDirectiveController { + static $inject = ['$element', '$scope']; + + methods:SdcWizardStepMethods = {}; + + constructor(public $element: JQuery, + public $scope: ISdcWizardStepScope) { + + this.initMethods(); + this.initScope(); + } + + private initScope = ():void => { + + this.$scope.controllerStepClicked = (stepName:string):void => { + let selectedStep:IWizardStep = _.find(this.$scope.steps, function (item) { + return item.name === stepName; + }); + + if (selectedStep && selectedStep.enabled===true){ + let result:boolean = selectedStep.callback(); + if (result===true){ + this.methods.unSelectAllSteps(); + this.methods.selectStep(selectedStep); + } + } + }; + + this.$scope.controllerSetStepValidity = (step:IWizardStep, valid:boolean):void => { + step.valid=valid; + }; + + }; + + private initMethods = ():void => { + + this.methods.unSelectAllSteps = ():void => { + this.$scope.steps.forEach(function (step) { + step.selected = false; + }); + } + + this.methods.selectStep = (step:IWizardStep):void => { + if (step.enabled===true){ + step.selected=true; + } + } + }; + + } + +} diff --git a/catalog-ui/app/scripts/filters/_category-name-filter.ts b/catalog-ui/app/scripts/filters/_category-name-filter.ts new file mode 100644 index 0000000000..77bbf47684 --- /dev/null +++ b/catalog-ui/app/scripts/filters/_category-name-filter.ts @@ -0,0 +1,40 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Filters { + + export class CategoryNameFilter{ + + constructor() { + let filter = ( (name:string) => { + if(name){ + let newName:string = _.last(name.split('/')); + if (newName){ + return newName; + } + return name; + } + }); + + return filter; + } + } + +} diff --git a/catalog-ui/app/scripts/filters/capitalize-filter.ts b/catalog-ui/app/scripts/filters/capitalize-filter.ts new file mode 100644 index 0000000000..ef0469aaa1 --- /dev/null +++ b/catalog-ui/app/scripts/filters/capitalize-filter.ts @@ -0,0 +1,43 @@ +/*- + * ============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========================================================= + */ +module Sdc.Filters { + + export class CapitalizeFilter{ + + constructor() { + let filter = ( (sentence:string) => { + if (sentence != null) { + let newSentence:string = ""; + let words = sentence.split(' '); + for (let i=0; i < words.length; ++i){ + let word:string = words[i].toLowerCase(); + newSentence += word.substring(0,1).toUpperCase()+word.substring(1) + ' '; + } + return newSentence.trim(); + }else{ + return sentence; + } + }); + + return filter; + } + } + +} diff --git a/catalog-ui/app/scripts/filters/catalog-status-filter.ts b/catalog-ui/app/scripts/filters/catalog-status-filter.ts new file mode 100644 index 0000000000..5b382f6513 --- /dev/null +++ b/catalog-ui/app/scripts/filters/catalog-status-filter.ts @@ -0,0 +1,41 @@ +/*- + * ============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========================================================= + */ +/// +/** + * Created by obarda on 19/08/2015. + */ +module Sdc.Filters { + + export class CatalogStatusFilter{ + + constructor() { + let filter = ( (statuses:any) => { + let filtered = []; + angular.forEach(statuses, function(status) { + filtered.push(status); + }); + return filtered; + }); + + return filter; + } + } + +} diff --git a/catalog-ui/app/scripts/filters/category-icon-filter.ts b/catalog-ui/app/scripts/filters/category-icon-filter.ts new file mode 100644 index 0000000000..6916a13399 --- /dev/null +++ b/catalog-ui/app/scripts/filters/category-icon-filter.ts @@ -0,0 +1,54 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Filters { + + export class CategoryIconFilter{ + + constructor() { + let filter = ( (category:string) => { + let map = { + 'Application Layer 4+/Application Servers': ['applicationServer', 'server'], + 'Application Layer 4+/Media Servers': ['applicationServer', 'server'], + 'Application Layer 4+/Web Server': ['applicationServer', 'server'], + 'Network Layer 4+/Common Network Resources': ['network', 'loadBalancer'], + 'Generic/Infrastructure': ['objectStorage', 'compute'], + 'Generic/Network Elements': ['port', 'network', 'router'], + 'Application Layer 4+/Database': ['database'], + 'Generic/Database': ['database'], + 'Network Layer 2-3/Router': ['router'], + 'Network Layer 2-3/Gateway': ['gateway'], + 'Network Layer 2-3/LAN Connectors': ['connector'], + 'Network Layer 2-3/WAN Connectors': ['connector'], + 'Application Layer 4+/Border Elements': ['borderElement'], + 'Application Layer 4+/Load Balancer': ['loadBalancer'], + 'Application Layer 4+/Call Control': ['call_controll'], + 'VoIP Call Control': ['call_controll'], + 'Mobility': ['mobility'], + 'Network L1-3': ['network_l_1-3'], + 'Network L4': ['network_l_4'] + } + return map[category]; + + }); + return filter; + } + } +} diff --git a/catalog-ui/app/scripts/filters/category-type-filter.ts b/catalog-ui/app/scripts/filters/category-type-filter.ts new file mode 100644 index 0000000000..482e566e5a --- /dev/null +++ b/catalog-ui/app/scripts/filters/category-type-filter.ts @@ -0,0 +1,45 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Filters { + + export class CategoryTypeFilter { + + static $inject = ['Sdc.Services.CacheService']; + + constructor(cacheService:Services.CacheService) { + let filter = (categories:any, selectedType:Array) => { + + if (!selectedType.length) + return categories; + + let filteredCategories:any = []; + selectedType.forEach((type:string) => { + filteredCategories = filteredCategories.concat(cacheService.get(type.toLowerCase() + 'Categories')); + }); + + return _.filter(categories, function (category:any) { + return filteredCategories.indexOf(category) != -1; + }); + }; + return filter; + } + } +} diff --git a/catalog-ui/app/scripts/filters/clear-whitespaces-filter.ts b/catalog-ui/app/scripts/filters/clear-whitespaces-filter.ts new file mode 100644 index 0000000000..5c946e1715 --- /dev/null +++ b/catalog-ui/app/scripts/filters/clear-whitespaces-filter.ts @@ -0,0 +1,39 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Filters { + + export class ClearWhiteSpacesFilter { + + constructor() { + let filter = ( (text:string) => { + if (!angular.isString(text)) { + return text; + } + + return text.replace(/ /g,''); // remove also whitespaces inside + }); + + return filter; + } + } +} + + diff --git a/catalog-ui/app/scripts/filters/entity-filter.ts b/catalog-ui/app/scripts/filters/entity-filter.ts new file mode 100644 index 0000000000..ce60d69833 --- /dev/null +++ b/catalog-ui/app/scripts/filters/entity-filter.ts @@ -0,0 +1,117 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Filters { + + export class EntityFilter{ + + constructor() { + + let filter = ( (components:Array, filter:any) => { + + let filteredComponents:Array = components; + + // filter by type + // -------------------------------------------------------------------------- + if ((filter.selectedComponentTypes && filter.selectedComponentTypes.length>0) || (filter.selectedResourceSubTypes && filter.selectedResourceSubTypes.length>0)) { + let filteredTypes = []; + angular.forEach(components, (component:Models.Components.Component):void => { + // Filter by component type + let typeLower:string = component.componentType.toLowerCase(); + let typeFirstCapital:string = typeLower.charAt(0).toUpperCase() + typeLower.slice(1); + if (filter.selectedComponentTypes.indexOf(typeFirstCapital) !== -1) { + filteredTypes.push(component); + } + + // Filter by resource sub type, only in case the resource checkbox was not selected (because in this case we already added all the components in above section). + if (component.isResource() && filter.selectedComponentTypes.indexOf("Resource") === -1 && filter.selectedResourceSubTypes.length > 0) { + //filteredComponents.pop(); // Remove the last inserted component. + let resource:Sdc.Models.Components.Resource = component; + if (filter.selectedResourceSubTypes.indexOf(resource.getComponentSubType()) !== -1) { + filteredTypes.push(component); + } + } + }); + filteredComponents = filteredTypes; + } + + // filter by categories & subcategories & groupings + // -------------------------------------------------------------------------- + if (filter.selectedCategoriesModel && filter.selectedCategoriesModel.length>0) { + let filteredCategories = []; + angular.forEach(filteredComponents, (component:Models.Components.Component):void => { + if (component.categories && filter.selectedCategoriesModel.indexOf(component.categories[0].uniqueId) !== -1) { + filteredCategories.push(component); + } else if (component.categories && component.categories[0].subcategories && filter.selectedCategoriesModel.indexOf(component.categories[0].subcategories[0].uniqueId) !== -1) { + filteredCategories.push(component); + } else if (component.categories && component.categories[0].subcategories && component.categories[0].subcategories[0].groupings && filter.selectedCategoriesModel.indexOf(component.categories[0].subcategories[0].groupings[0].uniqueId) !== -1) { + filteredCategories.push(component); + } + }); + filteredComponents = filteredCategories; + } + + // filter by statuses + // -------------------------------------------------------------------------- + if (filter.selectedStatuses && filter.selectedStatuses.length > 0) { + //convert array of array to string array + let selectedStatuses:Array = [].concat.apply([],filter.selectedStatuses); + + let filteredStatuses = []; + angular.forEach(filteredComponents, (component:Models.Components.Component):void => { + if (selectedStatuses.indexOf(component.lifecycleState) > -1) { + filteredStatuses.push(component); + } + //if status DISTRIBUTED && CERTIFIED are selected the component will added in CERTIFIED status , not need to add twice + if(selectedStatuses.indexOf('DISTRIBUTED') > -1 && !(selectedStatuses.indexOf('CERTIFIED') > -1)){ + if( component.distributionStatus && component.distributionStatus.indexOf('DISTRIBUTED') > -1 && component.lifecycleState.indexOf('CERTIFIED') > -1){ + filteredStatuses.push(component); + } + } + }); + filteredComponents = filteredStatuses; + } + + // filter by statuses and distributed + // -------------------------------------------------------------------------- + if (filter.distributed != undefined && filter.distributed.length > 0) { + let filterDistributed: Array = filter.distributed; + let filteredDistributed = []; + angular.forEach(filteredComponents, (entity) => { + filterDistributed.forEach((distribute) => { + let distributeItem = distribute.split(','); + distributeItem.forEach((item) => { + if (item !== undefined && entity.distributionStatus === item){ + filteredDistributed.push(entity); + } + }) + }); + }); + filteredComponents = filteredDistributed; + } + + return filteredComponents; + }); + + return filter; + } + } + +} diff --git a/catalog-ui/app/scripts/filters/graph-resource-name-filter.ts b/catalog-ui/app/scripts/filters/graph-resource-name-filter.ts new file mode 100644 index 0000000000..63f0d780be --- /dev/null +++ b/catalog-ui/app/scripts/filters/graph-resource-name-filter.ts @@ -0,0 +1,47 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Filters { + + export class GraphResourceNameFilter { + + + constructor() { + let filter = ( (name:string) => { + let context = document.createElement("canvas").getContext("2d"); + context.font = "13px Arial"; + + if(67 < context.measureText(name).width) { + let newLen = name.length - 3; + let newName = name.substring(0, newLen); + + while (59 < (context.measureText(newName).width)) { + newName = newName.substring(0, (--newLen)); + } + return newName + '...'; + } + + return name; + }); + return filter; + } + } + +} diff --git a/catalog-ui/app/scripts/filters/product-category-name-filter.ts b/catalog-ui/app/scripts/filters/product-category-name-filter.ts new file mode 100644 index 0000000000..afe8c7ef08 --- /dev/null +++ b/catalog-ui/app/scripts/filters/product-category-name-filter.ts @@ -0,0 +1,39 @@ +/*- + * ============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========================================================= + */ +module Sdc.Filters { + + export class ProductCategoryNameFilter{ + + constructor() { + let filter = ( (name:string) => { + if(name){ + let newName:string = name.split('/')[1]; + if (newName){ + return newName; + } + return name; + } + }); + + return filter; + } + } + +} diff --git a/catalog-ui/app/scripts/filters/product-subcategory-name-filter.ts b/catalog-ui/app/scripts/filters/product-subcategory-name-filter.ts new file mode 100644 index 0000000000..66d7a76c28 --- /dev/null +++ b/catalog-ui/app/scripts/filters/product-subcategory-name-filter.ts @@ -0,0 +1,39 @@ +/*- + * ============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========================================================= + */ +module Sdc.Filters { + + export class ProductSubCategoryNameFilter{ + + constructor() { + let filter = ( (name:string) => { + if(name){ + let newName:string = _.last(name.split('/')); + if (newName){ + return newName; + } + return name; + } + }); + + return filter; + } + } + +} diff --git a/catalog-ui/app/scripts/filters/relation-name-fllter.ts b/catalog-ui/app/scripts/filters/relation-name-fllter.ts new file mode 100644 index 0000000000..7d97eea372 --- /dev/null +++ b/catalog-ui/app/scripts/filters/relation-name-fllter.ts @@ -0,0 +1,53 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Filters { + + export class RelationNameFilter{ + + constructor() { + let filter = ( (relationshipType:string) => { + let icons: Array = [ + 'AttachesTo', + 'BindsTo', + 'DependsOn', + 'HostedOn', + 'LinksTo', + 'RoutesTo' + ]; + + let result:string = 'ConnectedTo'; + + if (relationshipType) { + let arr = relationshipType.split('.'); // looks like tosca.relationships.AttachesTo + relationshipType = arr[arr.length - 1]; + if (icons.indexOf(relationshipType) > -1) { + result = relationshipType; + } + } + + return result; + }); + + return filter; + } + } + +} diff --git a/catalog-ui/app/scripts/filters/resource-name-filter.ts b/catalog-ui/app/scripts/filters/resource-name-filter.ts new file mode 100644 index 0000000000..a1f6162a4c --- /dev/null +++ b/catalog-ui/app/scripts/filters/resource-name-filter.ts @@ -0,0 +1,45 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Filters { + + export class ResourceNameFilter{ + + + constructor() { + let filter = ( (name:string) => { + if(name){ + //let newName:string = _.last(name.split('.')); + let newName = + _.last(_.last(_.last(_.last(_.last(_.last(_.last(_.last(name.split('tosca.nodes.')) + .split('network.')).split('relationships.')).split('org.openecomp.')).split('resource.nfv.')) + .split('nodes.module.')).split('cp.')).split('vl.')); + if (newName){ + return newName; + } + return name; + } + }); + + return filter; + } + } + +} diff --git a/catalog-ui/app/scripts/filters/resource-type-filter.ts b/catalog-ui/app/scripts/filters/resource-type-filter.ts new file mode 100644 index 0000000000..6aa79dae76 --- /dev/null +++ b/catalog-ui/app/scripts/filters/resource-type-filter.ts @@ -0,0 +1,38 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Filters { + + export class ResourceTypeFilter{ + static '$inject' = ['Sdc.Services.CacheService']; + constructor(cacheService:Services.CacheService) + { + let filter = (resourceType:string) => { + let uiConfiguration:any = cacheService.get('UIConfiguration'); + + if(uiConfiguration.resourceTypes && uiConfiguration.resourceTypes[resourceType]){ + return uiConfiguration.resourceTypes[resourceType]; + } + return resourceType; + } + return filter; + } + } +} diff --git a/catalog-ui/app/scripts/filters/string-to-date-filter.ts b/catalog-ui/app/scripts/filters/string-to-date-filter.ts new file mode 100644 index 0000000000..1c4919d419 --- /dev/null +++ b/catalog-ui/app/scripts/filters/string-to-date-filter.ts @@ -0,0 +1,34 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Filters { + + export class StringToDateFilter{ + + constructor() { + let filter = ( (date:string) => { + if(date){ + return new Date(date.replace(" UTC", '').replace(" ", 'T') + '+00:00'); + } + }); + return filter; + } + } +} diff --git a/catalog-ui/app/scripts/filters/tests-id-filter.ts b/catalog-ui/app/scripts/filters/tests-id-filter.ts new file mode 100644 index 0000000000..12c5e6fd79 --- /dev/null +++ b/catalog-ui/app/scripts/filters/tests-id-filter.ts @@ -0,0 +1,33 @@ +/*- + * ============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========================================================= + */ +module Sdc.Filters { + + export class TestsIdFilter{ + + constructor() { + let filter = ( (testId:string) => { + return testId.replace(/\s/g, '_').toLowerCase(); + }); + + return filter; + } + } + +} diff --git a/catalog-ui/app/scripts/filters/trim-filter.ts b/catalog-ui/app/scripts/filters/trim-filter.ts new file mode 100644 index 0000000000..fd231abc8d --- /dev/null +++ b/catalog-ui/app/scripts/filters/trim-filter.ts @@ -0,0 +1,39 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Filters { + + export class TrimFilter { + + constructor() { + let filter = ( (text:string) => { + if (!angular.isString(text)) { + return text; + } + + return text.replace(/^\s+|\s+$/g, ''); // you could use .trim, but it's not going to work in IE<9 + }); + + return filter; + } + } +} + + diff --git a/catalog-ui/app/scripts/filters/truncate-filter.ts b/catalog-ui/app/scripts/filters/truncate-filter.ts new file mode 100644 index 0000000000..1470e5937d --- /dev/null +++ b/catalog-ui/app/scripts/filters/truncate-filter.ts @@ -0,0 +1,48 @@ +/*- + * ============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========================================================= + */ +module Sdc.Filters { + + export class TruncateFilter { + constructor() { + let filter = (str:string, length:number) => { + if (str.length <= length) { + return str; + } + + //if(str[length - 1] === ' '){ + // return str.substring(0, length - 1) + '...'; + //} + + let char; + let index = length; + while (char !== ' ' && index !== 0) { + index--; + char = str[index]; + } + if (index === 0) { + return (index === 0) ? str : str.substring(0, length - 3) + '...'; + } + return (index === 0) ? str : str.substring(0, index) + '...'; + }; + return filter; + } + + } +} diff --git a/catalog-ui/app/scripts/filters/underscoreless-filter.ts b/catalog-ui/app/scripts/filters/underscoreless-filter.ts new file mode 100644 index 0000000000..6849a36f04 --- /dev/null +++ b/catalog-ui/app/scripts/filters/underscoreless-filter.ts @@ -0,0 +1,33 @@ +/*- + * ============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========================================================= + */ +module Sdc.Filters { + + export class UnderscoreLessFilter{ + + constructor() { + let filter = ( (sentence:string) => { + return sentence.replace(/_/g, ' '); + }); + + return filter; + } + } + +} diff --git a/catalog-ui/app/scripts/models/activity.ts b/catalog-ui/app/scripts/models/activity.ts new file mode 100644 index 0000000000..4f8648d6b7 --- /dev/null +++ b/catalog-ui/app/scripts/models/activity.ts @@ -0,0 +1,48 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 19/11/2015. + */ +/// +module Sdc.Models { + 'use strict'; + + /*this is in uppercase because of the server response*/ + export class Activity{ + TIMESTAMP: string; + ACTION:string; + MODIFIER:string; + STATUS:string; + DESC:string; + COMMENT:string; + //custom data + public dateFormat:string; + + constructor() { + } + public toJSON = ():any => { + this.dateFormat = undefined; + return this; + }; + + } +} + + diff --git a/catalog-ui/app/scripts/models/additional-information.ts b/catalog-ui/app/scripts/models/additional-information.ts new file mode 100644 index 0000000000..bcac2e5d12 --- /dev/null +++ b/catalog-ui/app/scripts/models/additional-information.ts @@ -0,0 +1,44 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + + export interface IAdditionalInformationModel { + uniqueId: string; + key: string; + value: string; + } + + + export class AdditionalInformationModel implements IAdditionalInformationModel { + uniqueId:string; + key:string; + value:string; + + constructor() { + this.uniqueId = ''; + this.key = ''; + this.value = ''; + + } + } +} diff --git a/catalog-ui/app/scripts/models/app-config.ts b/catalog-ui/app/scripts/models/app-config.ts new file mode 100644 index 0000000000..f0a316fc92 --- /dev/null +++ b/catalog-ui/app/scripts/models/app-config.ts @@ -0,0 +1,232 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + + 'use strict'; + export interface IApi { + baseUrl:string; + + //***** NEW API *******// + GET_component: string; + PUT_component: string; + GET_component_validate_name: string; + POST_changeLifecycleState: string; + component_api_root:string; + welcome_page_video_url:string; + //*********// + + GET_user: string; + GET_user_authorize: string; + GET_all_users: string; + POST_create_user; + DELETE_delete_user; + POST_edit_user_role; + GET_resource: string; + GET_resources_latestversion_notabstract:string; + GET_resources_certified_not_abstract: string; + GET_resources_certified_abstract: string; + PUT_resource: string; + GET_resource_property: string; + GET_resource_artifact:string; + GET_download_instance_artifact:string; + POST_instance_artifact:string; + GET_resource_additional_information:string; + GET_service_artifact:string; + GET_resource_interface_artifact:string; + GET_resource_api_artifact:string; + GET_resource_validate_name: string; + GET_resource_artifact_types: string; + GET_activity_log: string; + GET_configuration_ui: string; + GET_service: string; + PUT_product: string; + GET_product: string; + GET_ecomp_menu_items: string; + GET_product_validate_name: string; + GET_service_validate_name: string; + GET_service_distributions: string; + GET_service_distributions_components: string; + POST_service_distribution_deploy: string; + GET_element: string; + GET_catalog: string; + GET_resource_category: string; + GET_service_category: string; + resource_instance: string; + GET_resource_instance_property: string; + GET_relationship:string; + GET_lifecycle_state_resource:string; + GET_lifecycle_state_CHECKIN:string; + GET_lifecycle_state_CERTIFICATIONREQUEST:string; + GET_lifecycle_state_UNDOCHECKOUT:string; + root: string; + PUT_service: string; + GET_download_artifact: string; + GET_SDC_Version: string; + GET_categories: string; + POST_category: string; + POST_subcategory: string; + POST_change_instance_version: string; + GET_requirements_capabilities: string; + GET_onboarding: string; + GET_component_from_csar_uuid: string; + kibana:string; + + //Added by Ikram -- starts + GET_product_category: string; + GET_product_category_temp: string; + GET_product_sub_category: string; + //Added by Ikram -- ends + + } + + export interface ILogConfig { + minLogLevel: string; + prefix: string; + } + + export interface ICookie { + junctionName: string; + prefix: string; + userIdSuffix: string; + userFirstName: string; + userLastName: string; + userEmail: string; + } + export interface IUserTypes { + admin: any; + designer: any; + tester: any; + } + + export interface IConfigStatuses { + inDesign: IConfigStatus; + readyForCertification: IConfigStatus; + inCertification: IConfigStatus; + certified: IConfigStatus; + distributed: IConfigStatus; + + } + + export interface IConfigStatus { + name: string; + values: Array; + } + + export interface IConfigRoles { + ADMIN: IConfigRole; + DESIGNER: IConfigRole; + TESTER: IConfigRole; + OPS: IConfigRole; + GOVERNOR: IConfigRole; + PRODUCT_MANAGER: IConfigRole; + PRODUCT_STRATEGIST: IConfigRole; + } + + export interface IConfigRole { + pages: Array; + states: IConfigState; + } + + export interface IConfigState { + NOT_CERTIFIED_CHECKOUT: Array; + NOT_CERTIFIED_CHECKIN: Array; + READY_FOR_CERTIFICATION: Array; + CERTIFICATION_IN_PROGRESS: Array; + CERTIFIED: Array; + } + + export interface IConfigDistribution { + DISTRIBUTION_NOT_APPROVED: Array; + DISTRIBUTION_APPROVED: Array; + DISTRIBUTED: Array; + DISTRIBUTION_REJECTED: Array; + } + + export interface IConfirmationMessage { + showComment: boolean; + title: string; + message: string; + } + + export interface IConfirmationMessages { + checkin: IConfirmationMessage; + checkout: IConfirmationMessage; + certify: IConfirmationMessage; + failCertification: IConfirmationMessage; + certificationRequest: IConfirmationMessage; + approve: IConfirmationMessage; + reject: IConfirmationMessage; + } + + export interface IAlertMessage { + title: string; + message: string; + } + + export interface IAlertMessages { + deleteInstance: IAlertMessage; + exitWithoutSaving: IConfirmationMessage; + } + + class ConfigMenuItem { + text:string; + action:string; + url:string; + disable:boolean = false; + } + + export interface IAppConfigurtaion { + environment:string; + api: IApi; + resourceTypesFilter:IResourceTypesFilter; + logConfig: ILogConfig; + cookie: ICookie; + imagesPath: string; + toscaFileExtension:string; + csarFileExtension:string; + testers: Array + tutorial:any; + roles: Array; + cpEndPointInstances: Array; + openSource:boolean; + } + export interface IResourceTypesFilter { + resource: Array; + } + + export interface ITester { + email: string; + } + + export interface IAppMenu { + roles: IConfigRoles; + confirmationMessages: IConfirmationMessages; + alertMessages: IAlertMessages; + statuses: IConfigStatuses; + catalogMenuItem: any; + categoriesDictionary:any; + canvas_buttons:Object; + component_workspace_menu_option: any; + LifeCycleStatuses: any; + DistributionStatuses: any; + ChangeLifecycleStateButton:any; + } +} diff --git a/catalog-ui/app/scripts/models/artifacts.ts b/catalog-ui/app/scripts/models/artifacts.ts new file mode 100644 index 0000000000..8ee98d90d1 --- /dev/null +++ b/catalog-ui/app/scripts/models/artifacts.ts @@ -0,0 +1,115 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + //this object contains keys, each key contain ArtifactModel + export class ArtifactGroupModel{ + constructor(artifacts?:Models.ArtifactGroupModel) { + _.forEach(artifacts, (artifact:Models.ArtifactModel, key) => { + this[key] = new Models.ArtifactModel(artifact); + }); + } + + public filteredByType (type:string): Models.ArtifactGroupModel { + return JSON.parse(JSON.stringify(_.pick(this, (artifact)=>{ return artifact.artifactType == type}))); + }; + } + + export class ArtifactModel { + + artifactDisplayName:string; + artifactGroupType:string; + uniqueId:string; + artifactName:string; + artifactLabel:string; + artifactType:string; + artifactUUID:string; + artifactVersion:string; + creatorFullName:string; + creationDate:number; + lastUpdateDate:number; + description:string; + mandatory:boolean; + serviceApi:boolean; + payloadData:string; + timeout:number; + esId:string; + "Content-MD5":string; + artifactChecksum:string; + apiUrl:string; + heatParameters:Array; + generatedFromId:string; + + //custom properties + selected:boolean; + originalDescription:string; + + constructor(artifact?:ArtifactModel) { + if(artifact) { + this.artifactDisplayName = artifact.artifactDisplayName; + this.artifactGroupType = artifact.artifactGroupType; + this.uniqueId = artifact.uniqueId; + this.artifactName = artifact.artifactName; + this.artifactLabel = artifact.artifactLabel; + this.artifactType = artifact.artifactType; + this.artifactUUID = artifact.artifactUUID; + this.artifactVersion = artifact.artifactVersion; + this.creatorFullName = artifact.creatorFullName; + this.creationDate = artifact.creationDate; + this.lastUpdateDate = artifact.lastUpdateDate; + this.description = artifact.description; + this.mandatory = artifact.mandatory; + this.serviceApi = artifact.serviceApi; + this.payloadData = artifact.payloadData; + this.timeout = artifact.timeout; + this.esId = artifact.esId; + this["Content-MD5"] = artifact["Content-MD5"]; + this.artifactChecksum = artifact.artifactChecksum; + this.apiUrl = artifact.apiUrl; + this.heatParameters = _.sortBy(artifact.heatParameters, 'name'); + this.generatedFromId = artifact.generatedFromId; + this.selected = artifact.selected ? artifact.selected : false; + this.originalDescription = artifact.description; + } + } + + public isHEAT = ():boolean => { + return Utils.Constants.ArtifactType.HEAT === this.artifactType.substring(0,4); + }; + + // public isEditableInInstanceLevel = ():boolean => { + // return true; + // }; + + public isThirdParty = ():boolean => { + return _.has(Utils.Constants.ArtifactType.THIRD_PARTY_RESERVED_TYPES, this.artifactType); + }; + + public toJSON = ():any => { + this.selected = undefined; + this.originalDescription = undefined; + return this; + }; + } +} + + diff --git a/catalog-ui/app/scripts/models/aschema-property.ts b/catalog-ui/app/scripts/models/aschema-property.ts new file mode 100644 index 0000000000..7ecc85c302 --- /dev/null +++ b/catalog-ui/app/scripts/models/aschema-property.ts @@ -0,0 +1,63 @@ +/*- + * ============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========================================================= + */ +/** + * Created by osonsino on 16/05/2016. + */ +/// +module Sdc.Models { + 'use strict'; + + export class SchemaPropertyGroupModel{ + property: SchemaProperty; + + constructor(schemaProperty?:Models.SchemaProperty) { + this.property = schemaProperty; + } + } + + export class SchemaProperty { + + type: string; + required: boolean; + definition: boolean; + description: string; + password: boolean; + //custom properties + simpleType: string; + + constructor(schemaProperty?:SchemaProperty) { + if(schemaProperty) { + this.type = schemaProperty.type; + this.required = schemaProperty.required; + this.definition = schemaProperty.definition; + this.description = schemaProperty.description; + this.password = schemaProperty.password; + this.simpleType = schemaProperty.simpleType; + } + } + + public toJSON = ():any => { + this.simpleType = undefined; + return this; + }; + } +} + + diff --git a/catalog-ui/app/scripts/models/attributes.ts b/catalog-ui/app/scripts/models/attributes.ts new file mode 100644 index 0000000000..ea4c7a5a23 --- /dev/null +++ b/catalog-ui/app/scripts/models/attributes.ts @@ -0,0 +1,139 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + export class AttributesGroup { + constructor(attributesObj?:Models.AttributesGroup) { + _.forEach(attributesObj, (attributes:Array, instance) => { + this[instance] = []; + _.forEach(attributes, (attribute:Models.AttributeModel):void => { + attribute.resourceInstanceUniqueId = instance; + attribute.readonly = true; + this[instance].push(new Models.AttributeModel(attribute)); + }); + }); + } + } + + export interface IAttributeModel { + + //server data + uniqueId:string; + name:string; + defaultValue:string; + description:string; + type:string; + schema:Models.SchemaAttributeGroupModel; + status:string; + value:string; + hidden:boolean; + parentUniqueId:string; + //custom data + resourceInstanceUniqueId:string; + readonly:boolean; + valueUniqueUid:string; + } + + export class AttributeModel implements IAttributeModel { + + //server data + uniqueId:string; + name:string; + defaultValue:string; + description:string; + type:string; + schema:Models.SchemaAttributeGroupModel; + status:string; + value:string; + hidden:boolean; + parentUniqueId:string; + //custom data + resourceInstanceUniqueId:string; + readonly:boolean; + valueUniqueUid:string; + + constructor(attribute?:Models.AttributeModel) { + if (attribute) { + this.uniqueId = attribute.uniqueId; + this.name = attribute.name; + this.defaultValue = attribute.defaultValue; + this.description = attribute.description; + this.type = attribute.type; + this.status = attribute.status; + this.schema = attribute.schema; + this.value = attribute.value; + this.hidden = attribute.hidden; + this.parentUniqueId = attribute.parentUniqueId; + this.resourceInstanceUniqueId = attribute.resourceInstanceUniqueId; + this.readonly = attribute.readonly; + this.valueUniqueUid = attribute.valueUniqueUid; + } + + if (!this.schema || !this.schema.property) { + this.schema = new Models.SchemaPropertyGroupModel(new Models.SchemaProperty()); + } else { + //forcing creating new object, so editing different one than the object in the table + this.schema = new Models.SchemaAttributeGroupModel(new Models.SchemaAttribute(this.schema.property)); + } + + this.convertValueToView(); + } + + public convertToServerObject:Function = ():string => { + if (this.defaultValue && this.type === 'map') { + this.defaultValue = '{' + this.defaultValue + '}'; + } + if (this.defaultValue && this.type === 'list') { + this.defaultValue = '[' + this.defaultValue + ']'; + } + this.defaultValue = this.defaultValue != "" && this.defaultValue != "[]" && this.defaultValue != "{}" ? this.defaultValue : null; + + return JSON.stringify(this); + }; + + + public convertValueToView() { + //unwrapping value {} or [] if type is complex + if (this.defaultValue && (this.type === 'map' || this.type === 'list') && + ['[', '{'].indexOf(this.defaultValue.charAt(0)) > -1 && + [']', '}'].indexOf(this.defaultValue.slice(-1)) > -1) { + this.defaultValue = this.defaultValue.slice(1, -1); + } + + //also for value - for the modal in canvas + if (this.value && (this.type === 'map' || this.type === 'list') && + ['[', '{'].indexOf(this.value.charAt(0)) > -1 && + [']', '}'].indexOf(this.value.slice(-1)) > -1) { + this.value = this.value.slice(1, -1); + } + } + + public toJSON = ():any => { + if (!this.resourceInstanceUniqueId) { + this.value = undefined; + } + this.readonly = undefined; + this.resourceInstanceUniqueId = undefined; + return this; + }; + } +} diff --git a/catalog-ui/app/scripts/models/capability.ts b/catalog-ui/app/scripts/models/capability.ts new file mode 100644 index 0000000000..815be5a389 --- /dev/null +++ b/catalog-ui/app/scripts/models/capability.ts @@ -0,0 +1,116 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 4/20/2016. + */ +/// +module Sdc.Models { + 'use strict'; + + //this is an object contains keys, when each key has matching array. + // for example: key = tosca.capabilities.network.Linkable and the match array is array of capabilities objects + export class CapabilitiesGroup { + constructor(capabilityGroupObj?:Models.CapabilitiesGroup) { + _.forEach(capabilityGroupObj, (capabilitiesArrayObj:Array, instance) => { + this[instance] = []; + _.forEach(capabilitiesArrayObj, (capability:Models.Capability):void => { + this[instance].push(new Models.Capability(capability)); + }); + }); + } + + public findValueByKey(keySubstring:string):Array { + let key:string = _.find(Object.keys(this), (key)=> { + return _.includes(key.toLowerCase(), keySubstring); + }); + return this[key]; + } + } + + export class Capability { + + //server data + name:string; + ownerId:string; + ownerName:string; + type:string; + uniqueId:string; + capabilitySources:Array; + minOccurrences:string; + maxOccurrences:string; + properties:Array; + description:string; + validSourceTypes:Array; + //custom + selected:boolean; + filterTerm:string; + + constructor(capability?:Capability) { + + if (capability) { + //server data + this.name = capability.name; + this.ownerId = capability.ownerId; + this.ownerName = capability.ownerName; + this.type = capability.type; + this.uniqueId = capability.uniqueId; + this.capabilitySources = capability.capabilitySources; + this.minOccurrences = capability.minOccurrences; + this.maxOccurrences = capability.maxOccurrences; + this.properties = capability.properties; + this.description = capability.description; + this.validSourceTypes = capability.validSourceTypes; + this.selected = capability.selected; + this.initFilterTerm(); + + } + } + + public getFullTitle():string { + let maxOccurrences:string = this.maxOccurrences === 'UNBOUNDED' ? '∞' : this.maxOccurrences; + return this.ownerName + ': ' + this.name + ': [' + this.minOccurrences + ', ' + maxOccurrences + ']'; + } + + public toJSON = ():any => { + this.selected = undefined; + this.filterTerm = undefined; + return this; + }; + + private initFilterTerm = ():void =>{ + this.filterTerm = this.name + " " + + (this.type ? (this.type.substring("tosca.capabilities.".length) + " " ) : "") + + (this.description||"") + " " + + (this.ownerName||"") + " " + + (this.validSourceTypes ? (this.validSourceTypes.join(',') + " ") : "") + + this.minOccurrences+","+this.maxOccurrences; + if(this.properties && this.properties.length){ + _.forEach(this.properties,(prop:Models.PropertyModel)=>{ + this.filterTerm += " "+ prop.name + + " " + (prop.description||"") + + " " + prop.type + + (prop.schema && prop.schema.property?(" " + prop.schema.property.type):""); + }); + } + } + } +} + + diff --git a/catalog-ui/app/scripts/models/category.ts b/catalog-ui/app/scripts/models/category.ts new file mode 100644 index 0000000000..730460cbc0 --- /dev/null +++ b/catalog-ui/app/scripts/models/category.ts @@ -0,0 +1,67 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + export class ICategoryBase { + + //server properties + name: string; + normalizedName: string; + uniqueId:string; + icons: Array; + + //custom properties + filterTerms: string; + isDisabled: boolean; + filteredGroup: Array; + + constructor(category?: ICategoryBase){ + if (category) { + this.name = category.name; + this.normalizedName = category.normalizedName; + this.icons = category.icons; + this.filterTerms = category.filterTerms; + this.isDisabled = category.isDisabled; + this.filteredGroup = category.filteredGroup; + } + } + } + + export class IMainCategory extends ICategoryBase { + subcategories:Array; + constructor(); + constructor(category?: IMainCategory){ + super(category); + if (category) { + this.subcategories = category.subcategories; + } + } + } + + export class ISubCategory extends ICategoryBase { + groupings:Array; + } + + export interface IGroup extends ICategoryBase { + } + +} diff --git a/catalog-ui/app/scripts/models/comments.ts b/catalog-ui/app/scripts/models/comments.ts new file mode 100644 index 0000000000..0f7643690d --- /dev/null +++ b/catalog-ui/app/scripts/models/comments.ts @@ -0,0 +1,33 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + export class AsdcComment{ + public userRemarks: string; + + constructor() { + } + } +} + + + diff --git a/catalog-ui/app/scripts/models/components/component.ts b/catalog-ui/app/scripts/models/components/component.ts new file mode 100644 index 0000000000..c0fb3a9fbb --- /dev/null +++ b/catalog-ui/app/scripts/models/components/component.ts @@ -0,0 +1,828 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/4/2016. + */ +/// +module Sdc.Models.Components { + 'use strict'; + import Util = jasmine.Util; + + export interface IComponent { + + //---------------------------------------------- API CALLS ----------------------------------------------------// + + //Component API + getComponent():ng.IPromise; + updateComponent():ng.IPromise; + createComponentOnServer():ng.IPromise; + changeLifecycleState(state:string, commentObj:Models.AsdcComment):ng.IPromise; + validateName(newName:string):ng.IPromise; + updateRequirementsCapabilities():ng.IPromise; + + //Artifacts API + addOrUpdateArtifact(artifact:ArtifactModel):ng.IPromise; + updateMultipleArtifacts(artifacts:Array):ng.IPromise; + deleteArtifact(artifactId:string, artifactLabel:string):ng.IPromise; + downloadInstanceArtifact(artifactId:string):ng.IPromise; + downloadArtifact(artifactId:string):ng.IPromise; + + //Property API + addOrUpdateProperty(property:Models.PropertyModel):ng.IPromise; + deleteProperty(propertyId:string):ng.IPromise; + updateInstanceProperty(property:Models.PropertyModel):ng.IPromise; + + //Attribute API + deleteAttribute(attributeId:string):ng.IPromise; + addOrUpdateAttribute(attribute:Models.AttributeModel):ng.IPromise; + updateInstanceAttribute(attribute:Models.AttributeModel):ng.IPromise; + + + + + //Component Instance API + createComponentInstance(componentInstance:Models.ComponentsInstances.ComponentInstance):ng.IPromise; + deleteComponentInstance(componentInstanceId:string):ng.IPromise; + addOrUpdateInstanceArtifact(artifact:Models.ArtifactModel):ng.IPromise; + deleteInstanceArtifact(artifactId:string, artifactLabel:string):ng.IPromise; + uploadInstanceEnvFile(artifact:Models.ArtifactModel): ng.IPromise; + changeComponentInstanceVersion(componentUid:string):ng.IPromise; + updateComponentInstance(componentInstance:Models.ComponentsInstances.ComponentInstance): ng.IPromise; + updateMultipleComponentInstances(instances: Array):ng.IPromise>; + + //Inputs API + getComponentInstanceInputProperties(componentInstanceId: string, inputId: string):ng.IPromise> + getComponentInputs(componentId: string):ng.IPromise>; + + createRelation(link:Models.RelationshipModel):ng.IPromise; + deleteRelation(link:Models.RelationshipModel):ng.IPromise; + + + //Modules + getModuleForDisplay(moduleId:string):ng.IPromise; + updateGroupMetadata(group:Models.Module):ng.IPromise; + //---------------------------------------------- HELP FUNCTIONS ----------------------------------------------------// + + getComponentSubType():string; + isAlreadyCertified():boolean; + isProduct():boolean; + isService():boolean; + isResource():boolean; + isComplex():boolean; + getAdditionalInformation():Array; + getAllVersionsAsSortedArray():Array; + getStatus(sdcMenu:Models.IAppMenu):string; + } + + + export class Component implements IComponent { + + //server data + public abstract:string; + public uniqueId:string; + public uuid:string; + public invariantUUID:string; + public name:string; + public version:string; + public creationDate:number; + public lastUpdateDate:number; + public description:string; + public lifecycleState:string; + public tags:Array; + public icon:string; + public contactId:string; + public allVersions:any; + public creatorUserId:string; + public creatorFullName:string; + public lastUpdaterUserId:string; + public lastUpdaterFullName:string; + public componentType:string; + public deploymentArtifacts:Models.ArtifactGroupModel; + public artifacts:Models.ArtifactGroupModel; + public toscaArtifacts:Models.ArtifactGroupModel; + public distributionStatus:string; + public categories:Array; + public componentInstancesProperties:Models.PropertiesGroup; + public componentInstancesAttributes:Models.AttributesGroup; + public componentInstancesRelations:Array; + public componentInstances:Array; + public inputs:Array; + public capabilities:Models.CapabilitiesGroup; + public requirements:Models.RequirementsGroup; + public additionalInformation:any; + public properties:Array; + public attributes:Array; + public highestVersion:boolean; + public vendorName:string; + public vendorRelease:string; + public derivedList:Array; + public interfaces:any; + public normalizedName:string; + public systemName:string; + public projectCode:string; + public groups:Array; + //custom properties + public componentService:Sdc.Services.Components.IComponentService; + public filterTerm:string; + public iconSprite:string; + public selectedInstance:Models.ComponentsInstances.ComponentInstance; + public mainCategory:string; + public subCategory:string; + public selectedCategory:string; + public showMenu:boolean; + + + constructor(componentService:Sdc.Services.Components.IComponentService, + protected $q:ng.IQService, + component?:Component) { + if (component) { + this.abstract = component.abstract; + this.uniqueId = component.uniqueId; + this.uuid = component.uuid; + this.invariantUUID = component.invariantUUID; + this.additionalInformation = component.additionalInformation; + this.artifacts = new Sdc.Models.ArtifactGroupModel(component.artifacts); + this.toscaArtifacts = new Sdc.Models.ArtifactGroupModel(component.toscaArtifacts); + this.contactId = component.contactId; + this.categories = component.categories; + this.creatorUserId = component.creatorUserId; + this.creationDate = component.creationDate; + this.creatorFullName = component.creatorFullName; + this.description = component.description; + this.icon = component.icon; + this.lastUpdateDate = component.lastUpdateDate; + this.lastUpdaterUserId = component.lastUpdaterUserId; + this.lastUpdaterFullName = component.lastUpdaterFullName; + this.lifecycleState = component.lifecycleState; + this.initComponentInstanceRelations(component.componentInstancesRelations); + this.componentInstancesProperties = new Models.PropertiesGroup(component.componentInstancesProperties); + this.componentInstancesAttributes = new Models.AttributesGroup(component.componentInstancesAttributes); + this.name = component.name; + this.version = component.version; + this.tags = component.tags; + this.capabilities = new Models.CapabilitiesGroup(component.capabilities); + this.requirements = new Models.RequirementsGroup(component.requirements); + this.allVersions = component.allVersions; + this.deploymentArtifacts = new Sdc.Models.ArtifactGroupModel(component.deploymentArtifacts); + this.componentType = component.componentType; + this.distributionStatus = component.distributionStatus; + this.highestVersion = component.highestVersion; + this.vendorName = component.vendorName; + this.vendorRelease = component.vendorRelease; + this.derivedList = component.derivedList; + this.interfaces = component.interfaces; + this.normalizedName = component.normalizedName; + this.systemName = component.systemName; + this.projectCode = component.projectCode; + this.inputs = component.inputs; + this.componentInstances = Utils.CommonUtils.initComponentInstances(component.componentInstances); + this.properties = Utils.CommonUtils.initProperties(component.properties, this.uniqueId); + this.attributes = Utils.CommonUtils.initAttributes(component.attributes, this.uniqueId); + this.selectedInstance = component.selectedInstance; + this.iconSprite = component.iconSprite; + this.showMenu = true; + this.groups = Utils.CommonUtils.initModules(component.groups); + } + + //custom properties + this.componentService = componentService; + } + + public setUniqueId = (uniqueId:string):void => { + this.uniqueId = uniqueId; + }; + + public setSelectedInstance = (componentInstance:Models.ComponentsInstances.ComponentInstance):void => { + this.selectedInstance = componentInstance; + }; + + //------------------------------------------ Init Functions ----------------------------------------------------------------// + + private initComponentInstanceRelations = (componentInstanceRelationsObj:Array):void => { + if (componentInstanceRelationsObj) { + this.componentInstancesRelations = []; + _.forEach(componentInstanceRelationsObj, (instanceRelation:Models.RelationshipModel):void => { + this.componentInstancesRelations.push(new Models.RelationshipModel(instanceRelation)); + }); + } + }; + //----------------------------------------------------------------------------------------------------------------------// + + //------------------------------------------ API Calls ----------------------------------------------------------------// + public changeLifecycleState = (state:string, commentObj:Models.AsdcComment):ng.IPromise => { + return this.componentService.changeLifecycleState(this, state, JSON.stringify(commentObj)); + }; + + public getComponent = ():ng.IPromise => { + return this.componentService.getComponent(this.uniqueId); + }; + + public createComponentOnServer = ():ng.IPromise => { + this.handleTags(); + return this.componentService.createComponent(this); + }; + + public updateComponent = ():ng.IPromise => { + this.handleTags(); + return this.componentService.updateComponent(this); + }; + + public validateName = (newName:string, subtype?:string):ng.IPromise => { + return this.componentService.validateName(newName, subtype); + }; + + public downloadArtifact = (artifactId:string):ng.IPromise => { + return this.componentService.downloadArtifact(this.uniqueId, artifactId); + }; + + public addOrUpdateArtifact = (artifact:ArtifactModel):ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = (artifactObj:Models.ArtifactModel):void => { + let newArtifact = new Models.ArtifactModel(artifactObj); + let artifacts = this.getArtifactsByType(artifactObj.artifactGroupType); + artifacts[artifactObj.artifactLabel] = newArtifact; + deferred.resolve(newArtifact); + }; + let onError = (error:any):void => { + deferred.reject(error); + }; + this.componentService.addOrUpdateArtifact(this.uniqueId, artifact).then(onSuccess, onError); + return deferred.promise; + }; + + public updateMultipleArtifacts = (artifacts:Array):ng.IPromise=> { + let deferred = this.$q.defer(); + let onSuccess = (response:any):void => { + deferred.resolve(response); + }; + let onError = (error:any):void => { + deferred.reject(error); + }; + let q = new Utils.Functions.QueueUtils(this.$q); + + _.forEach(artifacts, (artifact)=> { + q.addBlockingUIAction(()=> this.addOrUpdateArtifact(artifact).then(onSuccess, onError)); + }); + return deferred.promise; + }; + + + public deleteArtifact = (artifactId:string, artifactLabel:string):ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = (artifactObj:Models.ArtifactModel):void => { + let newArtifact = new Models.ArtifactModel(artifactObj); + let artifacts = this.getArtifactsByType(artifactObj.artifactGroupType); + if (newArtifact.mandatory || newArtifact.serviceApi) { + artifacts[newArtifact.artifactLabel] = newArtifact; + } + else { + delete artifacts[artifactLabel]; + } + deferred.resolve(newArtifact); + }; + this.componentService.deleteArtifact(this.uniqueId, artifactId, artifactLabel).then(onSuccess); + return deferred.promise; + }; + + + public addOrUpdateProperty = (property:Models.PropertyModel):ng.IPromise => { + let deferred = this.$q.defer(); + + let onError = (error:any):void => { + deferred.reject(error); + }; + + if (!property.uniqueId) { + let onSuccess = (property:Models.PropertyModel):void => { + let newProperty = new Models.PropertyModel(property); + this.properties.push(newProperty); + deferred.resolve(newProperty); + }; + this.componentService.addProperty(this.uniqueId, property).then(onSuccess, onError); + } + else { + let onSuccess = (newProperty:Models.PropertyModel):void => { + // find exist instance property in parent component for update the new value ( find bu uniqueId ) + let existProperty:Models.PropertyModel = _.find(this.properties, {uniqueId: newProperty.uniqueId}); + let propertyIndex = this.properties.indexOf(existProperty); + newProperty.readonly = this.uniqueId != newProperty.parentUniqueId; + this.properties[propertyIndex] = newProperty; + deferred.resolve(newProperty); + }; + this.componentService.updateProperty(this.uniqueId, property).then(onSuccess, onError); + } + return deferred.promise; + }; + + public addOrUpdateAttribute = (attribute:Models.AttributeModel):ng.IPromise => { + let deferred = this.$q.defer(); + + let onError = (error:any):void => { + deferred.reject(error); + }; + + if (!attribute.uniqueId) { + let onSuccess = (attribute:Models.AttributeModel):void => { + let newAttribute = new Models.AttributeModel(attribute); + this.attributes.push(newAttribute); + deferred.resolve(newAttribute); + }; + this.componentService.addAttribute(this.uniqueId, attribute).then(onSuccess, onError); + } + else { + let onSuccess = (newAttribute:Models.AttributeModel):void => { + let existAttribute:Models.AttributeModel = _.find(this.attributes, {uniqueId: newAttribute.uniqueId}); + let attributeIndex = this.attributes.indexOf(existAttribute); + newAttribute.readonly = this.uniqueId != newAttribute.parentUniqueId; + this.attributes[attributeIndex] = newAttribute; + deferred.resolve(newAttribute); + }; + this.componentService.updateAttribute(this.uniqueId, attribute).then(onSuccess, onError); + } + return deferred.promise; + }; + + public deleteProperty = (propertyId:string):ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = ():void => { + console.log("Property deleted"); + delete _.remove(this.properties, {uniqueId: propertyId})[0]; + deferred.resolve(); + }; + let onFailed = ():void => { + console.log("Failed to delete property"); + deferred.reject(); + }; + this.componentService.deleteProperty(this.uniqueId, propertyId).then(onSuccess, onFailed); + return deferred.promise; + }; + + public deleteAttribute = (attributeId:string):ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = ():void => { + console.log("Attribute deleted"); + delete _.remove(this.attributes, {uniqueId: attributeId})[0]; + }; + let onFailed = ():void => { + console.log("Failed to delete attribute"); + }; + this.componentService.deleteAttribute(this.uniqueId, attributeId).then(onSuccess, onFailed); + return deferred.promise; + }; + + public updateInstanceProperty = (property:Models.PropertyModel):ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = (newProperty:Models.PropertyModel):void => { + // find exist instance property in parent component for update the new value ( find bu uniqueId & path) + let existProperty:Models.PropertyModel = _.find(this.componentInstancesProperties[newProperty.resourceInstanceUniqueId], {uniqueId: newProperty.uniqueId,path: newProperty.path}); + let index = this.componentInstancesProperties[newProperty.resourceInstanceUniqueId].indexOf(existProperty); + this.componentInstancesProperties[newProperty.resourceInstanceUniqueId][index] = newProperty; + deferred.resolve(newProperty); + }; + let onFailed = (error:any):void => { + console.log('Failed to update property value'); + deferred.reject(error); + }; + this.componentService.updateInstanceProperty(this.uniqueId, property).then(onSuccess, onFailed); + return deferred.promise; + }; + + public updateInstanceAttribute = (attribute:Models.AttributeModel):ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = (newAttribute:Models.AttributeModel):void => { + let existAttribute:Models.AttributeModel = _.find(this.componentInstancesAttributes[newAttribute.resourceInstanceUniqueId], {uniqueId: newAttribute.uniqueId}); + let index = this.componentInstancesAttributes[newAttribute.resourceInstanceUniqueId].indexOf(existAttribute); + this.componentInstancesAttributes[newAttribute.resourceInstanceUniqueId][index] = newAttribute; + deferred.resolve(newAttribute); + }; + let onFailed = (error:any):void => { + console.log('Failed to update attribute value'); + deferred.reject(error); + }; + this.componentService.updateInstanceAttribute(this.uniqueId, attribute).then(onSuccess, onFailed); + return deferred.promise; + }; + + public downloadInstanceArtifact = (artifactId:string):ng.IPromise => { + return this.componentService.downloadInstanceArtifact(this.uniqueId, this.selectedInstance.uniqueId, artifactId); + }; + + public deleteInstanceArtifact = (artifactId:string, artifactLabel:string):ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = (artifactObj:Models.ArtifactModel):void => { + let newArtifact = new Models.ArtifactModel(artifactObj); + let artifacts = this.selectedInstance.deploymentArtifacts; + if (newArtifact.mandatory || newArtifact.serviceApi) {//????????? + artifacts[newArtifact.artifactLabel] = newArtifact; + } + else { + delete artifacts[artifactLabel]; + } + deferred.resolve(newArtifact); + }; + this.componentService.deleteInstanceArtifact(this.uniqueId,this.selectedInstance.uniqueId, artifactId, artifactLabel).then(onSuccess); + return deferred.promise; + }; + + public addOrUpdateInstanceArtifact = (artifact:ArtifactModel):ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = (artifactObj:Models.ArtifactModel):void => { + this.selectedInstance.deploymentArtifacts[artifactObj.artifactLabel] = artifactObj; + deferred.resolve(artifactObj); + }; + let onError = (error:any):void => { + deferred.reject(error); + }; + if(artifact.uniqueId){ + this.componentService.updateInstanceArtifact(this.uniqueId, this.selectedInstance.uniqueId, artifact).then(onSuccess, onError); + }else{ + this.componentService.addInstanceArtifact(this.uniqueId, this.selectedInstance.uniqueId, artifact).then(onSuccess, onError); + } + return deferred.promise; + }; + + public uploadInstanceEnvFile = (artifact:Models.ArtifactModel):ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = (artifactObj:Models.ArtifactModel):void => { + this.selectedInstance.deploymentArtifacts[artifactObj.artifactLabel] = artifactObj; + deferred.resolve(artifactObj); + }; + let onError = (error:any):void => { + deferred.reject(error); + }; + this.componentService.uploadInstanceEnvFile(this.uniqueId, this.selectedInstance.uniqueId, artifact).then(onSuccess, onError); + return deferred.promise; + }; + + //this function will update the instance version than the function call getComponent to update the current component and return the new instance version + public changeComponentInstanceVersion = (componentUid:string):ng.IPromise => { + let deferred = this.$q.defer(); + let onFailed = (error:any):void => { + deferred.reject(error); + }; + let onSuccess = (componentInstance:Models.ComponentsInstances.ComponentInstance):void => { + let onSuccess = (component:Models.Components.Component):void => { + component.setSelectedInstance(componentInstance); + deferred.resolve(component); + }; + this.getComponent().then(onSuccess, onFailed); + }; + this.componentService.changeResourceInstanceVersion(this.uniqueId, this.selectedInstance.uniqueId, componentUid).then(onSuccess, onFailed); + return deferred.promise; + }; + + public createComponentInstance = (componentInstance:Models.ComponentsInstances.ComponentInstance):ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = (instance:Models.ComponentsInstances.ComponentInstance):void => { + let onSuccess = (component:Models.Components.Component):void => { + this.componentInstances = Utils.CommonUtils.initComponentInstances(component.componentInstances); + this.componentInstancesProperties = new Models.PropertiesGroup(component.componentInstancesProperties); + this.componentInstancesAttributes = new Models.AttributesGroup(component.componentInstancesAttributes); + deferred.resolve(instance); + }; + this.getComponent().then(onSuccess); + }; + let onFailed = (error:any):void => { + deferred.reject(error); + }; + this.componentService.createComponentInstance(this.uniqueId, componentInstance).then(onSuccess, onFailed); + return deferred.promise; + }; + + public updateComponentInstance = (componentInstance:Models.ComponentsInstances.ComponentInstance):ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = (updatedInstance:Models.ComponentsInstances.ComponentInstance):void => { + let componentInstance:Models.ComponentsInstances.ComponentInstance = _.find(this.componentInstances, (instance:Models.ComponentsInstances.ComponentInstance) => { + return instance.uniqueId === updatedInstance.uniqueId; + }); + + let index = this.componentInstances.indexOf(componentInstance); + this.componentInstances[index] = componentInstance; + deferred.resolve(updatedInstance); + + }; + let onFailed = (error:any):void => { + deferred.reject(error); + }; + this.componentService.updateComponentInstance(this.uniqueId, componentInstance).then(onSuccess, onFailed); + return deferred.promise; + }; + + public updateMultipleComponentInstances = (instances: Array):ng.IPromise> => { + let deferred = this.$q.defer(); + let onSuccess = (updatedInstances:Array):void => { + deferred.resolve(updatedInstances); + }; + let onFailed = (error:any):void => { + deferred.reject(error); + }; + this.componentService.updateMultipleComponentInstances(this.uniqueId, instances).then(onSuccess, onFailed); + return deferred.promise; + }; + + public deleteComponentInstance = (componentInstanceId:string):ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = ():void => { + let onSuccess = (component:Models.Components.Component):void => { + this.componentInstances = Utils.CommonUtils.initComponentInstances(component.componentInstances); + this.componentInstancesProperties = new Models.PropertiesGroup(component.componentInstancesProperties); + this.componentInstancesAttributes = new Models.AttributesGroup(component.componentInstancesAttributes); + this.initComponentInstanceRelations(component.componentInstancesRelations); + deferred.resolve(); + }; + this.getComponent().then(onSuccess); + }; + let onFailed = (error:any):void => { + deferred.reject(error); + }; + this.componentService.deleteComponentInstance(this.uniqueId, componentInstanceId).then(onSuccess, onFailed); + return deferred.promise; + }; + + + public createRelation = (relation:Models.RelationshipModel):ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = (relation:Models.RelationshipModel):void => { + console.info('Link created successfully', relation); + if (!this.componentInstancesRelations) { + this.componentInstancesRelations = []; + } + this.componentInstancesRelations.push(new Models.RelationshipModel(relation)); + deferred.resolve(relation); + }; + let onFailed = (error:any):void => { + console.info('Failed to create relation', error); + deferred.reject(error); + }; + this.componentService.createRelation(this.uniqueId, relation).then(onSuccess, onFailed); + return deferred.promise; + }; + + public deleteRelation = (relation:Models.RelationshipModel):ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = (responseRelation:Models.RelationshipModel):void => { + console.log("Link Deleted In Server"); + let relationToDelete = _.find(this.componentInstancesRelations, (item) => { + return item.fromNode === relation.fromNode && item.toNode === relation.toNode && _.some(item.relationships, (relationship)=> { + return angular.equals(relation.relationships[0], relationship); + }); + }); + let index = this.componentInstancesRelations.indexOf(relationToDelete); + if (relationToDelete != undefined && index > -1) { + if (relationToDelete.relationships.length == 1) { + this.componentInstancesRelations.splice(index, 1); + } else { + this.componentInstancesRelations[index].relationships = + _.reject(this.componentInstancesRelations[index].relationships, relation.relationships[0]); + } + } else { + console.error("Error while deleting relation - the return delete relation from server was not found in UI") + } + deferred.resolve(relation); + }; + let onFailed = (error:any):void => { + console.error("Failed To Delete Link"); + deferred.reject(error); + }; + this.componentService.deleteRelation(this.uniqueId, relation).then(onSuccess, onFailed); + return deferred.promise; + }; + + public updateRequirementsCapabilities = ():ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = (response:any):void => { + this.capabilities = response.capabilities; + this.requirements = response.requirements; + deferred.resolve(response); + }; + let onFailed = (error:any):void => { + deferred.reject(error); + }; + this.componentService.getRequirementsCapabilities(this.uniqueId).then(onSuccess, onFailed); + return deferred.promise; + }; + + public getModuleForDisplay = (moduleId:string):ng.IPromise => { + + let deferred = this.$q.defer(); + let onSuccess = (response:Models.DisplayModule):void => { + deferred.resolve(response); + }; + let onFailed = (error:any):void => { + deferred.reject(error); + }; + this.componentService.getModuleForDisplay(this.uniqueId, moduleId).then(onSuccess, onFailed); + return deferred.promise; + }; + + // this function get all instances filtered by inputs and properties (optional) - if no search string insert - this function will + // get all the instances of the component (in service only VF instances) + public getComponentInstancesFilteredByInputsAndProperties = (searchText?:string):ng.IPromise> => { + + let deferred = this.$q.defer(); + let onSuccess = (response: Array):void => { + deferred.resolve(response); + }; + let onFailed = (error:any): void => { + deferred.reject(error); + }; + this.componentService.getComponentInstancesFilteredByInputsAndProperties(this.uniqueId, searchText).then(onSuccess, onFailed); + return deferred.promise; + }; + + + // get inputs for instance - Pagination function + public getComponentInputs = ():ng.IPromise> => { + + let deferred = this.$q.defer(); + let onSuccess = (inputsRes: Array):void => { + this.inputs = inputsRes; + deferred.resolve(inputsRes); + }; + let onFailed = (error:any): void => { + deferred.reject(error); + }; + this.componentService.getComponentInputs(this.uniqueId).then(onSuccess, onFailed); + return deferred.promise; + }; + + + // get inputs instance - Pagination function + public getComponentInstanceInputs = (componentInstanceId: string, originComponentUid: string):ng.IPromise> => { + + let deferred = this.$q.defer(); + let onSuccess = (response: Array):void => { + deferred.resolve(response); + }; + let onFailed = (error:any): void => { + deferred.reject(error); + }; + this.componentService.getComponentInstanceInputs(this.uniqueId, componentInstanceId, originComponentUid).then(onSuccess, onFailed); + return deferred.promise; + }; + + // get inputs inatnce - Pagination function + public getComponentInstanceInputProperties = (componentInstanceId: string, inputId: string):ng.IPromise> => { + + let deferred = this.$q.defer(); + let onSuccess = (response: Array):void => { + deferred.resolve(response); + }; + let onFailed = (error:any): void => { + deferred.reject(error); + }; + this.componentService.getComponentInstanceInputProperties(this.uniqueId, componentInstanceId, inputId).then(onSuccess, onFailed); + return deferred.promise; + }; + + public updateGroupMetadata = (module: Models.Module):ng.IPromise => { + + let deferred = this.$q.defer(); + + let onSuccess = (updatedModule:Models.Module):void => { + let groupIndex: number = _.indexOf(this.groups, _.find(this.groups, (module: Models.Module) => { + return module.uniqueId === updatedModule.uniqueId; + })); + + if(groupIndex !== -1) { + this.groups[groupIndex] = updatedModule; + } + deferred.resolve(updatedModule); + }; + let onFailed = (error:any):void => { + deferred.reject(error); + }; + + this.componentService.updateGroupMetadata(this.uniqueId, module).then(onSuccess, onFailed); + + return deferred.promise; + }; + + //------------------------------------------ Help Functions ----------------------------------------------------------------// + + public isProduct = ():boolean => { + return this instanceof Product; + }; + + public isService = ():boolean => { + return this instanceof Service; + }; + + public isResource = ():boolean => { + return this instanceof Resource; + }; + + public getComponentSubType = ():string => { + return this.componentType; + }; + + public isAlreadyCertified = ():boolean => { + return parseInt(this.version) >= 1; + }; + + public isComplex = ():boolean => { + return true; + }; + + //sort string version value from hash to sorted version (i.e 1.9 before 1.11) + private sortVersions = (v1:string, v2:string):number => { + let ver1 = v1.split('.'); + let ver2 = v2.split('.'); + let diff = parseInt(_.first(ver1)) - parseInt(_.first(ver2)); + if (!diff){ + return parseInt(_.last(ver1)) - parseInt(_.last(ver2)); + } + return diff; + }; + + public getAllVersionsAsSortedArray = ():Array => { + let res = []; + if(this.allVersions){ + let keys = Object.keys(this.allVersions).sort(this.sortVersions); + _.forEach(keys, (key)=> { + res.push({ + versionNumber: key, + versionId: this.allVersions[key] + }) + }); + } + return res; + }; + + public isLatestVersion = ():boolean => { + if (this.allVersions){ + return this.version === _.last(Object.keys(this.allVersions).sort(this.sortVersions)); + }else{ + return true; + } + + }; + + public getAdditionalInformation = ():Array => { + let additionalInformationObject:any = _.find(this.additionalInformation, (obj:any):boolean => { + return obj.parentUniqueId == this.uniqueId; + }); + if (additionalInformationObject) { + return additionalInformationObject.parameters; + } + return []; + }; + + public handleTags = ():void => { + let isContainTag = _.find(this.tags, (tag)=> { + return tag === this.name; + }); + if (!isContainTag) { + this.tags.push(this.name); + } + }; + + public getArtifactsByType = (artifactGroupType:string):Models.ArtifactGroupModel => { + switch (artifactGroupType) { + case Utils.Constants.ArtifactGroupType.DEPLOYMENT: + return this.deploymentArtifacts; + case Utils.Constants.ArtifactGroupType.INFORMATION: + return this.artifacts; + } + }; + + public getStatus =(sdcMenu:Models.IAppMenu):string =>{ + let status:string = sdcMenu.LifeCycleStatuses[this.lifecycleState].text; + if(this.lifecycleState == "CERTIFIED" && sdcMenu.DistributionStatuses[this.distributionStatus]) { + status = sdcMenu.DistributionStatuses[this.distributionStatus].text; + } + return status; + }; + + public toJSON = ():any => { + this.componentService = undefined; + this.filterTerm = undefined; + this.iconSprite = undefined; + this.mainCategory = undefined; + this.subCategory = undefined; + this.selectedInstance = undefined; + this.showMenu = undefined; + this.$q = undefined; + this.selectedCategory = undefined; + return this; + }; + } +} + diff --git a/catalog-ui/app/scripts/models/components/displayComponent.ts b/catalog-ui/app/scripts/models/components/displayComponent.ts new file mode 100644 index 0000000000..578f392470 --- /dev/null +++ b/catalog-ui/app/scripts/models/components/displayComponent.ts @@ -0,0 +1,98 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 7/5/2016. + */ +/// +module Sdc.Models { + 'use strict'; + + export class DisplayComponent { + + uniqueId:string; + displayName:string; + version:string; + mainCategory:string; + subCategory:string; + iconClass:string; + componentSubType:string; + searchFilterTerms:string; + certifiedIconClass:string; + icon:string; + isRequirmentAndCapabilitiesLoaded:boolean; + + constructor(public component:Models.Components.Component) { + this.icon = component.icon; + this.version = component.version; + this.uniqueId = component.uniqueId; + this.isRequirmentAndCapabilitiesLoaded = false; + + if (component.categories && component.categories[0] && component.categories[0].subcategories && component.categories[0].subcategories[0]) { + this.mainCategory = component.categories[0].name; + this.subCategory = component.categories[0].subcategories[0].name; + } else { + this.mainCategory = 'Generic'; + this.subCategory = 'Generic'; + } + if (component instanceof Models.Components.Resource) { + this.componentSubType = (component).resourceType; + } else { + this.componentSubType = component.componentType; + } + + this.initDisplayName(component.name); + this.searchFilterTerms = (this.displayName + ' ' + component.description + ' ' + component.tags.join(' ')).toLowerCase() + ' ' + component.version; + this.initIconSprite(component.icon); + this.certifiedIconClass = component.lifecycleState != 'CERTIFIED' ? 'non-certified' : ''; + if(component.icon === 'vl' || component.icon === 'cp') { + this.certifiedIconClass = this.certifiedIconClass + " " + 'smaller-icon'; + } + } + + public initDisplayName = (name:string):void => { + let newName = + _.last(_.last(_.last(_.last(_.last(_.last(_.last(_.last(name.split('tosca.nodes.')) + .split('network.')).split('relationships.')).split('org.openecomp.')).split('resource.nfv.')) + .split('nodes.module.')).split('cp.')).split('vl.')); + if (newName){ + this.displayName = newName; + } else { + this.displayName = name; + } + }; + + public initIconSprite = (icon:string ):void => { + switch (this.componentSubType) { + case Utils.Constants.ComponentType.SERVICE: + this.iconClass = "sprite-services-icons " + icon; + break; + case Utils.Constants.ComponentType.PRODUCT: + this.iconClass = "sprite-product-icons " + icon; + break; + default: + this.iconClass = "sprite-resource-icons " + icon; + } + } + + public getComponentSubType = ():string => { + return this.componentSubType; + }; + } +} diff --git a/catalog-ui/app/scripts/models/components/product.ts b/catalog-ui/app/scripts/models/components/product.ts new file mode 100644 index 0000000000..6ba3404afb --- /dev/null +++ b/catalog-ui/app/scripts/models/components/product.ts @@ -0,0 +1,109 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/4/2016. + */ +/// +module Sdc.Models.Components { + 'use strict'; + + export class Product extends Component{ + + public contacts:Array; + public componentService: Services.Components.IProductService; + public fullName: string; + + constructor(componentService: Services.Components.IProductService, $q:ng.IQService, component?:Product) { + super(componentService, $q, component); + + if(component) { + this.fullName = component.fullName; + this.filterTerm = this.name + ' ' + this.description + ' ' + (this.tags ? this.tags.toString() : '') + ' ' + this.version; + this.contacts = component.contacts; + } + this.componentService = componentService; + this.iconSprite = "sprite-product-icons"; + } + + public deleteGroup = (uniqueId: string): void => { + _.forEach(this.categories, (category: Models.IMainCategory) => { + _.forEach(category.subcategories, (subcategory:Models.ISubCategory) => { + subcategory.groupings = _.reject (subcategory.groupings, (group:Models.IGroup) => { + return group.uniqueId === uniqueId; + }); + if(subcategory.groupings.length == 0){ // if there is no groups, delete the subcategory + category.subcategories = _.reject (category.subcategories, (subcategoryObj:Models.ISubCategory) => { + return subcategoryObj.uniqueId === subcategory.uniqueId; + }); + if(category.subcategories.length == 0){ // if there is no subcategory, delete the category + this.categories = _.reject (this.categories , (categoryObj:Models.IMainCategory) => { + return categoryObj.uniqueId === category.uniqueId; + }); + } + } + }); + }); + }; + + private getCategoryObjectById = (categoriesArray:Array, categoryUniqueId:string):Models.ICategoryBase => { + let categorySelected = _.find(categoriesArray, (category) => { + return category.uniqueId === categoryUniqueId; + }); + return categorySelected; + }; + + public addGroup = (category: Models.IMainCategory, subcategory: Models.ISubCategory, group: Models.IGroup): void => { + if(!this.categories){ + this.categories = new Array(); + } + let existingCategory:Models.IMainCategory = this.getCategoryObjectById(this.categories, category.uniqueId); + let newGroup = angular.copy(group); + newGroup.filterTerms = undefined; + newGroup.isDisabled = undefined; + if(!existingCategory){ + let newCategory: Models.IMainCategory = angular.copy(category); + newCategory.filteredGroup = undefined; + newCategory.subcategories = []; + let newSubcategory:Models.ISubCategory = angular.copy(subcategory); + newSubcategory.groupings = []; + newSubcategory.groupings.push(newGroup); + newCategory.subcategories.push(newSubcategory); + this.categories.push(newCategory); + } + else{ + let existingSubcategory:Models.ISubCategory = this.getCategoryObjectById(existingCategory.subcategories, subcategory.uniqueId); + if(!existingSubcategory){ + let newSubcategory:Models.ISubCategory = angular.copy(subcategory); + newSubcategory.groupings = []; + newSubcategory.groupings.push(newGroup); + existingCategory.subcategories.push(newSubcategory); + + } else { + let existingGroup:Models.IGroup = this.getCategoryObjectById(existingSubcategory.groupings, group.uniqueId); + if(!existingGroup){ + existingSubcategory.groupings.push(newGroup); + } + } + } + }; + + } +} + diff --git a/catalog-ui/app/scripts/models/components/resource.ts b/catalog-ui/app/scripts/models/components/resource.ts new file mode 100644 index 0000000000..243ef3463c --- /dev/null +++ b/catalog-ui/app/scripts/models/components/resource.ts @@ -0,0 +1,185 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/3/2016. + */ +/// +module Sdc.Models.Components { + 'use strict'; + + export class Resource extends Component { + + public interfaces: any; + public derivedFrom:Array; + public componentService: Services.Components.IResourceService; + public resourceType:string; + public payloadData:string; + public payloadName:string; + public importedFile: Sdc.Directives.FileUploadModel; + + // Onboarding parameters + public csarUUID:string; + public csarVersion:string; + public csarPackageType:string; + public packageId:string; + + constructor(componentService: Services.Components.IResourceService, $q: ng.IQService, component?:Resource) { + super(componentService, $q, component); + if(component) { + + this.interfaces = component.interfaces; + this.derivedFrom = component.derivedFrom; + this.payloadData = component.payloadData ? component.payloadData : undefined; + this.payloadName = component.payloadName ? component.payloadName : undefined; + this.resourceType = component.resourceType; + this.csarUUID = component.csarUUID; + this.csarVersion = component.csarVersion; + this.filterTerm = this.name + ' ' + this.description + ' ' + (this.tags ? this.tags.toString() : '') + ' ' + this.version + ' ' + this.resourceType; + + if (component.categories && component.categories[0] && component.categories[0].subcategories && component.categories[0].subcategories[0]) { + component.mainCategory = component.categories[0].name; + component.subCategory = component.categories[0].subcategories[0].name; + this.selectedCategory = component.mainCategory + "_#_" + component.subCategory; + this.importedFile = component.importedFile; + } + } else { + this.resourceType = Utils.Constants.ResourceType.VF; + } + + this.componentService = componentService; + this.iconSprite = "sprite-resource-icons"; + } + + public getComponentSubType = ():string => { + return this.resourceType; + }; + + public isComplex = ():boolean => { + return this.resourceType === Utils.Constants.ResourceType.VF; + }; + + public isVl = ():boolean => { + return Utils.Constants.ResourceType.VL == this.resourceType; + }; + + public isCsarComponent = ():boolean => { + return !!this.csarUUID; + }; + + public createComponentOnServer = ():ng.IPromise => { + let deferred = this.$q.defer(); + let onSuccess = (component:Models.Components.Resource):void => { + this.payloadData = undefined; + this.payloadName = undefined; + deferred.resolve(component); + }; + let onError = (error:any):void => { + deferred.reject(error); + }; + + this.handleTags(); + if(this.importedFile){ + this.payloadData = this.importedFile.base64; + this.payloadName = this.importedFile.filename; + } + this.componentService.createComponent(this).then(onSuccess, onError); + return deferred.promise; + }; + + /* we need to change the name of the input to vfInstanceName + input name before sending to server in order to create the inputs on the service + * we also need to remove already selected inputs (the inputs that already create on server, and disabled in the view - but they are selected so they are still in the view model + */ + public createInputsFormInstances = (instanceInputsPropertiesMap:Models.InstanceInputsPropertiesMapData):ng.IPromise> => { + let deferred = this.$q.defer(); + /* + let instanceInputsPropertiesMapToCreate: Models.InstanceInputsPropertiesMapData = new Models.InstanceInputsPropertiesMapData(); + _.forEach(instanceInputsPropertiesMap, (properties:Array, instanceId:string) => { + + if(properties && properties.length > 0) { + let componentInstance:Models.ComponentsInstances.ComponentInstance = _.find(this.componentInstances, (instace:Models.ComponentsInstances.ComponentInstance) => { + return instace.uniqueId === instanceId; + }); + + instanceInputsPropertiesMapToCreate[instanceId] = new Array(); + _.forEach(properties, (property:Models.PropertyModel) => { + + if(!property.isAlreadySelected) { + let newInput = new Models.PropertyModel(property); + newInput.name = componentInstance.normalizedName + '_' + property.name; + instanceInputsPropertiesMapToCreate[instanceId].push(newInput); + } + }); + if( instanceInputsPropertiesMapToCreate[instanceId].length === 0) { + delete instanceInputsPropertiesMapToCreate[instanceId]; + } + } else { + delete instanceInputsPropertiesMapToCreate[instanceId]; + } + }); + + if(Object.keys(instanceInputsPropertiesMapToCreate).length > 0) { + let deferred = this.$q.defer(); + let onSuccess = (propertiesCreated: Array):void => { + this.inputs = propertiesCreated.concat(this.inputs); + deferred.resolve(propertiesCreated); + }; + let onFailed = (error:any): void => { + deferred.reject(error); + }; + this.componentService.createInputsFromInstancesInputsProperties(this.uniqueId, new Models.InstanceInputsPropertiesMap(instanceInputsPropertiesMapToCreate)).then(onSuccess, onFailed); + } + */ + return deferred.promise; + }; + + // we need to change the name of the input to vfInstanceName + input name before sending to server in order to create the inputs on the service + public getResourceInputInputs = (inputId:string):ng.IPromise> => { + let deferred = this.$q.defer(); + let onSuccess = (inputInputs: Array):void => { + let input: Models.InputModel = _.find(this.inputs, (input:Models.InputModel) => { + return input.uniqueId === inputId; + }); + input.inputs = inputInputs; + deferred.resolve(inputInputs); + }; + let onFailed = (error:any): void => { + deferred.reject(error); + }; + this.componentService.getComponentInputInputs(this.uniqueId, inputId).then(onSuccess, onFailed); + return deferred.promise; + }; + + public toJSON = ():any => { + this.componentService = undefined; + this.filterTerm = undefined; + this.iconSprite = undefined; + this.mainCategory = undefined; + this.subCategory = undefined; + this.selectedInstance = undefined; + this.showMenu = undefined; + this.$q = undefined; + this.selectedCategory = undefined; + this.importedFile = undefined; + return this; + }; + } +} + + diff --git a/catalog-ui/app/scripts/models/components/service.ts b/catalog-ui/app/scripts/models/components/service.ts new file mode 100644 index 0000000000..b1730aae94 --- /dev/null +++ b/catalog-ui/app/scripts/models/components/service.ts @@ -0,0 +1,147 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/4/2016. + */ +/// +module Sdc.Models.Components { + 'use strict'; + + + export class Service extends Component { + + public serviceApiArtifacts:Models.ArtifactGroupModel; + public componentService:Services.Components.IServiceService; + + constructor(componentService:Services.Components.IServiceService, $q:ng.IQService, component?:Service) { + super(componentService, $q, component); + if (component) { + this.serviceApiArtifacts = new Models.ArtifactGroupModel(component.serviceApiArtifacts); + this.filterTerm = this.name + ' ' + this.description + ' ' + (this.tags ? this.tags.toString() : '') + ' ' + this.version; + if (component.categories && component.categories[0]) { + this.mainCategory = component.categories[0].name; + this.selectedCategory = this.mainCategory; + } + } + this.componentService = componentService; + this.iconSprite = "sprite-services-icons"; + } + + public getDistributionsList = ():ng.IPromise> => { + return this.componentService.getDistributionsList(this.uuid); + }; + + public getDistributionsComponent = (distributionId:string):ng.IPromise> => { + return this.componentService.getDistributionComponents(distributionId); + }; + + public markAsDeployed = (distributionId:string):ng.IPromise => { + return this.componentService.markAsDeployed(this.uniqueId, distributionId); + }; + + /* we need to change the name of the input to vfInstanceName + input name before sending to server in order to create the inputs on the service + * we also need to remove already selected inputs (the inputs that already create on server, and disabled in the view - but they are selected so they are still in the view model + */ + public createInputsFormInstances = (instancesInputsMap:Models.InstancesInputsMapData):ng.IPromise> => { + let deferred = this.$q.defer(); + + let instancesInputsMapToCreate: Models.InstancesInputsMapData = new Models.InstancesInputsMapData(); + _.forEach(instancesInputsMap, (inputs:Array, instanceId:string) => { + + if(inputs && inputs.length > 0) { + let componentInstance:Models.ComponentsInstances.ComponentInstance = _.find(this.componentInstances, (instace:Models.ComponentsInstances.ComponentInstance) => { + return instace.uniqueId === instanceId; + }); + instancesInputsMapToCreate[instanceId] = new Array(); + _.forEach(inputs, (input:Models.InputModel) => { + + if(!input.isAlreadySelected) { + let newInput = new Models.InputModel(input); + newInput.name = componentInstance.normalizedName + '_' + input.name; + instancesInputsMapToCreate[instanceId].push(newInput); + } + }); + if( instancesInputsMapToCreate[instanceId].length === 0) { + delete instancesInputsMapToCreate[instanceId]; + } + } else { + delete instancesInputsMapToCreate[instanceId]; + } + }); + + if(Object.keys(instancesInputsMapToCreate).length > 0) { + let deferred = this.$q.defer(); + let onSuccess = (inputsCreated: Array):void => { + this.inputs = inputsCreated.concat(this.inputs); + deferred.resolve(inputsCreated); + }; + let onFailed = (error:any): void => { + deferred.reject(error); + }; + this.componentService.createInputsFromInstancesInputs(this.uniqueId, new Models.InstancesInputsMap(instancesInputsMapToCreate)).then(onSuccess, onFailed); + } + return deferred.promise; + }; + + // we need to change the name of the input to vfInstanceName + input name before sending to server in order to create the inputs on the service + public getServiceInputInputs = (inputId:string):ng.IPromise> => { + let deferred = this.$q.defer(); + let onSuccess = (inputInputs: Array):void => { + let input: Models.InputModel = _.find(this.inputs, (input:Models.InputModel) => { + return input.uniqueId === inputId; + }); + input.inputs = inputInputs; + deferred.resolve(inputInputs); + }; + let onFailed = (error:any): void => { + deferred.reject(error); + }; + this.componentService.getComponentInputInputs(this.uniqueId, inputId).then(onSuccess, onFailed); + return deferred.promise; + }; + + public deleteServiceInput = (inputId:string):ng.IPromise => { + var deferred = this.$q.defer(); + + var onSuccess = (input: Models.InputModel):void => { + deferred.resolve(input) + }; + + var onFailed = (error:any) : void => { + deferred.reject(error); + }; + + this.componentService.deleteComponentInput(this.uniqueId, inputId).then(onSuccess, onFailed); + return deferred.promise; + }; + + public getArtifactsByType = (artifactGroupType:string):Models.ArtifactGroupModel => { + switch (artifactGroupType) { + case Utils.Constants.ArtifactGroupType.DEPLOYMENT: + return this.deploymentArtifacts; + case Utils.Constants.ArtifactGroupType.INFORMATION: + return this.artifacts; + case Utils.Constants.ArtifactGroupType.SERVICE_API: + return this.serviceApiArtifacts; + } + }; + } +} + diff --git a/catalog-ui/app/scripts/models/componentsInstances/componentInstance.ts b/catalog-ui/app/scripts/models/componentsInstances/componentInstance.ts new file mode 100644 index 0000000000..af2f338998 --- /dev/null +++ b/catalog-ui/app/scripts/models/componentsInstances/componentInstance.ts @@ -0,0 +1,126 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/4/2016. + */ +/// +module Sdc.Models.ComponentsInstances { + 'use strict'; + + export class ComponentInstance{ + + public componentUid: string; + public componentName:string; + public posX: number; + public posY: number; + public componentVersion:string; + public description: string; + public icon: string; + public name: string; + public normalizedName:string; + public originType: string; + public deploymentArtifacts: Models.ArtifactGroupModel; + public propertyValueCounter: number; + public uniqueId: string; + public creationTime: number; + public modificationTime: number; + public capabilities: Models.CapabilitiesGroup; + public requirements: Models.RequirementsGroup; + + //custom properties + public certified: boolean; + public iconSprite:string; + public inputs: Array; + public properties: Array; + + constructor(componentInstance?: ComponentInstance) { + + if(componentInstance) { + this.componentUid = componentInstance.componentUid; + this.componentName = componentInstance.componentName; + + this.componentVersion = componentInstance.componentVersion; + this.description = componentInstance.description; + this.icon = componentInstance.icon; + this.name = componentInstance.name; + this.normalizedName = componentInstance.normalizedName; + this.originType = componentInstance.originType; + this.deploymentArtifacts = new Models.ArtifactGroupModel(componentInstance.deploymentArtifacts); + this.uniqueId = componentInstance.uniqueId; + this.creationTime = componentInstance.creationTime; + this.modificationTime = componentInstance.modificationTime; + this.propertyValueCounter = componentInstance.propertyValueCounter; + this.capabilities = new Models.CapabilitiesGroup(componentInstance.capabilities); + this.requirements = new Models.RequirementsGroup(componentInstance.requirements); + this.certified = componentInstance.certified; + this.updatePosition(componentInstance.posX, componentInstance.posY); + } + } + + public isUcpe = ():boolean =>{ + if(this.originType === 'VF' && this.capabilities && this.capabilities['tosca.capabilities.Container'] && this.name.toLowerCase().indexOf('ucpe') > -1){ + return true; + } + return false; + }; + + public isVl = ():boolean =>{ + return this.originType === 'VL'; + }; + + + public setInstanceRC = ():void=>{ + _.forEach(this.requirements, (requirementValue:Array, requirementKey)=> { + _.forEach(requirementValue, (requirement)=> { + if (!requirement.ownerName){ + requirement['ownerId'] = this.uniqueId; + requirement['ownerName'] = this.name; + } + }); + }); + _.forEach(this.capabilities, (capabilityValue:Array, capabilityKey)=> { + _.forEach(capabilityValue, (capability)=> { + if (!capability.ownerName){ + capability['ownerId'] = this.uniqueId; + capability['ownerName'] = this.name; + } + }); + }); + }; + + public updatePosition (posX:number, posY:number) { + this.posX = posX; + this.posY = posY; + } + + public toJSON = ():any => { + + var serverInstance = angular.copy(this); + serverInstance.certified = undefined; + serverInstance.iconSprite = undefined; + serverInstance.inputs = undefined; + serverInstance.properties = undefined; + serverInstance.requirements = undefined; + serverInstance.capabilities = undefined; + return serverInstance; + }; + } + +} diff --git a/catalog-ui/app/scripts/models/componentsInstances/productInstance.ts b/catalog-ui/app/scripts/models/componentsInstances/productInstance.ts new file mode 100644 index 0000000000..71ef9bb7d3 --- /dev/null +++ b/catalog-ui/app/scripts/models/componentsInstances/productInstance.ts @@ -0,0 +1,34 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/4/2016. + */ +/// +module Sdc.Models.ComponentsInstances { + 'use strict'; + + export class ProductInstance extends ComponentInstance{ + + constructor(componentInstance?: ProductInstance) { + super(componentInstance); + this.iconSprite = "sprite-product-icons"; + } + } +} diff --git a/catalog-ui/app/scripts/models/componentsInstances/resourceInstance.ts b/catalog-ui/app/scripts/models/componentsInstances/resourceInstance.ts new file mode 100644 index 0000000000..67df05ded9 --- /dev/null +++ b/catalog-ui/app/scripts/models/componentsInstances/resourceInstance.ts @@ -0,0 +1,36 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/4/2016. + */ +/// +module Sdc.Models.ComponentsInstances { + 'use strict'; + + export class ResourceInstance extends ComponentInstance{ + + constructor(componentInstance?: ResourceInstance) { + super(componentInstance); + + this.iconSprite = "sprite-resource-icons"; + } + } +} + diff --git a/catalog-ui/app/scripts/models/componentsInstances/serviceInstance.ts b/catalog-ui/app/scripts/models/componentsInstances/serviceInstance.ts new file mode 100644 index 0000000000..0d78feafd3 --- /dev/null +++ b/catalog-ui/app/scripts/models/componentsInstances/serviceInstance.ts @@ -0,0 +1,35 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/4/2016. + */ +/// +module Sdc.Models.ComponentsInstances { + 'use strict'; + + export class ServiceInstance extends ComponentInstance{ + + constructor(componentInstance?: ServiceInstance) { + super(componentInstance); + this.iconSprite = "sprite-services-icons"; + } + } +} + diff --git a/catalog-ui/app/scripts/models/csar-component.ts b/catalog-ui/app/scripts/models/csar-component.ts new file mode 100644 index 0000000000..da649c1efd --- /dev/null +++ b/catalog-ui/app/scripts/models/csar-component.ts @@ -0,0 +1,36 @@ +/*- + * ============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========================================================= + */ +module Sdc.Models { + 'use strict'; + + export interface ICsarComponent { + displayName:string; + description:string; + vspName:string; + version:string; + packageId:string; + category:string; + subCategory:string + vendorName:string; + packageType:string; + vendorRelease:string; + } + +} diff --git a/catalog-ui/app/scripts/models/data-type-properties.ts b/catalog-ui/app/scripts/models/data-type-properties.ts new file mode 100644 index 0000000000..973978d9b2 --- /dev/null +++ b/catalog-ui/app/scripts/models/data-type-properties.ts @@ -0,0 +1,65 @@ +/*- + * ============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========================================================= + */ +/** + * Created by rcohen on 9/25/2016. + */ +/// +module Sdc.Models { + 'use strict'; + + export class DataTypePropertyModel { + + //server data + uniqueId:string; + type:string; + required:boolean; + definition:boolean; + description:string; + password:boolean; + name:string; + parentUniqueId:string; + defaultValue:string; + constraints:Array; + //custom + simpleType:string; + + constructor(dataTypeProperty:DataTypePropertyModel) { + if (dataTypeProperty) { + this.uniqueId = dataTypeProperty.uniqueId; + this.type = dataTypeProperty.type; + this.required = dataTypeProperty.required; + this.definition = dataTypeProperty.definition; + this.description = dataTypeProperty.description; + this.password = dataTypeProperty.password; + this.name = dataTypeProperty.name; + this.parentUniqueId = dataTypeProperty.parentUniqueId; + this.defaultValue = dataTypeProperty.defaultValue; + this.constraints = dataTypeProperty.constraints; + this.simpleType = dataTypeProperty.simpleType; + } + } + + public toJSON = ():any => { + this.simpleType = undefined; + return this; + }; + } + +} diff --git a/catalog-ui/app/scripts/models/data-types-map.ts b/catalog-ui/app/scripts/models/data-types-map.ts new file mode 100644 index 0000000000..d1bee48e41 --- /dev/null +++ b/catalog-ui/app/scripts/models/data-types-map.ts @@ -0,0 +1,39 @@ +/*- + * ============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========================================================= + */ +/** + * Created by rcohen on 9/25/2016. + */ +/// +module Sdc.Models { + 'use strict'; + + export class DataTypesMapData { + [dataTypeId:string]: Array; + } + + export class DataTypesMap { + dataTypesMap:DataTypesMapData; + + constructor(dataTypesMap:DataTypesMapData) { + this.dataTypesMap = dataTypesMap; + } + } + +} diff --git a/catalog-ui/app/scripts/models/data-types.ts b/catalog-ui/app/scripts/models/data-types.ts new file mode 100644 index 0000000000..d7de238f3b --- /dev/null +++ b/catalog-ui/app/scripts/models/data-types.ts @@ -0,0 +1,55 @@ +/*- + * ============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========================================================= + */ +/** + * Created by rcohen on 9/25/2016. + */ +/// +module Sdc.Models { + 'use strict'; + + export class DataTypeModel { + + //server data + name:string; + uniqueId:string; + derivedFromName:string; + creationTime:string; + modificationTime:string; + properties:Array; + + constructor(dataType:DataTypeModel) { + if (dataType) { + this.uniqueId = dataType.uniqueId; + this.name = dataType.name; + this.derivedFromName = dataType.derivedFromName; + this.creationTime = dataType.creationTime; + this.modificationTime = dataType.modificationTime; + this.properties = dataType.properties; + } + } + + public toJSON = ():any => { + + return this; + }; + } + +} + diff --git a/catalog-ui/app/scripts/models/distribution.ts b/catalog-ui/app/scripts/models/distribution.ts new file mode 100644 index 0000000000..1c3a9568dd --- /dev/null +++ b/catalog-ui/app/scripts/models/distribution.ts @@ -0,0 +1,66 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + export class DistributionStatuses{ + public omfComponentID: string; + public url: string; + public timestamp:string; + public status: string; + + constructor() { + } + } + + + export class DistributionComponent{ + public omfComponentID: string; + public url: string; + public timestamp:string; + public status: string; + + constructor() { + } + } + + export class Distribution { + public distributionID:string; + public timestamp:string; + public userId:string; + public deployementStatus:string; + public distributionComponents:Array; + public statusCount:any; + //custom data + public dateFormat:string; + + constructor() { + } + public toJSON = ():any => { + this.dateFormat = undefined; + return this; + }; + + } + +} + + diff --git a/catalog-ui/app/scripts/models/file-download.ts b/catalog-ui/app/scripts/models/file-download.ts new file mode 100644 index 0000000000..8a74ed57c1 --- /dev/null +++ b/catalog-ui/app/scripts/models/file-download.ts @@ -0,0 +1,28 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + export interface IFileDownload{ + artifactName: string; + base64Contents:string; + } +} diff --git a/catalog-ui/app/scripts/models/graph/d2-node.ts b/catalog-ui/app/scripts/models/graph/d2-node.ts new file mode 100644 index 0000000000..16daa5470d --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/d2-node.ts @@ -0,0 +1,31 @@ +/*- + * ============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========================================================= + */ +/// + +// module Sdc.Models { +// +// export interface D2Node extends go.Node { +// //TODO:should be typesafe! +// resource: any; +// key:string; +// data:any; +// canvasPosition: {x:number;y:number}; +// } +// } diff --git a/catalog-ui/app/scripts/models/graph/graph-links/common-base-link.ts b/catalog-ui/app/scripts/models/graph/graph-links/common-base-link.ts new file mode 100644 index 0000000000..7d21c5d978 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/graph-links/common-base-link.ts @@ -0,0 +1,53 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 6/29/2016. + */ +/// +module Sdc.Models { + + export class CommonLinkBase { + + img:string; + color:string; + classes: string; + + //this is cytoscapejs fields + public source: string; + public target: string; + public type: string; + public isSdcElement: boolean; + + constructor() { + this.isSdcElement = true; + this.type = 'sdc-link'; + + } + + public setImage = (imgUrl: string) => { + this.img = imgUrl; + }; + + public setColor = (color: string) => { + this.color = color; + }; + + } +} diff --git a/catalog-ui/app/scripts/models/graph/graph-links/common-ci-link-base.ts b/catalog-ui/app/scripts/models/graph/graph-links/common-ci-link-base.ts new file mode 100644 index 0000000000..1e7416ac3e --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/graph-links/common-ci-link-base.ts @@ -0,0 +1,50 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 6/29/2016. + */ +/// +module Sdc.Models { + + export interface ICommonCiLinkBase { + + } + + export class CommonCiLinkBase extends CommonLinkBase implements ICommonCiLinkBase { + + relation:RelationshipModel; + + + constructor(relation?:RelationshipModel, singleRelationship?:Models.Relationship) { + super(); + if (relation) { + if(singleRelationship){ + this.relation = new Models.RelationshipModel(relation, singleRelationship); + }else{ + this.relation = new Models.RelationshipModel(relation); + } + this.source = relation.fromNode; + this.target = relation.toNode; + } else { + this.relation = new RelationshipModel(); + } + } + } +} diff --git a/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-link-base.ts b/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-link-base.ts new file mode 100644 index 0000000000..3587198615 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-link-base.ts @@ -0,0 +1,46 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + + export interface ICompositionCiLinkBase extends ICommonCiLinkBase{ + updateLinkDirection():void; + } + + export class CompositionCiLinkBase extends CommonCiLinkBase implements ICompositionCiLinkBase { + + type:string; + visible:boolean; + + constructor(relation?:RelationshipModel, singleRelationship?:Models.Relationship) { + super(relation, singleRelationship); + this.visible = true; + } + + public setRelation = (relation: Models.RelationshipModel) => { + this.relation = relation; + }; + + updateLinkDirection():void{ + this.source = this.relation.fromNode; + this.target = this.relation.toNode; + } + } +} diff --git a/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-simple-link.ts b/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-simple-link.ts new file mode 100644 index 0000000000..c2deddbfc3 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-simple-link.ts @@ -0,0 +1,31 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + + export class CompositionCiSimpleLink extends CompositionCiLinkBase { + + constructor(relation?:RelationshipModel, singleRelationship?:Models.Relationship) { + super(relation, singleRelationship); + this.color = Utils.Constants.GraphColors.BASE_LINK; + this.classes = 'simple-link'; + } + } +} diff --git a/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-ucpe-host-link.ts b/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-ucpe-host-link.ts new file mode 100644 index 0000000000..7a30c20eee --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-ucpe-host-link.ts @@ -0,0 +1,33 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 4/20/2016. + */ +/// +module Sdc.Models { + export class LinkUcpeHost extends CompositionCiLinkBase { + + constructor(relation?:RelationshipModel, singleRelationship?:Models.Relationship) { + super(relation, singleRelationship); + this.visible = false; + this.classes = "ucpe-host-link"; + } + } +} diff --git a/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-ucpe-link.ts b/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-ucpe-link.ts new file mode 100644 index 0000000000..5d035ccc2c --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-ucpe-link.ts @@ -0,0 +1,37 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + + export class CompositionCiUcpeLink extends CompositionCiLinkBase { + + isFromUcpe: boolean; + constructor(relation?:RelationshipModel, from?:boolean, singleRelation?:Relationship) { + super(relation, singleRelation); + this.isFromUcpe = from; + this.target = relation.toNode; + this.source = singleRelation.requirementOwnerId; + this.relation.relationships = [singleRelation]; + this.color = Utils.Constants.GraphColors.BASE_LINK; + } + + updateLinkDirection():void {} + } +} diff --git a/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-vl-link.ts b/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-vl-link.ts new file mode 100644 index 0000000000..a347db6cb5 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-vl-link.ts @@ -0,0 +1,34 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + + export class CompositionCiVLink extends CompositionCiLinkBase { + + constructor(relation?:RelationshipModel, singleRelationship?:Models.Relationship) { + super(relation, singleRelationship); + this.color = Utils.Constants.GraphColors.VL_LINK; + this.classes ='vl-link'; + } + + + + } +} diff --git a/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-vl-ucpe-link.ts b/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-vl-ucpe-link.ts new file mode 100644 index 0000000000..2ebc796cb9 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/graph-links/composition-graph-links/composition-ci-vl-ucpe-link.ts @@ -0,0 +1,33 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 4/20/2016. + */ +/// +module Sdc.Models { + + export class CompositionCiVlUcpeLink extends CompositionCiUcpeLink { + + constructor(relation?:RelationshipModel, from?:boolean, singleRelation?:Relationship) { + super(relation, from, singleRelation); + this.color = Utils.Constants.GraphColors.VL_LINK; + } + } +} diff --git a/catalog-ui/app/scripts/models/graph/graph-links/links-factory.ts b/catalog-ui/app/scripts/models/graph/graph-links/links-factory.ts new file mode 100644 index 0000000000..8f6cd6d321 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/graph-links/links-factory.ts @@ -0,0 +1,80 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 5/1/2016. + */ +/// +module Sdc.Utils { + 'use strict'; + + export class LinksFactory { + + constructor() { + } + + public createGraphLink = (cy: Cy.Instance, relation:Models.RelationshipModel, singleRelation:Models.Relationship):Models.CompositionCiLinkBase => { + + let newRelation:Models.CompositionCiLinkBase; + + let fromNode:Models.Graph.CompositionCiNodeBase = cy.getElementById(relation.fromNode).data(); + let toNode:Models.Graph.CompositionCiNodeBase = cy.getElementById(relation.toNode).data() ; + + if ((relation.fromNode && fromNode.isUcpePart) || (relation.toNode && toNode.isUcpePart )) { //Link from or to node inside ucpe + + if (singleRelation && singleRelation.relationship.type && singleRelation.relationship.type == 'tosca.relationships.HostedOn') { + newRelation = new Models.LinkUcpeHost(relation, singleRelation); + } else if (singleRelation.relationship.type && _.includes(singleRelation.relationship.type.toLowerCase(), 'link')) { + newRelation = new Models.CompositionCiVlUcpeLink(relation, fromNode.isUcpePart, singleRelation); + } else { + newRelation = new Models.CompositionCiUcpeLink(relation, fromNode.isUcpePart, singleRelation); + } + } else if (singleRelation.relationship.type && _.includes(singleRelation.relationship.type.toLowerCase(), 'link')) { + newRelation = new Models.CompositionCiVLink(relation, singleRelation); + } else { + newRelation = new Models.CompositionCiSimpleLink(relation, singleRelation); + } + + return newRelation; + }; + + public createUcpeHostLink = (relation:Models.RelationshipModel):Models.LinkUcpeHost => { + return new Models.LinkUcpeHost(relation); + }; + + public createVLLink = (relation:Models.RelationshipModel):Models.CompositionCiVLink => { + return new Models.CompositionCiVLink(relation); + } + + + public createModuleGraphLinks= (relation:Models.RelationshipModel, singleRelation:Models.Relationship):Models.ModuleCiLinkBase => { + + let newRelation:Models.ModuleCiLinkBase; + + if (_.includes(singleRelation.relationship.type.toLowerCase(), 'link')) { + newRelation = new Models.ModuleCiVlLink(relation, singleRelation); + } else { + newRelation = new Models.ModuleCiLinkBase(relation, singleRelation); + } + + return newRelation; + }; + + } +} diff --git a/catalog-ui/app/scripts/models/graph/graph-links/module-graph-links/module-ci-link-base.ts b/catalog-ui/app/scripts/models/graph/graph-links/module-graph-links/module-ci-link-base.ts new file mode 100644 index 0000000000..b85e7673f5 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/graph-links/module-graph-links/module-ci-link-base.ts @@ -0,0 +1,38 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 6/29/2016. + */ +/// +module Sdc.Models { + + export interface IModuleCiLinkBase extends ICommonCiLinkBase{ + + } + + export class ModuleCiLinkBase extends CommonCiLinkBase implements IModuleCiLinkBase { + + constructor(relation?:RelationshipModel, singleRelationship?:Models.Relationship) { + super(relation, singleRelationship); + this.color = Utils.Constants.GraphColors.BASE_LINK; + } + + } +} diff --git a/catalog-ui/app/scripts/models/graph/graph-links/module-graph-links/module-ci-vl-link.ts b/catalog-ui/app/scripts/models/graph/graph-links/module-graph-links/module-ci-vl-link.ts new file mode 100644 index 0000000000..a421610792 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/graph-links/module-graph-links/module-ci-vl-link.ts @@ -0,0 +1,37 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 6/29/2016. + */ +/// +module Sdc.Models { + + export interface IModuleCiVlLink extends ICommonCiLinkBase{ + + } + + export class ModuleCiVlLink extends CommonCiLinkBase implements IModuleCiVlLink { + + constructor(relation?:RelationshipModel, singleRelationship?:Models.Relationship) { + super(relation, singleRelationship); + this.color = Utils.Constants.GraphColors.VL_LINK; + } + } +} diff --git a/catalog-ui/app/scripts/models/graph/graphTooltip.ts b/catalog-ui/app/scripts/models/graph/graphTooltip.ts new file mode 100644 index 0000000000..08a85e1126 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/graphTooltip.ts @@ -0,0 +1,38 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + export class GraphTooltip{ + position: Cy.Position; + isShow:boolean; + text:string; + + constructor(); + constructor(position: Cy.Position, isShow:boolean, text: string); + constructor(position?: Cy.Position, isShow?:boolean, text?: string) { + this.position = position; + this.isShow = isShow; + this.text = text; + } + } +} + diff --git a/catalog-ui/app/scripts/models/graph/link-menu.ts b/catalog-ui/app/scripts/models/graph/link-menu.ts new file mode 100644 index 0000000000..606c392982 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/link-menu.ts @@ -0,0 +1,38 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + export class LinkMenu { + position:Sdc.Models.Graph.Point; + isShow:boolean; + link:Cy.CollectionFirstEdge; + + constructor(); + constructor(point:Sdc.Models.Graph.Point, isShow:boolean, link:Cy.CollectionFirstEdge); + constructor(point?:Sdc.Models.Graph.Point, isShow?:boolean, link?:Cy.CollectionFirstEdge) { + this.position = point ? point: new Sdc.Models.Graph.Point(); + this.isShow = isShow ? isShow : false; + this.link = link ? link : null; + } + } +} + diff --git a/catalog-ui/app/scripts/models/graph/match-relation.ts b/catalog-ui/app/scripts/models/graph/match-relation.ts new file mode 100644 index 0000000000..8d864c675b --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/match-relation.ts @@ -0,0 +1,109 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + export class MatchBase { + requirement:Models.Requirement; + isFromTo:boolean; + fromNode:string; + toNode:string; + + constructor(requirement:Models.Requirement, isFromTo:boolean, fromNode:string, toNode:string) { + this.requirement = requirement; + this.isFromTo = isFromTo; + this.fromNode = fromNode; + this.toNode = toNode; + } + + public getDisplayText = (menuSide:string):string => {return '';}; + + public isOwner = (id:string):boolean => { return false; } + + } + + export class MatchReqToReq extends MatchBase { + + secondRequirement:Models.Requirement; + + constructor(requirement:Models.Requirement, secondRequirement:Models.Requirement, isFromTo:boolean, fromNode:string, toNode:string) { + super(requirement, isFromTo, fromNode, toNode); + this.secondRequirement = secondRequirement; + } + + public getDisplayText = (menuSide:string):string => { + if ('left' == menuSide) { + return this.requirement.getFullTitle(); + } + return this.secondRequirement.getFullTitle(); + }; + + public isOwner = (id:string):boolean => { + return this.secondRequirement.ownerId === id || this.requirement.ownerId === id; + } + } + + export class MatchReqToCapability extends MatchBase { + + capability:Models.Capability; + + constructor(requirement:Models.Requirement, capability:Models.Capability, isFromTo:boolean, fromNode:string, toNode:string) { + super(requirement, isFromTo, fromNode, toNode); + this.capability = capability; + } + + public matchToRelation = ():Models.Relationship => { + let relationship:Models.Relationship = new Models.Relationship(); + relationship.capability = this.capability.name; + relationship.capabilityOwnerId = this.capability.ownerId; + relationship.capabilityUid = this.capability.uniqueId; + relationship.relationship = new Models.RelationType(this.capability.type); + relationship.requirement = this.requirement.name; + relationship.requirementOwnerId = this.requirement.ownerId; + relationship.requirementUid = this.requirement.uniqueId; + return relationship; + }; + + + public getDisplayText = (menuSide:string):string => { + if (this.isFromTo && 'left' == menuSide || !this.isFromTo && 'right' == menuSide) { + return this.requirement.getFullTitle(); + } + return this.capability.getFullTitle(); + + }; + + public isOwner = (id:string):boolean => { + return this.capability.ownerId === id || this.requirement.ownerId === id; + }; + + + public matchToRelationModel = ():Models.RelationshipModel => { + let relationshipModel:Models.RelationshipModel = new Models.RelationshipModel(); + let relationship:Models.Relationship = this.matchToRelation(); + relationshipModel.setRelationshipModelParams(this.fromNode, this.toNode, [relationship]); + return relationshipModel; + }; + } + +} + + diff --git a/catalog-ui/app/scripts/models/graph/nodes/base-common-node.ts b/catalog-ui/app/scripts/models/graph/nodes/base-common-node.ts new file mode 100644 index 0000000000..e1957e61aa --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/nodes/base-common-node.ts @@ -0,0 +1,73 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 6/29/2016. + */ +/// + +module Sdc.Models.Graph { + 'use strict'; + + export abstract class CommonNodeBase { + + public displayName:string; + public name:string; + public img:string; + public certified:boolean; + public isGroup:boolean; + public imagesPath: string; + public isDraggable: boolean; //we need to to manage manually the dragging on the graph inside groups (ucpe-cp is not draggable) + + //cytoscape fields + public id:string; + public type:string; //type is for the edge edition extension, by type we put the green plus icon in position + public isSdcElement:boolean; //this fields is in order to filter sdc elements from all extensions elements + public classes: string; + public parent: string; + public allowConnection: boolean; //this is for egeEdition extension in order to decide if connection to a node is available + + constructor() { + + this.imagesPath = Services.AngularJSBridge.getAngularConfig().imagesPath; + this.type = "basic-node"; + this.isSdcElement = true; + this.isDraggable = true; + this.allowConnection = true; + } + + public updateNameForDisplay =() => { + let context = document.createElement("canvas").getContext("2d"); + context.font = "13px Arial"; + + if (63 < context.measureText(this.name).width) { + let newLen = this.name.length - 3; + let newName = this.name.substring(0, newLen); + + while (60 < (context.measureText(newName).width)) { + newName = newName.substring(0, (--newLen)); + } + this.displayName = newName + '...'; + return; + } + + this.displayName = this.name; + }; + } +} diff --git a/catalog-ui/app/scripts/models/graph/nodes/common-ci-node-base.ts b/catalog-ui/app/scripts/models/graph/nodes/common-ci-node-base.ts new file mode 100644 index 0000000000..1597650654 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/nodes/common-ci-node-base.ts @@ -0,0 +1,46 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models.Graph { + + export abstract class CommonCINodeBase extends CommonNodeBase { + + public certified:boolean; + public template:string; + public componentInstance:Models.ComponentsInstances.ComponentInstance; + public group:string; + + constructor(instance:Models.ComponentsInstances.ComponentInstance) { + super(); + this.componentInstance = instance; + this.id = this.componentInstance.uniqueId; + this.name = this.componentInstance.name; + this.img = ''; + this.certified = this.isCertified(this.componentInstance.componentVersion); + this.displayName = instance.name; + } + + private isCertified(version:string):boolean { + return 0 === (parseFloat(version)) % 1; + } + + } +} + diff --git a/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-base.ts b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-base.ts new file mode 100644 index 0000000000..5f4c0df3c2 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-base.ts @@ -0,0 +1,72 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.Models.Graph { + + export interface ICompositionCiNodeBase { + + } + + + export abstract class CompositionCiNodeBase extends CommonCINodeBase implements ICompositionCiNodeBase { + + public textPosition: string; //need to move to cp UCPE + public isUcpe: boolean; + public isInsideGroup: boolean; + public isUcpePart: boolean; + + constructor(instance: Models.ComponentsInstances.ComponentInstance, + public imageCreator: Utils.ImageCreatorService) { + super(instance); + this.init(); + } + + private init() { + + this.displayName = this.getDisplayName(); + this.isUcpe = false; + this.isGroup = false; + this.isUcpePart = false; + this.isInsideGroup = false; + + } + + public initImage(node: Cy.Collection): string { + + this.imageCreator.getImageBase64(this.imagesPath + Utils.Constants.ImagesUrl.RESOURCE_ICONS + this.componentInstance.icon + '.png', + this.imagesPath + Utils.Constants.ImagesUrl.RESOURCE_ICONS + 'uncertified.png') + .then(imageBase64 => { + this.img = imageBase64; + node.style({'background-image': this.img}); + }); + + return this.img; + } + + protected getDisplayName(): string { + + let graphResourceName = Services.AngularJSBridge.getFilter('graphResourceName'); + let resourceName = Services.AngularJSBridge.getFilter('resourceName'); + return graphResourceName(resourceName(this.componentInstance.name)); + } + + } +} diff --git a/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-cp.ts b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-cp.ts new file mode 100644 index 0000000000..6286c8245d --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-cp.ts @@ -0,0 +1,48 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.Models.Graph { + + export class CompositionCiNodeCp extends CompositionCiNodeBase { + + constructor(instance:Models.ComponentsInstances.ComponentInstance, + imageCreator: Utils.ImageCreatorService) { + super(instance, imageCreator); + this.initCp(); + } + + private initCp():void { + let sdcConfig = Services.AngularJSBridge.getAngularConfig(); + this.img = sdcConfig.imagesPath + Utils.Constants.ImagesUrl.RESOURCE_ICONS + this.componentInstance.icon + '.png'; + this.type = "basic-small-node"; + //if the cp from type cpEndPointInstances create with another template + if(sdcConfig.cpEndPointInstances.indexOf(this.componentInstance.icon) > -1){ + this.classes = 'cp-end-point-node'; + }else { + this.classes = 'cp-node'; + } + if(!this.certified) { + this.classes = this.classes + ' not-certified'; + } + + } + } +} diff --git a/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-service.ts b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-service.ts new file mode 100644 index 0000000000..41bf0cef98 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-service.ts @@ -0,0 +1,42 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.Models.Graph { + + export class CompositionCiNodeService extends CompositionCiNodeBase { + + constructor(instance:Models.ComponentsInstances.ComponentInstance, + imageCreator: Utils.ImageCreatorService) { + super(instance, imageCreator); + this.initService(); + } + + private initService():void { + + this.img = this.imagesPath + Utils.Constants.ImagesUrl.SERVICE_ICONS + this.componentInstance.icon + '.png'; + this.classes = 'service-node' + if(!this.certified) { + this.classes = this.classes + ' not-certified'; + } + + } + } +} diff --git a/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe-cp.ts b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe-cp.ts new file mode 100644 index 0000000000..9123ff7224 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe-cp.ts @@ -0,0 +1,39 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.Models.Graph { + + export class CompositionCiNodeUcpeCp extends CompositionCiNodeCp { + + constructor(instance:Models.ComponentsInstances.ComponentInstance, + imageCreator: Utils.ImageCreatorService) { + super(instance, imageCreator); + this.isUcpePart = true; + this.classes = 'ucpe-cp'; // the css class for the node + this.parent = instance.uniqueId; + this.type = 'ucpe-cp-node'; //the type is for the handle (plus icon) extension + this.isDraggable = false; + } + + + + } +} diff --git a/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe.ts b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe.ts new file mode 100644 index 0000000000..bc91e004f4 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-ucpe.ts @@ -0,0 +1,50 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.Models.Graph { + + export class NodeUcpe extends CompositionCiNodeBase { + constructor(instance:Models.ComponentsInstances.ComponentInstance, + imageCreator:Utils.ImageCreatorService) { + super(instance, imageCreator); + this.initUcpe(); + } + + private initUcpe():void { + this.isUcpe = true; + this.isGroup = true; + this.isUcpePart = true; + this.classes = 'ucpe-node'; + this.type = 'ucpe-node'; + this.allowConnection = false; + + if (!this.certified) { + this.classes = this.classes + ' not-certified-ucpe'; + } + } + + } +} + + + + + diff --git a/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-vf.ts b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-vf.ts new file mode 100644 index 0000000000..d090960046 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-vf.ts @@ -0,0 +1,41 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.Models.Graph { + + export class CompositionCiNodeVf extends CompositionCiNodeBase { + + constructor(instance: Models.ComponentsInstances.ComponentInstance, + imageCreator: Utils.ImageCreatorService) { + super(instance, imageCreator); + this.initVf(); + } + + private initVf(): void { + this.img = this.imagesPath + Utils.Constants.ImagesUrl.RESOURCE_ICONS + this.componentInstance.icon + '.png'; + this.classes = 'vf-node'; + if(!this.certified) { + this.classes = this.classes + ' not-certified'; + } + } + + } +} diff --git a/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-vfc.ts b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-vfc.ts new file mode 100644 index 0000000000..04f45c87fb --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-vfc.ts @@ -0,0 +1,33 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.Models.Graph { + export class CompositionCiNodeVfc extends CompositionCiNodeBase { + constructor(instance:Models.ComponentsInstances.ComponentInstance, imageCreator: Utils.ImageCreatorService) { + super(instance, imageCreator); + this.initVfc(); + } + + private initVfc():void { + this.img = this.imagesPath + Utils.Constants.ImagesUrl.RESOURCE_ICONS+ this.componentInstance.icon + '.png'; + } + } +} diff --git a/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-vl.ts b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-vl.ts new file mode 100644 index 0000000000..ed9a0d9d87 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/nodes/composition-graph-nodes/composition-ci-node-vl.ts @@ -0,0 +1,54 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.Models.Graph { + + export class CompositionCiNodeVl extends CompositionCiNodeBase { + private toolTipText:string; + + constructor(instance:Models.ComponentsInstances.ComponentInstance, imageCreator: Utils.ImageCreatorService) { + super(instance, imageCreator); + this.initVl(); + + } + + private initVl():void { + this.type = "basic-small-node"; + this.toolTipText = 'Point to point'; + let key:string = _.find(Object.keys(this.componentInstance.capabilities), (key)=> { + return _.includes(key.toLowerCase(), 'linkable'); + }); + let linkable = this.componentInstance.capabilities[key]; + if (linkable) { + if ('UNBOUNDED' == linkable[0].maxOccurrences) { + this.toolTipText = 'Multi point'; + } + } + this.img = this.imagesPath + Utils.Constants.ImagesUrl.RESOURCE_ICONS + 'vl.png'; + + this.classes = 'vl-node'; + if(!this.certified) { + this.classes = this.classes + ' not-certified'; + } + } + + } +} diff --git a/catalog-ui/app/scripts/models/graph/nodes/modules-graph-nodes/module-node-base.ts b/catalog-ui/app/scripts/models/graph/nodes/modules-graph-nodes/module-node-base.ts new file mode 100644 index 0000000000..cd6ab3ba85 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/nodes/modules-graph-nodes/module-node-base.ts @@ -0,0 +1,52 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 6/29/2016. + */ +/// + +module Sdc.Models.Graph { + 'use strict'; + + export interface IModuleNodeBase { + } + + export class ModuleNodeBase extends CommonNodeBase implements IModuleNodeBase { + + module:Module; + + constructor(module:Module) { + super(); + this.module = module; + this.init(); + } + + private init() { + + this.id = this.module.uniqueId; + this.name = this.module.name; + this.displayName = this.module.name; + this.isGroup = true; + this.img = Utils.Constants.IMAGE_PATH + Utils.Constants.ImagesUrl.MODULE_ICON; + this.classes = "module-node"; + + } + } +} diff --git a/catalog-ui/app/scripts/models/graph/nodes/nodes-factory.ts b/catalog-ui/app/scripts/models/graph/nodes/nodes-factory.ts new file mode 100644 index 0000000000..b19b1a7261 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/nodes/nodes-factory.ts @@ -0,0 +1,63 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Utils { + 'use strict'; + + export class NodesFactory { + + constructor( + private imageCreator:ImageCreatorService) { + } + + public createNode = (instance:Models.ComponentsInstances.ComponentInstance):Models.Graph.CompositionCiNodeBase => { + + if (instance.isUcpe()) { + return new Models.Graph.NodeUcpe(instance, this.imageCreator); + } + if (instance.originType === Utils.Constants.ComponentType.SERVICE) { + return new Models.Graph.CompositionCiNodeService(instance, this.imageCreator); + } + if (instance.originType === Utils.Constants.ResourceType.CP) { + return new Models.Graph.CompositionCiNodeCp(instance, this.imageCreator); + } + if (instance.originType === Utils.Constants.ResourceType.VL) { + return new Models.Graph.CompositionCiNodeVl(instance, this.imageCreator); + } + + return new Models.Graph.CompositionCiNodeVf(instance, this.imageCreator); + }; + + public createModuleNode = (module:Models.Module):Models.Graph.ModuleNodeBase => { + + return new Models.Graph.ModuleNodeBase(module); + }; + + public createUcpeCpNode = (instance:Models.ComponentsInstances.ComponentInstance):Models.Graph.CompositionCiNodeCp => { + + + return new Models.Graph.CompositionCiNodeUcpeCp(instance, this.imageCreator); + } + } + + NodesFactory.$inject = [ + 'ImageCreatorService' + ]; +} diff --git a/catalog-ui/app/scripts/models/graph/point.ts b/catalog-ui/app/scripts/models/graph/point.ts new file mode 100644 index 0000000000..0efd4c6040 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/point.ts @@ -0,0 +1,26 @@ +/** + * Created by obarda on 11/7/2016. + */ +/// + +module Sdc.Models.Graph { + + + export class Point { + /** + * The two-argument constructor produces the Point(x, y). + * @param {number} x + * @param {number} y + */ + constructor(x?:number, y?:number) { + this.x = x || 0; + this.y = y || 0; + } + + /**Gets or sets the x value of the Point.*/ + x:number; + + /**Gets or sets the y value of the Point.*/ + y:number; + } +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/models/graph/relationMenuObjects.ts b/catalog-ui/app/scripts/models/graph/relationMenuObjects.ts new file mode 100644 index 0000000000..266ed76cfa --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/relationMenuObjects.ts @@ -0,0 +1,138 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + + export class RelationMenuDirectiveObj { + + fromNode:Models.Graph.CompositionCiNodeBase; + toNode:Models.Graph.CompositionCiNodeBase; + // modelLinks:Array; + mp2mpVL:Models.Components.Component; + p2pVL:Models.Components.Component; + menuPosition: Cy.Position; + rightSideLink:GraphLinkMenuSide; + leftSideLink:GraphLinkMenuSide; + selectionText:string; + vlType:string; + + constructor(fromNode:Models.Graph.CompositionCiNodeBase, toNode:Models.Graph.CompositionCiNodeBase, mp2mpVL:Models.Components.Component, p2pVL:Models.Components.Component, menuPosition:Cy.Position, possibleRelations:Array) { + this.fromNode = fromNode; + this.toNode = toNode; + // this.modelLinks = modelLinks; + this.mp2mpVL = mp2mpVL; + this.p2pVL = p2pVL; + this.menuPosition = menuPosition; + this.leftSideLink = new GraphLinkMenuSide(this.fromNode.componentInstance); + this.rightSideLink = new GraphLinkMenuSide(this.toNode.componentInstance); + this.selectionText = ''; + this.vlType = null; + + possibleRelations.forEach((match:any) => { + + let reqObjKey: string = match.requirement.ownerName + match.requirement.uniqueId; + let capObjKey: string = match.secondRequirement ? match.secondRequirement.ownerName + match.secondRequirement.uniqueId + : match.capability.ownerName + match.capability.uniqueId; + + if (match.fromNode === this.leftSideLink.componentInstance.uniqueId) { + //init the left side requirements Array + if (!this.leftSideLink.requirements[reqObjKey]) { + this.leftSideLink.requirements[reqObjKey] = []; + } + //push the match to fromNode object (from node is always the requirement) + this.leftSideLink.requirements[reqObjKey].push(match); + + if (match instanceof Models.MatchReqToReq) { + //init the right side requirements Array + if (!this.rightSideLink.requirements[capObjKey]) { + this.rightSideLink.requirements[capObjKey] = []; + } + this.rightSideLink.requirements[capObjKey].push(match); + } else { + //init the right side capabilities Array + if (!this.rightSideLink.capabilities[capObjKey]) { + this.rightSideLink.capabilities[capObjKey] = []; + } + //add to array + this.rightSideLink.capabilities[capObjKey].push(match); + } + + } else { + if (!this.rightSideLink.requirements[reqObjKey]) { + this.rightSideLink.requirements[reqObjKey] = []; + } + this.rightSideLink.requirements[reqObjKey].push(match); + + if (!this.leftSideLink.capabilities[capObjKey]) { + this.leftSideLink.capabilities[capObjKey] = []; + } + this.leftSideLink.capabilities[capObjKey].push(match); + } + }); + + } + } + + + export class GraphLinkMenuSide { + public componentInstance:Models.ComponentsInstances.ComponentInstance; + public selectedMatch:Array; //match array returned by function in utils + public requirements:any; //array of matches returned by function in utils + public capabilities:any; //array of matches returned by function in utils + + constructor(componentInstance:Models.ComponentsInstances.ComponentInstance) { + this.componentInstance = componentInstance; + this.capabilities = {}; + this.requirements = {}; + } + + public selectMatchArr(matchArr:Array):void { + if (this.selectedMatch === matchArr) { + this.selectedMatch = undefined; + } else { + this.selectedMatch = matchArr; + } + } + + + //TODO move to match object + public getPreviewText(showReq:boolean):string { + if (!this.selectedMatch) { + return ''; + } + + let match:any = this.selectedMatch[0]; + if (showReq) { + return match.requirement.ownerName + ': ' + match.requirement.name + + ': [' + match.requirement.minOccurrences + ', ' + match.requirement.maxOccurrences + ']'; + } else if (match.secondRequirement) { + return match.secondRequirement.ownerName + ': ' + match.secondRequirement.name + + ': [' + match.secondRequirement.minOccurrences + ', ' + match.secondRequirement.maxOccurrences + ']'; + } + else { + return match.capability.ownerName + ': ' + match.capability.name + + ': [' + match.capability.minOccurrences + ', ' + match.capability.maxOccurrences + ']'; + } + } + } + +} diff --git a/catalog-ui/app/scripts/models/graph/relationship.ts b/catalog-ui/app/scripts/models/graph/relationship.ts new file mode 100644 index 0000000000..e0dfbbd6d1 --- /dev/null +++ b/catalog-ui/app/scripts/models/graph/relationship.ts @@ -0,0 +1,107 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + export class RelationshipModel { + fromNode:string; + toNode:string; + relationships:Array; + + constructor(relationshipModel?:RelationshipModel, singleRelationship?:Relationship) { + if(relationshipModel){ + this.fromNode = relationshipModel.fromNode; + this.toNode = relationshipModel.toNode; + this.relationships = []; + if (relationshipModel.relationships && !singleRelationship) { + _.forEach(relationshipModel.relationships, (relation:Models.Relationship):void => { + this.relationships.push(new Models.Relationship(relation)); + }); + }else if(singleRelationship){ + this.relationships.push(singleRelationship); + } + } + } + + public setRelationshipModelParams (fromNode: string, toNode:string, relationships:Array) { + this.fromNode = fromNode; + this.toNode = toNode; + this.relationships = relationships; + } + } + + export class RelationType { + type:string; + + constructor(type?:string) { + if(type){ + this.type = type; + } + } + } + + export class Relationship { + capability:string; + capabilityOwnerId:string; + capabilityUid:string; + relationship:RelationType; + requirement:string; + requirementOwnerId:string; + requirementUid:string; + + constructor(relationship?:Models.Relationship) { + if(relationship) { + this.capability = relationship.capability; + this.capabilityOwnerId = relationship.capabilityOwnerId; + this.capabilityUid = relationship.capabilityUid; + this.relationship = new RelationType(relationship.relationship.type); + this.requirement = relationship.requirement; + this.requirementOwnerId = relationship.requirementOwnerId; + this.requirementUid = relationship.requirementUid; + } else { + this.relationship = new RelationType(); + } + + } + + //public setRelationProperties = (capability:string, capabilityOwnerId:string, capabilityUid:string, relationship:RelationType, requirement:string, requirementOwnerId:string, requirementUid:string )=>{ + // this.capability = capability; + // this.capabilityOwnerId = capabilityOwnerId; + // this.capabilityUid = capabilityUid; + // this.relationship = relationship; + // this.requirement =requirement; + // this.requirementOwnerId = requirementOwnerId; + // this.requirementUid = requirementUid; + //} + + + public setRelationProperties = (capability:Models.Capability, requirement:Models.Requirement)=>{ + this.capability = capability.name; + this.capabilityOwnerId = capability.ownerId; + this.capabilityUid = capability.uniqueId; + this.relationship = new Models.RelationType(capability.type); + this.requirement = requirement.name; + this.requirementOwnerId = requirement.ownerId; + this.requirementUid = requirement.uniqueId; + }; + + } +} diff --git a/catalog-ui/app/scripts/models/inputs.ts b/catalog-ui/app/scripts/models/inputs.ts new file mode 100644 index 0000000000..68e26e246e --- /dev/null +++ b/catalog-ui/app/scripts/models/inputs.ts @@ -0,0 +1,74 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 8/24/2016. + */ +/// +module Sdc.Models { + 'use strict'; + + export class InputModel { + + //server data + uniqueId:string; + name:string; + type:string; + password:boolean; + required:boolean; + definition:boolean; + parentUniqueId:string; + description:string; + componentInstanceName:string; + componentInstanceId:string; + + //costom properties + isNew: boolean; + properties:Array; + inputs:Array; + isAlreadySelected: boolean; + filterTerm: string; + + constructor(input:InputModel) { + if (input) { + this.uniqueId = input.uniqueId; + this.name = input.name; + this.type = input.type; + this.description = input.description; + this.password = input.password; + this.required = input.required; + this.definition = input.definition; + this.parentUniqueId = input.parentUniqueId; + this.description = input.description; + this.componentInstanceName = input.componentInstanceName; + this.componentInstanceId = input.componentInstanceId; + this.filterTerm = this.name + ' ' + this.description + ' ' + this.type + ' ' + this.componentInstanceName; + } + } + + public toJSON = ():any => { + this.isNew = undefined; + this.properties = undefined; + this.inputs = undefined; + this.isAlreadySelected = undefined; + this.filterTerm = undefined; + return this; + }; + } +} diff --git a/catalog-ui/app/scripts/models/instance-inputs-properties-map.ts b/catalog-ui/app/scripts/models/instance-inputs-properties-map.ts new file mode 100644 index 0000000000..2c67dfd718 --- /dev/null +++ b/catalog-ui/app/scripts/models/instance-inputs-properties-map.ts @@ -0,0 +1,39 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 9/12/2016. + */ +/// +module Sdc.Models { + 'use strict'; + + export class InstanceInputsPropertiesMapData { + [instanceId:string]: Array; + } + + export class InstanceInputsPropertiesMap { + componentInstanceInputsProperties:InstanceInputsPropertiesMapData; + + constructor(componentInstanceInputsPropertiesMapData:InstanceInputsPropertiesMapData) { + this.componentInstanceInputsProperties = componentInstanceInputsPropertiesMapData; + } + } + +} diff --git a/catalog-ui/app/scripts/models/instances-inputs-map.ts b/catalog-ui/app/scripts/models/instances-inputs-map.ts new file mode 100644 index 0000000000..1643a125ae --- /dev/null +++ b/catalog-ui/app/scripts/models/instances-inputs-map.ts @@ -0,0 +1,39 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 9/12/2016. + */ +/// +module Sdc.Models { + 'use strict'; + + export class InstancesInputsMapData { + [instanceId:string]: Array; + } + + export class InstancesInputsMap { + componentInstanceInputsMap:InstancesInputsMapData; + + constructor(componentInstanceInputsMapData:InstancesInputsMapData) { + this.componentInstanceInputsMap = componentInstanceInputsMapData; + } + } + +} diff --git a/catalog-ui/app/scripts/models/left-panel.ts b/catalog-ui/app/scripts/models/left-panel.ts new file mode 100644 index 0000000000..a47170c7c2 --- /dev/null +++ b/catalog-ui/app/scripts/models/left-panel.ts @@ -0,0 +1,33 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + export class LeftPanelModel { + numberOfElements:number; + sortedCategories:any; + + constructor() { + this.numberOfElements = 0; + this.sortedCategories = {}; + } + } +} diff --git a/catalog-ui/app/scripts/models/member.ts b/catalog-ui/app/scripts/models/member.ts new file mode 100644 index 0000000000..21dc907333 --- /dev/null +++ b/catalog-ui/app/scripts/models/member.ts @@ -0,0 +1,39 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 8/2/2016. + */ + +/// +module Sdc.Models { + 'use strict'; + + export class Members { + + [index: string]: string; + + constructor(members?:Members) { + _.forEach(members, (memberId:string, index) => { + this[index] = memberId; + }); + } + } +} + diff --git a/catalog-ui/app/scripts/models/modules/base-module.ts b/catalog-ui/app/scripts/models/modules/base-module.ts new file mode 100644 index 0000000000..2df52cc907 --- /dev/null +++ b/catalog-ui/app/scripts/models/modules/base-module.ts @@ -0,0 +1,108 @@ +/*- + * ============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========================================================= + */ + +/** + * Created by obarda on 2/4/2016. + */ +/// +module Sdc.Models { + 'use strict'; + + export class Module { + + public name:string; + public groupUUID:string; + public invariantUUID:string; + public propertyValueCounter:number; + public type:string; + public typeUid:string; + public uniqueId:string; + public version: string; + public artifacts: Array | Array; + public artifactsUuid: Array; + public properties: Array; + public members: Array; + + + constructor(module?: Module) { + if(module) { + this.name = module.name; + this.groupUUID = module.groupUUID; + this.invariantUUID = module.invariantUUID; + this.propertyValueCounter = module.propertyValueCounter; + this.type = module.type; + this.typeUid = module.typeUid; + this.uniqueId = module.uniqueId; + this.version = module.version; + this.artifacts = module.artifacts; + this.artifactsUuid = module.artifactsUuid; + this.properties = Utils.CommonUtils.initProperties(module.properties); + this.members = module.members; + + this.name = this.name.replace(/:/g, '..'); + + } + } + } + + export class DisplayModule extends Module { + + isBase: string; + artifacts:Array; + + //custom properties + public vfInstanceName: string; + public heatName: string; + public moduleName: string; + + constructor(displayModule?:Models.DisplayModule) { + super(displayModule); + + this.isBase = displayModule.isBase; + this.initArtifactsForDisplay(displayModule.artifacts); + + //splitting module name for display and edit + let splitName:Array = this.name.split('..'); + this.vfInstanceName = splitName[0]; + this.heatName = splitName[1]; + this.moduleName = splitName[2]; + } + + private initArtifactsForDisplay = (artifacts:Array):void => { + this.artifacts = new Array(); + _.forEach(artifacts, (artifact:Models.ArtifactModel) => { + this.artifacts.push(new Models.ArtifactModel(artifact)); + }); + }; + + public updateName = ():void => { + this.name = this.vfInstanceName + '..' + this.heatName + '..' + this.moduleName; + }; + + public toJSON = ():any => { + this.vfInstanceName = undefined; + this.heatName = undefined; + this.moduleName = undefined; + this.isBase = undefined; + this.artifacts = undefined; + return this; + }; + } +} diff --git a/catalog-ui/app/scripts/models/properties.ts b/catalog-ui/app/scripts/models/properties.ts new file mode 100644 index 0000000000..679ca03b44 --- /dev/null +++ b/catalog-ui/app/scripts/models/properties.ts @@ -0,0 +1,176 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + export class PropertiesGroup { + constructor(propertiesObj?:Models.PropertiesGroup){ + _.forEach(propertiesObj, (properties:Array, instance) => { + this[instance] = []; + _.forEach(properties, (property:Models.PropertyModel):void => { + property.resourceInstanceUniqueId = instance; + property.readonly = true; + this[instance].push(new Models.PropertyModel(property)); + }); + }); + } + } + + export interface IPropertyModel { + + //server data + uniqueId: string; + name: string; + constraints: Array; + defaultValue: string; + description: string; + password: boolean; + required: boolean; + type: string; + source: string; + parentUniqueId: string; + schema: Models.SchemaPropertyGroupModel; + + //instance properties + value:string; + valueUniqueUid:string; + path:Array; + rules:Array; + + //custom properties + resourceInstanceUniqueId: string; + readonly: boolean; + simpleType: string; + } + + export class PropertyModel implements IPropertyModel{ + + //server data + uniqueId:string; + name:string; + constraints:Array; + defaultValue:string; + description:string; + password:boolean; + required:boolean; + type:string; + source:string; + parentUniqueId:string; + schema: Models.SchemaPropertyGroupModel; + + //instance properties + value:string; + valueUniqueUid:string; + path:Array; + rules:Array; + + //custom properties + resourceInstanceUniqueId:string; + readonly:boolean; + simpleType: string; + filterTerm: string; + isAlreadySelected: boolean; + + constructor(property?:Models.PropertyModel) { + if (property) { + this.uniqueId = property.uniqueId; + this.name = property.name; + this.constraints = property.constraints; + this.defaultValue = property.defaultValue; + this.description = property.description; + this.password = property.password; + this.required = property.required; + this.type = property.type; + this.source = property.source; + this.parentUniqueId = property.parentUniqueId; + this.schema = property.schema; + this.value = property.value?property.value:property.defaultValue; + this.valueUniqueUid = property.valueUniqueUid; + this.path = property.path; + this.rules = property.rules; + this.resourceInstanceUniqueId = property.resourceInstanceUniqueId; + this.readonly = property.readonly; + this.simpleType = property.simpleType; + + + } + + if(!this.schema || !this.schema.property) { + this.schema = new Models.SchemaPropertyGroupModel(new Models.SchemaProperty()); + } else { + //forcing creating new object, so editing different one than the object in the table + this.schema = new Models.SchemaPropertyGroupModel(new Models.SchemaProperty(this.schema.property)); + } + if(property) { + this.filterTerm = this.name + " " + (this.description||"") +" " + this.type; + if(this.schema.property && this.schema.property.type) { + this.filterTerm += " " +this.schema.property.type; + } + } + } + + public convertToServerObject:Function = ():string => { + let serverObject = {}; + let mapData = { + "type": this.type, + "required": this.required || false, + "defaultValue": this.defaultValue != "" && this.defaultValue != "[]" && this.defaultValue != "{}" ? this.defaultValue :null, + "description": this.description, + "constraints": this.constraints, + "isPassword": this.password || false, + "schema": this.schema, + "name": this.name + }; + serverObject[this.name] = mapData; + + return JSON.stringify(serverObject); + }; + + + // public convertValueToView () { + // //unwrapping value {} or [] if type is complex + // if (this.defaultValue && (this.type === 'map' || this.type === 'list') && + // ['[','{'].indexOf(this.defaultValue.charAt(0)) > -1 && + // [']','}'].indexOf(this.defaultValue.slice(-1)) > -1) { + // this.defaultValue = this.defaultValue.slice(1, -1); + // } + // + // //also for value - for the modal in canvas + // if (this.value && (this.type === 'map' || this.type === 'list') && + // ['[','{'].indexOf(this.value.charAt(0)) > -1 && + // [']','}'].indexOf(this.value.slice(-1)) > -1) { + // this.value = this.value.slice(1, -1); + // } + // } + + public toJSON = ():any => { + if(!this.resourceInstanceUniqueId){ + this.value = undefined; + } + this.readonly = undefined; + this.resourceInstanceUniqueId = undefined; + this.simpleType = undefined; + this.value = this.value === "{}" || this.value === "[]" ? undefined: this.value; + this.defaultValue = this.defaultValue === "{}" || this.defaultValue === "[]" ? undefined: this.defaultValue; + return this; + }; + } +} diff --git a/catalog-ui/app/scripts/models/requirement.ts b/catalog-ui/app/scripts/models/requirement.ts new file mode 100644 index 0000000000..091bfc139e --- /dev/null +++ b/catalog-ui/app/scripts/models/requirement.ts @@ -0,0 +1,91 @@ +/*- + * ============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========================================================= + */ + /* + * Created by obarda on 4/20/2016. + */ +/// +module Sdc.Models { + 'use strict'; + //this is an object contains keys, when each key has matching array. + // for example: key = tosca.capabilities.network. and the match array is array of requirements objects + export class RequirementsGroup{ + constructor(requirementGroupObj?:Models.RequirementsGroup){ + _.forEach(requirementGroupObj, (requirementsArrayObj:Array, instance) => { + this[instance] = []; + _.forEach(requirementsArrayObj, (requirement:Models.Requirement):void => { + this[instance].push(new Models.Requirement(requirement)); + }); + }); + } + } + + export class Requirement { + + //server data + capability:string; + name: string; + ownerId: string; + ownerName:string; + node:string; + uniqueId:string; + relationship: string; + minOccurrences: string; + maxOccurrences: string; + //custom + filterTerm:string; + constructor(requirement?:Requirement) { + + if(requirement) { + this.capability = requirement.capability; + this.name = requirement.name; + this.ownerId = requirement.ownerId; + this.ownerName = requirement.ownerName; + this.node = requirement.node; + this.uniqueId = requirement.uniqueId; + this.relationship = requirement.relationship; + this.minOccurrences = requirement.minOccurrences; + this.maxOccurrences = requirement.maxOccurrences; + this.initFilterTerm(); + + } + } + + public getFullTitle():string { + return this.ownerName + ': ' + this.name + + ': [' + this.minOccurrences + ', ' + this.maxOccurrences + ']'; + } + + public toJSON = ():any => { + this.filterTerm = undefined; + return this; + }; + + private initFilterTerm = ():void =>{ + this.filterTerm = (this.name + " ") + + (this.ownerName + " " ) + + (this.capability ? (this.capability.substring("tosca.capabilities.".length) + " " ) : "") + + (this.node? (this.node.substring("tosca.nodes.".length) +" ") : "") + + (this.relationship? (this.relationship.substring("tosca.relationships.".length) +" ") : "") + + this.minOccurrences+","+this.maxOccurrences; + } + } +} + + diff --git a/catalog-ui/app/scripts/models/schema-attribute.ts b/catalog-ui/app/scripts/models/schema-attribute.ts new file mode 100644 index 0000000000..725a7589e0 --- /dev/null +++ b/catalog-ui/app/scripts/models/schema-attribute.ts @@ -0,0 +1,37 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + export class SchemaAttributeGroupModel{ + property: SchemaAttribute; + + constructor(schemaAttribute?:Models.SchemaAttribute) { + this.property = schemaAttribute; + } + } + + export class SchemaAttribute extends SchemaProperty{ + + } +} + + diff --git a/catalog-ui/app/scripts/models/tab.ts b/catalog-ui/app/scripts/models/tab.ts new file mode 100644 index 0000000000..cc42d4f348 --- /dev/null +++ b/catalog-ui/app/scripts/models/tab.ts @@ -0,0 +1,47 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 7/31/2016. + */ +/// +module Sdc.Models { + 'use strict'; + + export class Tab { + + public templateUrl:string; + public controller:string; + public data:any; + public icon:string; + public name:string; + + constructor(templateUrl:string, controller:string, name:string, data?:any, icon?:string) { + + this.templateUrl = templateUrl; + this.controller = controller; + this.icon = icon; + this.data = data; + this.name = name; + } + } +} + + + diff --git a/catalog-ui/app/scripts/models/tooltip-data.ts b/catalog-ui/app/scripts/models/tooltip-data.ts new file mode 100644 index 0000000000..027904b245 --- /dev/null +++ b/catalog-ui/app/scripts/models/tooltip-data.ts @@ -0,0 +1,28 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + export class TooltipData{ + } +} + + diff --git a/catalog-ui/app/scripts/models/user.ts b/catalog-ui/app/scripts/models/user.ts new file mode 100644 index 0000000000..836066f5f9 --- /dev/null +++ b/catalog-ui/app/scripts/models/user.ts @@ -0,0 +1,117 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + export enum UserRole { + ADMIN, + DESIGNER, + TESTER, + GOVERNOR, + OPS, + PRODUCT_MANAGER, + PRODUCT_STRATEGIST + } + + export interface IUserManager { + isInEditMode: boolean; + filterTerm: string; + } + + export interface IUserProperties extends IUserManager{ + firstName: string; + lastName: string; + userId: string; + email: string; + role: string; + tempRole:string; + lastLoginTime: string; + status:string; + } + + export interface IUser { + resource: Services.IUserResource; + getRole(): UserRole; + getRoleToView(): string; + getName(): string; + getFirstName(): string; + getLastName(): string; + } + + export class User implements IUser { + + constructor(public resource:Services.IUserResource) { + } + + public getLastName = () => { + return this.resource.lastName; + } + + public getFirstName = () => { + return this.resource.firstName; + } + + public getName = () => { + return this.resource.firstName + ' ' + this.resource.lastName; + } + + public getLastLogin = () => { + if (!this.resource.lastLoginTime || this.resource.lastLoginTime === "0") { + return ""; + } else { + return this.resource.lastLoginTime; + } + } + + public getRole = ():UserRole => { + let role:UserRole; + switch (UserRole[this.resource.role.toUpperCase()]) { + case UserRole.ADMIN: + role = UserRole.ADMIN; + break; + case UserRole.DESIGNER: + role = UserRole.DESIGNER; + break; + case UserRole.TESTER: + role = UserRole.TESTER; + break; + case UserRole.GOVERNOR: + role = UserRole.GOVERNOR; + break; + case UserRole.OPS: + role = UserRole.OPS; + break; + case UserRole.PRODUCT_MANAGER: + role = UserRole.PRODUCT_MANAGER; + break; + case UserRole.PRODUCT_STRATEGIST: + role = UserRole.PRODUCT_STRATEGIST; + break; + } + return role; + } + + public getRoleToView = ():string => { + let role:string = this.resource.role.toLowerCase().replace('governor','governance_Rep'); + return role.charAt(0).toUpperCase() + role.slice(1).replace('_',' '); + } + } +} diff --git a/catalog-ui/app/scripts/models/validate.ts b/catalog-ui/app/scripts/models/validate.ts new file mode 100644 index 0000000000..21540d38b6 --- /dev/null +++ b/catalog-ui/app/scripts/models/validate.ts @@ -0,0 +1,29 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Models { + 'use strict'; + + export interface IValidate{ + isValid : boolean; + } +} + + diff --git a/catalog-ui/app/scripts/modules/directive-module.ts b/catalog-ui/app/scripts/modules/directive-module.ts new file mode 100644 index 0000000000..70a15378fa --- /dev/null +++ b/catalog-ui/app/scripts/modules/directive-module.ts @@ -0,0 +1,106 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc { + let moduleName:string = 'Sdc.Directives'; + let directiveModule:ng.IModule = angular.module(moduleName, []); + + directiveModule.directive('clickedOutside', Directives.ClickedOutsideDirective.factory); + directiveModule.directive('loader', Directives.LoaderDirective.factory); + directiveModule.directive('userHeaderDetails', Directives.UserHeaderDetailsDirective.factory); + directiveModule.directive('ellipsis', Directives.EllipsisDirective.factory); + directiveModule.directive('downloadArtifact', Directives.DownloadArtifactDirective.factory); + directiveModule.directive('fileType', Directives.FileTypeDirective.factory); + directiveModule.directive('invalidCharacters', Directives.InvalidCharactersDirective.factory); + directiveModule.directive('tutorial', Directives.TutorialDirective.factory); + directiveModule.directive('perfectScrollbar', Directives.PerfectScrollerDirective.factory); + directiveModule.directive('expandCollapse', Directives.ExpandCollapseDirective.factory); + directiveModule.directive('sdcModal', Directives.SdcModalDirective.factory); + directiveModule.directive('sdcMessages', Directives.SdcMessagesDirective.factory); + directiveModule.directive('sdcMessage', Directives.SdcMessageDirective.factory); + directiveModule.directive('sdcErrorTooltip', Directives.SdcErrorTooltipDirective.factory); + directiveModule.directive('fileOpener', Directives.FileOpenerDirective.factory); + directiveModule.directive('fileUpload', Directives.FileUploadDirective.factory); + directiveModule.directive('structureTree', Directives.StructureTreeDirective.factory); + directiveModule.directive('sdcWizardStep', Directives.SdcWizardStepDirective.factory); + directiveModule.directive('sdcPageSelector', Directives.PageSelectorDirective.factory); + directiveModule.directive('sdcSmartTooltip', Directives.SmartTooltipDirective.factory); + directiveModule.directive('printGraphScreen', Directives.PrintGraphScreenDirective.factory); + directiveModule.directive('sdcTag', Directives.TagDirective.factory); + directiveModule.directive('sdcTags', Directives.SdcTagsDirective.factory); + directiveModule.directive('sdcKeyboardEvents', Directives.SdcKeyboardEventsDirective.factory); + directiveModule.directive('expandCollapseMenuBox', Directives.ExpandCollapseMenuBoxDirective.factory); + directiveModule.directive('sdcPageScroll', Directives.SdcPageScrollDirective.factory); + directiveModule.directive('punchOut', Directives.PunchOutDirective.factory); + directiveModule.directive('relationMenu', Directives.RelationMenuDirective.factory); + directiveModule.directive('customValidation', Directives.CustomValidationDirective.factory); + directiveModule.directive('ecompHeader', Directives.EcompHeaderDirective.factory); + directiveModule.directive('editNamePopover', Directives.EditNamePopoverDirective.factory); + directiveModule.directive('fieldsStructure', Directives.DataTypeFieldsStructureDirective.factory); + directiveModule.directive('typeMap', Directives.TypeMapDirective.factory); + directiveModule.directive('typeList', Directives.TypeListDirective.factory); + directiveModule.directive('infoTooltip', Directives.InfoTooltipDirective.factory); + + directiveModule.directive('sdcTabs', Directives.SdcTabsDirective.factory); + directiveModule.directive('sdcSingleTab', Directives.SdcSingleTabDirective.factory); + directiveModule.directive('innerSdcSingleTab', Directives.InnerSdcSingleTabDirective.factory); + + //composition + directiveModule.directive('palette', Directives.Palette.factory); + directiveModule.directive('compositionGraph', Directives.CompositionGraph.factory); + + //deployment + directiveModule.directive('deploymentGraph', Directives.DeploymentGraph.factory); + + // Layouts + directiveModule.directive('topNav', Directives.TopNavDirective.factory); + directiveModule.directive('topProgress', Directives.TopProgressDirective.factory); + + // Elements + directiveModule.directive('sdcCheckbox', Directives.CheckboxElementDirective.factory); + directiveModule.directive('sdcRadioButton', Directives.RadiobuttonElementDirective.factory); + + //Graph Utils - Common + directiveModule.service('CommonGraphUtils', Sdc.Graph.Utils.CommonGraphUtils); + + //Composition Graph Utils + directiveModule.service('CompositionGraphNodesUtils', Sdc.Graph.Utils.CompositionGraphNodesUtils); + directiveModule.service('CompositionGraphGeneralUtils', Sdc.Graph.Utils.CompositionGraphGeneralUtils); + directiveModule.service('CompositionGraphLinkUtils', Sdc.Graph.Utils.CompositionGraphLinkUtils); + directiveModule.service('MatchCapabilitiesRequirementsUtils', Sdc.Graph.Utils.MatchCapabilitiesRequirementsUtils); + + //Composition Graph Utils + directiveModule.service('DeploymentGraphGeneralUtils', Sdc.Graph.Utils.DeploymentGraphGeneralUtils); + + //Util service for graph + directiveModule.service('NodesFactory', Sdc.Utils.NodesFactory); + directiveModule.service('LinksFactory', Sdc.Utils.LinksFactory); + directiveModule.service('ImageCreatorService', Sdc.Utils.ImageCreatorService); + + //directiveModule.service('GraphUtilsServerUpdateQueue', Sdc.Directives.GraphUtilsServerUpdateQueue); + + //controller for go.js + directiveModule.controller('SdcWizardStepDirectiveController', Directives.SdcWizardStepDirectiveController); + + // Events + directiveModule.directive('onLastRepeat', Directives.OnLastRepeatDirective.factory); +} + + diff --git a/catalog-ui/app/scripts/modules/filters.ts b/catalog-ui/app/scripts/modules/filters.ts new file mode 100644 index 0000000000..1bf31507fd --- /dev/null +++ b/catalog-ui/app/scripts/modules/filters.ts @@ -0,0 +1,44 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc { + + let moduleName: string = 'Sdc.Filters'; + let filterModule: ng.IModule = angular.module(moduleName, []); + filterModule.filter("resourceName", Sdc.Filters.ResourceNameFilter); + filterModule.filter("graphResourceName", Sdc.Filters.GraphResourceNameFilter); + filterModule.filter("categoryNameFilter", Sdc.Filters.CategoryNameFilter); + filterModule.filter("entityFilter", Sdc.Filters.EntityFilter); + filterModule.filter("truncate", Sdc.Filters.TruncateFilter); + filterModule.filter("catalogStatusFilter", Sdc.Filters.CatalogStatusFilter); + filterModule.filter("categoryTypeFilter", Sdc.Filters.CategoryTypeFilter); + filterModule.filter("stringToDateFilter", Sdc.Filters.StringToDateFilter); + filterModule.filter("categoryIcon", Sdc.Filters.CategoryIconFilter); + filterModule.filter("capitalizeFilter", Sdc.Filters.CapitalizeFilter); + filterModule.filter("underscoreLessFilter", Sdc.Filters.UnderscoreLessFilter); + filterModule.filter("resourceTypeName", Sdc.Filters.ResourceTypeFilter); + filterModule.filter("relationName", Sdc.Filters.RelationNameFilter); + filterModule.filter("trim", Sdc.Filters.TrimFilter); + filterModule.filter("clearWhiteSpaces", Sdc.Filters.ClearWhiteSpacesFilter); + filterModule.filter('testsId', Sdc.Filters.TestsIdFilter); + + //Added by Ikram + filterModule.filter("productCategoryNameFilter", Sdc.Filters.ProductCategoryNameFilter); +} diff --git a/catalog-ui/app/scripts/modules/service-module.ts b/catalog-ui/app/scripts/modules/service-module.ts new file mode 100644 index 0000000000..c77e8b0ad4 --- /dev/null +++ b/catalog-ui/app/scripts/modules/service-module.ts @@ -0,0 +1,64 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc { + let moduleName:string = 'Sdc.Services'; + let serviceModule:ng.IModule = angular.module(moduleName, []); + + serviceModule.service('Sdc.Services.ConfigurationUiService', Services.ConfigurationUiService); + serviceModule.service('Sdc.Services.CookieService', Services.CookieService); + serviceModule.service('Sdc.Services.EntityService', Services.EntityService); + serviceModule.service('Sdc.Services.AvailableIconsService', Services.AvailableIconsService); + serviceModule.service('Sdc.Services.RelationIconsService', Services.RelationIconsService); + serviceModule.service('Sdc.Services.UrlToBase64Service', Services.UrlToBase64Service); + serviceModule.service('Sdc.Services.CacheService', Services.CacheService); + serviceModule.service('Sdc.Services.HeaderInterceptor', Services.HeaderInterceptor); + serviceModule.service('Sdc.Services.HttpErrorInterceptor', Services.HttpErrorInterceptor); + serviceModule.service('Sdc.Services.SharingService', Services.SharingService); + serviceModule.service('Sdc.Services.SdcVersionService', Services.SdcVersionService); + serviceModule.service('Sdc.Services.ActivityLogService', Services.ActivityLogService); + serviceModule.service('Sdc.Services.OnboardingService', Services.OnboardingService); + serviceModule.service('Sdc.Services.EcompHeaderService', Services.EcompHeaderService); + serviceModule.service('Sdc.Services.DataTypesService', Services.DataTypesService); + + //Components Services + serviceModule.service('Sdc.Services.Components.ComponentService', Services.Components.ComponentService); + serviceModule.service('Sdc.Services.Components.ServiceService', Services.Components.ServiceService); + serviceModule.service('Sdc.Services.Components.ResourceService', Services.Components.ResourceService); + serviceModule.service('Sdc.Services.Components.ProductService', Services.Components.ProductService); + serviceModule.service('LeftPaletteLoaderService', Services.Components.LeftPaletteLoaderService); + serviceModule.service('EventListenerService', Services.EventListenerService); + serviceModule.service('Sdc.Services.ProgressService', Services.ProgressService); + + //Utils + serviceModule.service('ArtifactsUtils', Sdc.Utils.ArtifactsUtils); + serviceModule.service('FileUtils', Sdc.Utils.FileUtils); + serviceModule.service('ValidationUtils', Sdc.Utils.ValidationUtils); + + + + + serviceModule.service('AngularJSBridge', Sdc.Services.AngularJSBridge); + serviceModule.service('LoaderService', Sdc.Services.LoaderService); + + serviceModule.factory('Sdc.Services.UserResourceService', Services.UserResourceService.getResource); + serviceModule.factory('Sdc.Services.CategoryResourceService', Services.CategoryResourceService.getResource); + +} diff --git a/catalog-ui/app/scripts/modules/utils.ts b/catalog-ui/app/scripts/modules/utils.ts new file mode 100644 index 0000000000..fd5eaf2a4b --- /dev/null +++ b/catalog-ui/app/scripts/modules/utils.ts @@ -0,0 +1,39 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/11/2016. + */ +/// +module Sdc { + let moduleName:string = 'Sdc.Utils'; + let serviceModule:ng.IModule = angular.module(moduleName, []); + + + + //Utils + serviceModule.service('ComponentFactory', Sdc.Utils.ComponentFactory); + serviceModule.service('ComponentInstanceFactory', Sdc.Utils.ComponentInstanceFactory); + serviceModule.service('ChangeLifecycleStateHandler', Sdc.Utils.ChangeLifecycleStateHandler); + serviceModule.service('ModalsHandler', Sdc.Utils.ModalsHandler); + serviceModule.service('MenuHandler', Sdc.Utils.MenuHandler); + + + +} diff --git a/catalog-ui/app/scripts/modules/view-model-module.ts b/catalog-ui/app/scripts/modules/view-model-module.ts new file mode 100644 index 0000000000..19cf5b45f4 --- /dev/null +++ b/catalog-ui/app/scripts/modules/view-model-module.ts @@ -0,0 +1,96 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc { + let moduleName: string = 'Sdc.ViewModels'; + let viewModelModule: ng.IModule = angular.module(moduleName, []); + + viewModelModule + .controller(moduleName+'.DashboardViewModel', ViewModels.DashboardViewModel) + .controller(moduleName+'.CompositionViewModel', ViewModels.CompositionViewModel) + + .controller(moduleName+'.DetailsViewModel', ViewModels.DetailsViewModel) + .controller(moduleName+'.ResourceArtifactsViewModel', ViewModels.ResourceArtifactsViewModel) + .controller(moduleName+'.PropertyFormViewModel', ViewModels.PropertyFormViewModel) + .controller(moduleName+'.ArtifactResourceFormViewModel', ViewModels.ArtifactResourceFormViewModel) + .controller(moduleName+'.AttributeFormViewModel', ViewModels.AttributeFormViewModel) + .controller(moduleName+'.ResourcePropertiesViewModel', ViewModels.ResourcePropertiesViewModel) + .controller(moduleName+'.CatalogViewModel', ViewModels.CatalogViewModel) + .controller(moduleName+'.OnboardVendorViewModel', ViewModels.OnboardVendorViewModel) + .controller(moduleName+'.DistributionViewModel', ViewModels.DistributionViewModel) + .controller(moduleName+'.SupportViewModel', ViewModels.SupportViewModel) + .controller(moduleName+'.ConfirmationModalViewModel', ViewModels.ConfirmationModalViewModel) + .controller(moduleName+'.EmailModalViewModel', ViewModels.EmailModalViewModel) + .controller(moduleName+'.MessageModalViewModel', ViewModels.MessageModalViewModel) + .controller(moduleName+'.ServerMessageModalViewModel', ViewModels.ServerMessageModalViewModel) + .controller(moduleName+'.ClientMessageModalViewModel', ViewModels.ClientMessageModalViewModel) + .controller(moduleName+'.ErrorViewModel', ViewModels.ErrorViewModel) + .controller(moduleName+'.ComponentViewerViewModel', ViewModels.ComponentViewerViewModel) + .controller(moduleName+'.RelationsViewModel', ViewModels.RelationsViewModel) + .controller(moduleName+'.ResourceInstanceNameViewModel', ViewModels.ResourceInstanceNameViewModel) + .controller(moduleName+'.WelcomeViewModel', ViewModels.WelcomeViewModel) + .controller(moduleName+'.PreLoadingViewModel', ViewModels.PreLoadingViewModel) + .controller(moduleName+'.TutorialEndViewModel', ViewModels.TutorialEndViewModel) + .controller(moduleName+'.AdminDashboardViewModel', ViewModels.AdminDashboardViewModel) + .controller(moduleName+'.EnvParametersFormViewModel', ViewModels.EnvParametersFormViewModel) + .controller(moduleName+'.StructureViewModel', ViewModels.StructureViewModel) + .controller(moduleName+'.AddCategoryModalViewModel', ViewModels.AddCategoryModalViewModel) + .controller(moduleName+'.DashboardCoverViewModel', ViewModels.DashboardCoverViewModel) + .controller(moduleName+'.UserManagementViewModel', ViewModels.UserManagementViewModel) + .controller(moduleName+'.CategoryManagementViewModel', ViewModels.CategoryManagementViewModel) + .controller(moduleName+'.WelcomeStepsControllerViewModel', ViewModels.WelcomeStepsControllerViewModel) + .controller(moduleName+'.OnboardingModalViewModel', ViewModels.OnboardingModalViewModel) + .controller(moduleName+'.DistributionStatusModalViewModel', ViewModels.DistributionStatusModalViewModel) + + .controller(moduleName+'.Wizard.EditWizardViewModel', ViewModels.Wizard.EditWizardViewModel) + .controller(moduleName+'.Wizard.CreateWizardViewModel', ViewModels.Wizard.CreateWizardViewModel) + .controller(moduleName+'.Wizard.ImportWizardViewModel', ViewModels.Wizard.ImportWizardViewModel) + .controller(moduleName+'.Wizard.GeneralStepViewModel', ViewModels.Wizard.GeneralStepViewModel) + .controller(moduleName+'.Wizard.IconsStepViewModel', ViewModels.Wizard.IconsStepViewModel) + .controller(moduleName+'.Wizard.ArtifactInformationStepViewModel', ViewModels.Wizard.ArtifactInformationStepViewModel) + .controller(moduleName+'.Wizard.ArtifactDeploymentStepViewModel', ViewModels.Wizard.ArtifactDeploymentStepViewModel) + .controller(moduleName+'.Wizard.PropertiesStepViewModel', ViewModels.Wizard.PropertiesStepViewModel) + .controller(moduleName+'.Wizard.ArtifactResourceFormStepViewModel', ViewModels.Wizard.ArtifactResourceFormStepViewModel) + .controller(moduleName+'.Wizard.PropertyFormViewModel', ViewModels.Wizard.PropertyFormViewModel) + .controller(moduleName+'.Wizard.HierarchyStepViewModel',ViewModels.Wizard.HierarchyStepViewModel) + + //NEW + .controller(moduleName+'.WorkspaceViewModel', ViewModels.WorkspaceViewModel) + .controller(moduleName+'.GeneralViewModel', ViewModels.GeneralViewModel) + .controller(moduleName+'.IconsViewModel', ViewModels.IconsViewModel) + .controller(moduleName+'.DeploymentArtifactsViewModel', ViewModels.DeploymentArtifactsViewModel) + .controller(moduleName+'.InformationArtifactsViewModel', ViewModels.InformationArtifactsViewModel) + .controller(moduleName+'.ToscaArtifactsViewModel', ViewModels.ToscaArtifactsViewModel) + .controller(moduleName+'.PropertiesViewModel', ViewModels.PropertiesViewModel) + .controller(moduleName+'.AttributesViewModel', ViewModels.AttributesViewModel) + .controller(moduleName+'.ProductHierarchyViewModel',ViewModels.ProductHierarchyViewModel) + .controller(moduleName+'.ActivityLogViewModel',ViewModels.ActivityLogViewModel) + .controller(moduleName+'.ManagementWorkflowViewModel',ViewModels.ManagementWorkflowViewModel) + .controller(moduleName+'.NetworkCallFlowViewModel',ViewModels.NetworkCallFlowViewModel) + .controller(moduleName+'.DeploymentViewModel',ViewModels.DeploymentViewModel) + .controller(moduleName+'.ResourceInputsViewModel',ViewModels.ResourceInputsViewModel) + .controller(moduleName+'.ServiceInputsViewModel', ViewModels.ServiceInputsViewModel) + .controller(moduleName+'.ReqAndCapabilitiesViewModel', ViewModels.ReqAndCapabilitiesViewModel) + + + + //TABS + .controller(moduleName+'.HierarchyViewModel',ViewModels.HierarchyViewModel) +} diff --git a/catalog-ui/app/scripts/services/activity-log-service.ts b/catalog-ui/app/scripts/services/activity-log-service.ts new file mode 100644 index 0000000000..6fe27c447e --- /dev/null +++ b/catalog-ui/app/scripts/services/activity-log-service.ts @@ -0,0 +1,48 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + 'use strict'; + + // Define an interface of the object you want to use, providing it's properties + export interface IActivityLogService{ + getActivityLogService(type :string, id: string): ng.IPromise>; + } + + export class ActivityLogService implements IActivityLogService{ + + + static '$inject' = ['$http', '$q','sdcConfig']; + private api: Models.IApi; + + constructor(private $http: ng.IHttpService, private $q: ng.IQService, sdcConfig: Models.IAppConfigurtaion){ + this.api = sdcConfig.api; + } + + getActivityLogService = (type:string, id:string): ng.IPromise> =>{ + let defer = this.$q.defer(); + this.$http.get(this.api.root + this.api.GET_activity_log.replace(':type', type).replace(':id', id)) + .success((activityLog: any) => { + defer.resolve(activityLog); + }); + return defer.promise; + } + } +} diff --git a/catalog-ui/app/scripts/services/angular-js-bridge-service.ts b/catalog-ui/app/scripts/services/angular-js-bridge-service.ts new file mode 100644 index 0000000000..2d8fb01b13 --- /dev/null +++ b/catalog-ui/app/scripts/services/angular-js-bridge-service.ts @@ -0,0 +1,22 @@ +module Sdc.Services { + export class AngularJSBridge{ + private static _$filter: ng.IFilterService; + private static _sdcConfig: Models.IAppConfigurtaion; + + public static getFilter(filterName: string){ + return AngularJSBridge._$filter(filterName); + } + + public static getAngularConfig(){ + return AngularJSBridge._sdcConfig; + } + + + constructor($filter: ng.IFilterService, sdcConfig: Models.IAppConfigurtaion){ + AngularJSBridge._$filter = $filter; + AngularJSBridge._sdcConfig = sdcConfig; + } + } + + AngularJSBridge.$inject = ['$filter', 'sdcConfig'] +} \ No newline at end of file diff --git a/catalog-ui/app/scripts/services/available-icons-service.ts b/catalog-ui/app/scripts/services/available-icons-service.ts new file mode 100644 index 0000000000..5c20afe5f2 --- /dev/null +++ b/catalog-ui/app/scripts/services/available-icons-service.ts @@ -0,0 +1,105 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/23/2016. + */ +/// +module Sdc.Services { + 'use strict'; + + interface IAvailableIconsService { + getIcons(componentType: Utils.Constants.ComponentType):Array; + } + + export class AvailableIconsService implements IAvailableIconsService { + constructor() {} + public getIcons = (componentType: string): Array => { + let icons: string[]; + switch (componentType){ + case Utils.Constants.ComponentType.SERVICE: + icons = [ + 'call_controll', + 'mobility', + 'network_l_1-3', + 'network_l_4' + ]; + break; + + case Utils.Constants.ComponentType.RESOURCE: + icons= [ + 'router', + 'database', + 'network', + 'objectStorage', + 'connector', + 'brocade', + 'cisco', + 'ericsson', + 'tropo', + 'fortinet', + 'att', + 'broadsoft', + 'alcatelLucent', + 'metaswitch', + 'aricent', + 'mySql', + 'oracle', + 'nokia_siemens', + 'juniper', + 'call_controll', + 'borderElement', + 'applicationServer', + 'server', + 'port', + 'loadBalancer', + 'compute', + 'gateway', + 'cp', + 'vl', + 'vfw', + 'firewall' + ]; + break; + + case Utils.Constants.ComponentType.PRODUCT: + icons = [ + 'vfw', + 'network', + 'security', + 'cloud', + 'setting', + 'orphan', + 'wanx', + 'vrouter', + 'ucpe', + 'mobility' + + ]; + break; + + } + return icons; + } + + } +} + + + diff --git a/catalog-ui/app/scripts/services/cache-service.ts b/catalog-ui/app/scripts/services/cache-service.ts new file mode 100644 index 0000000000..3e5e5495c7 --- /dev/null +++ b/catalog-ui/app/scripts/services/cache-service.ts @@ -0,0 +1,58 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + + 'use strict'; + + interface ICacheService { + get(key:string):any; + set(key:string, value:any):void; + } + + export class CacheService implements ICacheService { + + static '$inject' = ['sdcConfig', '$document']; + private storage:Utils.Dictionary; + + constructor() { + this.storage = new Utils.Dictionary(); + }; + + public get = (key:string):any => { + return this.storage.getValue(key); + }; + + public set = (key:string, value:any):void => { + this.storage.setValue(key, value); + }; + + public remove = (key:string):void => { + if (this.storage.containsKey(key)){ + this.storage.remove(key); + } + }; + + public contains = (key:string):boolean => { + return this.storage.containsKey(key); + }; + + } +} diff --git a/catalog-ui/app/scripts/services/category-resource-service.ts b/catalog-ui/app/scripts/services/category-resource-service.ts new file mode 100644 index 0000000000..eef1b445e6 --- /dev/null +++ b/catalog-ui/app/scripts/services/category-resource-service.ts @@ -0,0 +1,83 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + import IMainCategory = Sdc.Models.IMainCategory; + 'use strict'; + + // Define an interface of the object you want to use, providing it's properties + export interface ICategoryResource extends Models.IUserProperties,ng.resource.IResource{ + name:string; + uniqueId:string; + subcategories:Array; + + getAllCategories(params?: Object, success?: Function, error?: Function): Array; + $saveSubCategory(params?: Object, success?: Function, error?: Function): any; + $deleteSubCategory(params?: Object, success?: Function, error?: Function): any; + } + + // Define your resource, adding the signature of the custom actions + export interface ICategoryResourceClass extends ng.resource.IResourceClass{ + getAllCategories(params?: Object, success?: Function, error?: Function): Array; + saveSubCategory(params?: Object, success?: Function, error?: Function): any; + deleteSubCategory(params?: Object, success?: Function, error?: Function): any; + } + + export class CategoryResourceService{ + + public static getResource = ( + $resource: ng.resource.IResourceService, + sdcConfig: Models.IAppConfigurtaion + ): ICategoryResourceClass => { + + // Define your custom actions here as IActionDescriptor + let getAllCategoriesAction : ng.resource.IActionDescriptor = { + method: 'GET', + isArray: true, + url: sdcConfig.api.root + sdcConfig.api.GET_categories + }; + let saveSubCategory : ng.resource.IActionDescriptor = { + method: 'POST', + isArray: false, + url: sdcConfig.api.root + sdcConfig.api.POST_subcategory + }; + let deleteSubCategory: ng.resource.IActionDescriptor = { + method: 'DELETE', + isArray: false, + url: sdcConfig.api.root + sdcConfig.api.POST_subcategory + }; + + + let url: string = sdcConfig.api.root + sdcConfig.api.POST_category; + let categoryResource: ICategoryResourceClass = $resource( + url, + { types: '@types', categoryId: '@categoryId' }, + { + getAllCategories: getAllCategoriesAction, + saveSubCategory: saveSubCategory, + deleteSubCategory: deleteSubCategory + } + ); + + return categoryResource; + } + } + CategoryResourceService.getResource.$inject = ['$resource', 'sdcConfig']; +} diff --git a/catalog-ui/app/scripts/services/components/component-service.ts b/catalog-ui/app/scripts/services/components/component-service.ts new file mode 100644 index 0000000000..393ea71c03 --- /dev/null +++ b/catalog-ui/app/scripts/services/components/component-service.ts @@ -0,0 +1,698 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services.Components { + + 'use strict'; + + declare let CryptoJS:any; + + export interface IComponentService { + + getComponent(id:string); + updateComponent(component:Models.Components.Component):ng.IPromise; + changeLifecycleState(component:Models.Components.Component, state:string, userRemarks:any):ng.IPromise ; + validateName(newName:string, subtype?:string):ng.IPromise; + createComponent(component:Models.Components.Component):ng.IPromise; + addOrUpdateArtifact(componentId:string, artifact:Models.ArtifactModel):ng.IPromise; + deleteArtifact(componentId:string, artifact:string, artifactLabel):ng.IPromise; + addProperty(componentId:string, property:Models.PropertyModel):ng.IPromise; + updateProperty(componentId:string, property:Models.PropertyModel):ng.IPromise; + addAttribute(componentId:string, attribute:Models.AttributeModel):ng.IPromise; + updateAttribute(componentId:string, attribute:Models.AttributeModel):ng.IPromise; + deleteProperty(componentId:string, propertyId:string):ng.IPromise; + deleteAttribute(componentId:string, attributeId:string):ng.IPromise; + changeResourceInstanceVersion(componentId:string, componentInstanceId:string, componentUid:string):ng.IPromise; + updateInstanceArtifact(componentId:string, instanceId:string, artifact:Models.ArtifactModel):ng.IPromise; + addInstanceArtifact(componentId: string, instanceId: string, artifact:Models.ArtifactModel):ng.IPromise; + deleteInstanceArtifact(componentId: string, instanceId: string, artifact:string, artifactLabel):ng.IPromise; + createComponentInstance(componentId:string, componentInstance:Models.ComponentsInstances.ComponentInstance):ng.IPromise; + updateComponentInstance(componentId:string, componentInstance:Models.ComponentsInstances.ComponentInstance):ng.IPromise; + updateMultipleComponentInstances(componentId:string, instances:Array):ng.IPromise< Array>; + downloadArtifact(componentId:string, artifactId:string):ng.IPromise; + uploadInstanceEnvFile(componentId:string, instanceId:string, artifact:Models.ArtifactModel):ng.IPromise; + downloadInstanceArtifact(componentId:string, instanceId:string, artifactId:string):ng.IPromise; + deleteComponentInstance(componentId:string, componentInstanceId:string):ng.IPromise; + createRelation(componentId:string, link:Models.RelationshipModel):ng.IPromise; + deleteRelation(componentId:string, link:Models.RelationshipModel):ng.IPromise; + getRequirementsCapabilities(componentId:string):ng.IPromise; + updateInstanceProperty(componentId:string, property:Models.PropertyModel):ng.IPromise; + updateInstanceAttribute(componentId:string, attribute:Models.AttributeModel):ng.IPromise; + getComponentInstancesFilteredByInputsAndProperties(componentId:string, searchText:string):ng.IPromise> + getComponentInstanceInputs(componentId:string, instanceId:string, originComponentUid):ng.IPromise>; + getComponentInputs(componentId:string):ng.IPromise>; + getComponentInstanceInputProperties(componentId:string, instanceId:string, inputId:string):ng.IPromise>; + getModuleForDisplay(componentId:string, moduleId:string):ng.IPromise; + updateGroupMetadata(componentId:string, group:Models.Module):ng.IPromise; + getComponentInputInputs(serviceId:string, input:string): ng.IPromise>; + createInputsFromInstancesInputs(serviceId:string, instancesInputsMap:Models.InstancesInputsMap): ng.IPromise>; + createInputsFromInstancesInputsProperties(resourceId:string, instanceInputsPropertiesMap:Models.InstanceInputsPropertiesMap): ng.IPromise>; + deleteComponentInput(serviceId:string, inputId:string):ng.IPromise; + } + + export class ComponentService implements IComponentService { + + static '$inject' = [ + '$log', + 'Restangular', + 'sdcConfig', + 'Sdc.Services.SharingService', + '$q', + '$interval', + '$base64', + 'ComponentInstanceFactory' + ]; + + constructor(protected $log: ng.ILogService, + protected restangular:restangular.IElement, + protected sdcConfig:Models.IAppConfigurtaion, + protected sharingService:Sdc.Services.SharingService, + protected $q:ng.IQService, + protected $interval:any, + protected $base64:any, + protected ComponentInstanceFactory:Utils.ComponentInstanceFactory) { + + this.restangular.setBaseUrl(sdcConfig.api.root + sdcConfig.api.component_api_root); + this.restangular.setRequestInterceptor(function (elem, operation) { + if (operation === "remove") { + return null; + } + return elem; + }); + // this.restangular.setDefaultHeaders({'Content-Type': 'application/json; charset=UTF-8'}); + } + + //this function is override by each service, we need to change this method to abstract when updtaing typescript version + protected createComponentObject = (component:Models.Components.Component):Models.Components.Component => { + return component; + }; + + public getComponent = (id:string):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(id).get().then((response:Models.Components.Component) => { + let component:Models.Components.Component = this.createComponentObject(response); + //this.$log.debug("Component Loaded successfully : ", component); + deferred.resolve(component); + }, (err)=> { + this.$log.debug("Failed to load component with ID: " + id); + deferred.reject(err); + }); + return deferred.promise; + }; + + public updateComponent = (component:Models.Components.Component):ng.IPromise => { + // If this is resource + if (component instanceof Sdc.Models.Components.Resource) { + let resource:Sdc.Models.Components.Resource = component; + if (resource.importedFile) { + // Update resource with payload data. + return this.updateResourceWithPayload(resource); + } else { + if (component.csarUUID) { + // Update resource without payload data. + return this.updateResource(component); + } else { + // Update resource without payload data (metadata). + return this.updateResourceMetadata(component); + } + } + } else { + return this.updateService(component); + } + }; + + private updateService = (component:Models.Components.Component):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(component.uniqueId).one("metadata").customPUT(JSON.stringify(component)).then((response:Models.Components.Component) => { + let component:Models.Components.Component = this.createComponentObject(response); + deferred.resolve(component); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + private updateResource = (component:Models.Components.Component):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(component.uniqueId).customPUT(JSON.stringify(component)).then((response:Models.Components.Component) => { + let component:Models.Components.Component = this.createComponentObject(response); + deferred.resolve(component); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + private updateResourceMetadata = (component:Models.Components.Component):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(component.uniqueId).one('metadata').customPUT(JSON.stringify(component)).then((response:Models.Components.Component) => { + let component:Models.Components.Component = this.createComponentObject(response); + deferred.resolve(component); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + /** + * Only resource can be updated with payload data + * @param component + * @returns {IPromise} + */ + private updateResourceWithPayload = (resource:Sdc.Models.Components.Resource):ng.IPromise => { + let deferred = this.$q.defer(); + + resource.payloadData = resource.importedFile.base64; + resource.payloadName = resource.importedFile.filename; + let headerObj = this.getHeaderMd5(resource); + + this.restangular.one(resource.uniqueId).customPUT(JSON.stringify(resource), '', {}, headerObj).then((response:Models.Components.Component) => { + let componentResult:Models.Components.Component = this.createComponentObject(response); + deferred.resolve(componentResult); + }, (err)=> { + deferred.reject(err); + }); + + return deferred.promise; + }; + + public createComponent = (component:Models.Components.Component):ng.IPromise => { + let deferred = this.$q.defer(); + let headerObj = this.getHeaderMd5(component); + this.restangular.customPOST(JSON.stringify(component), '', {}, headerObj).then((response:Models.Components.Component) => { + let component:Models.Components.Component = this.createComponentObject(response); + deferred.resolve(component); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + public validateName = (newName:string, subtype?:string):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one("validate-name").one(newName).get({'subtype': subtype}).then((response:any) => { + deferred.resolve(response.plain()); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + public changeLifecycleState = (component:Models.Components.Component, state:string, userRemarks:any):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(component.uniqueId).one(state).customPOST(userRemarks).then((response:Models.Components.Component) => { + this.sharingService.addUuidValue(response.uniqueId, response.uuid); + let component:Models.Components.Component = this.createComponentObject(response); + deferred.resolve(component); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + // ------------------------------------------------ Artifacts API --------------------------------------------------// + public addOrUpdateArtifact = (componentId:string, artifact:Models.ArtifactModel):ng.IPromise => { + let deferred = this.$q.defer(); + let headerObj = {}; + if (artifact.payloadData) { + headerObj = this.getHeaderMd5(artifact); + } + this.restangular.one(componentId).one("artifacts").customPOST(JSON.stringify(artifact), artifact.uniqueId, {}, headerObj).then((response:any) => { + deferred.resolve(response.plain()); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + public downloadArtifact = (componentId:string, artifactId:string):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("artifacts").one(artifactId).get().then((response:any) => { + deferred.resolve(response.plain()); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + public deleteArtifact = (componentId:string, artifactId:string, artifactLabel:string):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("artifacts").one(artifactId).remove({'operation': artifactLabel}).then((response:Models.ArtifactModel) => { + deferred.resolve(response); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + + // ------------------------------------------------ Properties API --------------------------------------------------// + public addProperty = (componentId:string, property:Models.PropertyModel):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("properties").customPOST(property.convertToServerObject()).then((response:any) => { + let property:Models.PropertyModel = new Models.PropertyModel(response[Object.keys(response)[0]]); + deferred.resolve(property); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + public updateProperty = (componentId:string, property:Models.PropertyModel):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("properties").one(property.uniqueId).customPUT(property.convertToServerObject()).then((response:any) => { + let property:Models.PropertyModel = new Models.PropertyModel(response[Object.keys(response)[0]]); + deferred.resolve(property); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + public deleteProperty = (componentId:string, propertyId:string):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("properties").one(propertyId).remove().then((response:any) => { + deferred.resolve(response); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + // ------------------------------------------------ Attributes API --------------------------------------------------// + public addAttribute = (componentId:string, attribute:Models.AttributeModel):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("attributes").customPOST(attribute.convertToServerObject()).then((response:any) => { + let attribute:Models.AttributeModel = new Models.AttributeModel(response); + deferred.resolve(attribute); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + public updateAttribute = (componentId:string, attribute:Models.AttributeModel):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("attributes").one(attribute.uniqueId).customPUT(attribute.convertToServerObject()).then((response:any) => { + let attribute:Models.AttributeModel = new Models.AttributeModel(response); + deferred.resolve(attribute); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + public deleteAttribute = (componentId:string, attributeId:string):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("attributes").one(attributeId).remove().then((response:any) => { + deferred.resolve(response); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + // ------------------------------------------------ Component Instances API --------------------------------------------------// + + public createComponentInstance = (componentId:string, componentInstance:Models.ComponentsInstances.ComponentInstance):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("resourceInstance").customPOST(JSON.stringify(componentInstance)).then((response:any) => { + let componentInstance:Models.ComponentsInstances.ComponentInstance = Utils.ComponentInstanceFactory.createComponentInstance(response); + this.$log.debug("Component Instance created", componentInstance); + deferred.resolve(componentInstance); + }, (err)=> { + this.$log.debug("Failed to create componentInstance. With Name: " + componentInstance.name); + deferred.reject(err); + }); + return deferred.promise; + }; + + public updateComponentInstance = (componentId:string, componentInstance:Models.ComponentsInstances.ComponentInstance):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("resourceInstance").one(componentInstance.uniqueId).customPOST(JSON.stringify(componentInstance)).then((response:any) => { + let componentInstance:Models.ComponentsInstances.ComponentInstance = Utils.ComponentInstanceFactory.createComponentInstance(response); + this.$log.debug("Component Instance was updated", componentInstance); + deferred.resolve(componentInstance); + }, (err)=> { + this.$log.debug("Failed to update componentInstance. With ID: " + componentInstance.uniqueId + "Name: " + componentInstance.name); + deferred.reject(err); + }); + return deferred.promise; + }; + + public updateMultipleComponentInstances = (componentId:string, instances:Array):ng.IPromise> => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("resourceInstance/multipleComponentInstance").customPOST(JSON.stringify(instances)).then((response:any) => { + this.$log.debug("Multiple Component Instances was updated", response); + let updateInstances:Array = new Array(); + _.forEach(response, (componentInstance:Models.ComponentsInstances.ComponentInstance) => { + let updatedComponentInstance:Models.ComponentsInstances.ComponentInstance = Utils.ComponentInstanceFactory.createComponentInstance(componentInstance); + updateInstances.push(updatedComponentInstance); + }); + deferred.resolve(updateInstances); + }, (err)=> { + this.$log.debug("Failed to update Multiple componentInstance."); + deferred.reject(err); + }); + return deferred.promise; + }; + + public deleteComponentInstance = (componentId:string, componentInstanceId:string):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("resourceInstance").one(componentInstanceId).remove().then(() => { + this.$log.debug("Component Instance was deleted"); + deferred.resolve(); + }, (err)=> { + this.$log.debug("Failed to delete componentInstance. With ID: " + componentInstanceId); + deferred.reject(err); + }); + return deferred.promise; + }; + + public changeResourceInstanceVersion = (componentId:string, componentInstanceId:string, componentUid:string):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("resourceInstance").one(componentInstanceId).one("changeVersion").customPOST({'componentUid': componentUid}).then((response:any) => { + let componentInstance:Models.ComponentsInstances.ComponentInstance = Utils.ComponentInstanceFactory.createComponentInstance(response); + deferred.resolve(componentInstance); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + public downloadInstanceArtifact = (componentId:string, instanceId:string, artifactId:string):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("resourceInstances").one(instanceId).one("artifacts").one(artifactId).get().then((response:any) => { + deferred.resolve(response.plain()); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + public updateInstanceArtifact = (componentId:string, instanceId:string, artifact:Models.ArtifactModel):ng.IPromise => { + let deferred = this.$q.defer(); + let headerObj = {}; + if(artifact.payloadData){ + headerObj = this.getHeaderMd5(artifact); + } + this.restangular.one(componentId).one("resourceInstance").one(instanceId).one("artifacts").customPOST(JSON.stringify(artifact), artifact.uniqueId , {}, headerObj).then((response: any) => { + let newArtifact = new Models.ArtifactModel(response); + deferred.resolve(newArtifact); + }, (err)=>{ + deferred.reject(err); + }); + return deferred.promise; + }; + + public addInstanceArtifact = (componentId: string, instanceId: string, artifact:Models.ArtifactModel): ng.IPromise => { + let deferred = this.$q.defer(); + let headerObj = {}; + if(artifact.payloadData){ + headerObj = this.getHeaderMd5(artifact); + } + this.restangular.one(componentId).one("resourceInstance").one(instanceId).one("artifacts").customPOST(JSON.stringify(artifact), artifact.uniqueId , {}, headerObj).then((response: any) => { + let artifact:Models.ArtifactModel = new Models.ArtifactModel(response.plain()); + deferred.resolve(artifact); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + public deleteInstanceArtifact = (componentId: string , instanceId: string, artifactId:string, artifactLabel: string): ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("resourceInstance").one(instanceId).one("artifacts").one(artifactId).remove({'operation': artifactLabel}).then((response: Models.ArtifactModel) => { + deferred.resolve(response); + }, (err)=>{ + deferred.reject(err); + }); + return deferred.promise; + }; + + public uploadInstanceEnvFile = (componentId:string, instanceId:string, artifact:Models.ArtifactModel):ng.IPromise => { + let deferred = this.$q.defer(); + let headerObj = {}; + if (artifact.payloadData) { + headerObj = this.getHeaderMd5(artifact); + } + this.restangular.one(componentId).one("resourceInstance").one(instanceId).one("artifacts").customPOST(JSON.stringify(artifact), artifact.uniqueId, {}, headerObj).then((response:any) => { + let newArtifact = new Models.ArtifactModel(response); + deferred.resolve(newArtifact); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + public updateInstanceProperty = (componentId:string, property:Models.PropertyModel):ng.IPromise => { + let deferred = this.$q.defer(); + let instanceId = property.resourceInstanceUniqueId; + this.restangular.one(componentId).one("resourceInstance").one(instanceId).one("property").customPOST(JSON.stringify(property)).then((response:any) => { + let newProperty = new Models.PropertyModel(response); + newProperty.readonly = true; + newProperty.resourceInstanceUniqueId = instanceId; + deferred.resolve(newProperty); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + public updateInstanceAttribute = (componentId:string, attribute:Models.AttributeModel):ng.IPromise => { + let deferred = this.$q.defer(); + let instanceId = attribute.resourceInstanceUniqueId; + this.restangular.one(componentId).one("resourceInstance").one(instanceId).one("attribute").customPOST(JSON.stringify(attribute)).then((response:any) => { + let newAttribute = new Models.AttributeModel(response); + newAttribute.readonly = true; + newAttribute.resourceInstanceUniqueId = instanceId; + deferred.resolve(newAttribute); + }, (err)=> { + deferred.reject(err); + }); + return deferred.promise; + }; + + public createRelation = (componentId:string, link:Models.RelationshipModel):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("resourceInstance").one("associate").customPOST(JSON.stringify(link)).then((response:any) => { + let relation:Models.RelationshipModel = new Models.RelationshipModel(response.plain()); + this.$log.debug("Link created successfully ", relation); + deferred.resolve(relation); + }, (err)=> { + this.$log.debug("Failed to create Link From: " + link.fromNode + "To: " + link.toNode); + deferred.reject(err); + }); + return deferred.promise; + }; + + public deleteRelation = (componentId:string, link:Models.RelationshipModel):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("resourceInstance").one("dissociate").customPUT(JSON.stringify(link)).then((response:any) => { + let relation:Models.RelationshipModel = new Models.RelationshipModel(response); + this.$log.debug("Link deleted successfully ", relation); + deferred.resolve(relation); + }, (err)=> { + this.$log.debug("Failed to delete Link From: " + link.fromNode + "To: " + link.toNode); + deferred.reject(err); + }); + return deferred.promise; + }; + + public getRequirementsCapabilities = (componentId:string):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("requirmentsCapabilities").get().then((response:any) => { + this.$log.debug("Component requirement capabilities recived: ", response); + deferred.resolve(response); + }, (err)=> { + this.$log.debug("Failed to get requirements & capabilities"); + deferred.reject(err); + }); + return deferred.promise; + }; + + public getModuleForDisplay = (componentId:string, moduleId:string):ng.IPromise => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("groups").one(moduleId).get().then((response:any) => { + this.$log.debug("module loaded successfully: ", response); + let module:Models.DisplayModule = new Models.DisplayModule(response); + deferred.resolve(module); + }, (err)=> { + this.$log.debug("Failed to get module with id: ", moduleId); + deferred.reject(err); + }); + return deferred.promise; + }; + + public getComponentInstancesFilteredByInputsAndProperties = (componentId:string, searchText?:string):ng.IPromise> => { + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("componentInstances").get({'searchText': searchText}).then((response:any) => { + this.$log.debug("component instances return successfully: ", response); + let componentInstances:Array = Utils.CommonUtils.initComponentInstances(response); + deferred.resolve(componentInstances); + }, (err) => { + this.$log.debug("Failed to get component instances of component with id: " + componentId); + deferred.reject(err); + }); + + return deferred.promise; + }; + + public getComponentInstanceInputs = (componentId:string, instanceId:string, originComponentUid):ng.IPromise> => { + + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("componentInstances").one(instanceId).one(originComponentUid).one("inputs").get().then((response:any) => { + this.$log.debug("component instance input return successfully: ", response); + let inputsArray:Array = new Array(); + _.forEach(response, (inputObj:Models.InputModel) => { + inputsArray.push(new Models.InputModel(inputObj)); + }); + deferred.resolve(inputsArray); + }, (err) => { + this.$log.debug("Failed to get component instance input with id: " + instanceId); + deferred.reject(err); + }); + + return deferred.promise; + }; + + public getComponentInputs = (componentId:string):ng.IPromise> => { + + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("inputs").get().then((response:any) => { + this.$log.debug("component inputs return successfully: ", response); + let inputsArray:Array = new Array(); + _.forEach(response, (inputObj:Models.InputModel) => { + inputsArray.push(new Models.InputModel(inputObj)); + }); + deferred.resolve(inputsArray); + }, (err) => { + this.$log.debug("Failed to get component inputs for component with id: " + componentId); + deferred.reject(err); + }); + + return deferred.promise; + }; + + public getComponentInstanceInputProperties = (componentId:string, instanceId:string, inputId:string):ng.IPromise> => { + + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("componentInstances").one(instanceId).one(inputId).one("properties").get().then((response:any) => { + this.$log.debug("component instance input properties return successfully: ", response); + let propertiesArray:Array = new Array(); + _.forEach(response, (propertyObj:Models.PropertyModel) => { + propertiesArray.push(new Models.PropertyModel(propertyObj)); + }); + deferred.resolve(propertiesArray); + }, (err) => { + this.$log.debug("Failed to get component instance input properties with instanceId: " + instanceId + "and input id: " + inputId); + deferred.reject(err); + }); + + return deferred.promise; + }; + + public updateGroupMetadata = (componentId:string, group:Models.Module):ng.IPromise => { + + let deferred = this.$q.defer(); + this.restangular.one(componentId).one("groups").one(group.uniqueId).one("metadata").customPUT(JSON.stringify(group)).then((response:Models.Module) => { + this.$log.debug("group metadata updated successfully: ", response); + let updatedGroup:Models.Module = new Models.Module(response); + + deferred.resolve(updatedGroup); + }, (err) => { + this.$log.debug("Failed to update group metadata for component: " + componentId + " for group with id: " + group.uniqueId); + deferred.reject(err); + }); + + return deferred.promise; + }; + + public getComponentInputInputs = (serviceId:string, inputId:string): ng.IPromise> => { + let defer = this.$q.defer(); + this.restangular.one(serviceId).one("inputs").one(inputId).one("inputs").get().then((response: any) => { + let inputsArray:Array = new Array(); + _.forEach(response, (inputObj:Models.InputModel) => { + inputsArray.push(new Models.InputModel(inputObj)); + }); + defer.resolve(inputsArray); + }, (err)=>{ + this.$log.debug("failed to get inputs of input : ", err); + defer.reject(err); + }); + return defer.promise; + }; + + createInputsFromInstancesInputsProperties = (resourceId:string, instancePropertyMap:Models.InstanceInputsPropertiesMap): ng.IPromise> => { + let defer = this.$q.defer(); + this.restangular.one(resourceId).one("create/properties").customPOST(instancePropertyMap).then((response: any) => { + let inputsArray:Array = new Array(); + _.forEach(response, (inputObj:Models.PropertyModel) => { + inputsArray.push(new Models.PropertyModel(inputObj)); + }); + defer.resolve(inputsArray); + }, (err)=>{ + this.$log.debug("failed to create service inputs from VF instances inputs : ", err); + defer.reject(err); + }); + return defer.promise; + }; + + createInputsFromInstancesInputs = (serviceId:string, instancesMap:Models.InstancesInputsMap): ng.IPromise> => { + let defer = this.$q.defer(); + this.restangular.one(serviceId).one("create/inputs").customPOST(instancesMap).then((response: any) => { + let inputsArray:Array = new Array(); + _.forEach(response, (inputObj:Models.InputModel) => { + inputsArray.push(new Models.InputModel(inputObj)); + }); + defer.resolve(inputsArray); + }, (err)=>{ + this.$log.debug("failed to create service inputs from VF instances inputs : ", err); + defer.reject(err); + }); + return defer.promise; + }; + + deleteComponentInput = (serviceId:string, inputId:string) : ng.IPromise => { + var defer = this.$q.defer(); + this.restangular.one(serviceId).one("delete").one(inputId).one("input").remove().then((response: any) => { + var inputToDelete = new Models.InputModel(response); + + defer.resolve(inputToDelete); + }, (err)=> { + console.log("failed to delete input from service: ", err); + defer.reject(err); + }); + return defer.promise; + }; + + private getHeaderMd5 = (object:any):any => { + let headerObj={}; + // This is ugly workaround!!! + // The md5 result is not correct if we do not add the line JSON.stringify(resource); twice. + JSON.stringify(object); + let componentString:string = JSON.stringify(object); + let md5Result = md5(componentString).toLowerCase(); + headerObj = {'Content-MD5': this.$base64.encode(md5Result)}; + return headerObj; + }; + + } +} diff --git a/catalog-ui/app/scripts/services/components/product-service.ts b/catalog-ui/app/scripts/services/components/product-service.ts new file mode 100644 index 0000000000..69171fbbfa --- /dev/null +++ b/catalog-ui/app/scripts/services/components/product-service.ts @@ -0,0 +1,61 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/8/2016. + */ +/// +module Sdc.Services.Components { + 'use strict'; + + export interface IProductService extends IComponentService { + + } + + export class ProductService extends ComponentService implements IProductService { + + static '$inject' = [ + '$log', + 'Restangular', + 'sdcConfig', + 'Sdc.Services.SharingService', + '$q', + '$interval', + '$base64', + 'ComponentInstanceFactory' + ]; + + constructor(protected $log: ng.ILogService, + protected restangular: restangular.IElement, + protected sdcConfig: Models.IAppConfigurtaion, + protected sharingService: Sdc.Services.SharingService, + protected $q: ng.IQService, + protected $interval: any, + protected $base64: any, + protected ComponentInstanceFactory: Utils.ComponentInstanceFactory) { + super($log, restangular, sdcConfig, sharingService, $q, $interval, $base64, ComponentInstanceFactory); + + this.restangular = restangular.one("products"); + } + + createComponentObject = (component: Models.Components.Component): Models.Components.Component => { + return new Models.Components.Product(this, this.$q, component); + }; + } +} diff --git a/catalog-ui/app/scripts/services/components/resource-service.ts b/catalog-ui/app/scripts/services/components/resource-service.ts new file mode 100644 index 0000000000..48781da48e --- /dev/null +++ b/catalog-ui/app/scripts/services/components/resource-service.ts @@ -0,0 +1,61 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/4/2016. + */ +/// +module Sdc.Services.Components { + 'use strict'; + + export interface IResourceService extends IComponentService { + + } + + export class ResourceService extends ComponentService implements IResourceService { + + static '$inject' = [ + '$log', + 'Restangular', + 'sdcConfig', + 'Sdc.Services.SharingService', + '$q', + '$interval', + '$base64', + 'ComponentInstanceFactory' + ]; + + constructor(protected $log: ng.ILogService, + protected restangular: restangular.IElement, + protected sdcConfig: Models.IAppConfigurtaion, + protected sharingService: Sdc.Services.SharingService, + protected $q: ng.IQService, + protected $interval: any, + protected $base64: any, + protected ComponentInstanceFactory: Utils.ComponentInstanceFactory) { + super($log, restangular, sdcConfig, sharingService, $q, $interval, $base64, ComponentInstanceFactory); + + this.restangular = restangular.one("resources"); + } + + createComponentObject = (component: Models.Components.Component): Models.Components.Component => { + return new Models.Components.Resource(this, this.$q, component); + }; + } +} diff --git a/catalog-ui/app/scripts/services/components/service-service.ts b/catalog-ui/app/scripts/services/components/service-service.ts new file mode 100644 index 0000000000..fef0b47512 --- /dev/null +++ b/catalog-ui/app/scripts/services/components/service-service.ts @@ -0,0 +1,97 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/4/2016. + */ +/// +module Sdc.Services.Components { + 'use strict'; + + + export interface IServiceService extends IComponentService { + getDistributionsList(uuid: string): ng.IPromise>; + getDistributionComponents(distributionId: string): ng.IPromise>; + markAsDeployed(serviceId: string, distributionId: string): ng.IPromise; + } + + export class ServiceService extends ComponentService implements IServiceService { + + static '$inject' = [ + '$log', + 'Restangular', + 'sdcConfig', + 'Sdc.Services.SharingService', + '$q', + '$interval', + '$base64', + 'ComponentInstanceFactory' + ]; + + public distribution: string = "distribution"; + + constructor(protected $log: ng.ILogService, + protected restangular: restangular.IElement, + protected sdcConfig: Models.IAppConfigurtaion, + protected sharingService: Sdc.Services.SharingService, + protected $q: ng.IQService, + protected $interval: any, + protected $base64: any, + protected ComponentInstanceFactory: Utils.ComponentInstanceFactory) { + super($log, restangular, sdcConfig, sharingService, $q, $interval, $base64, ComponentInstanceFactory); + + this.restangular = restangular.one("services"); + } + + getDistributionsList = (uuid: string): ng.IPromise> => { + let defer = this.$q.defer>(); + this.restangular.one(uuid).one("distribution").get().then((distributions: any) => { + defer.resolve(> distributions.distributionStatusOfServiceList); + }, (err)=> { + defer.reject(err); + }); + return defer.promise; + }; + + getDistributionComponents = (distributionId: string): ng.IPromise> => { + let defer = this.$q.defer>(); + this.restangular.one("distribution").one(distributionId).get().then((distributions: any) => { + defer.resolve(> distributions.distributionStatusList); + }, (err)=> { + defer.reject(err); + }); + return defer.promise; + }; + + markAsDeployed = (serviceId: string, distributionId: string): ng.IPromise => { + let defer = this.$q.defer(); + this.restangular.one(serviceId).one("distribution").one(distributionId).one("markDeployed").customPOST().then((result: any) => { + defer.resolve(result); + }, (err)=> { + + defer.reject(err); + }); + return defer.promise; + }; + + createComponentObject = (component: Models.Components.Component): Models.Components.Component => { + return new Models.Components.Service(this, this.$q, component); + }; + } +} diff --git a/catalog-ui/app/scripts/services/components/utils/composition-left-palette-service.ts b/catalog-ui/app/scripts/services/components/utils/composition-left-palette-service.ts new file mode 100644 index 0000000000..25ac1cdf17 --- /dev/null +++ b/catalog-ui/app/scripts/services/components/utils/composition-left-palette-service.ts @@ -0,0 +1,248 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 3/13/2016. + */ +/// +module Sdc.Services.Components { + + 'use strict'; + + export class LeftPanelLatestVersion { + uid: string; + version: string; + } + + export class LeftPaletteDataObject { + currentUpdatingIdsList: Array; + latestVersionAndIdsList: Array; + fullDataLeftPaletteComponents: Array; + displayLeftPanelComponents: Array; + onFinishLoadingEvent: string; + + constructor(onFinishEventListener: string) { + + this.fullDataLeftPaletteComponents = new Array(); + this.displayLeftPanelComponents = new Array(); + this.currentUpdatingIdsList = new Array(); + this.latestVersionAndIdsList = new Array(); + this.onFinishLoadingEvent = onFinishEventListener; + } + } + + export class LeftPaletteLoaderService { + + static '$inject' = [ + 'Restangular', + 'sdcConfig', + '$q', + '$base64', + 'ComponentFactory', + 'EventListenerService' + + ]; + + constructor(protected restangular: restangular.IElement, + protected sdcConfig: Models.IAppConfigurtaion, + protected $q: ng.IQService, + protected $base64: any, + protected ComponentFactory: Utils.ComponentFactory, + protected EventListenerService: Services.EventListenerService) { + + this.restangular.setBaseUrl(sdcConfig.api.root + sdcConfig.api.component_api_root); + } + + private serviceLeftPaletteData: LeftPaletteDataObject; + private resourceLeftPaletteData: LeftPaletteDataObject; + private productLeftPaletteData: LeftPaletteDataObject; + private vlData: LeftPaletteDataObject; + + public loadLeftPanel = (): void => { + + this.serviceLeftPaletteData = new LeftPaletteDataObject(Utils.Constants.EVENTS.SERVICE_LEFT_PALETTE_UPDATE_EVENT); + this.resourceLeftPaletteData = new LeftPaletteDataObject(Utils.Constants.EVENTS.RESOURCE_LEFT_PALETTE_UPDATE_EVENT); + this.productLeftPaletteData = new LeftPaletteDataObject(Utils.Constants.EVENTS.PRODUCT_LEFT_PALETTE_UPDATE_EVENT); + this.vlData = new LeftPaletteDataObject(Utils.Constants.EVENTS.VL_LEFT_PALETTE_UPDATE_EVENT); + + //initiating service palette + this.updateComponentLeftPalette(Utils.Constants.ComponentType.SERVICE); + + //initiating resource palette + this.updateComponentLeftPalette(Utils.Constants.ComponentType.RESOURCE); + + //initiating product palette + this.updateComponentLeftPalette(Utils.Constants.ComponentType.PRODUCT); + + //initiating vl + this.updateComponentLeftPalette(Utils.Constants.ResourceType.VL); + }; + + private updateData = (latestVersionComponents: Array, leftPaletteDataObj: LeftPaletteDataObject) => { + + let fullDataComponentsArray: Array = new Array(); + let displayComponentsArray: Array = new Array(); + + _.forEach(latestVersionComponents, (componentObj: any) => { + let component: Models.Components.Component = this.ComponentFactory.createComponent(componentObj); + fullDataComponentsArray.push(component); + displayComponentsArray.push(new Models.DisplayComponent(component)); + }); + + leftPaletteDataObj.fullDataLeftPaletteComponents = leftPaletteDataObj.fullDataLeftPaletteComponents.concat(fullDataComponentsArray); + leftPaletteDataObj.displayLeftPanelComponents = leftPaletteDataObj.displayLeftPanelComponents.concat(displayComponentsArray); + }; + + private getTypeUrl = (componentType: string): string => { + return Utils.Constants.ComponentType.PRODUCT === componentType ? "services" : "resources"; + }; + + private onFinishLoading = (componentType: string, leftPaletteData: LeftPaletteDataObject): void => { + leftPaletteData.currentUpdatingIdsList = []; + this.EventListenerService.notifyObservers(leftPaletteData.onFinishLoadingEvent); + }; + + private getPartialLastVersionFullComponents = (componentType: string, componentInternalType: string, leftPaletteData: LeftPaletteDataObject): void => { + this.restangular.one(this.getTypeUrl(componentType)).one('/latestversion/notabstract').customPOST(leftPaletteData.currentUpdatingIdsList, '', {'internalComponentType': componentInternalType}).then((componentsArray: any) => { + this.updateData(componentsArray, leftPaletteData); + this.onFinishLoading(componentType, leftPaletteData); //when finish loading update view + }); + }; + + private removeNotUpdatedComponents = (leftPaletteObject: LeftPaletteDataObject) => { + + leftPaletteObject.fullDataLeftPaletteComponents = _.filter(leftPaletteObject.fullDataLeftPaletteComponents, (component)=> { + return leftPaletteObject.currentUpdatingIdsList.indexOf(component.uniqueId) != -1; + }); + leftPaletteObject.displayLeftPanelComponents = _.filter(leftPaletteObject.displayLeftPanelComponents, (component)=> { + return leftPaletteObject.currentUpdatingIdsList.indexOf(component.uniqueId) != -1; + }); + }; + + private findIdsToUpdate = (leftPaletteObj: LeftPaletteDataObject): Array => { + let idsToUpdate = _.difference(leftPaletteObj.currentUpdatingIdsList, _.map(leftPaletteObj.fullDataLeftPaletteComponents, 'uniqueId')); + let neededUpdate = _.filter(leftPaletteObj.fullDataLeftPaletteComponents, (component) => { + let updated = _.find(leftPaletteObj.latestVersionAndIdsList, (versionAndId: LeftPanelLatestVersion) => { + return versionAndId.uid === component.uniqueId && versionAndId.version != component.version + }); + return updated != undefined; + }); + if (neededUpdate && neededUpdate.length > 0) { + let neededUpdateIds = _.map(neededUpdate, 'uid'); + idsToUpdate.concat(neededUpdateIds); + } + return idsToUpdate; + }; + + private updateCurrentIdsList = (componentType: string, leftPaletteObj: LeftPaletteDataObject): void=> { + this.removeNotUpdatedComponents(leftPaletteObj); + leftPaletteObj.currentUpdatingIdsList = this.findIdsToUpdate(leftPaletteObj); + //remove all components that needed update from current lists + if (leftPaletteObj.currentUpdatingIdsList.length > 0) { + leftPaletteObj.displayLeftPanelComponents = _.filter(leftPaletteObj.displayLeftPanelComponents, (component)=> { + return leftPaletteObj.currentUpdatingIdsList.indexOf(component.uniqueId) === -1; + }); + leftPaletteObj.fullDataLeftPaletteComponents = _.filter(leftPaletteObj.fullDataLeftPaletteComponents, (component)=> { + return leftPaletteObj.currentUpdatingIdsList.indexOf(component.uniqueId) === -1; + }); + } + }; + + private updateLeftPalette = (componentType, componentInternalType: string, leftPaletteData: LeftPaletteDataObject): void => { + if (leftPaletteData.currentUpdatingIdsList.length > 0) return; //this means the service is still performing update + this.restangular.one(this.getTypeUrl(componentType)).one('/latestversion/notabstract/uidonly').get({'internalComponentType': componentInternalType}).then((latestVersionUniqueIds: Array) => { + leftPaletteData.latestVersionAndIdsList = latestVersionUniqueIds; + leftPaletteData.currentUpdatingIdsList = _.map(latestVersionUniqueIds, 'uid') + + if (leftPaletteData.fullDataLeftPaletteComponents.length === 0) { //this is when first loading product or resource left palette + this.getPartialLastVersionFullComponents(componentType, componentInternalType, leftPaletteData); + } else { + this.updateCurrentIdsList(componentType, leftPaletteData); + if (leftPaletteData.currentUpdatingIdsList.length === 0) { + this.onFinishLoading(componentType, leftPaletteData); //when finish loading update view + return; + } + this.getPartialLastVersionFullComponents(componentType, componentInternalType, leftPaletteData); + } + }); + }; + + public getLeftPanelComponentsForDisplay = (componentType: string): Array => { + switch (componentType) { + case Utils.Constants.ComponentType.SERVICE: + return this.serviceLeftPaletteData.displayLeftPanelComponents; + case Utils.Constants.ComponentType.PRODUCT: + return this.productLeftPaletteData.displayLeftPanelComponents; + default: + return this.resourceLeftPaletteData.displayLeftPanelComponents; + } + }; + + public getFullDataComponentList = (componentType: string): Array => { + switch (componentType) { + case Utils.Constants.ResourceType.VL: + return this.vlData.fullDataLeftPaletteComponents; + case Utils.Constants.ComponentType.SERVICE: + return this.serviceLeftPaletteData.fullDataLeftPaletteComponents; + case Utils.Constants.ComponentType.PRODUCT: + return this.productLeftPaletteData.fullDataLeftPaletteComponents; + default : + return this.resourceLeftPaletteData.fullDataLeftPaletteComponents; + } + }; + + public getFullDataComponentListWithVls = (componentType: string): Array => { + let listPart1: Array; + let listPart2: Array; + if (componentType === Utils.Constants.ResourceType.VL) { + listPart1 = []; + listPart2 = this.getFullDataComponentList(Utils.Constants.ResourceType.VL); + } else { + listPart1 = this.getFullDataComponentList(componentType); + listPart2 = this.getFullDataComponentList(Utils.Constants.ResourceType.VL); + } + return listPart1.concat(listPart2); + }; + + public updateSpecificComponentLeftPalette = (component: Models.Components.Component, componentType: string): void => { + let listComponents: Array = this.getFullDataComponentList(componentType); + for (let i in listComponents) { + if (listComponents[i].uniqueId === component.uniqueId) { + listComponents[i] = component; + } + } + }; + + public updateComponentLeftPalette = (componentType): void => { + switch (componentType) { + case Utils.Constants.ResourceType.VL: + this.updateLeftPalette(Utils.Constants.ComponentType.RESOURCE, Utils.Constants.ResourceType.VL, this.vlData); + break; + case Utils.Constants.ComponentType.SERVICE: + this.updateLeftPalette(Utils.Constants.ComponentType.SERVICE, Utils.Constants.ComponentType.SERVICE, this.serviceLeftPaletteData); + break; + case Utils.Constants.ComponentType.PRODUCT: + this.updateLeftPalette(Utils.Constants.ComponentType.PRODUCT, Utils.Constants.ComponentType.SERVICE, this.productLeftPaletteData); + break; + default: + this.updateLeftPalette(Utils.Constants.ComponentType.RESOURCE, Utils.Constants.ResourceType.VF, this.resourceLeftPaletteData); + } + }; + } +} diff --git a/catalog-ui/app/scripts/services/configuration-ui-service.ts b/catalog-ui/app/scripts/services/configuration-ui-service.ts new file mode 100644 index 0000000000..51eb3dcd9c --- /dev/null +++ b/catalog-ui/app/scripts/services/configuration-ui-service.ts @@ -0,0 +1,49 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + + 'use strict' + + interface IConfigurationUiService { + getConfigurationUi(): ng.IPromise; + } + + export class ConfigurationUiService implements IConfigurationUiService{ + + static '$inject' = ['$http', '$q','sdcConfig']; + private api: Models.IApi; + + constructor(private $http: ng.IHttpService, private $q: ng.IQService, sdcConfig: Models.IAppConfigurtaion){ + this.api = sdcConfig.api; + } + + getConfigurationUi = (): ng.IPromise =>{ + let defer = this.$q.defer(); + this.$http.get(this.api.root+this.api.GET_configuration_ui) + .success((result: any) => { + defer.resolve(result); + }); + return defer.promise; + } + } + + +} diff --git a/catalog-ui/app/scripts/services/cookie-service.ts b/catalog-ui/app/scripts/services/cookie-service.ts new file mode 100644 index 0000000000..b23a7dccde --- /dev/null +++ b/catalog-ui/app/scripts/services/cookie-service.ts @@ -0,0 +1,95 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + + 'use strict'; + + interface ICookieService { + getUserId(): string; + getFirstName(): string; + getLastName(): string; + getEmail(): string; + getUserIdSuffix(): string; + } + + export class CookieService implements ICookieService { + + static '$inject' = ['sdcConfig', '$document']; + private cookie: Sdc.Models.ICookie; + private cookiePrefix: string; + + + constructor(sdcConfig: Models.IAppConfigurtaion, private $document) { + this.cookie = sdcConfig.cookie; + + this.cookiePrefix = ''; + let junctionName: string = this.getCookieByName(this.cookie.junctionName); + if ((junctionName !== null) && (junctionName !== '')){ + this.cookiePrefix = this.cookie.prefix+junctionName+'!'; + } + } + + private getCookieByName = (cookieName: string): string => { + cookieName += '='; + let cookies: Array = this.$document[0].cookie.split(';'); + let cookieVal: string = ''; + cookies.forEach((cookie: string) => { + while(cookie.charAt(0) === ' '){ + cookie = cookie.substring(1); + } + if(cookie.indexOf(cookieName) === 0){ + cookieVal = cookie.substring(cookieName.length, cookie.length); + return; + } + }); + return cookieVal; + }; + + public getUserIdSuffix = (): string => { + return this.cookie.userIdSuffix; + }; + + public getUserId = (): string => { + let userIdCookieName: string = this.cookiePrefix+this.cookie.userIdSuffix; + let userId: string = this.getCookieByName(userIdCookieName); + return userId; + }; + + public getFirstName = (): string => { + let firstNameCookieName: string = this.cookiePrefix+this.cookie.userFirstName; + let firstName: string = this.getCookieByName(firstNameCookieName); + return firstName; + }; + + public getLastName = (): string => { + let lastNameCookieName: string = this.cookiePrefix+this.cookie.userLastName; + let lastName: string = this.getCookieByName(lastNameCookieName); + return lastName; + }; + + public getEmail = (): string => { + let emailCookieName: string = this.cookiePrefix+this.cookie.userEmail; + let email: string = this.getCookieByName(emailCookieName); + return email; + }; + + } +} diff --git a/catalog-ui/app/scripts/services/data-types-service.ts b/catalog-ui/app/scripts/services/data-types-service.ts new file mode 100644 index 0000000000..0e5fca8b5d --- /dev/null +++ b/catalog-ui/app/scripts/services/data-types-service.ts @@ -0,0 +1,129 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + + 'use strict'; + + export interface IDataTypesService { + //declare methods + getAllDataTypes():ng.IPromise; + getFirsLevelOfDataTypeProperties(dataTypeName:string, dataTypes:Models.DataTypesMap):Array; + isDataTypeForSchemaType(property:Models.SchemaProperty, types:Models.DataTypesMap):boolean; + isDataTypeForPropertyType(property:Models.PropertyModel, types:Models.DataTypesMap):boolean; + isDataTypeForDataTypePropertyType(property:Models.DataTypePropertyModel, types:Models.DataTypesMap):boolean; + } + + export class DataTypesService implements IDataTypesService { + + static '$inject' = [ + 'sdcConfig', + '$q', + '$http' + ]; + + constructor(private sdcConfig:Models.IAppConfigurtaion, + private $q:ng.IQService, + private $http:ng.IHttpService) { + } + + //if the dt derived from simple- return the first parent type, else- return null + private getTypeForDataTypeDerivedFromSimple = (dataTypeName:string, dataTypes:Models.DataTypesMap):string => { + /////////temporary hack for tosca primitives/////////////////////// + if(!dataTypes[dataTypeName]){ + return 'string'; + } + /////////////////////////////////////////////////////////////////// + if(dataTypes[dataTypeName].derivedFromName == "tosca.datatypes.Root" || dataTypes[dataTypeName].properties){ + return null; + } + if(Utils.Constants.PROPERTY_DATA.SIMPLE_TYPES.indexOf(dataTypes[dataTypeName].derivedFromName) > -1 ){ + return dataTypes[dataTypeName].derivedFromName + } + return this.getTypeForDataTypeDerivedFromSimple(dataTypes[dataTypeName].derivedFromName,dataTypes); + }; + + public getAllDataTypes = ():ng.IPromise => { + let deferred = this.$q.defer(); + this.$http({ + url: this.sdcConfig.api.root + this.sdcConfig.api.component_api_root + "dataTypes", + method: "get" + }) + .success((response:any) => { + deferred.resolve(response); + }) + .error((err) => { + deferred.reject(err); + }); + return deferred.promise; + }; + + //return list of data type properties and all its parents properties + //(not include the properties of its properties, in case this data type has not primitive properties) + public getFirsLevelOfDataTypeProperties = (dataTypeName:string, dataTypes:Models.DataTypesMap):Array => { + let properties = dataTypes[dataTypeName].properties || []; + if(dataTypes[dataTypeName].derivedFromName != "tosca.datatypes.Root" ){ + properties = this.getFirsLevelOfDataTypeProperties(dataTypes[dataTypeName].derivedFromName,dataTypes).concat(properties); + } + return properties; + }; + + //return false when type= data type (=not simple type) that not derived from simple type + public isDataTypeForSchemaType = (property:Models.SchemaProperty, types:Models.DataTypesMap):boolean=>{ + property.simpleType=""; + if(property.type && Utils.Constants.PROPERTY_DATA.TYPES.indexOf(property.type) > -1){ + return false; + } + let simpleType = this.getTypeForDataTypeDerivedFromSimple(property.type, types); + if(simpleType){ + property.simpleType=simpleType; + return false; + } + return true; + }; + + public isDataTypeForPropertyType = (property:Models.PropertyModel, types:Models.DataTypesMap):boolean=>{ + property.simpleType=""; + if(property.type && Utils.Constants.PROPERTY_DATA.TYPES.indexOf(property.type) > -1){ + return false; + } + let simpleType = this.getTypeForDataTypeDerivedFromSimple(property.type, types); + if(simpleType){ + property.simpleType=simpleType; + return false; + } + return true; + }; + + public isDataTypeForDataTypePropertyType = (property:Models.DataTypePropertyModel, types:Models.DataTypesMap):boolean=>{ + property.simpleType=""; + if(property.type && Utils.Constants.PROPERTY_DATA.TYPES.indexOf(property.type) > -1){ + return false; + } + let simpleType = this.getTypeForDataTypeDerivedFromSimple(property.type, types); + if(simpleType){ + property.simpleType=simpleType; + return false; + } + return true; + }; + + } +} diff --git a/catalog-ui/app/scripts/services/ecomp-service.ts b/catalog-ui/app/scripts/services/ecomp-service.ts new file mode 100644 index 0000000000..d7910bd612 --- /dev/null +++ b/catalog-ui/app/scripts/services/ecomp-service.ts @@ -0,0 +1,54 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + + 'use strict'; + + interface IEcompHeaderService { + getMenuItems(userId): ng.IPromise>; + } + + export class EcompHeaderService implements IEcompHeaderService { + static '$inject' = ['$http', '$q', 'sdcConfig']; + private api:Models.IApi; + + constructor(private $http:ng.IHttpService, + private $q:ng.IQService, + private sdcConfig:Models.IAppConfigurtaion) { + this.api = sdcConfig.api; + } + + getMenuItems = (userId):ng.IPromise> => { + let defer = this.$q.defer>(); + //defer.resolve(this.mockData); + this.$http.get(this.api.root + this.api.GET_ecomp_menu_items.replace(':userId', userId)) + .success((response:any) => { + defer.resolve(response); + }) + .error((response) => { + defer.reject(response); + }); + + return defer.promise; + }; + + } +} diff --git a/catalog-ui/app/scripts/services/entity-service.ts b/catalog-ui/app/scripts/services/entity-service.ts new file mode 100644 index 0000000000..a9d5a421ce --- /dev/null +++ b/catalog-ui/app/scripts/services/entity-service.ts @@ -0,0 +1,114 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + + 'use strict'; + + interface IEntityService { + getAllComponents(): ng.IPromise>; + } + + interface IComponentsArray { + services:Array; + resources:Array; + products:Array; + } + + export class EntityService implements IEntityService { + static '$inject' = ['$http', '$q', 'sdcConfig', 'Sdc.Services.SharingService','ComponentFactory','Sdc.Services.CacheService']; + private api:Models.IApi; + + constructor(private $http:ng.IHttpService, + private $q:ng.IQService, + private sdcConfig:Models.IAppConfigurtaion, + private sharingService:Sdc.Services.SharingService, + private ComponentFactory: Sdc.Utils.ComponentFactory, + private cacheService:Sdc.Services.CacheService + ) { + this.api = sdcConfig.api; + } + + getCatalog = ():ng.IPromise> => { + let defer = this.$q.defer>(); + this.$http.get(this.api.root + this.api.GET_catalog) + .success((followedResponse:IComponentsArray) => { + + let componentsList:Array = new Array(); + + followedResponse.services.forEach((serviceResponse: Models.Components.Service) => { + let component:Models.Components.Service = this.ComponentFactory.createService(serviceResponse); // new Models.Components.Service(serviceResponse); + componentsList.push(component); + this.sharingService.addUuidValue(component.uniqueId, component.uuid); + }); + + followedResponse.resources.forEach((resourceResponse:Models.Components.Resource) => { + let component:Models.Components.Resource = this.ComponentFactory.createResource(resourceResponse); + componentsList.push(component); + this.sharingService.addUuidValue(component.uniqueId, component.uuid); + }); + + followedResponse.products.forEach((productResponse:Models.Components.Product) => { + + let component:Models.Components.Product = this.ComponentFactory.createProduct(productResponse); + componentsList.push(component); + this.sharingService.addUuidValue(component.uniqueId, component.uuid); + }); + + this.cacheService.set('breadcrumbsComponents',componentsList); + defer.resolve(componentsList); + }) + .error((responce) => { + defer.reject(responce); + }); + return defer.promise; + }; + + getAllComponents = ():ng.IPromise> => { + let defer = this.$q.defer>(); + this.$http.get(this.api.root + this.api.GET_element) + .success((componentResponse:IComponentsArray) => { + let componentsList:Array = []; + + componentResponse.services && componentResponse.services.forEach((serviceResponse:Models.Components.Service) => { + let component:Models.Components.Service = this.ComponentFactory.createService(serviceResponse); + componentsList.push(component); + this.sharingService.addUuidValue(component.uniqueId, component.uuid); + }); + + componentResponse.resources && componentResponse.resources.forEach((resourceResponse:Models.Components.Resource) => { + let component:Models.Components.Resource = this.ComponentFactory.createResource(resourceResponse); + componentsList.push(component); + this.sharingService.addUuidValue(component.uniqueId, component.uuid); + }); + + componentResponse.products && componentResponse.products.forEach((productsResponse:Models.Components.Product) => { + let component:Models.Components.Product = this.ComponentFactory.createProduct(productsResponse); + componentsList.push(component); + this.sharingService.addUuidValue(component.uniqueId, component.uuid); + }); + this.cacheService.set('breadcrumbsComponents',componentsList); + defer.resolve(componentsList); + }); + + return defer.promise; + }; + } +} diff --git a/catalog-ui/app/scripts/services/event-listener-service.ts b/catalog-ui/app/scripts/services/event-listener-service.ts new file mode 100644 index 0000000000..67afd65c56 --- /dev/null +++ b/catalog-ui/app/scripts/services/event-listener-service.ts @@ -0,0 +1,78 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 7/4/2016. + */ +/// +module Sdc.Services { + + 'use strict'; + + interface IEventListenerService { + + } + + interface ICallbackData { + callback:Function; + args:any[]; + } + + export class EventListenerService implements IEventListenerService { + + public observerCallbacks:Utils.Dictionary = new Utils.Dictionary>(); + + //register an observer + callback + public registerObserverCallback = (eventName:string, callback:Function, ...args) => { + let callbackData = { + callback: callback, + args: args + } + + if (this.observerCallbacks.containsKey(eventName)) { + let callbacks = this.observerCallbacks.getValue(eventName); + + // Only insert the callback if the callback is different from existing callbacks. + for (let i = 0; i < callbacks.length; i++) { + if (callbacks[i].toString() === callback.toString()) { + return; // Do not add this callback. + } + } + + callbacks.push(callbackData); + this.observerCallbacks.setValue(eventName, callbacks); + } else { + this.observerCallbacks.setValue(eventName, [callbackData]); + } + }; + + //unregister an observer + public unRegisterObserver = (eventName:string) => { + if (this.observerCallbacks.containsKey(eventName)) { + this.observerCallbacks.remove(eventName); + } + }; + + public notifyObservers = function (eventName:string, ...args) { + _.forEach(this.observerCallbacks.getValue(eventName), (callbackData:ICallbackData) => { + callbackData.callback(...args); + }); + }; + } +} diff --git a/catalog-ui/app/scripts/services/header-interceptor.ts b/catalog-ui/app/scripts/services/header-interceptor.ts new file mode 100644 index 0000000000..7f362d3f8c --- /dev/null +++ b/catalog-ui/app/scripts/services/header-interceptor.ts @@ -0,0 +1,93 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + 'use strict'; + + //Method name should be exactly "response" - http://docs.angularjs.org/api/ng/service/$http + export interface IInterceptor { + request: Function; + + } + + export class HeaderInterceptor implements IInterceptor { + public static $inject = [ + '$log', + '$injector', + '$q', + 'uuid4', + 'Sdc.Services.SharingService', + 'sdcConfig', + '$location' + + + ]; + + public static Factory($log: ng.ILogService, + $injector: ng.auto.IInjectorService, + $q: ng.IQService, + uuid4: any, + sharingService: Sdc.Services.SharingService, + sdcConfig: Models.IAppConfigurtaion, + $location: ng.ILocationService) { + return new HeaderInterceptor($log, $injector, $q, uuid4, sharingService, sdcConfig, $location); + } + + constructor(private $log: ng.ILogService, + private $injector: ng.auto.IInjectorService, + private $q: ng.IQService, + private uuid4: any, + private sharingService: Sdc.Services.SharingService, + private sdcConfig: Models.IAppConfigurtaion, + private $location: ng.ILocationService) { + this.$log.debug('initializing AuthenticationInterceptor'); + } + + public request = (requestSuccess): ng.IPromise => { + requestSuccess.headers['X-ECOMP-RequestID'] = this.uuid4.generate(); + /** + * For every request to the server, that the service id, or resource id is sent in the URL, need to pass UUID in the header. + * Check if the unique id exists in uuidMap, and if so get the UUID and add it to the header. + */ + let map: Utils.Dictionary = this.sharingService.getUuidMap(); + if (map && requestSuccess.url.indexOf(this.sdcConfig.api.root) === 0) { + this.$log.debug("url: " + requestSuccess.url); + map.forEach((key: string) => { + if (requestSuccess.url.indexOf(key) !== -1) { + requestSuccess.headers['X-ECOMP-ServiceID'] = this.sharingService.getUuidValue(key); + } + }); + } + return requestSuccess; + }; + + public response = (responseSuccess): ng.IPromise => { + let responseData = responseSuccess.data; + if (responseData) { + let data = JSON.stringify(responseData); + if (data && (data.indexOf("Global Logon: Login") > 0)) { + this.$location.path('dashboard/welcome'); + window.location.reload(); + } + } + return responseSuccess; + } + } +} diff --git a/catalog-ui/app/scripts/services/http-error-interceptor.ts b/catalog-ui/app/scripts/services/http-error-interceptor.ts new file mode 100644 index 0000000000..c04659dfec --- /dev/null +++ b/catalog-ui/app/scripts/services/http-error-interceptor.ts @@ -0,0 +1,118 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + 'use strict'; + + export class HttpErrorInterceptor { + public static $inject = ['$injector', '$q']; + + public static Factory($injector: ng.auto.IInjectorService, $q: angular.IQService) { + return new HttpErrorInterceptor($injector, $q); + } + + constructor(private $injector: ng.auto.IInjectorService, private $q: angular.IQService) { + } + + public formatMessageArrays = (message: string, variables: Array)=> { + return message.replace(/\[%(\d+)\]/g, function (_, m) { + let tmp = []; + let list = variables[--m].split(";"); + list.forEach(function (item) { + tmp.push("
    1. " + item + "
    2. "); + }); + return "
        " + tmp.join("") + "
      "; + }); + }; + + public responseError = (rejection: any)=> { + + let text: string; + let variables; + let messageId: string = ""; + let isKnownException = false; + + if (rejection.data && rejection.data.serviceException) { + text = rejection.data.serviceException.text; + variables = rejection.data.serviceException.variables; + messageId = rejection.data.serviceException.messageId; + isKnownException = true; + } else if (rejection.data && rejection.data.requestError && rejection.data.requestError.serviceException) { + text = rejection.data.requestError.serviceException.text; + variables = rejection.data.requestError.serviceException.variables; + messageId = rejection.data.requestError.serviceException.messageId; + isKnownException = true; + } else if (rejection.data && rejection.data.requestError && rejection.data.requestError.policyException) { + text = rejection.data.requestError.policyException.text; + variables = rejection.data.requestError.policyException.variables; + messageId = rejection.data.requestError.policyException.messageId; + isKnownException = true; + } else if (rejection.data) { + text = 'Wrong error format from server'; + console.error(text); + isKnownException = false; + } + + let data: Sdc.ViewModels.IServerMessageModalModel; + if (isKnownException) { + // Remove the "Error: " text at the begining + if (text.trim().indexOf("Error:") === 0) { + text = text.replace("Error:", "").trim(); + } + + //mshitrit DE199895 bug fix + let count: number = 0; + variables.forEach(function (item) { + variables[count] = item ? item.replace('<', '<').replace('>', '>') : ''; + count++; + }); + + // Format the message in case has array to
      • + text = this.formatMessageArrays(text, variables); + + // Format the message %1 %2 + text = text.format(variables); + + // Need to inject the MessageService manually to prevent circular dependencies (because MessageService use $templateCache that use $http). + data = { + title: 'Error', + message: text, + messageId: messageId, + status: rejection.status, + severity: Utils.Constants.SEVERITY.ERROR + }; + } else { + // Need to inject the MessageService manually to prevent circular dependencies (because MessageService use $templateCache that use $http). + data = { + title: 'Error', + message: rejection.status !== -1 ? rejection.statusText : "Error getting response from server", + messageId: messageId, + status: rejection.status, + severity: Utils.Constants.SEVERITY.ERROR + }; + } + + let modalsHandler = this.$injector.get('ModalsHandler'); + modalsHandler.openServerMessageModal(data); + + return this.$q.reject(rejection); + } + } +} diff --git a/catalog-ui/app/scripts/services/loader-service.ts b/catalog-ui/app/scripts/services/loader-service.ts new file mode 100644 index 0000000000..6a1a1febe1 --- /dev/null +++ b/catalog-ui/app/scripts/services/loader-service.ts @@ -0,0 +1,26 @@ +/** + * Created by obarda on 3/13/2016. + */ +/// +module Sdc.Services { + 'use strict'; + + export class LoaderService { + + + constructor(private eventListenerService: Services.EventListenerService) { + + } + + public showLoader(...args) { + this.eventListenerService.notifyObservers(Utils.Constants.EVENTS.SHOW_LOADER_EVENT, ...args); + } + + public hideLoader(...args) { + this.eventListenerService.notifyObservers(Utils.Constants.EVENTS.HIDE_LOADER_EVENT, ...args); + } + + } + + LoaderService.$inject = ['EventListenerService']; +} diff --git a/catalog-ui/app/scripts/services/onboarding-service.ts b/catalog-ui/app/scripts/services/onboarding-service.ts new file mode 100644 index 0000000000..c09871d67f --- /dev/null +++ b/catalog-ui/app/scripts/services/onboarding-service.ts @@ -0,0 +1,103 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + + 'use strict'; + + interface IOnboardingService { + getOnboardingComponents(): ng.IPromise>; + getComponentFromCsarUuid(csarUuid:string): ng.IPromise; + downloadOnboardingCsar(packageId:string):ng.IPromise; + } + + export class OnboardingService implements IOnboardingService { + + static '$inject' = ['$http', '$q', 'sdcConfig', 'ComponentFactory']; + private api:Models.IApi; + + constructor(private $http:ng.IHttpService, + private $q:ng.IQService, + private sdcConfig:Models.IAppConfigurtaion, + private ComponentFactory: Sdc.Utils.ComponentFactory + ) { + this.api = sdcConfig.api; + } + + getOnboardingComponents = ():ng.IPromise> => { + let defer = this.$q.defer>(); + this.$http.get(this.api.GET_onboarding) + .success((response:any) => { + let onboardingComponents:Array = response.results; + let componentsList:Array = new Array(); + + onboardingComponents.forEach((obc: Models.ICsarComponent) => { + let component:Models.Components.Component = this.ComponentFactory.createFromCsarComponent(obc); + componentsList.push(component); + }); + + defer.resolve(componentsList); + }) + .error((response) => { + defer.reject(response); + }); + + return defer.promise; + }; + + downloadOnboardingCsar = (packageId:string):ng.IPromise => { + let defer = this.$q.defer(); + this.$http({ + url: this.api.GET_onboarding + "/" + packageId, + method: "get", + responseType: "blob" + }) + .success((response:any) => { + defer.resolve(response); + }) + .error((err) => { + defer.reject(err); + }); + + return defer.promise; + }; + + getComponentFromCsarUuid = (csarUuid:string):ng.IPromise => { + let defer = this.$q.defer(); + this.$http.get(this.api.root + this.api.GET_component_from_csar_uuid.replace(':csar_uuid', csarUuid)) + .success((response:any) => { + let component:Models.Components.Resource; + // If the status is 400, this means that the component not found. + // I do not want to return error from server, because a popup will appear in client with the error. + // So returning success (200) with status 400. + if (response.status!==400) { + component = new Models.Components.Resource(null, this.$q, response); + } + defer.resolve(component); + }) + .error((response) => { + defer.reject(response); + }); + + return defer.promise; + }; + + } +} diff --git a/catalog-ui/app/scripts/services/progress-service.ts b/catalog-ui/app/scripts/services/progress-service.ts new file mode 100644 index 0000000000..caa463fc98 --- /dev/null +++ b/catalog-ui/app/scripts/services/progress-service.ts @@ -0,0 +1,112 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 7/7/2016. + */ +/** + * Created by obarda on 7/4/2016. + */ +/// +module Sdc.Services { + + 'use strict'; + import IIntervalService = angular.IIntervalService; + + export class ProgressService { + + public progresses:any = {}; + + static '$inject' = ['$interval']; + + constructor( + protected $interval:any + ) {} + + private totalProgress:number = 90; + private startProgress:number = 10; + private onePercentIntervalSeconds:number = 5; + private createComponentInterval; + + public setProgressValue(name:string, value:number):void { + if (!this.progresses[name]) { + this.progresses[name]={}; + } + this.progresses[name].value = value; + } + + public getProgressValue(name:string):number{ + if (this.progresses[name]){ + return this.progresses[name].value; + } + return 0; + } + + public deleteProgressValue(name:string):void{ + this.stopCreateComponentInterval(); + delete this.progresses[name]; + } + + + private stopCreateComponentInterval = ():void => { + this.$interval.cancel(this.createComponentInterval); + }; + + + + public initCreateComponentProgress = (componentId:string):void => { + var progressValue:number = this.startProgress; + if(!this.getProgressValue(componentId)){ + this.stopCreateComponentInterval(); + this.setProgressValue(componentId, this.startProgress); + this.createComponentInterval = this.$interval(():void => { + //TODO replace getProgressMockData to real data after BE provide the API + var progressValue = this.getProgressMockData(componentId); + if (progressValue<=this.totalProgress ) { + this.setProgressValue(componentId, progressValue); + } else { + /** + * Currently the progress is not really checking against the BE. + * So the progress can pass 100. So the workaround for now, in case we pass 90 (totalProgress) + * stop the interval, so the progress will be kept at 90 until the promise will return value and set + * the progress to 100. + */ + this.deleteProgressValue(componentId); + } + }, this.onePercentIntervalSeconds*1000); + } + + }; + + + private getProgressMockData =(id:string):number =>{ + var progressValue = this.getProgressValue(id); + if(progressValue>0){ + progressValue = progressValue + 1; + } + //if not finish always stay on 90% + if (progressValue>90){ + progressValue =90; + } + + return progressValue; + } + + } +} diff --git a/catalog-ui/app/scripts/services/relation-icons-service.ts b/catalog-ui/app/scripts/services/relation-icons-service.ts new file mode 100644 index 0000000000..3d3b494f16 --- /dev/null +++ b/catalog-ui/app/scripts/services/relation-icons-service.ts @@ -0,0 +1,61 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + 'use strict'; + + export interface IRelationIconsService { + getIconPath(iconName:string):string; + } + + export class RelationIconsService implements IRelationIconsService { + constructor() {} + private icons: Array = [ + 'AttachesTo', + 'BindsTo', + 'DependsOn', + 'HostedOn', + 'LinksTo', + 'RoutesTo' + ]; + + public getIconPath = (relationshipType:string): string => { + let result:string = 'ConnectedTo'; + let baseUrl:string = '/styles/images/relationship-icons/'; + + if (relationshipType) { + let arr = relationshipType.split('.'); // looks like tosca.relationships.AttachesTo + relationshipType = arr[arr.length - 1]; + if (this.icons.indexOf(relationshipType) > -1) { + result = relationshipType; + } + if('LinksTo'==result){ + return ''; + } + } + + return baseUrl + result + '.svg'; + } + + } +} + + + diff --git a/catalog-ui/app/scripts/services/sdc-version-service.ts b/catalog-ui/app/scripts/services/sdc-version-service.ts new file mode 100644 index 0000000000..1744381bca --- /dev/null +++ b/catalog-ui/app/scripts/services/sdc-version-service.ts @@ -0,0 +1,48 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + 'use strict'; + + export interface ISdcVersionService { + getVersion():ng.IPromise; + } + export class SdcVersionService implements ISdcVersionService{ + + static '$inject' = ['$http', '$q','sdcConfig']; + private api: Models.IApi; + + constructor(private $http: ng.IHttpService, private $q: ng.IQService, sdcConfig: Models.IAppConfigurtaion){ + this.api = sdcConfig.api; + } + + public getVersion():ng.IPromise{ + let defer = this.$q.defer>(); + let url = this.api.root + this.api.GET_SDC_Version; + console.log("======================>" + url); + this.$http.get(url) + .success((version: any) => { + defer.resolve(version); + }); + return defer.promise; + } + } +} + diff --git a/catalog-ui/app/scripts/services/sharing-service.ts b/catalog-ui/app/scripts/services/sharing-service.ts new file mode 100644 index 0000000000..14c3158611 --- /dev/null +++ b/catalog-ui/app/scripts/services/sharing-service.ts @@ -0,0 +1,41 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + 'use strict'; + + export class SharingService { + + private uuidMap: Utils.Dictionary = new Utils.Dictionary(); + + public getUuidValue = (uniqueId:string):string => { + return this.uuidMap.getValue(uniqueId); + }; + + public addUuidValue = (uniqueId:string, uuid:string):void => { + this.uuidMap.setValue(uniqueId, uuid); + }; + + public getUuidMap = ():Utils.Dictionary => { + return this.uuidMap; + }; + + } +} diff --git a/catalog-ui/app/scripts/services/url-tobase64-service.ts b/catalog-ui/app/scripts/services/url-tobase64-service.ts new file mode 100644 index 0000000000..2d6980da3f --- /dev/null +++ b/catalog-ui/app/scripts/services/url-tobase64-service.ts @@ -0,0 +1,52 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + 'use strict'; + + export interface IUrlToBase64Service { + downloadUrl(url:string, callback:Function):void; + } + + export class UrlToBase64Service implements IUrlToBase64Service { + constructor() {} + + public downloadUrl = (url:string, callback:Function): void => { + let xhr :any = new XMLHttpRequest(); + + xhr.onload = ():void => { + let reader = new FileReader(); + reader.onloadend = ():void => { + if (xhr.status === 200) { + callback(reader.result); + } else { + callback(null); + } + }; + reader.readAsDataURL(xhr.response); + }; + xhr.open('GET', url); + xhr.responseType = 'blob'; + xhr.send(); + } + + } +} + diff --git a/catalog-ui/app/scripts/services/user-resource-service.ts b/catalog-ui/app/scripts/services/user-resource-service.ts new file mode 100644 index 0000000000..7414e2221e --- /dev/null +++ b/catalog-ui/app/scripts/services/user-resource-service.ts @@ -0,0 +1,123 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Services { + 'use strict'; + + // Define an interface of the object you want to use, providing it's properties + export interface IUserResource extends Models.IUserProperties,ng.resource.IResource{ + + } + + // Define your resource, adding the signature of the custom actions + export interface IUserResourceClass extends ng.resource.IResourceClass{ + authorize(): IUserResource; + getLoggedinUser(): IUserResource; + setLoggedinUser(user: IUserResource): void; + getAllUsers(success?: Function, error?: Function): Array; + createUser(IResourceResource, success?: Function, error?: Function): void; + editUserRole(IResourceResource, success?: Function, error?: Function): void; + deleteUser(IResourceResource, success?: Function, error?: Function): void; + } + + export class UserResourceService{ + + public static getResource = ( + $resource: ng.resource.IResourceService, + sdcConfig: Models.IAppConfigurtaion, + cookieService: Services.CookieService + ): IUserResourceClass => { + + let url: string = sdcConfig.api.root+sdcConfig.api.GET_user; + let authorizeUrl: string = sdcConfig.api.root+sdcConfig.api.GET_user_authorize; + let authorizeActionHeaders: any = {}; + let cookie: Models.ICookie = sdcConfig.cookie; + authorizeActionHeaders[cookie.userFirstName] = cookieService.getFirstName(); + authorizeActionHeaders[cookie.userLastName] = cookieService.getLastName(); + authorizeActionHeaders[cookie.userEmail] = cookieService.getEmail(); + authorizeActionHeaders[cookie.userIdSuffix] = cookieService.getUserId(); + + // Define your custom actions here as IActionDescriptor + let authorizeAction : ng.resource.IActionDescriptor = { + method: 'GET', + isArray: false, + url: authorizeUrl, + headers: authorizeActionHeaders + }; + + let getAllUsers : ng.resource.IActionDescriptor = { + method: 'GET', + isArray: true, + url: sdcConfig.api.root + sdcConfig.api.GET_all_users + }; + + let editUserRole : ng.resource.IActionDescriptor = { + method: 'POST', + isArray: false, + url: sdcConfig.api.root + sdcConfig.api.POST_edit_user_role, + transformRequest: (data, headers)=>{ + data.payloadData = undefined; + data.payloadName = undefined; + return JSON.stringify(data); + } + }; + + let deleteUser : ng.resource.IActionDescriptor = { + method: 'DELETE', + isArray: false, + url: sdcConfig.api.root + sdcConfig.api.DELETE_delete_user + }; + + let createUser : ng.resource.IActionDescriptor = { + method: 'POST', + isArray: false, + url: sdcConfig.api.root + sdcConfig.api.POST_create_user, + transformRequest: (data, headers)=>{ + data.payloadData = undefined; + data.payloadName = undefined; + return JSON.stringify(data); + } + }; + let userResource: IUserResourceClass = $resource( + url, + { id: '@id'}, + { + authorize: authorizeAction, + getAllUsers: getAllUsers, + createUser: createUser, + editUserRole:editUserRole, + deleteUser:deleteUser} + ); + + let _loggedinUser: IUserResource; + + userResource.getLoggedinUser = () => { + return _loggedinUser; + }; + + userResource.setLoggedinUser = (loggedinUser: IUserResource) => { + _loggedinUser = loggedinUser; + }; + + return userResource; + } + } + UserResourceService.getResource.$inject = ['$resource', 'sdcConfig', 'Sdc.Services.CookieService']; +} diff --git a/catalog-ui/app/scripts/utils/artifacts-utils.ts b/catalog-ui/app/scripts/utils/artifacts-utils.ts new file mode 100644 index 0000000000..439a0e98d0 --- /dev/null +++ b/catalog-ui/app/scripts/utils/artifacts-utils.ts @@ -0,0 +1,121 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Utils { + export class ArtifactsUtils { + + static '$inject' = [ + '$filter', + '$templateCache', + '$modal' + ]; + + constructor(private $filter:ng.IFilterService, + private $templateCache:ng.ITemplateCacheService, + private $modal:ng.ui.bootstrap.IModalService) { + + } + + public getArtifactTypeByState(currentState:string):string { + switch (currentState) { + case "workspace.composition.lifecycle": + return "interface"; + case "workspace.composition.api": + return "api"; + case "workspace.composition.deployment": + return "deployment"; + default: + return "normal"; + } + } + + public getTitle(artifactType:string, selectedComponent:Models.Components.Component):string { + switch (artifactType) { + case "interface": + return "Lifecycle Management"; + case "api": + return "API Artifacts"; + case "deployment": + return "Deployment Artifacts"; + default: + if (!selectedComponent) { + return ""; + } else { + return this.$filter("resourceName")(selectedComponent.name) + ' Artifacts'; + } + } + } + + public setArtifactType = (artifact:Models.ArtifactModel, artifactType:string):void => { + switch (artifactType) { + case "api": + artifact.artifactGroupType = 'SERVICE_API'; + break; + case "deployment": + artifact.artifactGroupType = 'DEPLOYMENT'; + break; + default: + artifact.artifactGroupType = 'INFORMATIONAL'; + break; + } + }; + + public isLicenseType = (artifactType:string) :boolean => { + let isLicense:boolean = false; + + if(Utils.Constants.ArtifactType.VENDOR_LICENSE === artifactType || Utils.Constants.ArtifactType.VF_LICENSE === artifactType) { + isLicense = true; + } + + return isLicense; + }; + + public removeArtifact = (artifact:Models.ArtifactModel, artifactsArr:Array):void => { + + if (!artifact.mandatory && (Utils.Constants.ArtifactGroupType.INFORMATION == artifact.artifactGroupType || + Utils.Constants.ArtifactGroupType.DEPLOYMENT == artifact.artifactGroupType)) { + _.remove(artifactsArr, {uniqueId: artifact.uniqueId}); + } + else { + let artifactToDelete = _.find(artifactsArr, {uniqueId: artifact.uniqueId}); + + delete artifactToDelete.esId; + delete artifactToDelete.description; + delete artifactToDelete.artifactName; + delete artifactToDelete.apiUrl; + } + }; + + public addAnotherAfterSave(scope:Sdc.ViewModels.IArtifactResourceFormViewModelScope) { + let newArtifact = new Models.ArtifactModel(); + this.setArtifactType(newArtifact, scope.artifactType); + scope.editArtifactResourceModel.artifactResource = newArtifact; + + scope.forms.editForm['description'].$setPristine(); + if(scope.forms.editForm['artifactLabel']){ + scope.forms.editForm['artifactLabel'].$setPristine(); + } + if(scope.forms.editForm['type']){ + scope.forms.editForm['type'].$setPristine(); + } + + } + } +} diff --git a/catalog-ui/app/scripts/utils/change-lifecycle-state-handler.ts b/catalog-ui/app/scripts/utils/change-lifecycle-state-handler.ts new file mode 100644 index 0000000000..7722a899b9 --- /dev/null +++ b/catalog-ui/app/scripts/utils/change-lifecycle-state-handler.ts @@ -0,0 +1,151 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/11/2016. + */ +/// +module Sdc.Utils { + + export class ChangeLifecycleStateHandler { + + static '$inject' = [ + 'sdcConfig', + 'sdcMenu', + 'ComponentFactory', + '$templateCache', + '$filter', + '$modal', + 'ModalsHandler' + ]; + + constructor( + private sdcConfig:Models.IAppConfigurtaion, + private sdcMenu:Models.IAppMenu, + private ComponentFactory: Sdc.Utils.ComponentFactory, + private $templateCache:ng.ITemplateCacheService, + private $filter:ng.IFilterService, + private $modal:ng.ui.bootstrap.IModalService, + private ModalsHandler: Utils.ModalsHandler + + ) { + + } + + changeLifecycleState = (component:Models.Components.Component, data:any, scope:any, onSuccessCallback?: Function, onErrorCallback?: Function):void => { + + let self = this; + + let getContacts = (component:Models.Components.Component):string =>{ + let testers = this.sdcConfig.testers; + let result:string = testers[component.componentType][component.categories[0].name]? + testers[component.componentType][component.categories[0].name]: + testers[component.componentType]['default']; + return result; + }; + + let onSuccess = (newComponent:Models.Components.Component):void => { + //scope.isLoading = false; + console.info(component.componentType.toLowerCase + ' change state ' , newComponent); + if(onSuccessCallback) { + onSuccessCallback(self.ComponentFactory.createComponent(newComponent)); + } + }; + + let onError = (error):void => { + scope.isLoading = false; + console.info('Failed to changeLifecycleState to ', data.url); + if(onErrorCallback) { + onErrorCallback(error); + } + }; + + let comment:Models.AsdcComment = new Models.AsdcComment(); + if (data.alertModal) { + // Show alert dialog if defined in menu.json + //------------------------------------------------- + let onOk = (confirmationText):void => { + comment.userRemarks = confirmationText; + scope.isLoading = true; + component.changeLifecycleState(data.url, comment).then(onSuccess, onError); + }; + + let onCancel = ():void => { + console.info('Cancel pressed'); + scope.isLoading = false; + }; + + let modalTitle = this.sdcMenu.alertMessages[data.alertModal].title; + let modalMessage = this.sdcMenu.alertMessages[data.alertModal].message.format([component.componentType.toLowerCase()]); + this.ModalsHandler.openAlertModal(modalTitle, modalMessage).then(onOk, onCancel); + } else if (data.confirmationModal) { + // Show confirmation dialog if defined in menu.json + //------------------------------------------------- + let onOk = (confirmationText):void => { + comment.userRemarks = confirmationText; + scope.isLoading = true; + component.changeLifecycleState(data.url, comment).then(onSuccess, onError); + }; + + let onCancel = ():void => { + console.info('Cancel pressed'); + scope.isLoading = false; + }; + + let modalTitle = this.sdcMenu.confirmationMessages[data.confirmationModal].title; + let modalMessage = this.sdcMenu.confirmationMessages[data.confirmationModal].message.format([component.componentType.toLowerCase()]); + let modalShowComment = this.sdcMenu.confirmationMessages[data.confirmationModal].showComment; + this.ModalsHandler.openConfirmationModal(modalTitle, modalMessage, modalShowComment).then(onOk, onCancel); + + } else if (data.emailModal) { + // Show email dialog if defined in menu.json + //------------------------------------------------- + let onOk = (resource):void => { + if (resource){ + onSuccess(resource); + } else { + onError("Error changing life cycle state"); + } + }; + + let onCancel = ():void => { + scope.isLoading = false; + }; + + let emailModel: ViewModels.IEmailModalModel = {}; + emailModel.email = {}; + emailModel.data = {}; + emailModel.title = this.$filter('translate')("EMAIL_MODAL_TITLE"); + emailModel.email.to = getContacts(component); + emailModel.email.subject = this.$filter('translate')("EMAIL_MODAL_SUBJECT", "{'entityName': '" + this.$filter('resourceName')(component.name) + "','entityVersion': '" + component.version + "'}"); + emailModel.email.message = ''; + emailModel.data.component = component; + emailModel.data.stateUrl = data.url; + + this.ModalsHandler.openEmailModal(emailModel).then(onOk, onCancel); + + } else { + // Submit to server only (no modal is shown). + scope.isLoading = true; + component.changeLifecycleState(data.url, comment).then(onSuccess, onError); + } + + } + } +} diff --git a/catalog-ui/app/scripts/utils/common-utils.ts b/catalog-ui/app/scripts/utils/common-utils.ts new file mode 100644 index 0000000000..aef6b9908d --- /dev/null +++ b/catalog-ui/app/scripts/utils/common-utils.ts @@ -0,0 +1,81 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 6/30/2016. + */ +/// +module Sdc.Utils { + + export class CommonUtils { + + static initProperties(propertiesObj:Array, uniqueId?:string):Array { + + let properties = new Array(); + if (propertiesObj) { + _.forEach(propertiesObj, (property:Sdc.Models.PropertyModel):void => { + if (uniqueId) { + property.readonly = property.parentUniqueId != uniqueId; + } + properties.push(new Sdc.Models.PropertyModel(property)); + }); + } + return properties; + }; + + static initAttributes(attributesObj:Array, uniqueId?:string):Array { + + let attributes = new Array(); + if (attributesObj) { + _.forEach(attributesObj, (attribute:Sdc.Models.AttributeModel):void => { + if (uniqueId) { + attribute.readonly = attribute.parentUniqueId != uniqueId; + } + attributes.push(new Sdc.Models.AttributeModel(attribute)); + }); + } + return attributes; + }; + + static initComponentInstances(componentInstanceObj:Array):Array { + + let componentInstances = new Array(); + if (componentInstanceObj) { + _.forEach(componentInstanceObj, (instance:Models.ComponentsInstances.ResourceInstance):void => { + componentInstances.push(Utils.ComponentInstanceFactory.createComponentInstance(instance)); + }); + } + return componentInstances; + }; + + static initModules(moduleArrayObj:Array):Array { + + let modules = new Array(); + + if (moduleArrayObj) { + _.forEach(moduleArrayObj, (module:Models.Module):void => { + if(module.type === "org.openecomp.groups.VfModule"){ + modules.push(new Models.Module(module)); + } + }); + } + return modules; + }; + } +} diff --git a/catalog-ui/app/scripts/utils/component-factory.ts b/catalog-ui/app/scripts/utils/component-factory.ts new file mode 100644 index 0000000000..1bb139dc45 --- /dev/null +++ b/catalog-ui/app/scripts/utils/component-factory.ts @@ -0,0 +1,181 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/8/2016. + */ +/// +module Sdc.Utils { + 'use strict'; + import Resource = Sdc.Models.Components.Resource; + + export class ComponentFactory { + + static '$inject' = [ + 'Sdc.Services.Components.ResourceService', + 'Sdc.Services.Components.ServiceService', + 'Sdc.Services.Components.ProductService', + 'Sdc.Services.CacheService', + '$q' + ]; + + constructor( + private ResourceService:Services.Components.ResourceService, + private ServiceService:Services.Components.ServiceService, + private ProductService:Services.Components.ProductService, + private cacheService:Services.CacheService, + private $q: ng.IQService) { + } + + public createComponent = (component:Models.Components.Component):Models.Components.Component => { + let newComponent:Models.Components.Component; + switch (component.componentType) { + + case 'SERVICE': + newComponent = new Models.Components.Service(this.ServiceService, this.$q, component); + break; + + case 'RESOURCE': + newComponent = new Models.Components.Resource(this.ResourceService, this.$q, component); + break; + + case 'PRODUCT': + newComponent = new Models.Components.Product(this.ProductService, this.$q, component); + break; + } + return newComponent; + }; + + public createProduct = (product:Models.Components.Product):Models.Components.Product => { + let newProduct:Models.Components.Product = new Models.Components.Product(this.ProductService, this.$q, product); + return newProduct; + }; + + public createService = (service:Models.Components.Service):Models.Components.Service => { + let newService:Models.Components.Service = new Models.Components.Service(this.ServiceService, this.$q, service); + return newService; + }; + + public createResource = (resource:Models.Components.Resource):Models.Components.Resource => { + let newResource:Models.Components.Resource = new Models.Components.Resource(this.ResourceService, this.$q, resource); + return newResource; + }; + + public createFromCsarComponent = (csar:Models.ICsarComponent):Models.Components.Component => { + let newResource:Sdc.Models.Components.Resource = this.createEmptyComponent(Sdc.Utils.Constants.ComponentType.RESOURCE); + newResource.name = csar.vspName; + + /** + * Onboarding CSAR contains category and sub category that are uniqueId. + * Need to find the category and sub category and extract the name from them. + * First concat all sub categories to one array. + * Then find the selected sub category and category. + * @type {any} + */ + let availableCategories = angular.copy(this.cacheService.get('resourceCategories')); + let allSubs = []; + _.each(availableCategories, (main:Models.IMainCategory)=>{ + if (main.subcategories) { + allSubs = allSubs.concat(main.subcategories); + } + }); + + let selectedCategory:Models.IMainCategory = _.find(availableCategories, function(main:Models.IMainCategory){ + return main.uniqueId === csar.category; + }); + + let selectedSubCategory:Models.ISubCategory = _.find(allSubs,(sub:Models.ISubCategory)=>{ + return sub.uniqueId === csar.subCategory; + }); + + // Build the categories and sub categories array (same format as component category) + let categories:Array = new Array(); + let subcategories:Array = new Array(); + if (selectedCategory && selectedSubCategory) { + subcategories.push(selectedSubCategory); + selectedCategory.subcategories = subcategories; + categories.push(selectedCategory); + } + + // Fill the component with details from CSAR + newResource.selectedCategory = selectedCategory && selectedSubCategory ? selectedCategory.name + "_#_" + selectedSubCategory.name : ''; + newResource.categories = categories; + newResource.vendorName = csar.vendorName; + newResource.vendorRelease = csar.vendorRelease; + newResource.csarUUID = csar.packageId; + newResource.csarPackageType = csar.packageType; + newResource.csarVersion = csar.version; + newResource.packageId = csar.packageId; + newResource.description = csar.description; + return newResource; + }; + + public createEmptyComponent = (componentType: string):Models.Components.Component => { + let newComponent:Models.Components.Component; + + switch (componentType) { + + case Utils.Constants.ComponentType.SERVICE: + newComponent = new Models.Components.Service(this.ServiceService, this.$q); + break; + + case Utils.Constants.ComponentType.RESOURCE: + case Utils.Constants.ResourceType.VF: + case Utils.Constants.ResourceType.VL: + case Utils.Constants.ResourceType.VFC: + case Utils.Constants.ResourceType.CP: + newComponent = new Models.Components.Resource(this.ResourceService, this.$q); + break; + + case Utils.Constants.ComponentType.PRODUCT: + newComponent = new Models.Components.Product(this.ProductService, this.$q); + break; + } + newComponent.componentType = componentType; + newComponent.tags = []; + newComponent.icon = Utils.Constants.DEFAULT_ICON; + return newComponent; + }; + + + public getServiceFromServer = (componentId: string): ng.IPromise => { + let service: Models.Components.Service = this.createEmptyComponent(Utils.Constants.ComponentType.SERVICE); + service.setUniqueId(componentId); + return service.getComponent(); + }; + + public getResourceFromServer = (componentId: string): ng.IPromise => { + let resource: Models.Components.Resource = this.createEmptyComponent(Utils.Constants.ComponentType.RESOURCE); + resource.setUniqueId(componentId); + return resource.getComponent(); + }; + + public getComponentFromServer = (componentType: string, componentId: string): ng.IPromise => { + let newComponent: Models.Components.Component = this.createEmptyComponent(componentType); + newComponent.setUniqueId(componentId); + return newComponent.getComponent(); + }; + + public createComponentOnServer = (componentObject:Models.Components.Component):ng.IPromise => { + let component: Models.Components.Component = this.createComponent(componentObject); + return component.createComponentOnServer(); + + }; + } +} diff --git a/catalog-ui/app/scripts/utils/component-instance-factory.ts b/catalog-ui/app/scripts/utils/component-instance-factory.ts new file mode 100644 index 0000000000..5f698aa46c --- /dev/null +++ b/catalog-ui/app/scripts/utils/component-instance-factory.ts @@ -0,0 +1,85 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 3/7/2016. + */ +/** + * Created by obarda on 2/8/2016. + */ +/// +module Sdc.Utils { + 'use strict'; + + export class ComponentInstanceFactory { + + static createComponentInstance(componentInstance:Models.ComponentsInstances.ComponentInstance):Models.ComponentsInstances.ComponentInstance { + let newComponentInstance:Models.ComponentsInstances.ComponentInstance; + switch (componentInstance.originType) { + case 'SERVICE': + newComponentInstance = new Models.ComponentsInstances.ServiceInstance(componentInstance); + break; + + case 'PRODUCT': + newComponentInstance = new Models.ComponentsInstances.ProductInstance(componentInstance); + break; + + default : + newComponentInstance = new Models.ComponentsInstances.ResourceInstance(componentInstance); + break; + } + return newComponentInstance; + }; + + public createEmptyComponentInstance = (componentInstanceType?: string):Models.ComponentsInstances.ComponentInstance => { + let newComponentInstance:Models.ComponentsInstances.ComponentInstance; + switch (componentInstanceType) { + case 'SERVICE': + newComponentInstance = new Models.ComponentsInstances.ServiceInstance(); + break; + + case 'PRODUCT': + newComponentInstance = new Models.ComponentsInstances.ProductInstance(); + break; + + default : + newComponentInstance = new Models.ComponentsInstances.ResourceInstance(); + break; + } + return newComponentInstance; + }; + + public createComponentInstanceFromComponent = (component: Models.Components.Component):Models.ComponentsInstances.ComponentInstance => { + let newComponentInstance:Models.ComponentsInstances.ComponentInstance = this.createEmptyComponentInstance(component.componentType); + newComponentInstance.uniqueId = component.uniqueId + (new Date()).getTime(); + newComponentInstance.posX = 0; + newComponentInstance.posY = 0; + newComponentInstance.name = component.name; + newComponentInstance.componentVersion = component.version; + newComponentInstance.originType = component.getComponentSubType(); + //new component instance -> req. & cap. are added on successful instance creation + newComponentInstance.requirements = component.requirements; + newComponentInstance.capabilities = component.capabilities; + newComponentInstance.icon = component.icon; + newComponentInstance.componentUid = component.uniqueId; + return newComponentInstance; + }; + + } +} diff --git a/catalog-ui/app/scripts/utils/constants.ts b/catalog-ui/app/scripts/utils/constants.ts new file mode 100644 index 0000000000..6db1edf29d --- /dev/null +++ b/catalog-ui/app/scripts/utils/constants.ts @@ -0,0 +1,247 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/18/2016. + */ +/// +module Sdc.Utils.Constants { + + import SuiteOrSpec = jasmine.SuiteOrSpec; + export let DEFAULT_ICON = 'defaulticon'; + export let CP_END_POINT = 'CpEndPoint'; + export let CHANGE_COMPONENT_CSAR_VERSION_FLAG = 'changeComponentCsarVersion'; + export let IMAGE_PATH = ''; + + export class ComponentType { + static SERVICE = 'SERVICE'; + static RESOURCE = 'RESOURCE'; + static PRODUCT = 'PRODUCT'; + } + + export class ResourceType { + static VF = 'VF'; + static VL = 'VL'; + static CP = 'CP'; + static VFC = 'VFC'; + } + + export class ComponentState { + static CERTIFICATION_IN_PROGRESS = 'CERTIFICATION_IN_PROGRESS'; + static CERTIFIED = 'CERTIFIED'; + static NOT_CERTIFIED_CHECKOUT = 'NOT_CERTIFIED_CHECKOUT'; + static NOT_CERTIFIED_CHECKIN = 'NOT_CERTIFIED_CHECKIN'; + static READY_FOR_CERTIFICATION = 'READY_FOR_CERTIFICATION'; + } + + export class DistributionStatus { + DISTRIBUTION_NOT_APPROVED = 'DISTRIBUTION_NOT_APPROVED'; + DISTRIBUTION_APPROVED = 'DISTRIBUTION_APPROVED'; + DISTRIBUTED = 'DISTRIBUTED'; + DISTRIBUTION_REJECTED = 'DISTRIBUTION_REJECTED'; + } + + export class ArtifactGroupType { + static DEPLOYMENT = "DEPLOYMENT"; + static INFORMATION = "INFORMATIONAL"; + static SERVICE_API = "SERVICE_API"; + } + + export class ArtifactType { + static HEAT = "HEAT"; + static VF_LICENSE = "VF_LICENSE"; + static VENDOR_LICENSE = "VENDOR_LICENSE"; + static THIRD_PARTY_RESERVED_TYPES = { WORKFLOW:"WORKFLOW", + NETWORK_CALL_FLOW:"NETWORK_CALL_FLOW", + AAI_SERVICE_MODEL:"AAI_SERVICE_MODEL", + AAI_VF_MODEL:"AAI_VF_MODEL", + AAI_VF_MODULE_MODEL:"AAI_VF_MODULE_MODEL", + AAI_VF_INSTANCE_MODEL:"AAI_VF_INSTANCE_MODEL"}; + static TOSCA = { TOSCA_TEMPLATE:"TOSCA_TEMPLATE", TOSCA_CSAR:"TOSCA_CSAR"}; + } + + export class SEVERITY { + public static DEBUG = 'DEBUG'; + public static INFO = 'INFO'; + public static WARNING = 'WARNING'; + public static ERROR = 'ERROR'; + } + + export class PROPERTY_TYPES { + public static STRING = 'string'; + public static INTEGER = 'integer'; + public static FLOAT = 'float'; + public static BOOLEAN = 'boolean'; + public static JSON = 'json'; + public static MAP = 'map'; + public static LIST = 'list'; + } + + export class SOURCES { + public static A_AND_AI = 'A&AI'; + public static ORDER = 'Order'; + public static RUNTIME = 'Runtime'; + } + + export class PROPERTY_DATA { + public static TYPES = [PROPERTY_TYPES.STRING, PROPERTY_TYPES.INTEGER, PROPERTY_TYPES.FLOAT, PROPERTY_TYPES.BOOLEAN, PROPERTY_TYPES.JSON, PROPERTY_TYPES.LIST, PROPERTY_TYPES.MAP]; + public static SIMPLE_TYPES = [PROPERTY_TYPES.STRING, PROPERTY_TYPES.INTEGER, PROPERTY_TYPES.FLOAT, PROPERTY_TYPES.BOOLEAN, PROPERTY_TYPES.JSON]; + public static SOURCES = [SOURCES.A_AND_AI, SOURCES.ORDER, SOURCES.RUNTIME]; + } + + export class PROPERTY_VALUE_CONSTRAINTS { + public static MAX_LENGTH = 100; + public static JSON_MAX_LENGTH = 4096; + } + + export class Role { + public static ADMIN = 'ADMIN'; + public static DESIGNER = 'DESIGNER'; + public static PRODUCT_STRATEGIST = 'PRODUCT_STRATEGIST'; + public static PRODUCT_MANAGER = 'PRODUCT_MANAGER'; + public static TESTER = 'TESTER'; + public static OPS = 'OPS'; + public static GOVERNOR = 'GOVERNOR'; + } + + export enum FormState{ + CREATE, + UPDATE, + IMPORT, + VIEW + } + + export class WorkspaceMode { + public static CREATE = 'create'; + public static EDIT = 'edit'; + public static IMPORT = 'import'; + public static VIEW = 'view'; + } + + export class ImagesUrl { + public static RESOURCE_ICONS = '/styles/images/resource-icons/'; + public static SERVICE_ICONS = '/styles/images/service-icons/'; + public static SELECTED_UCPE_INSTANCE = '/styles/images/resource-icons/selectedUcpeInstance.png'; + public static SELECTED_CP_INSTANCE = '/styles/images/resource-icons/selectedCPInstance.png'; + public static SELECTED_VL_INSTANCE = '/styles/images/resource-icons/selectedVLInstance.png'; + public static CANVAS_PLUS_ICON = '/styles/images/resource-icons/canvasPlusIcon.png'; + public static MODULE_ICON = '/styles/images/resource-icons/module.png'; + public static OPEN_MODULE_ICON = '/styles/images/resource-icons/openModule.png'; + public static OPEN_MODULE_HOVER_ICON = '/styles/images/resource-icons/openModuleHover.png'; + public static CLOSE_MODULE_ICON = '/styles/images/resource-icons/closeModule.png'; + public static CLOSE_MODULE_HOVER_ICON = '/styles/images/resource-icons/closeModuleHover.png'; + } + + export class ModalType { + static STANDARD = 'standard'; + static ERROR = 'error'; + static ALERT = 'alert'; + } + + export class GraphColors { + public static NOT_CERTIFIED_LINK = 'rgb(218,31,61)'; + public static VL_LINK = 'rgb(216,216,216)'; + public static ACTIVE_LINK = '#30bdf2'; + public static BASE_LINK = 'rgb(55,55,55)'; + public static NODE_BACKGROUND_COLOR = 'rgba(46, 162, 157, 0.24)'; + public static NODE_SHADOW_COLOR = 'rgba(198, 230, 228, 0.7)'; + public static NODE_OVERLAPPING_BACKGROUND_COLOR = 'rgba(179, 10, 60, 0.24)'; + public static NODE_OVERLAPPING_SHADOW_COLOR = 'rgba(236, 194, 206, 0.7)'; + public static NODE_UCPE_CP = '#9063cd'; + public static NODE_UCPE = '#fbfbfb'; + public static NODE_SELECTED_BORDER_COLOR = '#30bdf2'; + } + + export class GraphTransactionLogText { + public static REMOVE_TEMP_LINK = "remove tempLink"; + public static DELETE_LINK = "delete link"; + public static ADD_LINK = "delete link"; + public static ADD_NODE = "adding node"; + } + + export class GraphUIObjects { + public static LINK_MENU_HEIGHT = 420; + public static TOP_HEADER_HEIGHT = 200; + public static TOOLTIP_OFFSET_X = 50; + public static TOOLTIP_OFFSET_Y = 145; + public static TOOLTIP_LINK_OFFSET_X = 35; + public static TOOLTIP_LINK_OFFSET_Y = 75; + public static MENU_LINK_VL_HEIGHT_OFFSET = 250; + public static MENU_LINK_VL_WIDTH_OFFSET = 200; + public static MENU_LINK_SIMPLE_HEIGHT_OFFSET = 180; + public static MENU_LINK_SIMPLE_WIDTH_OFFSET = 130; + public static DIAGRAM_RIGHT_WIDTH_OFFSET = 248; + public static DIAGRAM_HEADER_OFFSET = 103; + public static DIAGRAM_PALETTE_WIDTH_OFFSET = 247; + + } + + export class States { + public static WORKSPACE_GENERAL = 'workspace.general'; + public static WORKSPACE_ICONS = 'workspace.icons'; + public static WORKSPACE_ACTIVITY_LOG = 'workspace.activity_log'; + public static WORKSPACE_DEPLOYMENT_ARTIFACTS = 'workspace.deployment_artifacts'; + public static WORKSPACE_PROPERTIES = 'workspace.properties'; + public static WORKSPACE_SERVICE_INPUTS = 'workspace.service_inputs'; + public static WORKSPACE_RESOURCE_INPUTS = 'workspace.resource_inputs'; + public static WORKSPACE_ATTRIBUTES = 'workspace.attributes'; + public static WORKSPACE_HIERARCHY = 'workspace.hierarchy'; + public static WORKSPACE_INFORMATION_ARTIFACTS = 'workspace.information_artifacts'; + public static WORKSPACE_TOSCA_ARTIFACTS = 'workspace.tosca_artifacts'; + public static WORKSPACE_COMPOSITION = 'workspace.composition'; + public static WORKSPACE_NETWORK_CALL_FLOW = 'workspace.network_call_flow'; + public static WORKSPACE_MANAGEMENT_WORKFLOW = 'workspace.management_workflow'; + public static WORKSPACE_DEPLOYMENT = 'workspace.deployment'; + public static WORKSPACE_DISTRIBUTION = 'workspace.distribution'; + public static WORKSPACE_REQUIREMENTS_AND_CAPABILITIES = 'workspace.reqAndCap'; + } + + export class EVENTS { + static RESOURCE_LEFT_PALETTE_UPDATE_EVENT = "resourceLeftPanelUpdateEvent"; + static SERVICE_LEFT_PALETTE_UPDATE_EVENT = "serviceLeftPanelUpdateEvent"; + static PRODUCT_LEFT_PALETTE_UPDATE_EVENT = "productLeftPanelUdateEvent"; + static VL_LEFT_PALETTE_UPDATE_EVENT = "vlLeftPanelUdateEvent"; + static ON_CSAR_LOADING = "onCsarLoading"; + static DOWNLOAD_ARTIFACT_FINISH_EVENT = "downloadArtifactFinishEvent"; + static ON_WORKSPACE_SAVE_BUTTON_CLICK = "onWorkspaceSaveButtonClick"; + static ON_WORKSPACE_SAVE_BUTTON_SUCCESS = "onWorkspaceSaveButtonSuccess"; + static ON_WORKSPACE_SAVE_BUTTON_ERROR = "onWorkspaceSaveButtonError"; + + //Loader events + static SHOW_LOADER_EVENT = "showLoaderEvent"; + static HIDE_LOADER_EVENT = "hideLoaderEvent"; + } + + export class GRAPH_EVENTS { + static ON_NODE_SELECTED = "onNodeSelected"; + static ON_GRAPH_BACKGROUND_CLICKED = "onGraphBackgroundClicked"; + static ON_PALETTE_COMPONENT_HOVER_IN = 'onPaletteComponentHoverIn'; + static ON_PALETTE_COMPONENT_HOVER_OUT = 'onPaletteComponentHoverOut'; + static ON_PALETTE_COMPONENT_DRAG_START = 'onPaletteComponentDragStart'; + static ON_PALETTE_COMPONENT_DRAG_ACTION = 'onPaletteComponentDragAction'; + static ON_COMPONENT_INSTANCE_NAME_CHANGED = 'onComponentInstanceNameChanged'; + static ON_DELETE_COMPONENT_INSTANCE = 'onDeleteComponentInstance'; + static ON_DELETE_MULTIPLE_COMPONENTS = 'onDeleteMultipleComponents'; + static ON_DELETE_EDGE = 'onDeleteEdge'; + static ON_INSERT_NODE_TO_UCPE = 'onInsertNodeToUCPE'; + static ON_REMOVE_NODE_FROM_UCPE = 'onRemoveNodeFromUCPE'; + static ON_VERSION_CHANGED = 'onVersionChanged'; + } + +} diff --git a/catalog-ui/app/scripts/utils/dictionary/dictionary.ts b/catalog-ui/app/scripts/utils/dictionary/dictionary.ts new file mode 100644 index 0000000000..ef9a1bc4ea --- /dev/null +++ b/catalog-ui/app/scripts/utils/dictionary/dictionary.ts @@ -0,0 +1,257 @@ +/*- + * ============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========================================================= + */ +/** + + This code was copy from collections.ts lib + https://github.com/basarat/typescript-collections +**/ + +module Sdc.Utils{ + 'use strict'; + + // Used internally by dictionary + interface IDictionaryPair{ + key: K; + value: V; + } + + export class Dictionary{ + + /** + * Object holding the key-value pairs. + * @type {Object} + * @private + */ + private table: { [key: string]: IDictionaryPair }; + //: [key: K] will not work since indices can only by strings in javascript and typescript enforces this. + + /** + * Number of elements in the list. + * @type {number} + * @private + */ + private nElements: number; + + /** + * Function used to convert keys to strings. + * @type {function(Object):string} + * @private + */ + private toStr: (key: K) => string; + + + /** + * Creates an empty dictionary. + * @class

        Dictionaries map keys to values; each key can map to at most one value. + * This implementation accepts any kind of objects as keys.

        + * + *

        If the keys are custom objects a function which converts keys to unique + * strings must be provided. Example:

        + *
        +       * function petToString(pet) {
        +       *  return pet.name;
        +       * }
        +       * 
        + * @constructor + * @param {function(Object):string=} toStrFunction optional function used + * to convert keys to strings. If the keys aren"t strings or if toString() + * is not appropriate, a custom function which receives a key and returns a + * unique string must be provided. + */ + constructor(toStrFunction?: (key: K) => string) { + this.table = {}; + this.nElements = 0; + this.toStr = toStrFunction || this.defaultToString; + } + + + /** + copy from angular.js isUndefined + */ + private isUndefined = (value: any):boolean => { + return typeof value === 'undefined'; + } + + defaultToString = (item: any): string => { + return item.toString(); + } + + /** + * Returns the value to which this dictionary maps the specified key. + * Returns undefined if this dictionary contains no mapping for this key. + * @param {Object} key key whose associated value is to be returned. + * @return {*} the value to which this dictionary maps the specified key or + * undefined if the map contains no mapping for this key. + */ + getValue = (key: K): V => { + let pair: IDictionaryPair = this.table[this.toStr(key)]; + if (this.isUndefined(pair)) { + return undefined; + } + return pair.value; + } + + + /** + * Associates the specified value with the specified key in this dictionary. + * If the dictionary previously contained a mapping for this key, the old + * value is replaced by the specified value. + * @param {Object} key key with which the specified value is to be + * associated. + * @param {Object} value value to be associated with the specified key. + * @return {*} previous value associated with the specified key, or undefined if + * there was no mapping for the key or if the key/value are undefined. + */ + setValue = (key: K, value: V): V => { + + if (this.isUndefined(key) || this.isUndefined(value)) { + return undefined; + } + + let ret: V; + let k = this.toStr(key); + let previousElement: IDictionaryPair = this.table[k]; + if (this.isUndefined(previousElement)) { + this.nElements++; + ret = undefined; + } else { + ret = previousElement.value; + } + this.table[k] = { + key: key, + value: value + }; + return ret; + } + + /** + * Removes the mapping for this key from this dictionary if it is present. + * @param {Object} key key whose mapping is to be removed from the + * dictionary. + * @return {*} previous value associated with specified key, or undefined if + * there was no mapping for key. + */ + remove = (key: K): V => { + let k = this.toStr(key); + let previousElement: IDictionaryPair = this.table[k]; + if (!this.isUndefined(previousElement)) { + delete this.table[k]; + this.nElements--; + return previousElement.value; + } + return undefined; + } + + /** + * Returns an array containing all of the keys in this dictionary. + * @return {Array} an array containing all of the keys in this dictionary. + */ + keys = (): K[] => { + let array: K[] = []; + for (let name in this.table) { + if (this.table.hasOwnProperty(name)) { + let pair: IDictionaryPair = this.table[name]; + array.push(pair.key); + } + } + return array; + } + + /** + * Returns an array containing all of the values in this dictionary. + * @return {Array} an array containing all of the values in this dictionary. + */ + values = (): V[] => { + let array: V[] = []; + for (let name in this.table) { + if (this.table.hasOwnProperty(name)) { + let pair: IDictionaryPair = this.table[name]; + array.push(pair.value); + } + } + return array; + } + + /** + * Executes the provided function once for each key-value pair + * present in this dictionary. + * @param {function(Object,Object):*} callback function to execute, it is + * invoked with two arguments: key and value. To break the iteration you can + * optionally return false. + */ + forEach = (callback: (key: K, value: V) => any): void => { + for (let name in this.table) { + if (this.table.hasOwnProperty(name)) { + let pair: IDictionaryPair = this.table[name]; + let ret = callback(pair.key, pair.value); + if (ret === false) { + return; + } + } + } + } + + /** + * Returns true if this dictionary contains a mapping for the specified key. + * @param {Object} key key whose presence in this dictionary is to be + * tested. + * @return {boolean} true if this dictionary contains a mapping for the + * specified key. + */ + containsKey = (key: K): boolean => { + return !this.isUndefined(this.getValue(key)); + } + + /** + * Removes all mappings from this dictionary. + * @this {Dictionary} + */ + clear = () => { + + this.table = {}; + this.nElements = 0; + } + + /** + * Returns the number of keys in this dictionary. + * @return {number} the number of key-value mappings in this dictionary. + */ + size = (): number => { + return this.nElements; + } + + /** + * Returns true if this dictionary contains no mappings. + * @return {boolean} true if this dictionary contains no mappings. + */ + isEmpty = (): boolean => { + return this.nElements <= 0; + } + + toString = (): string => { + let toret = "{"; + this.forEach((k, v) => { + toret = toret + "\n\t" + k.toString() + " : " + v.toString(); + }); + return toret + "\n}"; + } + } // End of dictionary + +} diff --git a/catalog-ui/app/scripts/utils/file-utils.ts b/catalog-ui/app/scripts/utils/file-utils.ts new file mode 100644 index 0000000000..db6251f199 --- /dev/null +++ b/catalog-ui/app/scripts/utils/file-utils.ts @@ -0,0 +1,73 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Utils { + export class FileUtils { + + static '$inject' = [ + '$window' + ]; + + constructor(private $window: any) { + } + + public byteCharactersToBlob = (byteCharacters, contentType): any => { + contentType = contentType || ''; + let sliceSize = 1024; + let bytesLength = byteCharacters.length; + let slicesCount = Math.ceil(bytesLength / sliceSize); + let byteArrays = new Array(slicesCount); + + for (let sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) { + let begin = sliceIndex * sliceSize; + let end = Math.min(begin + sliceSize, bytesLength); + + let bytes = new Array(end - begin); + for (let offset = begin, i = 0; offset < end; ++i, ++offset) { + bytes[i] = byteCharacters[offset].charCodeAt(0); + } + byteArrays[sliceIndex] = new Uint8Array(bytes); + } + return new Blob(byteArrays, {type: contentType}); + }; + + public base64toBlob = (base64Data, contentType): any => { + let byteCharacters = atob(base64Data); + return this.byteCharactersToBlob(byteCharacters, contentType); + }; + + public downloadFile = (blob, fileName): void=> { + let url = this.$window.URL.createObjectURL(blob); + let downloadLink = document.createElement("a"); + + downloadLink.setAttribute('href', url); + downloadLink.setAttribute('download', fileName); + document.body.appendChild(downloadLink); + downloadLink.click(); + + //time out for firefox + setTimeout(()=> { + document.body.removeChild(downloadLink); + this.$window.URL.revokeObjectURL(url); + }, 100); + } + + } +} diff --git a/catalog-ui/app/scripts/utils/functions.ts b/catalog-ui/app/scripts/utils/functions.ts new file mode 100644 index 0000000000..32bc9243cf --- /dev/null +++ b/catalog-ui/app/scripts/utils/functions.ts @@ -0,0 +1,58 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Utils.Functions { + + export class QueueUtils { + + private executionQueue : any; + + constructor(private $q:ng.IQService){ + this.executionQueue = this.getDummyPromise(); + } + + + private getDummyPromise = (): ng.IPromise => { + let deferred : ng.IDeferred= this.$q.defer(); + deferred.resolve(true); + return deferred.promise; + }; + + + private addMethodToQueue = (runMe:Function) : void => { + this.executionQueue = this.executionQueue.then(runMe, runMe); + }; + + addNonBlockingUIAction = (update:Function , releaseUIcallBack:Function) : void => { + releaseUIcallBack(); + this.addMethodToQueue(update); + }; + + // The Method call is responsible for releasing the UI + addBlockingUIAction = ( blockingServerRequest : Function ):void => { + this.addMethodToQueue(blockingServerRequest); + }; + + addBlockingUIActionWithReleaseCallback = ( blockingServerRequest : Function, releaseUIcallBack:Function):void=>{ + this.addMethodToQueue(blockingServerRequest); + this.addMethodToQueue(releaseUIcallBack); + }; + } +} diff --git a/catalog-ui/app/scripts/utils/menu-handler.ts b/catalog-ui/app/scripts/utils/menu-handler.ts new file mode 100644 index 0000000000..0f2b7de3be --- /dev/null +++ b/catalog-ui/app/scripts/utils/menu-handler.ts @@ -0,0 +1,145 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.Utils { + + 'use strict'; + + export class MenuItem { + text: string; + callback: (...args: Array) => ng.IPromise; + state: string; + action: string; + params: Array; + isDisabled: boolean; + disabledRoles: Array; + blockedForTypes:Array; // This item will not be shown for specific components types. + + //TODO check if needed + confirmationModal:string; // Open confirmation modal (user should select "OK" or "Cancel"), and continue with the action. + emailModal:string; // Open email modal (user should fill email details), and continue with the action. + url:string; // Data added to menu item, in case the function need to use it, example: for function "changeLifecycleState", I need to pass also the state "CHECKOUT" that I want the state to change to. + + + constructor(text: string, callback: (...args: Array) => ng.IPromise, state:string, action:string, params?: Array, blockedForTypes?:Array) { + this.text = text; + this.callback = callback; + this.state = state; + this.action = action; + this.params = params; + this.blockedForTypes = blockedForTypes; + } + } + + export class MenuItemGroup { + selectedIndex: number; + menuItems: Array; + itemClick: boolean; + + constructor(selectedIndex?:number, menuItems?: Array, itemClick?: boolean) { + this.selectedIndex = selectedIndex; + this.menuItems = menuItems; + this.itemClick = itemClick; + } + + public updateSelectedMenuItemText (newText: string) { + this.menuItems[this.selectedIndex].text = newText; + } + } + + + export class MenuHandler { + + static '$inject' = [ + 'sdcConfig', + 'sdcMenu', + 'ComponentFactory', + '$templateCache', + '$filter', + '$modal', + 'ModalsHandler', + '$state', + '$q' + ]; + + constructor( + private sdcConfig:Models.IAppConfigurtaion, + private sdcMenu:Models.IAppMenu, + private ComponentFactory: ComponentFactory, + private $templateCache:ng.ITemplateCacheService, + private $filter:ng.IFilterService, + private $modal:ng.ui.bootstrap.IModalService, + private ModalsHandler: ModalsHandler, + private $state:ng.ui.IStateService, + private $q:ng.IQService + ) { + + } + + + generateBreadcrumbsModelFromComponents = (components: Array, selected:Sdc.Models.Components.Component):MenuItemGroup => { + let result = new MenuItemGroup(0, [], false); + if (components) { + + // Search the component in all components by uuid (and not uniqueid, gives access to an assets's minor versions). + let selectedItem = _.find(components, (item:Sdc.Models.Components.Component) => { + return item.uuid === selected.uuid; + }); + + // If not found search by invariantUUID + if(undefined == selectedItem){ + selectedItem = _.find(components, (item:Sdc.Models.Components.Component) => { + //invariantUUID && Certified State matches between major versions + return item.invariantUUID === selected.invariantUUID && item.lifecycleState === Utils.Constants.ComponentState.CERTIFIED; + }); + } + + // If not found search by name (name is unique). + if(undefined == selectedItem){ + selectedItem = _.find(components, (item:Sdc.Models.Components.Component) => { + return item.name === selected.name; + }); + } + + result.selectedIndex = components.indexOf(selectedItem); + components[result.selectedIndex] = selected; + let clickItemCallback = (component: Sdc.Models.Components.Component): ng.IPromise => { + this.$state.go('workspace.general', {id: component.uniqueId, type:component.componentType.toLowerCase(), mode: Utils.Constants.WorkspaceMode.VIEW}); + return this.$q.when(true); + }; + + components.forEach((component:Sdc.Models.Components.Component) => { + let menuItem = new MenuItem( + // component.name, + component.getComponentSubType() + ': ' + this.$filter('resourceName')(component.name), + clickItemCallback, + null, + null, + [component] + ); + // menuItem.text = component.name; + result.menuItems.push(menuItem); + }); + } + return result; + }; + + } +} diff --git a/catalog-ui/app/scripts/utils/modals-handler.ts b/catalog-ui/app/scripts/utils/modals-handler.ts new file mode 100644 index 0000000000..f3e80a7a24 --- /dev/null +++ b/catalog-ui/app/scripts/utils/modals-handler.ts @@ -0,0 +1,275 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 2/11/2016. + */ +/// +module Sdc.Utils { + + export interface IModalsHandler { + + openViewerModal(component:Models.Components.Component):void; + openDistributionStatusModal(distribution: Models.Distribution,status:string):void; + openConfirmationModal (title:string, message:string, showComment:boolean, size?: string):ng.IPromise; + openAlertModal (title:string, message:string, size?: string):ng.IPromise; + openStandardModal (title:string, message:string, size?: string):ng.IPromise; + openErrorModal (title:string, message:string, size?: string):ng.IPromise; + openEmailModal(emailModel:ViewModels.IEmailModalModel) :ng.IPromise; + openServerMessageModal(data:Sdc.ViewModels.IServerMessageModalModel): ng.IPromise; + openClientMessageModal(data:Sdc.ViewModels.IClientMessageModalModel): ng.IPromise; + openWizardArtifactModal(artifact: Models.ArtifactModel, component:Models.Components.Component): ng.IPromise; + openWizard(componentType: Utils.Constants.ComponentType, component?:Models.Components.Component, importedFile?: any): ng.IPromise; + } + + export class ModalsHandler implements IModalsHandler{ + + static '$inject' = [ + '$templateCache', + '$modal', + '$q' + ]; + + constructor(private $templateCache:ng.ITemplateCacheService, + private $modal:ng.ui.bootstrap.IModalService, + private $q:ng.IQService) { + } + + openViewerModal = (component:Models.Components.Component):void => { + + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get('/app/scripts/view-models/component-viewer/component-viewer.html'), + controller: 'Sdc.ViewModels.ComponentViewerViewModel', + size: 'lg', + backdrop: 'static', + resolve: { + component: ():Models.Components.Component=> { + return component; + } + } + }; + this.$modal.open(modalOptions); + }; + + + openDistributionStatusModal = (distribution: Models.Distribution,status:string): ng.IPromise => { + let deferred = this.$q.defer(); + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get('/app/scripts/view-models/workspace/tabs/distribution/disribution-status-modal/disribution-status-modal-view.html'), + controller: 'Sdc.ViewModels.DistributionStatusModalViewModel', + size: 'sdc-xl', + backdrop: 'static', + resolve: { + data: ():any => { + return { + 'distribution': distribution, + 'status': status + }; + } + } + }; + let modalInstance:ng.ui.bootstrap.IModalServiceInstance = this.$modal.open(modalOptions); + deferred.resolve(modalInstance.result); + return deferred.promise; + }; + + + + openAlertModal = (title:string, message:string, size?: string):ng.IPromise => { + return this.openConfirmationModalBase(title, message, false, Utils.Constants.ModalType.ALERT, size); + }; + + openStandardModal = (title:string, message:string, size?: string):ng.IPromise => { + return this.openConfirmationModalBase(title, message, false, Utils.Constants.ModalType.STANDARD, size); + }; + + openErrorModal = (title:string, message:string, size?: string):ng.IPromise => { + return this.openConfirmationModalBase(title, message, false, Utils.Constants.ModalType.ERROR, size); + }; + + openConfirmationModal = (title:string, message:string, showComment:boolean, size?: string):ng.IPromise => { + return this.openConfirmationModalBase(title, message, showComment, Utils.Constants.ModalType.STANDARD, size); + }; + + private openConfirmationModalBase = (title:string, message:string, showComment:boolean, type:Utils.Constants.ModalType, size?: string):ng.IPromise => { + let deferred = this.$q.defer(); + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get('/app/scripts/view-models/modals/confirmation-modal/confirmation-modal-view.html'), + controller: 'Sdc.ViewModels.ConfirmationModalViewModel', + size: size? size:'sdc-sm', + backdrop: 'static', + resolve: { + confirmationModalModel: ():Sdc.ViewModels.IConfirmationModalModel => { + let model:Sdc.ViewModels.IConfirmationModalModel = { + title: title, + message: message, + showComment: showComment, + type: type + }; + return model; + } + } + }; + + let modalInstance:ng.ui.bootstrap.IModalServiceInstance = this.$modal.open(modalOptions); + deferred.resolve(modalInstance.result); + return deferred.promise; + }; + + openEmailModal = (emailModel:ViewModels.IEmailModalModel):ng.IPromise => { + + let deferred = this.$q.defer(); + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get('/app/scripts/view-models/modals/email-modal/email-modal-view.html'), + controller: 'Sdc.ViewModels.EmailModalViewModel', + size: 'sdc-sm', + backdrop: 'static', + resolve: { + emailModalModel: ():ViewModels.IEmailModalModel => { + return emailModel; + } + } + }; + let modalInstance:ng.ui.bootstrap.IModalServiceInstance = this.$modal.open(modalOptions); + deferred.resolve(modalInstance.result); + return deferred.promise; + + }; + + openServerMessageModal = (data:Sdc.ViewModels.IServerMessageModalModel):ng.IPromise => { + let deferred = this.$q.defer(); + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get('/app/scripts/view-models/modals/message-modal/message-server-modal/server-message-modal-view.html'), + controller: 'Sdc.ViewModels.ServerMessageModalViewModel', + size: 'sdc-sm', + backdrop: 'static', + resolve: { + serverMessageModalModel: ():Sdc.ViewModels.IServerMessageModalModel => { + return data; + } + } + }; + + let modalInstance:ng.ui.bootstrap.IModalServiceInstance = this.$modal.open(modalOptions); + deferred.resolve(modalInstance.result); + return deferred.promise; + }; + + openClientMessageModal = (data:Sdc.ViewModels.IClientMessageModalModel):ng.IPromise => { + let deferred = this.$q.defer(); + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get('/app/scripts/view-models/modals/message-modal/message-client-modal/client-message-modal-view.html'), + controller: 'Sdc.ViewModels.ClientMessageModalViewModel', + size: 'sdc-sm', + backdrop: 'static', + resolve: { + clientMessageModalModel: ():Sdc.ViewModels.IClientMessageModalModel => { + return data; + } + } + }; + let modalInstance:ng.ui.bootstrap.IModalServiceInstance = this.$modal.open(modalOptions); + deferred.resolve(modalInstance); + return deferred.promise; + }; + + openOnboadrdingModal = (okButtonText:string,currentCsarUUID?:string): ng.IPromise => { + let deferred = this.$q.defer(); + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get('/app/scripts/view-models/modals/onboarding-modal/onboarding-modal-view.html'), + controller: 'Sdc.ViewModels.OnboardingModalViewModel', + size: 'sdc-xl', + backdrop: 'static', + resolve: { + okButtonText:():string=>{ + return okButtonText; + }, + currentCsarUUID:():string=>{ + return currentCsarUUID||null; + } + } + }; + let modalInstance:ng.ui.bootstrap.IModalServiceInstance = this.$modal.open(modalOptions); + deferred.resolve(modalInstance.result); + return deferred.promise; + }; + + + openWizard = (componentType: Utils.Constants.ComponentType, component?:Models.Components.Component, importedFile?: any): ng.IPromise => { + let deferred = this.$q.defer(); + let template = this.$templateCache.get('/app/scripts/view-models/wizard/wizard-creation-base.html'); + + let controller:string; + if(component){ + controller = 'Sdc.ViewModels.Wizard.EditWizardViewModel'; //Edit mode + } else { + if (importedFile){ + controller = 'Sdc.ViewModels.Wizard.ImportWizardViewModel'; // Import Mode + } else { + controller = 'Sdc.ViewModels.Wizard.CreateWizardViewModel'; // Create Mode + } + } + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: template, + controller: controller, + size: 'sdc-xl', + backdrop: 'static', + keyboard: false, + resolve: { + data: ():any => { + return { + 'componentType': componentType, + 'component': component, + 'importFile':importedFile + }; + } + } + }; + + let modalInstance:ng.ui.bootstrap.IModalServiceInstance = this.$modal.open(modalOptions); + deferred.resolve(modalInstance.result); + return deferred.promise; + }; + + openWizardArtifactModal = (artifact: Models.ArtifactModel, component:Models.Components.Component): ng.IPromise => { + let deferred = this.$q.defer(); + let viewModelsHtmlBasePath:string = '/app/scripts/view-models/'; + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get(viewModelsHtmlBasePath + 'wizard/artifact-form-step/artifact-form-step-view.html'), + controller: 'Sdc.ViewModels.Wizard.ArtifactResourceFormStepViewModel', + size: 'sdc-md', + backdrop: 'static', + keyboard: false, + resolve: { + artifact: ():Models.ArtifactModel => { + return artifact; + }, + component: (): Models.Components.Component => { + return component; + } + } + }; + + let modalInstance:ng.ui.bootstrap.IModalServiceInstance = this.$modal.open(modalOptions); + deferred.resolve(modalInstance.result); + return deferred.promise; + }; + + } +} diff --git a/catalog-ui/app/scripts/utils/prototypes.ts b/catalog-ui/app/scripts/utils/prototypes.ts new file mode 100644 index 0000000000..de961cfc4b --- /dev/null +++ b/catalog-ui/app/scripts/utils/prototypes.ts @@ -0,0 +1,155 @@ +/*- + * ============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========================================================= + */ +interface String { + format(variables:Array):string +} + +interface Array { + clean(o: T): Array; +} + + +/** + * This function will replace the % with strings (from array). + * Example: "Requested '%1' resource was not found.".format(["MyResource"]); + * Note: in case the array contains empty string the function will also remove the '' or the "". + */ +if (!String.hasOwnProperty("format")) { + String.prototype["format"] = function (variables:Array) : string { + + if (variables===null || variables===undefined || variables.length===0){ + variables=['']; + } + + for (let i=0;i>> 0; + + // 4. If IsCallable(callback) is false, throw a TypeError exception. + // See: http://es5.github.com/#x9.11 + if (typeof callback !== "function") { + throw new TypeError(callback + " is not a function"); + } + + // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. + if (thisArg) { + T = thisArg; + } + + // 6. Let A be a new array created as if by the expression new Array(len) where Array is + // the standard built-in constructor with that name and len is the value of len. + A = new Array(len); + + // 7. Let k be 0 + k = 0; + + // 8. Repeat, while k < len + while(k < len) { + + let kValue, mappedValue; + + // a. Let Pk be ToString(k). + // This is implicit for LHS operands of the in operator + // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk. + // This step can be combined with c + // c. If kPresent is true, then + if (k in O) { + + // i. Let kValue be the result of calling the Get internal method of O with argument Pk. + kValue = O[ k ]; + + // ii. Let mappedValue be the result of calling the Call internal method of callback + // with T as the this value and argument list containing kValue, k, and O. + mappedValue = callback.call(T, kValue, k, O); + + // iii. Call the DefineOwnProperty internal method of A with arguments + // Pk, Property Descriptor {Value: mappedValue, : true, Enumerable: true, Configurable: true}, + // and false. + + // In browsers that support Object.defineProperty, use the following: + // Object.defineProperty(A, Pk, { value: mappedValue, writable: true, enumerable: true, configurable: true }); + + // For best browser support, use the following: + A[ k ] = mappedValue; + } + // d. Increase k by 1. + k++; + } + + // 9. return A + return A; + }; +} diff --git a/catalog-ui/app/scripts/utils/validation-utils.ts b/catalog-ui/app/scripts/utils/validation-utils.ts new file mode 100644 index 0000000000..7618e7d0e3 --- /dev/null +++ b/catalog-ui/app/scripts/utils/validation-utils.ts @@ -0,0 +1,173 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.Utils { + class basePattern{ + pattern:RegExp; + base:number; + constructor(pattern:RegExp, base:number){ + this.pattern = pattern; + this.base = base; + } + } + + export interface IMapRegex{ + integer: RegExp; + boolean: RegExp; + float: RegExp; + string: RegExp; + } + + export class ValidationUtils { + + static '$inject' = [ + 'IntegerNoLeadingZeroValidationPattern', + 'FloatValidationPattern', + 'CommentValidationPattern', + 'BooleanValidationPattern', + 'NumberValidationPattern', + 'LabelValidationPattern', + ]; + private trueRegex : string = '[t][r][u][e]|[t]|[o][n]|[y]|[y][e][s]|[1]'; + private falseRegex : string = '[f][a][l][s][e]|[f]|[o][f][f]|[n]|[n][o]|[0]'; + private heatBooleanValidationPattern : RegExp = new RegExp( '^('+this.trueRegex+'|'+this.falseRegex+')$'); + + + constructor(private IntegerNoLeadingZeroValidationPattern:RegExp, + private FloatValidationPattern:RegExp, + private CommentValidationPattern:RegExp, + private BooleanValidationPattern:RegExp, + private NumberValidationPattern:RegExp, + private LabelValidationPattern:RegExp) {} + + public stripAndSanitize(text:string):string{ + if(!text){ + return null; + } + return text.replace(/\s+/g, ' ').replace(/%[A-Fa-f0-9]{2}/g, '').trim(); + } + + public getValidationPattern = (validationType:string , parameterType?:string) : RegExp => { + switch (validationType){ + case 'integer': + return this.IntegerNoLeadingZeroValidationPattern; + case 'float': + return this.FloatValidationPattern; + case 'number': + return this.NumberValidationPattern; + case 'string': + return this.CommentValidationPattern; + case 'boolean': + { + //Bug Fix DE197437 [Patch]Mismatch between BE to FE regarding supported characters in Boolean filed + if( parameterType && parameterType === 'heat'){ + return this.heatBooleanValidationPattern; + } + else{ + return this.BooleanValidationPattern; + } + + } + + case 'label': + return this.LabelValidationPattern; + case 'category': + return this.LabelValidationPattern; + default : + return null; + } + }; + + public getPropertyListPatterns():IMapRegex { + return { + integer: /^(0|[-+]?[1-9][0-9]*|[-+]?0x[0-9a-fA-F]+|[-+]?0o[0-7]+)(,?(0|[-+]?[1-9][0-9]*|[-+]?0x[0-9a-fA-F]+|[-+]?0o[0-7]+))*$/, + string: /^"[\u0000-\u0021\u0023-\u00BF]+"(\s*,?\s*"[\u0000-\u0021\u0023-\u00BF]+")*$/, + boolean: /^([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])(,?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee]))*$/, + float: /^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?(,?[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?f?)*$/ + }; + } + public getPropertyMapPatterns():IMapRegex { + return { + integer: /^"\w+"\s*:\s?(0|[-+]?[1-9][0-9]*|[-+]?0x[0-9a-fA-F]+|[-+]?0o[0-7]+)+(\s*,?\s*"\w+"\s?:\s?(0|[-+]?[1-9][0-9]*|[-+]?0x[0-9a-fA-F]+|[-+]?0o[0-7]+)+)*$/, + string: /^"\w+"\s?:\s?"[\u0000-\u0021\u0023-\u00BF]*"(\s*,?\s*"\w+"\s?:\s?"[\u0000-\u0021\u0023-\u00BF]*")*$/, + boolean: /^"\w+"\s?:\s?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])(\s*,?\s*"\w+"\s?:\s?([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee]))*$/, + float: /^"\w+"\s?:\s?[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?f?(\s*,?\s*"\w+"\s?:\s?[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?f?)*$/ + }; + } + public validateUniqueKeys(viewValue:string):boolean { + if(!viewValue) { + return true; //allow empty value + } + + let json:string = "{" + viewValue.replace(/\s\s+/g, ' ') + "}"; + try{ + let obj:any = JSON.parse(json); + /* + //Method #1 : check json string length before & after parsing + let newJson:string = JSON.stringify(obj); + if (newJson.length < json.length) { + return false; + }*/ + + //Method #2 : check how many times we can find "KEY": in json string + let result:boolean = true; + Object.keys(obj).forEach((key:string) => { + result = result && json.split('"' + key + '":').length === 2; + }); + return result; + + }catch(e){ + return false; //not a valid JSON + } + + //return true; + } + + public validateJson = (json:string):boolean => { + try{ + JSON.parse(json); + return true; + }catch(err){ + console.log('invalid json'); + return false; + } + }; + + public validateIntRange = (value:string):boolean => { + + let base8 = new basePattern(/^([-+]?0o[0-7]+)$/, 8); + let base10 = new basePattern(/^(0|[-+]?[1-9][0-9]*)$/, 10); + let base16 = new basePattern(/^([-+]?0x[0-9a-fA-F]+)$/, 16); + + let min:number = -0x80000000; + let max:number = 0x7fffffff; + let intPatterns:Array = [base8, base10, base16]; + let matchedBase = _.find(intPatterns, (item)=> { + return item.pattern.test(value); + }); + + let parsed:number = parseInt(value.replace('o',''), matchedBase.base); + if(parsed){ + return min <= parsed && max >= parsed; + } + } + } +} diff --git a/catalog-ui/app/scripts/view-models/admin-dashboard/add-category-modal/add-category-modal-view-model.ts b/catalog-ui/app/scripts/view-models/admin-dashboard/add-category-modal/add-category-modal-view-model.ts new file mode 100644 index 0000000000..93c1dac174 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/admin-dashboard/add-category-modal/add-category-modal-view-model.ts @@ -0,0 +1,94 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + interface IAddCategoryModalViewModelScope extends ng.IScope { + category:Sdc.Services.ICategoryResource; + modelType:string; + footerButtons: Array; + forms:any; + + save():void; + close():void; + } + + export class AddCategoryModalViewModel { + + static '$inject' = [ + '$scope', + 'Sdc.Services.CategoryResourceService', + '$modalInstance', + 'parentCategory', + 'type' + ]; + + constructor( + private $scope:IAddCategoryModalViewModelScope, + private categoryResourceService:Sdc.Services.ICategoryResourceClass, + private $modalInstance:ng.ui.bootstrap.IModalServiceInstance, + private parentCategory:Sdc.Services.ICategoryResource, + private type:string + ){ + this.initScope(); + } + + private initScope = ():void => { + this.$scope.forms = {}; + this.$scope.modelType = this.parentCategory ? 'sub category' : 'category'; + this.$scope.category = new this.categoryResourceService(); + + this.$scope.close = ():void => { + this.$modalInstance.dismiss(); + }; + + this.$scope.save = ():void => { + + let onOk = (newCategory :Sdc.Services.ICategoryResource):void => { + this.$modalInstance.close(newCategory); + }; + + let onCancel = ():void => { + //error + }; + + if(!this.parentCategory) { + this.$scope.category.$save({types: this.type+"s"}, onOk, onCancel); + }else{ + this.$scope.category.$saveSubCategory({types: this.type+"s", categoryId: this.parentCategory.uniqueId}, onOk, onCancel); + } + + }; + + this.$scope.footerButtons = [ + {'name': 'OK', 'css': 'blue', 'callback': this.$scope.save, 'disabled': true}, + {'name': 'Cancel', 'css': 'grey', 'callback': this.$scope.close} + ]; + + this.$scope.$watch("forms.editForm.$invalid", (newVal, oldVal) => { + this.$scope.footerButtons[0].disabled = this.$scope.forms.editForm.$invalid; + }); + + } + + + } +} diff --git a/catalog-ui/app/scripts/view-models/admin-dashboard/add-category-modal/add-category-modal-view.html b/catalog-ui/app/scripts/view-models/admin-dashboard/add-category-modal/add-category-modal-view.html new file mode 100644 index 0000000000..5718982661 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/admin-dashboard/add-category-modal/add-category-modal-view.html @@ -0,0 +1,41 @@ + + +
        + +
        +
        + + + +
        + + + +
        + +
        + +
        + +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/admin-dashboard/add-category-modal/add-category-modal-view.less b/catalog-ui/app/scripts/view-models/admin-dashboard/add-category-modal/add-category-modal-view.less new file mode 100644 index 0000000000..39d84aab23 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/admin-dashboard/add-category-modal/add-category-modal-view.less @@ -0,0 +1,3 @@ +.i-sdc-admin-add-category-modal { + +} diff --git a/catalog-ui/app/scripts/view-models/admin-dashboard/admin-dashboard-view-model.ts b/catalog-ui/app/scripts/view-models/admin-dashboard/admin-dashboard-view-model.ts new file mode 100644 index 0000000000..d7cbbcc68d --- /dev/null +++ b/catalog-ui/app/scripts/view-models/admin-dashboard/admin-dashboard-view-model.ts @@ -0,0 +1,82 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + + 'use strict'; + + interface IAdminDashboardViewModelScope extends ng.IScope { + version:string; + sdcConfig:Models.IAppConfigurtaion; + isLoading: boolean; + currentTab: string; + templateUrl:string; + monitorUrl:string; + moveToTab(tab:string):void; + isSelected(tab:string):boolean; + } + + + export class AdminDashboardViewModel { + static '$inject' = [ + '$scope', + 'Sdc.Services.CacheService', + 'sdcConfig' + ]; + + constructor(private $scope:IAdminDashboardViewModelScope, + private cacheService:Services.CacheService, + private sdcConfig:Models.IAppConfigurtaion) { + + this.initScope(); + } + + + private initScope = ():void => { + + this.$scope.version = this.cacheService.get('version'); + this.$scope.sdcConfig = this.sdcConfig; + this.$scope.monitorUrl = this.$scope.sdcConfig.api.kibana; + this.$scope.isSelected=(tab:string):boolean => { + return tab===this.$scope.currentTab; + } + + this.$scope.moveToTab=(tab:string):void => { + if (tab===this.$scope.currentTab){ + return; + } + else if(tab === 'USER_MANAGEMENT'){ + this.$scope.templateUrl = '/app/scripts/view-models/admin-dashboard/user-management/user-management-view.html'; + } + else if(tab ==='CATEGORY_MANAGEMENT'){ + this.$scope.templateUrl = '/app/scripts/view-models/admin-dashboard/category-management/category-management-view.html'; + } + /* else if(tab ==='ECOMP'){ + this.$scope.templateUrl = '/app/scripts/view-models/admin-dashboard/ecomp/ecomp-view.html'; + }*/ + this.$scope.currentTab = tab; + }; + + this.$scope.moveToTab('USER_MANAGEMENT'); + + + } + } +} diff --git a/catalog-ui/app/scripts/view-models/admin-dashboard/admin-dashboard-view.html b/catalog-ui/app/scripts/view-models/admin-dashboard/admin-dashboard-view.html new file mode 100644 index 0000000000..063525a4bf --- /dev/null +++ b/catalog-ui/app/scripts/view-models/admin-dashboard/admin-dashboard-view.html @@ -0,0 +1,24 @@ +
        + + + + + +
        + +
        +
        diff --git a/catalog-ui/app/scripts/view-models/admin-dashboard/admin-dashboard.less b/catalog-ui/app/scripts/view-models/admin-dashboard/admin-dashboard.less new file mode 100644 index 0000000000..874a02c431 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/admin-dashboard/admin-dashboard.less @@ -0,0 +1,49 @@ +.sdc-admin-container{ + height: 100%; + + .sdc-admin-top-bar-menu{ + .bg_k; + height: @top_nav_admin_height; + padding-left:260px; + .box-shadow(-1px 0px 3px 0px rgba(0, 0, 0, 0.33)); + position: absolute; + top: @header_height; + left: 0; + right: 0; + z-index: 2; + + .sdc-admin-top-bar-menu-tab{ + .b_17; + .hand; + height: 44px; + background-color: transparent; + position: relative; + padding: 0px 10px 0px 10px; + border: none; + outline: none; + margin-right: 15px; + &.selected { + outline: none; + border-bottom: solid 4px @color_t; + } + } + .sdc-admin-top-bar-menu-monitor-btn{ + .bg_a; + .c_6; + float: right; + border: none; + position: relative; + padding: 11px 24px; + } + } + + .sdc-admin-body{ + .bg_n; + padding: 40px 260px 60px 260px; + position: absolute; + top: @top_nav_admin_height; + left: 0; + right: 0; + bottom: 0; + } +} diff --git a/catalog-ui/app/scripts/view-models/admin-dashboard/category-management/category-management-view-model.ts b/catalog-ui/app/scripts/view-models/admin-dashboard/category-management/category-management-view-model.ts new file mode 100644 index 0000000000..a3ad7a2714 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/admin-dashboard/category-management/category-management-view-model.ts @@ -0,0 +1,197 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + interface ICategoryManagementViewModelScope extends ng.IScope { + SERVICE:string; + RESOURCE:string; + categoriesToShow: Array; + serviceCategories: Array; + resourceCategories: Array; + selectedCategory: Sdc.Services.ICategoryResource; + selectedSubCategory: Sdc.Services.ICategoryResource; + modalInstance:ng.ui.bootstrap.IModalServiceInstance; + isLoading:boolean; + type:string; + namePattern:RegExp; + + selectCategory(category:Sdc.Services.ICategoryResource) :void; + selectSubCategory(subcategory:Sdc.Services.ICategoryResource) :void; + selectType(type:string) :void; + deleteCategory(category:Sdc.Services.ICategoryResource, subCategory:Sdc.Services.ICategoryResource) :void; + createCategoryModal(parentCategory:Sdc.Services.ICategoryResource) :void; + } + + export class CategoryManagementViewModel { + static '$inject' = [ + '$scope', + 'sdcConfig', + 'Sdc.Services.CacheService', + '$templateCache', + '$modal', + '$filter', + 'ValidationUtils', + 'ModalsHandler' + ]; + + constructor(private $scope:ICategoryManagementViewModelScope, + private sdcConfig:Models.IAppConfigurtaion, + private cacheService:Services.CacheService, + private $templateCache:ng.ITemplateCacheService, + private $modal:ng.ui.bootstrap.IModalService, + private $filter:ng.IFilterService, + private ValidationUtils: Sdc.Utils.ValidationUtils, + private ModalsHandler: Utils.ModalsHandler + ) { + + this.initScope(); + this.$scope.selectType(Sdc.Utils.Constants.ComponentType.SERVICE.toLocaleLowerCase()); + + } + + private initScope = ():void => { + let scope:ICategoryManagementViewModelScope = this.$scope; + scope.SERVICE = Sdc.Utils.Constants.ComponentType.SERVICE.toLocaleLowerCase(); + scope.RESOURCE = Sdc.Utils.Constants.ComponentType.RESOURCE.toLocaleLowerCase(); + + scope.namePattern = this.ValidationUtils.getValidationPattern('cssClasses'); + + scope.selectCategory = (category :Sdc.Services.ICategoryResource) => { + if(scope.selectedCategory !== category) { + scope.selectedSubCategory = null; + } + scope.selectedCategory = category; + }; + scope.selectSubCategory = (subcategory :Sdc.Services.ICategoryResource) => { + scope.selectedSubCategory = subcategory; + }; + scope.selectType = (type:string):void => { + if (scope.type !== type) { + scope.selectedCategory = null; + scope.selectedSubCategory = null; + } + + scope.type = type; + scope.categoriesToShow = scope[type + 'Categories']; + }; + + scope.createCategoryModal = (parentCategory:Sdc.Services.ICategoryResource):void => { + //can't create a sub category for service + if(parentCategory && scope.type === Sdc.Utils.Constants.ComponentType.SERVICE.toLowerCase()) { + return; + } + + let type:string = scope.type; + + let onOk = (newCategory :Sdc.Services.ICategoryResource):void => { + if(!parentCategory) { + scope[type + 'Categories'].push(newCategory); + }else{ + if(!parentCategory.subcategories) { + parentCategory.subcategories = []; + } + parentCategory.subcategories.push(newCategory); + } + }; + + let onCancel = ():void => { + + }; + + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get('/app/scripts/view-models/admin-dashboard/add-category-modal/add-category-modal-view.html'), + controller: 'Sdc.ViewModels.AddCategoryModalViewModel', + size: 'sdc-xsm', + backdrop: 'static', + scope: scope, + resolve: { + parentCategory: function () { + return parentCategory; + }, + type: function () { + return type; + } + } + }; + + scope.modalInstance = this.$modal.open(modalOptions); + scope.modalInstance.result.then(onOk, onCancel); + + }; + + scope.deleteCategory = (category: Sdc.Services.ICategoryResource, subCategory: Sdc.Services.ICategoryResource): void => { + + let onOk = ():void => { + + scope.isLoading = true; + let type:string = scope.type; + + let onError = (response):void => { + scope.isLoading = false; + console.info('onFaild', response); + }; + + let onSuccess = (response: any) :void => { + let arr:Array; + + if(!subCategory) { + arr = this.$scope[type + 'Categories']; + arr.splice(arr.indexOf(category), 1); + if(category === scope.selectedCategory) { + scope.selectedCategory = null; + scope.selectedSubCategory = null; + } + } else { + arr = category.subcategories; + arr.splice(arr.indexOf(subCategory), 1); + } + + scope.isLoading = false; + }; + + if(!subCategory) { + category.$delete({ + types: type+"s", + categoryId: category.uniqueId + } + , onSuccess, onError); + } else { + category.$deleteSubCategory({ + types: type+"s", + categoryId: category.uniqueId, + subCategoryId: subCategory.uniqueId, + } + , onSuccess, onError); + } + }; + let modelType:string = subCategory ? 'sub category' : 'cssClasses'; + let title:string = this.$filter('translate')("DELETE_CATEGORY_MODAL_HEADER", "{'modelType': '" + modelType +"' }"); + let message:string = this.$filter('translate')("DELETE_CATEGORY_MODAL_CATEGORY_NAME", "{'modelType': '" + modelType +"' }"); + + this.ModalsHandler.openConfirmationModal(title, message, false, 'sdc-xsm').then(onOk); + }; + + this.$scope.serviceCategories = this.cacheService.get('serviceCategories'); + this.$scope.resourceCategories = this.cacheService.get('resourceCategories'); + } + } +} diff --git a/catalog-ui/app/scripts/view-models/admin-dashboard/category-management/category-management-view.html b/catalog-ui/app/scripts/view-models/admin-dashboard/category-management/category-management-view.html new file mode 100644 index 0000000000..95a002d3d7 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/admin-dashboard/category-management/category-management-view.html @@ -0,0 +1,53 @@ +
        + + + +
        + +
        + +

        + + +

        + + + +
          +
        • + {{category.name}} + + + +
        • +
        +
        +
        + +
        + +

        + + + +
          +
        • + {{subcategory.name}} + + + +
        • +
        +
        +
        + +
        +
        diff --git a/catalog-ui/app/scripts/view-models/admin-dashboard/category-management/category-management.less b/catalog-ui/app/scripts/view-models/admin-dashboard/category-management/category-management.less new file mode 100644 index 0000000000..011122c9e8 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/admin-dashboard/category-management/category-management.less @@ -0,0 +1,118 @@ + +.category-management { + + .row { + display: table; + width: 70%; + min-width: 800px; + margin: auto; + + [class*="col-"] { + float: none; + display: table-cell; + vertical-align: top; + background-color: white; + border: 1px solid #c1c1c1; + padding: 0; + + &:not(:last-child) { + border-right: none; + } + + h4 { + float:left; + color:white; + background-color: rgb(155,168,176); + margin: 0; + padding: 0px 0px 0px 16px; + width: 100%; + height: 31px; + font-size: 15px; + + span{ + display: inline-block; + line-height: 30px; + margin-right: 5px; + padding: 0 7px; + + &.selected { + border-bottom: 2px #067ab4 solid; + } + } + } + h4+span{ + .hand; + float:right; + display: inline-block; + background-color: rgb(59,124,156); + text-align: center; + padding: 5.5px 0px; + width: 60px; + color: white; + position: absolute; + top: 0; + right: 0; + z-index: 1; + color: white; + } + + + .perfect-scrollbar { + width: 100%; + height: 500px; + margin-top: 40px; + margin-bottom: 15px; + } + + ul { + clear: both; + margin: 5px 0 10px 0; + list-style-type: none; + padding: 0; + position: relative; + + li{ + .hand; + padding: 0 8px; + text-indent: 9px; + font-size: 13px; + line-height: 25px; + border: 1px solid white; + border-right: none; + border-left: none; + margin-right: 5px; + + button { + background-color: transparent; + border: none; + float: right; + margin: 5px 3px; + display: none; + } + + &:hover { + background-color: #d9e6ec; + color: #3b7b9b; + border-color: #d9e6ec; + + button { + display: inline-block; + } + } + &.selected { + background-color: rgb(219,230,236); + color: #3b7b9b; + border-color: rgba(59, 123, 155, 0.42); + + &.gray { + background-color: rgba(155, 168, 176, 0.09); + border-color: white; + } + } + + } + } + } + } + +} diff --git a/catalog-ui/app/scripts/view-models/admin-dashboard/ecomp/ecomp-view.html b/catalog-ui/app/scripts/view-models/admin-dashboard/ecomp/ecomp-view.html new file mode 100644 index 0000000000..7c89b545c5 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/admin-dashboard/ecomp/ecomp-view.html @@ -0,0 +1 @@ +
        diff --git a/catalog-ui/app/scripts/view-models/admin-dashboard/user-management/user-management-view-model.ts b/catalog-ui/app/scripts/view-models/admin-dashboard/user-management/user-management-view-model.ts new file mode 100644 index 0000000000..3921d0cf8f --- /dev/null +++ b/catalog-ui/app/scripts/view-models/admin-dashboard/user-management/user-management-view-model.ts @@ -0,0 +1,220 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + + import IUserProperties = Sdc.Models.IUserProperties; + 'use strict'; + + interface IUserManagementViewModelScope extends ng.IScope { + sdcConfig:Models.IAppConfigurtaion; + usersList: Array; + isLoading: boolean; + isNewUser: boolean; + sortBy:string; + reverse:boolean; + tableHeadersList:any; + roles:Array; + newUser: Models.IUser; + currentUser: Sdc.Services.IUserResource; + userIdValidationPattern: RegExp; + editForm:ng.IFormController; + getAllUsers():void; + editUserRole(user:IUserProperties); + sort(sortBy:string): void; + createUser(): void; + deleteUser(userId:string) : void; + onEditUserPressed(user:IUserProperties): void; + saveUserChanges(user:IUserProperties) :void; + getTitle(role:string): string; + clearForm():void; + + } + + + export class UserManagementViewModel { + static '$inject' = [ + '$scope', + 'sdcConfig', + 'Sdc.Services.UserResourceService', + '$templateCache', + '$modal', + 'UserIdValidationPattern', + '$filter', + 'ModalsHandler' + ]; + + constructor(private $scope:IUserManagementViewModelScope, + private sdcConfig:Models.IAppConfigurtaion, + private userResourceService:Sdc.Services.IUserResourceClass, + private $templateCache:ng.ITemplateCacheService, + private $modal:ng.ui.bootstrap.IModalService, + private UserIdValidationPattern:RegExp, + private $filter:ng.IFilterService, + private ModalsHandler: Utils.ModalsHandler + ) { + + this.initScope(); + + } + + + + private getAllUsers = ():void => { + this.$scope.isLoading = true; + + let onError = (response) => { + this.$scope.isLoading = false; + console.info('onFaild', response); + }; + let onSuccess = (response: Array) => { + this.$scope.usersList = response; + _.forEach(this.$scope.usersList,(user:any,i:number)=>{ + user.index = i; + }); + this.$scope.isLoading = false; + }; + this.userResourceService.getAllUsers(onSuccess, onError); + }; + + private updateUserFilterTerm = (user: IUserProperties): void =>{ + user.filterTerm = user.firstName + ' ' + user.lastName + ' ' + user.userId + ' ' + user.email + ' ' + user.role + ' ' + this.$filter('date')(user.lastLoginTime, "MM/dd/yyyy"); + }; + + private initScope = ():void => { + let self=this; + + this.$scope.tableHeadersList = [ + {title: "First Name", property: 'firstName'}, + {title: "Last Name", property: 'lastName'}, + {title: this.$filter('translate')("USER_MANAGEMENT_TABLE_HEADER_USER_ID"), property: 'userId'}, + {title: "Email", property: 'email'}, + {title: "Role", property: 'role'}, + {title: "Last Active", property: 'lastLoginTime'} + ]; + this.$scope.userIdValidationPattern = this.UserIdValidationPattern; + this.$scope.sortBy = 'lastLoginTime'; + this.$scope.reverse = false; + this.$scope.roles = this.sdcConfig.roles; + this.$scope.isNewUser = false; + this.$scope.currentUser = this.userResourceService.getLoggedinUser(); + this.getAllUsers(); + + let resource : Services.IUserResource = {}; + this.$scope.newUser = new Sdc.Models.User(resource); + + this.$scope.sort = (sortBy:string):void => {//default sort by descending last update. default for alphabetical = ascending + this.$scope.isNewUser = false; + this.$scope.reverse = (this.$scope.sortBy === sortBy) ? ( !this.$scope.reverse) : this.$scope.reverse = false; + this.$scope.sortBy = sortBy; + }; + + this.$scope.createUser = () : void => { + + let onError = (response) => { + this.$scope.isLoading = false; + console.info('onFaild', response); + }; + + let onSuccess = (response: Models.IUserProperties) => { + this.$scope.newUser.resource['index'] = this.$scope.usersList.length; + this.$scope.newUser.resource.lastLoginTime = "0"; + this.$scope.newUser.resource.status = response.status; + this.updateUserFilterTerm(this.$scope.newUser.resource); + this.$scope.usersList.unshift(this.$scope.newUser.resource); + this.$scope.isNewUser = true; + this.$scope.sortBy = 'index'; + this.$scope.reverse = true; + this.$scope.isLoading = false; + this.$scope.newUser = new Sdc.Models.User(null); + this.$scope.editForm.$setPristine(); + let _self = this; + setTimeout(function () { + _self.$scope.isNewUser = false; + }, 7000); + }; + this.userResourceService.createUser({ userId: this.$scope.newUser.resource.userId, role: this.$scope.newUser.resource.role}, onSuccess, onError); + }; + + + this.$scope.onEditUserPressed = (user:IUserProperties): void => { + user.isInEditMode = true; + user.tempRole = user.role; + }; + + this.$scope.editUserRole = (user:IUserProperties): void => { + let roleBeforeUpdate: string = user.role; + user.role= user.tempRole; + + let onError = (response) => { + this.$scope.isLoading = false; + user.role = roleBeforeUpdate; + console.info('onFaild', response); + }; + let onSuccess = (response: any) => { + this.$scope.isLoading = false; + user.tempRole = user.role; + this.updateUserFilterTerm(user); + }; + + this.userResourceService.editUserRole({ id: user.userId, role: user.role}, onSuccess, onError); + }; + + this.$scope.saveUserChanges = (user:IUserProperties): void => { + if(user.tempRole != user.role){ + this.$scope.editUserRole(user) + } + user.isInEditMode = false; + }; + + this.$scope.deleteUser = (userId:string): void => { + + let onOk = ():void => { + this.$scope.isLoading = true; + + let onError = (response):void => { + this.$scope.isLoading = false; + console.info('onFaild', response); + }; + + let onSuccess = (response: any) :void => { + _.remove(this.$scope.usersList, {userId: userId }); + this.$scope.isLoading = false; + }; + this.userResourceService.deleteUser({ id: userId}, onSuccess, onError); + }; + + let title:string = this.$filter('translate')("USER_MANAGEMENT_VIEW_DELETE_MODAL_TITLE"); + let message:string = this.$filter('translate')("USER_MANAGEMENT_VIEW_DELETE_MODAL_TEXT"); + this.ModalsHandler.openConfirmationModal(title, message, false).then(onOk); + }; + + this.$scope.getTitle = (role:string):string =>{ + return role.toLowerCase().replace('governor','governance_Rep').replace('_',' '); + }; + + this.$scope.clearForm =():void =>{ + if(!this.$scope.editForm['contactId'].$viewValue && !this.$scope.editForm['role'].$viewValue){ + this.$scope.editForm.$setPristine(); + } + }; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/admin-dashboard/user-management/user-management-view.html b/catalog-ui/app/scripts/view-models/admin-dashboard/user-management/user-management-view.html new file mode 100644 index 0000000000..26e720b044 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/admin-dashboard/user-management/user-management-view.html @@ -0,0 +1,102 @@ +
        + +
        +
        + + + +
        +
        +
        +
        +
        + +
        +
        + + +
        + + +
        +
        +
        + +
        + +
        +
        + +
        +
        +
        + + +
        + +
        +
        +
        {{header.title}} + +
        +
        +
        +
        + +
        + +
        + +
        {{user.firstName || '---'}}
        +
        {{user.lastName || '---' }}
        +
        {{user.userId || '---'}}
        +
        {{user.email || '---'}}
        +
        +
        + +
        +
        {{user.lastLoginTime == 0 ? 'Waiting' : (user.lastLoginTime | date:'MM/dd/yyyy')}}
        +
        + + +
        +
        + +
        + +
        +
        +
        + +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/admin-dashboard/user-management/user-management.less b/catalog-ui/app/scripts/view-models/admin-dashboard/user-management/user-management.less new file mode 100644 index 0000000000..934faab9e7 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/admin-dashboard/user-management/user-management.less @@ -0,0 +1,251 @@ +.sdc-user-management-top-bar { + display: flex; + width: 100%; + label { + .i_17; + } + .sdc-user-management-top-bar-form-input, + .sdc-user-management-top-bar-form-select { + .b_9; + color: @color_b; + height: 28px; + padding-left: 10px; + border-radius: 2px; + border: 1px solid @border_color_f; + } + + .sdc-user-management-top-bar-search-container { + display: flex; + flex-direction: column; + position: relative; + width: 400px; + + label { + margin-bottom: 20px; + } + + .w-sdc-search-icon { + right: 11px; + top: 49px; + } + } + .vertical-border-container { + min-width: 50px; + margin: 0px auto; + + .vertical-border { + + width: 1px; + height: 70px; + background-color: @color_e; + display: table; + margin: 0 auto; + } + } + + .sdc-user-management-top-bar-wrapper { + display: flex; + } + + .sdc-user-management-top-bar-title { + .i_17; + font-weight: bold; + } + + .sdc-user-management-top-bar-create-user-container { + + display: flex; + flex-direction: column; + position: relative; + float: right; + padding-top: 0px; + text-align: left; + width: 650px; + + label { + margin-bottom: 20px; + } + + .sdc-user-management-top-bar-form-container { + width: 233px; + margin-right: 35px; + } + + .sdc-user-management-top-bar-create-btn { + .w-sdc-btn-light-green; + height: 30px; + width: 100px; + line-height: 0px; + padding-bottom: 3px; + margin-right: 0px; + } + } +} + + +.sdc-user-management-table-container-flex { + height: 650px; + margin-top: 35px; + .sdc-user-management-table { + width: 100%; + border: 1px solid @color_m; + .head { + .bg_m; + .head-row { + .c_18; + font-weight: bold; + + border-right: 1px solid @border_color_d; + + .sdc-user-management-table-header-sort-arrow { + display: inline-block; + background-color: transparent; + border: none; + .c_9; + width: 0; + height: 0; + float: right; + margin: 8px 8px 0px 0px; + &.up { + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid; + } + &.down { + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid; + } + } + } + .sdc-user-management-table-header:hover { + .bg_j; + } + + } + .body { + .scrollbar-container { + max-height: 421px; + .perfect-scrollbar; + } + .b_9; + + .data-row { + &:nth-of-type(odd) { + .bg_c; + } + &.sdc-user-management-table-new-user-row { + + animation: change 7s step-end both; + + @keyframes change { + from { + color: @color_z + } + to { + color: @color_b + } + } + } + &.sdc-user-management-table-row-edit-mode { + .bg_j; + } + div { + + border-right: 1px solid @border_color_d; + + &:last-child { + border-right: none; + } + + .sdc-user-management-table-role-select { + background-color: transparent; + border: 0; + width: 100%; + + } + .sdc-user-management-table-role-label { + margin-left:4px; + } + + } + + } + .data-row:hover { + .bg_j; + } + + } + + .sdc-user-management-table-btn-col { + + line-height: 0px; + text-align: center; + .sdc-user-management-table-delete-btn { + background-color: transparent; + border: none; + .sprite; + .sprite.e-sdc-small-icon-delete; + opacity: 0.7; + } + .sdc-user-management-table-edit-btn { + background-color: transparent; + border: none; + .sprite; + .e-sdc-small-icon-pencil; + opacity: 0.7; + } + .sdc-user-management-table-save-btn { + background-color: transparent; + border: none; + .sprite; + .sprite.e-sdc-green-save; + } + } + + } + + .sdc-user-management-flex-container { + display: flex; + } + + .sdc-user-management-flex-item { + width:10px; + padding: 5px; + text-align: center; + } + + .sdc-user-management-flex-item:nth-child(1) { + flex-grow: 5; + } + + .sdc-user-management-flex-item:nth-child(2) { + flex-grow: 7; + } + + .sdc-user-management-flex-item:nth-child(3) { + flex-grow: 4; + } + + .sdc-user-management-flex-item:nth-child(4) { + flex-grow: 8; + } + + .sdc-user-management-flex-item:nth-child(5) { + flex-grow: 8; + } + + .sdc-user-management-flex-item:nth-child(6) { + flex-grow: 8; + } + + .sdc-user-management-flex-item:nth-child(7) { + flex-grow: 1; + } + + .sdc-user-management-flex-item:nth-child(8) { + flex-grow: 1; + } + +} + diff --git a/catalog-ui/app/scripts/view-models/catalog/catalog-view-model.ts b/catalog-ui/app/scripts/view-models/catalog/catalog-view-model.ts new file mode 100644 index 0000000000..bf37e92e56 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/catalog/catalog-view-model.ts @@ -0,0 +1,312 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + + 'use strict'; + + interface Checkboxes { + componentTypes:Array; + resourceSubTypes:Array; + } + + interface CheckboxesFilter { + // Types + selectedComponentTypes:Array; + selectedResourceSubTypes:Array; + // Categories + selectedCategoriesModel:Array; + // Statuses + selectedStatuses:Array; + } + + interface Gui { + isLoading: boolean; + onResourceSubTypesClick:Function; + onComponentTypeClick:Function; + onCategoryClick:Function; + onSubcategoryClick:Function; + onGroupClick:Function; + } + + export interface ICatalogViewModelScope extends ng.IScope { + checkboxes:Checkboxes; + checkboxesFilter:CheckboxesFilter; + gui:Gui; + + categories: Array; + confStatus: Models.IConfigStatuses; + sdcMenu:Models.IAppMenu; + catalogFilterdItems: Array; + expandedSection: Array; + actionStrategy: any; + user: Models.IUserProperties; + catalogMenuItem: any; + version:string; + sortBy:string; + reverse:boolean; + + //this is for UI paging + numberOfItemToDisplay:number; + isAllItemDisplay: boolean; + + openViewerModal(isResource: boolean, uniqueId: string): void; + changeLifecycleState(entity:any,state:string): void; + sectionClick (section:string):void; + order(sortBy:string): void; + getNumOfElements(num:number): string; + goToComponent(component:Models.Components.Component):void; + raiseNumberOfElementToDisplay():void; + } + + export class CatalogViewModel { + static '$inject' = [ + '$scope', + '$filter', + 'Sdc.Services.EntityService', + 'sdcConfig', + 'sdcMenu', + '$state', + '$q', + 'Sdc.Services.UserResourceService', + '$modal', + '$templateCache', + 'Sdc.Services.CacheService', + 'ComponentFactory', + 'ChangeLifecycleStateHandler', + 'ModalsHandler', + 'MenuHandler' + ]; + + constructor(private $scope:ICatalogViewModelScope, + private $filter:ng.IFilterService, + private EntityService:Services.EntityService, + private sdcConfig:Models.IAppConfigurtaion, + private sdcMenu:Models.IAppMenu, + private $state:any, + private $q:any, + private userResourceService:Sdc.Services.IUserResourceClass, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService, + private cacheService:Services.CacheService, + private ComponentFactory: Sdc.Utils.ComponentFactory, + private ChangeLifecycleStateHandler: Sdc.Utils.ChangeLifecycleStateHandler, + private OpenViewModalHandler: Utils.ModalsHandler, + private MenuHandler: Utils.MenuHandler + ) { + + this.initScopeMembers(); + this.initCatalogData(); // Async task to get catalog from server. + this.initScopeMethods(); + } + + private initCatalogData = ():void => { + let onSuccess = (followedResponse:Array):void => { + this.$scope.catalogFilterdItems = followedResponse; + this.$scope.isAllItemDisplay = this.$scope.numberOfItemToDisplay >= this.$scope.catalogFilterdItems.length; + this.$scope.categories = this.cacheService.get('serviceCategories').concat(this.cacheService.get('resourceCategories')).concat(this.cacheService.get('productCategories')); + this.$scope.gui.isLoading = false; + }; + + let onError = ():void => { + console.info('Failed to load catalog CatalogViewModel::initCatalog'); + this.$scope.gui.isLoading = false; + }; + this.EntityService.getCatalog().then(onSuccess, onError); + }; + + + + private initScopeMembers = ():void => { + // Gui init + this.$scope.gui = {}; + this.$scope.gui.isLoading = true; + this.$scope.numberOfItemToDisplay = 0; + //this.$scope.categories = this.cacheService.get('categoriesMap'); + this.$scope.sdcMenu = this.sdcMenu; + this.$scope.confStatus = this.sdcMenu.statuses; + this.$scope.expandedSection = ["type", "cssClasses", "product-category", "status"]; + this.$scope.user = this.userResourceService.getLoggedinUser(); + this.$scope.catalogMenuItem = this.sdcMenu.catalogMenuItem; + this.$scope.version = this.cacheService.get('version'); + this.$scope.sortBy = 'lastUpdateDate'; + this.$scope.reverse = true; + + + // Checklist init + this.$scope.checkboxes = {}; + this.$scope.checkboxes.componentTypes = ['Resource', 'Service', 'Product']; + this.$scope.checkboxes.resourceSubTypes = ['VF', 'VFC', 'CP', 'VL']; + + // Checkboxes filter init + this.$scope.checkboxesFilter = {}; + this.$scope.checkboxesFilter.selectedComponentTypes = []; + this.$scope.checkboxesFilter.selectedResourceSubTypes = []; + this.$scope.checkboxesFilter.selectedCategoriesModel = []; + this.$scope.checkboxesFilter.selectedStatuses = []; + + // this.$scope.isAllItemDisplay = this.$scope.numberOfItemToDisplay >= this.$scope.catalogFilterdItems.length; + }; + + private initScopeMethods = ():void => { + this.$scope.sectionClick = (section:string):void => { + let index:number = this.$scope.expandedSection.indexOf(section); + if (index!==-1) { + this.$scope.expandedSection.splice(index,1); + } else { + this.$scope.expandedSection.push(section); + } + }; + + + this.$scope.order = (sortBy:string):void => {//default sort by descending last update. default for alphabetical = ascending + this.$scope.reverse = (this.$scope.sortBy === sortBy) ? !this.$scope.reverse : (sortBy === 'lastUpdateDate') ? true: false; + this.$scope.sortBy = sortBy; + }; + + + this.$scope.goToComponent = (component:Models.Components.Component):void => { + this.$scope.gui.isLoading = true; + this.$state.go('workspace.general', {id: component.uniqueId, type:component.componentType.toLowerCase()}); + }; + + + // Will print the number of elements found in catalog + this.$scope.getNumOfElements = (num:number) : string => { + if (!num || num===0){ + return "No Elements found"; + } else if (num===1){ + return "1 Element found"; + }else { + return num + " Elements found"; + } + }; + + /** + * Select | unselect sub resource when resource is clicked | unclicked. + * @param type + */ + this.$scope.gui.onComponentTypeClick = (type:string): void => { + if (type==='Resource'){ + if (this.$scope.checkboxesFilter.selectedComponentTypes.indexOf('Resource')===-1){ + // If the resource was not selected, unselect all childs. + this.$scope.checkboxesFilter.selectedResourceSubTypes = []; + } else { + // If the resource was selected, select all childs + this.$scope.checkboxesFilter.selectedResourceSubTypes = angular.copy(this.$scope.checkboxes.resourceSubTypes); + } + } + }; + + /** + * Selecting | unselect resources when sub resource is clicked | unclicked. + */ + this.$scope.gui.onResourceSubTypesClick = ():void => { + if (this.$scope.checkboxesFilter.selectedResourceSubTypes && this.$scope.checkboxesFilter.selectedResourceSubTypes.length===this.$scope.checkboxes.resourceSubTypes.length){ + this.$scope.checkboxesFilter.selectedComponentTypes.push('Resource'); + } else { + this.$scope.checkboxesFilter.selectedComponentTypes = _.without(this.$scope.checkboxesFilter.selectedComponentTypes,'Resource'); + } + }; + + this.$scope.gui.onCategoryClick = (category:Models.IMainCategory): void => { + // Select | Unselect all childs + if (this.isCategorySelected(category.uniqueId)){ + this.$scope.checkboxesFilter.selectedCategoriesModel = this.$scope.checkboxesFilter.selectedCategoriesModel.concat(angular.copy(_.map(category.subcategories, (item) => { return item.uniqueId; }))); + if (category.subcategories) { + category.subcategories.forEach((sub:Models.ISubCategory)=> { // Loop on all selected subcategories and mark the childrens + this.$scope.checkboxesFilter.selectedCategoriesModel = this.$scope.checkboxesFilter.selectedCategoriesModel.concat(angular.copy(_.map(sub.groupings, (item) => { + return item.uniqueId; + }))); + }); + } + } else { + this.$scope.checkboxesFilter.selectedCategoriesModel = _.difference(this.$scope.checkboxesFilter.selectedCategoriesModel, _.map(category.subcategories, (item) => { return item.uniqueId; })); + if (category.subcategories) { + category.subcategories.forEach((sub:Models.ISubCategory)=> { // Loop on all selected subcategories and un mark the childrens + this.$scope.checkboxesFilter.selectedCategoriesModel = _.difference(this.$scope.checkboxesFilter.selectedCategoriesModel, _.map(sub.groupings, (item) => { + return item.uniqueId; + })); + }); + } + } + }; + + this.$scope.gui.onSubcategoryClick = (category:Models.IMainCategory, subCategory:Models.ISubCategory) : void => { + // Select | Unselect all childs + if (this.isCategorySelected(subCategory.uniqueId)){ + this.$scope.checkboxesFilter.selectedCategoriesModel = this.$scope.checkboxesFilter.selectedCategoriesModel.concat(angular.copy(_.map(subCategory.groupings, (item) => { return item.uniqueId; }))); + } else { + this.$scope.checkboxesFilter.selectedCategoriesModel = _.difference(this.$scope.checkboxesFilter.selectedCategoriesModel, _.map(subCategory.groupings, (item) => { return item.uniqueId; })); + } + + // Mark | Un mark the parent when all childs selected. + if (this.areAllCategoryChildsSelected(category)){ + // Add the category to checkboxesFilter.selectedCategoriesModel + this.$scope.checkboxesFilter.selectedCategoriesModel.push(category.uniqueId); + } else { + this.$scope.checkboxesFilter.selectedCategoriesModel = _.without(this.$scope.checkboxesFilter.selectedCategoriesModel, category.uniqueId); + } + + }; + + this.$scope.raiseNumberOfElementToDisplay = () : void => { + this.$scope.numberOfItemToDisplay = this.$scope.numberOfItemToDisplay +35; + if(this.$scope.catalogFilterdItems) { + this.$scope.isAllItemDisplay = this.$scope.numberOfItemToDisplay >= this.$scope.catalogFilterdItems.length; + } + }; + + this.$scope.gui.onGroupClick = (subCategory:Models.ISubCategory) : void => { + // Mark | Un mark the parent when all childs selected. + if (this.areAllSubCategoryChildsSelected(subCategory)){ + // Add the category to checkboxesFilter.selectedCategoriesModel + this.$scope.checkboxesFilter.selectedCategoriesModel.push(subCategory.uniqueId); + } else { + this.$scope.checkboxesFilter.selectedCategoriesModel = _.without(this.$scope.checkboxesFilter.selectedCategoriesModel, subCategory.uniqueId); + } + }; + + + }; + + private areAllCategoryChildsSelected = (category:Models.IMainCategory):boolean => { + if (!category.subcategories){return false;} + let allIds = _.map(category.subcategories, (sub:Models.ISubCategory)=>{return sub.uniqueId;}); + let total = _.intersection(this.$scope.checkboxesFilter.selectedCategoriesModel, allIds); + return total.length === category.subcategories.length?true:false; + }; + + private areAllSubCategoryChildsSelected = (subCategory:Models.ISubCategory):boolean => { + if (!subCategory.groupings){return false;} + let allIds = _.map(subCategory.groupings, (group:Models.IGroup)=>{return group.uniqueId;}); + let total = _.intersection(this.$scope.checkboxesFilter.selectedCategoriesModel, allIds); + return total.length === subCategory.groupings.length?true:false; + }; + + private isCategorySelected = (uniqueId:string):boolean => { + if (this.$scope.checkboxesFilter.selectedCategoriesModel.indexOf(uniqueId)!==-1){ + return true; + } + return false; + }; + + } +} diff --git a/catalog-ui/app/scripts/view-models/catalog/catalog-view-tests.ts b/catalog-ui/app/scripts/view-models/catalog/catalog-view-tests.ts new file mode 100644 index 0000000000..3e21835233 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/catalog/catalog-view-tests.ts @@ -0,0 +1,309 @@ +/*- + * ============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========================================================= + */ +/// +describe("test catalog-view", () => { + + let $controllerMock:ng.IControllerService; + let $qMock:ng.IQService; + let $httpBackendMock:ng.IHttpBackendService; + let $scopeMock:Sdc.ViewModels.ICatalogViewModelScope; + let $stateMock:ng.ui.IStateService; + let $stateParams:any; + let entityServiceMock; + let cacheServiceMock; + + beforeEach(angular.mock.module('sdcApp')); + + let getAllEntitiesResponseMock = [ + { + "uniqueId": "855acdc7-7976-4913-9fa6-25220bd5a069", + "uuid": "8bc54f94-082c-42fa-9049-84767df3ff05", + "contactId": "qa1234", + "category": "VoIP Call Control", + "creationDate": 1447234712398, + "description": "ddddd", + "highestVersion": true, + "icon": "mobility", + "lastUpdateDate": 1447234712398, + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "distributionStatus": "DISTRIBUTION_NOT_APPROVED", + "projectCode": "233233", + "name": "mas mas mas mas mas mas mas mas mas mas mas mas ma", + "version": "0.1", + "type": 0, + "tags": [ + "mas mas mas mas mas mas mas mas mas mas mas mas ma" + ], + "systemName": "MasMasMasMasMasMasMasMasMasMasMasMasMa", + "vnf": true, + "$$hashKey": "object:30" + }, + { + "uniqueId": "4bb577ce-cb2c-4cb7-bb39-58644b5e73cb", + "uuid": "e27f4723-c9ec-4160-89da-dbf84d19a7e3", + "contactId": "qa1111", + "category": "Mobility", + "creationDate": 1447238503181, + "description": "aqa", + "highestVersion": true, + "icon": "call_controll", + "lastUpdateDate": 1447248991388, + "lastUpdaterUserId": "jm0007", + "lastUpdaterFullName": "Joni Mitchell", + "lifecycleState": "CERTIFIED", + "distributionStatus": "DISTRIBUTION_REJECTED", + "projectCode": "111111", + "name": "martin18", + "version": "1.0", + "type": 0, + "tags": [ + "martin18" + ], + "systemName": "Martin18", + "vnf": true + }, + { + "uniqueId": "f192f4a6-7fbf-42e4-a546-37509df28dc1", + "uuid": "0b77dc0d-222e-4d10-85cd-e420c9481417", + "contactId": "fd1212", + "category": "Application Layer 4+/Web Server", + "creationDate": 1447233679778, + "description": "geefw", + "highestVersion": true, + "icon": "database", + "lastUpdateDate": 1447233681582, + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "name": "ger", + "version": "0.1", + "type": 1, + "tags": [ + "ger" + ], + "vendorName": "fewwfe", + "vendorRelease": "fewew", + "systemName": "Ger", + "$$hashKey": "object:31" + }, + { + "uniqueId": "78392d08-1859-47c2-b1f2-1a35b7f8c30e", + "uuid": "8cdd63b2-6a62-4376-9012-624f424f71d4", + "contactId": "qw1234", + "category": "Application Layer 4+/Application Servers", + "creationDate": 1447234046114, + "description": "test", + "highestVersion": true, + "icon": "router", + "lastUpdateDate": 1447234050545, + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "name": "test", + "version": "0.1", + "type": 1, + "tags": [ + "test" + ], + "vendorName": "test", + "vendorRelease": "test", + "systemName": "Test", + "$$hashKey": "object:32" + }, + { + "uniqueId": "939e153d-2236-410f-b4a9-3b4bf8c79c9e", + "uuid": "84862547-4f56-4058-b78e-40df5f374d7e", + "contactId": "qw1234", + "category": "Application Layer 4+/Application Servers", + "creationDate": 1447235242560, + "description": "jlk", + "highestVersion": true, + "icon": "database", + "lastUpdateDate": 1447235328062, + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "lifecycleState": "NOT_CERTIFIED_CHECKIN", + "name": "new", + "version": "0.1", + "type": 1, + "tags": [ + "new" + ], + "vendorName": "e", + "vendorRelease": "e", + "systemName": "New", + "$$hashKey": "object:33" + }, + { + "uniqueId": "ece818e0-fd59-477a-baf6-e27461a7ce23", + "uuid": "8db823c2-6a9c-4636-8676-f5e713270dd7", + "contactId": "uf2345", + "category": "Network Layer 2-3/Router", + "creationDate": 1447235352429, + "description": "u", + "highestVersion": true, + "icon": "network", + "lastUpdateDate": 1447235370064, + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "name": "u", + "version": "0.1", + "type": 1, + "tags": [ + "u" + ], + "vendorName": "u", + "vendorRelease": "u", + "systemName": "U", + "$$hashKey": "object:34" + } + ]; + + let resourceCategoriesResponseMock = [{"name":"Network L2-3","normalizedName":"network l2-3","uniqueId":"resourceNewCategory.network l2-3","subcategories":[{"name":"Gateway","normalizedName":"gateway","uniqueId":"resourceNewCategory.network l2-3.gateway","icons":["gateway"]},{"name":"Infrastructure","normalizedName":"infrastructure","uniqueId":"resourceNewCategory.network l2-3.infrastructure","icons":["ucpe"]},{"name":"WAN Connectors","normalizedName":"wan connectors","uniqueId":"resourceNewCategory.network l2-3.wan connectors","icons":["network","connector","port"]},{"name":"LAN Connectors","normalizedName":"lan connectors","uniqueId":"resourceNewCategory.network l2-3.lan connectors","icons":["network","connector","port"]},{"name":"Router","normalizedName":"router","uniqueId":"resourceNewCategory.network l2-3.router","icons":["router","vRouter"]}]},{"name":"Network L4+","normalizedName":"network l4+","uniqueId":"resourceNewCategory.network l4+","subcategories":[{"name":"Common Network Resources","normalizedName":"common network resources","uniqueId":"resourceNewCategory.network l4+.common network resources","icons":["network"]}]},{"name":"Application L4+","normalizedName":"application l4+","uniqueId":"resourceNewCategory.application l4+","subcategories":[{"name":"Load Balancer","normalizedName":"load balancer","uniqueId":"resourceNewCategory.application l4+.load balancer","icons":["loadBalancer"]},{"name":"Media Servers","normalizedName":"media servers","uniqueId":"resourceNewCategory.application l4+.media servers","icons":["applicationServer"]},{"name":"Application Server","normalizedName":"application server","uniqueId":"resourceNewCategory.application l4+.application server","icons":["applicationServer"]},{"name":"Database","normalizedName":"database","uniqueId":"resourceNewCategory.application l4+.database","icons":["database"]},{"name":"Call Control","normalizedName":"call control","uniqueId":"resourceNewCategory.application l4+.call control","icons":["call_controll"]},{"name":"Border Element","normalizedName":"border element","uniqueId":"resourceNewCategory.application l4+.border element","icons":["borderElement"]},{"name":"Web Server","normalizedName":"web server","uniqueId":"resourceNewCategory.application l4+.web server","icons":["applicationServer"]},{"name":"Firewall","normalizedName":"firewall","uniqueId":"resourceNewCategory.application l4+.firewall","icons":["firewall"]}]},{"name":"Generic","normalizedName":"generic","uniqueId":"resourceNewCategory.generic","subcategories":[{"name":"Database","normalizedName":"database","uniqueId":"resourceNewCategory.generic.database","icons":["database"]},{"name":"Abstract","normalizedName":"abstract","uniqueId":"resourceNewCategory.generic.abstract","icons":["objectStorage","compute"]},{"name":"Network Elements","normalizedName":"network elements","uniqueId":"resourceNewCategory.generic.network elements","icons":["network","connector"]},{"name":"Infrastructure","normalizedName":"infrastructure","uniqueId":"resourceNewCategory.generic.infrastructure","icons":["connector"]}]},{"name":"NewCategory","normalizedName":"newcategory","uniqueId":"resourceNewCategory.newcategory","subcategories":[{"name":"MyNewSubCategory","normalizedName":"mynewsubcategory","uniqueId":"resourceNewCategory.newcategory.mynewsubcategory"}]}]; + + let getAllEntitiesDefered:ng.IDeferred = null; + + beforeEach(angular.mock.inject((_$controller_:ng.IControllerService, + _$httpBackend_:ng.IHttpBackendService, + _$rootScope_, + _$q_:ng.IQService, + _$state_:ng.ui.IStateService, + _$stateParams_:any) => { + + $controllerMock = _$controller_; + $httpBackendMock = _$httpBackend_ + $scopeMock = _$rootScope_.$new(); + $qMock = _$q_; + $stateMock = _$state_; + $stateParams = _$stateParams_; + + + //handle all http request thet not relevant to the tests + $httpBackendMock.expectGET(/.*languages\/en_US.json.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*rest\/version.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*configuration\/ui.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*user\/authorize.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*categories\/services.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*categories\/resources.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*categories\/products.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET('http://feHost:8181/sdc1/feProxy/rest/version').respond(200, JSON.stringify({})); + + /** + * Mock the service + * @type {any} + */ + getAllEntitiesDefered = $qMock.defer(); + getAllEntitiesDefered.resolve(getAllEntitiesResponseMock); + + cacheServiceMock = jasmine.createSpyObj('cacheServiceMock', ['get']); + cacheServiceMock.get.and.callFake(function(string){return resourceCategoriesResponseMock;}); + /* + cacheServiceMock.get.and.callFake(function(value:string){ + switch(value){ + case 'serviceCategories': + console.log('serviceCategories'); + break; + case 'resourceCategories': + console.log('resourceCategories'); + break; + case 'productCategories': + console.log('productCategories'); + break; + default : + console.log('default'); + break; + } + }); + */ + + entityServiceMock = jasmine.createSpyObj('entityServiceMock', ['getCatalog']); + entityServiceMock.getCatalog.and.returnValue(getAllEntitiesDefered.promise); + + // $stateParams['show'] = ''; + + /** + * Need to inject into the controller only the objects that we want to MOCK + * those that we need to change theirs behaviors + */ + $controllerMock(Sdc.ViewModels.CatalogViewModel, { + '$scope': $scopeMock, + '$stateParams': $stateParams, + 'Sdc.Services.EntityService': entityServiceMock, + 'Sdc.Services.CacheService': cacheServiceMock + }); + + })); + + + beforeEach(function () { + }); + + describe("test GUI events on checkbox type resource click", function () { + + /** + * The function checks only for resource type. + * Select the Resource and verify that the sub resources are selected. + * + */ + it('test onComponentTypeClick (check select checkbox of Resource type)', function () { + $scopeMock.$apply(); + $scopeMock.checkboxesFilter.selectedComponentTypes = ['Resource']; + $scopeMock.gui.onComponentTypeClick('Resource'); + expect($scopeMock.checkboxesFilter.selectedResourceSubTypes.length === 4).toBeTruthy(); + }); + + /** + * The function checks only for resource type. + * Un select the Resource and verify that the sub resources are selected. + * + */ + it('test onComponentTypeClick (check un select checkbox of Resource type)', function () { + $scopeMock.$apply(); + $scopeMock.gui.onComponentTypeClick('Resource'); + expect($scopeMock.checkboxesFilter.selectedResourceSubTypes.length === 0).toBeTruthy(); + }); + + }); + + describe("test GUI events on checkbox main category click -> sub categories are selected", function () { + + /** + * The function checks that after selecting 2 main categories, the subcategories are selected also. + * + */ + it('test onComponentTypeClick (check select checkbox of Resource type)', function () { + let category1 = resourceCategoriesResponseMock[0]; + let category2 = resourceCategoriesResponseMock[1]; + + $scopeMock.$apply(); + $scopeMock.checkboxesFilter.selectedCategoriesModel = [category1.uniqueId, category2.uniqueId]; + $scopeMock.gui.onCategoryClick(category1); + $scopeMock.gui.onCategoryClick(category2); + + expect($scopeMock.checkboxesFilter.selectedCategoriesModel.length===8).toBeTruthy(); + }); + + }); + + +}); diff --git a/catalog-ui/app/scripts/view-models/catalog/catalog-view.html b/catalog-ui/app/scripts/view-models/catalog/catalog-view.html new file mode 100644 index 0000000000..0d46dc2a24 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/catalog/catalog-view.html @@ -0,0 +1,190 @@ +
        + + + + +
        + + + +
        + +
        +
        + + Type +
        +
        +
          +
        • + + + +
            +
          • + + + +
          • +
          +
        • +
        +
        +
        + +
        +
        + + Categories +
        +
        + + +
          +
        • + + + + +
            +
          • + + + + +
              +
            • + + + +
            • +
            +
          • +
          +
        • +
        + +
        +
        + + +
        +
        + + Status +
        + +
        +
          + + +
        • + + + +
          + +
        • +
        +
        +
        + +
        +
        + + + + + +
        +
        + {{getNumOfElements((catalogFilterdItems | entityFilter:checkboxesFilter | filter:search).length)}} +
        +
        +    +   + +  |  +   + +
        +
        + +
        + +
        + +
        +
        + +
        + +
        + {{component.name | resourceName}} +
        +
        + + +
        +
        +
        + +
        + + + +
        diff --git a/catalog-ui/app/scripts/view-models/catalog/catalog.less b/catalog-ui/app/scripts/view-models/catalog/catalog.less new file mode 100644 index 0000000000..8be90a6a59 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/catalog/catalog.less @@ -0,0 +1,304 @@ +.sdc-catalog-container { + + .i-sdc-categories-list-item { + font-weight: normal; + } + + // Checkboxes + .i-sdc-designer-leftbar-section-content-ul { + padding: 0; + margin: 0; + + .i-sdc-catalog-subcategories-checkbox { + padding: 0 0 0 20px; + margin: 0; + + .i-sdc-catalog-grouping-checkbox { + padding: 0 0 0 20px; + margin: 0; + } + + } + + } + + .i-sdc-designer-leftbar-section-content-li { + &:last-child { + .i-sdc-categories-list-item { + margin: 0; + } + } + } + + .i-sdc-categories-list-item { + display: block; + //margin-bottom: 5px; + //padding-left: 15px; + //text-indent: -24px; + vertical-align: top; + font-weight: bold; + } + + .i-sdc-subcategories-list-item { + display: block; + //padding-left: 20px; + vertical-align: top; + font-weight: normal; + margin: 0; + //text-indent: -10px; + } + + /*Added by - Ikram */ + .i-sdc-product-input, + .i-sdc-product-select { + border: 1px solid @border_color_f; + min-height: 30px; + padding: 0; + width: 100%; + margin: 1px 0; + background-color: #F2F2F2; + outline: none; + + &:disabled { + .disabled; + } + optgroup{ + color: @color_u; + option{ + color: @color_b; + } + } + } + + .i-sdc-categories-list-item-icon { + display: inline-block; + float: right; + position: relative; + right: -8px; + top: 6px; + } + + .i-sdc-categories-list-item { + margin-top: 7px; + &.NOT_CERTIFIED_CHECKOUT, + &.NOT_CERTIFIED_CHECKIN { + .i-sdc-categories-list-item-icon { + background: url('../../../styles/images/sprites/sprite-global-old.png') no-repeat -53px -2889px; + width: 14px; + height: 14px; + + } + } + + &.CERTIFIED { + .i-sdc-categories-list-item-icon { + background: url('../../../styles/images/sprites/sprite-global-old.png') no-repeat -53px -3034px; + width: 14px; + height: 16px; + } + } + + &.READY_FOR_CERTIFICATION { + .i-sdc-categories-list-item-icon { + background: url('../../../styles/images/sprites/sprite-global-old.png') no-repeat -53px -2985px; + width: 14px; + height: 16px; + } + } + + &.CERTIFICATION_IN_PROGRESS { + .i-sdc-categories-list-item-icon { + background: url('../../../styles/images/sprites/sprite-global-old.png') no-repeat -53px -2934px; + width: 14px; + height: 16px; + } + } + + &.DISTRIBUTED, + &.TBD { + .i-sdc-categories-list-item-icon { + background: url('../../../styles/images/sprites/sprite-global-old.png') no-repeat -43px -3087px; + width: 24px; + height: 14px; + + } + } + } + + .i-sdc-categories-list-input { + margin: 8px; + + } + + .i-sdc-subcategories-list-input { + + margin: 8px; + } + .i-sdc-subcategories-list-input-container { + margin: 0px 0px 0px 20px; + padding: 2px; + } + + .w-sdc-header-catalog-search-container { + display: table; + padding: 21px 0; + position: relative; + + .w-sdc-designer-leftbar-search-input { + color: #000; + width: 300px; + } + + // .magnification { + // .sprite; + // .sprite.magnification-glass; + // .hand; + // position: absolute; + // top: 40px; + // right: 42px; + // } + } + + .w-sdc-catalog-main { + padding: 10px 12px; + } + .w-sdc-dashboard-catalog-header { + .b_9; + display: inline-block; + font-style: italic; + font-weight: bold; + padding-left: 10px; + } + + .w-sdc-dashboard-catalog-header-order { + .b_9; + font-weight: 800; + } + + .w-sdc-dashboard-catalog-sort { + .b_9; + font-weight: bold; + white-space:pre; + &:hover{ + .hand; + text-decoration: none; + .a_9; + } + &.blue { + .a_9; + } + } + + .w-sdc-catalog-sort-arrow{ + display: inline-block; + &.up{ + .b_9; + width: 0; + height: 0; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid ; + } + &.down{ + .b_9; + width: 0; + height: 0; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid; + } + } + + + + + .w-sdc-dashboard-catalog-header-right{ + float: right; + display: inline-block; + padding-right:34px; + } + + .w-sdc-header-catalog-search-input { + width: 420px; + display: table-cell; + padding: 0 25px 1px 10px; + border: 1px solid #bcbcbc; + .border-radius(10px); + height: 30px; + margin: 10px 30px; + outline: none; + } + + .sdc-catalog-type-filter-container { + margin-top: -1px; + } + + .i-sdc-designer-leftbar-section-title { + text-transform: uppercase; + .l_14_m; + line-height: 30px; + } + + .i-sdc-designer-leftbar-section-title-icon { + .hand; + .tlv-sprite; + .footer-close; + transition: .3s all; + margin-top: -4px; + } + + .i-sdc-designer-leftbar-section-title-text { + margin-left: 20px; + } + + .seperator-left, + .seperator-right { + border-right: solid 1px @color_m; + display: table-cell; + width: 2px; + } + + // Rotate catalog left side arrows + .i-sdc-designer-leftbar-section-title.expanded .i-sdc-designer-leftbar-section-title-icon { + transform: rotate(180deg); + } + + // Transform catalog left side sections + .i-sdc-designer-leftbar-section-title + .i-sdc-designer-leftbar-section-content { + max-height: 0px; + margin: 0 auto; + transition: all .3s; + overflow: hidden; + padding: 0 10px 0 18px; + } + + .i-sdc-designer-leftbar-section-title.expanded + .i-sdc-designer-leftbar-section-content { + max-height: 9999px; + margin: 0 auto 1px; + transition: all .3s; + padding: 10px 18px 10px 18px; + overflow: hidden; + } + +} + +.w-sdc-search-icon{ + position: absolute; + right: 40px; + top: 40px; + &.leftbar{ + top: 19px; + right: 18px; + } + &.magnification { + .sprite; + .sprite.magnification-glass; + .hand; + } + + &.cancel { + .sprite; + .sprite.clear-text; + .hand; + } +} diff --git a/catalog-ui/app/scripts/view-models/component-viewer/activity-log/activity-log-view.html b/catalog-ui/app/scripts/view-models/component-viewer/activity-log/activity-log-view.html new file mode 100644 index 0000000000..ac51e9014c --- /dev/null +++ b/catalog-ui/app/scripts/view-models/component-viewer/activity-log/activity-log-view.html @@ -0,0 +1,16 @@ +
        +
        {{activityDate | date: 'longDate'}}
        +
        +
        {{activity.TIMESTAMP.replace(" UTC", '') | stringToDateFilter | date: 'mediumTime':'UTC'}}
        +
        {{"Action: " + parseAction(activity.ACTION) + " Performed by: " + activity.MODIFIER + " Status: " + activity.STATUS}}
        +
        +
        + + + + + + + + + diff --git a/catalog-ui/app/scripts/view-models/component-viewer/activity-log/activity-log-view.less b/catalog-ui/app/scripts/view-models/component-viewer/activity-log/activity-log-view.less new file mode 100644 index 0000000000..4a7676b6e2 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/component-viewer/activity-log/activity-log-view.less @@ -0,0 +1,18 @@ +.w-sdc-component-viewer-right-activity-log{ + + .w-sdc-component-viewer-right-activity-log-date{ + .backgroundColor.n; + .font-color.g; + padding: 4px 11px + } + .w-sdc-component-viewer-right-activity-log-time{ + .g_3; + padding: 12px 0px 0px 11px; + } + + .w-sdc-component-viewer-right-activity-log-content{ + .g_1; + padding: 0px 0px 12px 11px; + border-bottom: 1px solid rgba(0, 0, 0, 0.17); + } +} diff --git a/catalog-ui/app/scripts/view-models/component-viewer/component-viewer-view-model.ts b/catalog-ui/app/scripts/view-models/component-viewer/component-viewer-view-model.ts new file mode 100644 index 0000000000..3ae8ad70fb --- /dev/null +++ b/catalog-ui/app/scripts/view-models/component-viewer/component-viewer-view-model.ts @@ -0,0 +1,211 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.ViewModels { + 'use strict'; + + interface IComponentViewerViewModelScope extends ng.IScope { + component: Models.Components.Component; + additionalInformations: Array; + activityLog: any; + activityDateArray: Array; //this is in order to sort the dates + inputs: Array; + isLoading: boolean; + templateUrl: string; + currentTab:string; + preVersion:string; + sdcMenu:Models.IAppMenu; + versionsList:Array; + close(): void; + hasItems(obj:any): boolean; + onVersionChanged(version:any) : void; + moveToTab(tab:string):void; + isSelected(tab:string):boolean; + getActivityLog(uniqueId:string):void; + parseAction(action:string):string; + } + + export class ComponentViewerViewModel { + + static '$inject' = [ + '$scope', + '$modalInstance', + 'component', + 'Sdc.Services.ActivityLogService', + 'sdcMenu', + 'ComponentFactory' + ]; + + constructor(private $scope:IComponentViewerViewModelScope, + private $modalInstance:ng.ui.bootstrap.IModalServiceInstance, + private component:Models.Components.Component, + private activityLogService:Services.ActivityLogService, + private sdcMenu:Models.IAppMenu, + private ComponentFactory: Utils.ComponentFactory) { + this.initScope(component); + } + + //creating objects for versions + private initVersionObject:Function = ():void => { + this.$scope.versionsList = []; + for (let version in this.$scope.component.allVersions) { + this.$scope.versionsList.push({ + versionNumber: version, + versioning: this.versioning(version), + versionId: this.$scope.component.allVersions[version] + }); + } + + }; + + private versioning:Function = (versionNumber:string):string => { + let version:Array = versionNumber.split('.'); + return '00000000'.slice(version[0].length) + version[0] + '.' + '00000000'.slice(version[1].length) + version[1]; + }; + + private showComponentInformationView:Function = ():void => { + if (this.$scope.component.isResource()) { + this.$scope.templateUrl = '/app/scripts/view-models/component-viewer/properties/resource-properties-view.html'; + } else if(this.$scope.component.isService()) { + this.$scope.templateUrl = '/app/scripts/view-models/component-viewer/properties/service-properties-view.html'; + } else { + this.$scope.templateUrl = '/app/scripts/view-models/component-viewer/properties/product-properties-view.html'; + } + }; + + private showActivityLogView:Function = ():void => { + this.$scope.templateUrl = '/app/scripts/view-models/component-viewer/activity-log/activity-log-view.html'; + }; + + private initComponent = (component:Models.Components.Component):void => { + this.$scope.component = component; + this.$scope.additionalInformations = component.getAdditionalInformation(); + this.initVersionObject(); + this.$scope.isLoading = false; + }; + + private initScope = (component:Models.Components.Component):void => { + this.$scope.isLoading = false; + this.initComponent(component); + this.$scope.currentTab = 'PROPERTIES'; + this.$scope.preVersion = component.version; + this.$scope.sdcMenu = this.sdcMenu; + this.showComponentInformationView(); + //service inputs + if (component.isService()) { + let inputs:Array = []; + + for (let group in component.componentInstancesProperties) { + if (component.componentInstancesProperties[group]) { + component.componentInstancesProperties[group].forEach((property:Models.PropertyModel):void => { + if (!property.value) { + property.value = property.defaultValue; + } + inputs.push({ + name: property.name, + value: property.value, + type: property.type + }); + }); + } + } + this.$scope.inputs = inputs; + } + + this.$scope.hasItems = (obj:any):boolean => { + return Object.keys(obj).length > 0; + }; + + this.$scope.close = ():void => { + this.$modalInstance.dismiss(); + }; + + this.$scope.onVersionChanged = (version:any):void => { + if (version.versionNumber != this.$scope.component.version) { + this.$scope.isLoading = true; + this.ComponentFactory.getComponentFromServer(this.component.componentType, version.versionId).then((component: Models.Components.Component):void => { + this.initComponent(component); + }); + if (this.$scope.currentTab === 'ACTIVITY_LOG') { + this.$scope.getActivityLog(version.versionId); + } + + } + }; + + this.$scope.getActivityLog = (uniqueId:any):void => { + + let onError = (response) => { + this.$scope.isLoading = false; + console.info('onFaild', response); + + }; + let onSuccess = (response:Array) => { + this.$scope.activityLog = _.groupBy(response, function (activity:Models.Activity) { //group by date only + let dateTime:Date = new Date(activity.TIMESTAMP.replace(" UTC", '').replace(" ", 'T')); + // let date:Date = new Date(dateTime.getFullYear(), dateTime.getMonth(), dateTime.getDate()); + return dateTime.getTime(); + }); + /*this is in order to sort the jsonObject by date*/ + this.$scope.activityDateArray = Object.keys(this.$scope.activityLog); + this.$scope.activityDateArray.sort().reverse(); + this.$scope.isLoading = false; + }; + + this.$scope.isLoading = true; + if (this.$scope.component.isResource()) { + this.activityLogService.getActivityLogService('resources', uniqueId).then(onSuccess, onError); + } + if (this.$scope.component.isService()) { + this.activityLogService.getActivityLogService('services', uniqueId).then(onSuccess, onError); + } + + }; + + this.$scope.moveToTab = (tab:string):void => { + if (tab === this.$scope.currentTab) { + return; + } else if (tab === 'PROPERTIES') { + this.showComponentInformationView(); + this.$scope.preVersion = this.$scope.component.version; + } else if (tab === 'ACTIVITY_LOG') { + if (!this.$scope.activityLog || this.$scope.preVersion != this.$scope.component.version) { + this.$scope.activityLog = this.$scope.getActivityLog(this.$scope.component.uniqueId); + } + this.showActivityLogView(); + } else { + console.error("Tab " + tab + " not found!"); + return; + } + this.$scope.currentTab = tab; + }; + + this.$scope.isSelected = (tab:string):boolean => { + return tab === this.$scope.currentTab; + }; + + this.$scope.parseAction = (action:string) => { + return action ? action.split(/(?=[A-Z])/).join(' ') : ''; + }; + + } + } +} diff --git a/catalog-ui/app/scripts/view-models/component-viewer/component-viewer.html b/catalog-ui/app/scripts/view-models/component-viewer/component-viewer.html new file mode 100644 index 0000000000..6f244b048e --- /dev/null +++ b/catalog-ui/app/scripts/view-models/component-viewer/component-viewer.html @@ -0,0 +1,55 @@ +
        + +
        X
        +
        +
        +

        +
        + {{component.name | resourceName}} +
        + v{{component.version}} +

        +

        + UUID: {{component.uuid}} +

        +
        +
        Version History
        + +
        +
        + {{ version.versionNumber }} +
        +
        +
        +
        + +
        +
        Composition
        + + + +
        +
        + +
        + + + + + + + +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/component-viewer/component-viewer.less b/catalog-ui/app/scripts/view-models/component-viewer/component-viewer.less new file mode 100644 index 0000000000..2fe5676d62 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/component-viewer/component-viewer.less @@ -0,0 +1,148 @@ +html .modal-component-viewer{ + width: 1084px; +} + +.w-sdc-resource-viewer { + .b_7; + .w-sdc-resource-viewer-modal-close{ + z-index: 2; + text-indent: -100px; + overflow: hidden; + top: 19px; + } + .w-sdc-resource-viewer-content { + position: relative; + overflow: hidden; + + .w-sdc-resource-viewer-left { + + .bg_j; + display: table-cell; + width: 282px; + + .w-sdc-resource-viewer-left-title { + margin: 0; + display: block; + height: 100px; + padding: 20px 0; + } + + .w-sdc-resource-viewer-left-title-icon { + margin: 0 15px; + vertical-align: middle; + float: left; + } + + .w-sdc-resource-viewer-left-title-name { + .g_7; + max-width: 160px; + overflow: hidden; + display: inline-block; + text-overflow: ellipsis; + vertical-align: middle; + line-height: 23px; + padding-top: 10px; + font-weight: bold; + white-space: nowrap; + } + + .w-sdc-resource-viewer-left-title-version { + .g_13; + float: left; + } + + .w-sdc-resource-viewer-left-title-uuid { + .g_14; + text-align: center; + border-top: 1px solid rgba(120, 136, 148, 0.26); + width: 95%; + margin: auto; + padding: 7px 0; + } + + .w-sdc-resource-viewer-leftbar-section { + font-family: omnes-medium, sans-serif; + } + + .w-sdc-resource-viewer-leftbar-section-title { + .bg_o; + color: #fff; + font-size: 14px; + padding: 12px 20px; + text-transform: uppercase; + } + + .w-sdc-resource-viewer-leftbar-section-structure{ + .perfect-scrollbar; + max-height: 525px; + } + .w-sdc-resource-viewer-version { + font-weight: bold; + .perfect-scrollbar; + } + + .i-sdc-resource-viewer-version-container { + padding: 13px 0px 13px 13px; + max-height: 218px; + + .i-sdc-resource-viewer-version-item { + + &.active { + .a_7; + } + &:hover { + cursor: pointer; + } + } + + } + } + + .w-sdc-resource-viewer-right { + .bg_c; + display: table-cell; + vertical-align: top; + padding: 0; // for the scroller to be on all width + width: 716px; + padding: 25px 0px 0px 35px; + + .w-sdc-resource-viewer-right-content { + padding: 0 52px 0 0px; + margin-bottom: 25px; + height: 700px; + overflow: hidden; + position: relative; + + } + + .w-sdc-resource-viewer-right-tab { + .b_6; + + .hand; + background-color: transparent; + position: relative; + font-weight: 500; + line-height: 30px; + border: none; + border-bottom: solid 1px @color_c; + vertical-align: middle; + padding: 0px 30px 20px 0px; + + + &:focus, + &:active { + outline: none; + + } + &.selected { + outline: none; + font-weight: 700; + .font-color.a; + } + } + + + } + + } +} diff --git a/catalog-ui/app/scripts/view-models/component-viewer/properties/product-properties-view.html b/catalog-ui/app/scripts/view-models/component-viewer/properties/product-properties-view.html new file mode 100644 index 0000000000..8aeda603f8 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/component-viewer/properties/product-properties-view.html @@ -0,0 +1,76 @@ +
        + +

        General Information

        +
        +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + Life Cycle Status: + + {{sdcMenu.LifeCycleStatuses[component.lifecycleState].text}} + +
        +
        + Distribution Status: + + {{sdcMenu.DistributionStatuses[component.distributionStatus].text}} + +
        +
        +
        +
        + + +
        +
        + + +
        +
        +
        +

        Additional Information

        + +
        + + + + + + + + + + + +
        KeyValue
        {{additionalInformation.key}}{{additionalInformation.value}}
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/component-viewer/properties/properties-view.less b/catalog-ui/app/scripts/view-models/component-viewer/properties/properties-view.less new file mode 100644 index 0000000000..c0beed338f --- /dev/null +++ b/catalog-ui/app/scripts/view-models/component-viewer/properties/properties-view.less @@ -0,0 +1,128 @@ +.w-sdc-component-viewer-right-properties { + .w-sdc-resource-viewer-tabs { + height: 42px; + } + + .w-sdc-resource-viewer-right-content-section { + margin: 0 0 20px 16px; + } + + .sdc-resource-viewer-sidebar-section-content-column-1, + .sdc-resource-viewer-sidebar-section-content-column-2 { + display: table-cell; + width: 50%; + } + .sdc-resource-viewer-sidebar-section-content-item { + .b_7; + margin-bottom: 5px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 305px; + } + .sdc-resource-viewer-sidebar-section-content-item-label { + .bold; + .g_9; + } + .w-sdc-resource-viewer-right .sdc-resource-viewer-sidebar-section-content-column-1 { + .sdc-resource-viewer-sidebar-section-content-item { + width: 390px; + } + } + .sdc-resource-viewer-sidebar-section-content-item.description { + margin: 0; + + .sdc-resource-viewer-sidebar-section-content-item-value { + word-wrap: break-word; + white-space: normal; + display: block; + + } + .sdc-resource-viewer-sidebar-section-content-tags { + word-wrap: break-word; + white-space: pre-wrap; + display: inline-block; + max-width: 167px; + + } + } + + .w-sdc-resource-viewer-right-title { + .g_1; + .bg_n; + padding: 7px 15px; + margin: 0px 0 25px; + font-weight: bold; + } + + .w-sdc-resource-viewer-right-table-head-cell { + .g_9; + text-align: left; + } + + .cols-1 { + width: 100%; + } + .cols-2 { + width: 50%; + } + .cols-3 { + width: 33%; + } + + .sdc-properties-container table tbody td.label { + .bold; + } + + .w-sdc-designer-sidebar-section-content, + .w-sdc-resource-viewer-right-table { + display: table; + width: 100%; + .b_9; + word-break: break-all; + + tbody td { + padding: 4px 20px 0 0; + + .ellipsis-directive-more-less { + display: none; + } + + .ellipsis-cols2 { + .sdc-ellipsis; + max-width: 340px; + } + .ellipsis-cols3 { + .sdc-ellipsis; + max-width: 200px; + } + } + + } + + .i-sdc-designer-sidebar-section-content-column-1 { + display: table-cell; + width: 50%; + } + + .i-sdc-designer-sidebar-section-content-column-2 { + display: table-cell; + width: 50%; + } + + .i-sdc-resource-viewer-artifacts-item-action, + .sdc-information-artifacts-icon { + .sprite; + display: inline-block; + width: 20px; + height: 20px; + cursor: pointer; + vertical-align: middle; + &.download { + .sprite.e-sdc-small-download; + } + &.preview { + .e-sdc-small-icon-eye; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/component-viewer/properties/resource-properties-view.html b/catalog-ui/app/scripts/view-models/component-viewer/properties/resource-properties-view.html new file mode 100644 index 0000000000..c02e7aba7e --- /dev/null +++ b/catalog-ui/app/scripts/view-models/component-viewer/properties/resource-properties-view.html @@ -0,0 +1,169 @@ +
        + +

        General Information

        +
        +
        +
        + + Resource +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + Life Cycle Status: + + {{sdcMenu.LifeCycleStatuses[component.lifecycleState].text}} + +
        +
        + System Name: + +
        +
        + + +
        +
        +
        +
        + + +
        +
        + + +
        +
        +
        + +

        Additional Information

        + +
        + + + + + + + + + + + +
        KeyValue
        {{additionalInformation.key}}{{additionalInformation.value}}
        +
        + +

        Properties

        +
        + + + + + + + + + + + + + +
        NameType (Constraints)Default Value
        {{property.name}}{{property.type}}{{property.defaultValue}}
        +
        + +

        Requirements

        +
        + + + + + + + + + +
        Type
        {{value[0].name}}
        +
        + + +

        Deployment Artifacts

        + +
        + + + + + + + + + + + + + + + +
        NameFileVersion
        {{artifact.artifactDisplayName}}{{artifact.artifactName}}{{artifact.artifactVersion}} + + +
        +
        + +

        Information Artifacts

        +
        + + + + + + + + + + + + + + + +
        NameFileVersion
        {{artifact.artifactDisplayName}}{{artifact.artifactName}}{{artifact.artifactVersion}} + + +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/component-viewer/properties/service-properties-view.html b/catalog-ui/app/scripts/view-models/component-viewer/properties/service-properties-view.html new file mode 100644 index 0000000000..01f872c13c --- /dev/null +++ b/catalog-ui/app/scripts/view-models/component-viewer/properties/service-properties-view.html @@ -0,0 +1,167 @@ +
        + +

        General Information

        +
        +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + Life Cycle Status: + {{sdcMenu.LifeCycleStatuses[component.lifecycleState].text}} +
        +
        + Distribution Status: + {{sdcMenu.DistributionStatuses[component.distributionStatus].text}} +
        + +
        + System Name: + +
        +
        +
        +
        + + +
        +
        + + +
        +
        +
        +

        Additional Information

        + +
        + + + + + + + + + + + +
        KeyValue
        {{additionalInformation.key}}{{additionalInformation.value}}
        +
        + +

        Inputs

        + +
        + + + + + + + + + + + + + +
        NameType (Constraints)Default Value
        {{input.name}}{{input.type}}{{input.value}}
        +
        + +

        API Artifacts

        + +
        + + + + + + + + + + + + + + + +
        NameFileVersion
        {{artifact.artifactDisplayName}}{{artifact.artifactName}}{{artifact.artifactVersion}} + + +
        +
        + +

        Deployment Artifacts

        + +
        + + + + + + + + + + + + + + + +
        NameFileVersion
        {{artifact.artifactDisplayName}}{{artifact.artifactName}}{{artifact.artifactVersion}} + + +
        +
        + + +

        Information Artifacts

        + +
        + + + + + + + + + + + + + + + +
        NameFileVersion
        {{artifact.artifactDisplayName}}{{artifact.artifactName}}{{artifact.artifactVersion}} + + +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/dashboard/cover/dashboard-cover-view-model.ts b/catalog-ui/app/scripts/view-models/dashboard/cover/dashboard-cover-view-model.ts new file mode 100644 index 0000000000..9979b6451b --- /dev/null +++ b/catalog-ui/app/scripts/view-models/dashboard/cover/dashboard-cover-view-model.ts @@ -0,0 +1,91 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + + 'use strict'; + + export interface IDashboardCoverViewModelScope extends ng.IScope { + showTutorial:boolean; + version:string; + modalInstance:ng.ui.bootstrap.IModalServiceInstance; + } + + export class DashboardCoverViewModel { + static '$inject' = [ + '$scope', + '$stateParams', + 'Sdc.Services.CacheService', + '$templateCache', + '$state', + '$modal', + 'sdcConfig' + ]; + + constructor(private $scope:IDashboardCoverViewModelScope, + private $stateParams:any, + private cacheService:Services.CacheService, + private $templateCache:ng.ITemplateCacheService, + private $state:any, + private $modal:ng.ui.bootstrap.IModalService, + private sdcConfig:Models.IAppConfigurtaion) { + + // Show the tutorial if needed when the dashboard page is opened. + // This is called from the welcome page. + if (this.$stateParams.show === 'tutorial') { + this.$scope.showTutorial = true; + } else if (this.$stateParams.show === 'whatsnew') { + this.$scope.version = this.cacheService.get('version'); + this.openWhatsNewModal(this.$scope); + } + + this.initScope(); + } + + private initScope = ():void => { + + }; + + private openWhatsNewModal = (scope:IDashboardCoverViewModelScope):void => { + + let onOk = ():void => {}; + + let onCancel = ():void => { + this.$state.go('dashboard.welcome', {show: ''}); + }; + + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get('/app/scripts/view-models/whats-new/whats-new-view.html'), + controller: 'Sdc.ViewModels.WhatsNewViewModel', + size: 'sdc-l', + backdrop: 'static', + scope: scope, + resolve: { + 'version': scope.version + } + }; + + scope.modalInstance = this.$modal.open(modalOptions); + scope.modalInstance.result.then(onOk, onCancel); + }; + + } + +} diff --git a/catalog-ui/app/scripts/view-models/dashboard/cover/dashboard-cover-view.html b/catalog-ui/app/scripts/view-models/dashboard/cover/dashboard-cover-view.html new file mode 100644 index 0000000000..c8657cba23 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/dashboard/cover/dashboard-cover-view.html @@ -0,0 +1 @@ +
        diff --git a/catalog-ui/app/scripts/view-models/dashboard/dashboard-view-model-tests.ts b/catalog-ui/app/scripts/view-models/dashboard/dashboard-view-model-tests.ts new file mode 100644 index 0000000000..d97d9bb5ec --- /dev/null +++ b/catalog-ui/app/scripts/view-models/dashboard/dashboard-view-model-tests.ts @@ -0,0 +1,276 @@ +/*- + * ============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========================================================= + */ +/// + +describe("dashboard View Model ", () => { + + let $controllerMock:ng.IControllerService; + let $qMock:ng.IQService; + let $httpBackendMock:ng.IHttpBackendService; + let $scopeMock:Sdc.ViewModels.IDashboardViewModelScope; + let $stateMock:ng.ui.IStateService; + let $stateParams:any; + let entityServiceMock; + + + let getAllEntitiesResponseMock = [ + { + "uniqueId": "855acdc7-7976-4913-9fa6-25220bd5a069", + "uuid": "8bc54f94-082c-42fa-9049-84767df3ff05", + "contactId": "qa1234", + "category": "VoIP Call Control", + "creationDate": 1447234712398, + "description": "ddddd", + "highestVersion": true, + "icon": "mobility", + "lastUpdateDate": 1447234712398, + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "distributionStatus": "DISTRIBUTION_NOT_APPROVED", + "projectCode": "233233", + "name": "mas mas mas mas mas mas mas mas mas mas mas mas ma", + "version": "0.1", + "type": 0, + "tags": [ + "mas mas mas mas mas mas mas mas mas mas mas mas ma" + ], + "systemName": "MasMasMasMasMasMasMasMasMasMasMasMasMa", + "vnf": true, + "$$hashKey": "object:30" + }, + { + "uniqueId": "4bb577ce-cb2c-4cb7-bb39-58644b5e73cb", + "uuid": "e27f4723-c9ec-4160-89da-dbf84d19a7e3", + "contactId": "qa1111", + "category": "Mobility", + "creationDate": 1447238503181, + "description": "aqa", + "highestVersion": true, + "icon": "call_controll", + "lastUpdateDate": 1447248991388, + "lastUpdaterUserId": "jm0007", + "lastUpdaterFullName": "Joni Mitchell", + "lifecycleState": "CERTIFIED", + "distributionStatus": "DISTRIBUTION_REJECTED", + "projectCode": "111111", + "name": "martin18", + "version": "1.0", + "type": 0, + "tags": [ + "martin18" + ], + "systemName": "Martin18", + "vnf": true + }, + { + "uniqueId": "f192f4a6-7fbf-42e4-a546-37509df28dc1", + "uuid": "0b77dc0d-222e-4d10-85cd-e420c9481417", + "contactId": "fd1212", + "category": "Application Layer 4+/Web Server", + "creationDate": 1447233679778, + "description": "geefw", + "highestVersion": true, + "icon": "database", + "lastUpdateDate": 1447233681582, + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "name": "ger", + "version": "0.1", + "type": 1, + "tags": [ + "ger" + ], + "vendorName": "fewwfe", + "vendorRelease": "fewew", + "systemName": "Ger", + "$$hashKey": "object:31" + }, + { + "uniqueId": "78392d08-1859-47c2-b1f2-1a35b7f8c30e", + "uuid": "8cdd63b2-6a62-4376-9012-624f424f71d4", + "contactId": "qw1234", + "category": "Application Layer 4+/Application Servers", + "creationDate": 1447234046114, + "description": "test", + "highestVersion": true, + "icon": "router", + "lastUpdateDate": 1447234050545, + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "name": "test", + "version": "0.1", + "type": 1, + "tags": [ + "test" + ], + "vendorName": "test", + "vendorRelease": "test", + "systemName": "Test", + "$$hashKey": "object:32" + }, + { + "uniqueId": "939e153d-2236-410f-b4a9-3b4bf8c79c9e", + "uuid": "84862547-4f56-4058-b78e-40df5f374d7e", + "contactId": "qw1234", + "category": "Application Layer 4+/Application Servers", + "creationDate": 1447235242560, + "description": "jlk", + "highestVersion": true, + "icon": "database", + "lastUpdateDate": 1447235328062, + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "lifecycleState": "NOT_CERTIFIED_CHECKIN", + "name": "new", + "version": "0.1", + "type": 1, + "tags": [ + "new" + ], + "vendorName": "e", + "vendorRelease": "e", + "systemName": "New", + "$$hashKey": "object:33" + }, + { + "uniqueId": "ece818e0-fd59-477a-baf6-e27461a7ce23", + "uuid": "8db823c2-6a9c-4636-8676-f5e713270dd7", + "contactId": "uf2345", + "category": "Network Layer 2-3/Router", + "creationDate": 1447235352429, + "description": "u", + "highestVersion": true, + "icon": "network", + "lastUpdateDate": 1447235370064, + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "name": "u", + "version": "0.1", + "type": 1, + "tags": [ + "u" + ], + "vendorName": "u", + "vendorRelease": "u", + "systemName": "U", + "$$hashKey": "object:34" + } + ]; + let getAllEntitiesDefered:ng.IDeferred = null; + + beforeEach(angular.mock.module('sdcApp')); + + beforeEach(angular.mock.inject((_$controller_:ng.IControllerService, + _$httpBackend_:ng.IHttpBackendService, + _$rootScope_, + _$q_:ng.IQService, + _$state_:ng.ui.IStateService, + _$stateParams_:any) => { + + $controllerMock = _$controller_; + $httpBackendMock = _$httpBackend_ + $scopeMock = _$rootScope_.$new(); + $qMock = _$q_; + $stateMock = _$state_; + $stateParams = _$stateParams_; + + + //handle all http request thet not relevant to the tests + $httpBackendMock.expectGET(/.*languages\/en_US.json.*/).respond(200, JSON.stringify({})); + // $httpBackendMock.expectGET(/.*resources\/certified\/abstract.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*rest\/version.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*configuration\/ui.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*user\/authorize.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*categories\/services.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*categories\/resources.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*categories\/products.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET('http://feHost:8181/sdc1/feProxy/rest/version').respond(200, JSON.stringify({})); + + /** + * Mock the service + * @type {any} + */ + getAllEntitiesDefered = $qMock.defer(); + getAllEntitiesDefered.resolve(getAllEntitiesResponseMock); + entityServiceMock = jasmine.createSpyObj('entityServiceMock', ['getAllComponents']); + entityServiceMock.getAllComponents.and.returnValue(getAllEntitiesDefered.promise); + + // $stateParams['show'] = ''; + + /** + * Need to inject into the controller only the objects that we want to MOCK + * those that we need to change theirs behaviors + */ + $controllerMock(Sdc.ViewModels.DashboardViewModel, { + '$scope': $scopeMock, + '$stateParams': $stateParams, + 'Sdc.Services.EntityService': entityServiceMock, + }); + + })); + + + describe("when Controller 'DashboardViewModel' created", () => { + + it('should generate all entities', () => { + $scopeMock.$apply(); + expect($scopeMock.components.length).toBe(getAllEntitiesResponseMock.length); + }); + + + it('should show tutorial page ', () => { + $stateParams.show = 'tutorial'; + + $controllerMock(Sdc.ViewModels.DashboardViewModel, { + '$scope': $scopeMock, + '$stateParams': $stateParams, + 'Sdc.Services.EntityService': entityServiceMock, + //to complete injects + }); + + $scopeMock.$apply(); + expect($scopeMock.isFirstTime).toBeTruthy(); + expect($scopeMock.showTutorial).toBeTruthy(); + }); + + }); + + + describe("when function 'entitiesCount' invoked", () => { + + beforeEach(() => { + $controllerMock(Sdc.ViewModels.DashboardViewModel, { + '$scope': $scopeMock, + 'Sdc.Services.EntityService': entityServiceMock, + }); + $scopeMock.$apply(); + }); + + it('should return entities count per folder', () => { + + }); + + + }); +}); diff --git a/catalog-ui/app/scripts/view-models/dashboard/dashboard-view-model.ts b/catalog-ui/app/scripts/view-models/dashboard/dashboard-view-model.ts new file mode 100644 index 0000000000..8325a3f133 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/dashboard/dashboard-view-model.ts @@ -0,0 +1,415 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + + 'use strict'; + import ResourceType = Sdc.Utils.Constants.ResourceType; + + export interface IDashboardViewModelScope extends ng.IScope { + + isLoading: boolean; + components: Array; + folders: FoldersMenu; + roles: Models.IConfigRoles; + user: Models.IUserProperties; + sdcConfig:Models.IAppConfigurtaion; + sdcMenu:Models.IAppMenu; + sharingService:Sdc.Services.SharingService; + showTutorial:boolean; + isFirstTime:boolean; + version:string; + checkboxesFilter:CheckboxesFilter; + + onImportVfc(file:any):void; + onImportVf(file:any):void; + openCreateModal(componentType: Utils.Constants.ComponentType, importedFile:any): void; + openWhatsNewModal(version:string):void; + openDesignerModal(isResource:boolean, uniqueId:string): void; + openViewerModal(entity:any) : void; + setSelectedFolder(folderItem: FoldersItemsMenu): void; + entitiesCount(folderItem: FoldersItemsMenu): number; + getCurrentFolderDistributed(): Array; + changeLifecycleState(entity:any, data:any): void; + goToComponent(component:Models.Components.Component):void; + wizardDebugEdit:Function; + notificationIconCallback:Function; + } + + interface CheckboxesFilter { + // Statuses + selectedStatuses:Array; + // distributed + distributed:Array; + } + + export interface IItemMenu { + + } + + export interface IMenuItemProperties { + text: string; + group: string; + state: string; + dist: string; + groupname: string; + states: Array; + } + + export class FoldersMenu { + + private _folders: Array = []; + + constructor(folders: Array) { + let self = this; + folders.forEach(function(folder: IMenuItemProperties) { + if (folder.groupname){ + self._folders.push(new FoldersItemsMenuGroup(folder)); + } else { + self._folders.push(new FoldersItemsMenu(folder)); + } + }); + self._folders[0].setSelected(true); + } + + public getFolders = (): Array => { + return this._folders; + }; + + public getCurrentFolder = (): FoldersItemsMenu => { + let menuItem: FoldersItemsMenu = undefined; + this.getFolders().forEach(function(tmpFolder: FoldersItemsMenu) { + if (tmpFolder.isSelected()){ + menuItem = tmpFolder; + } + }); + return menuItem; + }; + + public setSelected = (folder: FoldersItemsMenu):void => { + this.getFolders().forEach(function(tmpFolder: FoldersItemsMenu) { + tmpFolder.setSelected(false); + }); + folder.setSelected(true); + } + + } + + export class FoldersItemsMenu implements IItemMenu { + + public text:string; + public group: string; + public state: string; + public dist: string; + public states: Array; + + private selected: boolean = false; + + constructor(menuProperties: IMenuItemProperties) { + this.text = menuProperties.text; + this.group = menuProperties.group; + this.state = menuProperties.state; + this.states = menuProperties.states; + this.dist = menuProperties.dist; + } + + public isSelected = ():boolean => { + return this.selected; + }; + + public setSelected = (value: boolean):void => { + this.selected = value; + }; + + public isGroup = ():boolean => { + return false; + } + + } + + export class FoldersItemsMenuGroup extends FoldersItemsMenu { + + public groupname:string; + + constructor(menuProperties: IMenuItemProperties) { + super(menuProperties); + this.groupname = menuProperties.groupname; + } + + public isGroup = ():boolean => { + return true; + } + + } + + export class DashboardViewModel { + static '$inject' = [ + '$scope', + '$filter', + 'Sdc.Services.EntityService', + '$http', + 'sdcConfig', + 'sdcMenu', + '$modal', + '$templateCache', + '$state', + '$stateParams', + 'Sdc.Services.UserResourceService', + 'Sdc.Services.SharingService', + 'Sdc.Services.CacheService', + '$q', + 'ComponentFactory', + 'ChangeLifecycleStateHandler', + 'ModalsHandler', + 'MenuHandler' + ]; + + private components: Array; + + constructor(private $scope:IDashboardViewModelScope, + private $filter:ng.IFilterService, + private entityService:Services.EntityService, + private $http:ng.IHttpService, + private sdcConfig:Models.IAppConfigurtaion, + private sdcMenu:Models.IAppMenu, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService, + private $state:any, + private $stateParams:any, + private userResourceService:Sdc.Services.IUserResourceClass, + private sharingService:Services.SharingService, + private cacheService:Services.CacheService, + private $q:ng.IQService, + private ComponentFactory: Sdc.Utils.ComponentFactory, + private ChangeLifecycleStateHandler: Sdc.Utils.ChangeLifecycleStateHandler, + private ModalsHandler: Sdc.Utils.ModalsHandler, + private MenuHandler: Utils.MenuHandler + ) { + this.initScope(); + this.initFolders(); + this.initEntities(true); + + if (this.$stateParams){ + + if (this.$state.params.folder){ + let self = this; + let folderName = this.$state.params.folder.replaceAll("_"," "); + + this.$scope.folders.getFolders().forEach(function(tmpFolder: FoldersItemsMenu) { + if (tmpFolder.text === folderName){ + self.$scope.setSelectedFolder(tmpFolder); + } + }); + } + + // Show the tutorial if needed when the dashboard page is opened. + // This is called from the welcome page. + else if (this.$stateParams.show==='tutorial'){ + this.$scope.showTutorial = true; + this.$scope.isFirstTime = true; + } + } + } + + private initFolders = ():void => { + if (this.$scope.user) { + this.$scope.folders = new FoldersMenu(this.$scope.roles[this.$scope.user.role].folder); + } + }; + + private initScope = ():void => { + let self = this; + + this.$scope.version = this.cacheService.get('version'); + this.$scope.sharingService = this.sharingService; + this.$scope.isLoading = false; + this.$scope.sdcConfig = this.sdcConfig; + this.$scope.sdcMenu = this.sdcMenu; + this.$scope.user = this.userResourceService.getLoggedinUser(); + this.$scope.roles = this.sdcMenu.roles; + this.$scope.showTutorial = false; + this.$scope.isFirstTime = false; + + // Open onboarding modal + this.$scope.notificationIconCallback = ():void => { + this.ModalsHandler.openOnboadrdingModal('Import').then(()=>{ + // OK + }, ()=>{ + // ERROR + }); + }; + + // Checkboxes filter init + this.$scope.checkboxesFilter = {}; + this.$scope.checkboxesFilter.selectedStatuses = []; + this.$scope.checkboxesFilter.distributed = []; + + let appendTemplateAndControllerForProduct:Function = (modalOptions:ng.ui.bootstrap.IModalSettings, isViewer:boolean):void => { + let viewModelsHtmlBasePath:string = '/app/scripts/view-models/'; + + if (isViewer) { + modalOptions.template = this.$templateCache.get(viewModelsHtmlBasePath + 'entity-viewer/product-viewer-view.html'); + modalOptions.controller = 'Sdc.ViewModels.ResourceViewerViewModel'; + } else { + modalOptions.template = this.$templateCache.get(viewModelsHtmlBasePath + 'entity-handler/product-form/product-form-view.html'); + modalOptions.controller = 'Sdc.ViewModels.ProductFormViewModel'; + } + + }; + + this.$scope.onImportVf = (file:any):void => { + if(file && file.filename) { + // Check that the file has valid extension. + let fileExtension:string = file.filename.split(".").pop(); + if (this.sdcConfig.csarFileExtension.indexOf(fileExtension.toLowerCase()) !== -1){ + this.$state.go('workspace.general', {type:Utils.Constants.ComponentType.RESOURCE.toLowerCase(), importedFile: file, resourceType: ResourceType.VF}); + }else { + let data:Sdc.ViewModels.IClientMessageModalModel = { + title: self.$filter('translate')("NEW_SERVICE_RESOURCE_ERROR_VALID_CSAR_EXTENSIONS_TITLE"), + message: self.$filter('translate')("NEW_SERVICE_RESOURCE_ERROR_VALID_CSAR_EXTENSIONS", "{'extensions': '" + this.sdcConfig.csarFileExtension + "'}"), + severity: Utils.Constants.SEVERITY.ERROR + }; + this.ModalsHandler.openClientMessageModal(data); + } + } + }; + + this.$scope.onImportVfc = (file:any):void => { + if(file && file.filename) { + // Check that the file has valid extension. + let fileExtension:string = file.filename.split(".").pop(); + if (this.sdcConfig.toscaFileExtension.indexOf(fileExtension.toLowerCase()) !== -1){ + this.$state.go('workspace.general', {type:Utils.Constants.ComponentType.RESOURCE.toLowerCase(), importedFile: file, resourceType: ResourceType.VFC}); + }else { + let data:Sdc.ViewModels.IClientMessageModalModel = { + title: self.$filter('translate')("NEW_SERVICE_RESOURCE_ERROR_VALID_TOSCA_EXTENSIONS_TITLE"), + message: self.$filter('translate')("NEW_SERVICE_RESOURCE_ERROR_VALID_TOSCA_EXTENSIONS", "{'extensions': '" + this.sdcConfig.toscaFileExtension + "'}"), + severity: Utils.Constants.SEVERITY.ERROR + }; + this.ModalsHandler.openClientMessageModal(data); + } + } + }; + + this.$scope.openCreateModal = (componentType: string, importedFile:any):void => { + if (importedFile){ + this.initEntities(true); // Return from import + } else { + this.$state.go('workspace.general', {type:componentType.toLowerCase()}); + } + + }; + + this.$scope.entitiesCount = (folderItem: FoldersItemsMenu): any => { + let self = this; + let total: number = 0; + if (folderItem.isGroup()){ + this.$scope.folders.getFolders().forEach(function(tmpFolder: FoldersItemsMenu){ + if (tmpFolder.group && tmpFolder.group===(folderItem).groupname){ + total = total + self._getTotalCounts(tmpFolder, self); + } + }); + } else { + total = total + self._getTotalCounts(folderItem, self); + } + return total; + }; + + this.$scope.getCurrentFolderDistributed = (): Array => { + let self = this; + let states = []; + if (this.$scope.folders) { + let folderItem:FoldersItemsMenu = this.$scope.folders.getCurrentFolder(); + if (folderItem.isGroup()) { + this.$scope.folders.getFolders().forEach(function (tmpFolder:FoldersItemsMenu) { + if (tmpFolder.group && tmpFolder.group === (folderItem).groupname) { + self._setStates(tmpFolder, states); + } + }); + } else { + self._setStates(folderItem, states); + } + } + return states; + }; + + this.$scope.setSelectedFolder = (folderItem: FoldersItemsMenu):void => { + this.$scope.folders.setSelected(folderItem); + }; + + this.$scope.goToComponent = (component:Models.Components.Component):void => { + this.$scope.isLoading=true; + this.$state.go('workspace.general', {id: component.uniqueId, type:component.componentType.toLowerCase() }); + }; + + }; + + private _getTotalCounts(tmpFolder, self): number { + let total: number = 0; + if (tmpFolder.dist !== undefined) { + let distributions = tmpFolder.dist.split(','); + distributions.forEach((item:any) => { + total = total + self.getEntitiesByStateDist(tmpFolder.state, item).length; + }); + } + else { + total = total + self.getEntitiesByStateDist(tmpFolder.state, tmpFolder.dist).length; + } + return total; + } + + private _setStates(tmpFolder, states) { + if (tmpFolder.states !== undefined) { + tmpFolder.states.forEach(function (item:any) { + states.push({"state": item.state, "dist": item.dist}); + }); + } else { + states.push({"state": tmpFolder.state, "dist": tmpFolder.dist}); + } + } + + private initEntities = (reload:boolean):void => { + this.$scope.isLoading = reload; + this.entityService.getAllComponents().then( + (components: Array) => { + this.components = components; + this.$scope.components = components; + this.$scope.isLoading = false; + }); + }; + + private getEntitiesByStateDist = (state: string, dist: string) : Array => { + let gObj:Array; + if (this.components && (state || dist)) { + gObj = this.components.filter(function (obj:Models.Components.Component) { + if (dist !== undefined && obj.distributionStatus === dist && obj.lifecycleState === state){ + return true; + } else if (dist === undefined && obj.lifecycleState === state) { + return true; + } + return false; + }); + } else { + gObj = []; + } + return gObj; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/dashboard/dashboard-view.html b/catalog-ui/app/scripts/view-models/dashboard/dashboard-view.html new file mode 100644 index 0000000000..0aef4e19c6 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/dashboard/dashboard-view.html @@ -0,0 +1,106 @@ +
        + + + + + +
        + + + + +
        +
        +
        +
        + + + +
        +
        +
        + + +
        +
        +
        +
        +
        Import VFC + +
        +
        Import VSP
        +
        Import DCAE asset + +
        +
        +
        +
        + +
        +
        + +
        + +
        +
        + {{component.name | resourceName}} +
        +
        + +
        + +
        + +
        +
        + {{folder.text}} + + + + + {{entitiesCount(folder)}} +
        +
        + +
        + + + +
        +
        diff --git a/catalog-ui/app/scripts/view-models/dashboard/dashboard.less b/catalog-ui/app/scripts/view-models/dashboard/dashboard.less new file mode 100644 index 0000000000..7b2522113b --- /dev/null +++ b/catalog-ui/app/scripts/view-models/dashboard/dashboard.less @@ -0,0 +1,420 @@ +.sdc-dashboard-container { + .tlv-loader { + top: -110px; + left: 80px; + } + .sdc-hide-popover { + .popover { + display: none !important; + } + } +} + +.w-sdc-left-sidebar-nav { + margin-top: 46px; +} + +.w-sdc-main-right-container-element { + float: left; + height: 217px; + width: 217px; + margin: 10px; + position: relative; +} + +.w-sdc-main-right-container-element-details-container { + position: absolute; + top: 165px; + left: 50px; +} + +.w-sdc-main-right-container-element-name { + font-weight: bold; +} + +.w-sdc-main-right-container-element-owner { + +} + +//////////////////////////////Cards//////////////////// +.w-sdc-dashboard-card-new { + border: 2px dashed @color_m; + .border-radius(2px); + cursor: pointer; + display: inline-block; + height: 200px; + margin: 9px; + position: relative; + vertical-align: middle; + width: 204px; +} + +.w-sdc-dashboard-card-new-content { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + height: 100%; +} + +.w-sdc-dashboard-card-new-content-plus { + .sprite-new; + .add-icon; + position: relative; + margin-bottom: 20px; + + &:after { + .n_14_m; + content: 'ADD'; + position: absolute; + top: 25px; + left: -3px; + vertical-align: -50%; + } +} + +.w-sdc-dashboard-card-import-content-plus { + .sprite-new; + .import-icon; + position: relative; + margin-bottom: 20px; + + &:after { + .n_14_m; + content: 'IMPORT'; + position: absolute; + top: 25px; + left: -16px; + vertical-align: -50%; + } +} + +.sdc-dashboard-create-element-container, +.sdc-dashboard-import-element-container { + + width: 140px; + + .tlv-btn.import-dcae { + padding: 0; + } + + .tlv-btn { + position: relative; + width: 100%; + margin-bottom: 10px; + + &:last-child { + margin-bottom: 0; + } + } + + input[type="file"] { + cursor: inherit; + filter: alpha(opacity=0); + opacity: 0; + position: absolute; + top: 0; + left: 0; + width: 138px; + height: 30px; + } +} + +.w-sdc-dashboard-card { + width: 204px; + height: 200px; + background-color: @main_color_p; + .border-radius(2px); + .box-shadow(0px 2px 2px 0px rgba(24, 24, 25, 0.05)); + display: inline-block; + margin: 10px; + position: relative; + vertical-align: middle; + border: solid 1px @main_color_p; + + &:hover { + border: solid 1px @main_color_o; + .box-shadow(3px 3px 2px 0px rgba(24, 24, 25, 0.05)); + } + + &:active { + border: solid 1px @main_color_c; + .box-shadow(3px 3px 2px 0px rgba(24, 24, 25, 0.05)); + } +} + +.w-sdc-dashboard-card-body { + .hand; + border-bottom: 1px solid @color_j; + height: 155px; + position: relative; + text-align: center; +} + +.w-sdc-dashboard-card-description { + .c_3; + .hand; + background-color: rgba(57, 73, 84, 0.9); + border-radius: 4px 4px 0 0; + bottom: 0; + left: 0; + opacity: 0; + padding: 10px; + position: absolute; + right: 0; + text-align: left; + top: 0; + word-wrap: break-word; + z-index: 4; + min-height: 100px; + overflow: hidden; +} + + +.w-sdc-dashboard-card-schema { + margin-top: 30px; +} + +.w-sdc-dashboard-card-edit { + .hand; + position: absolute; + right: 13px; + top: 15px; + z-index: 2; +} + +.w-sdc-dashboard-card-footer { + padding: 3px 12px 10px 12px; + position: relative; +} + +.w-sdc-dashboard-card-avatar { + .uppercase; + border-radius: 50%; + display: inline-block; + position: absolute; + left: -6px; + text-align: center; + top: -6px; + + span { + + background-color: @main_color_p; + .border-radius(15px); + color: @color_c; + content: ''; + height: 30px; + text-align: center; + display: block; + border: solid 2px #ECEFF3; + padding: 3px 10px 2px 10px; + + &.VF { + .j_14_m; + &::before { + content: 'VF'; + } + } + + &.VFC { + .j_14_m; + &::before { + content: 'VFC'; + } + } + + &.CP { + .j_14_m; + &::before { + content: 'CP'; + } + } + + &.VL { + .j_14_m; + &::before { + content: 'VL'; + } + } + + &.SERVICE { + .c_14_m; + &::before { + content: 'S'; + } + } + + &.PRODUCT { + .b_14_m; + &::before { + content: 'P'; + } + } + + &.green { + .d_12; + &::before { + content: 'R'; + } + } + &.red { + .r_12; + &::before { + content: 'S'; + } + } + &.dblack { + .s_12; + &::before { + content: 'P'; + } + } + } +} + +.w-sdc-dashboard-card-info { + display: inline-block; + vertical-align: middle; + max-width: 165px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.w-sdc-dashboard-card-info-name-container{ + position: absolute; + bottom: 0; + left: 0; + margin: 0 0 2px 10px; +} +.w-sdc-dashboard-card-info-name { + .m_14_m; + display: inline-block; + vertical-align: middle; + max-width: 165px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.w-sdc-dashboard-card-info-lifecycleState { + .m_13_m; + display: inline-block; + vertical-align: middle; + max-width: 165px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.w-sdc-dashboard-card-info-user { + .n_13_r; + line-height: 18px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 100%; +} + +.w-sdc-dashboard-card-menu-button { + display: inline-block; + padding: 12px 0 0 10px; + position: absolute; + right: 12px; + top: 8px; + border-left: solid 1px @color_k; + height: 42px; + + &:hover { + .w-sdc-dashboard-card-menu { + display: block; + } + } +} + +.w-sdc-dashboard-card-menu { + .bg_c; + border-radius: 0 0 4px 4px; + border-top: 3px solid @color_a; + box-shadow: 0 2px 2px 0px rgba(0, 0, 0, 0.2); + color: @color_s; + display: none; + min-height: 30px; + padding: 9px 0; + position: absolute; + right: -27px; + width: 208px; + z-index: 9; + max-height: 164px; + + &::before { + //TODO: Missing image for small blue triangle. + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkE1OTIzNDI1MENFQjExRTU4ODRERTI1MDM2REZCOUYzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkE1OTIzNDI2MENFQjExRTU4ODRERTI1MDM2REZCOUYzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTU5MjM0MjMwQ0VCMTFFNTg4NERFMjUwMzZERkI5RjMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTU5MjM0MjQwQ0VCMTFFNTg4NERFMjUwMzZERkI5RjMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4gBXTlAAAAOElEQVR42mK0rp7NgASMgZgFiE/CBJjQJPcA8U4gNkdXAJMUAGJ+ZEVMaJIwAFfEhEUSRRFAgAEAVtgJyiLAPWAAAAAASUVORK5CYII='); + content: ''; + display: block; + height: 21px; + position: absolute; + right: 24px; + top: -24px; + width: 184px; + background-repeat: no-repeat; + background-position: 175px 16px; + } +} + +.i-sdc-dashboard-card-menu-item { + .hand; + line-height: 24px; + padding: 0 10px; + &:hover { .a_7; } +} + +.w-sdc-dashboard-card-info-lifecycleState-icon{ + position:absolute; + bottom:18px; + right:10px; +} + +// Same for dashboard and catalog view. +.w-sdc-dashboard-card-schema-image { + position: absolute; + top: 41%; + + //TODO: Israel - remove this after getting the services sprite. + height: 45px; + width: 53px; + background-repeat: no-repeat; + + // Center the icon vertical and horizontal. + margin: auto; + left: 0; + right: 0; + top: -10px; + bottom: 0; +} + +/* dashboard card main icons */ +.w-sdc-dashboard-card-schema-image.service { .s-sdc-service } +.w-sdc-dashboard-card-schema-image.resource { .s-sdc-resource } + +/* dashboard card statuses icons */ +.w-sdc-dashboard-card-edit.NOT_CERTIFIED_CHECKIN { .sprite; .s-sdc-state.NOT_CERTIFIED_CHECKIN; } +.w-sdc-dashboard-card-edit.NOT_CERTIFIED_CHECKOUT { .sprite; .s-sdc-state.NOT_CERTIFIED_CHECKOUT; } +.w-sdc-dashboard-card-edit.CERTIFIED { .sprite; .s-sdc-state.CERTIFIED; } +.w-sdc-dashboard-card-edit.READY_FOR_CERTIFICATION { .sprite; .s-sdc-state.READY_FOR_CERTIFICATION; } +.w-sdc-dashboard-card-edit.CERTIFICATION_IN_PROGRESS { .sprite; .s-sdc-state.CERTIFICATION_IN_PROGRESS; } +.w-sdc-dashboard-card-edit.DISTRIBUTED { .sprite; .s-sdc-state.DISTRIBUTED; } + +.w-sdc-dashboard-card-avatar.green + .w-sdc-dashboard-card-edit.NOT_CERTIFIED_CHECKIN { .sprite; .s-sdc-state.NOT_CERTIFIED_CHECKIN.green; } +.w-sdc-dashboard-card-avatar.green + .w-sdc-dashboard-card-edit.NOT_CERTIFIED_CHECKOUT { .sprite; .s-sdc-state.NOT_CERTIFIED_CHECKOUT.green; } +.w-sdc-dashboard-card-avatar.green + .w-sdc-dashboard-card-edit.CERTIFIED { .sprite; .s-sdc-state.CERTIFIED.green; } +.w-sdc-dashboard-card-avatar.green + .w-sdc-dashboard-card-edit.READY_FOR_CERTIFICATION { .sprite; .s-sdc-state.READY_FOR_CERTIFICATION.green; } +.w-sdc-dashboard-card-avatar.green + .w-sdc-dashboard-card-edit.CERTIFICATION_IN_PROGRESS { .sprite; .s-sdc-state.CERTIFICATION_IN_PROGRESS.green; } +.w-sdc-dashboard-card-avatar.green + .w-sdc-dashboard-card-edit.DISTRIBUTED { .sprite; .s-sdc-state.DISTRIBUTED.green; } + +.w-sdc-dashboard-card-avatar.red + .w-sdc-dashboard-card-edit.NOT_CERTIFIED_CHECKIN { .sprite; .s-sdc-state.NOT_CERTIFIED_CHECKIN.red; } +.w-sdc-dashboard-card-avatar.red + .w-sdc-dashboard-card-edit.NOT_CERTIFIED_CHECKOUT { .sprite; .s-sdc-state.NOT_CERTIFIED_CHECKOUT.red; } +.w-sdc-dashboard-card-avatar.red + .w-sdc-dashboard-card-edit.CERTIFIED { .sprite; .s-sdc-state.CERTIFIED.red; } +.w-sdc-dashboard-card-avatar.red + .w-sdc-dashboard-card-edit.READY_FOR_CERTIFICATION { .sprite; .s-sdc-state.READY_FOR_CERTIFICATION.red; } +.w-sdc-dashboard-card-avatar.red + .w-sdc-dashboard-card-edit.CERTIFICATION_IN_PROGRESS { .sprite; .s-sdc-state.CERTIFICATION_IN_PROGRESS.red; } +.w-sdc-dashboard-card-avatar.red + .w-sdc-dashboard-card-edit.DISTRIBUTED { .sprite; .s-sdc-state.DISTRIBUTED.red; } diff --git a/catalog-ui/app/scripts/view-models/forms/artifact-form/artifact-form-view-model.ts b/catalog-ui/app/scripts/view-models/forms/artifact-form/artifact-form-view-model.ts new file mode 100644 index 0000000000..092594b0d5 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/forms/artifact-form/artifact-form-view-model.ts @@ -0,0 +1,354 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.ViewModels { + 'use strict'; + import Resource = Sdc.Models.Components.Resource; + + export interface IEditArtifactModel { + artifactResource: Models.ArtifactModel; + artifactTypes: Array; + artifactFile: any; + } + + export interface IArtifactResourceFormViewModelScope extends ng.IScope { + forms:any; + $$childTail: any; + isNew: boolean; + isLoading: boolean; + validationPattern: RegExp; + urlValidationPattern: RegExp; + labelValidationPattern: RegExp; + integerValidationPattern: RegExp; + commentValidationPattern: RegExp; + artifactType: string; + editArtifactResourceModel: IEditArtifactModel; + defaultHeatTimeout: number; + validExtensions: any; + originalArtifactName: string; + editForm: ng.IFormController; + footerButtons: Array; + modalInstanceArtifact:ng.ui.bootstrap.IModalServiceInstance; + + fileExtensions():string; + save(doNotCloseModal?:boolean): void; + saveAndAnother(): void; + close(): void; + getOptions(): Array; + isDeploymentHeat(): boolean; + onFileChange(): void; + setDefaultTimeout(): void; + openEditEnvParametersModal(artifact:Models.ArtifactModel):void; + getFormTitle():string; + fileUploadRequired():string; + isArtifactOwner():boolean; + } + + export class ArtifactResourceFormViewModel { + + private artifactArr:Array; + + static '$inject' = [ + '$scope', + '$modalInstance', + 'artifact', + 'Sdc.Services.CacheService', + 'ValidationPattern', + 'UrlValidationPattern', + 'LabelValidationPattern', + 'IntegerValidationPattern', + 'CommentValidationPattern', + 'ValidationUtils', + '$base64', + '$state', + 'ArtifactsUtils', + '$modal', + '$templateCache', + 'component' + ]; + + private formState:Utils.Constants.FormState; + private entityId:string; + + constructor(private $scope:IArtifactResourceFormViewModelScope, + private $modalInstance:ng.ui.bootstrap.IModalServiceInstance, + private artifact:Models.ArtifactModel, + private cacheService:Services.CacheService, + private ValidationPattern:RegExp, + private UrlValidationPattern:RegExp, + private LabelValidationPattern:RegExp, + private IntegerValidationPattern : RegExp, + private CommentValidationPattern: RegExp, + private ValidationUtils: Sdc.Utils.ValidationUtils, + private $base64:any, + private $state:any, + private artifactsUtils:Sdc.Utils.ArtifactsUtils, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService, + private component:Models.Components.Component) { + + + this.entityId = this.component.uniqueId; + this.artifactArr = []; + this.formState = angular.isDefined(artifact.artifactLabel) ? Utils.Constants.FormState.UPDATE : Utils.Constants.FormState.CREATE; + this.initScope(); + } + + private initEntity = ():void => { + this.$scope.editArtifactResourceModel.artifactResource = this.artifact; + this.$scope.originalArtifactName = this.artifact.artifactName; + }; + + + private initFooterButtons = ():void =>{ + + this.$scope.footerButtons = [ + {'name': 'Done', 'css': 'blue', 'callback': this.$scope.save} + ]; + if (this.$scope.isNew){ + this.$scope.footerButtons.push( {'name': 'Add Another', 'css': 'grey', 'disabled': !this.$scope.isNew && 'deployment' === this.$scope.artifactType, 'callback': this.$scope.saveAndAnother}); + } + + }; + + + private initArtifactTypes = ():void => { + + let artifactTypes:any = this.cacheService.get('UIConfiguration'); + + if('deployment' === this.$scope.artifactType) { + + this.$scope.validExtensions = ('HEAT_ENV' == this.artifact.artifactType||this.component.selectedInstance)?//to remove the first condition? + artifactTypes.artifacts.deployment.resourceInstanceDeploymentArtifacts + : this.component.isResource() ? artifactTypes.artifacts.deployment.resourceDeploymentArtifacts + : artifactTypes.artifacts.deployment.serviceDeploymentArtifacts; + + if(this.$scope.validExtensions) { + this.$scope.editArtifactResourceModel.artifactTypes = Object.keys(this.$scope.validExtensions); + } + this.$scope.defaultHeatTimeout = artifactTypes.defaultHeatTimeout; + if(this.$scope.isNew) { + let isHeat='HEAT_ENV' == this.artifact.artifactType; + _.remove(this.$scope.editArtifactResourceModel.artifactTypes, (item:string)=> { + return 'HEAT' == item.substring(0,4)||(!isHeat && item == "VF_MODULES_METADATA") || + _.has(Utils.Constants.ArtifactType.THIRD_PARTY_RESERVED_TYPES, item); + }); + } + + }if (this.$scope.artifactType === 'normal') { + this.$scope.editArtifactResourceModel.artifactTypes = artifactTypes.artifacts.other.map((element:any)=> { + return element.name; + }); + _.remove(this.$scope.editArtifactResourceModel.artifactTypes, (item:string)=> { + return _.has(Utils.Constants.ArtifactType.THIRD_PARTY_RESERVED_TYPES, item) || + _.has(Utils.Constants.ArtifactType.TOSCA, item); + }) + } + + if(this.component.isResource() && (this.component).isCsarComponent()) { + _.remove(this.$scope.editArtifactResourceModel.artifactTypes, (item:string) => { + return this.artifactsUtils.isLicenseType(item); + }) + } + + }; + + private initEditArtifactResourceModel = ():void => { + this.$scope.editArtifactResourceModel = { + artifactResource: null, + artifactTypes: null, + artifactFile:{} + }; + + this.initEntity(); + }; + + private initScope = ():void => { + + this.$scope.validationPattern = this.ValidationPattern; + this.$scope.urlValidationPattern = this.UrlValidationPattern; + this.$scope.labelValidationPattern = this.LabelValidationPattern; + this.$scope.integerValidationPattern = this.IntegerValidationPattern; + this.$scope.commentValidationPattern = this.CommentValidationPattern; + this.$scope.isLoading = false; + this.$scope.isNew = (this.formState === Utils.Constants.FormState.CREATE); + this.$scope.artifactType = this.artifactsUtils.getArtifactTypeByState(this.$state.current.name); + this.$scope.modalInstanceArtifact = this.$modalInstance; + + this.initEditArtifactResourceModel(); + this.initArtifactTypes(); + + // In case of edit, show the file name in browse. + if (this.artifact.artifactName!=="" && 'HEAT_ENV'!==this.artifact.artifactType){ + this.$scope.editArtifactResourceModel.artifactFile = {}; + this.$scope.editArtifactResourceModel.artifactFile.filename = this.artifact.artifactName; + } + + //scope methods + this.$scope.isDeploymentHeat = ():boolean => { + return !this.$scope.isNew && this.$scope.artifactType === 'deployment' && + 'HEAT' === this.$scope.editArtifactResourceModel.artifactResource.artifactType.substring(0,4); + }; + this.$scope.onFileChange = ():void => { + if(this.$scope.editArtifactResourceModel.artifactFile && this.$scope.editArtifactResourceModel.artifactFile.filename) { + this.$scope.editArtifactResourceModel.artifactResource.artifactName = this.$scope.editArtifactResourceModel.artifactFile.filename; + } else { + this.$scope.editArtifactResourceModel.artifactResource.artifactName = this.$scope.originalArtifactName; + } + }; + this.$scope.setDefaultTimeout = ():void => { + if(this.$scope.isDeploymentHeat() && !this.$scope.editArtifactResourceModel.artifactResource.timeout) { + this.$scope.editArtifactResourceModel.artifactResource.timeout = this.$scope.defaultHeatTimeout; + } + }; + + this.$scope.fileExtensions = ():string => { + let type:string = this.$scope.editArtifactResourceModel.artifactResource.artifactType; + return type && this.$scope.validExtensions && this.$scope.validExtensions[type].acceptedTypes ? + this.$scope.validExtensions[type].acceptedTypes.join(',') : ""; + }; + + this.$scope.save = (doNotCloseModal?:boolean):void => { + this.$scope.isLoading = true; + this.$scope.editArtifactResourceModel.artifactResource.description = this.ValidationUtils.stripAndSanitize(this.$scope.editArtifactResourceModel.artifactResource.description); + + if (!this.$scope.isDeploymentHeat()) { + this.$scope.editArtifactResourceModel.artifactResource.timeout = null; + } + + if (this.$scope.editArtifactResourceModel.artifactFile) { + this.$scope.editArtifactResourceModel.artifactResource.payloadData = this.$scope.editArtifactResourceModel.artifactFile.base64; + this.$scope.editArtifactResourceModel.artifactResource.artifactName = this.$scope.editArtifactResourceModel.artifactFile.filename; + } + + let onFaild = (response):void => { + this.$scope.isLoading = false; + console.info('onFaild', response); + }; + + let onSuccess = (artifactResource:Models.ArtifactModel):void => { + this.$scope.isLoading = false; + this.$scope.originalArtifactName = ""; + + if(this.$scope.isDeploymentHeat()){ + if(artifactResource.heatParameters) { + this.$scope.openEditEnvParametersModal(artifactResource); + } + } + + if (!doNotCloseModal) { + this.$modalInstance.close(); + //this.artifactArr = []; + } else { + this.$scope.editArtifactResourceModel.artifactFile = null; + angular.element("input[type='file']").val(null); // for support chrome when upload the same file + this.artifactsUtils.addAnotherAfterSave(this.$scope); + } + + }; + + if('HEAT_ENV' == this.artifact.artifactType){ + this.component.uploadInstanceEnvFile(this.$scope.editArtifactResourceModel.artifactResource).then(onSuccess, onFaild); + }else if(this.$scope.isArtifactOwner()){ + this.component.addOrUpdateInstanceArtifact(this.$scope.editArtifactResourceModel.artifactResource).then(onSuccess, onFaild); + }else { + this.component.addOrUpdateArtifact(this.$scope.editArtifactResourceModel.artifactResource).then(onSuccess, onFaild); + } + }; + + this.$scope.isArtifactOwner = ():boolean=> { + return this.component.isService() && !!this.component.selectedInstance; + }; + + this.$scope.saveAndAnother = ():void => { + this.$scope.save(true); + }; + + this.$scope.close = ():void => { + this.$modalInstance.close(); + this.artifactArr = []; + }; + + this.$scope.fileUploadRequired = ():string => { + if (this.$scope.editArtifactResourceModel.artifactFile.filename){ + // This is edit mode + return 'false'; + } else { + return 'true'; + } + }; + + this.$scope.getFormTitle =(): string =>{ + if('HEAT_ENV' == this.artifact.artifactType){ + return 'Update HEAT ENV'; + } + if(this.$scope.isDeploymentHeat()){ + if(!this.$scope.editArtifactResourceModel.artifactResource.artifactChecksum){ + return 'Add HEAT Template'; + } + return 'Update HEAT Template'; + } + if(this.$scope.isNew){ + return 'Add Artifact'; + } + return 'Update Artifact'; + }; + + this.$scope.openEditEnvParametersModal = (artifactResource:Models.ArtifactModel):void => { + + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get('/app/scripts/view-models/forms/env-parameters-form/env-parameters-form.html'), + controller: 'Sdc.ViewModels.EnvParametersFormViewModel', + size: 'sdc-md', + backdrop: 'static', + resolve: { + artifact: ():Models.ArtifactModel => { + return artifactResource; + }, + component: ():Models.Components.Component => { + return this.component; + } + } + }; + + let modalInstance:ng.ui.bootstrap.IModalServiceInstance = this.$modal.open(modalOptions); + modalInstance + .result + .then(():void => { + }); + }; + + this.$scope.forms = {}; + + this.initFooterButtons(); + + + this.$scope.$watch("forms.editForm.$invalid", (newVal, oldVal) => { + this.$scope.footerButtons[0].disabled = this.$scope.forms.editForm.$invalid; + if(this.$scope.isNew){ + this.$scope.footerButtons[1].disabled = this.$scope.forms.editForm.$invalid; + } + }); + + } + + } +} diff --git a/catalog-ui/app/scripts/view-models/forms/artifact-form/artifact-form-view.html b/catalog-ui/app/scripts/view-models/forms/artifact-form/artifact-form-view.html new file mode 100644 index 0000000000..74a19c8776 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/forms/artifact-form/artifact-form-view.html @@ -0,0 +1,169 @@ + + + + +
        +
        + + +
        + + + +
        + + + + +
        +
        + + +
        + +
        + +
        + + + +
        + + + +
        + +
        + +
        + + + +
        + +
        + +
        + +
        + + + +
        + + + +
        + +
        + +
        + +
        + +
        + + + +
        + + + +
        + +
        + +
        + +
        + +
        + + + +
        + + + +
        + +
        + UUID +
        + Version +
        +
        + +
        + +
        + + + +
        +
        +
        + diff --git a/catalog-ui/app/scripts/view-models/forms/artifact-form/artifact-form.less b/catalog-ui/app/scripts/view-models/forms/artifact-form/artifact-form.less new file mode 100644 index 0000000000..1f77958c88 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/forms/artifact-form/artifact-form.less @@ -0,0 +1,44 @@ +.sdc-edit-artifact-form-container { + + .w-sdc-form-note { + .h_9; + display: block; + position: relative; + top: 13px; + } + + .i-sdc-form-textarea{ + min-height: 95px; + } + + .i-sdc-form-url { + padding-bottom: 0px; + } + + &.mandatory-artifact { + .w-sdc-form-column { + width: 100%; + padding: 0; + min-height: initial; + } + } + .w-sdc-form .i-sdc-form-item.upload input[type="file"] { + display: none + } + + .artifact-info { + text-align: left; + color: rgb(140, 140, 140); + font-size: 13px; + margin-top: -10px; + margin-bottom: 5px; + width: 100%; + min-height: initial; + + span { + color: #666666; + padding-left: 4px; + } + } + +} diff --git a/catalog-ui/app/scripts/view-models/forms/attribute-form/attribute-form-view.html b/catalog-ui/app/scripts/view-models/forms/attribute-form/attribute-form-view.html new file mode 100644 index 0000000000..432b32fbd3 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/forms/attribute-form/attribute-form-view.html @@ -0,0 +1,153 @@ + + +
        +
        + +
        + +
        + + +
        + + +
        + + + + +
        +
        + + +
        + + +
        + + + +
        +
        + + +
        + +
        + +
        + + +
        + +
        +
        + + +
        + + + +
        + +
        +
        + + +
        + + + +
        + + + + +
        +
        + + +
        + + +
        +
        + +
        + +
        +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/forms/attribute-form/attribute-from-view-model.ts b/catalog-ui/app/scripts/view-models/forms/attribute-form/attribute-from-view-model.ts new file mode 100644 index 0000000000..d369cfa5d1 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/forms/attribute-form/attribute-from-view-model.ts @@ -0,0 +1,255 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.ViewModels { + 'use strict'; + + export interface IEditAttributeModel { + attribute: Models.AttributeModel; + types: Array; + simpleTypes: Array; + } + + interface IAttributeFormViewModelScope extends ng.IScope { + $$childTail: any; + forms:any; + editForm:ng.IFormController; + footerButtons: Array; + isService: boolean; + editAttributeModel: IEditAttributeModel; + modalInstanceAttribute:ng.ui.bootstrap.IModalServiceInstance; + isNew: boolean; + listRegex: Sdc.Utils.IMapRegex; + mapRegex: Sdc.Utils.IMapRegex; + propertyNameValidationPattern: RegExp; + commentValidationPattern: RegExp; + isLoading: boolean; + validationPattern: RegExp; + + save():void; + close(): void; + onTypeChange():void; + onValueChange(): void; + isAttributeValueOwner():boolean; + validateIntRange(value:string):boolean; + validateUniqueKeys(viewValue:string):boolean; + getValidationTranslate(): string; + showSchema(): boolean; + isSchemaEditable(): boolean; + validateName():void; + } + + export class AttributeFormViewModel { + + static '$inject' = [ + '$scope', + '$modalInstance', + 'attribute', + 'ValidationUtils', + 'CommentValidationPattern', + 'PropertyNameValidationPattern', + 'component' + ]; + + private formState: Sdc.Utils.Constants.FormState; + + + constructor(private $scope:IAttributeFormViewModelScope, + private $modalInstance:ng.ui.bootstrap.IModalServiceInstance, + private attribute: Models.AttributeModel, + private ValidationUtils:Sdc.Utils.ValidationUtils, + private CommentValidationPattern:RegExp, + private PropertyNameValidationPattern: RegExp, + private component: Models.Components.Component) { + this.formState = angular.isDefined(attribute.name) ? Utils.Constants.FormState.UPDATE : Utils.Constants.FormState.CREATE; + this.initScope(); + } + + private initResource = ():void => { + this.$scope.editAttributeModel.attribute = new Sdc.Models.AttributeModel(this.attribute); + if (this.$scope.editAttributeModel.types.indexOf(this.attribute.type) === -1) {//attribute defaulte type is string too? + this.attribute.type = "string"; + } + }; + + private initEditAttributeModel = ():void => { + this.$scope.editAttributeModel = { + attribute: null, + types: ['integer', 'string', 'float', 'boolean', 'list', 'map'], + simpleTypes: ['integer', 'string', 'float', 'boolean'] + }; + + this.initResource(); + }; + + private initScope = ():void => { + + //scope attributes + this.$scope.forms = {}; + this.$scope.propertyNameValidationPattern = this.PropertyNameValidationPattern; + this.$scope.commentValidationPattern = this.CommentValidationPattern; + + this.$scope.modalInstanceAttribute = this.$modalInstance; + this.$scope.listRegex = this.ValidationUtils.getPropertyListPatterns(); + this.$scope.mapRegex = this.ValidationUtils.getPropertyMapPatterns(); + + this.$scope.isNew = (this.formState === Utils.Constants.FormState.CREATE); + this.$scope.isLoading = false; + + this.initEditAttributeModel(); + this.setValidationPattern(); + + //scope methods + this.$scope.save = ():void => { + if(!this.$scope.forms.editForm.$invalid){ + let attribute:Models.AttributeModel = this.$scope.editAttributeModel.attribute; + this.$scope.editAttributeModel.attribute.description = this.ValidationUtils.stripAndSanitize(this.$scope.editAttributeModel.attribute.description); + ////if read only - just closes the modal + if (this.$scope.editAttributeModel.attribute.readonly && !this.$scope.isAttributeValueOwner()) { + this.$modalInstance.close(); + return; + } + this.$scope.isLoading = true; + let onAttributeFaild = (response):void => { + console.info('onFaild', response); + this.$scope.isLoading = false; + }; + + let onAttributeSuccess = (attributeFromBE:Models.AttributeModel):void => { + console.info('onAttributeResourceSuccess : ', attributeFromBE); + this.$scope.isLoading = false; + this.$modalInstance.close(); + }; + + //in case we have uniqueId we call update method + if (this.$scope.isAttributeValueOwner()) { + this.component.updateInstanceAttribute(attribute).then(onAttributeSuccess, onAttributeFaild); + } else { + this.component.addOrUpdateAttribute(attribute).then(onAttributeSuccess, onAttributeFaild); + } + } + }; + + this.$scope.close = ():void => { + this.$modalInstance.close(); + }; + + this.$scope.validateName = ():void => { + let existsAttr: Models.AttributeModel = _.find(this.component.attributes, (attribute:Models.AttributeModel) => { + return attribute.name === this.$scope.editAttributeModel.attribute.name; + }); + if(existsAttr){ + this.$scope.forms.editForm["attributeName"].$setValidity('nameExist', false); + }else{ + this.$scope.forms.editForm["attributeName"].$setValidity('nameExist', true); + } + + }; + + this.$scope.onTypeChange = ():void => { + this.$scope.editAttributeModel.attribute.value = ''; + this.$scope.editAttributeModel.attribute.defaultValue = ''; + this.setValidationPattern(); + }; + + this.$scope.isAttributeValueOwner = ():boolean=> { + return this.component.isService() || !!this.component.selectedInstance; + }; + + this.$scope.onValueChange = ():void => { + if (!this.$scope.editAttributeModel.attribute.value) { + if (this.$scope.isAttributeValueOwner()) { + this.$scope.editAttributeModel.attribute.value = this.$scope.editAttributeModel.attribute.defaultValue; + } + } + }; + + + this.$scope.validateUniqueKeys = (viewValue:string) : boolean => { + if(this.$scope.editAttributeModel.attribute.type === 'map') { + return this.ValidationUtils.validateUniqueKeys(viewValue); + } + else { + return true; //always valid if not a map + } + }; + + this.$scope.validateIntRange = (value:string):boolean => { + return !value || this.ValidationUtils.validateIntRange(value); + }; + + this.$scope.isSchemaEditable = () :boolean => { + let schemaType=this.$scope.editAttributeModel.attribute.schema.property.type; + return this.$scope.editAttributeModel.simpleTypes.indexOf(schemaType) > -1||!schemaType; + }; + + this.$scope.showSchema = () :boolean => { + return ['list', 'map'].indexOf(this.$scope.editAttributeModel.attribute.type) > -1; + }; + + this.$scope.getValidationTranslate = () : string => { + let result = "ATTRIBUTE_EDIT_PATTERN"; + if (this.$scope.showSchema()) { + + result = "ATTRIBUTE_EDIT_" + this.$scope.editAttributeModel.attribute.type.toUpperCase(); + + if(this.$scope.editAttributeModel.attribute.schema.property.type === Utils.Constants.PROPERTY_TYPES.STRING) { + result += "_STRING"; + }else if(this.$scope.editAttributeModel.attribute.schema.property.type === Utils.Constants.PROPERTY_TYPES.BOOLEAN) { + result += "_BOOLEAN"; + } else { + result += "_GENERIC"; + } + } + + return result; + }; + + // Add the done button at the footer. + this.$scope.footerButtons = [ + {'name': 'Done', 'css':'blue', 'callback': this.$scope.save}, + {'name':'Cancel', 'css':'grey', 'callback': this.$scope.close} + ]; + + this.$scope.$watchCollection("forms.editForm.$invalid", (newVal, oldVal) => { + this.$scope.footerButtons[0].disabled = this.$scope.forms.editForm.$invalid; + }); + + } + + + private setValidationPattern = ():void => { + + if(this.$scope.editAttributeModel.attribute.type === 'list') { + this.$scope.validationPattern = this.$scope.listRegex[this.$scope.editAttributeModel.attribute.schema.property.type]; + } + else if(this.$scope.editAttributeModel.attribute.type === 'map') { + this.$scope.validationPattern = this.$scope.mapRegex[this.$scope.editAttributeModel.attribute.schema.property.type]; + } + else{ + this.$scope.validationPattern = this.ValidationUtils.getValidationPattern(this.$scope.editAttributeModel.attribute.type); + } + + }; + + + } +} diff --git a/catalog-ui/app/scripts/view-models/forms/env-parameters-form/env-parameters-form.html b/catalog-ui/app/scripts/view-models/forms/env-parameters-form/env-parameters-form.html new file mode 100644 index 0000000000..69367dc68c --- /dev/null +++ b/catalog-ui/app/scripts/view-models/forms/env-parameters-form/env-parameters-form.html @@ -0,0 +1,39 @@ + +
        +
        + +
        + +
        +
        + + + + +
        + + + +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/forms/env-parameters-form/env-parameters-form.less b/catalog-ui/app/scripts/view-models/forms/env-parameters-form/env-parameters-form.less new file mode 100644 index 0000000000..c58c94ab22 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/forms/env-parameters-form/env-parameters-form.less @@ -0,0 +1,74 @@ + +.sdc-env-form-container{ + .w-sdc-modal-body{ + padding: 20px 10px 2px 10px; + } + .w-sdc-modal-body-content{ + .b_6; + display: block; + } + + .env-file-generation-label{ + .p_9; + .bold; + margin-bottom: 20px; + } +} + +.w-sdc-env-form-container { + border-top: 1px solid #cdcdcd; + border-bottom: 1px solid #cdcdcd; + height: 356px; + margin: 35px 0 10px 0; + + .w-sdc-form { + text-align: left; + } + .i-sdc-form-item{ + display: inline-block; + .description{ + margin-bottom: 2px; + vertical-align: baseline; + padding: 32px 0 0 0; + text-transform: capitalize; + .b_1; + } + } + .left-column-container{ + width: 250px; + float: left; + .i-sdc-env-form-label { + overflow: hidden; + max-width: 100%; + text-overflow: ellipsis; + display: inline-block; + white-space: nowrap; + + &.required::before { + color: #f33; + content: '*'; + margin-right: 4px; + } + } + } + .i-sdc-env-form-label-description { + float: right; + + .i-sdc-env-form-label { + .p_9; + // height: 20px; + margin: 30px 0px 0px 30px; + overflow: hidden; + max-width: 245px; + text-overflow: ellipsis; + display: inline-block; + white-space: nowrap; + + &.required::before { + color: #f33; + content: '*'; + margin-right: 4px; + } + } + } +} diff --git a/catalog-ui/app/scripts/view-models/forms/env-parameters-form/env-parameters-form.ts b/catalog-ui/app/scripts/view-models/forms/env-parameters-form/env-parameters-form.ts new file mode 100644 index 0000000000..d1bae440cc --- /dev/null +++ b/catalog-ui/app/scripts/view-models/forms/env-parameters-form/env-parameters-form.ts @@ -0,0 +1,149 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.ViewModels { + 'use strict'; + + export interface IEnvParametersFormViewModelScope extends ng.IScope { + isLoading: boolean; + type:string; + heatParameters:any; + editForm:ng.IFormController; + artifactResource:Models.ArtifactModel; + saveButton: Array; + envParametersModal: ng.ui.bootstrap.IModalServiceInstance; + + getValidationPattern(type:string):RegExp; + isInstance():boolean; + validateJson(json:string):boolean; + close(): void; + save():void; + } + + export class EnvParametersFormViewModel { + + + static '$inject' = [ + '$scope', + '$state', + '$modalInstance', + 'artifact', + // 'ArtifactsUtils', + 'ValidationUtils', + 'component' + ]; + + + constructor(private $scope:IEnvParametersFormViewModelScope, + private $state:any, + private $modalInstance:ng.ui.bootstrap.IModalServiceInstance, + private artifact:Models.ArtifactModel, + // private artifactsUtils:Sdc.Utils.ArtifactsUtils, + private ValidationUtils: Sdc.Utils.ValidationUtils, + private component:Models.Components.Component) { + + + this.initScope(); + } + + private updateInstanceHeat = ():void => { + let success =(responseArtifact:Models.ArtifactModel): void => { + this.$scope.isLoading = false; + this.$modalInstance.close(); + }; + + let error = ():void => { + this.$scope.isLoading = false; + console.info('Failed to load save artifact'); + }; + + this.component.addOrUpdateInstanceArtifact(this.$scope.artifactResource).then(success, error); + + }; + + private initScope = ():void => { + this.$scope.envParametersModal = this.$modalInstance; + this.$scope.artifactResource= this.artifact; + this.$scope.heatParameters = angular.copy(this.artifact.heatParameters); + + this.$scope.getValidationPattern = (validationType:string , parameterType?:string):RegExp => { + return this.ValidationUtils.getValidationPattern(validationType, parameterType); + }; + + this.$scope.validateJson = (json:string):boolean => { + if(!json){ + return true; + } + return this.ValidationUtils.validateJson(json); + }; + + this.$scope.isInstance =(): boolean =>{ + return !!this.component.selectedInstance; + }; + + + this.$scope.save = ():void => { + this.$scope.isLoading = true; + this.artifact.heatParameters = this.$scope.heatParameters; + this.artifact.heatParameters.forEach((parameter:any):void => { + /* if ("" === parameter.currentValue) { + parameter.currentValue = null; + }else */ + if(!parameter.currentValue && parameter.defaultValue) { + parameter.currentValue = parameter.defaultValue; + } + }); + + if(this.$scope.isInstance()){ + this.updateInstanceHeat(); + return; + } + + let success =(responseArtifact:Models.ArtifactModel): void => { + this.$scope.isLoading = false; + this.$modalInstance.close(); + + }; + + let error = ():void => { + this.$scope.isLoading = false; + console.info('Failed to load save artifact'); + }; + + this.component.addOrUpdateArtifact(this.$scope.artifactResource).then(success, error); + }; + + this.$scope.saveButton = [ + {'name': 'Save', 'css': 'blue', 'callback': this.$scope.save} + ]; + + this.$scope.close = ():void => { + //this.artifact.heatParameters.forEach((parameter:any):void => { + // if (!parameter.currentValue && parameter.defaultValue) { + // parameter.currentValue = parameter.defaultValue; + // } + //}); + this.$modalInstance.dismiss(); + }; + + }; + } +} diff --git a/catalog-ui/app/scripts/view-models/forms/property-form/property-form-view-model.ts b/catalog-ui/app/scripts/view-models/forms/property-form/property-form-view-model.ts new file mode 100644 index 0000000000..c9732aa9a6 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/forms/property-form/property-form-view-model.ts @@ -0,0 +1,330 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.ViewModels { + 'use strict'; + + export interface IEditPropertyModel { + property: Models.PropertyModel; + types: Array; + simpleTypes: Array; + sources: Array; + } + + interface IPropertyFormViewModelScope extends ng.IScope { + forms:any; + editForm:ng.IFormController; + footerButtons: Array; + isNew: boolean; + isLoading: boolean; + isService: boolean; + validationPattern: RegExp; + propertyNameValidationPattern: RegExp; + commentValidationPattern: RegExp; + editPropertyModel: IEditPropertyModel; + modalInstanceProperty:ng.ui.bootstrap.IModalServiceInstance; + currentPropertyIndex:number; + isLastProperty:boolean; + myValue:any; + nonPrimitiveTypes:Array; + dataTypes:Models.DataTypesMap; + isTypeDataType:boolean; + maxLength:number; + + save(doNotCloseModal?:boolean): void; + getValidationPattern(type:string): RegExp; + validateIntRange(value:string):boolean; + close(): void; + onValueChange(): void; + onSchemaTypeChange():void; + onTypeChange(resetSchema:boolean): void; + isPropertyValueOwner():boolean; + showSchema(): boolean; + delete(property:Models.PropertyModel): void; + getPrev(): void; + getNext(): void; + isSimpleType(typeName:string):boolean; + getDefaultValue():any; + } + + export class PropertyFormViewModel { + + static '$inject' = [ + '$scope', + 'Sdc.Services.DataTypesService', + '$modalInstance', + 'property', + 'ValidationPattern', + 'PropertyNameValidationPattern', + 'CommentValidationPattern', + 'ValidationUtils', + 'component', + '$filter', + 'ModalsHandler', + 'filteredProperties', + '$timeout' + ]; + + private formState: Sdc.Utils.Constants.FormState; + + constructor(private $scope:IPropertyFormViewModelScope, + private DataTypesService:Sdc.Services.DataTypesService, + private $modalInstance:ng.ui.bootstrap.IModalServiceInstance, + private property: Models.PropertyModel, + private ValidationPattern:RegExp, + private PropertyNameValidationPattern: RegExp, + private CommentValidationPattern:RegExp, + private ValidationUtils:Sdc.Utils.ValidationUtils, + private component: Models.Components.Component, + private $filter:ng.IFilterService, + private ModalsHandler:Utils.ModalsHandler, + private filteredProperties: Array, + private $timeout: ng.ITimeoutService) { + + this.formState = angular.isDefined(property.name) ? Utils.Constants.FormState.UPDATE : Utils.Constants.FormState.CREATE; + this.initScope(); + } + + private initResource = ():void => { + this.$scope.editPropertyModel.property = new Sdc.Models.PropertyModel(this.property); + this.$scope.editPropertyModel.property.type = this.property.type? this.property.type: null; + this.setMaxLength(); + // if (this.$scope.editPropertyModel.types.indexOf(this.property.type) === -1 && !this.$scope.isNew) { + // this.property.type = "string"; + // } + }; + + private initEditPropertyModel = ():void => { + this.$scope.editPropertyModel = { + property: null, + types: Utils.Constants.PROPERTY_DATA.TYPES, + simpleTypes: Utils.Constants.PROPERTY_DATA.SIMPLE_TYPES, + sources: Utils.Constants.PROPERTY_DATA.SOURCES + }; + + this.initResource(); + }; + + private initForNotSimpleType = ():void => { + let property = this.$scope.editPropertyModel.property; + this.$scope.isTypeDataType=this.DataTypesService.isDataTypeForPropertyType(this.$scope.editPropertyModel.property,this.$scope.dataTypes); + if(property.type && this.$scope.editPropertyModel.simpleTypes.indexOf(property.type)==-1){ + if(!(property.value||property.defaultValue)) { + switch (property.type) { + case Utils.Constants.PROPERTY_TYPES.MAP: + this.$scope.myValue = {'':null}; + break; + case Utils.Constants.PROPERTY_TYPES.LIST: + this.$scope.myValue = []; + break; + default: + this.$scope.myValue = {}; + } + }else{ + this.$scope.myValue = JSON.parse(property.value||property.defaultValue); + } + } + }; + + private setMaxLength = ():void => { + switch (this.$scope.editPropertyModel.property.type) { + case Utils.Constants.PROPERTY_TYPES.MAP: + case Utils.Constants.PROPERTY_TYPES.LIST: + this.$scope.maxLength = this.$scope.editPropertyModel.property.schema.property.type == Utils.Constants.PROPERTY_TYPES.JSON? + Utils.Constants.PROPERTY_VALUE_CONSTRAINTS.JSON_MAX_LENGTH: + Utils.Constants.PROPERTY_VALUE_CONSTRAINTS.MAX_LENGTH; + break; + case Utils.Constants.PROPERTY_TYPES.JSON: + this.$scope.maxLength = Utils.Constants.PROPERTY_VALUE_CONSTRAINTS.JSON_MAX_LENGTH; + break; + default: + this.$scope.maxLength = Utils.Constants.PROPERTY_VALUE_CONSTRAINTS.MAX_LENGTH; + } + }; + + + private initScope = ():void => { + + //scope properties + this.$scope.forms = {}; + this.$scope.validationPattern = this.ValidationPattern; + this.$scope.propertyNameValidationPattern = this.PropertyNameValidationPattern; + this.$scope.commentValidationPattern = this.CommentValidationPattern; + this.$scope.isLoading = false; + this.$scope.isNew = (this.formState === Utils.Constants.FormState.CREATE); + this.$scope.isService = this.component.isService(); + this.$scope.modalInstanceProperty = this.$modalInstance; + this.$scope.currentPropertyIndex = _.findIndex(this.filteredProperties, i=> i.name == this.property.name ); + this.$scope.isLastProperty= this.$scope.currentPropertyIndex==(this.filteredProperties.length-1); + + this.initEditPropertyModel(); + + this.DataTypesService.getAllDataTypes().then((response:any) => { + this.$scope.dataTypes = response; + delete response['tosca.datatypes.Root']; + this.$scope.nonPrimitiveTypes =_.filter(Object.keys(response),(type:string)=>{ + return this.$scope.editPropertyModel.types.indexOf(type)==-1; + }); + this.initForNotSimpleType(); + }, (err)=> {}); + + + + + + //scope methods + this.$scope.save = (doNotCloseModal?:boolean):void => { + let property:Models.PropertyModel = this.$scope.editPropertyModel.property; + this.$scope.editPropertyModel.property.description = this.ValidationUtils.stripAndSanitize(this.$scope.editPropertyModel.property.description); + ////if read only - just closes the modal + if (this.$scope.editPropertyModel.property.readonly && !this.$scope.isPropertyValueOwner()) { + this.$modalInstance.close(); + return; + } + + this.$scope.isLoading = true; + + let onPropertyFaild = (response):void => { + console.info('onFaild', response); + this.$scope.isLoading = false; + }; + + let onPropertySuccess = (propertyFromBE:Models.PropertyModel):void => { + console.info('onPropertyResourceSuccess : ', propertyFromBE); + this.$scope.isLoading = false; + + if (!doNotCloseModal) { + this.$modalInstance.close(); + } else { + this.$scope.forms.editForm.$setPristine(); + this.$scope.editPropertyModel.property = new Models.PropertyModel(); + } + }; + + //in case we have uniqueId we call update method + if (this.$scope.isPropertyValueOwner()) { + if(!this.$scope.editPropertyModel.property.simpleType && !this.$scope.isSimpleType(property.type)){ + let myValueString:string = JSON.stringify(this.$scope.myValue); + property.value = myValueString; + } + this.component.updateInstanceProperty(property).then(onPropertySuccess, onPropertyFaild); + } else { + if(!this.$scope.editPropertyModel.property.simpleType && !this.$scope.isSimpleType(property.type)){ + let myValueString:string = JSON.stringify(this.$scope.myValue); + property.defaultValue = myValueString; + }else{ + this.$scope.editPropertyModel.property.defaultValue = this.$scope.editPropertyModel.property.value; + } + this.component.addOrUpdateProperty(property).then(onPropertySuccess, onPropertyFaild); + } + }; + + + this.$scope.isPropertyValueOwner = ():boolean=> { + return this.component.isService() || !!this.component.selectedInstance; + }; + + this.$scope.getPrev = ():void=> { + this.property = this.filteredProperties[--this.$scope.currentPropertyIndex]; + this.initResource(); + this.initForNotSimpleType(); + this.$scope.isLastProperty=false; + }; + + this.$scope.getNext = ():void=> { + this.property = this.filteredProperties[++this.$scope.currentPropertyIndex]; + this.initResource(); + this.initForNotSimpleType(); + this.$scope.isLastProperty= this.$scope.currentPropertyIndex==(this.filteredProperties.length-1); + }; + + this.$scope.isSimpleType = (typeName:string):boolean=>{ + return typeName && this.$scope.editPropertyModel.simpleTypes.indexOf(typeName)!=-1; + }; + + this.$scope.showSchema = () :boolean => { + return [Utils.Constants.PROPERTY_TYPES.LIST, Utils.Constants.PROPERTY_TYPES.MAP].indexOf(this.$scope.editPropertyModel.property.type) > -1; + }; + + this.$scope.getValidationPattern = (type:string):RegExp => { + return this.ValidationUtils.getValidationPattern(type); + }; + + this.$scope.validateIntRange = (value:string):boolean => { + return !value || this.ValidationUtils.validateIntRange(value); + }; + + this.$scope.close = ():void => { + this.$modalInstance.close(); + }; + + // put default value when instance value is empty + this.$scope.onValueChange = ():void => { + if (!this.$scope.editPropertyModel.property.value) { + if (this.$scope.isPropertyValueOwner()) { + this.$scope.editPropertyModel.property.value = this.$scope.editPropertyModel.property.defaultValue; + } + } + }; + + // Add the done button at the footer. + this.$scope.footerButtons = [ + {'name': 'Save', 'css': 'blue', 'callback': this.$scope.save }, + {'name': 'Cancel', 'css': 'grey', 'callback':this.$scope.close } + ]; + + this.$scope.$watch("forms.editForm.$invalid", (newVal, oldVal) => { + this.$scope.footerButtons[0].disabled = this.$scope.forms.editForm.$invalid; + }); + + this.$scope.getDefaultValue = ():any => { + return this.$scope.isPropertyValueOwner() ? this.$scope.editPropertyModel.property.defaultValue : null; + }; + + this.$scope.onTypeChange = ():void => { + this.$scope.editPropertyModel.property.value = ''; + this.$scope.editPropertyModel.property.defaultValue = ''; + this.setMaxLength(); + this.initForNotSimpleType(); + }; + + this.$scope.onSchemaTypeChange = ():void => { + if(this.$scope.editPropertyModel.property.type==Utils.Constants.PROPERTY_TYPES.MAP){ + this.$scope.myValue={'':null}; + }else if(this.$scope.editPropertyModel.property.type==Utils.Constants.PROPERTY_TYPES.LIST){ + this.$scope.myValue=[]; + } + this.setMaxLength(); + }; + + this.$scope.delete = (property:Models.PropertyModel):void => { + let onOk = ():void => { + this.component.deleteProperty(property.uniqueId).then( + this.$scope.close + ); + }; + let title:string = this.$filter('translate')("PROPERTY_VIEW_DELETE_MODAL_TITLE"); + let message:string = this.$filter('translate')("PROPERTY_VIEW_DELETE_MODAL_TEXT", "{'name': '" + property.name + "'}"); + this.ModalsHandler.openConfirmationModal(title, message, false).then(onOk); + }; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/forms/property-form/property-form-view.html b/catalog-ui/app/scripts/view-models/forms/property-form/property-form-view.html new file mode 100644 index 0000000000..d593d47a77 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/forms/property-form/property-form-view.html @@ -0,0 +1,219 @@ + +
        +
        + Delete + + Previous + Next +
        +
        + +
        + +
        + +
        + +
        + + +
        + + + +
        + + + +
        + +
        + + + + + +
        + +
        +
        +
        + +
        + + + +
        + +
        +
        +
        +
        + +
        + + + +
        + +
        +
        +
        +
        + + +
        + +
        + Should be constraints by type(TBD) +
        +
        + +
        + +
        + +
        + + + +
        + + + +
        +
        + + +
        + +
        + + +
        +
        +
        + +
        +
        + +
        +
        +
        + + + +
        + + + + +
        +
        +
        +
        +
        + +
        +
        +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/forms/property-form/property-form.less b/catalog-ui/app/scripts/view-models/forms/property-form/property-form.less new file mode 100644 index 0000000000..15e30af4ee --- /dev/null +++ b/catalog-ui/app/scripts/view-models/forms/property-form/property-form.less @@ -0,0 +1,63 @@ +.sdc-edit-property-container { + .scrollbar-container{ + height: 415px; + width: 830px; + .perfect-scrollbar; + } + + form{ + width: 813px; + [name="description"]{ + min-height:50px; + } + } + + .sdc-modal-top-bar{ + height: 40px; + .sdc-modal-top-bar-buttons { + float: right; + + > span:not(.delimiter){ + vertical-align: middle; + .hand; + + &.sprite-new { + text-indent: 100%; + } + &.disabled, &:hover.disabled { + pointer-events: none; + } + } + + .delete-btn{ + margin-right: 6px; + } + + .left-arrow{ + margin-right: 8px; + } + + .delimiter { + height: 20px; + width: 1px; + background-color: #959595; + display: inline-block; + vertical-align: middle; + margin-right: 10px; + } + } + } + + .w-sdc-form-note { + .h_9; + display: block; + position: relative; + top: 13px; + } + + .default-value-section{ + border-top: solid 1px @main_color_a; + padding-top: 15px; + margin-top: 15px; + } +} diff --git a/catalog-ui/app/scripts/view-models/forms/resource-instance-name-form/resource-instance-name-model.ts b/catalog-ui/app/scripts/view-models/forms/resource-instance-name-form/resource-instance-name-model.ts new file mode 100644 index 0000000000..b69bf4a2a6 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/forms/resource-instance-name-form/resource-instance-name-model.ts @@ -0,0 +1,105 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.ViewModels { + 'use strict'; + + interface IResourceInstanceViewModelScope extends ng.IScope { + + componentInstanceModel: Sdc.Models.ComponentsInstances.ComponentInstance; + validationPattern: RegExp; + oldName:string; + isAlreadyPressed:boolean; + footerButtons: Array; + forms:any; + modalInstanceName:ng.ui.bootstrap.IModalServiceInstance; + + save(): void; + close(): void; + } + + export class ResourceInstanceNameViewModel { + + static '$inject' = [ + '$scope', + 'ValidationPattern', + '$modalInstance', + 'ComponentInstanceFactory', + 'component' + ]; + + + constructor(private $scope:IResourceInstanceViewModelScope, + private ValidationPattern:RegExp, + private $modalInstance:ng.ui.bootstrap.IModalServiceInstance, + private ComponentInstanceFactory:Utils.ComponentInstanceFactory, + private component:Models.Components.Component) { + + this.initScope(); + } + + + private initScope = ():void => { + this.$scope.forms = {}; + this.$scope.validationPattern = this.ValidationPattern; + this.$scope.componentInstanceModel = Utils.ComponentInstanceFactory.createComponentInstance(this.component.selectedInstance); + this.$scope.oldName = this.component.selectedInstance.name; + this.$scope.modalInstanceName = this.$modalInstance; + + this.$scope.isAlreadyPressed = false; + + + this.$scope.close = ():void => { + this.$modalInstance.dismiss(); + }; + + this.$scope.save = ():void => { + + let onFailed = () => { + this.$scope.isAlreadyPressed = true; + }; + + let onSuccess = (componentInstance:Models.ComponentsInstances.ComponentInstance) => { + this.$modalInstance.close(); + this.$scope.isAlreadyPressed = false; + this.$scope.componentInstanceModel = componentInstance; + //this.component.name = componentInstance.name;//DE219124 + this.component.selectedInstance.name = componentInstance.name; + + }; + + this.$scope.isAlreadyPressed = true; + if (this.$scope.oldName != this.$scope.componentInstanceModel.name) { + this.component.updateComponentInstance(this.$scope.componentInstanceModel).then(onSuccess, onFailed); + } + }; + + this.$scope.footerButtons = [ + {'name': 'OK', 'css': 'blue', 'callback': this.$scope.save, 'disabled': (!this.$scope.componentInstanceModel.name || this.$scope.componentInstanceModel.name === this.$scope.oldName) || this.$scope.isAlreadyPressed}, + {'name': 'Cancel', 'css': 'grey', 'callback': this.$scope.close} + ]; + + this.$scope.$watch("forms.editNameForm.$invalid", (newVal, oldVal) => { + this.$scope.footerButtons[0].disabled = this.$scope.forms.editNameForm.$invalid; + }); + } + } +} diff --git a/catalog-ui/app/scripts/view-models/forms/resource-instance-name-form/resource-instance-name-view.html b/catalog-ui/app/scripts/view-models/forms/resource-instance-name-form/resource-instance-name-view.html new file mode 100644 index 0000000000..e04343adbd --- /dev/null +++ b/catalog-ui/app/scripts/view-models/forms/resource-instance-name-form/resource-instance-name-view.html @@ -0,0 +1,72 @@ + + +
        +
        + + + +
        + + + +
        + +
        +
        + +
        + + + + diff --git a/catalog-ui/app/scripts/view-models/forms/resource-instance-name-form/resource-instance-name.less b/catalog-ui/app/scripts/view-models/forms/resource-instance-name-form/resource-instance-name.less new file mode 100644 index 0000000000..57698bef17 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/forms/resource-instance-name-form/resource-instance-name.less @@ -0,0 +1,29 @@ +.w-sdc-modal-resource-instance-name { + + .w-sdc-modal-body { + overflow: visible; + } + + .w-sdc-modal-action { + display: flex; + align-items: center; + justify-content: center; + } + + .w-sdc-modal-resource-instance-input { + .p_1; + border: solid 1px @color_p; + height: 45px; + padding: 0 20px; + margin: 0 auto 0 auto; + display: block; + } + .w-sdc-modal-body { + border-bottom: none; + } + + .w-sdc-form .i-sdc-form-item.error::after { + top: 13px; + } + +} diff --git a/catalog-ui/app/scripts/view-models/modals/confirmation-modal/confirmation-modal-view-model.ts b/catalog-ui/app/scripts/view-models/modals/confirmation-modal/confirmation-modal-view-model.ts new file mode 100644 index 0000000000..f906593d8a --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/confirmation-modal/confirmation-modal-view-model.ts @@ -0,0 +1,96 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + export interface IConfirmationModalModel { + title: string; + message: string; + showComment: boolean; + type: Utils.Constants.ModalType; + } + + interface IConfirmationModalViewModelScope { + modalInstanceConfirmation:ng.ui.bootstrap.IModalServiceInstance; + confirmationModalModel: IConfirmationModalModel; + comment: any; + commentValidationPattern:RegExp; + editForm:ng.IFormController; + okButtonColor: string; + hideCancelButton: boolean; + ok(): any; + cancel(): void; + } + + export class ConfirmationModalViewModel { + + static '$inject' = ['$scope', '$modalInstance', 'confirmationModalModel', 'CommentValidationPattern', 'ValidationUtils', '$templateCache', '$modal']; + + constructor(private $scope:IConfirmationModalViewModelScope, + private $modalInstance:ng.ui.bootstrap.IModalServiceInstance, + confirmationModalModel:IConfirmationModalModel, + private CommentValidationPattern: RegExp, + private ValidationUtils: Sdc.Utils.ValidationUtils, + private $templateCache:ng.ITemplateCacheService, + private $modal:ng.ui.bootstrap.IModalService) { + + this.initScope(confirmationModalModel); + } + + private initScope = (confirmationModalModel:IConfirmationModalModel):void => { + let self = this; + this.$scope.hideCancelButton = false; + this.$scope.modalInstanceConfirmation = this.$modalInstance; + this.$scope.confirmationModalModel = confirmationModalModel; + this.$scope.comment = {"text": ''}; + this.$scope.commentValidationPattern = this.CommentValidationPattern; + + this.$scope.ok = ():any => { + self.$modalInstance.close(this.ValidationUtils.stripAndSanitize(self.$scope.comment.text)); + }; + + this.$scope.cancel = ():void => { + console.info('Cancel pressed on: ' + this.$scope.confirmationModalModel.title); + self.$modalInstance.dismiss(); + }; + + // Set the OK button color according to modal type (standard, error, alert) + let _okButtonColor = 'blue'; // Default + switch (confirmationModalModel.type) { + case Sdc.Utils.Constants.ModalType.STANDARD: + _okButtonColor='blue'; + break; + case Sdc.Utils.Constants.ModalType.ERROR: + _okButtonColor='red'; + break; + case Sdc.Utils.Constants.ModalType.ALERT: + this.$scope.hideCancelButton = true; + _okButtonColor='grey'; + break; + default: + _okButtonColor='blue'; + break; + } + this.$scope.okButtonColor = _okButtonColor; + + } + } +} diff --git a/catalog-ui/app/scripts/view-models/modals/confirmation-modal/confirmation-modal-view.html b/catalog-ui/app/scripts/view-models/modals/confirmation-modal/confirmation-modal-view.html new file mode 100644 index 0000000000..09c27f8cd3 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/confirmation-modal/confirmation-modal-view.html @@ -0,0 +1,29 @@ + +
        + + +
        + + +
        + + +
        +
        +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/modals/confirmation-modal/confirmation-modal.less b/catalog-ui/app/scripts/view-models/modals/confirmation-modal/confirmation-modal.less new file mode 100644 index 0000000000..666c41d5ed --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/confirmation-modal/confirmation-modal.less @@ -0,0 +1,30 @@ +.w-sdc-modal-confirmation { + form.w-sdc-form{ + padding: 0; + } + + .w-sdc-modal-body-content { + .b_6; + word-break: break-word; + + } + .w-sdc-modal-body { + height: auto; + /* padding: 47px 60px 20px 60px; */ + border-bottom: none; + } + .w-sdc-modal-body-content { + padding: 0; + } + .w-sdc-modal-body-comment { + width: 430px; + height: 127px; + border: solid 1px @color_e; + margin: 20px 0 0 0; + padding: 15px; + } + .w-sdc-modal-label { + .m_14_r; + text-align: left; + } +} diff --git a/catalog-ui/app/scripts/view-models/modals/email-modal/email-modal-view-model.ts b/catalog-ui/app/scripts/view-models/modals/email-modal/email-modal-view-model.ts new file mode 100644 index 0000000000..6430a955a6 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/email-modal/email-modal-view-model.ts @@ -0,0 +1,117 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + export interface IEmailModalModel_Email { + to: string; + subject: string; + message: string; + } + + export interface IEmailModalModel_Data { + component: Models.Components.Component; + stateUrl: string; + } + + export interface IEmailModalModel { + title: string; + email: IEmailModalModel_Email; + data: IEmailModalModel_Data; + } + + interface IEmailModalViewModelScope { + modalInstanceEmail:ng.ui.bootstrap.IModalServiceInstance; + emailModalModel: IEmailModalModel; + submitInProgress:boolean; + commentValidationPattern:RegExp; + isLoading:boolean; + submit(): any; + cancel(): void; + validateField(field:any):boolean; + } + + export class EmailModalViewModel { + + static '$inject' = ['$scope', '$filter', 'sdcConfig', '$modalInstance', 'emailModalModel', 'ValidationUtils', 'CommentValidationPattern']; + + constructor(private $scope:IEmailModalViewModelScope, + private $filter:ng.IFilterService, + private sdcConfig:Models.IAppConfigurtaion, + private $modalInstance:ng.ui.bootstrap.IModalServiceInstance, + private emailModalModel:IEmailModalModel, + private ValidationUtils: Sdc.Utils.ValidationUtils, + private CommentValidationPattern: RegExp) { + + this.initScope(emailModalModel); + } + + private initScope = (emailModalModel:IEmailModalModel):void => { + this.$scope.emailModalModel = emailModalModel; + this.$scope.submitInProgress=false; + this.$scope.commentValidationPattern = this.CommentValidationPattern; + this.$scope.modalInstanceEmail = this.$modalInstance; + + this.$scope.submit = ():any => { + + let onSuccess = (component:Models.Components.Component) => { + this.$scope.isLoading = false; + this.$scope.submitInProgress=false; + let link:string = encodeURI(this.sdcConfig.api.baseUrl + "?folder=Ready_For_Testing"); + let outlook:string = this.$filter('translate')("EMAIL_OUTLOOK_MESSAGE", "{'to': '" + emailModalModel.email.to + "','subject': '" + emailModalModel.email.subject + "','message': '" + emailModalModel.email.message + "', 'entityNameAndVersion': '" + emailModalModel.email.subject + "','link': '" + link + "'}"); + if(!this.sdcConfig.openSource) { + window.location.href=outlook; // Open outlook with the email to send + } + this.$modalInstance.close(component); // Close the dialog + }; + + let onError = () => { + this.$scope.isLoading = false; + this.$scope.submitInProgress=false; + this.$modalInstance.close(); // Close the dialog + }; + + // Submit to server + // Prevent from user pressing multiple times on submit. + if (this.$scope.submitInProgress===false) { + this.$scope.isLoading = true; + this.$scope.submitInProgress = true; + let comment:Models.AsdcComment = new Models.AsdcComment(); + comment.userRemarks = emailModalModel.email.message; + emailModalModel.data.component.changeLifecycleState(emailModalModel.data.stateUrl, comment).then(onSuccess, onError); + } + }; + + this.$scope.cancel = ():void => { + this.$modalInstance.dismiss(); + }; + + this.$scope.validateField = (field:any):boolean => { + if (field && field.$dirty && field.$invalid){ + return true; + } + return false; + }; + } + + + } +} diff --git a/catalog-ui/app/scripts/view-models/modals/email-modal/email-modal-view.html b/catalog-ui/app/scripts/view-models/modals/email-modal/email-modal-view.html new file mode 100644 index 0000000000..82293a3091 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/email-modal/email-modal-view.html @@ -0,0 +1,79 @@ + diff --git a/catalog-ui/app/scripts/view-models/modals/email-modal/email-modal.less b/catalog-ui/app/scripts/view-models/modals/email-modal/email-modal.less new file mode 100644 index 0000000000..b946a097cd --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/email-modal/email-modal.less @@ -0,0 +1,56 @@ +.w-sdc-modal-email { + + .w-sdc-modal-body { + border-bottom: none; + } + + form.w-sdc-form{ + padding: 0; + + .i-sdc-form-item { + clear: both; + label { + min-height: 30px; + padding-top: 4px; + } + + .col-sm-10 { + padding-right: 0; + } + + } + + .w-sdc-modal-body-email { + border-style: solid; + border-width: 1px; + border-color: @color_e; + box-sizing: border-box; + width: 100%; + height: 127px; + } + + label {.m_14_m; text-align: left;} + input {.m_14_r;} + textarea {.m_14_r;} + /* I made the subject and to fields as input (for future use), but for now they look like labels: */ + input:disabled { + .bg_c; + border: none; + } + } + + .w-sdc-modal-action { + background-color: @main_color_p; + padding: 0 13px 0 0; + height: 90px; + line-height: 65px; + + button {width: 174px;} + } + + .w-sdc-form .i-sdc-form-item label.required::before { + position: absolute; + left: -13px; + } + +} diff --git a/catalog-ui/app/scripts/view-models/modals/error-modal/error-403-view.html b/catalog-ui/app/scripts/view-models/modals/error-modal/error-403-view.html new file mode 100644 index 0000000000..185fcce461 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/error-modal/error-403-view.html @@ -0,0 +1,4 @@ +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/modals/error-modal/error-view-model.ts b/catalog-ui/app/scripts/view-models/modals/error-modal/error-view-model.ts new file mode 100644 index 0000000000..b8b2bfbbe7 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/error-modal/error-view-model.ts @@ -0,0 +1,43 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + interface IErrorViewModelScope{ + mailtoJson: any; + } + + export class ErrorViewModel { + + static '$inject' = ['$scope', 'Sdc.Services.CookieService', '$window', '$filter']; + + constructor($scope:IErrorViewModelScope, cookieService:Services.CookieService, $window, $filter:ng.IFilterService){ + let adminEmail:string = $filter('translate')('ADMIN_EMAIL'); + let subjectPrefix:string = $filter('translate')('EMAIL_SUBJECT_PREFIX'); + let userDetails = cookieService.getFirstName() + ' '+cookieService.getLastName() + ' ('+cookieService.getUserId() + ')'; + let line = adminEmail+'?subject='+$window.encodeURIComponent(subjectPrefix+' '+userDetails); + $scope.mailtoJson = { + "mailto": line + }; + } + + } +} diff --git a/catalog-ui/app/scripts/view-models/modals/error-modal/error.less b/catalog-ui/app/scripts/view-models/modals/error-modal/error.less new file mode 100644 index 0000000000..8297b5053d --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/error-modal/error.less @@ -0,0 +1,13 @@ +.sdc-error-403-container { + .bg_n; + width: 700px; + height: 400px; + margin: auto; + margin-top: 196px; + + .w-sdc-error-403-text { + .q_11; + margin-top: 20px; + } + +} diff --git a/catalog-ui/app/scripts/view-models/modals/message-modal/message-base-modal-model.ts b/catalog-ui/app/scripts/view-models/modals/message-modal/message-base-modal-model.ts new file mode 100644 index 0000000000..26df780d25 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/message-modal/message-base-modal-model.ts @@ -0,0 +1,64 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + export interface IMessageModalModel { + title: string; + message: string; + severity: Utils.Constants.SEVERITY; + } + + export interface IMessageModalViewModelScope extends ng.IScope { + footerButtons: Array; + messageModalModel: IMessageModalModel; + modalInstanceError:ng.ui.bootstrap.IModalServiceInstance; + ok(): void; + } + + export class MessageModalViewModel { + + constructor(private $baseScope:IMessageModalViewModelScope, + private $baseModalInstance:ng.ui.bootstrap.IModalServiceInstance, + private baseMessageModalModel:IMessageModalModel) { + + this.initScope(baseMessageModalModel); + } + + private initScope = (messageModalViewModel:IMessageModalModel):void => { + + this.$baseScope.messageModalModel = messageModalViewModel; + this.$baseScope.modalInstanceError = this.$baseModalInstance; + + this.$baseScope.ok = ():void => { + this.$baseModalInstance.close(); + }; + + this.$baseScope.footerButtons = [ + { + 'name': 'OK', + 'css': 'grey', + 'callback': this.$baseScope.ok + } + ]; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/modals/message-modal/message-client-modal/client-message-modal-view-model.ts b/catalog-ui/app/scripts/view-models/modals/message-modal/message-client-modal/client-message-modal-view-model.ts new file mode 100644 index 0000000000..82afe11fe4 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/message-modal/message-client-modal/client-message-modal-view-model.ts @@ -0,0 +1,43 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + export interface IClientMessageModalModel extends IMessageModalModel { + } + + export interface IClientMessageModalViewModelScope extends IMessageModalViewModelScope { + clientMessageModalModel: IClientMessageModalModel; + } + + export class ClientMessageModalViewModel extends MessageModalViewModel { + + static '$inject' = ['$scope', '$modalInstance', 'clientMessageModalModel']; + + constructor(private $scope:IClientMessageModalViewModelScope, + private $modalInstance:ng.ui.bootstrap.IModalServiceInstance, + private clientMessageModalModel:IClientMessageModalModel) { + + super($scope, $modalInstance, clientMessageModalModel); + } + + } +} diff --git a/catalog-ui/app/scripts/view-models/modals/message-modal/message-client-modal/client-message-modal-view.html b/catalog-ui/app/scripts/view-models/modals/message-modal/message-client-modal/client-message-modal-view.html new file mode 100644 index 0000000000..cfb0a35f69 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/message-modal/message-client-modal/client-message-modal-view.html @@ -0,0 +1,16 @@ + + + +
        +
        +
        +
        + +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/modals/message-modal/message-client-modal/client-message-modal.less b/catalog-ui/app/scripts/view-models/modals/message-modal/message-client-modal/client-message-modal.less new file mode 100644 index 0000000000..e69de29bb2 diff --git a/catalog-ui/app/scripts/view-models/modals/message-modal/message-server-modal/server-message-modal-view-model.ts b/catalog-ui/app/scripts/view-models/modals/message-modal/message-server-modal/server-message-modal-view-model.ts new file mode 100644 index 0000000000..f7a0dcfabf --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/message-modal/message-server-modal/server-message-modal-view-model.ts @@ -0,0 +1,45 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + export interface IServerMessageModalModel extends IMessageModalModel { + status: string; + messageId: string; + } + + export interface IServerMessageModalViewModelScope extends IMessageModalViewModelScope { + serverMessageModalModel: IServerMessageModalModel; + } + + export class ServerMessageModalViewModel extends MessageModalViewModel { + + static '$inject' = ['$scope', '$modalInstance', 'serverMessageModalModel']; + + constructor(private $scope:IServerMessageModalViewModelScope, + private $modalInstance:ng.ui.bootstrap.IModalServiceInstance, + private serverMessageModalModel:IServerMessageModalModel) { + + super($scope, $modalInstance, serverMessageModalModel); + } + + } +} diff --git a/catalog-ui/app/scripts/view-models/modals/message-modal/message-server-modal/server-message-modal-view.html b/catalog-ui/app/scripts/view-models/modals/message-modal/message-server-modal/server-message-modal-view.html new file mode 100644 index 0000000000..294dc76c4c --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/message-modal/message-server-modal/server-message-modal-view.html @@ -0,0 +1,17 @@ + + + +
        +
        +
        Error code: {{messageModalModel.messageId}}
        +
        Status code: {{messageModalModel.status}}
        +
        +
        +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/modals/message-modal/message-server-modal/server-message-modal.less b/catalog-ui/app/scripts/view-models/modals/message-modal/message-server-modal/server-message-modal.less new file mode 100644 index 0000000000..e69de29bb2 diff --git a/catalog-ui/app/scripts/view-models/modals/onboarding-modal/onboarding-modal-view-model.ts b/catalog-ui/app/scripts/view-models/modals/onboarding-modal/onboarding-modal-view-model.ts new file mode 100644 index 0000000000..a6e85c4abc --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/onboarding-modal/onboarding-modal-view-model.ts @@ -0,0 +1,249 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + import Resource = Sdc.Models.Components.Resource; + import ComponentFactory = Sdc.Utils.ComponentFactory; + + interface IOnboardingModalViewModelScope { + modalOnboarding: ng.ui.bootstrap.IModalServiceInstance; + componentsList: Array; + tableHeadersList: Array; + selectedComponent: Models.Components.Component; + componentFromServer: Models.Components.Component; + reverse: boolean; + sortBy: string; + searchBind: string; + okButtonText: string; + isCsarComponentExists: boolean; + user: Models.IUser; + isLoading: boolean; + + doSelectComponent(component: Models.Components.Component): void; + doUpdateCsar(): void; + doImportCsar(): void; + sort(sortBy: string): void; + downloadCsar(packageId: string): void; + } + + export class OnboardingModalViewModel { + + static '$inject' = [ + '$scope', + '$filter', + '$state', + 'sdcConfig', + '$modalInstance', + 'Sdc.Services.OnboardingService', + 'okButtonText', + 'currentCsarUUID', + 'Sdc.Services.CacheService', + 'FileUtils', + 'ComponentFactory', + 'ModalsHandler' + ]; + + constructor(private $scope: IOnboardingModalViewModelScope, + private $filter: ng.IFilterService, + private $state: any, + private sdcConfig: Models.IAppConfigurtaion, + private $modalInstance: ng.ui.bootstrap.IModalServiceInstance, + private onBoardingService: Sdc.Services.OnboardingService, + private okButtonText: string, + private currentCsarUUID: string, + private cacheService: Services.CacheService, + private fileUtils: Sdc.Utils.FileUtils, + private componentFactory: Utils.ComponentFactory, + private modalsHandler: Sdc.Utils.ModalsHandler) { + + this.init(); + } + + /** + * Called from controller constructor, this will call onboarding service to get list + * of "mini" components (empty components created from CSAR). + * The list is inserted to componentsList on $scope. + * And then call initScope method. + */ + private init = (): void => { + this.initOnboardingComponentsList(); + }; + + private initScope = (): void => { + + this.initSortedTableScope(); + this.initModalScope(); + this.$scope.sortBy = "name"; // Default sort by + this.$scope.user = this.cacheService.get('user'); + this.$scope.okButtonText = this.okButtonText; + + // Dismiss the modal and pass the "mini" component to workspace general page + this.$scope.doImportCsar = (): void => { + this.$modalInstance.dismiss(); + this.$state.go('workspace.general', { + type: Utils.Constants.ComponentType.RESOURCE.toLowerCase(), + componentCsar: this.$scope.selectedComponent + }); + }; + + this.$scope.doUpdateCsar = (): void => { + // In case user select on update the checkin and submit for testing buttons (in general page) should be disabled. + // to do that we need to pass to workspace.general state parameter to know to disable the buttons. + this.$modalInstance.close(); + // Change the component version to the CSAR version we want to update. + /*(this.$scope.componentFromServer).csarVersion = (this.$scope.selectedComponent).csarVersion; + let component:Models.Components.Component = this.componentFactory.createComponent(this.$scope.componentFromServer); + this.$state.go('workspace.general', {vspComponent: component, disableButtons: true });*/ + this.cacheService.set(Utils.Constants.CHANGE_COMPONENT_CSAR_VERSION_FLAG, (this.$scope.selectedComponent).csarVersion); + this.$state.go('workspace.general', { + id: this.$scope.componentFromServer.uniqueId, + type: this.$scope.componentFromServer.componentType.toLowerCase(), + disableButtons: true + }); + }; + + this.$scope.downloadCsar = (packageId: string): void => { + this.onBoardingService.downloadOnboardingCsar(packageId).then( + (file: any): void => { + if (file) { + this.fileUtils.downloadFile(file, packageId + '.zip'); + } + }, (): void => { + let data: Sdc.ViewModels.IServerMessageModalModel = { + title: 'Download error', + message: "Error downloading file", + severity: Utils.Constants.SEVERITY.ERROR, + messageId: "", + status: "" + }; + this.modalsHandler.openServerMessageModal(data); + } + ); + }; + + // When the user select a row, set the component as selectedComponent + this.$scope.doSelectComponent = (component: Models.Components.Component): void => { + + if (this.$scope.selectedComponent === component) { + // Collapse the item + this.$scope.selectedComponent = undefined; + return; + } + + this.$scope.isLoading = true; + this.$scope.componentFromServer = undefined; + this.$scope.selectedComponent = component; + + let onSuccess = (componentFromServer: Models.Components.Component): void => { + this.$scope.isLoading = false; + if (componentFromServer) { + this.$scope.componentFromServer = componentFromServer; + this.$scope.isCsarComponentExists = true; + } else { + this.$scope.componentFromServer = component; + this.$scope.isCsarComponentExists = false; + } + }; + + let onError = (): void => { + this.$scope.isLoading = false; + this.$scope.componentFromServer = component; + this.$scope.isCsarComponentExists = false; + }; + + this.onBoardingService.getComponentFromCsarUuid((component).csarUUID).then(onSuccess, onError); + }; + + }; + + private initSortedTableScope = (): void => { + this.$scope.tableHeadersList = [ + {title: 'Name', property: 'name'}, + {title: 'Vendor', property: 'vendorName'}, + {title: 'Category', property: 'categories'}, + {title: 'Version', property: 'csarVersion'}, + {title: '#', property: 'importAndUpdate'} + //{title: 'Date', property: 'componentDate'} + ]; + + this.$scope.sort = (sortBy: string): void => { + this.$scope.reverse = (this.$scope.sortBy === sortBy) ? !this.$scope.reverse : false; + this.$scope.sortBy = sortBy; + }; + }; + + private initModalScope = (): void => { + // Enable the modal directive to close + this.$scope.modalOnboarding = this.$modalInstance; + }; + + private initOnboardingComponentsList = (): void => { + let onSuccess = (onboardingResponse: Array): void => { + initMaxVersionOfItemsInList(onboardingResponse); + + if (this.currentCsarUUID) { + //this.$scope.componentsList = this.$filter('filter')(this.$scope.componentsList, {csarUUID: this.currentCsarUUID}); + this.$scope.componentsList = this.$filter('filter')(this.$scope.componentsList, + (input): boolean => { + return input.csarUUID === this.currentCsarUUID; + } + ); + } + this.initScope(); + }; + + let onError = (): void => { + console.log("Error getting onboarding list"); + this.initScope(); + }; + + let initMaxVersionOfItemsInList = (onboardingResponse: Array): void => { + // Get only the latest version of each item + this.$scope.componentsList = []; + + // Get all unique items from the list + let uniqueItems = _.uniqBy(onboardingResponse, 'packageId'); + + // Loop on all the items with unique packageId + _.each(uniqueItems, (item: any): void => { + // Find all the items that has same packageId + let ItemsFound: Array = _.filter(onboardingResponse, (inListItem: any): any => { + return inListItem.packageId === item.packageId; + }); + + // Loop on all the items with same packageId and find the max version. + let maxItem: any; + _.each(ItemsFound, (ItemFound: any): void => { + if (!maxItem) { + maxItem = ItemFound; + } else if (maxItem && parseInt(maxItem.csarVersion) < parseInt(ItemFound.csarVersion)) { + maxItem = ItemFound; + } + }); + this.$scope.componentsList.push(maxItem); + }); + }; + + this.onBoardingService.getOnboardingComponents().then(onSuccess, onError); + }; + + } +} diff --git a/catalog-ui/app/scripts/view-models/modals/onboarding-modal/onboarding-modal-view.html b/catalog-ui/app/scripts/view-models/modals/onboarding-modal/onboarding-modal-view.html new file mode 100644 index 0000000000..246915212c --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/onboarding-modal/onboarding-modal-view.html @@ -0,0 +1,142 @@ + + +
        +
        +

        Select one of the software product component below:

        +
        + + +
        + +
        +
        + + +
        +
        {{header.title}} + +
        +
        + + +
        + + + +
        + There are no software product component to display +
        + + +
        + + +
        + + {{component.name}} +
        + + +
        + {{component.vendorName}} +
        + + +
        + {{component.categories[0].name}} {{component.categories[0].subcategories[0].name}} +
        + + +
        + {{component.csarVersion}} +
        + + +
        + +
        + +
        + +
        +
        VSP Description:
        + {{component.description}} +
        + +
        +
        + +
        Name: {{componentFromServer.name}}
        +
        Lifecycle: {{componentFromServer.lifecycleState}}
        +
        Creator: {{componentFromServer.creatorFullName}}
        +
        +
        + +
        +
        + +
        UUID: {{componentFromServer.uuid}}
        +
        Version: {{componentFromServer.version}}
        +
        Modifier: {{componentFromServer.lastUpdaterFullName}}
        +
        + Designers cannot update a VSP if the VF is checked out by another user. +
        +
        + Designers cannot update a VSP if the VF is in Ready for testing state. +
        +
        +
        + +
        + +
        + +
        + + + + + +
        + + +
        + +
        +
        +
        +
        + + +
        diff --git a/catalog-ui/app/scripts/view-models/modals/onboarding-modal/onboarding-modal.less b/catalog-ui/app/scripts/view-models/modals/onboarding-modal/onboarding-modal.less new file mode 100644 index 0000000000..c745a86888 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/modals/onboarding-modal/onboarding-modal.less @@ -0,0 +1,148 @@ +.w-sdc-modal-onboarding { + + width: 100%; + display: inline-block; + + .general-info-button{ + position: relative; + top: -40px; + left: 86px; + float: left; + } + + .title-wrapper { + display: flex; + justify-content: space-between; + align-items: flex-end; + + .sub-title { + .m_14_r; + float:left; + } + } + + .w-sdc-classic-btn { + float: right; + margin-bottom: 10px; + } + + .table{ + height: 472px; + margin-bottom: 0; + } + + .table-container-flex { + margin-top: 10px; + + .table { + .body { + .data-row + div.item-opened { + word-wrap: break-word; + display: flex; + justify-content: space-between; + padding: 10px 0; + + .item-opened-description-title, + .item-opened-metadata-title { + .m_14_m; + } + + .item-opened-description, + .item-opened-metadata1, + .item-opened-metadata2, + .item-opened-metadata3 { + .th { .m_14_m; } + flex-basis: 0; + overflow: hidden; + padding: 5px 15px; + } + + .item-opened-description, + .item-opened-metadata3 { + border-right: 1px solid @main_color_o; + } + + .item-opened-metadata2 { + word-break: break-word; + .note { + color: @func_color_q; + } + } + + .item-opened-icon { + flex-basis: 0; + overflow: hidden; + padding: 5px 15px; + align-self: center; + } + + .item-opened-description {flex-grow: 25;} + .item-opened-metadata1 {flex-grow: 25;} + .item-opened-metadata2 {flex-grow: 30;} + .item-opened-metadata3 { + flex-grow: 10; + .info-button{ + float: right; + } + } + .item-opened-icon {flex-grow: 10;} + } + } + } + + .flex-item:nth-child(1) { + flex-grow: 25; + .hand; + span.table-arrow { + margin-right: 7px; + } + } + + .flex-item:nth-child(2) {flex-grow: 25;} + .flex-item:nth-child(3) {flex-grow: 30;} + .flex-item:nth-child(4) {flex-grow: 10; text-align: center; } + .flex-item:nth-child(5) {flex-grow: 10; } + + } + + .download-file-btn { + cursor: pointer; + margin-left: 4px; + } + + .refresh-file-btn, + .import-file-btn { + cursor: pointer; + margin-left: 20px; + } + + .top-search { + float: right; + position: relative; + + input.search-text { + .border-radius(2px); + width: 245px; + height: 32px; + line-height: 32px; + border: 1px solid @main_color_o; + margin: 0; + outline: none; + text-indent: 10px; + + &::-webkit-input-placeholder { font-style: italic; } /* Safari, Chrome and Opera */ + &:-moz-placeholder { font-style: italic; } /* Firefox 18- */ + &::-moz-placeholder { font-style: italic; } /* Firefox 19+ */ + &:-ms-input-placeholder { font-style: italic; } /* IE 10+ */ + &:-ms-input-placeholder { font-style: italic; } /* Edge */ + } + + .magnification { + position: absolute; + top: 10px; + right: 10px; + } + + } + +} diff --git a/catalog-ui/app/scripts/view-models/onboard-vendor/onboard-vendor-view-model.ts b/catalog-ui/app/scripts/view-models/onboard-vendor/onboard-vendor-view-model.ts new file mode 100644 index 0000000000..c8be2b7361 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/onboard-vendor/onboard-vendor-view-model.ts @@ -0,0 +1,148 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + export class BreadcrumbsMenuItem { + key: string; + displayText: string; + } + + export class BreadcrumbsMenu { + selectedKey: string; + menuItems: Array; + } + + export class BreadcrumbsPath { + selectedKeys: Array; + } + + export class VendorData { + breadcrumbs: BreadcrumbsPath; + } + + export interface IOnboardVendorViewModelScope extends ng.IScope { + vendorData: VendorData; + onVendorEvent: Function; + topNavMenuModel: Array; + topNavRootMenu: Utils.MenuItemGroup; + user:Models.IUserProperties; + version:string; + } + + export class OnboardVendorViewModel { + static '$inject' = [ + '$scope', + '$q', + 'Sdc.Services.CacheService' + ]; + + private firstControlledTopNavMenu: Utils.MenuItemGroup; + + constructor( + private $scope: IOnboardVendorViewModelScope, + private $q: ng.IQService, + private cacheService:Services.CacheService + ) { + + this.$scope.vendorData = { + breadcrumbs: { + selectedKeys: [] + } + }; + + this.$scope.version = this.cacheService.get('version'); + + this.$scope.onVendorEvent = (eventName:string, data:any): void => { + switch (eventName) { + case 'breadcrumbsupdated': + this.handleBreadcrumbsUpdate(data); + break; + } + }; + + this.$scope.topNavMenuModel = []; + + this.$scope.user = this.cacheService.get('user'); + } + + updateBreadcrumbsPath = (selectedKeys: Array): ng.IPromise => { + let topNavMenuModel = this.$scope.topNavMenuModel; + let startIndex = topNavMenuModel.indexOf(this.firstControlledTopNavMenu); + if (startIndex === -1) { + startIndex = topNavMenuModel.length; + } + topNavMenuModel.splice(startIndex + selectedKeys.length); + this.$scope.vendorData = { + breadcrumbs: { selectedKeys: selectedKeys } + }; + + return this.$q.when(true); + }; + + handleBreadcrumbsUpdate(breadcrumbsMenus: Array): void { + let selectedKeys = []; + let topNavMenus = breadcrumbsMenus.map((breadcrumbMenu, breadcrumbIndex) => { + let topNavMenu = new Utils.MenuItemGroup(); + topNavMenu.menuItems = breadcrumbMenu.menuItems.map(menuItem => + new Utils.MenuItem( + menuItem.displayText, + this.updateBreadcrumbsPath, + null, + null, + [selectedKeys.concat([menuItem.key])] + ) + ); + topNavMenu.selectedIndex = _.findIndex( + breadcrumbMenu.menuItems, + menuItem => menuItem.key === breadcrumbMenu.selectedKey + ); + selectedKeys.push(breadcrumbMenu.selectedKey); + return topNavMenu; + }); + + let topNavMenuModel = this.$scope.topNavMenuModel; + let len = topNavMenuModel.length; + let startIndex = topNavMenuModel.indexOf(this.firstControlledTopNavMenu); + if (startIndex === -1) { + startIndex = len; + } + topNavMenuModel.splice(startIndex, len - startIndex); + topNavMenuModel.push.apply(topNavMenuModel, topNavMenus); + this.firstControlledTopNavMenu = topNavMenus[0]; + + if (startIndex === 1 && this.$scope.topNavRootMenu == null) { + let topNavRootMenu = topNavMenuModel[0]; + let onboardItem = topNavRootMenu.menuItems[topNavRootMenu.selectedIndex]; + let originalCallback = onboardItem.callback; + onboardItem.callback = (...args) => { + let ret = this.updateBreadcrumbsPath([]); + return originalCallback && originalCallback.apply(undefined, args) || ret; + }; + this.$scope.topNavRootMenu = topNavRootMenu; + } + + this.updateBreadcrumbsPath(selectedKeys); + } + } + + +} diff --git a/catalog-ui/app/scripts/view-models/onboard-vendor/onboard-vendor-view.html b/catalog-ui/app/scripts/view-models/onboard-vendor/onboard-vendor-view.html new file mode 100644 index 0000000000..733e2d0cc0 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/onboard-vendor/onboard-vendor-view.html @@ -0,0 +1,14 @@ +
        + + + + +
        + +
        + + + +
        diff --git a/catalog-ui/app/scripts/view-models/onboard-vendor/onboard-vendor.less b/catalog-ui/app/scripts/view-models/onboard-vendor/onboard-vendor.less new file mode 100644 index 0000000000..2b43bbb321 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/onboard-vendor/onboard-vendor.less @@ -0,0 +1,303 @@ +.sdc-catalog-container { + + .i-sdc-categories-list-item { + font-weight: normal; + } + + // Checkboxes + .i-sdc-designer-leftbar-section-content-ul { + padding: 0; + margin: 0; + + .i-sdc-catalog-subcategories-checkbox { + padding: 0 0 0 20px; + margin: 0; + + .i-sdc-catalog-grouping-checkbox { + padding: 0 0 0 20px; + margin: 0; + } + + } + + } + + .i-sdc-designer-leftbar-section-content-li { + &:last-child { + .i-sdc-categories-list-item { + margin: 0; + } + } + } + + .i-sdc-categories-list-item { + display: block; + //margin-bottom: 5px; + //padding-left: 15px; + //text-indent: -24px; + vertical-align: top; + font-weight: bold; + } + + .i-sdc-subcategories-list-item { + display: block; + //padding-left: 20px; + vertical-align: top; + font-weight: normal; + margin: 0; + //text-indent: -10px; + } + + /*Added by - Ikram */ + .i-sdc-product-input, + .i-sdc-product-select { + border: 1px solid @border_color_f; + min-height: 30px; + padding: 0; + width: 100%; + margin: 1px 0; + background-color: #F2F2F2; + outline: none; + + &:disabled { + .disabled; + } + optgroup{ + color: @color_u; + option{ + color: @color_b; + } + } + } + + .i-sdc-categories-list-item-icon { + display: inline-block; + float: right; + position: relative; + right: -8px; + top: 6px; + } + + .i-sdc-categories-list-item { + margin-top: 7px; + &.NOT_CERTIFIED_CHECKOUT, + &.NOT_CERTIFIED_CHECKIN { + .i-sdc-categories-list-item-icon { + background: url('../../../styles/images/sprites/sprite-global-old.png') no-repeat -53px -2889px; + width: 14px; + height: 14px; + + } + } + + &.CERTIFIED { + .i-sdc-categories-list-item-icon { + background: url('../../../styles/images/sprites/sprite-global-old.png') no-repeat -53px -3034px; + width: 14px; + height: 16px; + } + } + + &.READY_FOR_CERTIFICATION { + .i-sdc-categories-list-item-icon { + background: url('../../../styles/images/sprites/sprite-global-old.png') no-repeat -53px -2985px; + width: 14px; + height: 16px; + } + } + + &.CERTIFICATION_IN_PROGRESS { + .i-sdc-categories-list-item-icon { + background: url('../../../styles/images/sprites/sprite-global-old.png') no-repeat -53px -2934px; + width: 14px; + height: 16px; + } + } + + &.DISTRIBUTED, + &.TBD { + .i-sdc-categories-list-item-icon { + background: url('../../../styles/images/sprites/sprite-global-old.png') no-repeat -43px -3087px; + width: 24px; + height: 14px; + + } + } + } + + .i-sdc-categories-list-input { + margin: 8px; + + } + + .i-sdc-subcategories-list-input { + + margin: 8px; + } + .i-sdc-subcategories-list-input-container { + margin: 0px 0px 0px 20px; + padding: 2px; + } + + .w-sdc-header-catalog-search-container { + display: table; + padding: 21px 0; + position: relative; + + .w-sdc-designer-leftbar-search-input { + color: #000; + width: 300px; + } + + // .magnification { + // .sprite; + // .sprite.magnification-glass; + // .hand; + // position: absolute; + // top: 40px; + // right: 42px; + // } + } + + .w-sdc-catalog-main { + padding: 10px 12px; + } + .w-sdc-dashboard-catalog-header { + .b_9; + display: inline-block; + font-style: italic; + font-weight: bold; + padding-left: 10px; + } + + .w-sdc-dashboard-catalog-header-order { + .b_9; + font-weight: 800; + } + + .w-sdc-dashboard-catalog-sort { + .b_9; + font-weight: bold; + white-space:pre; + &:hover{ + .hand; + text-decoration: none; + .a_9; + } + &.blue { + .a_9; + } + } + + .w-sdc-catalog-sort-arrow{ + display: inline-block; + &.up{ + .b_9; + width: 0; + height: 0; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid ; + } + &.down{ + .b_9; + width: 0; + height: 0; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid; + } + } + + + + + .w-sdc-dashboard-catalog-header-right{ + float: right; + display: inline-block; + padding-right:34px; + } + + .w-sdc-header-catalog-search-input { + width: 420px; + display: table-cell; + padding: 0 25px 1px 10px; + border: 1px solid #bcbcbc; + .border-radius(10px); + height: 30px; + margin: 10px 30px; + outline: none; + } + + .sdc-catalog-type-filter-container { + margin-top: -1px; + } + + .i-sdc-designer-leftbar-section-title { + text-transform: uppercase; + .l_14_m; + line-height: 30px; + } + + .i-sdc-designer-leftbar-section-title-icon { + .hand; + .tlv-sprite; + .footer-close; + transition: .3s all; + margin-top: -4px; + } + + .i-sdc-designer-leftbar-section-title-text { + margin-left: 20px; + } + + .seperator-left, + .seperator-right { + border-right: solid 1px @color_m; + display: table-cell; + width: 2px; + } + + // Rotate catalog left side arrows + .i-sdc-designer-leftbar-section-title.expanded .i-sdc-designer-leftbar-section-title-icon { + transform: rotate(180deg); + } + + // Transform catalog left side sections + .i-sdc-designer-leftbar-section-title + .i-sdc-designer-leftbar-section-content { + max-height: 0px; + margin: 0 auto; + transition: all .3s; + overflow: hidden; + padding: 0 10px 0 18px; + } + + .i-sdc-designer-leftbar-section-title.expanded + .i-sdc-designer-leftbar-section-content { + max-height: 9999px; + margin: 0 auto 1px; + transition: all .3s; + padding: 10px 18px 10px 18px; + overflow: hidden; + } + +} + +.w-sdc-search-icon{ + position: absolute; + right: 40px; + top: 40px; + &.leftbar{ + top: 19px; + right: 18px; + } + &.magnification { + .sprite; + .sprite.magnification-glass; + .hand; + } + &.cancel { + .sprite; + .sprite.clear-text; + .hand; + } +} diff --git a/catalog-ui/app/scripts/view-models/preloading/preloading-view.html b/catalog-ui/app/scripts/view-models/preloading/preloading-view.html new file mode 100644 index 0000000000..c0512dd9ec --- /dev/null +++ b/catalog-ui/app/scripts/view-models/preloading/preloading-view.html @@ -0,0 +1,9 @@ +
        +

        +

        + +
        +
        Loading...
        +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/preloading/preloading-view.less b/catalog-ui/app/scripts/view-models/preloading/preloading-view.less new file mode 100644 index 0000000000..b02ea54621 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/preloading/preloading-view.less @@ -0,0 +1,107 @@ +/* +.sdc-loading-page { + + background-color: @main_color_l; + width: 100%; + height: 100%; + + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + + h1 { + .c_5; + text-align: center; + } + + p { + display: block; + .e_4; + } + + .caption1, .caption2 { + visibility: hidden; + } + + .load-container-wrapper { + position: relative; + + .load-container { + + @background_color: #000000; + + .loader, + .loader:before, + .loader:after { + border-radius: 50%; + } + .loader:before, + .loader:after { + position: absolute; + content: ''; + } + .loader:before { + width: 5.2em; + height: 10.2em; + background: @background_color; + border-radius: 10.2em 0 0 10.2em; + top: -0.1em; + left: -0.1em; + -webkit-transform-origin: 5.2em 5.1em; + transform-origin: 5.2em 5.1em; + -webkit-animation: load2 2s infinite ease 1.5s; + animation: load2 2s infinite ease 1.5s; + } + .loader { + color: #ffffff; + font-size: 11px; + text-indent: -99999em; + margin: 0 auto; + /!*margin: 55px auto;*!/ + position: relative; + width: 10em; + height: 10em; + box-shadow: inset 0 0 0 1em; + -webkit-transform: translateZ(0); + -ms-transform: translateZ(0); + transform: translateZ(0); + } + .loader:after { + width: 5.2em; + height: 10.2em; + background: @background_color; + border-radius: 0 10.2em 10.2em 0; + top: -0.1em; + left: 5.1em; + -webkit-transform-origin: 0px 5.1em; + transform-origin: 0px 5.1em; + -webkit-animation: load2 2s infinite ease; + animation: load2 2s infinite ease; + } + @-webkit-keyframes load2 { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } + } + @keyframes load2 { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } + } + } + + } + +} +*/ diff --git a/catalog-ui/app/scripts/view-models/preloading/preloading-view.ts b/catalog-ui/app/scripts/view-models/preloading/preloading-view.ts new file mode 100644 index 0000000000..7127b70e3c --- /dev/null +++ b/catalog-ui/app/scripts/view-models/preloading/preloading-view.ts @@ -0,0 +1,47 @@ +/*- + * ============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========================================================= + */ +module Sdc.ViewModels { + 'use strict'; + + interface IPreLoadingViewScope { + startZoomIn: boolean; + } + + export class PreLoadingViewModel { + + static '$inject' = ['$scope']; + constructor(private $scope:IPreLoadingViewScope){ + this.init($scope); + } + + private init = ($scope:IPreLoadingViewScope):void => { + this.animate($('.caption1'),'fadeInUp',400); + this.animate($('.caption2'),'fadeInUp',800); + }; + + private animate = (element:any, animation:string, when:number):void => { + window.setTimeout(()=>{ + element.addClass("animated " + animation); + element[0].style="visibility: visible;"; + },when); + }; + + } +} diff --git a/catalog-ui/app/scripts/view-models/support/support-view-model.ts b/catalog-ui/app/scripts/view-models/support/support-view-model.ts new file mode 100644 index 0000000000..2142cffdda --- /dev/null +++ b/catalog-ui/app/scripts/view-models/support/support-view-model.ts @@ -0,0 +1,38 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.ViewModels { + 'use strict'; + + interface ISupportViewModelScope { + version:string; + } + + export class SupportViewModel{ + + static '$inject' = ['$scope','Sdc.Services.CacheService']; + constructor(private $scope:ISupportViewModelScope, + private cacheService:Services.CacheService){ + this.$scope.version = this.cacheService.get('version'); + } + + } +} diff --git a/catalog-ui/app/scripts/view-models/support/support-view.html b/catalog-ui/app/scripts/view-models/support/support-view.html new file mode 100644 index 0000000000..0e6d09ddd7 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/support/support-view.html @@ -0,0 +1,33 @@ +
        + +
        + +
        Support
        + +
        +
        +
        +
        +
        In Design ({{numOfCheckOutEntities+numOfCheckInEntities}})
        +
        Checked Out ({{numOfCheckOutEntities}})
        +
        Checked In ({{numOfCheckInEntities}})
        +
        +
        +
        Completed Design ({{numOfReadyForCertificationEntities+numOfCertificationInProgressEntities+numOfCertifiedEntities}})
        +
        Ready For Certification ({{numOfReadyForCertificationEntities}})
        +
        Certification In Progress ({{numOfCertificationInProgressEntities}})
        +
        Certified ({{numOfCertifiedEntities}})
        +
        +
        +
        Catalog
        +
        Support
        +
        +
        + + +
        +
        diff --git a/catalog-ui/app/scripts/view-models/support/support.less b/catalog-ui/app/scripts/view-models/support/support.less new file mode 100644 index 0000000000..8159e38320 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/support/support.less @@ -0,0 +1,8 @@ +.w-sdc-left-sidebar-in-progress, +.w-sdc-left-sidebar-following { + .b_7; +} + +.w-sdc-left-sidebar-following { + padding: 13px 0; +} diff --git a/catalog-ui/app/scripts/view-models/tabs/general-tab.less b/catalog-ui/app/scripts/view-models/tabs/general-tab.less new file mode 100644 index 0000000000..a8b4f5b9be --- /dev/null +++ b/catalog-ui/app/scripts/view-models/tabs/general-tab.less @@ -0,0 +1,131 @@ +.sdc-general-tab { + + display: flex; + min-height: 100%; + flex-flow: column; + + .sdc-edit-icon { + .sprite; + .e-sdc-small-icon-pencil; + } + .sdc-general-tab-title { + + .f-color.a; + .f-type._14_m; + padding: 0px 0px 15px 0px; + margin: 0px 20px 0px 20px; + border-bottom: 1px solid @main_color_o; + } + + .sdc-general-tab-sub-title { + + .f-color.a; + .f-type._14_m; + padding: 15px 20px 15px 20px; + + } + + //scrollbar + .general-tab-scrollbar-container { + + .perfect-scrollbar; + width: 100%; + } + + //plus minus expand collapse + .general-tab-expand-collapse { + + &.expanded { + .expand-collapse-title { + .expand-collapse-title-icon { + .expand-collapse-minus-icon; + + &:hover { + .expand-collapse-minus-icon.hover; + } + } + } + } + + .expand-collapse-title { + + padding: 8px 20px 4px 20px; + cursor: pointer; + &:hover { + background-color: @main_color_o; + } + + .expand-collapse-title-icon { + .hand; + .sprite-new; + .expand-collapse-plus-icon; + &:hover { + .expand-collapse-plus-icon.hover; + } + + } + .expand-collapse-title-text { + max-width: 225px; + display: inline-block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + padding-left: 10px; + line-height: 15px; + } + } + .selected { + background-color: @main_color_a; + .f-color.p; + } + + } + + .expand-collapse-sub-title { + max-width: 190px; + display: inline-block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + padding-left: 43px; + + } + + //resizable view + .resizable-container { + + flex: 1 1 auto; + display: flex; + flex-direction: column; + height: 90%; + + .resizable-section { + min-height: 50px; + flex: 1; + display: flex; + flex-flow: column; + &.resizable { + flex: 0 0 300px; + } + } + + //this is the resizable icon custom design for the angular resizable directive + .rg-top { + span { + margin-top: -5px; + &:before { + border-top: 1px dotted @main_color_m; + content: ''; + display: inline-block; + width: 39px; + height: 6px; + } + + border-top: 1px dotted @main_color_m; + border-bottom: 1px dotted @main_color_m; + width: 39px; + height: 4px; + } + } + } +} diff --git a/catalog-ui/app/scripts/view-models/tabs/hierarchy/hierarchy-view-model.ts b/catalog-ui/app/scripts/view-models/tabs/hierarchy/hierarchy-view-model.ts new file mode 100644 index 0000000000..bd59199eb4 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/tabs/hierarchy/hierarchy-view-model.ts @@ -0,0 +1,99 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 7/28/2016. + */ +/** + * Created by obarda on 4/4/2016. + */ +/// +module Sdc.ViewModels { + 'use strict'; + import Module = Sdc.Models.Module; + + export interface IHierarchyScope extends ng.IScope { + component:Models.Components.Component; + selectedIndex: number; + selectedModule:Models.DisplayModule; + singleTab:Models.Tab; + templateUrl:string; + isLoading:boolean; + + onModuleSelected(moduleId:string, selectedIndex: number):void; + onModuleNameChanged(module:Models.DisplayModule):void; + updateHeatName():void; + } + + export class HierarchyViewModel { + + static '$inject' = [ + '$scope' + ]; + + constructor(private $scope:IHierarchyScope) { + this.$scope.component = this.$scope.singleTab.data; + this.$scope.isLoading = false; + this.initScopeMethods(); + } + + private initScopeMethods():void { + + this.$scope.templateUrl = '/app/scripts/view-models/tabs/hierarchy/edit-module-name-popover.html'; + this.$scope.onModuleSelected = (moduleId:string, selectedIndex: number):void => { + + let onSuccess = (module:Models.DisplayModule) => { + console.log("Module Loaded: ", module); + this.$scope.selectedModule = module; + this.$scope.isLoading = false; + }; + + let onFailed = () => { + this.$scope.isLoading = false; + }; + + this.$scope.selectedIndex = selectedIndex; + if( !this.$scope.selectedModule || (this.$scope.selectedModule && this.$scope.selectedModule.uniqueId != moduleId)) { + this.$scope.isLoading = true; + this.$scope.component.getModuleForDisplay(moduleId).then(onSuccess, onFailed); + } + }; + + this.$scope.updateHeatName = () => { + this.$scope.isLoading = true; + + let originalName:string = this.$scope.selectedModule.name; + + let onSuccess = (module:Models.Module) => { + console.log("Module name updated:", module.name); + this.$scope.selectedModule.name = module.name; + this.$scope.isLoading = false; + }; + + let onFailed = () => { + this.$scope.isLoading = false; + this.$scope.selectedModule.name = originalName; + }; + + this.$scope.selectedModule.updateName(); + this.$scope.component.updateGroupMetadata(new Models.DisplayModule(this.$scope.selectedModule)).then(onSuccess, onFailed); + }; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/tabs/hierarchy/hierarchy-view.html b/catalog-ui/app/scripts/view-models/tabs/hierarchy/hierarchy-view.html new file mode 100644 index 0000000000..971105c191 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/tabs/hierarchy/hierarchy-view.html @@ -0,0 +1,57 @@ +
        + +
        +
        {{component.name}}
        + +
        +
        + + + +
        +
        + + +
        +
        + +
        +
        +
        {{memberName}}
        +
        +
        +
        +
        + +
        + +
        +
        +
        {{selectedModule.name}}
        +
        + +
        +
        +
        Module ID: {{selectedModule.groupUUID}}
        +
        Invariant UUID: {{selectedModule.invariantUUID}}
        +
        Version: {{selectedModule.version}}
        +
        IsBase: {{selectedModule.isBase}}
        + +
        +
        +
        +
        {{artifact.artifactName}}
        +
        UUID: {{artifact.artifactUUID}}
        +
        Version: {{artifact.artifactVersion}}
        +
        +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/tabs/hierarchy/hierarchy.less b/catalog-ui/app/scripts/view-models/tabs/hierarchy/hierarchy.less new file mode 100644 index 0000000000..5e8572678d --- /dev/null +++ b/catalog-ui/app/scripts/view-models/tabs/hierarchy/hierarchy.less @@ -0,0 +1,71 @@ +.hierarchy-tab{ + + .hierarchy-module-list-container{ + padding: 0px 20px 0px 20px; + } + .module-data-container{ + + width: 100%; + height: 100%; + background-color: #e6f6fb; + border: 1px solid #009fdb; + border-top: 4px solid #009fdb; + box-shadow: 0.3px 1px 2px rgba(24, 24, 25, 0.32); + + .module-data { + + .selectable; + .module-name { + .f-type._14_m; + width: 87%; + } + .f-type._14_r; + .f-color.a; + padding: 10px 0px 10px 0px; + margin: 0px 20px 0px 20px; + border-bottom: 1px solid rgba(0, 159, 219, 0.6); + } + + .artifact-data{ + .selectable; + .f-type._12_r; + .f-color.m; + + padding: 10px 0px 10px 0px; + margin: 0px 20px 0px 20px; + border-bottom: 1px solid rgba(0, 159, 219, 0.6); + .artifact-name { + .f-type._14_r; + font-weight: bold; + } + } + + .module-text-overflow { + max-width: 240px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + display: inline-block; + } + } + + + .hierarchy-module-member-list { + overflow: hidden; + } + + .edit-name-container { + float: right; + border-left: 1px solid #5cc1e7; + height: 20px; + width: 12%; + + .sdc-edit-icon { + float: right; + cursor: pointer; + position: relative; + top: 4px; + right: 5px; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/tutorial-end/tutorial-end.html b/catalog-ui/app/scripts/view-models/tutorial-end/tutorial-end.html new file mode 100644 index 0000000000..6e478fc471 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/tutorial-end/tutorial-end.html @@ -0,0 +1,10 @@ +
        + +

        +

        +
        + + +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/tutorial-end/tutorial-end.less b/catalog-ui/app/scripts/view-models/tutorial-end/tutorial-end.less new file mode 100644 index 0000000000..71648a4f86 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/tutorial-end/tutorial-end.less @@ -0,0 +1,41 @@ +.sdc-tutorial-end-page { + + .bg_s; + width: 100%; + height: 100%; + position: absolute; + top: 0; + left: 0; + z-index: 999; + .opacity(0.8); + display: flex; + align-items: center; + + background-image: url('../../../styles/images/welcome.png'); + background-repeat: no-repeat; + background-position: bottom left; + + .sdc-tutorial-end-page-main { + width: 600px; + height: 400px; + margin: 100px auto 100px auto; + padding: 80px; + } + + h2 { + .t_15; + margin: 0; + } + + .sdc-tutorial-end-page-description1 { + .c_2; + .opacity(0.8); + margin-top: 10px; + line-height: 22px; + } + + .w-sdc-btn-blue { + margin: 40px 10px 0 0; + } + +} diff --git a/catalog-ui/app/scripts/view-models/tutorial-end/tutorial-end.ts b/catalog-ui/app/scripts/view-models/tutorial-end/tutorial-end.ts new file mode 100644 index 0000000000..411d3f8d24 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/tutorial-end/tutorial-end.ts @@ -0,0 +1,42 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + interface ITutorialEndViewModelScope extends ng.IScope {} + + export class TutorialEndViewModel { + + static '$inject' = [ + '$scope' + ]; + constructor( + private $scope:ITutorialEndViewModelScope + ){ + this.init(); + } + + private init = ():void => { + + } + + } +} diff --git a/catalog-ui/app/scripts/view-models/welcome/slide0.html b/catalog-ui/app/scripts/view-models/welcome/slide0.html new file mode 100644 index 0000000000..48d37215a4 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/welcome/slide0.html @@ -0,0 +1,50 @@ +
        +
        +
        + +
        + +
        +
        + +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/welcome/slide1.html b/catalog-ui/app/scripts/view-models/welcome/slide1.html new file mode 100644 index 0000000000..9252026a6b --- /dev/null +++ b/catalog-ui/app/scripts/view-models/welcome/slide1.html @@ -0,0 +1,34 @@ +
        +
        +
        + + +
        + + + +
        +
        + + + +

        Welcome to SDC

        + +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/welcome/slide2.html b/catalog-ui/app/scripts/view-models/welcome/slide2.html new file mode 100644 index 0000000000..4329bf462d --- /dev/null +++ b/catalog-ui/app/scripts/view-models/welcome/slide2.html @@ -0,0 +1,26 @@ +
        +
        +
        +
        + Innovate
        + network- design
        + platform
        +
        +
        +

        + Adapt swiftly to the constant demands placed on
        networks by ongoing technological advances. +

        +

        + Using ASDC’s innovative network-design platform,
        quickly and easily create and share software +
        + components. +

        +
        +
        +
        + 01 +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/welcome/slide3.html b/catalog-ui/app/scripts/view-models/welcome/slide3.html new file mode 100644 index 0000000000..dd5448beac --- /dev/null +++ b/catalog-ui/app/scripts/view-models/welcome/slide3.html @@ -0,0 +1,27 @@ +
        +
        + +
        +
        + Enhance
        + and extend +
        +
        +

        + Blend, build and arrange resources and services in the
        designer workspace. +

        +

        + Let your creativity lead the way to any number of
        network solutions. +

        +

        + Then simply click on elements to customize and refine
        their specific properties to match your needs. +

        +
        +
        +
        + 02 +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/welcome/slide4.html b/catalog-ui/app/scripts/view-models/welcome/slide4.html new file mode 100644 index 0000000000..1428ce5375 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/welcome/slide4.html @@ -0,0 +1,29 @@ +
        +
        +
        +
        + Share
        + and Collaborate +
        +
        +

        + Graphically arranged, the Catalog is an easily
        searchable collection of resources, services and +
        products that provides you with a variety of
        network elements. +

        +

        + Benefit from these assets by using them as
        building blocks to form any number of network +
        solutions. +

        +

        + After being certified for release, share and
        collaborate with others as your solution is +
        automatically included in the catalog. +

        +
        +
        +
        + 03 +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/welcome/slide5.html b/catalog-ui/app/scripts/view-models/welcome/slide5.html new file mode 100644 index 0000000000..913573c8fc --- /dev/null +++ b/catalog-ui/app/scripts/view-models/welcome/slide5.html @@ -0,0 +1,27 @@ +
        +
        +
        +
        + Fast, efficient
        + and reliable +
        +
        +

        + ASDC is a platform built around a simple error-free +
        process for resource and service design and distribution. +
        +
        An integrated certification process makes ASDC a safe +
        and reliable environment to experiment, review and test +
        your work. +
        +
        Once approved your solution is ready to be used in +
        the real-world. +

        + +
        + +
        +
        + +
        +
        diff --git a/catalog-ui/app/scripts/view-models/welcome/slide6.html b/catalog-ui/app/scripts/view-models/welcome/slide6.html new file mode 100644 index 0000000000..22006f7f82 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/welcome/slide6.html @@ -0,0 +1,26 @@ +
        +
        + +
        +
        + +
        ASDC
        +
        + jump starting your network solutions. +
        +
        + Home +
        +
        + + + +
        +
        diff --git a/catalog-ui/app/scripts/view-models/welcome/welcome-steps-controller.ts b/catalog-ui/app/scripts/view-models/welcome/welcome-steps-controller.ts new file mode 100644 index 0000000000..816afcf2d2 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/welcome/welcome-steps-controller.ts @@ -0,0 +1,74 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + export interface IWelcomeStepsController { + video_mp4: string; + video_ogg: string; + onPlayVideo: Function; + } + + export class WelcomeStepsControllerViewModel { + + static '$inject' = [ + '$scope', + '$sce', + 'sdcConfig', + '$state', + '$filter' + ]; + + constructor( + private $scope:IWelcomeStepsController, + private $sce:any, + private sdcConfig: Models.IAppConfigurtaion, + private $state:ng.ui.IStateService, + private $filter:ng.IFilterService + ){ + this.init(); + this.initScope(); + } + + private init = ():void => { + + }; + + private initScope = ():void => { + + this.$scope.onPlayVideo = ():void => { + //console.log("onPlayVideo"); + $("#sdc-page-scroller").removeClass("animated fadeIn"); + $("#sdc-page-scroller").addClass("animated fadeOut"); + window.setTimeout(()=>{$("#sdc-page-scroller").css("display","none");},500); + + $("#sdc-welcome-video-wrapper").removeClass("animated fadeOut"); + $("#sdc-welcome-video-wrapper").addClass("animated fadeIn"); + window.setTimeout(()=>{$("#sdc-welcome-video-wrapper").css("display","block");},0); + + let videoElement:any = $("#asdc-welcome-video")[0]; + videoElement.play(); + }; + + }; + + } +} diff --git a/catalog-ui/app/scripts/view-models/welcome/welcome-view.html b/catalog-ui/app/scripts/view-models/welcome/welcome-view.html new file mode 100644 index 0000000000..ba41e88a4e --- /dev/null +++ b/catalog-ui/app/scripts/view-models/welcome/welcome-view.html @@ -0,0 +1,22 @@ +
        + + + +
        Welcome to SDC
        + + +
        diff --git a/catalog-ui/app/scripts/view-models/welcome/welcome-view.ts b/catalog-ui/app/scripts/view-models/welcome/welcome-view.ts new file mode 100644 index 0000000000..0a0c923481 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/welcome/welcome-view.ts @@ -0,0 +1,267 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + export interface IWelcomeViewMode { + slides:Array; + onCloseButton():void; + onCloseVideoButton():void; + + video_mp4: string; + video_ogg: string; + } + + export class WelcomeViewModel { + + firstLoad:boolean = true; + alreadyAnimated:Array = []; + + static '$inject' = [ + '$scope', + '$sce', + 'sdcConfig', + '$state', + '$filter' + ]; + + constructor( + private $scope:IWelcomeViewMode, + private $sce:any, + private sdcConfig: Models.IAppConfigurtaion, + private $state:ng.ui.IStateService, + private $filter:ng.IFilterService + ){ + /*this.init(); + this.initScope(); + window.setTimeout(():void => { + this.loadImages(():void=> { + window.setTimeout(():void =>{ + $(".sdc-welcome-new-page").addClass("animated fadeIn"); + this.animateGeneral(); + this.animate1(); + },1000); + }); + },0);*/ + } + + private initScope = ():void => { + + this.$scope.onCloseButton = ():void => { + //console.log("onCloseButton"); + this.$state.go("dashboard", {}); + }; + + this.$scope.onCloseVideoButton = ():void => { + //console.log("onCloseVideoButton"); + $("#sdc-page-scroller").removeClass("animated fadeOut"); + $("#sdc-page-scroller").addClass("animated fadeIn"); + window.setTimeout(()=>{$("#sdc-page-scroller").css("display","block");},0); + + $("#sdc-welcome-video-wrapper").removeClass("animated fadeIn"); + $("#sdc-welcome-video-wrapper").addClass("animated fadeOut"); + window.setTimeout(()=>{$("#sdc-welcome-video-wrapper").css("display","none");},500); + + let videoElement:any = $("#asdc-welcome-video")[0]; + videoElement.pause(); + }; + + let url: string = this.sdcConfig.api.welcome_page_video_url; + + this.$scope.video_mp4 = this.$sce.trustAsResourceUrl(url + ".mp4"); + this.$scope.video_ogg = this.$sce.trustAsResourceUrl(url + ".ogg"); + + }; + + private init = ():void => { + let viewModelsHtmlBasePath:string = '/app/scripts/view-models/'; + this.$scope.slides = [ + {"url": viewModelsHtmlBasePath + 'welcome/slide0.html', "id": "slide-0", "index": 0, "callback": () => {this.animate0();}}, + {"url": viewModelsHtmlBasePath + 'welcome/slide1.html', "id": "slide-1", "index": 1, "callback": () => {}}, + {"url": viewModelsHtmlBasePath + 'welcome/slide2.html', "id": "slide-2", "index": 2, "callback": () => {this.animate2();}}, + {"url": viewModelsHtmlBasePath + 'welcome/slide3.html', "id": "slide-3", "index": 3, "callback": () => {this.animate3();}}, + {"url": viewModelsHtmlBasePath + 'welcome/slide4.html', "id": "slide-4", "index": 4, "callback": () => {this.animate4();}}, + {"url": viewModelsHtmlBasePath + 'welcome/slide5.html', "id": "slide-5", "index": 5, "callback": () => {this.animate5();}}, + {"url": viewModelsHtmlBasePath + 'welcome/slide6.html', "id": "slide-6", "index": 6, "callback": () => {this.animate6();}} + ]; + + $('body').keyup((e):void=> { + if (e.keyCode == 27) { // escape key maps to keycode `27` + this.$state.go('dashboard'); + } + }); + }; + + private animateGeneral = ():void => { + //console.log("animateGeneral"); + + /*// Animate the right navigation + if (this.firstLoad===true) { + //TODO: Israel + //TweenLite.from('.page-nav', 2, {x: "100px", delay: 2}); + } + */ + + this.firstLoad = false; + }; + + /*private loadImages = (callback: Function):void => { + let src = $('#slide-1 .asdc-welcome-frame').css('background-image'); + let url = src.match(/\((.*?)\)/)[1].replace(/('|")/g,''); + + let img = new Image(); + img.onload = function() { + callback(); + //alert('image loaded'); + }; + img.src = url; + /!*if (img.complete){ + callback; + }*!/ + };*/ + + private animate = (element:any, animation:string, when:number):void => { + window.setTimeout(()=>{ + element.addClass("animated " + animation); + if (element[0]) { + element[0].style = "visibility: visible;"; + } + },when); + }; + + private hide = (element:any, animation:string, animationToHide:string, when:number):void => { + element.addClass("animated " + animation); + element[0].style="visibility: hidden;"; + }; + + private animate0 = ():void => { + if (this.alreadyAnimated.indexOf(0)!==-1){ + return; + } else { + this.alreadyAnimated.push(0); + } + //console.log("slide 0 - animate"); + this.animate($('#slide-0 .bg-1'),'fadeInDown',500); + this.animate($('#slide-0 .bg-2'),'fadeInDown',1000); + this.animate($('#slide-0 .bg-3'),'fadeInDown',1500); + this.animate($('#slide-0 .bg-4'),'fadeInDown',2000); + + this.animate($('#slide-0 .bg-5'),'fadeInDown',2500); + this.animate($('#slide-0 .bg-6'),'fadeInDown',3000); + this.animate($('#slide-0 .bg-7'),'fadeInDown',3500); + this.animate($('#slide-0 .bg-8'),'fadeInDown',4000); + }; + + private animate1 = ():void => { + if (this.alreadyAnimated.indexOf(1)!==-1){ + return; + } else { + this.alreadyAnimated.push(1); + } + //console.log("slide 1 - animate"); + + this.animate($('#slide-1 .asdc-welcome-main-title'),'fadeInUp',1000); + this.animate($('#slide-1 .asdc-welcome-main-message'),'fadeInUp',2000); + + this.animate($('#slide-1 .asdc-welcome-main-back-btn'),'fadeIn',3000); + + this.animate($('#slide-1 .asdc-welcome-video-icon'),'zoomIn',3000); + this.animate($('#slide-1 .asdc-welcome-inner-circle'),'zoomIn',3000); + + this.animate($('.welcome-nav'),'slideInRight',2000); + }; + + private animate2 = ():void => { + if (this.alreadyAnimated.indexOf(2)!==-1){ + return; + } else { + this.alreadyAnimated.push(2); + } + //console.log("slide 2 - animate"); + this.animate($('#slide-2 .asdc-welcome-frame-shape'),'zoomIn',500); + this.animate($('#slide-2 .asdc-welcome-slide-text-box-content'),'fadeInUp',2000); + this.animate($('#slide-2 .asdc-welcome-slide-text-box-title'),'fadeInUp',1000); + }; + + private animate3 = ():void => { + if (this.alreadyAnimated.indexOf(3)!==-1){ + return; + } else { + this.alreadyAnimated.push(3); + } + //console.log("slide 3 - animate"); + this.animate($('#slide-3 .asdc-welcome-frame-shape'),'zoomIn',500); + this.animate($('#slide-3 .asdc-welcome-slide-text-box-content'),'fadeInUp',2000); + this.animate($('#slide-3 .asdc-welcome-slide-text-box-title'),'fadeInUp',1000); + }; + + private animate4 = ():void => { + if (this.alreadyAnimated.indexOf(4)!==-1){ + return; + } else { + this.alreadyAnimated.push(4); + } + //console.log("slide 4 - animate"); + this.animate($('#slide-4 .asdc-welcome-frame-shape'),'zoomIn',500); + this.animate($('#slide-4 .asdc-welcome-slide-text-box-content'),'fadeInUp',2000); + this.animate($('#slide-4 .asdc-welcome-slide-text-box-title'),'fadeInUp',1000); + }; + + private animate5 = ():void => { + if (this.alreadyAnimated.indexOf(5)!==-1){ + return; + } else { + this.alreadyAnimated.push(5); + } + //console.log("slide 5 - animate"); + this.animate($('#slide-5 .asdc-welcome-frame-shape'),'zoomIn',500); + this.animate($('#slide-5 .asdc-welcome-slide-text-box-content'),'fadeInUp',2000); + this.animate($('#slide-5 .asdc-welcome-slide-text-box-title'),'fadeInUp',1000); + }; + + private animate6 = ():void => { + if (this.alreadyAnimated.indexOf(6)!==-1){ + return; + } else { + this.alreadyAnimated.push(6); + } + //console.log("slide 6 - animate"); + this.animate($('#slide-6 .asdc-welcome-main-message'),'fadeInUp',2000); + this.animate($('#slide-6 .asdc-welcome-main-title'),'fadeInUp',1000); + this.animate($('#slide-6 .asdc-welcome-main-back-btn'),'fadeInUp',3000); + }; + + private animateCss = (element:JQuery, animationName:string):void => { + let animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; + element.addClass('animated ' + animationName).one(animationEnd, function() { + element.removeClass('animated ' + animationName); + }); + }; + + private unAnimateCss = (element:JQuery, animationName:string):void => { + let animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; + element.addClass('animated ' + animationName).one(animationEnd, function() { + element.removeClass('animated ' + animationName); + }); + }; + + } +} diff --git a/catalog-ui/app/scripts/view-models/wizard/ReadMe.txt b/catalog-ui/app/scripts/view-models/wizard/ReadMe.txt new file mode 100644 index 0000000000..ca5cfb988a --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/ReadMe.txt @@ -0,0 +1,54 @@ +import-asset wizard +======================================================== + +What should be done in each wizard step: +---------------------------------------- + +1. Each step scope should extend IAssetCreationStepScope (this way you can call methods on the wizard scope). + Example: + export interface IGeneralStepScope extends IAssetCreationStepScope { + + } + +2. Each step class should implements IAssetCreationStep + Example: export class GeneralStepViewModel implements IAssetCreationStep { + + } + +3. Add the method: public save = (callback:Function):void => {} + The method should perform the save and call: callback(true); in case of success, or callback(false); in case of error. + Example: + var onSuccess:Function = (resourceProperties:Services.IResourceResource) => { + this.$scope.setAngularResourceOfResource(resourceProperties); + var resourceObj = new Sdc.Models.Resource(resourceProperties); + this.$scope.setEntity(resourceObj); + this.$scope.latestEntityName = (resourceProperties.resourceName); + callback(true); + }; + +4. Add the first line after the constructor: this.$scope.registerChild(this); + This will register the current step reference in the wizard. + +5. Each step can get and set angular $resource of resource from the wizard. + // Will be called from each step to get current entity. + this.$scope.getAngularResourceOfResource = ():Services.IResourceResource => { + return this.resourceProperties; + }; + + // Will be called from each step after save to update the resource. + this.$scope.setAngularResourceOfResource = (resourceProperties:Services.IResourceResource):void => { + this.resourceProperties = resourceProperties; + this.fillAssetNameAndType(); + }; + + Note: after success save, set setAngularResourceOfResource in the wizard (see example in step 3). + +6. The wizard needs to know if the step is valid (to know if to show next button), I used the following to update the wizard: + this.$scope.$watch("editForm.$valid", function(newVal, oldVal){ + this.$scope.setValidState(newVal); + }); + + Note: in case there is no save for the step, and the step is always valid, call: this.$scope.setValidState(true); + + + diff --git a/catalog-ui/app/scripts/view-models/wizard/artifact-deployment-step/artifact-deployment-step.html b/catalog-ui/app/scripts/view-models/wizard/artifact-deployment-step/artifact-deployment-step.html new file mode 100644 index 0000000000..97817d59f2 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/artifact-deployment-step/artifact-deployment-step.html @@ -0,0 +1,137 @@ +
        + +
        Add
        + +
        + +
        + +
        +
        {{header.title}} + +
        +
        +
        + +
        + + + + +
        +
        + +
        + + + {{artifact.artifactDisplayName}} +
        + +
        + {{artifact.artifactType}} +
        +
        + {{artifact.timeout? artifact.timeout:''}} +
        + +
        + + +
        +
        +
        + + + +
        + + + +
        + + + +
        + +
        + + +
        + +
        +
        + + ? + + +
        + + + +
        +
        +
        + + +
        +
        + + ? + + +
        + + + +
        +
        +
        + +
        +
        + + + + + + +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/wizard/artifact-deployment-step/artifact-deployment-step.less b/catalog-ui/app/scripts/view-models/wizard/artifact-deployment-step/artifact-deployment-step.less new file mode 100644 index 0000000000..043fba3277 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/artifact-deployment-step/artifact-deployment-step.less @@ -0,0 +1,107 @@ +.artifact-deployment-step { + + .table-container-flex .table .body .data-row + div.item-opened { + padding: 10px 40px 10px 30px; + } + + .w-sdc-classic-btn { + float: right; + margin-bottom: 10px; + } + + .table { + height:412px; + margin-bottom: 0; + } + + .parameter-description { + .circle(18px, @color_p); + content: '?'; + line-height: 18px; + vertical-align: middle; + margin-left: 5px; + cursor: default; + display: inline-block; + position: absolute; + top: 16px; + } + + .table-container-flex { + + margin-top: 0px; + + .flex-item:nth-child(1) { + flex-grow: 15; + padding: 5px 4px; + .hand; + span.table-arrow { + margin-right: 7px; + + } + } + + .flex-item:nth-child(2) { + padding: 5px 4px; + flex-grow: 6; + } + + .flex-item:nth-child(3) { + padding: 5px 4px; + flex-grow: 9; + } + + .flex-item:nth-child(4) { + padding: 5px 4px; + flex-grow: 3; + padding-top: 10px; + } + } + .w-sdc-form{ + text-align: left; + + .w-sdc-env-params{ + border-top: 1px solid #cdcdcd; + margin: 25px 0 10px 0; + } + + .i-sdc-form-textarea { + border: 1px solid @color_e; + min-height: 60px; + padding: 10px 13px; + width: 100%; + resize: none; + + &:disabled { + .disabled; + } + } + + .w-sdc-form-item { + &.error { + .i-sdc-form-input, + .i-sdc-form-select, + .i-sdc-form-textarea { + border-color: @color_h; + outline: none; + box-sizing: border-box; + } + } + } + + .i-sdc-env-form-label{ + .p_9; + overflow: hidden; + max-width: 245px; + text-overflow: ellipsis; + display: inline-block; + white-space: nowrap; + margin-top: 14px; + + &.required::before { + color: #f33; + content: '*'; + margin-right: 4px; + } + } + } +} diff --git a/catalog-ui/app/scripts/view-models/wizard/artifact-deployment-step/artifact-deployment-step.ts b/catalog-ui/app/scripts/view-models/wizard/artifact-deployment-step/artifact-deployment-step.ts new file mode 100644 index 0000000000..80f145b9b1 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/artifact-deployment-step/artifact-deployment-step.ts @@ -0,0 +1,228 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels.Wizard { + 'use strict'; + import ArtifactModel = Sdc.Models.ArtifactModel; + + interface IArtifactDeploymentStepViewModelScope extends IWizardCreationStepScope { + tableHeadersList: Array; + reverse: boolean; + sortBy:string; + component: Models.Components.Component; + artifacts: Array; + editForm:ng.IFormController; + isLoading:boolean; + artifactDescriptions:any; + updateInProgress:boolean; + + addOrUpdate(artifact:Models.ArtifactModel): void; + update(artifact:Models.ArtifactModel): void; + delete(artifact:Models.ArtifactModel): void; + sort(sortBy:string): void; + noArtifactsToShow():boolean; + getValidationPattern(validationType:string, parameterType?:string):RegExp; + validateJson(json:string):boolean; + resetValue(parameter:any):void; + } + + export class ArtifactDeploymentStepViewModel implements IWizardCreationStep { + + static '$inject' = [ + '$scope', + '$filter', + '$modal', + '$templateCache', + 'ValidationUtils', + 'ModalsHandler' + ]; + + constructor( + private $scope:IArtifactDeploymentStepViewModelScope, + private $filter:ng.IFilterService, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService, + private validationUtils: Sdc.Utils.ValidationUtils, + private ModalsHandler: Utils.ModalsHandler + ){ + this.$scope.registerChild(this); + this.$scope.setValidState(true); + this.initScope(); + } + + private initDescriptions = ():void =>{ + this.$scope.artifactDescriptions = {}; + _.forEach(this.$scope.component.deploymentArtifacts,(artifact:Models.ArtifactModel):void => { + this.$scope.artifactDescriptions[artifact.artifactLabel] = artifact.description; + }); + }; + + + private setArtifact = (artifact:Models.ArtifactModel):void =>{ + if(artifact.heatParameters) { + artifact.heatParameters.forEach((parameter:any):void => { + if (!parameter.currentValue && parameter.defaultValue) { + parameter.currentValue = parameter.defaultValue; + } else if ("" === parameter.currentValue) { + parameter.currentValue = null; + } + }); + } + if(!artifact.description || !this.$scope.getValidationPattern('string').test(artifact.description)){ + artifact.description = this.$scope.artifactDescriptions[artifact.artifactLabel]; + } + }; + + private updateAll = ():void =>{ + let artifacts:Array= []; + _.forEach(this.$scope.component.deploymentArtifacts,(artifact:Models.ArtifactModel): void => { + if(artifact.selected) { + this.setArtifact(artifact); + artifacts.push(artifact); + } + }); + this.$scope.component.updateMultipleArtifacts(artifacts); + }; + + + + private initScope = (): void => { + let self = this; + this.$scope.isLoading = false; + this.$scope.updateInProgress = false; + this.$scope.component = this.$scope.getComponent(); + this.initDescriptions(); + this.$scope.artifacts = _.values(this.$scope.component.deploymentArtifacts); + + + this.$scope.tableHeadersList = [ + {title:'Name', property: 'artifactDisplayName'}, + {title:'Type', property: 'artifactType'}, + {title:'Deployment timeout', property: 'timeout'} + ]; + + this.$scope.sort = (sortBy:string):void => { + this.$scope.reverse = (this.$scope.sortBy === sortBy) ? !this.$scope.reverse : false; + this.$scope.sortBy = sortBy; + }; + + this.$scope.getValidationPattern = (validationType:string, parameterType?:string):RegExp => { + return this.validationUtils.getValidationPattern(validationType, parameterType); + }; + + this.$scope.validateJson = (json:string):boolean => { + if(!json){ + return true; + } + return this.validationUtils.validateJson(json); + }; + + + this.$scope.addOrUpdate = (artifact:Models.ArtifactModel): void => { + artifact.artifactGroupType = 'DEPLOYMENT'; + let artifactCopy = new Models.ArtifactModel(artifact); + this.ModalsHandler.openWizardArtifactModal(artifactCopy, this.$scope.component).then(() => { + this.$scope.artifactDescriptions[artifactCopy.artifactLabel]= artifactCopy.description; + this.$scope.artifacts = _.values(this.$scope.component.deploymentArtifacts); + }) + }; + + this.$scope.noArtifactsToShow = ():boolean =>{ + return !_.some(this.$scope.artifacts, 'esId'); + }; + + this.$scope.resetValue = (parameter:any):void => { + if(!parameter.currentValue && parameter.defaultValue){ + parameter.currentValue = parameter.defaultValue; + } + else if('boolean'==parameter.type){ + parameter.currentValue = parameter.currentValue.toUpperCase(); + } + }; + + + this.$scope.$watch('editForm.$valid', ():void => { + if(this.$scope.editForm) { + this.$scope.setValidState(this.$scope.editForm.$valid); + } + }); + + this.$scope.update = (artifact:Models.ArtifactModel):void =>{ + if(false == this.$scope.isLoading) { + if(artifact.selected) { + this.$scope.isLoading = true; + this.$scope.updateInProgress = true; + let onSuccess = (responseArtifact:Models.ArtifactModel):void => { + this.$scope.artifactDescriptions[responseArtifact.artifactLabel] = responseArtifact.description; + this.$scope.artifacts = _.values(this.$scope.component.deploymentArtifacts); + this.$scope.isLoading = false; + this.$scope.updateInProgress = false; + artifact.selected = !artifact.selected; + }; + + let onFailed = (error:any):void => { + console.log('Delete artifact returned error:', error); + this.$scope.isLoading = false; + this.$scope.updateInProgress = false; + artifact.selected = !artifact.selected; + }; + + this.setArtifact(artifact); + this.$scope.component.addOrUpdateArtifact(artifact).then(onSuccess, onFailed); + } else { + artifact.selected = !artifact.selected; + } + } + }; + + this.$scope.delete = (artifact:Models.ArtifactModel):void => { + let onOk = ():void => { + this.$scope.isLoading = true; + let onSuccess = ():void => { + this.$scope.isLoading = false; + this.$scope.artifacts = _.values(this.$scope.component.deploymentArtifacts); + }; + + let onFailed = (error:any):void => { + this.$scope.isLoading = false; + console.log('Delete artifact returned error:', error); + }; + + this.$scope.component.deleteArtifact(artifact.uniqueId, artifact.artifactLabel).then(onSuccess, onFailed); + }; + + let title:string = self.$filter('translate')("ARTIFACT_VIEW_DELETE_MODAL_TITLE"); + let message:string = self.$filter('translate')("ARTIFACT_VIEW_DELETE_MODAL_TEXT", "{'name': '" + artifact.artifactDisplayName + "'}"); + this.ModalsHandler.openConfirmationModal(title, message, false).then(onOk); + }; + }; + + public save = (callback:Function):void => { + this.updateAll(); + this.$scope.setComponent(this.$scope.component); + callback(true); + }; + + public back = (callback:Function):void => { + this.$scope.setComponent(this.$scope.component); + callback(true); + } + } +} diff --git a/catalog-ui/app/scripts/view-models/wizard/artifact-form-step/artifact-form-step-view-model.ts b/catalog-ui/app/scripts/view-models/wizard/artifact-form-step/artifact-form-step-view-model.ts new file mode 100644 index 0000000000..459729c179 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/artifact-form-step/artifact-form-step-view-model.ts @@ -0,0 +1,304 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels.Wizard { + 'use strict'; + import Resource = Sdc.Models.Components.Resource; + + export interface IEditArtifactStepModel { + artifactResource: Models.ArtifactModel; + artifactTypes: Array; + artifactsFormList: any; + artifactFile:any; + } + + export interface IArtifactResourceFormStepViewModelScope extends ng.IScope { + editForm:ng.IFormController; + forms:any; + footerButtons: Array; + isNew: boolean; + isPlaceHolderArtifact:boolean; + isLoading: boolean; + validationPattern: RegExp; + urlValidationPattern: RegExp; + labelValidationPattern: RegExp; + integerValidationPattern: RegExp; + commentValidationPattern: RegExp; + artifactType: string; + artifactGroupType:string; + editArtifactResourceModel: IEditArtifactStepModel; + defaultHeatTimeout: number; + validExtensions: any; + originalArtifactName: string; + modalInstanceArtifact:ng.ui.bootstrap.IModalServiceInstance; + selectedArtifact:string; + + fileExtensions():string; + save(): void; + close(): void; + changeArtifact(selectedArtifact:string):void; + getOptions(): Array; + removeInputLabel(): void; + fileUploadRequired():string; + isDeploymentHeat():boolean; + setDefaultTimeout():void; + getFormTitle():string; + } + + export class ArtifactResourceFormStepViewModel { + + static '$inject' = [ + '$scope', + '$modalInstance', + 'artifact', + 'component', + 'Sdc.Services.CacheService', + 'ValidationPattern', + 'UrlValidationPattern', + 'LabelValidationPattern', + 'IntegerValidationPattern', + 'CommentValidationPattern', + 'ValidationUtils', + 'ArtifactsUtils', + '$state', + '$modal', + '$templateCache' + ]; + + private formState:Utils.Constants.FormState; + private entityId:string; + + constructor(private $scope:IArtifactResourceFormStepViewModelScope, + private $modalInstance:ng.ui.bootstrap.IModalServiceInstance, + private artifact:Models.ArtifactModel, + private component:Models.Components.Component, + private cacheService:Services.CacheService, + private ValidationPattern:RegExp, + private UrlValidationPattern:RegExp, + private LabelValidationPattern:RegExp, + private IntegerValidationPattern:RegExp, + private CommentValidationPattern:RegExp, + private ValidationUtils:Sdc.Utils.ValidationUtils, + private ArtifactsUtils:Sdc.Utils.ArtifactsUtils, + private $state:any, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService) { + + + this.entityId = this.component.uniqueId; + this.formState = angular.isDefined(artifact.artifactLabel) ? Utils.Constants.FormState.UPDATE : Utils.Constants.FormState.CREATE; + + this.initScope(); + this.initEditArtifactResourceModel(); + this.initComponent(); + this.initArtifactTypes(); + } + + private initEditArtifactResourceModel = ():void => { + this.$scope.editArtifactResourceModel = { + artifactResource: null, + artifactTypes: null, + artifactsFormList: {}, + artifactFile: {} + } + }; + + private initComponent = ():void => { + this.$scope.editArtifactResourceModel.artifactResource = this.artifact; + this.$scope.originalArtifactName = this.artifact.artifactName; + let artifacts:any = Utils.Constants.ArtifactGroupType.INFORMATION === this.artifact.artifactGroupType? + this.component.artifacts : this.component.deploymentArtifacts; + this.$scope.editArtifactResourceModel.artifactsFormList = _.pick(artifacts, (artifact:Models.ArtifactModel)=> { + return artifact.artifactLabel && !artifact.esId; + }); + this.$scope.editArtifactResourceModel.artifactFile.filename= this.artifact.artifactName?this.artifact.artifactName:''; + + if(this.artifact.artifactLabel){//this is edit mode + this.$scope.editArtifactResourceModel.artifactsFormList[this.artifact.artifactLabel]= this.artifact; + this.$scope.selectedArtifact = this.artifact.artifactDisplayName; + } + }; + + private initArtifactTypes = ():void => { + let artifactTypes:any = this.cacheService.get('UIConfiguration'); + + if (Utils.Constants.ArtifactGroupType.INFORMATION === this.artifact.artifactGroupType) { + this.$scope.editArtifactResourceModel.artifactTypes = artifactTypes.artifacts.other.map((element:any)=> { + return element.name; + }); + _.remove(this.$scope.editArtifactResourceModel.artifactTypes, (item:string)=> { + return _.has(Utils.Constants.ArtifactType.THIRD_PARTY_RESERVED_TYPES, item) || + _.has(Utils.Constants.ArtifactType.TOSCA, item); + }) + }else if(Utils.Constants.ArtifactGroupType.DEPLOYMENT === this.artifact.artifactGroupType) { + + this.$scope.validExtensions = artifactTypes.artifacts.deployment.resourceDeploymentArtifacts; + if(this.$scope.validExtensions) { + this.$scope.editArtifactResourceModel.artifactTypes = Object.keys(this.$scope.validExtensions); + } + this.$scope.defaultHeatTimeout = artifactTypes.defaultHeatTimeout; + + if(!this.$scope.isPlaceHolderArtifact) { + _.remove(this.$scope.editArtifactResourceModel.artifactTypes, (item:string)=> { + return Utils.Constants.ArtifactType.HEAT == item.substring(0,4) || + _.has(Utils.Constants.ArtifactType.THIRD_PARTY_RESERVED_TYPES, item); + }) + } + + if(this.component.isResource() && (this.component).isCsarComponent()) { + _.remove(this.$scope.editArtifactResourceModel.artifactTypes, (item:string) => { + return this.ArtifactsUtils.isLicenseType(item); + }) + } + } + }; + + private initScope = ():void => { + + this.$scope.modalInstanceArtifact = this.$modalInstance; + this.$scope.validationPattern = this.ValidationPattern; + this.$scope.urlValidationPattern = this.UrlValidationPattern; + this.$scope.labelValidationPattern = this.LabelValidationPattern; + this.$scope.integerValidationPattern = this.IntegerValidationPattern; + this.$scope.commentValidationPattern = this.CommentValidationPattern; + this.$scope.isLoading = false; + this.$scope.isPlaceHolderArtifact = true; + this.$scope.isNew = (this.formState === Utils.Constants.FormState.CREATE); + this.$scope.artifactGroupType = this.artifact.artifactGroupType; + this.$scope.selectedArtifact = '?'; + + this.$scope.fileExtensions = ():string => { + let type:string = this.$scope.editArtifactResourceModel.artifactResource.artifactType; + return type && this.$scope.validExtensions && this.$scope.validExtensions[type].acceptedTypes ? + this.$scope.validExtensions[type].acceptedTypes.join(',') : ""; + }; + + this.$scope.removeInputLabel = ():void => { + this.$scope.isPlaceHolderArtifact = true; + }; + + this.$scope.fileUploadRequired = ():string => { + if (this.$scope.isNew===false){ + return 'false'; // This is edit mode + } else { + return 'true'; + } + }; + + this.$scope.isDeploymentHeat = ():boolean =>{ + return Utils.Constants.ArtifactGroupType.DEPLOYMENT === this.artifact.artifactGroupType + && this.$scope.editArtifactResourceModel.artifactResource + && this.$scope.editArtifactResourceModel.artifactResource.artifactType + && Utils.Constants.ArtifactType.HEAT === this.$scope.editArtifactResourceModel.artifactResource.artifactType.substring(0,4); + }; + + this.$scope.getFormTitle =(): string =>{ + let title:string = this.artifact.esId? 'Update':'Add'; + if (Utils.Constants.ArtifactGroupType.DEPLOYMENT === this.artifact.artifactGroupType) { + title += ' Deployment'; + } + title += ' Artifact'; + return title; + }; + + this.$scope.setDefaultTimeout = ():void => { + if(!this.$scope.editArtifactResourceModel.artifactResource.timeout) { + this.$scope.editArtifactResourceModel.artifactResource.timeout = this.$scope.defaultHeatTimeout; + } + }; + + this.$scope.changeArtifact = (selectedArtifact:string):void => { + let tempArtifact:Models.ArtifactModel = this.$scope.editArtifactResourceModel.artifactResource; + this.$scope.editArtifactResourceModel.artifactResource = null; + + if (selectedArtifact && selectedArtifact != '' && selectedArtifact != '?') { + let artifactResource = _.find(this.$scope.editArtifactResourceModel.artifactsFormList,{'artifactDisplayName':selectedArtifact}); + this.$scope.editArtifactResourceModel.artifactResource = new Sdc.Models.ArtifactModel(artifactResource); + this.$scope.originalArtifactName = this.$scope.editArtifactResourceModel.artifactResource.artifactName; + this.$scope.isPlaceHolderArtifact = true; + if(this.$scope.isDeploymentHeat()){ + this.$scope.setDefaultTimeout(); + } + } else if (selectedArtifact === "") { + //this.$scope.editArtifactResourceModel.artifactFile = {}; + this.$scope.editArtifactResourceModel.artifactResource = {}; + this.$scope.editArtifactResourceModel.artifactResource.artifactGroupType = this.$scope.artifactGroupType; + this.$scope.isPlaceHolderArtifact = false; + } + + if (_.size(this.$scope.editArtifactResourceModel.artifactFile) && this.$scope.editArtifactResourceModel.artifactResource) { + this.$scope.editArtifactResourceModel.artifactResource.artifactName = this.$scope.editArtifactResourceModel.artifactFile.filename; + } + if(tempArtifact && tempArtifact.description != ''){ + this.$scope.editArtifactResourceModel.artifactResource.description = tempArtifact.description; + } + + this.initArtifactTypes(); + this.$scope.isNew = true; + + }; + + + this.$scope.save = ():void => { + this.$scope.isLoading = true; + this.$scope.editArtifactResourceModel.artifactResource.description = + this.ValidationUtils.stripAndSanitize(this.$scope.editArtifactResourceModel.artifactResource.description); + + if (this.$scope.editArtifactResourceModel.artifactFile) { + this.$scope.editArtifactResourceModel.artifactResource.payloadData = this.$scope.editArtifactResourceModel.artifactFile.base64; + this.$scope.editArtifactResourceModel.artifactResource.artifactName = this.$scope.editArtifactResourceModel.artifactFile.filename; + } + + let onFailed = (response) => { + this.$scope.isLoading = false; + console.info('onFaild', response); + this.$scope.editArtifactResourceModel.artifactResource.esId = undefined; + }; + + let onSuccess = () => { + this.$scope.isLoading = false; + this.$scope.originalArtifactName = ""; + this.$modalInstance.close(); + + }; + + this.component.addOrUpdateArtifact(this.$scope.editArtifactResourceModel.artifactResource).then(onSuccess, onFailed); + }; + + + this.$scope.close = ():void => { + this.$modalInstance.dismiss(); + }; + + //new form layout for import asset + this.$scope.forms = {}; + this.$scope.footerButtons = [ + {'name': this.artifact.esId ? 'Update' : 'Add', 'css': 'blue', 'callback': this.$scope.save}, + {'name': 'Cancel', 'css': 'grey', 'callback': this.$scope.close} + ]; + + this.$scope.$watch("forms.editForm.$invalid", (newVal, oldVal) => { + this.$scope.footerButtons[0].disabled = this.$scope.forms.editForm.$invalid; + }); + + } + + } +} diff --git a/catalog-ui/app/scripts/view-models/wizard/artifact-form-step/artifact-form-step-view.html b/catalog-ui/app/scripts/view-models/wizard/artifact-form-step/artifact-form-step-view.html new file mode 100644 index 0000000000..2643b99c20 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/artifact-form-step/artifact-form-step-view.html @@ -0,0 +1,147 @@ + + + + +
        + + +
        + + + +
        + + + + +
        +
        + + +
        +
        + +
        + + + +
        + +
        +
        + +
        + + + + +
        + + + +
        +
        + +
        + + + +
        + + + +
        +
        +
        + + + +
        + +
        + +
        +
        + +
        + +
        + + + +
        + + + +
        + +
        +
        +
        + + + +
        + +
        + + diff --git a/catalog-ui/app/scripts/view-models/wizard/artifact-form-step/artifact-form-step.less b/catalog-ui/app/scripts/view-models/wizard/artifact-form-step/artifact-form-step.less new file mode 100644 index 0000000000..a189c12d62 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/artifact-form-step/artifact-form-step.less @@ -0,0 +1,45 @@ +.sdc-add-artifact { + + .w-sdc-form-note { + .h_9; + display: block; + position: relative; + top: 13px; + } + + .w-sdc-form { + + .i-sdc-form-textarea{ + min-height: 95px; + } + + .i-sdc-form-item.upload input[type="file"] { + display: none + } + + .w-sdc-icon-cancel { + position: absolute; + right: 7px; + top: 33px; + .sprite; + .sprite.small-x-btn-black; + .hand; + } + } + + .artifact-info { + text-align: left; + color: rgb(140, 140, 140); + font-size: 13px; + margin-top: -40px; + margin-bottom: 5px; + width: 600px; + min-height: initial; + + span { + color: #666666; + padding-left: 4px; + } + } + +} diff --git a/catalog-ui/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.html b/catalog-ui/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.html new file mode 100644 index 0000000000..ea4566561c --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.html @@ -0,0 +1,48 @@ +
        +
        Add
        +
        +
        +
        +
        {{header.title}} + +
        +
        +
        +
        + +
        + There are no information artifacts to display +
        +
        + +
        + + {{artifact.artifactDisplayName}} +
        + +
        + {{artifact.artifactType}} +
        + +
        + + +
        +
        +
        + + +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.less b/catalog-ui/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.less new file mode 100644 index 0000000000..b0600ca483 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.less @@ -0,0 +1,50 @@ +.artifact-step { + + .w-sdc-classic-btn { + float: right; + margin-bottom: 10px; + } + + .table{ + height: 412px; + margin-bottom: 0; + } + + .table-container-flex { + margin-top: 0px; + + .item-opened{ + word-wrap: break-word; + } + + + .flex-item:nth-child(1) { + padding: 5px 4px; + flex-grow: 15; + .hand; + span.table-arrow { + margin-right: 7px; + } + } + + .flex-item:nth-child(2) { + padding: 5px 4px; + flex-grow: 6; + } + + .flex-item:nth-child(3) { + padding: 5px 4px; + flex-grow: 3; + padding-top: 10px; + } + + .flex-item:nth-child(4) { + padding: 5px 4px; + flex-grow: 1; + } + + } + +} + + diff --git a/catalog-ui/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.ts b/catalog-ui/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.ts new file mode 100644 index 0000000000..f6e25a53a3 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.ts @@ -0,0 +1,168 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels.Wizard { + 'use strict'; + import ArtifactModel = Sdc.Models.ArtifactModel; + + export interface IArtifactInformationStepScope extends IWizardCreationScope { + artifacts: Array; + tableHeadersList: Array; + artifactType: string; + isResourceInstance:boolean; + downloadFile:Models.IFileDownload; + isLoading:boolean; + sortBy:string; + reverse:boolean; + component:Models.Components.Component; + + getTitle(): string; + addOrUpdate(artifact:Models.ArtifactModel): void; + delete(artifact:Models.ArtifactModel): void; + download(artifact:Models.ArtifactModel): void; + clickArtifactName(artifact:any):void; + openEditEnvParametersModal(artifactResource: Models.ArtifactModel):void; + sort(sortBy:string): void; + showNoArtifactMessage():boolean; + } + + export class ArtifactInformationStepViewModel implements IWizardCreationStep { + + static '$inject' = [ + '$scope', + '$filter', + '$modal', + '$templateCache', + 'Sdc.Services.SharingService', + '$state', + 'sdcConfig', + 'ModalsHandler' + ]; + + constructor(private $scope:IArtifactInformationStepScope, + private $filter:ng.IFilterService, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService, + private sharingService:Sdc.Services.SharingService, + private $state:any, + private sdcConfig:Models.IAppConfigurtaion, + private ModalsHandler: Utils.ModalsHandler) { + this.$scope.registerChild(this); + this.$scope.setValidState(true); + this.initScope(); + } + + + private getMappedObjects():any { + return { + normal: this.$scope.component.artifacts + }; + } + + private initScope = ():void => { + let self = this; + this.$scope.isLoading = false; + this.$scope.sortBy = 'artifactDisplayName'; + this.$scope.reverse = false; + + this.$scope.artifactType = 'normal'; + this.$scope.getTitle = ():string => { + return this.$filter("resourceName")(this.$scope.component.name) + ' Artifacts'; + + }; + + this.$scope.tableHeadersList = [ + {title: 'Name', property: 'artifactDisplayName'}, + {title: 'Type', property: 'artifactType'} + ]; + + + this.$scope.component = this.$scope.getComponent(); + this.$scope.artifacts = _.values(this.$scope.component.artifacts); + + + this.$scope.sort = (sortBy:string):void => { + this.$scope.reverse = (this.$scope.sortBy === sortBy) ? !this.$scope.reverse : false; + this.$scope.sortBy = sortBy; + }; + + + this.$scope.addOrUpdate = (artifact:Models.ArtifactModel):void => { + artifact.artifactGroupType = 'INFORMATIONAL'; + this.ModalsHandler.openWizardArtifactModal(artifact, this.$scope.getComponent()).then(() => { + this.$scope.artifacts = _.values(this.$scope.component.artifacts); + }); + }; + + this.$scope.showNoArtifactMessage = ():boolean => { + let artifacts:any = []; + artifacts = _.filter(this.$scope.artifacts, (artifact:Models.ArtifactModel)=> { + return artifact.esId; + }); + + if (artifacts.length === 0) { + return true; + } + return false; + } + + this.$scope.delete = (artifact:Models.ArtifactModel):void => { + + let onOk = ():void => { + this.$scope.isLoading = true; + let onSuccess = ():void => { + this.$scope.isLoading = false; + this.$scope.artifacts = _.values(this.$scope.component.artifacts); + }; + + let onFailed = (error:any):void => { + console.log('Delete artifact returned error:', error); + this.$scope.isLoading = false; + }; + + this.$scope.component.deleteArtifact(artifact.uniqueId, artifact.artifactLabel).then(onSuccess, onFailed); + }; + + let title:string = this.$filter('translate')("ARTIFACT_VIEW_DELETE_MODAL_TITLE"); + let message:string = this.$filter('translate')("ARTIFACT_VIEW_DELETE_MODAL_TEXT", "{'name': '" + artifact.artifactDisplayName + "'}"); + this.ModalsHandler.openConfirmationModal(title, message, false).then(onOk); + }; + + this.$scope.clickArtifactName = (artifact:any) => { + if ('deployment' !== this.$scope.artifactType || 'HEAT' !== artifact.artifactType || !artifact.esId) { + this.$scope.addOrUpdate(artifact); + } + + }; + + } + + public save = (callback:Function):void => { + this.$scope.setComponent(this.$scope.component); + callback(true); + } + + public back = (callback:Function):void => { + callback(true); + } + + } + +} diff --git a/catalog-ui/app/scripts/view-models/wizard/general-step/general-step.html b/catalog-ui/app/scripts/view-models/wizard/general-step/general-step.html new file mode 100644 index 0000000000..db975caf47 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/general-step/general-step.html @@ -0,0 +1,270 @@ +
        +
        +
        +
        + + + + +
        + + + + +
        + + +
        + +
        + + +
        + + + +
        + + + + + +
        +
        + + + +
        + + + +
        + + + + + +
        +
        + + + +
        + + + + +
        + + + +
        +
        + + + +
        + + + +
        + +
        +
        + + + +
        + + + +
        + + + +
        + +
        + + + + +
        + + + +
        + + + +
        +
        + + + + +
        + +
        + + +
        + + + + +
        + +
        +
        + + + +
        + + + +
        + + +
        +
        + + + +
        + + + +
        + + +
        +
        + + + +
        + +
        + +
        + Your resource has been saved +
        + +
        + +
        + +
        +
        diff --git a/catalog-ui/app/scripts/view-models/wizard/general-step/general-step.less b/catalog-ui/app/scripts/view-models/wizard/general-step/general-step.less new file mode 100644 index 0000000000..700997a423 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/general-step/general-step.less @@ -0,0 +1,34 @@ +.sdc-wizard-general-step { + + .w-sdc-form { + padding: 0; + + .w-sdc-form-section-container { + text-align: center; + } + + .i-sdc-form-item { + &.upload { + margin-top: 0; + width: auto; + padding: 10px; + } + } + + .template-desc { + border: 1px dashed @border_color_f; + height: 130px; + overflow: hidden; + padding: 10px 6px 6px 6px; + margin-top: 10px; + } + + .sdc-tag .tag { + max-width: 225px; + } + + } + +} + + diff --git a/catalog-ui/app/scripts/view-models/wizard/general-step/general-step.ts b/catalog-ui/app/scripts/view-models/wizard/general-step/general-step.ts new file mode 100644 index 0000000000..74c681e433 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/general-step/general-step.ts @@ -0,0 +1,381 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels.Wizard { + import ISubCategory = Sdc.Models.ISubCategory; + import IMainCategory = Sdc.Models.IMainCategory; + 'use strict'; + + /* + * TODO: The template (derived from is not necessary here). + * Need to delete it from all remarks. + * */ + + export class UIModel { + tosca:Sdc.Directives.FileUploadModel; + name:string; + description:string; + vendorName:string; + vendorRelease:string; + category:string; + tags:Array; + userId:string; + icon:string; + projectCode:string; + fullName:string; + isAlreadyCertified:boolean; + } + + export class Validation { + validationPattern: RegExp; + contactIdValidationPattern: RegExp; + tagValidationPattern: RegExp; + vendorValidationPattern: RegExp; + commentValidationPattern: RegExp; + projectCodeValidationPattern: RegExp; + } + + export interface IGeneralStepScope extends IWizardCreationStepScope { + model:UIModel; + validation:Validation; + editForm:ng.IFormController; + component: Models.Components.Component; + categories: Array; + latestComponentName:string; + latestCategoryId: string; + latestVendorName: string; + isNew:boolean; + toscaFileExtensions:any; + isCreate:boolean; + + onToscaFileChange():void + validateField(field:any):boolean; + validateName(isInit:boolean): void; + calculateUnique(mainCategory:string, subCategory:string):string; // Build unique string from main and sub category + calculatedTagsMaxLength():number; + setIconToDefault():void; + onVendorNameChange(oldVendorName: string): void; + } + + export class GeneralStepViewModel implements IWizardCreationStep { + + static '$inject' = [ + '$scope', + 'Sdc.Services.CacheService', + 'ValidationPattern', + 'ContactIdValidationPattern', + 'TagValidationPattern', + 'VendorValidationPattern', + 'CommentValidationPattern', + 'ValidationUtils', + 'sdcConfig', + 'ComponentFactory', + 'ProjectCodeValidationPattern' + ]; + + constructor(private $scope:IGeneralStepScope, + private cacheService:Services.CacheService, + private ValidationPattern:RegExp, + private ContactIdValidationPattern:RegExp, + private TagValidationPattern:RegExp, + private VendorValidationPattern:RegExp, + private CommentValidationPattern: RegExp, + private ValidationUtils: Sdc.Utils.ValidationUtils, + private sdcConfig:Models.IAppConfigurtaion, + private ComponentFactory: Sdc.Utils.ComponentFactory, + private ProjectCodeValidationPattern:RegExp + ) { + + this.$scope.registerChild(this); + this.initScopeValidation(); + this.initScopeMethods(); + this.initScope(); + this.$scope.isCreate = this.$scope.data.importFile === undefined; + } + + private initScopeValidation = (): void => { + this.$scope.validation = new Validation(); + this.$scope.validation.validationPattern = this.ValidationPattern; + this.$scope.validation.contactIdValidationPattern = this.ContactIdValidationPattern; + this.$scope.validation.tagValidationPattern = this.TagValidationPattern; + this.$scope.validation.vendorValidationPattern = this.VendorValidationPattern; + this.$scope.validation.commentValidationPattern = this.CommentValidationPattern; + this.$scope.validation.projectCodeValidationPattern = this.ProjectCodeValidationPattern; + }; + + private initScope = ():void => { + + // Init UIModel + this.$scope.model = new UIModel(); + + // Init categories + if(this.$scope.data.componentType === Utils.Constants.ComponentType.RESOURCE){ + this.$scope.categories = this.cacheService.get('resourceCategories'); + } + if (this.$scope.data.componentType === Utils.Constants.ComponentType.SERVICE) { + this.$scope.categories = this.cacheService.get('serviceCategories'); + } + + this.$scope.model.category=''; + + //init file extenstions + this.$scope.toscaFileExtensions = this.sdcConfig.toscaFileExtension; + + // Init Tosca import file + if (this.$scope.data.importFile) { + this.$scope.model.tosca = this.$scope.data.importFile; + } + + // Case insert or update + this.$scope.component = this.$scope.getComponent(); + if ( this.$scope.component!==undefined){ + // Update mode + + //this.$scope.latestCategoryId = this.$scope.component[0].uniqueId; + //this.$scope.latestVendorName = this.$scope.component.vendorName; + this.$scope.latestComponentName = this.$scope.component.name; + this.$scope.isNew=false; + this.resource2ModelUi(this.$scope.component); + } else { + // Create mode + this.$scope.isNew=true; + this.$scope.model.tags=[]; // Init tags + this.$scope.model.userId = this.cacheService.get("user").userId; // Fill user ID from logged in user + this.$scope.model.icon = Utils.Constants.DEFAULT_ICON; // Set the default icon + this.$scope.component = this.ComponentFactory.createEmptyComponent(this.$scope.data.componentType); + } + }; + + private initScopeMethods = ():void => { + + this.$scope.validateField = (field:any):boolean => { + if (field && field.$dirty && field.$invalid){ + return true; + } + return false; + }; + + this.$scope.validateName = (isInit:boolean):void => { + if (isInit===undefined){isInit=false;} + + let name = this.$scope.model.name; + if (!name || name===""){ + if (this.$scope.editForm + && this.$scope.editForm["componentName"] + && this.$scope.editForm["componentName"].$error){ + + // Clear the error name already exists + this.$scope.editForm["componentName"].$setValidity('nameExist', true); + } + + return; + } + let subtype:string = Utils.Constants.ComponentType.RESOURCE == this.$scope.data.componentType? + this.$scope.data.importFile? 'VFC':'VF' : undefined; + + let onFailed = (response) => { + //console.info('onFaild', response); + //this.$scope.isLoading = false; + }; + + let onSuccess = (validation:Models.IValidate) => { + this.$scope.editForm["componentName"].$setValidity('nameExist', validation.isValid); + }; + + if (isInit){ + // When page is init after update + if (this.$scope.model.name !== this.$scope.latestComponentName){ + if(!this.$scope.component.isProduct()) {//TODO remove when backend is ready + this.$scope.component.validateName(name, subtype).then(onSuccess, onFailed); + } + } + } else { + // Validating on change (has debounce) + if (this.$scope.editForm + && this.$scope.editForm["componentName"] + && this.$scope.editForm["componentName"].$error + && !this.$scope.editForm["componentName"].$error.pattern + && this.$scope.model.name !== this.$scope.latestComponentName + ) { + if(!this.$scope.component.isProduct()) { //TODO remove when backend is ready + this.$scope.component.validateName(name, subtype).then(onSuccess, onFailed); + } + } else if (this.$scope.model.name === this.$scope.latestComponentName) { + // Clear the error + this.$scope.editForm["componentName"].$setValidity('nameExist', true); + } + } + }; + + this.$scope.calculateUnique = (mainCategory:string, subCategory:string):string => { + let uniqueId: string = mainCategory; + if(subCategory) { + uniqueId += "_#_" + subCategory; // Set the select category combobox to show the selected category. + } + return uniqueId; + }; + + // Notify the parent if this step valid or not. + this.$scope.$watch("editForm.$valid", (newVal, oldVal) => { + //console.log("editForm validation: " + newVal); + this.$scope.setValidState(newVal); + }); + + this.$scope.setIconToDefault = ():void => { + this.$scope.model.icon = Utils.Constants.DEFAULT_ICON; + }; + + this.$scope.onVendorNameChange = (oldVendorName: string):void => { + if(this.$scope.component.icon === oldVendorName) { + this.$scope.setIconToDefault(); + } + }; + }; + + public save = (callback:Function):void => { + this.modelUi2Resource(); + + let onFailed = (response) => { + callback(false); + }; + + let onSuccess = (component:Models.Components.Component) => { + this.$scope.component = component; + this.$scope.setComponent(this.$scope.component); + this.$scope.latestComponentName = (component.name); + callback(true); + }; + + try { + //Send the form with attached tosca file. + if (this.$scope.isNew===true) { + this.ComponentFactory.createComponentOnServer(this.$scope.component).then(onSuccess, onFailed); + } else { + this.$scope.component.updateComponent().then(onSuccess, onFailed); + } + }catch(e){ + //console.log("ERROR: Error in updating/creating component: " + e); + callback(false); + } + + }; + + public back = (callback:Function):void => { + callback(true); + } + + // Fill the resource properties object with data from UIModel + private modelUi2Resource = ():void => { + + this.$scope.component.name = this.$scope.model.name; + this.$scope.component.description = this.ValidationUtils.stripAndSanitize(this.$scope.model.description); + this.$scope.component.vendorName = this.$scope.model.vendorName; + this.$scope.component.vendorRelease = this.$scope.model.vendorRelease; + this.$scope.component.tags = angular.copy(this.$scope.model.tags); + this.$scope.component.tags.push(this.$scope.model.name); + this.$scope.component.contactId = this.$scope.model.userId; + this.$scope.component.icon = this.$scope.model.icon; + + if(this.$scope.component.isResource()) { + (this.$scope.component).resourceType = "VF"; + + // Handle the tosca file + if (this.$scope.model.tosca && this.$scope.isNew) { + (this.$scope.component).payloadData = this.$scope.model.tosca.base64; + (this.$scope.component).payloadName = this.$scope.model.tosca.filename; + } + + this.$scope.component.categories = this.convertCategoryStringToOneArray(); + } + + if(this.$scope.component.isProduct()) { + this.$scope.component.projectCode = this.$scope.model.projectCode; + // Handle the tosca file + this.$scope.component.categories = undefined; + (this.$scope.component).contacts = new Array(); + (this.$scope.component).contacts.push(this.$scope.component.contactId); + (this.$scope.component).fullName = this.$scope.model.fullName; + } + + if(this.$scope.component.isService()) { + this.$scope.component.projectCode = this.$scope.model.projectCode; + this.$scope.component.categories = this.convertCategoryStringToOneArray(); + } + }; + + // Fill the UIModel from data from resource properties + private resource2ModelUi = (component: Models.Components.Component):void => { + this.$scope.model.name = component.name; + this.$scope.model.description = component.description; + this.$scope.model.vendorName = component.vendorName; + this.$scope.model.vendorRelease = component.vendorRelease; + this.$scope.model.tags = _.reject(component.tags, (item)=>{return item===component.name}); + this.$scope.model.userId = component.contactId; + this.$scope.model.icon = component.icon; + this.$scope.model.projectCode = component.projectCode; + this.$scope.model.isAlreadyCertified = component.isAlreadyCertified(); + + if(!this.$scope.component.isProduct()) { + this.$scope.model.category = this.convertCategoryOneArrayToString(component.categories); + } + + if(component.isProduct()) { + this.$scope.model.fullName = (component).fullName; + + } + + }; + + // Convert category string MainCategory_#_SubCategory to Array with one item (like the server except) + private convertCategoryStringToOneArray = ():Array => { + let tmp = this.$scope.model.category.split("_#_"); + let mainCategory = tmp[0]; + let subCategory = tmp[1]; + + // Find the selected category and add the relevant sub category. + let selectedMainCategory:IMainCategory = _.find(this.$scope.categories, function (item) { + return item["name"] === mainCategory + }); + let mainCategoryClone = jQuery.extend(true, {}, selectedMainCategory); + if(subCategory) { + mainCategoryClone['subcategories'] = [{ + "name": subCategory + }]; + } + let tmpSelected = mainCategoryClone; + + let result:Array = []; + result.push(tmpSelected); + + return result; + }; + + private convertCategoryOneArrayToString = (categories:Array):string => { + let mainCategory:string = categories[0].name; + let subCategory:string = ''; + if(categories[0].subcategories) { + subCategory = categories[0].subcategories[0].name; + } + return this.$scope.calculateUnique(mainCategory, subCategory); + }; + + } + +} diff --git a/catalog-ui/app/scripts/view-models/wizard/hierarchy-step/hierarchy-step.html b/catalog-ui/app/scripts/view-models/wizard/hierarchy-step/hierarchy-step.html new file mode 100644 index 0000000000..7fc3e9224f --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/hierarchy-step/hierarchy-step.html @@ -0,0 +1,40 @@ +
        + +
        + +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/wizard/hierarchy-step/hierarchy-step.less b/catalog-ui/app/scripts/view-models/wizard/hierarchy-step/hierarchy-step.less new file mode 100644 index 0000000000..74786c127a --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/hierarchy-step/hierarchy-step.less @@ -0,0 +1,125 @@ +.hierarchy-step { + margin-top: 35px; + + .scrollbar-container{ + max-height:400px; + .perfect-scrollbar; + } + + .dropdown-container { + position: relative; + display: inline-block; + width: 100%; + + &:after{ + top: 47%; + right: 1%; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none; + border-color: rgba(0, 0, 0, 0); + border-top-color: black; + border-width: 4px; + margin-left: -4px; + } + + .dropdown-input-text { + width: 100%; + padding: 4px 10px; + } + + .dropdown-content { + .perfect-scrollbar; + border: 1px solid #d8d8d8; + display: none; + position: absolute; + overflow: hidden; + width: 100%; + .bg_c; + max-height: 400px; + z-index: 999999; + + .dropdown-option { + border-bottom: 1px solid #d8d8d8; + display: inline-block; + width: 100%; + } + + .category-container{ + width: 250px; + float: left; + padding-left: 5px; + + .category { + .bold; + padding: 3px 3px 2px 3px; + &:after{ + .sprite; + .arrow-left; + content: ''; + margin-left: 5px; + transform: rotate(180deg); + } + } + .subcategory { + padding-left: 3px; + } + } + + .groupings-container{ + display: inline-block; + width: 424px; + border-left: 1px solid #d8d8d8; + min-height: 55px; + .group{ + padding: 3px 3px 3px 10px; + &:hover{ + .hand; + .bg_n; + } + &.disabled-group { + opacity: 0.5; + &:hover{ + cursor: auto; + .bg_c; + } + } + } + } + + .seperator { + height: 1px; + width: 100%; + .bg_j; + margin: 5px 0px; + } + } + .show { + display: block; + } + } + + .hierarchy-groups-container{ + .b_9; + width: 100%; + border: 1px solid #d8d8d8; + height: 425px; + padding: 15px; + text-align: center; + + .no-group-text{ + text-align: center; + margin-top:25px; + a { + cursor: pointer; + } + } + .group-tag{ + display: inline-block; + float: left; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/wizard/hierarchy-step/hierarchy-step.ts b/catalog-ui/app/scripts/view-models/wizard/hierarchy-step/hierarchy-step.ts new file mode 100644 index 0000000000..a974c0af81 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/hierarchy-step/hierarchy-step.ts @@ -0,0 +1,149 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels.Wizard { + 'use strict'; + + export interface IHierarchyStepScope extends IWizardCreationScope { + + categoriesOptions: Array; + product:Models.Components.Product; + isLoading:boolean; + showDropDown:boolean; + + onInputTextClicked():void; + onGroupSelected(category: Models.IMainCategory, subcategory: Models.ISubCategory, group: Models.IGroup):void; + clickOutside():void; + deleteGroup(uniqueId:string):void; + } + + export class HierarchyStepViewModel implements IWizardCreationStep { + + static '$inject' = [ + '$scope', + 'Sdc.Services.CacheService', + 'ComponentFactory' + ]; + + constructor(private $scope:IHierarchyStepScope, + private cacheService:Sdc.Services.CacheService, + private ComponentFactory: Sdc.Utils.ComponentFactory) { + + this.$scope.registerChild(this); + this.$scope.setValidState(true); + this.$scope.product = this.$scope.getComponent(); + this.initScope(); + } + + private initCategories = () => { + this.$scope.categoriesOptions = angular.copy(this.cacheService.get('productCategories')); + let selectedGroup:Array = []; + _.forEach(this.$scope.product.categories, (category: Models.IMainCategory) => { + _.forEach(category.subcategories, (subcategory:Models.ISubCategory) => { + selectedGroup = selectedGroup.concat(subcategory.groupings); + }); + }); + _.forEach(this.$scope.categoriesOptions, (category: Models.IMainCategory) => { + _.forEach(category.subcategories, (subcategory:Models.ISubCategory) => { + _.forEach(subcategory.groupings, (group:Models.ISubCategory) => { + let componentGroup:Models.IGroup = _.find(selectedGroup, (componentGroupObj) => { + return componentGroupObj.uniqueId == group.uniqueId; + }); + if(componentGroup){ + group.isDisabled = true; + } + }); + }); + }); + }; + + private setFormValidation = ():void => { + if(!this.$scope.product.categories || this.$scope.product.categories.length === 0){ + this.$scope.setValidState(false); + } + else{ + this.$scope.setValidState(true); + } + + }; + + private initScope = ():void => { + this.$scope.isLoading= false; + this.$scope.showDropDown =false; + this.initCategories(); + this.setFormValidation(); + + this.$scope.onGroupSelected = (category: Models.IMainCategory, subcategory: Models.ISubCategory, group: Models.IGroup):void => { + this.$scope.showDropDown = false; + this.$scope.product.addGroup(category, subcategory, group); + group.isDisabled = true; + this.setFormValidation(); + }; + + this.$scope.onInputTextClicked = ():void => {//just edit the component in place, no pop up nor server update ? + this.$scope.showDropDown = !this.$scope.showDropDown; + }; + + this.$scope.clickOutside = (): any => { + this.$scope.showDropDown = false; + }; + + this.$scope.deleteGroup = (uniqueId:string) : void => { + //delete group from component + this.$scope.product.deleteGroup(uniqueId); + this.setFormValidation(); + //enabled group + _.forEach(this.$scope.categoriesOptions, (category: Models.IMainCategory) => { + _.forEach(category.subcategories, (subcategory:Models.ISubCategory) => { + let groupObj:Models.IGroup = _.find (subcategory.groupings, (group) => { + return group.uniqueId === uniqueId; + }); + if(groupObj){ + groupObj.isDisabled = false; + } + }); + }); + } + }; + + public save = (callback:Function):void => { + let onFailed = (response) => { + callback(false); + }; + + let onSuccess = (component: Models.Components.Component) => { + this.$scope.product = this.ComponentFactory.createComponent(component); + this.$scope.setComponent(this.$scope.product); + callback(true); + }; + + try { + this.$scope.product.updateComponent().then(onSuccess, onFailed); + }catch(e){ + //console.log("ERROR: Error in updating/creating component: " + e); + callback(false); + } + }; + + public back = (callback:Function):void => { + this.save(callback); + } + } +} diff --git a/catalog-ui/app/scripts/view-models/wizard/icons-step/icons-step.html b/catalog-ui/app/scripts/view-models/wizard/icons-step/icons-step.html new file mode 100644 index 0000000000..2ae386283c --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/icons-step/icons-step.html @@ -0,0 +1,26 @@ +
        + +
        + +
        +
        +
        +
        + + +
        +
        +
        +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/wizard/icons-step/icons-step.less b/catalog-ui/app/scripts/view-models/wizard/icons-step/icons-step.less new file mode 100644 index 0000000000..c03c949962 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/icons-step/icons-step.less @@ -0,0 +1,55 @@ +.icons-step { + + .w-sdc-form { + padding-top: 0px; + padding-bottom: 0px; + .selected-icon-container { + text-align: left; + border: 1px solid #cfcfcf; + clear: both; + margin-bottom: 15px; + padding-left: 3px; + padding-bottom: 3px; + .selected-icon { + margin: 8px 5px 0px 6px; + } + } + + .suggested-icons-container { + text-align: left; + border: 1px solid #cfcfcf; + clear: both; + padding-left: 3px; + height: 340px; + margin-bottom: 0px; + + .suggested-icon-wrapper { + margin: 8px 5px 0px 6px; + display: inline-block; + + &.selected { + border: 1px solid @color_p; + border-radius: 25px; + box-shadow: 0 0 2px #888; + display: inline-block; + line-height: 0px; + padding: 2px; + } + + } + .suggested-icon { + // margin: 8px 5px 0px 6px; + display: inline-block; + &.disable{ + opacity: 0.4; + } + } + + + } + + .icons-label { + float: left; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/wizard/icons-step/icons-step.ts b/catalog-ui/app/scripts/view-models/wizard/icons-step/icons-step.ts new file mode 100644 index 0000000000..4dc5e377fa --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/icons-step/icons-step.ts @@ -0,0 +1,150 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels.Wizard { + 'use strict'; + + export interface IIconsStepScope extends IWizardCreationStepScope{ + icons : Array; + component: Models.Components.Component; + iconSprite: string; + setComponentIcon(iconSrc:string): void; + } + + export class IconsStepViewModel implements IWizardCreationStep { + + static '$inject' = [ + '$scope', + 'Sdc.Services.AvailableIconsService', + 'ComponentFactory' + ]; + + constructor(private $scope:IIconsStepScope, + private availableIconsService:Services.AvailableIconsService, + private ComponentFactory: Sdc.Utils.ComponentFactory) { + + this.$scope.registerChild(this); + this.$scope.component = this.$scope.getComponent(); + this.$scope.iconSprite = this.$scope.component.iconSprite; + this.initScope(); + this.initIcons(); + + if(this.$scope.component.isResource()) { + this.initVendor(); + } + // In case there is one icons select it. + if( this.$scope.icons.length == 1 && !this.$scope.component.isAlreadyCertified()){ + this.$scope.setComponentIcon(this.$scope.icons[0]); + } + } + + private initIcons = ():void => { + + // For subcategories that where created by admin, there is no icons + this.$scope.icons = new Array(); + if (this.$scope.component.categories && this.$scope.component.categories.length > 0) { + + _.forEach(this.$scope.component.categories, (category:Models.IMainCategory):void => { + if (category.icons) { + this.$scope.icons = this.$scope.icons.concat(category.icons); + } + if (category.subcategories) { + _.forEach(category.subcategories, (subcategory:Models.ISubCategory):void => { + if (subcategory.icons) { + this.$scope.icons = this.$scope.icons.concat(subcategory.icons); + } + }); + } + }); + } + + if (this.$scope.component.isResource()) { + let resourceType:string = this.$scope.component.getComponentSubType(); + if (resourceType === 'VL') { + this.$scope.icons = ['vl']; + } + if (resourceType === 'CP') { + this.$scope.icons = ['cp']; + } + } + + if (this.$scope.icons.length === 0) { + this.$scope.icons = this.availableIconsService.getIcons(this.$scope.component.componentType); + } + + }; + + private initVendor = ():void => { + let vendors:Array = this.availableIconsService.getIcons(this.$scope.component.componentType).slice(5, 19); + let vendorName = this.$scope.component.vendorName.toLowerCase(); + if ('at&t' === vendorName){ + vendorName = 'att'; + } + if ('nokia' === vendorName){ + vendorName = 'nokiasiemens'; + } + + let vendor:string = _.find(vendors, (vendor:string)=>{ + return vendor.replace(/[_]/g, '').toLowerCase() === vendorName; + }); + + if(vendor && this.$scope.icons.indexOf(vendor)===-1) { + this.$scope.icons.push(vendor); + } + }; + + private initScope():void { + this.$scope.icons = []; + + if(this.$scope.component.icon === Utils.Constants.DEFAULT_ICON){ + this.$scope.setValidState(false); + } + + this.$scope.setComponentIcon = (iconSrc:string):void => { + this.$scope.component.icon = iconSrc; + this.$scope.setValidState(true); + } + } + + save(callback:Function):void { + let onFailed = () => { + callback(false); + }; + + let onSuccess = (component:Models.Components.Component) => { + this.$scope.component = component; + this.$scope.setComponent(this.$scope.component); + callback(true); + }; + + try { + this.$scope.component.updateComponent().then(onSuccess, onFailed); + }catch(e){ + callback(false); + } + } + + public back = (callback:Function):void => { + this.save(callback); + } + + } + +} diff --git a/catalog-ui/app/scripts/view-models/wizard/properties-step/properties-step.html b/catalog-ui/app/scripts/view-models/wizard/properties-step/properties-step.html new file mode 100644 index 0000000000..4429451871 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/properties-step/properties-step.html @@ -0,0 +1,57 @@ +
        + +
        Add
        + +
        + +
        +
        +
        {{header.title}} + +
        +
        + +
        + +
        + +
        + There are no properties to display
        + click here to add one +
        +
        + +
        + + {{property.name}} + +
        + +
        + +
        + +
        + +
        + + +
        + + +
        +
        +
        +
        +
        + +
        +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/wizard/properties-step/properties-step.less b/catalog-ui/app/scripts/view-models/wizard/properties-step/properties-step.less new file mode 100644 index 0000000000..0d7dad8dc2 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/properties-step/properties-step.less @@ -0,0 +1,55 @@ +.properties-step { + + .w-sdc-classic-btn { + float: right; + margin-bottom: 10px; + } + + .table{ + height: 412px; + margin-bottom: 0; + } + + .table-container-flex { + margin-top: 0px; + + .text{ + overflow: hidden; + text-overflow: ellipsis; + display: inline-block; + white-space: nowrap; + padding: 5px 4px; + + } + + .flex-item:nth-child(1) { + flex-grow: 15; + + .hand; + span.table-arrow { + margin-right: 7px; + } + } + + .flex-item:nth-child(2) { + flex-grow: 6; + } + + .flex-item:nth-child(3) { + flex-grow: 9; + } + + .flex-item:nth-child(4) { + flex-grow: 3; + //padding-top: 10px; + padding: 10px 4px; + + } + + .flex-item:nth-child(5) { + flex-grow: 1; + } + + } + +} diff --git a/catalog-ui/app/scripts/view-models/wizard/properties-step/properties-step.ts b/catalog-ui/app/scripts/view-models/wizard/properties-step/properties-step.ts new file mode 100644 index 0000000000..08dfb5e153 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/properties-step/properties-step.ts @@ -0,0 +1,123 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels.Wizard { + 'use strict'; + + interface IPropertiesStepViewModelScope extends IWizardCreationStepScope { + component: Models.Components.Component; + tableHeadersList: Array; + reverse: boolean; + sortBy:string; + + addOrUpdateProperty(): void; + delete(property: Models.PropertyModel): void; + sort(sortBy:string): void; + } + + export class PropertiesStepViewModel implements IWizardCreationStep { + + static '$inject' = [ + '$scope', + '$filter', + '$modal', + '$templateCache', + 'ModalsHandler' + ]; + + + constructor( + private $scope:IPropertiesStepViewModelScope, + private $filter:ng.IFilterService, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService, + private ModalsHandler: Utils.ModalsHandler + ){ + + this.$scope.registerChild(this); + this.$scope.setValidState(true); + this.initScope(); + } + + public save = (callback:Function):void => { + this.$scope.setComponent(this.$scope.component); + callback(true); + }; + + public back = (callback:Function):void => { + this.$scope.setComponent(this.$scope.component); + callback(true); + } + + + private openEditPropertyModal = (property: Models.PropertyModel): void => { + let viewModelsHtmlBasePath: string = '/app/scripts/view-models/'; + + let modalOptions: ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get(viewModelsHtmlBasePath+'wizard/property-form/property-form.html'), + controller: 'Sdc.ViewModels.Wizard.PropertyFormViewModel', + size: 'sdc-md', + backdrop: 'static', + keyboard: false, + resolve: { + property: (): Models.PropertyModel => { + return property; + }, + component: (): Models.Components.Component => { + return this.$scope.getComponent(); + } + } + }; + this.$modal.open(modalOptions); + }; + + private initScope = (): void => { + + let self = this; + this.$scope.component = this.$scope.getComponent(); + this.$scope.sortBy = 'name'; + this.$scope.reverse = false; + + this.$scope.tableHeadersList = [ + {title:'Name', property: 'name'}, + {title:'Type', property: 'type'}, + {title:'Default Value', property: 'defaultValue'} + ]; + this.$scope.sort = (sortBy:string):void => { + this.$scope.reverse = (this.$scope.sortBy === sortBy) ? !this.$scope.reverse : false; + this.$scope.sortBy = sortBy; + }; + + this.$scope.addOrUpdateProperty = (property?: Models.PropertyModel): void => { + this.openEditPropertyModal(property ? property : new Models.PropertyModel()); + }; + + this.$scope.delete = (property: Models.PropertyModel): void => { + + let onOk = (): void => { + this.$scope.component.deleteProperty(property.uniqueId); + }; + let title:string = this.$filter('translate')("PROPERTY_VIEW_DELETE_MODAL_TITLE"); + let message:string = this.$filter('translate')("PROPERTY_VIEW_DELETE_MODAL_TEXT", "{'name': '" + property.name + "'}"); + this.ModalsHandler.openConfirmationModal(title, message, false).then(onOk); + }; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/wizard/property-form/property-form-view-model-tests.ts b/catalog-ui/app/scripts/view-models/wizard/property-form/property-form-view-model-tests.ts new file mode 100644 index 0000000000..3f390841ca --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/property-form/property-form-view-model-tests.ts @@ -0,0 +1,163 @@ +/*- + * ============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========================================================= + */ +/// + +describe("property form View Model ", () => { + + let $controllerMock:ng.IControllerService; + let $qMock:ng.IQService; + let $httpBackendMock:ng.IHttpBackendService; + let $scopeMock:Sdc.ViewModels.Wizard.IPropertyFormViewModelScope; + let $stateMock:ng.ui.IStateService; + let $stateParams:any; + let component = { + "uniqueId": "ece818e0-fd59-477a-baf6-e27461a7ce23", + "uuid": "8db823c2-6a9c-4636-8676-f5e713270dd7", + "contactId": "uf2345", + "category": "Network Layer 2-3/Router", + "creationDate": 1447235352429, + "description": "u", + "highestVersion": true, + "icon": "network", + "lastUpdateDate": 1447235370064, + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "name": "u", + "version": "0.1", + "type": 1, + "tags": [ + "u" + ], + "vendorName": "u", + "vendorRelease": "u", + "systemName": "U", + "$$hashKey": "object:34" + }; + + + beforeEach(angular.mock.module('sdcApp')); + + beforeEach(angular.mock.inject((_$controller_:ng.IControllerService, + _$httpBackend_:ng.IHttpBackendService, + _$rootScope_, + _$q_:ng.IQService, + _$state_:ng.ui.IStateService, + _$stateParams_:any) => { + + $controllerMock = _$controller_; + $httpBackendMock = _$httpBackend_ + $scopeMock = _$rootScope_.$new(); + $qMock = _$q_; + $stateMock = _$state_; + $stateParams = _$stateParams_; + + + //handle all http request thet not relevant to the tests + $httpBackendMock.expectGET(/.*languages\/en_US.json.*/).respond(200, JSON.stringify({})); + // $httpBackendMock.expectGET(/.*resources\/certified\/abstract.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*rest\/version.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*configuration\/ui.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*user\/authorize.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*categories\/services.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*categories\/resources.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET(/.*categories\/products.*/).respond(200, JSON.stringify({})); + $httpBackendMock.expectGET('http://feHost:8181/sdc1/feProxy/rest/version').respond(200, JSON.stringify({})); + + /** + * Mock the service + * @type {any} + */ + //getAllEntitiesDefered = $qMock.defer(); + //getAllEntitiesDefered.resolve(getAllEntitiesResponseMock); + //entityServiceMock = jasmine.createSpyObj('entityServiceMock', ['getAllComponents']); + //entityServiceMock.getAllComponents.and.returnValue(getAllEntitiesDefered.promise); + + // $stateParams['show'] = ''; + + /** + * Need to inject into the controller only the objects that we want to MOCK + * those that we need to change theirs behaviors + */ + $controllerMock(Sdc.ViewModels.Wizard.PropertyFormViewModel, { + '$scope': $scopeMock, + 'property': new Sdc.Models.PropertyModel(), + 'component': component, + }); + + })); + + describe("when Controller 'PropertyFormViewModel' created", () => { + + it('should have a regexp per each type', () => { + $scopeMock.$apply(); + expect(Object.keys($scopeMock.listRegex).length).toBe($scopeMock.editPropertyModel["simpleTypes"].length); + }); + + it('should have equal regexps for map and list', () => { + $scopeMock.$apply(); + expect(Object.keys($scopeMock.listRegex).length).toBe(Object.keys($scopeMock.mapRegex).length); + }); + + }); + + /*describe("when Controller 'DashboardViewModel' created", () => { + + it('should generate all entities', () => { + $scopeMock.$apply(); + expect($scopeMock.components.length).toBe(getAllEntitiesResponseMock.length); + }); + + + it('should show tutorial page ', () => { + $stateParams.show = 'tutorial'; + + $controllerMock(Sdc.ViewModels.DashboardViewModel, { + '$scope': $scopeMock, + '$stateParams': $stateParams, + 'Sdc.Services.EntityService': entityServiceMock, + //to complete injects + }); + + $scopeMock.$apply(); + expect($scopeMock.isFirstTime).toBeTruthy(); + expect($scopeMock.showTutorial).toBeTruthy(); + }); + + }); + + + describe("when function 'entitiesCount' invoked", () => { + + beforeEach(() => { + $controllerMock(Sdc.ViewModels.DashboardViewModel, { + '$scope': $scopeMock, + 'Sdc.Services.EntityService': entityServiceMock, + }); + $scopeMock.$apply(); + }); + + it('should return entities count per folder', () => { + + }); + + + });*/ +}); diff --git a/catalog-ui/app/scripts/view-models/wizard/property-form/property-form-view-model.ts b/catalog-ui/app/scripts/view-models/wizard/property-form/property-form-view-model.ts new file mode 100644 index 0000000000..5cb0ef1ddd --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/property-form/property-form-view-model.ts @@ -0,0 +1,250 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.ViewModels.Wizard { + 'use strict'; + + export interface IEditPropertyModel{ + property: Models.PropertyModel; + types: Array; + simpleTypes: Array; + sources: Array; + } + + export interface IPropertyFormViewModelScope extends ng.IScope{ + + $$childTail: any; + editForm:ng.IFormController; + forms:any; + footerButtons: Array; + isNew: boolean; + isLoading: boolean; + validationPattern: RegExp; + propertyNameValidationPattern: RegExp; + integerValidationPattern: RegExp; + floatValidationPattern: RegExp; + commentValidationPattern: RegExp; + listRegex: Sdc.Utils.IMapRegex; + mapRegex: Sdc.Utils.IMapRegex; + editPropertyModel: IEditPropertyModel; + modalInstanceProperty: ng.ui.bootstrap.IModalServiceInstance; + save(doNotCloseModal?: boolean): void; + saveAndAnother(): void; + getValidation(): RegExp; + validateIntRange(value:string):boolean; + close(): void; + onValueChange(): void; + onTypeChange(resetSchema:boolean): void; + showSchema(): boolean; + getValidationTranslate():string; + validateUniqueKeys(viewValue:string):boolean; + } + + export class PropertyFormViewModel{ + + private originalValue: string; + + static '$inject' = [ + '$scope', + '$modalInstance', + 'property', + 'ValidationPattern', + 'PropertyNameValidationPattern', + 'IntegerNoLeadingZeroValidationPattern', + 'FloatValidationPattern', + 'CommentValidationPattern', + 'ValidationUtils', + 'component' + ]; + + private formState: Utils.Constants.FormState; + private entityId: string; + private resourceInstanceUniqueId: string; + private readonly: boolean; + + constructor( + private $scope:IPropertyFormViewModelScope, + private $modalInstance: ng.ui.bootstrap.IModalServiceInstance, + private property : Models.PropertyModel, + private ValidationPattern : RegExp, + private PropertyNameValidationPattern: RegExp, + private IntegerNoLeadingZeroValidationPattern : RegExp, + private FloatValidationPattern : RegExp, + private CommentValidationPattern: RegExp, + private ValidationUtils: Sdc.Utils.ValidationUtils, + private component:Models.Components.Component + ){ + this.entityId = this.component.uniqueId; + this.formState = angular.isDefined(property.name) ? Utils.Constants.FormState.UPDATE : Utils.Constants.FormState.CREATE; + this.initScope(); + } + + + private initResource = (): void => { + this.$scope.editPropertyModel.property = new Sdc.Models.PropertyModel(this.property); + this.originalValue = this.property.defaultValue; + if(this.$scope.editPropertyModel.types.indexOf(this.property.type) === -1 && !this.$scope.isNew){ + this.property.type = "string"; + } + }; + + private initEditPropertyModel = (): void => { + this.$scope.editPropertyModel = { + property: null, + types: ['integer', 'string', 'float', 'boolean', 'list', 'map'], + simpleTypes: ['integer', 'string', 'float', 'boolean'], + sources: ['A&AI', 'Order', 'Runtime'] + }; + + this.initResource(); + }; + + private initScope = (): void => { + + this.$scope.modalInstanceProperty = this.$modalInstance; + //scope properties + this.$scope.validationPattern = this.ValidationPattern; + this.$scope.propertyNameValidationPattern = this.PropertyNameValidationPattern; + this.$scope.integerValidationPattern = this.IntegerNoLeadingZeroValidationPattern; + this.$scope.floatValidationPattern = this.FloatValidationPattern; + this.$scope.commentValidationPattern = this.CommentValidationPattern; + + //map & list validation patterns + this.$scope.listRegex = this.ValidationUtils.getPropertyListPatterns(); + this.$scope.mapRegex = this.ValidationUtils.getPropertyMapPatterns(); + + this.$scope.isLoading = false; + this.$scope.isNew = (this.formState === Utils.Constants.FormState.CREATE); + this.initEditPropertyModel(); + + //scope methods + this.$scope.save = (): void => { + this.$scope.editPropertyModel.property.description = this.ValidationUtils.stripAndSanitize(this.$scope.editPropertyModel.property.description); + this.$scope.isLoading = true; + + let onFailed = (response) => { + console.info('onFaild',response); + this.$scope.isLoading = false; + this.$scope.editPropertyModel.property.readonly = this.readonly; + this.$scope.editPropertyModel.property.resourceInstanceUniqueId = this.resourceInstanceUniqueId; + }; + + let onSuccess = (property: Models.PropertyModel): void => { + console.info('property added : ',property); + this.$scope.isLoading = false; + property.resourceInstanceUniqueId = this.resourceInstanceUniqueId; + property.readonly = (property.parentUniqueId !== this.component.uniqueId) /*|| this.component.isService()*/; + + this.$modalInstance.close(); + }; + + this.resourceInstanceUniqueId = this.$scope.editPropertyModel.property.resourceInstanceUniqueId; + this.readonly = this.$scope.editPropertyModel.property.readonly; + this.$scope.editPropertyModel.property.defaultValue = this.$scope.editPropertyModel.property.defaultValue ? this.$scope.editPropertyModel.property.defaultValue:null; + + this.component.addOrUpdateProperty(this.$scope.editPropertyModel.property).then(onSuccess, onFailed); + }; + + this.$scope.saveAndAnother = (): void => { + this.$scope.save(); + }; + + this.$scope.showSchema = () :boolean => { + return ['list', 'map'].indexOf(this.$scope.editPropertyModel.property.type) > -1; + }; + + this.$scope.getValidationTranslate = () : string => { + let result = "PROPERTY_EDIT_PATTERN"; + if (this.$scope.showSchema()) { + + result = "PROPERTY_EDIT_" + this.$scope.editPropertyModel.property.type.toUpperCase(); + + if(this.$scope.editPropertyModel.property.schema.property.type === 'string') { + result += "_STRING"; + } else { + result += "_GENERIC"; + } + } + + return result; + }; + + this.$scope.getValidation = () : RegExp => { + let type = this.$scope.editPropertyModel.property.type; + switch (type){ + case 'integer': + return this.$scope.integerValidationPattern; + case 'float': + return this.$scope.floatValidationPattern; + case 'list': + return this.$scope.listRegex[this.$scope.editPropertyModel.property.schema.property.type]; + case 'map': + return this.$scope.mapRegex[this.$scope.editPropertyModel.property.schema.property.type]; + default : + return null; + } + }; + + this.$scope.validateUniqueKeys = (viewValue:string) : boolean => { + if(this.$scope.editPropertyModel.property.type === 'map') { + return this.ValidationUtils.validateUniqueKeys(viewValue); + } + else { + return true; //always valid if not a map + } + }; + + this.$scope.validateIntRange = (value:string):boolean => { + return !value || this.ValidationUtils.validateIntRange(value); + }; + + this.$scope.close = (): void => { + this.$modalInstance.close(); + }; + + this.$scope.onValueChange = (): void => { + if(!this.$scope.editPropertyModel.property.defaultValue && this.$scope.editPropertyModel.property.required) { + this.$scope.editPropertyModel.property.defaultValue = this.originalValue; + } + }; + + this.$scope.onTypeChange = (resetSchema:boolean): void => { + this.$scope.editPropertyModel.property.defaultValue = ''; + if (resetSchema) { + this.$scope.editPropertyModel.property.schema.property.type = ''; + } + }; + + //new form layout for import asset + this.$scope.forms = {}; + this.$scope.footerButtons = [ + {'name': this.$scope.isNew ? 'Add' : 'Update', 'css':'blue', 'callback': this.$scope.save}, + {'name':'Cancel', 'css':'grey', 'callback': this.$scope.close} + ]; + + this.$scope.$watch('forms.editForm.$invalid', () => { + this.$scope.footerButtons[0].disabled = this.$scope.forms.editForm.$invalid; + }); + + } + + } +} diff --git a/catalog-ui/app/scripts/view-models/wizard/property-form/property-form.html b/catalog-ui/app/scripts/view-models/wizard/property-form/property-form.html new file mode 100644 index 0000000000..be237112a4 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/property-form/property-form.html @@ -0,0 +1,133 @@ + + +
        + +
        + +
        + +
        + + + +
        + + + +
        +
        + + +
        + + + +
        + +
        +
        + + +
        + + + + +
        + + + + +
        +
        + +
        + +
        + +
        + + + +
        + +
        +
        + +
        + + + +
        + + + +
        +
        + +
        + +
        +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/wizard/property-form/property-form.less b/catalog-ui/app/scripts/view-models/wizard/property-form/property-form.less new file mode 100644 index 0000000000..52b8564fdb --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/property-form/property-form.less @@ -0,0 +1,7 @@ +.sdc-add-property{ + + .w-sdc-form { + + } + +} diff --git a/catalog-ui/app/scripts/view-models/wizard/wizard-creation-base.html b/catalog-ui/app/scripts/view-models/wizard/wizard-creation-base.html new file mode 100644 index 0000000000..afa9307265 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/wizard-creation-base.html @@ -0,0 +1,12 @@ + +
        {{assetName}} | {{assetType}}
        + +
        +
        + +
        +
        + +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/wizard/wizard-creation-base.less b/catalog-ui/app/scripts/view-models/wizard/wizard-creation-base.less new file mode 100644 index 0000000000..591186789b --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/wizard-creation-base.less @@ -0,0 +1,60 @@ +.sdc-wizard-wrapper { + display: flex; + padding: 80px 0; + height: 620px; + // So input validation error will be shown outside the modal (long messages). + // overflow: hidden; + + .sdc-wizard-left-content { + width: 400px; + white-space: nowrap; + + .wizard-steps-line { + padding: 0 80px 0 0; + display: block; + } + + } + + .sdc-wizard-right-content { + margin-right: 200px; + /* background-color: #fafafa; */ + height: 100%; + width: 100%; + .perfect-scrollbar; + overflow: visible; + //.animation-duration(2s); + + .sdc-wizard-right-include { + + } + } + +} + +.sprite-green-tick.animated { + .animation-duration(3s); +} + +.sdc-wizard-name-type-label { + position: absolute; + top: 64px; + right: 40px; + + span { + .b_7; + &.name {.bold;} + &.sprite-green-tick { + position: absolute; + left: -22px; + top: 5px; + } + } + +} + +.w-wizard-footer { + button.cancel { + margin-right: 120px; + } +} diff --git a/catalog-ui/app/scripts/view-models/wizard/wizard-creation-base.ts b/catalog-ui/app/scripts/view-models/wizard/wizard-creation-base.ts new file mode 100644 index 0000000000..365d3aedf6 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/wizard-creation-base.ts @@ -0,0 +1,399 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels.Wizard { + 'use strict'; + + export class StepNames { + static general = "General"; + static icon = "Icon"; + static deploymentArtifact = "Deployment Artifact"; + static informationArtifact = "Information Artifact"; + static properties = "Properties"; + static hierarchy = "Hierarchy"; + } + + class FooterButtons { + static cancel = "Cancel"; + static back = "Back"; + static next = "Next"; + static finish = "Finish"; + } + + export class WizardCreationTypes { + static importAsset = "importAsset"; + static create = "create"; + static edit = "edit"; + } + + export class _CreationStep { + name:string; + url:string; + } + + export class CurrentStep { + assetCreationStep:_CreationStep; + reference:IWizardCreationStep; + index:number; + valid: boolean; + } + + export interface IWizardCreationStep { + save(callback:Function):void; + back(callback:Function):void; + } + + export interface IWizardCreationStepScope extends ng.IScope { + data:any; + getComponent():Sdc.Models.Components.Component; + setComponent(component: Sdc.Models.Components.Component):void; + registerChild(child:IWizardCreationStep):void; // Called from the step + setValidState(valid:boolean):void; // Called from the step + } + + export interface IWizardCreationScope extends ng.IScope { + isLoading: boolean; + data:any; // data passed from dashboard (opener), need it on the scope, because general step will use this (extends the scope) + directiveSteps: Array; // Steps for the directive, on the scope (on the scope because need to pass to directive via HTML) + templateUrl: string; // On the scope because need to pass to via HTML + footerButtons: Array; // Wizard footer buttons (on the scope because need to pass to directive via HTML) + assetCreationControl:any; // Link to wizard directive functions. + modalInstance:ng.ui.bootstrap.IModalServiceInstance; // Reference to the modal, so we can close it (on the scope because need to pass to directive via HTML) + assetName:string; + assetType:string; + modalTitle:string; + getComponent():Sdc.Models.Components.Component; + setComponent(component: Sdc.Models.Components.Component):void; + registerChild(child:IWizardCreationStep):void; // Called from the step + setValidState(valid:boolean):void; // Called from the step + } + + export class WizardCreationBaseViewModel { + + component: Sdc.Models.Components.Component; + protected assetCreationSteps: Array<_CreationStep>; // Contains URL and name so we can replace them + currentStep:CurrentStep; + protected type:string; + + constructor(protected $scope:IWizardCreationScope, + protected data:any, + protected ComponentFactory: Utils.ComponentFactory, + protected $modalInstance: ng.ui.bootstrap.IModalServiceInstance + ) { + + this.$scope.data = data; + this.currentStep = new CurrentStep(); + this.currentStep.valid=false; + this.$scope.modalInstance = this.$modalInstance; + this.initScope(); + this.noBackspaceNav(); + + // In case the modal was opened with filled resource (edit mode). + if (data.component){ + this.$scope.setComponent(data.component); + data.componentType = this.$scope.getComponent().componentType; + window.setTimeout(()=>{ + this.safeApply(this.setCurrentStepByIndex(0, false)); + },100); + } else { + // Default step to start with + window.setTimeout(()=>{ + this.safeApply(this.setCurrentStepByIndex(0, false)); + },100); + } + + } + + private safeApply = (fn:any) => { + let phase = this.$scope.$root.$$phase; + if (phase == '$apply' || phase == '$digest') { + if (fn && (typeof(fn) === 'function')) { + fn(); + } + } else { + this.$scope.$apply(fn); + } + }; + + private initScope = ():void => { + + // Control to call functions on wizard step directive + this.$scope.assetCreationControl = {}; + + // Footer buttons definitions for the modal directive. + this.$scope.footerButtons = [ + {"name":FooterButtons.cancel, "css":'white cancel',"callback": ()=>{this.btnCancelClicked();}}, + {"name":FooterButtons.back, "disabled":true, "css":'white back',"callback": ()=>{this.btnBackClicked();}}, + {"name":FooterButtons.next, "disabled":true, "css":'blue next',"callback": ()=>{this.btnNextClicked();}}, + {"name":FooterButtons.finish, "disabled":true, "css":'white finish',"callback": ()=>{this.btnFinishedClicked();}} + ]; + + // Will be called from step constructor to register him. + // So the current step will be the reference. + this.$scope.registerChild=(child:IWizardCreationStep):void => { + this.currentStep.reference=child; + }; + + // Will be called from each step to notify if the step is valid + // The wizard will set the "Next", "Finish" buttons accordingly. + this.$scope.setValidState = (valid:boolean):void => { + this.currentStep.valid=valid; + let currentDirectiveStep:Sdc.Directives.IWizardStep = this.$scope.directiveSteps[this.currentStep.index]; + this.$scope.assetCreationControl.setStepValidity(currentDirectiveStep, valid); + this.footerButtonsStateMachine(); + this.wizardButtonsIconsStateMachine(); + }; + + /** + * Will be called from each step to get current entity. + * This will return copy of the entity (not reference), because I do not want that the step will change entity parameters. + * If the step need to update the entity it can call setComponent function. + * @returns {Sdc.Models.IEntity} + */ + this.$scope.getComponent = ():Sdc.Models.Components.Component => { + return this.component; + }; + + // Will be called from each step after save to update the resource. + this.$scope.setComponent = (component:Sdc.Models.Components.Component):void => { + this.component = component; + }; + + }; + + protected setCurrentStepByName = (stepName:string):boolean => { + let stepIndex:number = this.getStepIndex(stepName); + return this.setCurrentStepByIndex(stepIndex); + }; + + // Set the current step, change the URL in ng-include. + protected setCurrentStepByIndex = (index:number, doSave:boolean=true):boolean => { + let result:boolean = false; + if (this.currentStep.index!==index) { // Check that not pressing on same step, also the first time currentStepIndex=undefined + if (doSave===true) { + this.callStepSave(() => { + // This section will be executed only if success save. + + // Set current step in the left wizard directive = valid + let currentDirectiveStep:Sdc.Directives.IWizardStep = this.$scope.directiveSteps[this.currentStep.index]; + this.$scope.assetCreationControl.setStepValidity(currentDirectiveStep, true); + + // Move to next step + let step:_CreationStep = this.assetCreationSteps[index]; + this.currentStep.index = index; + this.currentStep.assetCreationStep = step; + this.$scope.templateUrl = step.url; + + // Update the next/back buttons and steps buttons. + this.footerButtonsStateMachine(); + this.wizardButtonsIconsStateMachine(); + + // Can not perform step click without enabling the step + this.$scope.directiveSteps[index].enabled = true; // Need to set the step enabled, before clicking it. + this.$scope.assetCreationControl.stepClicked(step.name); + + // After saving the asset name and type will be shown in the top right of the screen. + this.fillAssetNameAndType(); + + result=true; + }); + } else { + // For the first time + let step:_CreationStep = this.assetCreationSteps[index]; + this.currentStep.index = index; + this.currentStep.assetCreationStep=step; + this.$scope.templateUrl = step.url; + this.$scope.directiveSteps[index].enabled = true; // Need to set the step enabled, before clicking it. + this.$scope.assetCreationControl.stepClicked(step.name); + result=true; + } + + //this.updateFooterButtonsStates(); + + } else { + result=true; + } + return result; + }; + + // Save the current step + private callStepSave = (successCallback:Function):void => { + this.$scope.isLoading = true; + this.currentStep.reference.save((result:boolean)=>{ + this.$scope.isLoading = false; + if (result===true){ + successCallback(); + } else { + // Set the next and finish button enabled. + //this.updateFooterButtonsStates(true); + } + }); + }; + + // Save the current step + private callStepBack = (successCallback:Function):void => { + this.$scope.isLoading = true; + this.currentStep.reference.back((result:boolean)=>{ + this.$scope.isLoading = false; + if (result===true){ + successCallback(); + } else { + // Set the next and finish button enabled. + //this.updateFooterButtonsStates(true); + } + }); + }; + + private getStepIndex = (stepName:string):number => { + let index:number=-1; + let tmp = _.find(this.assetCreationSteps, function (item, indx) { + index = indx; + return item.name === stepName; + }); + return index; + }; + + private btnNextClicked = ():void => { + if (this.hasNext()===true) { + let tmp = this.currentStep.index+1; + this.setCurrentStepByIndex(tmp); + } + }; + + private btnBackClicked = ():void => { + if (this.hasBack()===true) { + this.callStepBack(() => { + let tmp = this.currentStep.index-1; + this.setCurrentStepByIndex(tmp, false); + }); + } + }; + + private btnCancelClicked = ():void => { + this.$modalInstance.dismiss(this.$scope.getComponent()); + }; + + private btnFinishedClicked = ():void => { + this.callStepSave(() => { + this.$modalInstance.close(this.$scope.getComponent()); + }); + }; + + // Check if we can move next + private hasNext = ():boolean => { + if (this.assetCreationSteps.length-1>this.currentStep.index){ + return true; + } else { + return false; + } + }; + + // Check if we can move back + private hasBack = ():boolean => { + if (this.currentStep.index===0){ + return false; + } else { + return true; + } + }; + + private fillAssetNameAndType=():void => { + this.$scope.assetName = this.$scope.getComponent().name; + this.$scope.assetType = this.$scope.getComponent().getComponentSubType(); + + }; + + protected enableAllWizardSteps=():void => { + this.$scope.directiveSteps.forEach((step:Sdc.Directives.IWizardStep) => { + step.enabled=true; + }); + }; + + protected disableAllWizardSteps=():void => { + this.$scope.directiveSteps.forEach((step:Sdc.Directives.IWizardStep) => { + step.enabled=false; + }); + }; + + private footerButtonsStateMachine = ():void => { + //console.log("footerButtonsStateMachine, current step validity: " + this.currentStep.valid); + let stepIndex:number = this.currentStep.index; + let cancelButton = this.$scope.footerButtons[0]; + let backButton = this.$scope.footerButtons[1]; + let nextButton = this.$scope.footerButtons[2]; + let finishButton = this.$scope.footerButtons[3]; + + // NEXT button + // Disable next button if it is the last step, and if not check the validity of the step. + if (this.hasNext()){ + nextButton.disabled = !this.currentStep.valid; + } else { + nextButton.disabled = true; + } + + // BACK button + backButton.disabled = !this.hasBack(); + + // FINISH button + // If step 2 is valid show the finish button. + if (stepIndex>=1 && this.currentStep.valid===true) { + finishButton.disabled = false; + } + if (this.currentStep.valid===false){ + finishButton.disabled = true; + } + + // EDIT + if (this.type===WizardCreationTypes.edit && this.currentStep.valid===true){ + finishButton.disabled = false; + } + + }; + + + + private wizardButtonsIconsStateMachine = ():void => { + + // Enable or disable wizard directive next step, in case the current step form is valid or not. + let stepIndex:number = this.currentStep.index; + if (this.$scope.directiveSteps[stepIndex + 1]) { + this.$scope.directiveSteps[stepIndex + 1].enabled = this.currentStep.valid; + } + + // In case step 1 and 2 are valid, we can open all other steps. + if (this.$scope.directiveSteps[0].valid===true && this.$scope.directiveSteps[1].valid===true){ + // Enable all wizard directive steps + this.enableAllWizardSteps(); + } else if (this.currentStep.valid===false) { + // Disable all steps + this.disableAllWizardSteps(); + } + }; + + private noBackspaceNav:Function = ():void => { + this.$scope.$on('$locationChangeStart', (event, newUrl, oldUrl):void =>{ + event.preventDefault(); + }) + }; + + + } + +} diff --git a/catalog-ui/app/scripts/view-models/wizard/wizard-state/create-wizard.ts b/catalog-ui/app/scripts/view-models/wizard/wizard-state/create-wizard.ts new file mode 100644 index 0000000000..9490cddfdb --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/wizard-state/create-wizard.ts @@ -0,0 +1,114 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 3/15/2016. + */ +/// +module Sdc.ViewModels.Wizard { + 'use strict'; + + export class CreateWizardViewModel extends WizardCreationBaseViewModel { + + static '$inject' = [ + '$scope', + 'data', + 'ComponentFactory', + '$modalInstance' + ]; + + constructor(public $scope:IWizardCreationScope, + public data:any, + public ComponentFactory: Sdc.Utils.ComponentFactory, + public $modalInstance: ng.ui.bootstrap.IModalServiceInstance) { + + super($scope, data, ComponentFactory, $modalInstance); + this.type = WizardCreationTypes.create; + this.init(); + this.initCreateAssetScope(); + } + + private init = ():void => { + + switch (this.data.componentType){ + case Utils.Constants.ComponentType.RESOURCE: { + this.assetCreationSteps = [ + {"name": StepNames.general, "url": '/app/scripts/view-models/wizard/general-step/general-step.html'}, + {"name": StepNames.icon, "url": '/app/scripts/view-models/wizard/icons-step/icons-step.html'}, + {"name": StepNames.deploymentArtifact, "url": '/app/scripts/view-models/wizard/artifact-deployment-step/artifact-deployment-step.html'}, + {"name": StepNames.informationArtifact, "url": '/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.html'}, + {"name": StepNames.properties, "url": '/app/scripts/view-models/wizard/properties-step/properties-step.html'} + ]; + } + break; + + case Utils.Constants.ComponentType.SERVICE: { + this.assetCreationSteps = [ + {"name": StepNames.general, "url": '/app/scripts/view-models/wizard/general-step/general-step.html'}, + {"name": StepNames.icon, "url": '/app/scripts/view-models/wizard/icons-step/icons-step.html'} + ]; + } + break; + + case Utils.Constants.ComponentType.PRODUCT: { + this.assetCreationSteps = [ + {"name": StepNames.general, "url": '/app/scripts/view-models/wizard/general-step/general-step.html'}, + {"name": StepNames.hierarchy, "url": '/app/scripts/view-models/wizard/hierarchy-step/hierarchy-step.html'}, + {"name": StepNames.icon, "url": '/app/scripts/view-models/wizard/icons-step/icons-step.html'} + ]; + } + break; + } + }; + + private initCreateAssetScope = ():void => { + switch (this.data.componentType){ + case Utils.Constants.ComponentType.RESOURCE: { + this.$scope.directiveSteps = [ + {"name": StepNames.general, "enabled": true, "callback": ()=> {return this.setCurrentStepByName(StepNames.general);}}, + {"name": StepNames.icon, "enabled": false, "callback": ()=> {return this.setCurrentStepByName(StepNames.icon);}}, + {"name": StepNames.deploymentArtifact, "enabled": false, "callback": ()=> {return this.setCurrentStepByName(StepNames.deploymentArtifact);}}, + {"name": StepNames.informationArtifact, "enabled": false, "callback": ()=> {return this.setCurrentStepByName(StepNames.informationArtifact);}}, + {"name": StepNames.properties, "enabled": false, "callback": ()=> {return this.setCurrentStepByName(StepNames.properties);}} + ]; + this.$scope.modalTitle = "Create VF"; + break; + } + case Utils.Constants.ComponentType.SERVICE: { + this.$scope.directiveSteps = [ + {"name": StepNames.general, "enabled": true, "callback": ()=> {return this.setCurrentStepByName(StepNames.general);}}, + {"name": StepNames.icon, "enabled": false, "callback": ()=> {return this.setCurrentStepByName(StepNames.icon);}}, + + ]; + this.$scope.modalTitle = "Create Service"; + break; + } + case Utils.Constants.ComponentType.PRODUCT: { + this.$scope.directiveSteps = [ + {"name": StepNames.general, "enabled": true, "callback": ()=> {return this.setCurrentStepByName(StepNames.general);}}, + {"name": StepNames.hierarchy, "enabled":false, "callback": ()=> {return this.setCurrentStepByName(StepNames.hierarchy);}}, + {"name": StepNames.icon, "enabled": false, "callback": ()=> {return this.setCurrentStepByName(StepNames.icon);}} + ]; + this.$scope.modalTitle = "Create Product"; + break; + } + } + } + } +} diff --git a/catalog-ui/app/scripts/view-models/wizard/wizard-state/edit-wizard.ts b/catalog-ui/app/scripts/view-models/wizard/wizard-state/edit-wizard.ts new file mode 100644 index 0000000000..353c487e0a --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/wizard-state/edit-wizard.ts @@ -0,0 +1,164 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels.Wizard { + 'use strict'; + + export class EditWizardViewModel extends WizardCreationBaseViewModel { + + static '$inject' = [ + '$scope', + 'data', + 'ComponentFactory', + '$modalInstance' + ]; + + constructor(public $scope:IWizardCreationScope, + public data:any, + public ComponentFactory: Sdc.Utils.ComponentFactory, + public $modalInstance: ng.ui.bootstrap.IModalServiceInstance) { + + super($scope, data, ComponentFactory, $modalInstance); + this.type = WizardCreationTypes.edit; + this.init(); + this.initCreateAssetScope(); + + // Enable all wizard directive steps + this.enableAllWizardSteps(); + } + + private init = ():void => { + switch (this.data.component.componentType){ + case Utils.Constants.ComponentType.RESOURCE: { + if(this.data.component.isComplex()) { + this.assetCreationSteps = [ + { + "name": StepNames.general, + "url": '/app/scripts/view-models/wizard/general-step/general-step.html' + }, + { + "name": StepNames.icon, + "url": '/app/scripts/view-models/wizard/icons-step/icons-step.html' + }, + { + "name": StepNames.deploymentArtifact, + "url": '/app/scripts/view-models/wizard/artifact-deployment-step/artifact-deployment-step.html' + }, + { + "name": StepNames.informationArtifact, + "url": '/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.html' + }, + { + "name": StepNames.properties, + "url": '/app/scripts/view-models/wizard/properties-step/properties-step.html' + } + ]; + }else{ + this.assetCreationSteps = [ + {"name": StepNames.general, "url": '/app/scripts/view-models/wizard/general-step/general-step.html'}, + {"name": StepNames.icon, "url": '/app/scripts/view-models/wizard/icons-step/icons-step.html'}, + {"name": StepNames.informationArtifact, "url": '/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.html'}, + {"name": StepNames.properties, "url": '/app/scripts/view-models/wizard/properties-step/properties-step.html'} + ]; + } + break; + } + case Utils.Constants.ComponentType.SERVICE: { + this.assetCreationSteps = [ + {"name": StepNames.general, "url": '/app/scripts/view-models/wizard/general-step/general-step.html'}, + {"name": StepNames.icon, "url": '/app/scripts/view-models/wizard/icons-step/icons-step.html'} + ]; + break; + } + case Utils.Constants.ComponentType.PRODUCT: { + this.assetCreationSteps = [ + {"name": StepNames.general, "url": '/app/scripts/view-models/wizard/general-step/general-step.html'}, + {"name": StepNames.hierarchy, "url": '/app/scripts/view-models/wizard/hierarchy-step/hierarchy-step.html'}, + {"name": StepNames.icon, "url": '/app/scripts/view-models/wizard/icons-step/icons-step.html'} + ]; + break; + } + } + }; + + private initCreateAssetScope = ():void => { + switch (this.data.component.componentType){ + case Utils.Constants.ComponentType.RESOURCE: { + if(this.data.component.isComplex()) { + this.$scope.directiveSteps = [ + { + "name": StepNames.general, "enabled": true, "callback": ()=> { + return this.setCurrentStepByName(StepNames.general); + } + }, + { + "name": StepNames.icon, "enabled": false, "callback": ()=> { + return this.setCurrentStepByName(StepNames.icon); + } + }, + { + "name": StepNames.deploymentArtifact, "enabled": false, "callback": ()=> { + return this.setCurrentStepByName(StepNames.deploymentArtifact); + } + }, + { + "name": StepNames.informationArtifact, "enabled": false, "callback": ()=> { + return this.setCurrentStepByName(StepNames.informationArtifact); + } + }, + { + "name": StepNames.properties, "enabled": false, "callback": ()=> { + return this.setCurrentStepByName(StepNames.properties); + } + } + ]; + }else{ + this.$scope.directiveSteps = [ + {"name": StepNames.general, "enabled": true, "callback": ()=> {return this.setCurrentStepByName(StepNames.general);}}, + {"name": StepNames.icon, "enabled": false, "callback": ()=> {return this.setCurrentStepByName(StepNames.icon);}}, + {"name": StepNames.informationArtifact, "enabled": false, "callback": ()=> {return this.setCurrentStepByName(StepNames.informationArtifact);}}, + {"name": StepNames.properties, "enabled": false, "callback": ()=> {return this.setCurrentStepByName(StepNames.properties);}} + ]; + } + this.$scope.modalTitle = "Edit " + this.data.component.resourceType; + break; + } + case Utils.Constants.ComponentType.SERVICE: { + this.$scope.directiveSteps = [ + {"name": StepNames.general, "enabled": true, "callback": ()=> {return this.setCurrentStepByName(StepNames.general);}}, + {"name": StepNames.icon, "enabled": false, "callback": ()=> {return this.setCurrentStepByName(StepNames.icon);}} + ]; + this.$scope.modalTitle = "Edit Service"; + break; + } + case Utils.Constants.ComponentType.PRODUCT: { + this.$scope.directiveSteps = [ + {"name": StepNames.general, "enabled": true, "callback": ()=> {return this.setCurrentStepByName(StepNames.general);}}, + {"name": StepNames.hierarchy, "enabled":false, "callback": ()=> {return this.setCurrentStepByName(StepNames.hierarchy);}}, + {"name": StepNames.icon, "enabled": false, "callback": ()=> {return this.setCurrentStepByName(StepNames.icon);}} + ]; + this.$scope.modalTitle = "Edit Product"; + break; + } + } + } + } +} + diff --git a/catalog-ui/app/scripts/view-models/wizard/wizard-state/import-wizard.ts b/catalog-ui/app/scripts/view-models/wizard/wizard-state/import-wizard.ts new file mode 100644 index 0000000000..5fe1bf7e59 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/wizard/wizard-state/import-wizard.ts @@ -0,0 +1,64 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels.Wizard { + 'use strict'; + + export class ImportWizardViewModel extends WizardCreationBaseViewModel { + + static '$inject' = [ + '$scope', + 'data', + 'ComponentFactory', + '$modalInstance' + ]; + + constructor(public $scope:IWizardCreationScope, + public data:any, + public ComponentFactory: Sdc.Utils.ComponentFactory, + public $modalInstance: ng.ui.bootstrap.IModalServiceInstance) { + + super($scope, data, ComponentFactory, $modalInstance ); + this.type = WizardCreationTypes.importAsset; + this.init(); + this.initImportAssetScope(); + } + + private init = ():void => { + this.assetCreationSteps = [ + {"name": StepNames.general, "url": '/app/scripts/view-models/wizard/general-step/general-step.html'}, + {"name": StepNames.icon, "url": '/app/scripts/view-models/wizard/icons-step/icons-step.html'}, + {"name": StepNames.informationArtifact, "url": '/app/scripts/view-models/wizard/artifact-information-step/artifact-information-step.html'}, + {"name": StepNames.properties, "url": '/app/scripts/view-models/wizard/properties-step/properties-step.html'} + ]; + }; + + private initImportAssetScope = ():void => { + this.$scope.directiveSteps = [ + {"name": StepNames.general, "enabled": true, "callback": ()=> {return this.setCurrentStepByName(StepNames.general);}}, + {"name": StepNames.icon, "enabled": false, "callback": ()=> {return this.setCurrentStepByName(StepNames.icon);}}, + {"name": StepNames.informationArtifact, "enabled": false, "callback": ()=> {return this.setCurrentStepByName(StepNames.informationArtifact);}}, + {"name": StepNames.properties, "enabled": false, "callback": ()=> {return this.setCurrentStepByName(StepNames.properties);}} + ]; + + this.$scope.modalTitle = "Import Asset"; + }; + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/activity-log/activity-log.html b/catalog-ui/app/scripts/view-models/workspace/tabs/activity-log/activity-log.html new file mode 100644 index 0000000000..23c08f6ec6 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/activity-log/activity-log.html @@ -0,0 +1,85 @@ +
        + +
        + +
        + +
        +
        + + +
        +
        {{header.title}} + +
        +
        + + +
        + + + +
        + There are no logs to display +
        + + +
        + + +
        + {{item.dateFormat}} +
        + + +
        + {{item.ACTION}} +
        + + +
        + {{item.COMMENT}} +
        + + +
        + {{item.MODIFIER}} +
        + + +
        + {{item.STATUS}} + +
        + +
        + +
        +
        +
        +
        + +
        + + + + diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/activity-log/activity-log.less b/catalog-ui/app/scripts/view-models/workspace/tabs/activity-log/activity-log.less new file mode 100644 index 0000000000..61bb3e9f01 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/activity-log/activity-log.less @@ -0,0 +1,83 @@ +.activity-log { + + margin-top: 30px; + + .title-wrapper { + display: flex; + justify-content: flex-end; + } + + .table-container-flex .table .body .scrollbar-container { + max-height: 448px; + } + + .view-mode { + background-color: @main_color_p; + } + + .table{ + height: 490px; + margin-bottom: 0; + } + + .table-container-flex { + margin-top: 10px; + + .flex-item:nth-child(1) { width: 200px; } + .flex-item:nth-child(2) { flex-grow: 20; } + .flex-item:nth-child(3) { flex-grow: 30; } + .flex-item:nth-child(4) { flex-grow: 20; } + .flex-item:nth-child(5) { width: 80px; } + + .success { + position: absolute; + top: 11px; + right: 20px; + .sprite-new; + .sdc-success; + } + + .error { + position: absolute; + top: 11px; + right: 20px; + .sprite-new; + .sdc-error; + } + + } + + .data-row { + position: relative; + } + + .top-search { + float: right; + position: relative; + + input.search-text { + .border-radius(2px); + width: 245px; + height: 32px; + line-height: 32px; + border: 1px solid @main_color_o; + margin: 0; + outline: none; + text-indent: 10px; + + &::-webkit-input-placeholder { font-style: italic; } /* Safari, Chrome and Opera */ + &:-moz-placeholder { font-style: italic; } /* Firefox 18- */ + &::-moz-placeholder { font-style: italic; } /* Firefox 19+ */ + &:-ms-input-placeholder { font-style: italic; } /* IE 10+ */ + &:-ms-input-placeholder { font-style: italic; } /* Edge */ + } + + .magnification { + position: absolute; + top: 10px; + right: 10px; + } + + } + +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/activity-log/activity-log.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/activity-log/activity-log.ts new file mode 100644 index 0000000000..665d0c0ef6 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/activity-log/activity-log.ts @@ -0,0 +1,122 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + export interface IActivityLogViewModelScope extends IWorkspaceViewModelScope { + activityDateArray: Array; //this is in order to sort the dates + activityLog: Array; + preVersion:string; + + tableHeadersList: Array; + reverse: boolean; + sortBy:string; + searchBind:string; + + getActivityLog(uniqueId:string):void; + onVersionChanged(version:any) : void; + parseAction(action:string):string; + sort(sortBy:string): void; + } + + export class ActivityLogViewModel { + + static '$inject' = [ + '$scope', + '$state', + 'Sdc.Services.ActivityLogService' + ]; + + constructor(private $scope:IActivityLogViewModelScope, + private $state:ng.ui.IStateService, + private activityLogService:Services.ActivityLogService + ) { + + this.initScope(); + this.$scope.setValidState(true); + this.initSortedTableScope(); + this.$scope.updateSelectedMenuItem(); + + // Set default sorting + this.$scope.sortBy = 'logDate'; + } + + private initScope():void { + + this.$scope.preVersion = this.$scope.component.version; + + this.$scope.onVersionChanged = (version:any):void => { + if (version.versionNumber != this.$scope.component.version) { + this.$scope.isLoading = true; + this.$scope.getActivityLog(version.versionId); + } + }; + + this.$scope.getActivityLog = (uniqueId:any):void => { + + let onError = (response) => { + this.$scope.isLoading = false; + console.info('onFaild', response); + + }; + + let onSuccess = (response:Array) => { + this.$scope.activityLog = _.sortBy(response, function(o) { return o.TIMESTAMP; }); //response; // + this.$scope.isLoading = false; + }; + + this.$scope.isLoading = true; + if (this.$scope.component.isResource()) { + this.activityLogService.getActivityLogService('resources', uniqueId).then(onSuccess, onError); + } + if (this.$scope.component.isService()) { + this.activityLogService.getActivityLogService('services', uniqueId).then(onSuccess, onError); + } + + }; + + if (!this.$scope.activityLog || this.$scope.preVersion != this.$scope.component.version) { + this.$scope.getActivityLog(this.$scope.component.uniqueId); + } + + this.$scope.parseAction = (action:string) => { + return action ? action.split(/(?=[A-Z])/).join(' ') : ''; + }; + + } + + private initSortedTableScope = ():void => { + this.$scope.tableHeadersList = [ + {title: 'Date', property: 'logDate'}, + {title: 'Action', property: 'logAction'}, + {title: 'Comment', property: 'logComment'}, + {title: 'Username', property: 'logUsername'}, + {title: 'Status', property: 'logStatus'} + ]; + + this.$scope.sort = (sortBy:string):void => { + this.$scope.reverse = (this.$scope.sortBy === sortBy) ? !this.$scope.reverse : false; + this.$scope.sortBy = sortBy; + }; + }; + + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/attributes/attributes-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/attributes/attributes-view-model.ts new file mode 100644 index 0000000000..469da6a2e1 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/attributes/attributes-view-model.ts @@ -0,0 +1,107 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + interface IAttributesViewModelScope extends IWorkspaceViewModelScope { + tableHeadersList: Array; + reverse: boolean; + sortBy:string; + + addOrUpdateAttribute(attribute?:Models.AttributeModel): void; + delete(attribute:Models.AttributeModel): void; + sort(sortBy:string): void; + } + + export class AttributesViewModel { + + static '$inject' = [ + '$scope', + '$filter', + '$modal', + '$templateCache', + 'ModalsHandler' + ]; + + + constructor(private $scope:IAttributesViewModelScope, + private $filter:ng.IFilterService, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService, + private ModalsHandler:Utils.ModalsHandler) { + this.initScope(); + this.$scope.updateSelectedMenuItem(); + } + + + private openEditAttributeModal = (attribute:Models.AttributeModel):void => { + let viewModelsHtmlBasePath:string = '/app/scripts/view-models/'; + + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get(viewModelsHtmlBasePath + 'forms/attribute-form/attribute-form-view.html'), + controller: 'Sdc.ViewModels.AttributeFormViewModel', + size: 'sdc-md', + backdrop: 'static', + keyboard: false, + resolve: { + attribute: ():Models.AttributeModel => { + return attribute; + }, + component: ():Models.Components.Component => { + return this.$scope.component; + } + } + }; + this.$modal.open(modalOptions); + }; + + private initScope = ():void => { + + //let self = this; + this.$scope.sortBy = 'name'; + this.$scope.reverse = false; + this.$scope.setValidState(true); + this.$scope.tableHeadersList = [ + {title: 'Name', property: 'name'}, + {title: 'Type', property: 'type'}, + {title: 'Default Value', property: 'defaultValue'} + ]; + this.$scope.sort = (sortBy:string):void => { + this.$scope.reverse = (this.$scope.sortBy === sortBy) ? !this.$scope.reverse : false; + this.$scope.sortBy = sortBy; + }; + + this.$scope.addOrUpdateAttribute = (attribute?:Models.AttributeModel):void => { + this.openEditAttributeModal(attribute ? attribute : new Models.AttributeModel()); + }; + + this.$scope.delete = (attribute:Models.AttributeModel):void => { + + let onOk = ():void => { + this.$scope.component.deleteAttribute(attribute.uniqueId); + }; + let title:string = this.$filter('translate')("ATTRIBUTE_VIEW_DELETE_MODAL_TITLE"); + let message:string = this.$filter('translate')("ATTRIBUTE_VIEW_DELETE_MODAL_TEXT", "{'name': '" + attribute.name + "'}"); + this.ModalsHandler.openConfirmationModal(title, message, false).then(onOk); + }; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/attributes/attributes-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/attributes/attributes-view.html new file mode 100644 index 0000000000..59ba933a0a --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/attributes/attributes-view.html @@ -0,0 +1,52 @@ +
        +
        Add
        +
        +
        +
        +
        {{header.title}} + +
        +
        + +
        + +
        + +
        + There are no attributes to display
        + click here to add one + +
        +
        + +
        + + {{attribute.name}} + +
        + +
        + +
        + +
        + +
        + + +
        +
        +
        +
        +
        +
        + +
        +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/attributes/attributes.less b/catalog-ui/app/scripts/view-models/workspace/tabs/attributes/attributes.less new file mode 100644 index 0000000000..ffd28afce4 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/attributes/attributes.less @@ -0,0 +1,54 @@ +.workspace-attributes { + + width: 93%; + display: inline-block; + .w-sdc-classic-btn { + float: right; + margin-bottom: 10px; + } + + .table{ + height:490px; + margin-bottom: 0; + } + + .table-container-flex { + margin-top: 27px; + + .text{ + overflow: hidden; + text-overflow: ellipsis; + display: inline-block; + white-space: nowrap; + } + + .flex-item:nth-child(1) { + flex-grow: 15; + + .hand; + span.table-arrow { + margin-right: 7px; + } + } + + .flex-item:nth-child(2) { + flex-grow: 6; + } + + .flex-item:nth-child(3) { + flex-grow: 9; + } + + .flex-item:nth-child(4) { + flex-grow: 3; + padding-top: 10px; + } + + .flex-item:nth-child(5) { + flex-grow: 1; + + } + + } + +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/composition-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/composition-view-model.ts new file mode 100644 index 0000000000..f8eeaf7f64 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/composition-view-model.ts @@ -0,0 +1,232 @@ +/*- + * ============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========================================================= + */ + +/// +module Sdc.ViewModels { + 'use strict'; + + export interface ICompositionViewModelScope extends IWorkspaceViewModelScope { + + currentComponent: Models.Components.Component; + selectedComponent: Models.Components.Component; + isLoading: boolean; + graphApi:any; + sharingService:Sdc.Services.SharingService; + sdcMenu:Models.IAppMenu; + version:string; + isViewOnly:boolean; + isLoadingRightPanel:boolean; + setComponent(component: Models.Components.Component); + isComponentInstanceSelected():boolean; + updateSelectedComponent(): void + openUpdateModal(); + deleteSelectedComponentInstance():void; + onBackgroundClick():void; + setSelectedInstance(componentInstance: Models.ComponentsInstances.ComponentInstance): void; + printScreen():void; + + cacheComponentsInstancesFullData: Models.Components.Component; + } + + export class CompositionViewModel { + + static '$inject' = [ + '$scope', + '$log', + 'sdcMenu', + 'MenuHandler', + '$modal', + '$templateCache', + '$state', + 'Sdc.Services.SharingService', + '$filter', + 'Sdc.Services.CacheService', + 'ComponentFactory', + 'ChangeLifecycleStateHandler', + 'LeftPaletteLoaderService', + 'ModalsHandler', + 'EventListenerService' + ]; + + constructor(private $scope:ICompositionViewModelScope, + private $log: ng.ILogService, + private sdcMenu:Models.IAppMenu, + private MenuHandler: Utils.MenuHandler, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService, + private $state:ng.ui.IStateService, + private sharingService:Services.SharingService, + private $filter:ng.IFilterService, + private cacheService:Services.CacheService, + private ComponentFactory: Utils.ComponentFactory, + private ChangeLifecycleStateHandler: Sdc.Utils.ChangeLifecycleStateHandler, + private LeftPaletteLoaderService: Services.Components.LeftPaletteLoaderService, + private ModalsHandler: Sdc.Utils.ModalsHandler, + private eventListenerService:Services.EventListenerService) { + + this.$scope.setValidState(true); + this.initScope(); + this.$scope.updateSelectedMenuItem(); + this.registerGraphEvents(this.$scope); + } + private cacheComponentsInstancesFullData: Array; + + private initComponent = ():void => { + + this.$scope.currentComponent = this.$scope.component; + this.$scope.selectedComponent = this.$scope.currentComponent; + this.updateUuidMap(); + this.$scope.isViewOnly = this.$scope.isViewMode(); + }; + private registerGraphEvents = (scope:ICompositionViewModelScope):void => { + + this.eventListenerService.registerObserverCallback(Utils.Constants.GRAPH_EVENTS.ON_NODE_SELECTED, scope.setSelectedInstance); + this.eventListenerService.registerObserverCallback(Utils.Constants.GRAPH_EVENTS.ON_GRAPH_BACKGROUND_CLICKED, scope.onBackgroundClick); + + } + private openUpdateComponentInstanceNameModal = ():void => { + + let viewModelsHtmlBasePath:string = '/app/scripts/view-models/'; + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get(viewModelsHtmlBasePath + 'forms/resource-instance-name-form/resource-instance-name-view.html'), + controller: 'Sdc.ViewModels.ResourceInstanceNameViewModel', + size: 'sdc-sm', + backdrop: 'static', + resolve: { + component: ():Models.Components.Component => { + return this.$scope.currentComponent; + + } + } + }; + + let modalInstance:ng.ui.bootstrap.IModalServiceInstance = this.$modal.open(modalOptions); + modalInstance.result.then(():void => { + this.eventListenerService.notifyObservers(Utils.Constants.GRAPH_EVENTS.ON_COMPONENT_INSTANCE_NAME_CHANGED, this.$scope.currentComponent.selectedInstance); + //this.$scope.graphApi.updateNodeName(this.$scope.currentComponent.selectedInstance); + }); + }; + + private removeSelectedComponentInstance = ():void => { + this.eventListenerService.notifyObservers(Utils.Constants.GRAPH_EVENTS.ON_DELETE_MULTIPLE_COMPONENTS); + }; + + private updateUuidMap = ():void => { + /** + * In case user press F5, the page is refreshed and this.sharingService.currentEntity will be undefined, + * but after loadService or loadResource this.sharingService.currentEntity will be defined. + * Need to update the uuidMap with the new resource or service. + */ + this.sharingService.addUuidValue(this.$scope.currentComponent.uniqueId,this.$scope.currentComponent.uuid); + }; + + private initScope = ():void => { + + this.$scope.sharingService = this.sharingService; + this.$scope.sdcMenu = this.sdcMenu; + this.$scope.isLoading = false; + this.$scope.isLoadingRightPanel = false; + this.$scope.graphApi = {}; + this.$scope.version = this.cacheService.get('version'); + this.initComponent(); + + this.cacheComponentsInstancesFullData = new Array(); + + this.$scope.isComponentInstanceSelected = ():boolean => { + return this.$scope.currentComponent && this.$scope.currentComponent.selectedInstance != undefined && this.$scope.currentComponent.selectedInstance != null; + }; + + this.$scope.updateSelectedComponent = (): void => { + if(this.$scope.currentComponent.selectedInstance){ + + let componentParent = _.find(this.cacheComponentsInstancesFullData, (component) => { + return component.uniqueId === this.$scope.currentComponent.selectedInstance.componentUid; + }); + if(componentParent) { + this.$scope.selectedComponent = componentParent; + } + else { + try { + let onSuccess = (component:Models.Components.Component) => { + this.$scope.isLoadingRightPanel = false; + this.$scope.selectedComponent = component; + this.cacheComponentsInstancesFullData.push(component); + }; + let onError = (component:Models.Components.Component) => { + console.log("Error updating selected component"); + this.$scope.isLoadingRightPanel = false; + }; + this.ComponentFactory.getComponentFromServer(this.$scope.currentComponent.selectedInstance.originType, this.$scope.currentComponent.selectedInstance.componentUid).then(onSuccess, onError); + } catch(e){ + console.log("Error updating selected component", e); + this.$scope.isLoadingRightPanel = false; + } + } + } + else { + this.$scope.selectedComponent = this.$scope.currentComponent; + } + }; + + this.$scope.setSelectedInstance = (selectedComponent:Models.ComponentsInstances.ComponentInstance):void => { + + this.$log.debug('composition-view-model::onNodeSelected:: with id: '+ selectedComponent.uniqueId); + this.$scope.currentComponent.setSelectedInstance(selectedComponent); + this.$scope.updateSelectedComponent(); + + if (this.$state.current.name === 'workspace.composition.api') { + this.$state.go('workspace.composition.details'); + } + if (this.$state.current.name === 'workspace.composition.relations' && this.$scope.currentComponent.isProduct()) { + this.$state.go('workspace.composition.details'); + } + }; + + this.$scope.onBackgroundClick = ():void => { + this.$scope.currentComponent.selectedInstance = null; + this.$scope.selectedComponent = this.$scope.currentComponent; + + if (this.$state.current.name === 'workspace.composition.api') { + this.$state.go('workspace.composition.details'); + } + }; + + this.$scope.openUpdateModal = ():void => { + this.openUpdateComponentInstanceNameModal(); + }; + + this.$scope.deleteSelectedComponentInstance = ():void => { + let state = "deleteInstance"; + let onOk = ():void => { + this.removeSelectedComponentInstance(); + //this.$scope.graphApi.deleteSelectedNodes(); + }; + let title:string = this.$scope.sdcMenu.alertMessages[state].title; + let message:string = this.$scope.sdcMenu.alertMessages[state].message.format([this.$scope.currentComponent.selectedInstance.name]); + this.ModalsHandler.openAlertModal(title, message).then(onOk); + }; + + this.$scope.setComponent = (component: Models.Components.Product):void => { + this.$scope.currentComponent = component; + } + + } + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/composition-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/composition-view.html new file mode 100644 index 0000000000..4efc74c31b --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/composition-view.html @@ -0,0 +1,99 @@ +
        + +
        + + + + + + + + +
        + +
        + +
        + +
        + +
        +
        +
        +
        +
        +
        + + +
        + +
        +
        + +
        + + + + + + + + +
        + +
        + + + +
        +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/composition.less b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/composition.less new file mode 100644 index 0000000000..4c4c0a87a5 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/composition.less @@ -0,0 +1,864 @@ + +.composition{ + .sdc-workspace-container{ + .w-sdc-main-container{ + .w-sdc-main-right-container{ + left:0; + .sdc-workspace-top-bar { + padding-left: 295px; + .not-latest{ + left: 270px; + } + } + .w-sdc-main-container-body-content{ + padding: 0 0 0 247px; + } + + > div:first-child{ + padding: 0; + } + } + } + } +} + +.workspace-composition { + height:100%; + display: block; + text-align: left; + align-items: left; + padding: 0; + + + + // --------------------------------------------------------------------------------------------------- + // Sidebar + // --------------------------------------------------------------------------------------------------- + + + + .w-sdc-designer-sidebar-toggle { + background-color: @main_color_p; + border-left: 1px solid @main_color_o; + border-bottom: 1px solid @main_color_o; + height: 21px; + position: absolute; + right: 0; + top: 53px; + width: 17px; + transition: right 0.2s; + z-index: 10; + .box-shadow(-1px 1px 3px 0 @main_color_n); + + &.active { + right: 302px; + .w-sdc-designer-sidebar-toggle-icon{ + transform: rotate(180deg); + } + } + + } + + .w-sdc-designer-sidebar-toggle-icon { + margin-left: 6px; + margin-top: 6px; + } + + .w-sdc-designer-sidebar { + background-color:@main_color_p ; + .noselect; + bottom: 0; + position: fixed; + right: -302px; + width: 302px; + top: 102px; + transition: right 0.2s; + z-index: 9; + .box-shadow(-7px -3px 6px -8px @main_color_n); + + } + + .w-sdc-designer-sidebar-toggle.active + .w-sdc-designer-sidebar { + right: 0; + + } + + .w-sdc-designer-sidebar-head { + padding: 36px 30px 30px 30px; + height: 120px; + } + + .w-sdc-designer-sidebar-logo-ph { + display: inline-block; + vertical-align: middle; + line-height: 48px; + height: 48px; + } + + .w-sdc-designer-sidebar-logo { + .g_6; + display: inline-block; + margin-left: 10px; + font-weight: 500; + } + + .w-sdc-designer-sidebar-logo-title { + .s_16_r; + .selectable; + vertical-align: middle; + text-overflow: ellipsis; + max-width: 167px; + display: inline-block; + white-space: nowrap; + overflow: hidden; + } + + .w-sdc-designer-update-resource-icon { + .hand; + position: absolute; + right: 20px; + top: 10px; + } + + .w-sdc-designer-delete-resource-icon { + .hand; + position: absolute; + right: 40px; + top: 10px; + } + + .w-sdc-designer-sidebar-tabs { + .bg_e; + } + + .w-sdc-designer-sidebar-tabs::after { + clear: both; + content: ''; + display: table; + } + + .i-sdc-designer-sidebar-tab { + background-color: @main_color_p; + border: 1px solid @tlv_color_u;; + border-left: none; + display: inline-block; + float: left; + height: 36px; + padding-top: 9px; + text-align: center; + width: 50px; + .hand; + + &:focus { + outline: none; + } + &.tab-disabled { + /* .disabled; */ + } + &.active, &:hover:enabled { + background-color: @tlv_color_u; + .i-sdc-designer-sidebar-tab-icon { + opacity: 1; + + + } + + } + + div& { + padding-top: 0; + } + /*for tooltip on disabled buttons*/ + } + + .i-sdc-designer-sidebar-tab-icon { + margin-top: 5px ; + // opacity: .4; + } + + .w-sdc-designer-sidebar-tab-content { + .perfect-scrollbar; + height: 100%; + } + + .w-sdc-designer-sidebar-tab-content-view { + position: absolute; + top: 156px; + bottom: 0px; + width: 100%; + + } + + .w-sdc-designer-sidebar-section { + } + + .w-sdc-designer-sidebar-section-title { + .m_14_m; + background-color: @tlv_color_u; + .hand; + clear: both; + height: 32px; + line-height: 32px; + margin-top: 1px; + padding: 0 40px 0 20px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + position: relative; + width: 100%; + display: block; + + &.expanded { + .w-sdc-designer-sidebar-section-title-icon { + transform: rotate(180deg); + } + } + } + + .w-sdc-designer-sidebar-section-title-text { + max-width: 240px; + display: inline-block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + position: relative; + } + + .w-sdc-designer-sidebar-section-title-icon { + .hand; + .sprite-new; + .arrow-up; + right: 16px; + top: 10px; + transition: .3s all; + position: absolute; + } + + .w-sdc-designer-sidebar-section-content { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .w-sdc-designer-sidebar-section-title + .w-sdc-designer-sidebar-section-content { + margin: 0 auto; + } + + .w-sdc-designer-sidebar-section-title.expanded + .w-sdc-designer-sidebar-section-content { + margin: 0 auto 1px; + + } + + .i-sdc-designer-sidebar-section-content-item { + .b_7; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + //max-width: 250px; + + &.description { + margin-top: 28px; + white-space: normal; + word-wrap: break-word; + } + } + + .i-sdc-designer-sidebar-section-content-item-tag { + .g_7; + .bg_c; + border-radius: 4px; + display: inline-block; + line-height: 25px; + margin: 0 4px 6px 0; + min-width: 50px; + padding: 0 9px; + text-align: center; + max-width: 280px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .w-sdc-designer-sidebar-section-footer { + margin-top: 10px; + text-align: center; + width: 100%; + } + + + + .w-sdc-designer-sidebar-section-footer-action { + width: 180px; + margin-top: 10px; + } + + //////////////////////Relationship + .w-sdc-designer-sidebar-section-requirements { + border-bottom: 1px solid @color_e; + margin: 0 13px 20px 13px; + padding: 15px 0 0; + } + + .w-sdc-designer-sidebar-section-requirements-item { + margin-bottom: 20px; + } + + .w-sdc-designer-sidebar-section-requirements-label { + display: inline-block; + overflow: hidden; + text-overflow: ellipsis; + vertical-align: middle; + white-space: nowrap; + width: 102px; + } + + .w-sdc-designer-sidebar-section-requirements-select { + border: 1px solid @color_e; + min-height: 30px; + padding: 4px 13px; + width: 168px; + } + + //////////////////////Properties + .i-sdc-designer-sidebar-section-content-item-property-and-attribute { + .b_7; + border-bottom: 1px solid @color_e; + min-height: 72px; + padding: 15px 10px 10px 18px; + position: relative; + + &:first-child { + //margin-top: -18px; + } + + &:hover { + // .bg_c_hover; + .bg_c; + transition: all .3s; + + .i-sdc-designer-sidebar-section-content-item-button { + display: block; + } + } + } + + .i-sdc-designer-sidebar-section-content-item-property-and-attribute-label { + overflow: hidden; + text-overflow: ellipsis; + max-width: 200px; + white-space: nowrap; + display: inline-block; + &:hover { + .a_7; + } + } + + .i-sdc-designer-sidebar-section-content-item-property-value { + overflow: hidden; + text-overflow: ellipsis; + max-width: 200px; + display: inline-block; + white-space: nowrap; + + } + + .i-sdc-designer-sidebar-section-content-item-property-label-value { + } + + .i-sdc-designer-sidebar-section-content-item-button { + display: none; + position: absolute; + top: 25px; + + &.update { + background-color: transparent; + border: 0; + right: 60px; + } + + &.delete { + background-color: transparent; + border: 0; + right: 13px; + } + + &.download { + background-color: transparent; + border: 0; + right: 35px; + } + + &.download-env { + background-color: transparent; + border: 0; + right: 35px; + margin-top: 65px; + } + + &.attach { + background-color: transparent; + border: 0; + right: 15px; + } + } + + // --------------------------------------------------------------------------------------------------- + // Canvas + // --------------------------------------------------------------------------------------------------- + .w-sdc-designer-canvas { + height:100%; + .noselect; + .bg_c; + bottom: 0; + // position: fixed; + //right: 0; + //left: 240px; + //top: 94px; + .view-mode{ + background-color: #f8f8f8; + border:0; + } + } + + .w-sdc-designer-canvas.sidebaractive { + //right: 300px; + } + + .w-sdc-designer-element { + .hand; + width: 200px; + height: 100px; + position: absolute; + text-align: center; + top: 50%; + margin-top: -200px; + left: 50%; + margin-left: -50px; + } + + .w-sdc-designer-resource-label { + .q_7; + } + + .w-sdc-designer-resource-label-indicator { + .bg_q; + border-radius: 50%; + display: inline-block; + height: 10px; + margin-right: 6px; + vertical-align: middle; + width: 10px; + + &.valid { + .bg_l; + } + + &.invalid { + .bg_h; + } + } + + // --------------------------------------------------------------------------------------------------- + // Leftbar + // --------------------------------------------------------------------------------------------------- + .w-sdc-designer-leftbar { + background-color: @main_color_p; + bottom: 0; + left: 0; + overflow-y: scroll; + overflow-x: hidden; + position: absolute; + top: 0; + width: 244px; + .box-shadow(7px -3px 6px -8px @main_color_n); + + } + + .w-sdc-designer-leftbar-title { + + .p_16_m; + background-color: @main_color_n; + line-height: 40px; + padding: 0 17px; + } + + .w-sdc-designer-leftbar-title-count { + float: right; + } + + .w-scd-diagram-container { + // left: 240px; + //right: 300px; + } + + .w-sdc-designer-leftbar-search { + background-color: @tlv_color_u; + padding: 10px; + white-space: nowrap; + position: relative; + } + + .w-sdc-designer-leftbar-search-input { + border: 1px solid @color_e; + .border-radius(4px); + height: 30px; + margin: 0; + padding: 0px 28px 3px 10px; + vertical-align: 4px; + width: 100%; + outline: none; + font-style: italic; + } + + .w-sdc-designer-leftbar-search-filter { + + } + + .i-sdc-designer-leftbar-section { + .hand; + } + + .i-sdc-designer-leftbar-section-title { + .m_14_m; + background-color: @tlv_color_u; + .hand; + clear: both; + height: 40px; + line-height: 40px; + margin-top: 1px; + padding: 0 10px; + position: relative; + text-transform: uppercase; + font-weight: bold; + } + + .i-sdc-designer-leftbar-section-title-icon { + .hand; + .sprite-new; + .arrow-up; + width: 15px; + height: 9px; + position: absolute; + right: 13px; + top: 18px; + transition: .3s all; + } + + .i-sdc-designer-leftbar-section.expanded .i-sdc-designer-leftbar-section-title-icon { + transform: rotate(180deg); + margin-right: 2px; + } + + .i-sdc-designer-leftbar-section-content { + background-color: @main_color_o; + } + + .i-sdc-designer-leftbar-section-content-item { + background-color: @main_color_p; + overflow: hidden; + + &:hover { + background-color: @main_color_p; + } + + .cp{ + margin: 6px; + } + + .vl{ + margin: 6px; + } + } + + .i-sdc-designer-leftbar-section-content-subcat { + .m_14_m; + background-color: @tlv_color_t; + line-height: 35px; + padding: 0 10px; + cursor: default; + + + &:hover { + background-color: @func_color_r; + } + + + } + + .i-sdc-designer-leftbar-section .i-sdc-designer-leftbar-section-content .i-sdc-designer-leftbar-section-content-item { + max-height: 0px; + margin: 0 auto; + transition: all .3s; + } + + .i-sdc-designer-leftbar-section.expanded .i-sdc-designer-leftbar-section-content .i-sdc-designer-leftbar-section-content-item { + max-height: 64px; + margin: 0 auto 1px auto; + // padding: 4px 13px; + } + + .i-sdc-designer-leftbar-section.expanded .i-sdc-designer-leftbar-section-content .i-sdc-designer-leftbar-section-content-subcat { + margin: 0; + } + + .i-sdc-designer-leftbar-section-content-item-icon-ph { + display: inline-block; + margin: 12px 0 12px 10px; + pointer-events: auto; + + .non-certified { + position: relative; + left: 27px; + bottom: 6px; + .sprite; + .s-sdc-state-non-certified; + display: block; + + &.smaller-icon { + bottom: 6px; + left: 13px; + } + } + + + + } + + .non-certified { + position: relative; + left: 43px; + bottom: 3px; + .sprite; + .s-sdc-state-non-certified; + display: block; + + &.smaller-icon { + left: 35px; + bottom: -14px; + } + } + /* + .i-sdc-composition-leftbar-section-content-item-icon { + background-image: url('../../../styles/images/resource-icons/default.png'); + // position: absolute; + right: 20px; + top: 10px; + height: 40px; + width: 40px; + background-size: 40px; + } + */ + + .i-sdc-designer-leftbar-section-content-item-info { + display: inline-block; + // margin-left: 10px; + //overflow: hidden; + // vertical-align: middle; + width: 160px; + padding: 0 0 0 10px; + } + + .i-sdc-designer-leftbar-section-content-item-info-title { + .m_14_m; + line-height: 14px; + overflow: hidden; + text-overflow: ellipsis; + text-transform: uppercase; + max-width: 120px; + display: inline-block; + white-space: nowrap; + vertical-align: bottom; + } + + .i-sdc-designer-leftbar-section-content-item-info-text { + .p_3; + line-height: 15px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + //margin: -1px 0 2px 0; + } + + .i-sdc-designer-leftbar-section-content-item-info-text-link { + color: @color_s; + text-decoration: underline; + float: right; + position: absolute; + right: 17px; + // bottom: 5px; + } + + // --------------------------------------------------------------------------------------------------- + // Form actions + // --------------------------------------------------------------------------------------------------- + .w-sdc-form-actions-container.add-property { + text-align: center; + width: 100%; + margin-top: 2px; + margin-bottom: 12px; + + .w-sdc-form-action { + width: 245px; + } + .w-sdc-form-action.add-property-add-another { + .bg_a; + margin-left: 35px; + } + .w-sdc-form-action.add-property-done { + margin-left: 312px; + } + .w-sdc-form-action.save { + margin-left: 327px; + margin-bottom: 30px; + } + + } + + // --------------------------------------------------------------------------------------------------- + // Top menu + // --------------------------------------------------------------------------------------------------- + .w-sdc-header-menu { + padding: 25px 0; + text-align: center; + white-space: nowrap; + } + + .i-sdc-header-menu-item { + cursor: pointer; + display: inline-block; + height: 43px; + min-width: 93px; + padding: 0 38px; + position: relative; + vertical-align: middle; + + &::after { + border-right: 1px solid @color_m; + content: ''; + display: block; + height: 43px; + right: 0; + position: absolute; + top: 0; + width: 2px; + } + + &:first-child { + &::before { + border-right: 1px solid @color_m; + content: ''; + display: block; + height: 43px; + left: 0; + position: absolute; + top: 0; + width: 2px; + } + } + } + + .i-sdc-header-menu-item-icon { + display: inline-block; + height: 20px; + width: 28px; + } + + .i-sdc-header-menu-item-label { + .g_1; + line-height: 18px; + } + + // --------------------------------------------------------------------------------------------------- + // Canvas inline menu + // --------------------------------------------------------------------------------------------------- + .w-sdc-canvas-menu { + position: fixed; + z-index: 100; + + border-style: solid; + border-width: 1px; + border-color: #d8d8d8; + box-sizing: border-box; + background-color: #ffffff; + box-shadow: 0px 2px 2px 0px rgba(24, 24, 25, 0.1); + width: 91px; + +/* &.vl-type-select{ + width: 173px; + } +*/ + + h3 { + color: @func_color_s; + font-size: 14px; + font-weight: bold; + margin: 0; + padding: 7px 11px; + border-bottom: 1px solid #e5e5e5; + } + + .w-sdc-canvas-menu-content { + padding: 5px 5px; + + &.vl-select{ + border-bottom: #d8d8d8 solid 1px; + line-height: 15px; + + .tlv-radio { + padding: 3px 0px; + + .tlv-radio-label { + padding: 3px 0px; + + &::before { + margin-right: 10px; + } + } + } + } + + .w-sdc-canvas-menu-content-update-button { + .sprite; + .sprite.e-sdc-small-icon-delete; + .hand; + position: absolute; + top: 15px; + right: 10px; + } + .w-sdc-canvas-menu-content-delete-button { + .sprite; + .sprite.e-sdc-small-icon-delete; + .hand; + margin: 0 8px 0 6px; + } + } + + .w-sdc-canvas-menu-arrow { + //TODO: Missing image for small blue triangle. + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkE1OTIzNDI1MENFQjExRTU4ODRERTI1MDM2REZCOUYzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkE1OTIzNDI2MENFQjExRTU4ODRERTI1MDM2REZCOUYzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTU5MjM0MjMwQ0VCMTFFNTg4NERFMjUwMzZERkI5RjMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTU5MjM0MjQwQ0VCMTFFNTg4NERFMjUwMzZERkI5RjMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4gBXTlAAAAOElEQVR42mK0rp7NgASMgZgFiE/CBJjQJPcA8U4gNkdXAJMUAGJ+ZEVMaJIwAFfEhEUSRRFAgAEAVtgJyiLAPWAAAAAASUVORK5CYII='); + content: ''; + display: block; + height: 21px; + position: absolute; + right: 12px; + top: -24px; + width: 184px; + background-repeat: no-repeat; + background-position: 175px 16px; + } + + } +} +/*.right-tab-loader { + border: 16px solid #f3f3f3; !* Light grey *! + border-top: 16px solid #3498db; !* Blue *! + border-radius: 50%; + width: 120px; + height: 120px; + animation: spin 2s linear infinite; +}*/ + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view-model.ts new file mode 100644 index 0000000000..5bb5d2cbbd --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view-model.ts @@ -0,0 +1,255 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + import Resource = Sdc.Models.Components.Resource; + + export interface IArtifactsViewModelScope extends ICompositionViewModelScope { + artifacts: Array; + artifactType: string; + downloadFile:Models.IFileDownload; + isLoading:boolean; + + getTitle(): string; + addOrUpdate(artifact:Models.ArtifactModel): void; + delete(artifact:Models.ArtifactModel): void; + download(artifact:Models.ArtifactModel): void; + openEditEnvParametersModal(artifact:Models.ArtifactModel):void; + getEnvArtifact(heatArtifact:Models.ArtifactModel):any; + getEnvArtifactName(artifact:Models.ArtifactModel):string; + isLicenseArtifact(artifact:Models.ArtifactModel):boolean; + isVFiArtifact(artifact:Models.ArtifactModel):boolean; + } + + export class ResourceArtifactsViewModel { + + static '$inject' = [ + '$scope', + '$filter', + '$modal', + '$templateCache', + '$state', + 'sdcConfig', + 'ArtifactsUtils', + 'ModalsHandler', + 'Sdc.Services.CacheService' + ]; + + constructor(private $scope:IArtifactsViewModelScope, + private $filter:ng.IFilterService, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService, + private $state:any, + private sdcConfig:Models.IAppConfigurtaion, + private artifactsUtils:Sdc.Utils.ArtifactsUtils, + private ModalsHandler: Utils.ModalsHandler, + private cacheService:Services.CacheService) { + + this.initScope(); + } + + + private initArtifactArr = (artifactType:string):void => { + let artifacts:Array = []; + + if (this.$scope.selectedComponent) { + if ('interface' == artifactType) { + let interfaces = this.$scope.selectedComponent.interfaces; + if (interfaces && interfaces.standard && interfaces.standard.operations) { + + angular.forEach(interfaces.standard.operations, (operation:any, interfaceName:string):void => { + let item:Sdc.Models.ArtifactModel = {}; + if (operation.implementation) { + item = operation.implementation; + } + item.artifactDisplayName = interfaceName; + item.artifactLabel = interfaceName; + item.mandatory = false; + artifacts.push(item); + }); + } + }else { + //init normal artifacts, deployment or api artifacts + let artifactsObj:Models.ArtifactGroupModel; + switch (artifactType) { + case "api": + artifactsObj = (this.$scope.selectedComponent).serviceApiArtifacts; + break; + case "deployment": + if (!this.$scope.isComponentInstanceSelected()) { + artifactsObj = this.$scope.selectedComponent.deploymentArtifacts; + } else { + artifactsObj = this.$scope.currentComponent.selectedInstance.deploymentArtifacts; + } + break; + default: + artifactsObj = this.$scope.selectedComponent.artifacts; + break; + } + _.forEach(artifactsObj, (artifact:Models.ArtifactModel, key) => { + artifacts.push(artifact); + }); + } + } + this.$scope.artifacts = artifacts; + }; + + private openEditArtifactModal = (artifact:Models.ArtifactModel):void => { + let viewModelsHtmlBasePath:string = '/app/scripts/view-models/'; + + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get(viewModelsHtmlBasePath + 'forms/artifact-form/artifact-form-view.html'), + controller: 'Sdc.ViewModels.ArtifactResourceFormViewModel', + size: 'sdc-md', + backdrop: 'static', + keyboard: false, + resolve: { + artifact: ():Models.ArtifactModel => { + return artifact; + }, + component: (): Models.Components.Component => { + return this.$scope.currentComponent; + } + } + }; + + let modalInstance:ng.ui.bootstrap.IModalServiceInstance = this.$modal.open(modalOptions); + modalInstance + .result + .then(():void => { + this.initArtifactArr(this.$scope.artifactType); + }); + }; + + private initScope = ():void => { + let self = this; + this.$scope.isLoading= false; + this.$scope.artifactType = this.artifactsUtils.getArtifactTypeByState(this.$state.current.name); + this.initArtifactArr(this.$scope.artifactType); + + this.$scope.getTitle = ():string => { + return this.artifactsUtils.getTitle(this.$scope.artifactType, this.$scope.selectedComponent); + }; + + let vfiArtifactTypes:any = this.cacheService.get('UIConfiguration').artifacts.deployment.resourceInstanceDeploymentArtifacts; + + this.$scope.isVFiArtifact=(artifact:Models.ArtifactModel):boolean=>{ + return vfiArtifactTypes[artifact.artifactType]; + } + + this.$scope.$watch('selectedComponent', (newResource:Models.Components.Component):void => { + if (newResource) { + this.initArtifactArr(this.$scope.artifactType); + } + }); + + + this.$scope.$watch('currentComponent.selectedInstance', (newInstance:Models.ComponentsInstances.ComponentInstance):void => { + if (newInstance) { + this.initArtifactArr(this.$scope.artifactType); + } + }); + + this.$scope.addOrUpdate = (artifact:Models.ArtifactModel):void => { + this.artifactsUtils.setArtifactType(artifact, this.$scope.artifactType); + let artifactCopy = new Models.ArtifactModel(artifact); + this.openEditArtifactModal(artifactCopy); + }; + + + this.$scope.delete = (artifact:Models.ArtifactModel):void => { + + let onOk = ():void => { + this.$scope.isLoading= true; + this.artifactsUtils.removeArtifact(artifact, this.$scope.artifacts); + + let success = (responseArtifact:Models.ArtifactModel):void => { + this.initArtifactArr(this.$scope.artifactType); + this.$scope.isLoading= false; + }; + + let error =(error:any):void =>{ + console.log('Delete artifact returned error:', error); + this.initArtifactArr(this.$scope.artifactType); + this.$scope.isLoading= false; + }; + if(this.$scope.isComponentInstanceSelected()){ + this.$scope.currentComponent.deleteInstanceArtifact(artifact.uniqueId, artifact.artifactLabel).then(success, error); + }else{ + this.$scope.currentComponent.deleteArtifact(artifact.uniqueId, artifact.artifactLabel).then(success, error);//TODO simulate error (make sure error returns) + } + }; + let title: string = this.$filter('translate')("ARTIFACT_VIEW_DELETE_MODAL_TITLE"); + let message: string = this.$filter('translate')("ARTIFACT_VIEW_DELETE_MODAL_TEXT", "{'name': '" + artifact.artifactDisplayName + "'}"); + this.ModalsHandler.openConfirmationModal(title, message, false).then(onOk); + }; + + + this.$scope.getEnvArtifact = (heatArtifact:Models.ArtifactModel):any=>{ + return _.find(this.$scope.artifacts, (item:Models.ArtifactModel)=>{ + return item.generatedFromId === heatArtifact.uniqueId; + }); + }; + + this.$scope.getEnvArtifactName = (artifact:Models.ArtifactModel):string =>{ + let envArtifact = this.$scope.getEnvArtifact(artifact); + if(envArtifact){ + return envArtifact.artifactDisplayName; + } + }; + + this.$scope.isLicenseArtifact = (artifact:Models.ArtifactModel) :boolean => { + let isLicense:boolean = false; + if(this.$scope.component.isResource() && (this.$scope.component).isCsarComponent()) { + isLicense = this.artifactsUtils.isLicenseType(artifact.artifactType); + } + + return isLicense; + }; + + this.$scope.openEditEnvParametersModal = (artifact:Models.ArtifactModel):void => { + + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get('/app/scripts/view-models/forms/env-parameters-form/env-parameters-form.html'), + controller: 'Sdc.ViewModels.EnvParametersFormViewModel', + size: 'sdc-md', + backdrop: 'static', + resolve: { + artifact: ():Models.ArtifactModel => { + return artifact; + }, + component: (): Models.Components.Component => { + return this.$scope.currentComponent; + } + } + }; + + let modalInstance:ng.ui.bootstrap.IModalServiceInstance = this.$modal.open(modalOptions); + modalInstance + .result + .then(():void => { + this.initArtifactArr(this.$scope.artifactType); + }); + }; + + } + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view.html new file mode 100644 index 0000000000..8c0138964f --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view.html @@ -0,0 +1,55 @@ + +
        + + +
        +
        + +
        +
        +
        + +
        +
        +
        + +
        + + +
        +
        + +
        + Description:{{artifact.description}} +
        +
        + + + + + +
        +
        + +
        + +
        +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/artifacts/artifacts.less b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/artifacts/artifacts.less new file mode 100644 index 0000000000..5726ca66fc --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/artifacts/artifacts.less @@ -0,0 +1,172 @@ +.w-sdc-designer-sidebar-tab-content.artifacts { + + .i-sdc-designer-sidebar-section-content-item-artifact.hand { + .hand; + } + + .w-sdc-designer-sidebar-section-content { + padding: 0; + } + .w-sdc-designer-sidebar-section-title { + &.expanded { + margin-bottom: 0; + } + } + + .i-sdc-designer-sidebar-section-content-item-artifact-details { + display: inline-block; + margin-left: 5px; + vertical-align: middle; + width: 180px; + &.heat { + line-height: 18px; + width: 250px; + } + } + + .i-sdc-designer-sidebar-section-content-item-artifact-details-name { + .g_7; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + max-width:220px; + display: inline-block; + //text-transform: capitalize; + &.enabled { + &:hover { + .a_7; + } + } + + } + + .i-sdc-designer-sidebar-section-content-item-artifact-heat-env { + .g_7; + margin-top: 6px; + line-height: 42px; + padding-top: 10px; + border-top:1px solid #c8cdd1; + .enabled { + &:hover { + .hand; + .a_7; + } + } + } + + .i-sdc-designer-sidebar-section-content-item-artifact-filename { + .g_7; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + max-width: 225px; + display: inline-block; + .bold; + &.enabled { + &:hover { + .a_7; + } + } + } + + + .i-sdc-designer-sidebar-section-content-item-file-link{ + border-left: 1px #848586 solid; + height: 58px; + margin-left: -11px; + margin-top: 11px; + border-top: 1px #848586 solid; + border-bottom: 1px #848586 solid; + width: 12px; + float: left; + } + + .i-sdc-designer-sidebar-section-content-item-artifact-details-desc { + display: none; + line-height: 16px; + word-wrap: break-word; + white-space: normal; + } + + .i-sdc-designer-sidebar-section-content-item-artifact-details-desc-label { + .b_3; + } + + + .i-sdc-designer-sidebar-section-content-item-artifact { + border-bottom: 1px solid #c8cdd1; + padding: 5px 10px 5px 18px; + position: relative; + // line-height: 36px; + min-height: 61px; + cursor: default; + display: flex; + align-items: center; + + + .i-sdc-designer-sidebar-section-content-item-button { + top: 20px; + line-height: 10px; + } + + &:hover { + //background-color: @color_c; + .bg_c; + transition: all .3s; + + .i-sdc-designer-sidebar-section-content-item-button { + display: block; + + } + + } + } + +} + +///////////////////Lifecycle Management +.i-sdc-designer-sidebar-section-content-item-lm { + .b_7; + border-bottom: 1px solid @color_e; + cursor: pointer; + height: 65px; + padding: 22px 0; + position: relative; + + &:hover { + .bg_c_hover; + margin-left: -10px; + margin-right: -10px; + padding: 22px 10px; + + .i-sdc-designer-sidebar-section-content-item-lm-icon { + right: 16px; + } + } +} + +.i-sdc-designer-sidebar-section-content-item-lm:first-child { + margin-top: -18px; +} + +.i-sdc-designer-sidebar-section-content-item-lm-icon { + position: absolute; + right: 6px; + + //TODO: Replace the icons. + &.icon-view { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAJCAYAAAACTR1pAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjdGMDNBRUJDMDkxNjExRTVCMjRBOEI5QzMxQTlBQjY4IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjdGMDNBRUJEMDkxNjExRTVCMjRBOEI5QzMxQTlBQjY4Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0YwM0FFQkEwOTE2MTFFNUIyNEE4QjlDMzFBOUFCNjgiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0YwM0FFQkIwOTE2MTFFNUIyNEE4QjlDMzFBOUFCNjgiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4U2decAAABRUlEQVR42pyRPUvDUBSG39t2UyyaBgvWQZMqKoFq4lBH0U0UqXSxKPaPieCoWPAPKIgdjG1ohaghOrSR1iaLKMXpmnMhQVfPcLmc8zxwPhjnHFE4rx3eMO/w4rr4+vwQuZHRMcwqClaMVeRnplnEskg8O7/g96YJSZLgBz5+R0bKIAgC6IaBvdKukBP0HJ+cctu2cVCtQsrIUFUVlcp+LE6EItWIIVaIV9c3/PnRRqlcxkJeYV2vi+/hEO/9QSx6b56oEUMsOal6/TacQcXinCpaGE+n0QnljufFIuUoiAlZTk6iWFyD6zpoWi3RwvrmBlLJZCzRn3IUxBBLjlgO9e06T9ja3sGyrqPX66NtWQLWCgVks5Owmg1c1mpQ8vM4OqywP1s1w1PkpnJY0jTIsizy/sDHQ7sFmt0ITxJtlf33jj8CDADhB52tEX6ifAAAAABJRU5ErkJggg=='); + height: 9px; + top: 29px; + width: 14px; + } + + //TODO: Replace the icons. + &.icon-alert { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAANCAYAAAB2HjRBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjhBM0YxQTBCMDkyMDExRTVBNzlCQUYxNEYwMDUwOTQ5IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjhBM0YxQTBDMDkyMDExRTVBNzlCQUYxNEYwMDUwOTQ5Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OEEzRjFBMDkwOTIwMTFFNUE3OUJBRjE0RjAwNTA5NDkiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6OEEzRjFBMEEwOTIwMTFFNUE3OUJBRjE0RjAwNTA5NDkiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7exgceAAAB5klEQVR42oySy2tTQRTGfzN3cpvbpFTaUlzUjeCuVFyJf4DuCl34wL/CrbpUunLnwpUuFFy48IFiwYWhpYuW+gCLrbWKBQumaRIba5ub3MccJ5WECCV44MDMme873/lmBhGhnZulcn/3/sfrO7J/45R017pT0xUS2bC93vy2LAOLt5DfCeUn14RD4h/ysbHRDii/8pyo7DmFiP7VZ4Rbu9KT3I7i+qJklp7ibQt2J6HeNOhXV/gv8tDcbaLtXYLJKeTcZfxqSPPzvGu6ID3J1Q8z0ny/hIkM5swF8qenUFUfwixHCtd7Kwez04jOgEmc+hq6tuZ8N9E6xG5U+Pn2kRxKLs7eE7tRc0XlToRM2sD+2sGmDiY+kWsSFG528Kr1Xgfjfn0n5uElvFrrzVqVDHqkiTKjxCsV9LBx08QkgcY/eZH+89Oqo+x9eumkwQaQaoPEKWpsHHN8ArItgLt5UdiG6736mFLxixyQt+bviik8QPuaNFRIkjqQRZ2YJDo6QWydjTRtOcGPPdJKgnlxFfN9fVmGNhecR4U3mLrL6nPTRTQHXZO5+4jyyI4Iqs99GJvgBiKjcySlj3897y6/kbreI4w0QS7ASxrsa4/cXkxkIzK5PKmNqRMw7NfdeczA+Fn1R4ABAPnMAeCjkgf5AAAAAElFTkSuQmCC'); + height: 13px; + top: 27px; + width: 15px; + } + +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/details/details-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/details/details-view-model.ts new file mode 100644 index 0000000000..b28de8d331 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/details/details-view-model.ts @@ -0,0 +1,132 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + + 'use strict'; + + export interface IEditResourceVersion { + allVersions: any; + changeVersion: string; + } + + interface IDetailsViewModelScope extends ICompositionViewModelScope { + isLoading: boolean; + $parent: ICompositionViewModelScope; + expandedSection: Array; + editForm:ng.IFormController; + editResourceVersion: IEditResourceVersion; + + changeResourceVersion(): void; + } + + export class DetailsViewModel { + + static '$inject' = [ + '$scope', + 'LeftPaletteLoaderService', + 'EventListenerService' + + ]; + + constructor(private $scope:IDetailsViewModelScope, + private LeftPaletteLoaderService:Services.Components.LeftPaletteLoaderService, + private eventListenerService:Services.EventListenerService) { + this.initScope(); + } + + private clearSelectedVersion = ():void => { + this.$scope.editResourceVersion = { + allVersions: {}, + changeVersion: null + }; + }; + + private versioning:Function = (versionNumber:string):string => { + let version:Array = versionNumber.split('.'); + return '00000000'.slice(version[0].length) + version[0] + '.' + '00000000'.slice(version[1].length) + version[1]; + }; + + private initEditResourceVersion = ():void => { + this.clearSelectedVersion(); + this.$scope.editResourceVersion.allVersions[this.$scope.currentComponent.selectedInstance.componentVersion] = this.$scope.currentComponent.selectedInstance.componentUid; + _.merge(this.$scope.editResourceVersion.allVersions, angular.copy(this.$scope.selectedComponent.allVersions)); + let sorted:any= _.sortBy(_.toPairs(this.$scope.editResourceVersion.allVersions), (item)=>{ + return this.versioning(item[0]); + }); + this.clearSelectedVersion(); + _.forEach(sorted, (item)=> { + this.$scope.editResourceVersion.allVersions[item[0]]= item[1]; + }); + + let highestVersion = _.last(Object.keys(this.$scope.selectedComponent.allVersions)); + + //TODO - ask ronny - what happend if the parent is not in the leftPalette (instance of csar for example) + if (parseFloat(highestVersion) % 1) { //if highest is minor, make sure it is the latest checked in - + let latestVersionComponent:Models.Components.Component = _.find(this.LeftPaletteLoaderService.getFullDataComponentListWithVls(this.$scope.currentComponent.componentType), (component:Models.Components.Component) => { //latest checked in + return (component.systemName === this.$scope.selectedComponent.systemName + || component.uuid === this.$scope.selectedComponent.uuid); + }); + let latestVersion:string = latestVersionComponent ? latestVersionComponent.version : highestVersion; + + if (highestVersion != latestVersion) { //highest is checked out - remove from options + this.$scope.editResourceVersion.allVersions = _.omit(this.$scope.editResourceVersion.allVersions, highestVersion); + } + } + this.$scope.editResourceVersion.changeVersion = this.$scope.currentComponent.selectedInstance.componentVersion; + }; + + private initScope = ():void => { + this.$scope.isLoading = false; + this.$scope.$parent.isLoading = false; + this.$scope.expandedSection = ['general', 'tags']; + //this.clearSelectedVersion(); + + this.$scope.$watch('selectedComponent', (component:Models.Components.Component) => { + if (this.$scope.isComponentInstanceSelected()) { + this.initEditResourceVersion(); + } + }); + + this.$scope.changeResourceVersion = ():void => { + this.$scope.isLoading = true; + this.$scope.$parent.isLoading = true; + + let onSuccess = (component:Models.Components.Component)=> { + this.$scope.isLoading = false; + this.$scope.$parent.isLoading = false; + this.$scope.setComponent(component); + this.$scope.updateSelectedComponent(); + + this.eventListenerService.notifyObservers(Sdc.Utils.Constants.GRAPH_EVENTS.ON_VERSION_CHANGED, this.$scope.currentComponent); + }; + + let onFailed = (error:any)=> { + this.$scope.isLoading = false; + this.$scope.$parent.isLoading = false; + console.log(error); + }; + + let componentUid:string = this.$scope.editResourceVersion.allVersions[this.$scope.editResourceVersion.changeVersion]; + this.$scope.currentComponent.changeComponentInstanceVersion(componentUid).then(onSuccess, onFailed); + }; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/details/details-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/details/details-view.html new file mode 100644 index 0000000000..6ae462760c --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/details/details-view.html @@ -0,0 +1,129 @@ + + +
        + + + + General Info +
        +
        + +
        +
        + Type: + +
        +
        + Resource Type: + +
        +
        + + Version: + + + + +
        +
        + Category: + +
        +
        + Sub Category: + +
        +
        + Creation Date: + +
        +
        + Author: + + +
        +
        + + +
        +
        + Vendor Name: + + +
        +
        + Vendor Release: + + +
        +
        + + +
        +
        + Description: + + + +
        + +
        +
        + +
        + + Additional Information +
        +
        + +
        +
        + + : + +
        +
        +
        + + +
        + + Tags +
        +
        + +
        +
        + +
        +
        +
        + + +
        + diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/details/details.less b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/details/details.less new file mode 100644 index 0000000000..e88e130379 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/details/details.less @@ -0,0 +1,68 @@ +.w-sdc-designer-sidebar-tab-content.details { + + .w-sdc-designer-sidebar-section-title + .w-sdc-designer-sidebar-section-content { + padding: 0 10px 0 18px; + } + + .w-sdc-designer-sidebar-section-title.expanded + .w-sdc-designer-sidebar-section-content { + padding: 10px 10px 10px 18px; + } + + .i-sdc-designer-sidebar-section-content-item-label { + font-weight: bold; + &.additional-information{ + max-width:100px; + display: inline-block; + text-overflow: ellipsis; + overflow: hidden; + vertical-align: bottom; + } + + } + + + + .i-sdc-designer-sidebar-section-content-item-value { + // .hyphenate; + padding-left: 10px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + display: inline-block; + max-width: 160px; + vertical-align:bottom; + font-weight: normal; + &.additional-information{ + max-width:160px; + display: inline-block; + } + &.i-sdc-form-select { + .b_1; + border: 1px solid @border_color_f; + width: 210px; + max-width: 210px; + padding-left: 4px; + + .select-instance-version { + .b_1; + &.minor { + .h_1; + } + } + } + &.minor { + .h_1; + } + } + .i-sdc-designer-sidebar-section-content-description-item-value{ + max-width: none; + font-weight: normal; + } + + .w-sdc-designer-sidebar-section.tags { + .i-sdc-designer-sidebar-section-content-item { + white-space: normal; + } + } + +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/properties-and-attributes/properties-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/properties-and-attributes/properties-view-model.ts new file mode 100644 index 0000000000..aef25c51ce --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/properties-and-attributes/properties-view-model.ts @@ -0,0 +1,228 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + interface IResourcePropertiesAndAttributesViewModelScope extends ICompositionViewModelScope { + properties: Models.PropertiesGroup; + attributes: Models.AttributesGroup; + propertiesMessage: string; + addProperty(): void; + updateProperty(property:Models.PropertyModel): void; + deleteProperty(property:Models.PropertyModel): void; + viewAttribute(attribute:Models.AttributeModel): void; + groupNameByKey(key:string): string; + isPropertyOwner():boolean; + } + + export class ResourcePropertiesViewModel { + + static '$inject' = [ + '$scope', + '$filter', + '$modal', + '$templateCache', + 'ModalsHandler' + ]; + + + constructor(private $scope:IResourcePropertiesAndAttributesViewModelScope, + private $filter:ng.IFilterService, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService, + private ModalsHandler: Utils.ModalsHandler) { + + this.initScope(); + } + + private initComponentProperties = ():void => { + let result:Models.PropertiesGroup = {}; + + if(this.$scope.selectedComponent){ + this.$scope.propertiesMessage = undefined; + if(this.$scope.isComponentInstanceSelected()){ + if (this.$scope.currentComponent.selectedInstance.originType==='VF') { + // Temporally fix to hide properties for VF (UI stack when there are many properties) + this.$scope.propertiesMessage = "Note: properties for VF are disabled"; + } else { + result[this.$scope.currentComponent.selectedInstance.uniqueId] = this.$scope.currentComponent.componentInstancesProperties[this.$scope.currentComponent.selectedInstance.uniqueId]; + } + }else if(this.$scope.currentComponent.isService()){ + // Temporally fix to hide properties for service (UI stack when there are many properties) + //result = this.$scope.currentComponent.componentInstancesProperties; + this.$scope.propertiesMessage = "Note: properties for service are disabled"; + }else{ + let key = this.$scope.selectedComponent.uniqueId; + result[key]= Array(); + let derived = Array(); + _.forEach(this.$scope.selectedComponent.properties, (property:Models.PropertyModel) => { + if(key == property.parentUniqueId){ + result[key].push(property); + }else{ + property.readonly = true; + derived.push(property); + } + }); + if(derived.length){ + result['derived']= derived; + } + } + this.$scope.properties = result; + } + }; + + + private initComponentAttributes = ():void => { + let result:Models.AttributesGroup = {}; + + if(this.$scope.selectedComponent){ + if(this.$scope.isComponentInstanceSelected()){ + result[this.$scope.currentComponent.selectedInstance.uniqueId] = this.$scope.currentComponent.componentInstancesAttributes[this.$scope.currentComponent.selectedInstance.uniqueId]; + }else if(this.$scope.currentComponent.isService()){ + result = this.$scope.currentComponent.componentInstancesAttributes; + } + this.$scope.attributes = result; + } + }; + + private openEditPropertyModal = (property:Models.PropertyModel):void => { + let viewModelsHtmlBasePath:string = '/app/scripts/view-models/'; + + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get(viewModelsHtmlBasePath + 'forms/property-form/property-form-view.html'), + controller: 'Sdc.ViewModels.PropertyFormViewModel', + size: 'sdc-l', + backdrop: 'static', + keyboard: false, + resolve: { + property: ():Models.PropertyModel => { + return property; + }, + component: ():Models.Components.Component => { + return this.$scope.currentComponent; + }, + filteredProperties: ():Array => { + return this.$scope.selectedComponent.properties + } + } + }; + + + let modalInstance:ng.ui.bootstrap.IModalServiceInstance = this.$modal.open(modalOptions); + modalInstance + .result + .then(():void => { + // this.initComponentProperties(); + }); + }; + + private openAttributeModal = (atrribute:Models.AttributeModel):void => { + let viewModelsHtmlBasePath:string = '/app/scripts/view-models/'; + + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get(viewModelsHtmlBasePath + 'forms/attribute-form/attribute-form-view.html'), + controller: 'Sdc.ViewModels.AttributeFormViewModel', + size: 'sdc-md', + backdrop: 'static', + keyboard: false, + resolve: { + attribute: ():Models.AttributeModel => { + return atrribute; + }, + component: ():Models.Components.Component => { + return this.$scope.currentComponent; + } + } + }; + this.$modal.open(modalOptions); + }; + + + + + private initScope = ():void => { + this.initComponentProperties(); + this.initComponentAttributes(); + + this.$scope.$watchCollection('currentComponent.componentInstancesProperties', (newData:any):void => { + this.initComponentProperties(); + }); + + this.$scope.$watchCollection('currentComponent.properties', (newData:any):void => { + this.initComponentProperties(); + }); + + this.$scope.$watch('currentComponent.selectedInstance', (newInstance:Models.ComponentsInstances.ComponentInstance):void => { + if (angular.isDefined(newInstance)) { + this.initComponentProperties(); + this.initComponentAttributes(); + } + }); + + this.$scope.$watchCollection('currentComponent.componentInstancesAttributes', (newData:any):void => { + this.initComponentAttributes(); + }); + + this.$scope.isPropertyOwner = ():boolean => { + return this.$scope.currentComponent && this.$scope.currentComponent.isResource() && + !this.$scope.isComponentInstanceSelected(); + }; + + this.$scope.addProperty = ():void => { + let property = new Models.PropertyModel(); + this.openEditPropertyModal(property); + }; + + this.$scope.updateProperty = (property:Models.PropertyModel):void => { + this.openEditPropertyModal(property); + }; + + this.$scope.deleteProperty = (property:Models.PropertyModel):void => { + + let onOk = ():void => { + this.$scope.currentComponent.deleteProperty(property.uniqueId); + }; + + let title:string = this.$filter('translate')("PROPERTY_VIEW_DELETE_MODAL_TITLE"); + let message:string = this.$filter('translate')("PROPERTY_VIEW_DELETE_MODAL_TEXT", "{'name': '" + property.name + "'}"); + this.ModalsHandler.openConfirmationModal(title, message, false).then(onOk); + }; + + this.$scope.viewAttribute = (attribute:Models.AttributeModel):void => { + this.openAttributeModal(attribute); + }; + + this.$scope.groupNameByKey = (key:string):string => { + switch (key){ + case 'derived': + return "Derived"; + + case this.$scope.currentComponent.uniqueId: + return this.$filter("resourceName")(this.$scope.currentComponent.name); + + default: + return this.$filter("resourceName")((_.find(this.$scope.currentComponent.componentInstances, {uniqueId:key})).name); + } + }; + + } + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/properties-and-attributes/properties-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/properties-and-attributes/properties-view.html new file mode 100644 index 0000000000..3022ee6e90 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/properties-and-attributes/properties-view.html @@ -0,0 +1,81 @@ + +
        + + + + + + + +
        +
        + +
        +
        +
        +
        + {{property.name}} +
        +
        + {{property.defaultValue}} + {{property.value}} +
        + +
        +
        + +
        + + + + + + +
        +
        + +
        +
        +
        +
        + {{attribute.name}} +
        +
        + {{attribute.defaultValue}} + {{attribute.value}} +
        +
        +
        + +
        + +
        +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/properties-and-attributes/properties.less b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/properties-and-attributes/properties.less new file mode 100644 index 0000000000..2ad87b9fca --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/properties-and-attributes/properties.less @@ -0,0 +1,16 @@ +.w-sdc-designer-sidebar-tab-content.properties { + .i-sdc-designer-sidebar-section-content-item-property-and-attribute-label{ + font-weight: bold; + } + .i-sdc-designer-sidebar-section-content-item-button.update{ + right: 17px; + } + .i-sdc-designer-sidebar-section-content-item-button.delete{ + right: 35px; + } + + .w-sdc-designer-sidebar-properties-disabled { + .s_14_m; + padding: 20px 20px; + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/relations/relations-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/relations/relations-view-model.ts new file mode 100644 index 0000000000..119a59d5af --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/relations/relations-view-model.ts @@ -0,0 +1,81 @@ +/*- + * ============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========================================================= + */ +/// > +module Sdc.ViewModels { + 'use strict'; + + interface IRelationsViewModelScope extends ICompositionViewModelScope { + isLoading: boolean; + $parent: ICompositionViewModelScope; + getRelation(requirement:any): any; + } + + export class RelationsViewModel { + + static '$inject' = [ + '$scope', + '$filter' + ]; + + constructor(private $scope:IRelationsViewModelScope, + private $filter:ng.IFilterService) { + this.initScope(); + } + + + private updateRC = ():void =>{ + if(this.$scope.currentComponent) { + this.$scope.currentComponent.updateRequirementsCapabilities(); + } + }; + + private initScope = ():void => { + + this.$scope.isLoading = this.$scope.$parent.isLoading; + + this.$scope.getRelation = (requirement:any):any => { + + if(this.$scope.isComponentInstanceSelected() && this.$scope.currentComponent.componentInstancesRelations ) { + let relationItem = _.filter(this.$scope.currentComponent.componentInstancesRelations, (relation:any) => { + return relation.fromNode === this.$scope.currentComponent.selectedInstance.uniqueId && + _.some(relation.relationships, {'requirement': requirement.name, + 'requirementOwnerId': requirement.ownerId}); + }); + + if (relationItem && relationItem.length) { + return { + type: requirement.relationship.split('.').pop(), + requirementName: this.$filter('resourceName')(this.$scope.currentComponent.componentInstances[_.map + (this.$scope.currentComponent.componentInstances, "uniqueId").indexOf(relationItem[0].toNode)].name) + }; + } + } + return null; + }; + + if(!this.$scope.isComponentInstanceSelected()) { + this.$scope.$watch('currentComponent.componentInstances + currentComponent.componentInstancesRelations', ():void => { + this.updateRC(); + }); + + } + } + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/relations/relations-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/relations/relations-view.html new file mode 100644 index 0000000000..72eaae27cf --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/relations/relations-view.html @@ -0,0 +1,57 @@ + + +
        + + Capabilities +
        +
        + +
        +
        +
        +
        +
        +
        {{capability.name}}  +   {{capability.ownerName | resourceName}}
        +
        {{capability.type}}
        +
        +
        +
        +
        +
        + +
        + + Requirements +
        +
        + +
        +
        +
        +
        +
        +
        {{requirement.name}}  +   {{requirement.ownerName | resourceName}}
        +
        {{requirement.node}} +
        +
        +
        + {{getRelation(requirement).type}}
        + {{getRelation(requirement).requirementName}} +
        +
        +
        +
        +
        +
        +
        +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/relations/relations.less b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/relations/relations.less new file mode 100644 index 0000000000..212b9785e9 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/relations/relations.less @@ -0,0 +1,116 @@ +.w-sdc-designer-sidebar-tab-content.relations { + + .w-sdc-designer-sidebar-section-content { + padding: 0; + } + + .w-sdc-designer-sidebar-section-title { + &.expanded { + margin-bottom: 0; + } + } + + .i-sdc-designer-sidebar-section-content-item-relations { + border-bottom: 1px solid @color_e; + padding: 10px 10px 10px 18px; + position: relative; + cursor: default; + + .i-sdc-designer-sidebar-section-content-item-button { + top: 15px; + line-height: 10px; + } + + &:hover { + background-color: @color_c; + + .i-sdc-designer-sidebar-section-content-item-button { + display: block; + + } + + } + + } + .w-sdc-designer-sidebar-section-relations:not(:last-child) .i-sdc-designer-sidebar-section-content-item-relations-group:last-child .i-sdc-designer-sidebar-section-content-item-relations:last-child { + border-bottom: none; + } + + + .i-sdc-designer-sidebar-section-content-item-relations.hand { + .hand; + } + + .i-sdc-designer-sidebar-section-content-item-relations-group { + //border-bottom: 1px solid @color_e; + } + + .i-sdc-designer-sidebar-section-content-item-relations-details { + display: inline-block; + margin-left: 5px; + vertical-align: middle; + } + + .i-sdc-designer-sidebar-section-content-item-relations-details-name { + .b_1; + .bold; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + //width: 100%; + text-transform: capitalize; + max-width: 240px; + display: inline-block; + } + + .i-sdc-designer-sidebar-section-content-item-relations-details-ownerName { + .b_13; + font-weight:400; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + + &:before{ + .sprite; + .arrow-left; + content: ''; + } + } + + .i-sdc-designer-sidebar-section-content-item-relations-details-desc { + .p_1; + line-height: 14px; + word-wrap: break-word; + white-space: normal; + + .i-sdc-designer-sidebar-section-content-item-relations-details-indent-box{ + border-left: 1px #848586 solid; + height: 40px; + margin-left: 2px; + margin-top: 5px; + border-bottom: 1px #848586 solid; + width: 25px; + float: left; + } + .i-sdc-designer-sidebar-section-content-item-relations-details-child{ + margin-top: 30px; + float: left; + padding-left: 10px; + max-width: 230px; + } + } + + .i-sdc-designer-sidebar-section-content-item-relations-details-desc-label { + font-family: omnes-medium, sans-serif; + } + + .i-sdc-designer-sidebar-section-content-item-relations-view { + position: absolute; + right: 0; + top: 22px; + display: none; + } + +} + + diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/structure/structure-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/structure/structure-view.html new file mode 100644 index 0000000000..2070041990 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/structure/structure-view.html @@ -0,0 +1,13 @@ + + +
        + + Composition +
        +
        + +
        + +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/structure/structure-view.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/structure/structure-view.ts new file mode 100644 index 0000000000..daeab7f2f3 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/composition/tabs/structure/structure-view.ts @@ -0,0 +1,34 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + interface IStructureViewModel extends ICompositionViewModelScope {} + + export class StructureViewModel { + static '$inject' = [ + '$scope' + ]; + + constructor(private $scope:IStructureViewModel) { + } + } + } diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view-model.ts new file mode 100644 index 0000000000..43511e2deb --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view-model.ts @@ -0,0 +1,253 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + import Resource = Sdc.Models.Components.Resource; + import ArtifactModel = Sdc.Models.ArtifactModel; + + interface IDeploymentArtifactsViewModelScope extends IWorkspaceViewModelScope { + tableHeadersList: Array; + reverse: boolean; + sortBy:string; + artifacts: Array; + editForm:ng.IFormController; + isLoading:boolean; + artifactDescriptions:any; + updateInProgress:boolean; + + addOrUpdate(artifact:Models.ArtifactModel): void; + update(artifact:Models.ArtifactModel): void; + delete(artifact:Models.ArtifactModel): void; + sort(sortBy:string): void; + noArtifactsToShow():boolean; + getValidationPattern(validationType:string, parameterType?:string):RegExp; + validateJson(json:string):boolean; + resetValue(parameter:any):void; + viewModeOrCsarComponent():boolean; + isLicenseArtifact(artifact:Models.ArtifactModel): boolean; + + } + + export class DeploymentArtifactsViewModel { + + static '$inject' = [ + '$scope', + '$filter', + '$modal', + '$templateCache', + 'ValidationUtils', + 'ArtifactsUtils', + 'ModalsHandler' + ]; + + constructor(private $scope:IDeploymentArtifactsViewModelScope, + private $filter:ng.IFilterService, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService, + private validationUtils:Sdc.Utils.ValidationUtils, + private artifactsUtils:Sdc.Utils.ArtifactsUtils, + private ModalsHandler:Utils.ModalsHandler) { + this.initScope(); + this.$scope.updateSelectedMenuItem(); + } + + private initDescriptions = ():void => { + this.$scope.artifactDescriptions = {}; + _.forEach(this.$scope.component.deploymentArtifacts, (artifact:Models.ArtifactModel):void => { + this.$scope.artifactDescriptions[artifact.artifactLabel] = artifact.description; + }); + }; + + + private setArtifact = (artifact:Models.ArtifactModel):void => { + if (artifact.heatParameters) { + artifact.heatParameters.forEach((parameter:any):void => { + if (!parameter.currentValue && parameter.defaultValue) { + parameter.currentValue = parameter.defaultValue; + } else if ("" === parameter.currentValue) { + parameter.currentValue = null; + } + }); + } + if (!artifact.description || !this.$scope.getValidationPattern('string').test(artifact.description)) { + artifact.description = this.$scope.artifactDescriptions[artifact.artifactLabel]; + } + }; + + private updateAll = ():void => { + let artifacts:Array = []; + _.forEach(this.$scope.component.deploymentArtifacts, (artifact:Models.ArtifactModel):void => { + if (artifact.selected) { + this.setArtifact(artifact); + artifacts.push(artifact); + } + }); + this.$scope.component.updateMultipleArtifacts(artifacts); + }; + + + private initScope = ():void => { + let self = this; + this.$scope.isLoading = false; + this.$scope.updateInProgress = false; + this.initDescriptions(); + this.$scope.artifacts = _.values(this.$scope.component.deploymentArtifacts); + this.$scope.setValidState(true); + + this.$scope.tableHeadersList = [ + {title: 'Name', property: 'artifactDisplayName'}, + {title: 'Type', property: 'artifactType'}, + {title: 'Deployment timeout', property: 'timeout'} + ]; + + this.$scope.isLicenseArtifact = (artifact:Models.ArtifactModel) :boolean => { + let isLicense:boolean = false; + if(this.$scope.component.isResource() && (this.$scope.component).isCsarComponent()) { + + isLicense = this.artifactsUtils.isLicenseType(artifact.artifactType); + } + + return isLicense; + }; + + this.$scope.sort = (sortBy:string):void => { + this.$scope.reverse = (this.$scope.sortBy === sortBy) ? !this.$scope.reverse : false; + this.$scope.sortBy = sortBy; + }; + + this.$scope.getValidationPattern = (validationType:string, parameterType?:string):RegExp => { + return this.validationUtils.getValidationPattern(validationType, parameterType); + }; + + this.$scope.validateJson = (json:string):boolean => { + if(!json){ + return true; + } + return this.validationUtils.validateJson(json); + }; + + this.$scope.viewModeOrCsarComponent = ():boolean => { + return this.$scope.isViewMode() || (this.$scope.component.isResource() && (this.$scope.component).isCsarComponent()); + }; + + + this.$scope.addOrUpdate = (artifact:Models.ArtifactModel):void => { + artifact.artifactGroupType = 'DEPLOYMENT'; + let artifactCopy = new Models.ArtifactModel(artifact); + + let success = (response:any):void => { + self.$scope.artifactDescriptions[artifactCopy.artifactLabel] = artifactCopy.description; + self.$scope.artifacts = _.values(self.$scope.component.deploymentArtifacts); + }; + + let error = (err:any):void =>{ + console.log(err); + self.$scope.artifacts = _.values(self.$scope.component.deploymentArtifacts); + }; + + + this.ModalsHandler.openWizardArtifactModal(artifactCopy, self.$scope.component).then(success, error); + }; + + this.$scope.noArtifactsToShow = ():boolean => { + return !_.some(this.$scope.artifacts, 'esId'); + }; + + + this.$scope.resetValue = (parameter:any):void => { + if (!parameter.currentValue && parameter.defaultValue) { + parameter.currentValue = parameter.defaultValue; + } + else if ('boolean' == parameter.type) { + parameter.currentValue = parameter.currentValue.toUpperCase(); + } + }; + + + this.$scope.$watch('editForm.$valid', ():void => { + if (this.$scope.editForm) { + // this.$scope.setValidState(this.$scope.editForm.$valid); + } + }); + + this.$scope.update = (artifact:Models.ArtifactModel):void => { + if (false == this.$scope.isLoading) { + if (artifact.selected && !this.$scope.isViewMode()) { + this.$scope.isLoading = true; + this.$scope.updateInProgress = true; + let onSuccess = (responseArtifact:Models.ArtifactModel):void => { + this.$scope.artifactDescriptions[responseArtifact.artifactLabel] = responseArtifact.description; + this.$scope.artifacts = _.values(this.$scope.component.deploymentArtifacts); + this.$scope.isLoading = false; + artifact.selected = !artifact.selected; + this.$scope.updateInProgress = false; + }; + + let onFailed = (error:any):void => { + console.log('Delete artifact returned error:', error); + this.$scope.isLoading = false; + artifact.selected = !artifact.selected; + this.$scope.updateInProgress = false; + }; + + this.setArtifact(artifact); + this.$scope.component.addOrUpdateArtifact(artifact).then(onSuccess, onFailed); + } else { + artifact.selected = !artifact.selected; + + } + } + }; + + this.$scope.delete = (artifact:Models.ArtifactModel):void => { + let onOk = ():void => { + this.$scope.isLoading = true; + let onSuccess = ():void => { + this.$scope.isLoading = false; + this.$scope.artifacts = _.values(this.$scope.component.deploymentArtifacts); + }; + + let onFailed = (error:any):void => { + this.$scope.isLoading = false; + console.log('Delete artifact returned error:', error); + }; + + this.$scope.component.deleteArtifact(artifact.uniqueId, artifact.artifactLabel).then(onSuccess, onFailed); + }; + + let title:string = self.$filter('translate')("ARTIFACT_VIEW_DELETE_MODAL_TITLE"); + let message:string = self.$filter('translate')("ARTIFACT_VIEW_DELETE_MODAL_TEXT", "{'name': '" + artifact.artifactDisplayName + "'}"); + this.ModalsHandler.openConfirmationModal(title, message, false).then(onOk); + }; + }; + + public save = (callback:Function):void => { + this.updateAll(); + this.$scope.setComponent(this.$scope.component); + callback(true); + }; + + public back = (callback:Function):void => { + this.$scope.setComponent(this.$scope.component); + callback(true); + } + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view.html new file mode 100644 index 0000000000..1547618134 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view.html @@ -0,0 +1,149 @@ +
        + +
        Add
        + +
        + +
        + +
        +
        {{header.title}} + +
        +
        +
        + +
        + + + + +
        +
        + +
        + + + {{artifact.artifactDisplayName}} +
        + +
        + {{artifact.artifactType}} +
        +
        + {{artifact.timeout? artifact.timeout:''}} +
        + +
        + + + + + +
        +
        +
        + + + +
        + + + +
        + + + +
        + +
        + + +
        + +
        +
        + + ? + + +
        + + + +
        +
        +
        + + +
        +
        + + ? + + +
        + + + +
        +
        +
        + + +
        +
        + + + + + + +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts.less b/catalog-ui/app/scripts/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts.less new file mode 100644 index 0000000000..9f90a47d5a --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts.less @@ -0,0 +1,102 @@ +.workspace-deployment-artifact { + width: 93%; + display: inline-block; + .table-container-flex .table .body .data-row + div.item-opened { + align-items: center; + padding: 10px 40px 10px 30px; + } + + .w-sdc-classic-btn { + float: right; + margin-bottom: 10px; + } + + .table { + height:490px; + margin-bottom: 0; + } + + .parameter-description { + .circle(18px, @color_p); + content: '?'; + line-height: 18px; + vertical-align: middle; + margin-left: 5px; + cursor: default; + display: inline-block; + position: absolute; + top: 16px; + } + + .table-container-flex { + + margin-top: 27px; + + .flex-item:nth-child(1) { + flex-grow: 15; + .hand; + span.table-arrow { + margin-right: 7px; + } + } + + .flex-item:nth-child(2) { + flex-grow: 6; + } + + .flex-item:nth-child(3) { + flex-grow: 9; + } + + .flex-item:nth-child(4) { + flex-grow: 3; + padding-top: 10px; + } + } + .w-sdc-form{ + text-align: left; + + .w-sdc-env-params{ + border-top: 1px solid #cdcdcd; + margin: 25px 0 10px 0; + } + + .i-sdc-form-textarea { + border: 1px solid @color_e; + min-height: 60px; + padding: 10px 13px; + width: 100%; + resize: none; + + } + + .w-sdc-form-item { + &.error { + .i-sdc-form-input, + .i-sdc-form-select, + .i-sdc-form-textarea { + border-color: @color_h; + outline: none; + box-sizing: border-box; + } + } + } + + .i-sdc-env-form-label{ + font-family: @font-omnes-medium; + color: @main_color_m; + overflow: hidden; + max-width: 450px; + text-overflow: ellipsis; + display: inline-block; + white-space: nowrap; + margin-top: 14px; + + &.required::before { + color: #f33; + content: '*'; + margin-right: 4px; + } + } + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/deployment/deployment-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/deployment/deployment-view-model.ts new file mode 100644 index 0000000000..f8afc0b758 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/deployment/deployment-view-model.ts @@ -0,0 +1,127 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + export interface IDeploymentViewModelScope extends IWorkspaceViewModelScope { + + currentComponent: Models.Components.Component; + selectedComponent: Models.Components.Component; + isLoading: boolean; + sharingService:Sdc.Services.SharingService; + sdcMenu:Models.IAppMenu; + version:string; + isViewOnly:boolean; + tabs:Array; + + setComponent(component: Models.Components.Component); + isComponentInstanceSelected():boolean; + updateSelectedComponent(): void + openUpdateModal(); + deleteSelectedComponentInstance():void; + onBackgroundClick():void; + setSelectedInstance(componentInstance: Models.ComponentsInstances.ComponentInstance): void; + printScreen():void; + + } + + export class DeploymentViewModel { + + static '$inject' = [ + '$scope', + 'sdcMenu', + 'MenuHandler', + '$modal', + '$templateCache', + '$state', + 'Sdc.Services.SharingService', + '$filter', + 'Sdc.Services.CacheService', + 'ComponentFactory', + 'ChangeLifecycleStateHandler', + 'LeftPaletteLoaderService', + 'ModalsHandler' + ]; + + constructor(private $scope:IDeploymentViewModelScope, + private sdcMenu:Models.IAppMenu, + private MenuHandler: Utils.MenuHandler, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService, + private $state:ng.ui.IStateService, + private sharingService:Services.SharingService, + private $filter:ng.IFilterService, + private cacheService:Services.CacheService, + private ComponentFactory: Utils.ComponentFactory, + private ChangeLifecycleStateHandler: Sdc.Utils.ChangeLifecycleStateHandler, + private LeftPaletteLoaderService: Services.Components.LeftPaletteLoaderService, + private ModalsHandler: Sdc.Utils.ModalsHandler) { + + this.$scope.setValidState(true); + this.initScope(); + this.$scope.updateSelectedMenuItem(); + } + + + private initComponent = ():void => { + + this.$scope.currentComponent = this.$scope.component; + this.$scope.selectedComponent = this.$scope.currentComponent; + this.updateUuidMap(); + this.$scope.isViewOnly = this.$scope.isViewMode(); + }; + + + private updateUuidMap = ():void => { + /** + * In case user press F5, the page is refreshed and this.sharingService.currentEntity will be undefined, + * but after loadService or loadResource this.sharingService.currentEntity will be defined. + * Need to update the uuidMap with the new resource or service. + */ + this.sharingService.addUuidValue(this.$scope.currentComponent.uniqueId,this.$scope.currentComponent.uuid); + }; + + private initRightTabs = ()=> { + if(this.$scope.currentComponent.groups){ + + let hierarchyTab = new Models.Tab('/app/scripts/view-models/tabs/hierarchy/hierarchy-view.html', 'Sdc.ViewModels.HierarchyViewModel', 'hierarchy', this.$scope.currentComponent, 'hierarchy'); + this.$scope.tabs = Array(); + this.$scope.tabs.push(hierarchyTab) + } + + } + private initScope = ():void => { + + this.$scope.sharingService = this.sharingService; + this.$scope.sdcMenu = this.sdcMenu; + this.$scope.isLoading = false; + + this.$scope.version = this.cacheService.get('version'); + this.initComponent(); + + this.$scope.setComponent = (component: Models.Components.Product):void => { + this.$scope.currentComponent = component; + } + + this.initRightTabs(); + } + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/deployment/deployment-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/deployment/deployment-view.html new file mode 100644 index 0000000000..9e26656f5f --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/deployment/deployment-view.html @@ -0,0 +1,10 @@ +
        +
        + + +
        + +
        + +
        +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/deployment/deployment.less b/catalog-ui/app/scripts/view-models/workspace/tabs/deployment/deployment.less new file mode 100644 index 0000000000..0439ccd0fa --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/deployment/deployment.less @@ -0,0 +1,33 @@ +.deployment-view{ + + display: inline-block; + text-align: left; + align-items: left; + padding: 0; + width: 100%; + height: 100%; + + .w-sdc-deployment-canvas { + .noselect; + .bg_c; + bottom: 0; + width: 100%; + height: 100%; + + .view-mode{ + background-color: #f8f8f8; + border:0; + } + } + + .w-sdc-deployment-right-bar { + + .noselect; + bottom: 0; + position: absolute; + right: 0px; + transition: right 0.2s; + z-index: 10000; + top: @action_nav_height; + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/disribution-status-modal/disribution-status-modal-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/disribution-status-modal/disribution-status-modal-view-model.ts new file mode 100644 index 0000000000..c0d6aba915 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/disribution-status-modal/disribution-status-modal-view-model.ts @@ -0,0 +1,67 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + interface IDistributionStatusModalViewModelScope { + distribution:Models.Distribution; + status:string; + getStatusCount(distributionComponent:Array):any; + getUrlName(url:string):string; + modalDitributionStatus:ng.ui.bootstrap.IModalServiceInstance; + footerButtons: Array; + close(): void; + } + + export class DistributionStatusModalViewModel { + + static '$inject' = ['$scope','$modalInstance', 'data']; + + constructor(private $scope:IDistributionStatusModalViewModelScope, + private $modalInstance:ng.ui.bootstrap.IModalServiceInstance, + private data:any + ) { + this.initScope(); + } + + private initScope = ():void => { + this.$scope.distribution = this.data.distribution; + this.$scope.status = this.data.status; + this.$scope.modalDitributionStatus = this.$modalInstance; + + this.$scope.getUrlName = (url:string):string =>{ + let urlName:string = _.last(url.split('/')); + return urlName; + }; + + this.$scope.close = ():void => { + this.$modalInstance.close(); + }; + + this.$scope.footerButtons = [ + {'name': 'Close', 'css': 'blue', 'callback': this.$scope.close } + ]; + + }; + + + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/disribution-status-modal/disribution-status-modal-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/disribution-status-modal/disribution-status-modal-view.html new file mode 100644 index 0000000000..b3393e99e0 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/disribution-status-modal/disribution-status-modal-view.html @@ -0,0 +1,126 @@ + + +
        +
        + +
        + + + +
        +
          +
        • +
          + +
          +
          +
          +
          Distribution ID
          +
          +
          +
          +
          +
          +
          +
          +
          Time[UTC]:
          +
          +
          +
          + + +
          +
          +
          +
          Status: {{status}}
          + +
          +
          +
          + +
            +
          • +
            +
            +
            +
            {{omfComponentID}} {{omfComponentList.length}} +
            +
            +
            +
            +
            +
            +
            +
            Component ID
            +
            Artifact Name
            +
            URL
            +
            Time(UTC)
            +
            Status
            +
            + +
            +
            +
            + {{urlList[0].omfComponentID}} +
            +
            + {{getUrlName(urlList[0].url)}} +
            +
            +
            {{urlList[0].url}}
            + +
            +
            +
            +
            {{urlList[0].status}}
            +
            + + +
            +
            +
              +
            • + + {{distributionComponent.status}} + Reason: Component has determined artifact is not needed. + Reason: {{distributionComponent.errorReason}} +
            • +
            +
            +
            +
            +
            +
            +
          • +
          +
        • +
        +
        + +
        +
        + + +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/disribution-status-modal/disribution-status-modal.less b/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/disribution-status-modal/disribution-status-modal.less new file mode 100644 index 0000000000..02321b6e2f --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/disribution-status-modal/disribution-status-modal.less @@ -0,0 +1,33 @@ +.w-sdc-classic-top-line-modal { + + .w-sdc-modal-head { + // border-bottom: none; + } + .w-sdc-distribution-view { + + .w-sdc-distribution-view-content { + height: 500px; + } + + .w-sdc-distribution-view-content-section { + + .w-sdc-distribute-parent-block { + .w-sdc-distribute-components-block { + + .omf-component-row { + .w-sdc-distribute-status-block { + margin-left: 0; + } + + } + div { + padding-left: 0; + } + } + + } + + } + } +} + diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/distribution-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/distribution-view-model.ts new file mode 100644 index 0000000000..219585fc3d --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/distribution-view-model.ts @@ -0,0 +1,135 @@ +/*- + * ============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========================================================= + */ +/// + +module Sdc.ViewModels { + 'use strict'; + + interface IDistributionViewModel extends IWorkspaceViewModelScope{ + modalDistribution:ng.ui.bootstrap.IModalServiceInstance; + service: Models.Components.Service; + distributions : Array; + showComponents(distribution:Models.Distribution): void; + markAsDeployed(distribution:Models.Distribution): void; + getStatusCount(distributionComponent:Array):any; + initDistributions():void; + getUrlName(url:string):string; + close(): void; + openDisributionStatusModal:Function; + } + + export class DistributionViewModel{ + + static '$inject' = [ + '$scope', + 'ModalsHandler' + + ]; + + constructor( + private $scope:IDistributionViewModel, + private ModalsHandler: Sdc.Utils.ModalsHandler + ){ + this.initScope(); + this.$scope.setValidState(true); + this.$scope.updateSelectedMenuItem(); + } + + private initScope = (): void => { + this.$scope.service = this.$scope.component; + + + // Open Distribution status modal + this.$scope.openDisributionStatusModal = (distribution: Models.Distribution,status:string):void => { + this.ModalsHandler.openDistributionStatusModal(distribution,status).then(()=>{ + // OK + }, ()=>{ + // ERROR + }); + }; + + + this.$scope.showComponents = (distribution: Models.Distribution): void => { + let onError = (response) => { + console.info('onError showComponents',response); + }; + let onSuccess = (distributionComponents: Array) => { + distribution.distributionComponents = distributionComponents; + distribution.statusCount = this.$scope.getStatusCount(distribution.distributionComponents); + // distribution.components = this.aggregateDistributionComponent(distributionComponents);; + }; + this.$scope.service.getDistributionsComponent(distribution.distributionID).then(onSuccess, onError); + }; + + this.$scope.getStatusCount = (distributionComponent:Array):any => { + return _.countBy(distributionComponent, 'status') + }; + + this.$scope.getUrlName = (url:string):string =>{ + let urlName:string = _.last(url.split('/')); + return urlName; + }; + + this.$scope.markAsDeployed = (distribution: Models.Distribution): void => { + let onError = (response) => { + console.info('onError markAsDeployed',response); + }; + let onSuccess = (result: any) => { + distribution.deployementStatus = 'Deployed'; + }; + this.$scope.service.markAsDeployed(distribution.distributionID).then(onSuccess, onError); + + }; + + this.$scope.initDistributions = (): void => { + let onError = (response) => { + console.info('onError initDistributions',response); + }; + let onSuccess = (distributions: Array) => { + this.$scope.distributions = distributions; + }; + this.$scope.service.getDistributionsList().then(onSuccess, onError); + }; + + this.$scope.initDistributions(); + + }; + + + private aggregateDistributionComponent = (distributionComponents:Array):any =>{ + let aggregateDistributions:Utils.Dictionary>> = new Utils.Dictionary>>(); + let tempAggregateDistributions:any= _.groupBy(distributionComponents,'omfComponentID'); + let aa = new Utils.Dictionary>(); + + let tempAggregate:any; + _.forEach(tempAggregateDistributions,(distributionComponents:Array,omfComponentID:string)=>{ + + let urls:any = _.groupBy(distributionComponents,'url'); + aggregateDistributions.setValue(omfComponentID,urls); + // aggregateDistributions[omfComponentID] = ; + + }); + console.log(aggregateDistributions); + return aggregateDistributions; + }; + + + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/distribution-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/distribution-view.html new file mode 100644 index 0000000000..1ab0f1e111 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/distribution-view.html @@ -0,0 +1,171 @@ +
        +
        +
        DISTRIBUTION
        +
        + +
        +
        + + + +
        +
          +
        • +
          +
          +
          +
          +
          +
          Distribution ID
          +
          +
          +
          +
          +
          +
          +
          +
          Time[UTC]:
          +
          +
          +
          + + +
          +
          +
          +
          +
          +
          +
          Total Artifacts:
          +
          Notified:
          + + + +
          Errors:
          +
          +
          +
          + +
            + +
          • +
            +
            +
            +
            {{omfComponentID}} {{(statusCount.NOT_NOTIFIED || 0) + (statusCount.NOTIFIED || 0) }} +
            +
            Notified:
            +
            Downloaded:
            +
            Deployed:
            +
            Not Notified:
            +
            Errors:
            +
            +
            +
            +
            +
            +
            +
            Component ID
            +
            Artifact Name
            +
            URL
            +
            Time(UTC)
            +
            Status
            +
            + +
            +
            +
            + {{urlList[0].omfComponentID}} +
            +
            + {{getUrlName(urlList[0].url)}} +
            +
            +
            {{urlList[0].url}}
            + +
            +
            +
            +
            {{urlList[0].status}}
            +
            + + +
            +
            +
              +
            • + + {{distributionComponent.status}} + Reason: Component has determined artifact is not needed. + Reason: {{distributionComponent.errorReason}} +
            • +
            +
            +
            +
            +
            +
            +
          • +
          +
        • +
        +
        + +
        +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/distribution.less b/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/distribution.less new file mode 100644 index 0000000000..8ad8c1793e --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/distribution/distribution.less @@ -0,0 +1,361 @@ + +.w-sdc-distribution-view { + text-align: left; + + .g_1; + min-height: 500px; + + .w-sdc-distribution-view-distributed-green-text { + .l_9; + .bold; + } + .w-sdc-distribution-view-distributed-error-red-text { + .h_9; + .bold; + } + + .bg_c; + vertical-align: top; + padding: 30px 10px; + width: 100%; + + .w-sdc-distribution-view-header { + display: flex; + -webkit-justify-content: space-between; + margin: 0 25px 5px 40px; + + .header-spacer { + flex-grow: 5; + } + } + + .top-search { + position: relative; + input { + &.search-text { + height: 26px; + line-height: 26px; + margin: 0 18px 4px 20px; + padding-right: 25px; + } + + } + .magnification { + top: 8px; + right: 25px; + } + } + + .w-sdc-distribution-view-content { + .perfect-scrollbar; + padding: 0 25px 0 0px; + margin-bottom: 25px; + height: 700px; + overflow: hidden; + position: relative; + + } + + .w-sdc-distribution-view-title { + .s_14_r; + + line-height: 30px; + + span { + padding-left: 5px; + } + } + + .blue-font { + .a_14_m; + + } + + .red-font { + .q_14_m; + } + + .w-sdc-distribution-view-block { + div { + display: inline-block; + } + } + + .w-sdc-distribution-view-content-section { + ul { + list-style-type: none; + } + + .distribution-bth { + .hand; + &.disabled { + cursor: none; + } + } + + .copy-link { + padding-right: 19px; + margin-left: 8px; + cursor: pointer; + + } + + .w-sdc-distribute-row-extends { + border-Left: solid 4px transparent; + &.extends { + border-left: solid 4px @main_color_c; + border-bottom: 1px solid @border_color_f; + margin-bottom: 10px; + } + } + .w-sdc-distribute-parent-block { + border: 1px solid @main_color_o;; + width: 100%; + margin-bottom: 6px; + + .status-icon { + vertical-align: middle; + margin-bottom: 4px; + } + + &.extends { + background-color: @tlv_color_t; + } + + :not(.disable-hover):hover { + background-color: @tlv_color_u; + } + + .title-section { + display: inline-block; + margin-right: 10px; + flex-basis: 0; + } + + .title { + .l_12_m; + font-weight: bold; + } + .w-sdc-distribute-content { + display: flex; + align-items: center; + justify-content: space-between; + margin-left: 10px; + } + + .w-sdc-distribution-arrow-btn { + .sprite-new; + .arrow-up-small; + margin: 0 6px; + } + .extends.w-sdc-distribution-arrow-btn { + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); + } + + .w-sdc-distribute-row { + display: flex; + align-items: center; + justify-content: space-between; + + .w-sdc-distribute-row-content { + margin: 15px 31px 10px 0; + width: 100%; + .w-sdc-distribute-status-block { + border-top: solid 1px @main_color_o; + } + .item-1 { + flex-grow: 2; + } + .item-2 { + flex-grow: 1; + } + .item-3 { + flex-grow: 1; + } + .item-4 { + flex-grow: 1; + } + .item-5 { + flex-grow: 1; + } + } + } + + .w-sdc-distribute-status-block { + display: flex; + align-items: center; + justify-content: space-between; + margin: 10px 5px 0 5px; + padding: 5px 5px 0 5px;; + width: 100%; + div { + border-left: 1px solid @main_color_o; + padding: 0 12px; + } + + .link { + .a_14_m; + cursor: pointer; + &:hover{ + text-decoration: underline; + .b_14_m; + } + } + + span { + padding: 2px; + } + + .deployed { + margin-left: 10px; + .sprite-new; + .success-circle-small; + } + + .error { + .q_14_m; + margin-left: 10px; + .sprite-new; + .error-icon; + } + + .status-item-1 { + border-left: 0; + } + + .status-item-6 { + flex-grow: 1; + border-left: none; + text-align: right; + } + } + + .w-sdc-distribute-components-block { + padding: 0; + padding-bottom: 5px; + list-style-type: none; + + li { + margin: 5px 2px; + } + + .omf-component-row { + border: 1px solid @border_color_f; + padding-left: 3px; + background-color: white; + margin: 0 30px; + &.extends { + padding-left: 0; + border-Left: solid 4px @main_color_c; + + } + + .w-sdc-distribute-status-block { + margin: 5px; + padding: 5px; + } + + .blue-font { + .a_16_m; + + } + + &:hover { + background-color: @tlv_color_u; + } + + } + + } + + .w-sdc-distribute-omfComponent-block { + background-color: white; + margin: 0 30px; + padding: 8px 10px; + border: 1px solid @border_color_f; + + .omfComponent-table-head { + margin-bottom: 5px; + background-color: @tlv_color_u; + .title { + padding: 6px 10px; + border-left: 1px solid @border_color_f; + &:first-child { + border: none; + } + } + } + + .omfComponent-table-row { + border-bottom: 1px solid @border_color_f; + &.row-0 { + border-top: 1px solid @border_color_f; + } + .w-sdc-distribute-cell { + padding: 10px; + border-left: 1px solid @border_color_f; + &:last-child { + border-right: 1px solid @border_color_f; + } + &.item-5 { + .m_14_m; + } + } + } + + .distribution-url { + + } + + .w-sdc-distribute-row.extends { + border-Left: solid 4px @main_color_c; + .item-1 { + border: none; + } + + } + + .item-1 { + width: 20%; + } + .item-2 { + width: 20%; + } + + .item-3 { + width: 24%; + display: flex; + } + + .item-4 { + width: 18%; + } + + .item-5 { + width: 18%; + } + } + + .w-sdc-distribute-url-block { + + padding: 10px 15px; + border: none; + border-right: 1px solid @border_color_f; + border-bottom: 1px solid @border_color_f; + width: 100%; + li { + border: none; + span { + padding-right: 30px; + .m_12_r; + } + } + + } + } + + } +} + diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/general/general-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/general/general-view-model.ts new file mode 100644 index 0000000000..f613648596 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/general/general-view-model.ts @@ -0,0 +1,379 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + + 'use strict'; + import Resource = Sdc.Models.Components.Resource; + import ISubCategory = Sdc.Models.ISubCategory; + import IMainCategory = Sdc.Models.IMainCategory; + import ResourceType = Sdc.Utils.Constants.ResourceType; + + export class Validation { + validationPattern:RegExp; + contactIdValidationPattern:RegExp; + tagValidationPattern:RegExp; + vendorValidationPattern:RegExp; + commentValidationPattern:RegExp; + projectCodeValidationPattern:RegExp; + } + + export interface IGeneralScope extends IWorkspaceViewModelScope { + validation:Validation; + editForm:ng.IFormController; + categories: Array; + latestCategoryId: string; + latestVendorName: string; + importedFileExtension:any; + isCreate:boolean; + isShowFileBrowse:boolean; + isShowOnboardingSelectionBrowse:boolean; + importedToscaBrowseFileText:string; + importCsarProgressKey:string; + browseFileLabel:string; + + + onToscaFileChange():void + validateField(field:any):boolean; + validateName(isInit:boolean): void; + calculateUnique(mainCategory:string, subCategory:string):string; // Build unique string from main and sub category + onVendorNameChange(oldVendorName:string): void; + convertCategoryStringToOneArray(category:string, subcategory:string):Array; + onCategoryChange():void; + openOnBoardingModal():void; + initCategoreis():void; + } + + export class GeneralViewModel { + + static '$inject' = [ + '$scope', + 'Sdc.Services.CacheService', + 'ValidationPattern', + 'ContactIdValidationPattern', + 'TagValidationPattern', + 'VendorValidationPattern', + 'CommentValidationPattern', + 'ValidationUtils', + 'sdcConfig', + 'ProjectCodeValidationPattern', + '$state', + 'ModalsHandler', + 'EventListenerService', + 'Notification', + 'Sdc.Services.ProgressService', + '$interval', + '$filter', + '$timeout' + ]; + + constructor(private $scope:IGeneralScope, + private cacheService:Services.CacheService, + private ValidationPattern:RegExp, + private ContactIdValidationPattern:RegExp, + private TagValidationPattern:RegExp, + private VendorValidationPattern:RegExp, + private CommentValidationPattern:RegExp, + private ValidationUtils:Sdc.Utils.ValidationUtils, + private sdcConfig:Models.IAppConfigurtaion, + private ProjectCodeValidationPattern:RegExp, + private $state:ng.ui.IStateService, + private ModalsHandler: Sdc.Utils.ModalsHandler, + private EventListenerService:Services.EventListenerService, + private Notification:any, + private progressService:Sdc.Services.ProgressService, + protected $interval:any, + private $filter:ng.IFilterService, + private $timeout:ng.ITimeoutService + ){ + + this.registerToSuccessSaveEvent(); + this.initScopeValidation(); + this.initScopeMethods(); + this.initScope(); + this.$scope.updateSelectedMenuItem(); + } + + private registerToSuccessSaveEvent = ():void => { + // Register to save success to show notification to user. + this.EventListenerService.registerObserverCallback(Utils.Constants.EVENTS.ON_WORKSPACE_SAVE_BUTTON_SUCCESS, this.showSuccessNotificationMessage); + + }; + + private showSuccessNotificationMessage = ():void => { + // In case we import CSAR. Notify user when import VF was finished. + this.Notification.success({ + message: this.$filter('translate')("IMPORT_VF_MESSAGE_CREATE_FINISHED_DESCRIPTION"), + title: this.$filter('translate')("IMPORT_VF_MESSAGE_CREATE_FINISHED_TITLE") + }); + + //set the form Pristine after save to reset the unsaved changes (whit for dom reload) + this.$timeout(()=> { + if(this.$scope.editForm) { + this.$scope.editForm.$setPristine(); + } + }, 500); + + }; + + + + private initScopeValidation = ():void => { + this.$scope.validation = new Validation(); + this.$scope.validation.validationPattern = this.ValidationPattern; + this.$scope.validation.contactIdValidationPattern = this.ContactIdValidationPattern; + this.$scope.validation.tagValidationPattern = this.TagValidationPattern; + this.$scope.validation.vendorValidationPattern = this.VendorValidationPattern; + this.$scope.validation.commentValidationPattern = this.CommentValidationPattern; + this.$scope.validation.projectCodeValidationPattern = this.ProjectCodeValidationPattern; + }; + + private initScope = ():void => { + + // Work around to change the csar version + if (this.cacheService.get(Utils.Constants.CHANGE_COMPONENT_CSAR_VERSION_FLAG)) { + (this.$scope.component).csarVersion = this.cacheService.get(Utils.Constants.CHANGE_COMPONENT_CSAR_VERSION_FLAG); + } + + this.$scope.importedToscaBrowseFileText = this.$scope.component.name + " (" + (this.$scope.component).csarVersion + ")"; + this.$scope.importCsarProgressKey = "importCsarProgressKey"; + this.$scope.browseFileLabel = this.$scope.component.isResource() && (this.$scope.component).resourceType===ResourceType.VF? "Upload file" : "Upload VFC"; + this.$scope.progressService = this.progressService; + + // Workaround to short vendor name to 25 chars + // onboarding send 27 chars, and the validation pattern is 25 chars. + if (this.$scope.component.vendorName){ + this.$scope.component.vendorName = this.$scope.component.vendorName.substr(0, 25); + } + + // Init UIModel + this.$scope.component.tags = _.without(this.$scope.component.tags, this.$scope.component.name); + + // Init categories + this.$scope.initCategoreis(); + + // Init the decision if to show file browse. + this.$scope.isShowFileBrowse = false; + if (this.$scope.component.isResource()){ + let resource:Sdc.Models.Components.Resource = this.$scope.component; + console.log(resource.name + ": " + resource.csarUUID); + if (resource.importedFile){ // Component has imported file. + this.$scope.isShowFileBrowse = true; + } + if (this.$scope.isEditMode() && resource.resourceType== ResourceType.VF && !resource.csarUUID){ + this.$scope.isShowFileBrowse = true; + } + }; + + // Init the decision if to show onboarding + this.$scope.isShowOnboardingSelectionBrowse = false; + if (this.$scope.component.isResource() && + this.$scope.isEditMode() && + (this.$scope.component).resourceType== ResourceType.VF && + (this.$scope.component).csarUUID) { + this.$scope.isShowOnboardingSelectionBrowse = true; + } + + //init file extensions based on the file that was imported. + if (this.$scope.component.isResource() && (this.$scope.component).importedFile){ + let fileName:string = (this.$scope.component).importedFile.filename; + let fileExtension:string = fileName.split(".").pop(); + if (this.sdcConfig.csarFileExtension.indexOf(fileExtension.toLowerCase()) !== -1){ + this.$scope.importedFileExtension = this.sdcConfig.csarFileExtension; + (this.$scope.component).importedFile.filetype="csar"; + } else if (this.sdcConfig.toscaFileExtension.indexOf(fileExtension.toLowerCase()) !== -1){ + (this.$scope.component).importedFile.filetype="yaml"; + this.$scope.importedFileExtension = this.sdcConfig.toscaFileExtension; + } + }else if(this.$scope.isEditMode()&& (this.$scope.component).resourceType === ResourceType.VF){ + this.$scope.importedFileExtension = this.sdcConfig.csarFileExtension; + //(this.$scope.component).importedFile.filetype="csar"; + } + + this.$scope.setValidState(true); + + this.$scope.calculateUnique = (mainCategory:string, subCategory:string):string => { + let uniqueId:string = mainCategory; + if (subCategory) { + uniqueId += "_#_" + subCategory; // Set the select category combobox to show the selected category. + } + return uniqueId; + }; + + //TODO remove this after handling contact in UI + if(this.$scope.component.isProduct() && this.$scope.isCreateMode()){ + (this.$scope.component).contacts = []; + (this.$scope.component).contacts.push(this.cacheService.get("user").userId); + }else if(this.$scope.isCreateMode()){ + this.$scope.component.contactId = this.cacheService.get("user").userId; + } + + }; + + // Convert category string MainCategory_#_SubCategory to Array with one item (like the server except) + private convertCategoryStringToOneArray = ():Array => { + let tmp = this.$scope.component.selectedCategory.split("_#_"); + let mainCategory = tmp[0]; + let subCategory = tmp[1]; + + // Find the selected category and add the relevant sub category. + let selectedMainCategory:IMainCategory = _.find(this.$scope.categories, function (item) { + return item["name"] === mainCategory; + + }); + + let mainCategoryClone = angular.copy(selectedMainCategory); + if (subCategory) { + let selectedSubcategory = _.find(selectedMainCategory.subcategories, function (item) { + return item["name"] === subCategory; + }); + mainCategoryClone['subcategories'] = [angular.copy(selectedSubcategory)]; + } + let tmpSelected = mainCategoryClone; + + let result:Array = []; + result.push(tmpSelected); + + return result; + }; + + private updateComponentNameInBreadcrumbs = ():void => { + //update breadcrum after changing name + this.$scope.breadcrumbsModel[1].updateSelectedMenuItemText(this.$scope.component.getComponentSubType() + ': ' + this.$scope.component.name); + this.$scope.updateMenuComponentName(this.$scope.component.name); + }; + + private initScopeMethods = ():void => { + + this.$scope.initCategoreis = ():void => { + if (this.$scope.componentType === Utils.Constants.ComponentType.RESOURCE) { + this.$scope.categories = this.cacheService.get('resourceCategories'); + + } + if (this.$scope.componentType === Utils.Constants.ComponentType.SERVICE) { + this.$scope.categories = this.cacheService.get('serviceCategories'); + } + } + + this.$scope.validateField = (field:any):boolean => { + if (field && field.$dirty && field.$invalid) { + return true; + } + return false; + }; + + this.$scope.openOnBoardingModal=():void => { + let csarUUID = (this.$scope.component).csarUUID; + this.ModalsHandler.openOnboadrdingModal('Update', csarUUID).then(()=>{ + // OK + this.$scope.uploadFileChangedInGeneralTab(); + }, ()=>{ + // ERROR + }); + }; + + this.$scope.validateName = (isInit:boolean):void => { + if (isInit === undefined) { + isInit = false; + } + + let name = this.$scope.component.name; + if (!name || name === "") { + if (this.$scope.editForm + && this.$scope.editForm["componentName"] + && this.$scope.editForm["componentName"].$error) { + + // Clear the error name already exists + this.$scope.editForm["componentName"].$setValidity('nameExist', true); + } + + return; + } + //????????????????????????? + let subtype:string = Utils.Constants.ComponentType.RESOURCE == this.$scope.componentType ? this.$scope.component.getComponentSubType() : undefined; + + let onFailed = (response) => { + //console.info('onFaild', response); + //this.$scope.isLoading = false; + }; + + let onSuccess = (validation:Models.IValidate) => { + this.$scope.editForm["componentName"].$setValidity('nameExist', validation.isValid); + if(validation.isValid){ + //update breadcrumb after changing name + this.updateComponentNameInBreadcrumbs(); + } + }; + + if (isInit) { + // When page is init after update + if (this.$scope.component.name !== this.$scope.originComponent.name) { + if (!(this.$scope.componentType===Utils.Constants.ComponentType.RESOURCE && (this.$scope.component).csarUUID!==undefined) + ){ + this.$scope.component.validateName(name, subtype).then(onSuccess, onFailed); + } + } + } else { + // Validating on change (has debounce) + if (this.$scope.editForm + && this.$scope.editForm["componentName"] + && this.$scope.editForm["componentName"].$error + && !this.$scope.editForm["componentName"].$error.pattern + && this.$scope.component.name !== this.$scope.originComponent.name + ) { + if (!(this.$scope.componentType===Utils.Constants.ComponentType.RESOURCE && (this.$scope.component).csarUUID!==undefined) + ){ + this.$scope.component.validateName(name, subtype).then(onSuccess, onFailed); + } + } else if (this.$scope.component.name === this.$scope.originComponent.name) { + // Clear the error + this.$scope.editForm["componentName"].$setValidity('nameExist', true); + } + } + }; + + this.$scope.$watchCollection('component.name', (newData:any):void => { + this.$scope.validateName(false); + }); + + // Notify the parent if this step valid or not. + this.$scope.$watch("editForm.$valid", (newVal, oldVal) => { + this.$scope.setValidState(newVal); + }); + + this.$scope.$watch("editForm.$dirty", (newVal, oldVal) => { + if (newVal!==oldVal) { + this.$state.current.data.unsavedChanges = newVal && !this.$scope.isCreateMode(); + } + }); + + this.$scope.onCategoryChange = ():void => { + this.$scope.component.categories = this.convertCategoryStringToOneArray(); + this.$scope.component.icon = Utils.Constants.DEFAULT_ICON; + }; + + this.$scope.onVendorNameChange = (oldVendorName:string):void => { + if (this.$scope.component.icon === oldVendorName) { + this.$scope.component.icon = Utils.Constants.DEFAULT_ICON; + } + }; + }; + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/general/general-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/general/general-view.html new file mode 100644 index 0000000000..1c1d4fedad --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/general/general-view.html @@ -0,0 +1,307 @@ +
        + +
        + +
        + + +
        + + +
        + + +
        + +
        + {{(fileModel && fileModel.filename) || importedToscaBrowseFileText}} +
        + +
        Browse
        +
        +
        + +
        + + + + + +
        + + +
        + +
        + + +
        + + + +
        + + + + + +
        +
        + + + +
        + + + +
        + + + + + +
        +
        + + + +
        + + + + +
        + + + +
        +
        + + + +
        + + + + +
        + +
        +
        + + + +
        + + + +
        + + +
        +
        + + +
        + + + +
        + + + +
        + +
        + + + + +
        + + + +
        + + + +
        +
        + + + + +
        + +
        + + +
        + + + + +
        + + +
        +
        + + + +
        + + + + +
        + + +
        +
        + + + +
        +
        + +
        + +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/general/general.less b/catalog-ui/app/scripts/view-models/workspace/tabs/general/general.less new file mode 100644 index 0000000000..1861d02e98 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/general/general.less @@ -0,0 +1,64 @@ +.sdc-workspace-general-step { + + .w-sdc-form { + padding: 0; + + .i-sdc-form-file-upload{ + input[type="button"] { + cursor: pointer; + display: block; + filter: alpha(opacity=0); + width: 100px; + height: 30px; + opacity: 0; + position: absolute; + right: 0; + text-align: right; + top: 0; + } + + .file-upload-browse-btn { + .noselect; + .bg_n; + padding: 4px 6px; + cursor: pointer; + z-index: 999; + width: 100px; + height: 28px; + text-align: center; + + &.disabled { + cursor: default; + } + } + } + + .w-sdc-form-section-container { + text-align: center; + } + + .i-sdc-form-item { + &.upload { + margin-top: 0; + width: auto; + padding: 10px; + } + } + + .template-desc { + border: 1px dashed @border_color_f; + height: 130px; + overflow: hidden; + padding: 10px 6px 6px 6px; + margin-top: 10px; + } + + .sdc-tag .tag { + max-width: 225px; + } + + } + +} + + diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/icons/icons-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/icons/icons-view-model.ts new file mode 100644 index 0000000000..a591641d0a --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/icons/icons-view-model.ts @@ -0,0 +1,131 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 4/4/2016. + */ +/// +module Sdc.ViewModels { + 'use strict'; + + export interface IIconsScope extends IWorkspaceViewModelScope { + icons : Array; + iconSprite: string; + setComponentIcon(iconSrc:string): void; + } + + export class IconsViewModel { + + static '$inject' = [ + '$scope', + 'Sdc.Services.AvailableIconsService', + 'ComponentFactory', + '$state' + ]; + + constructor(private $scope:IIconsScope, + private availableIconsService:Services.AvailableIconsService, + private ComponentFactory:Sdc.Utils.ComponentFactory, + private $state:ng.ui.IStateService) { + + + this.initScope(); + this.initIcons(); + this.$scope.updateSelectedMenuItem(); + this.$scope.iconSprite = this.$scope.component.iconSprite; + + if (this.$scope.component.isResource()) { + this.initVendor(); + } + } + + private initialIcon:string = this.$scope.component.icon; + private initIcons = ():void => { + + // For subcategories that where created by admin, there is no icons + this.$scope.icons = new Array(); + if (this.$scope.component.categories && this.$scope.component.categories.length > 0) { + + _.forEach(this.$scope.component.categories, (category:Models.IMainCategory):void => { + if (category.icons) { + this.$scope.icons = this.$scope.icons.concat(category.icons); + } + if (category.subcategories) { + _.forEach(category.subcategories, (subcategory:Models.ISubCategory):void => { + if (subcategory.icons) { + this.$scope.icons = this.$scope.icons.concat(subcategory.icons); + } + }); + } + }); + } + + if (this.$scope.component.isResource()) { + let resourceType:string = this.$scope.component.getComponentSubType(); + if (resourceType === 'VL') { + this.$scope.icons = ['vl']; + } + if (resourceType === 'CP') { + this.$scope.icons = ['cp']; + } + } + + if (this.$scope.icons.length === 0) { + this.$scope.icons = this.availableIconsService.getIcons(this.$scope.component.componentType); + } + //we always add the defual icon to the list + this.$scope.icons.push('defaulticon'); + }; + + private initVendor = ():void => { + let vendors:Array = this.availableIconsService.getIcons(this.$scope.component.componentType).slice(5, 19); + let vendorName = this.$scope.component.vendorName.toLowerCase(); + if ('at&t' === vendorName) { + vendorName = 'att'; + } + if ('nokia' === vendorName) { + vendorName = 'nokiasiemens'; + } + + let vendor:string = _.find(vendors, (vendor:string)=> { + return vendor.replace(/[_]/g, '').toLowerCase() === vendorName; + }); + + if (vendor && this.$scope.icons.indexOf(vendor) === -1) { + this.$scope.icons.push(vendor); + } + }; + + private initScope():void { + this.$scope.icons = []; + this.$scope.setValidState(true); + //if(this.$scope.component.icon === Utils.Constants.DEFAULT_ICON){ + // //this.$scope.setValidState(false); + //} + + this.$scope.setComponentIcon = (iconSrc:string):void => { + this.$state.current.data.unsavedChanges = !this.$scope.isViewMode() && (iconSrc != this.initialIcon); + this.$scope.component.icon = iconSrc; + // this.$scope.setValidState(true); + }; + + } + + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/icons/icons-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/icons/icons-view.html new file mode 100644 index 0000000000..aac14e0e84 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/icons/icons-view.html @@ -0,0 +1,26 @@ +
        + +
        + +
        +
        +
        +
        +
        Select one of the icons below for the asset
        +
        +
        +
        +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/icons/icons.less b/catalog-ui/app/scripts/view-models/workspace/tabs/icons/icons.less new file mode 100644 index 0000000000..65f946f395 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/icons/icons.less @@ -0,0 +1,65 @@ +.workspace-icons { + + width: 89%; + display: inline-block; + text-align: center; + align-items: center; + + .w-sdc-form { + padding-top: 0px; + padding-bottom: 0px; + .selected-icon-container { + text-align: left; + border: 1px solid #cfcfcf; + clear: both; + margin-bottom: 30px; + padding: 2px 0px 5px 5px; + .selected-icon { + margin: 8px 5px 0px 6px; + } + } + + .suggested-icons-container { + text-align: left; + border: 1px solid #cfcfcf; + clear: both; + padding: 2px 0px 5px 5px; + height: 340px; + margin-bottom: 0px; + + .suggested-icon-wrapper { + margin: 8px 5px 0px 6px; + display: inline-block; + + &.selected { + border: 2px solid @main_color_a; + border-radius: 35px; + display: inline-block; + line-height: 0px; + padding: 3px; + } + + } + .suggested-icon { + // margin: 8px 5px 0px 6px; + display: inline-block; + &.disable{ + opacity: 0.4; + } + } + } + + .icons-label { + float: left; + } + + .icons-text { + text-align: left; + line-height: 32px; + padding-left: 10px; + width: 100%; + border: 1px solid #cfcfcf; + border-bottom: none; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/information-artifacts/information-artifacts-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/information-artifacts/information-artifacts-view-model.ts new file mode 100644 index 0000000000..3a048c1879 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/information-artifacts/information-artifacts-view-model.ts @@ -0,0 +1,150 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + import ArtifactModel = Sdc.Models.ArtifactModel; + + export interface IInformationArtifactsScope extends IWorkspaceViewModelScope { + artifacts: Array; + tableHeadersList: Array; + artifactType: string; + isResourceInstance:boolean; + downloadFile:Models.IFileDownload; + isLoading:boolean; + sortBy:string; + reverse:boolean; + + getTitle(): string; + addOrUpdate(artifact:Models.ArtifactModel): void; + delete(artifact:Models.ArtifactModel): void; + download(artifact:Models.ArtifactModel): void; + clickArtifactName(artifact:any):void; + openEditEnvParametersModal(artifactResource:Models.ArtifactModel):void; + sort(sortBy:string): void; + showNoArtifactMessage():boolean; + } + + export class InformationArtifactsViewModel { + + static '$inject' = [ + '$scope', + '$filter', + '$modal', + '$templateCache', + 'Sdc.Services.SharingService', + '$state', + 'sdcConfig', + 'ModalsHandler' + ]; + + constructor(private $scope:IInformationArtifactsScope, + private $filter:ng.IFilterService, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService, + private sharingService:Sdc.Services.SharingService, + private $state:any, + private sdcConfig:Models.IAppConfigurtaion, + private ModalsHandler:Utils.ModalsHandler) { + this.initScope(); + this.$scope.updateSelectedMenuItem(); + } + + + private getMappedObjects():any { + return { + normal: this.$scope.component.artifacts + }; + } + + private initScope = ():void => { + let self = this; + this.$scope.isLoading = false; + this.$scope.sortBy = 'artifactDisplayName'; + this.$scope.reverse = false; + this.$scope.setValidState(true); + this.$scope.artifactType = 'normal'; + this.$scope.getTitle = ():string => { + return this.$filter("resourceName")(this.$scope.component.name) + ' Artifacts'; + + }; + + this.$scope.tableHeadersList = [ + {title: 'Name', property: 'artifactDisplayName'}, + {title: 'Type', property: 'artifactType'} + ]; + + this.$scope.artifacts = _.values(this.$scope.component.artifacts); + this.$scope.sort = (sortBy:string):void => { + this.$scope.reverse = (this.$scope.sortBy === sortBy) ? !this.$scope.reverse : false; + this.$scope.sortBy = sortBy; + }; + + + this.$scope.addOrUpdate = (artifact:Models.ArtifactModel):void => { + artifact.artifactGroupType = 'INFORMATIONAL'; + this.ModalsHandler.openWizardArtifactModal(artifact, this.$scope.component).then(() => { + this.$scope.artifacts = _.values(this.$scope.component.artifacts); + }); + }; + + this.$scope.showNoArtifactMessage = ():boolean => { + let artifacts:any = []; + artifacts = _.filter(this.$scope.artifacts, (artifact:Models.ArtifactModel)=> { + return artifact.esId; + }); + + if (artifacts.length === 0) { + return true; + } + return false; + }; + + this.$scope.delete = (artifact:Models.ArtifactModel):void => { + + let onOk = ():void => { + this.$scope.isLoading = true; + let onSuccess = ():void => { + this.$scope.isLoading = false; + this.$scope.artifacts = _.values(this.$scope.component.artifacts); + }; + + let onFailed = (error:any):void => { + console.log('Delete artifact returned error:', error); + this.$scope.isLoading = false; + }; + + this.$scope.component.deleteArtifact(artifact.uniqueId, artifact.artifactLabel).then(onSuccess, onFailed); + }; + + let title:string = this.$filter('translate')("ARTIFACT_VIEW_DELETE_MODAL_TITLE"); + let message:string = this.$filter('translate')("ARTIFACT_VIEW_DELETE_MODAL_TEXT", "{'name': '" + artifact.artifactDisplayName + "'}"); + this.ModalsHandler.openConfirmationModal(title, message, false).then(onOk); + }; + + this.$scope.clickArtifactName = (artifact:any) => { + if (!artifact.esId) { + this.$scope.addOrUpdate(artifact); + } + + }; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/information-artifacts/information-artifacts-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/information-artifacts/information-artifacts-view.html new file mode 100644 index 0000000000..790117b2fd --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/information-artifacts/information-artifacts-view.html @@ -0,0 +1,57 @@ +
        +
        Add
        +
        +
        +
        +
        {{header.title}} + +
        +
        +
        +
        + +
        + There are no information artifacts to display +
        +
        + +
        + + {{artifact.artifactDisplayName}} +
        + +
        + {{artifact.artifactType}} +
        + +
        + + + +
        +
        +
        + + +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/information-artifacts/information-artifacts.less b/catalog-ui/app/scripts/view-models/workspace/tabs/information-artifacts/information-artifacts.less new file mode 100644 index 0000000000..d3fe14d945 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/information-artifacts/information-artifacts.less @@ -0,0 +1,47 @@ +.workspace-information-artifact { + width: 93%; + display: inline-block; + .w-sdc-classic-btn { + float: right; + margin-bottom: 10px; + } + + .table{ + height: 490px; + margin-bottom: 0; + } + + .table-container-flex { + margin-top: 27px; + + .item-opened{ + word-wrap: break-word; + } + + + .flex-item:nth-child(1) { + flex-grow: 15; + .hand; + span.table-arrow { + margin-right: 7px; + } + } + + .flex-item:nth-child(2) { + flex-grow: 6; + } + + .flex-item:nth-child(3) { + flex-grow: 3; + padding-top: 10px; + } + + .flex-item:nth-child(4) { + flex-grow: 1; + } + + } + +} + + diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/inputs.less b/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/inputs.less new file mode 100644 index 0000000000..76a82c69ee --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/inputs.less @@ -0,0 +1,286 @@ +.workspace-inputs { + + .sdc-workspace-container .w-sdc-main-right-container .w-sdc-main-container-body-content { + padding: 25px 8% 0px 8%; + } + + width: 100%; + display: flex; + + .text { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + padding-left: 15px; + } + + .title-text { + color: @main_color_m; + .f-type._13_m; + .bold; + } + + .title-blue-text { + color: @main_color_a; + .f-type._13_m; + + &.property-name-text { + padding-right: 13px; + border-right: 1px solid rgba(120, 136, 148, 0.26); + flex-grow: 1; + } + } + + .instance-name-text { + flex-grow: 1; + } + + ng-include { + width: 45%; + } + + .w-sdc-inputs-search { + padding: 10px 20px 20px 0; + white-space: nowrap; + position: relative; + width: 60%; + height: 64px; + + .inputs-search-icon { + top: 9px; + right: 11px; + } + + .magnification-white { + .sprite-new; + .search-white-icon; + .hand; + } + + .search-icon-container { + width: 35px; + height: 30px; + background-color: @main_color_a; + white-space: nowrap; + float: right; + position: relative; + bottom: 31px; + right: 1px; + border-radius: 0px 4px 4px 0px; + .hand + } + } + + .total-inputs-count { + width: 100%; + font-weight: bold; + text-align: left; + } + + .new-input-button { + margin: 9px 0 0 0; + } + + .w-sdc-inputs-search-input { + border: 1px solid @color_e; + .border-radius(4px); + height: 32px; + margin: 0; + padding: 0px 28px 3px 10px; + vertical-align: 4px; + width: 100%; + outline: none; + font-style: italic; + } + + .w-sdc-classic-btn { + float: right; + margin-bottom: 10px; + } + + .prop-to-input-button { + position: absolute; + top: 50%; + margin-right: -20px; + margin-bottom: -10px; + + } + + .property-row { + border-bottom: 1px solid @border_color_d; + padding-left: 10px; + .property-name-container { + display: flex; + flex-grow: 4; + } + + .type-schema-container { + flex-grow: 1; + border-left: 1px solid @border_color_d; + text-align: left; + line-height: 30px; + text-transform: capitalize; + width: 10px; + } + + } + + .table-container-flex { + + .flex-item { + line-height: 22px; + } + .expand-collapse-table-row { + + &.expanded { + .flex-container { + .expand-collapse-inputs-table-icon { + transform: rotate(180deg); + left: 0px; + } + } + } + + .data-row { + background: @tlv_color_u; + .hand; + align-items: center; + padding: 0 12px; + margin: 1px 0px 1px 0px; + min-height: 40px; + } + + .data-row:hover { + .bg_j; + } + + .input-row { + padding-left: 45px; + background: @tlv_color_t; + border: @main_color_o solid 1px; + align-items: center; + .hand; + margin: 1px 0px 1px 0px; + + &.service-input-row { + background: @tlv_color_u; + &.new-input { + background: @tlv_color_v; + } + } + &.selected { + background-color: @tlv_color_v; + } + .flex-item { + min-height: 60px; + padding: 0 15px; + } + .input-check-box { + padding-right: 10px; + margin-top: 9px; + } + &>.title-text{ + text-align: start; + padding: 4px 0 0 35px; + } + + .expand-collapse-inputs-table-icon{ + margin-top: 15px; + } + + } + + .input-row:hover { + .bg_j; + } + + + } + } + + .table { + height: 640px; + margin-bottom: 0; + clear: both; + + .empty-row { + padding: 3px; + } + + .flex-item { + line-height: 22px; + } + + .table-header { + + line-height: 14px; + background-color: @main_color_a; + color: @main_color_p; + text-align: left; + padding: 7px 5px 7px 10px; + .f-type._14_m; + } + .head { + background-color: #e6e6e6; + } + + .property-row:hover{ + background-color: @func_color_r; + } + + .body { + .scrollbar-container { + .perfect-scrollbar; + max-height: 610px; + } + + .expand-collapse-inputs-table-icon { + .hand; + .sprite-new; + .arrow-up; + transition: .3s all; + position: relative; + left: 8px; + border: none !important; + padding: 0px 10px 0px 10px; + } + + .table-col-text { + margin-left: 14px; + } + } + } + + .inputs-header { + width: 100%; + position: relative; + bottom: 31px; + } + + .inputs-tables-container { + width: 100%; + min-width: 100%; + display: flex; + } + + .inputs-button-container { + width: 8%; + min-width: 8%; + display: flex; + + .right-arrow-btn { + .sprite-new; + .blue-right-arrow-circle; + margin: auto; + cursor: pointer; + } + } + + .table-container-flex { + margin-top: 27px; + width: 46%; + min-width: 46%; + display: inline-block; + float: left; + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/resource-input/resource-inputs-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/resource-input/resource-inputs-view-model.ts new file mode 100644 index 0000000000..2dc1b1d9ff --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/resource-input/resource-inputs-view-model.ts @@ -0,0 +1,145 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + import Dictionary = Sdc.Utils.Dictionary; + import InputModel = Sdc.Models.InputModel; + + export interface IInputsViewModelScope extends IWorkspaceViewModelScope { + InstanceInputsProperties:Models.InstanceInputsPropertiesMapData; //this is tha map object that hold the selected inputs and the inputs we already used + vfInstancesList: Array; + component:Models.Components.Resource; + + onArrowPressed():void; + getInputPropertiesForInstance(instanceId:string, instance:Models.ComponentsInstances.ComponentInstance): ng.IPromise ; + loadInputPropertiesForInstance(instanceId:string, input:Models.InputModel): ng.IPromise ; + loadInputInputs(input:Models.InputModel): ng.IPromise; + } + + export class ResourceInputsViewModel { + + static '$inject' = [ + '$scope', + '$q' + ]; + + constructor(private $scope:IInputsViewModelScope, private $q: ng.IQService) { + this.initScope(); + } + + private initScope = (): void => { + + this.$scope.InstanceInputsProperties = new Models.InstanceInputsPropertiesMapData(); + this.$scope.vfInstancesList = this.$scope.component.componentInstances; + + // Need to cast all inputs to InputModel for the search to work + let tmpInputs:Array = new Array(); + _.each(this.$scope.component.inputs, (input):void => { + tmpInputs.push(new Models.InputModel(input)); + }); + this.$scope.component.inputs = tmpInputs; + // This function is not supported for resource + //this.$scope.component.getComponentInputs(); + + /* + * When clicking on instance input in the left or right table, this function will load all properties of the selected input + */ + this.$scope.getInputPropertiesForInstance = (instanceId:string, instance:Models.ComponentsInstances.ComponentInstance): ng.IPromise => { + let deferred = this.$q.defer(); + instance.properties = this.$scope.component.componentInstancesProperties[instanceId]; + deferred.resolve(true); + return deferred.promise; + }; + + /* + * When clicking on input in the right table, this function will load all inputs of the selected input + */ + this.$scope.loadInputInputs = (input:Models.InputModel): ng.IPromise => { + let deferred = this.$q.defer(); + + let onSuccess = () => { deferred.resolve(true); }; + let onError = () => { deferred.resolve(false); }; + + if(!input.inputs) { + this.$scope.component.getResourceInputInputs(input.uniqueId).then(onSuccess, onError); + } else { + deferred.resolve(true); + } + return deferred.promise; + }; + + /* + * When clicking on instance input in the left or right table, this function will load all properties of the selected input + */ + this.$scope.loadInputPropertiesForInstance = (instanceId:string, input:Models.InputModel): ng.IPromise => { + let deferred = this.$q.defer(); + + let onSuccess = (properties:Array) => { + input.properties = properties; + deferred.resolve(true); + }; + + let onError = () => { + deferred.resolve(false) + }; + + if(!input.properties) { + this.$scope.component.getComponentInstanceInputProperties(instanceId, input.uniqueId).then(onSuccess, onError); + } else { + deferred.resolve(true); + } + return deferred.promise; + }; + + /* + * When pressing the arrow, we create service inputs from the inputs selected + */ + this.$scope.onArrowPressed = ():void => { + let onSuccess = (inputsCreated: Array) => { + + //disabled all the inputs in the left table + _.forEach(this.$scope.InstanceInputsProperties, (properties:Array) => { + _.forEach(properties, (property:Models.PropertyModel) => { + property.isAlreadySelected = true; + }); + }); + + // Adding color to the new inputs (right table) + _.forEach(inputsCreated, (input) => { + input.isNew = true; + }); + + // Removing color to the new inputs (right table) + setTimeout(() => { + _.forEach(inputsCreated, (input) => { + input.isNew = false; + }); + this.$scope.$apply(); + }, 3000); + }; + + this.$scope.component.createInputsFormInstances(this.$scope.InstanceInputsProperties).then(onSuccess); + }; + + } + + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/resource-input/resource-inputs-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/resource-input/resource-inputs-view.html new file mode 100644 index 0000000000..7cdf5a2fa4 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/resource-input/resource-inputs-view.html @@ -0,0 +1,136 @@ +
        +
        + +
        +
        VFC instances inputs
        +
        +
        + + + +
        +
        +
        + {{instance.name}} +
        +
        + +
        + +
        + +
        No properties to display
        + +
        +
        +
        + {{property.name}} + {{property.name}} +
        +
        +
        + {{property.type}} +
        +
        +
        +
        + {{property.schema.property.type}} +
        +
        + +
        +
        + +
        + +
        +
        +
        +
        + +
        + +
        + +
        + +
        +
        +
        Resource instance inputs
        + + +
        +
        {{resourceInput.name}}
        +
        +
        +
        +
        + Description: + {{resourceInput.description}} +
        +
        +
        +
        + VF Instance: + {{resourceInput.name}} +
        +
        + Type: + {{resourceInput.type}} +
        +
        +
        +
        +
        + +
        +
        No properties to display
        +
        +
        +
        + {{property.name}} + {{property.name}} +
        +
        +
        + {{property.type}} +
        +
        +
        +
        + {{property.schema.property.type}} +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/resource-input/resource-inputs.less b/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/resource-input/resource-inputs.less new file mode 100644 index 0000000000..ebb32fbdb2 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/resource-input/resource-inputs.less @@ -0,0 +1,9 @@ +.workspace-inputs { + + .property-row { + .input-check-box { + text-align: center; + } + } + +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/service-input/service-inputs-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/service-input/service-inputs-view-model.ts new file mode 100644 index 0000000000..6c8391720a --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/service-input/service-inputs-view-model.ts @@ -0,0 +1,246 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + import IAngularEvent = angular.IAngularEvent; + import ComponentInstance = Sdc.Models.ComponentsInstances.ComponentInstance; + + + interface IServiceInputsViewModelScope extends IWorkspaceViewModelScope { + + vfInstancesList: Array; + selectedInputs:Array; + instanceInputsMap:Models.InstancesInputsMapData; //this is tha map object that hold the selected inputs and the inputs we already used + component:Models.Components.Service; + sdcMenu:Models.IAppMenu; + + onArrowPressed():void; + loadComponentInputs(): void; + loadInstanceInputs(instance:ComponentInstance): ng.IPromise ; + loadInputPropertiesForInstance(instanceId:string, input:Models.InputModel): ng.IPromise ; + loadInputInputs(input:Models.InputModel): ng.IPromise; + deleteInput(input:Models.InputModel):void + } + + export class ServiceInputsViewModel { + + static '$inject' = [ + '$scope', + '$q', + 'ModalsHandler' + ]; + + constructor(private $scope:IServiceInputsViewModelScope, + private $q: ng.IQService, + private ModalsHandler: Sdc.Utils.ModalsHandler) { + this.initScope(); + } + + /* + * When loading the screen again, we need to disabled the inputs that already created on the service, + * we do that by comparing the service input name, to the instance name + '_' + the resource instance input name. + */ + private disableEnableSelectedInputs = (instance: ComponentInstance): void => { + + let alreadySelectedInput = new Array(); + _.forEach(instance.inputs, (input:Models.InputModel) => { + let expectedServiceInputName = instance.normalizedName + '_' + input.name; + let inputAlreadyInService: Models.InputModel = _.find(this.$scope.component.inputs, (serviceInput: Models.InputModel) => { + return serviceInput.name === expectedServiceInputName; + }); + if(inputAlreadyInService) { + input.isAlreadySelected = true; + alreadySelectedInput.push(input); + } else { + input.isAlreadySelected = false; + } + }); + this.$scope.instanceInputsMap[instance.uniqueId] = alreadySelectedInput; + }; + + private initScope = (): void => { + + this.$scope.instanceInputsMap = new Models.InstancesInputsMapData(); + this.$scope.isLoading = true; + this.$scope.selectedInputs = new Array(); + + // Why do we need this? we call this later. + //this.$scope.component.getComponentInputs(); + + let onSuccess = (componentInstances:Array) => { + console.log("component instances loaded: ", componentInstances); + this.$scope.vfInstancesList = componentInstances; + this.$scope.isLoading = false; + }; + + //This function will get al component instance for the left table - in future the instances will be filter according to search text + this.$scope.component.getComponentInstancesFilteredByInputsAndProperties().then(onSuccess); + + // This function will get the service inputs for the right table + this.$scope.component.getComponentInputs(); + + + /* + * When clicking on instance in the left table, this function will load all instance inputs + */ + this.$scope.loadInstanceInputs = (instance:ComponentInstance): ng.IPromise => { + let deferred = this.$q.defer(); + + let onSuccess = (inputs:Array) => { + instance.inputs = inputs; + this.disableEnableSelectedInputs(instance); + deferred.resolve(true); + }; + + let onError = () => { + deferred.resolve(false); + }; + + if(!instance.inputs) { + this.$scope.component.getComponentInstanceInputs(instance.uniqueId, instance.componentUid).then(onSuccess, onError); + this.disableEnableSelectedInputs(instance); + } else { + deferred.resolve(true); + } + return deferred.promise; + }; + + /* + * When clicking on instance input in the left or right table, this function will load all properties of the selected input + */ + this.$scope.loadInputPropertiesForInstance = (instanceId:string, input:Models.InputModel): ng.IPromise => { + let deferred = this.$q.defer(); + + let onSuccess = (properties:Array) => { + input.properties = properties; + deferred.resolve(true); + }; + + let onError = () => { + deferred.resolve(false) + }; + + if(!input.properties) { + this.$scope.component.getComponentInstanceInputProperties(instanceId, input.uniqueId).then(onSuccess, onError); + } else { + deferred.resolve(true); + } + return deferred.promise; + }; + + /* + * When clicking on input in the right table, this function will load all inputs of the selected input + */ + this.$scope.loadInputInputs = (input:Models.InputModel): ng.IPromise => { + let deferred = this.$q.defer(); + + let onSuccess = () => { deferred.resolve(true); }; + let onError = () => { deferred.resolve(false); }; + + if(!input.inputs) { // Caching, if exists do not get it. + this.$scope.component.getServiceInputInputs(input.uniqueId).then(onSuccess, onError); + } else { + deferred.resolve(true); + } + return deferred.promise; + }; + + /* + * When pressing the arrow, we create service inputs from the inputs selected + */ + this.$scope.onArrowPressed = ():void => { + let onSuccess = (inputsCreated: Array) => { + + //disabled all the inputs in the left table + _.forEach(this.$scope.instanceInputsMap, (inputs:Array, instanceId:string) => { + _.forEach(inputs, (input:Models.InputModel) => { + input.isAlreadySelected = true; + }); + }); + + this.addColorToItems(inputsCreated); + }; + + this.$scope.component.createInputsFormInstances(this.$scope.instanceInputsMap).then(onSuccess); + }; + + this.$scope.deleteInput = (input: Models.InputModel):void => { + + var onDelete = ():void => { + var onSuccess = (deletedInput: Models.InputModel, componentInstanceId:string):void => { + // Remove from component.inputs the deleted input (service inputs) + var remainingServiceInputs:Array = _.filter(this.$scope.component.inputs, (input:Models.InputModel):boolean => { + return input.uniqueId !== deletedInput.uniqueId; + }); + this.$scope.component.inputs = remainingServiceInputs; + + // Find the instance that contains the deleted input, and set disable|enable the deleted input + var deletedInputComponentInstance:ComponentInstance = _.find(this.$scope.vfInstancesList, (instanceWithChildToDelete:ComponentInstance):boolean => { + return instanceWithChildToDelete.uniqueId === componentInstanceId; + }); + this.disableEnableSelectedInputs(deletedInputComponentInstance); + }; + + var onFailed = (error:any) : void => { + console.log("Error deleting input"); + }; + + this.addColorToItems([input]); + + // Get service inputs of input (so after delete we will know the component instance) + this.$scope.loadInputInputs(input).then((result:boolean):void=>{ + if (result && input.inputs.length>0) { + var componentInstanceId:string = input.inputs[0].componentInstanceId; + this.$scope.component.deleteServiceInput(input.uniqueId).then((deletedInput: Models.InputModel):void => { + onSuccess(deletedInput, componentInstanceId); + }, onFailed); + } + }); + }; + + // Get confirmation modal text from menu.json + var state = "deleteInput"; + var title:string = this.$scope.sdcMenu.alertMessages[state].title; + var message:string = this.$scope.sdcMenu.alertMessages[state].message.format([input.name]); + + // Open confirmation modal + this.ModalsHandler.openAlertModal(title, message).then(onDelete); + } + }; + + private addColorToItems = (inputsCreated:Array):void => { + + // Adding color to the new inputs (right table) + _.forEach(inputsCreated, (input) => { + input.isNew = true; + }); + + // Removing color to the new inputs (right table) + setTimeout(() => { + _.forEach(inputsCreated, (input) => { + input.isNew = false; + }); + this.$scope.$apply(); + }, 3000); + }; + + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/service-input/service-inputs-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/service-input/service-inputs-view.html new file mode 100644 index 0000000000..bf15a70322 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/service-input/service-inputs-view.html @@ -0,0 +1,205 @@ +
        +
        + +
        +
        Resource instance inputs
        +
        +
        + + + +
        +
        +
        + {{instance.name}} +
        +
        + +
        + +
        + + +
        +
        {{input.name}}
        +
        +
        +
        + +
        + Description: + {{input.description}} +
        +
        +
        +
        + VF Instance: + {{instance.name}} +
        +
        + Type: + {{input.type}} +
        +
        + +
        +
        + + +
        + +
        +
        No properties to display
        + +
        +
        +
        + {{property.name}} + {{property.name}} +
        +
        +
        + {{property.type}} +
        +
        +
        +
        + {{property.schema.property.type}} +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
        + +
        + +
        +
        +
        Service Inputs
        + + +
        +
        {{serviceInput.name}}
        +
        +
        +
        +
        + Description: + {{serviceInput.description}} +
        +
        +
        +
        + VF Instance: + {{serviceInput.name}} +
        +
        + Type: + {{serviceInput.type}} +
        +
        +
        + +
        +
        +
        +
        + +
        + +
        +
        {{input.name}}
        +
        +
        +
        +
        + Description: + {{input.description}} +
        +
        +
        +
        + VF Instance: + {{instance.componentInstanceName}} +
        +
        + Type: + {{input.type}} +
        +
        +
        +
        +
        + +
        +
        No properties to display
        +
        +
        +
        + {{property.name}} + {{property.name}} +
        +
        +
        + {{property.type}} +
        +
        +
        +
        + {{property.schema.property.type}} +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/service-input/service-inputs.less b/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/service-input/service-inputs.less new file mode 100644 index 0000000000..11e613b56e --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/inputs/service-input/service-inputs.less @@ -0,0 +1,54 @@ +.workspace-inputs { + + .service-inputs-view { + + .table-container-flex { + width:100% !important; + } + + .table-loader { + position: relative; + top:215px; + } + + } + + .infinite-scroll { + + overflow-y: scroll; + overflow-x: hidden; + max-height: 400px; + } + + .class_with_css_props_leading_to_a_scroll { + height: 100%; + overflow-y: auto; + } + + .table-container-flex { + .expand-collapse-table-row { + .service-input-row { + padding-left: 15px; + border: none; + border-bottom: rgba(120, 136, 148, 0.26) solid 1px; + + .delete { + width: 50px; + padding: 0; + position: relative; + } + + .remove-input-icon { + position: absolute; + top: 12px; + right: 18px; + } + + .remove-input-icon:hover { + .delete-icon-hover; + } + } + } + } + +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/management-workflow/management-workflow-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/management-workflow/management-workflow-view-model.ts new file mode 100644 index 0000000000..2fab118378 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/management-workflow/management-workflow-view-model.ts @@ -0,0 +1,128 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + export interface IManagementWorkflowViewModelScope extends IWorkspaceViewModelScope { + vendorModel:VendorModel; + } + + export class VendorModel { + artifacts: Models.ArtifactGroupModel; + serviceID: string; + readonly: boolean; + sessionID: string; + requestID: string; + diagramType: string; + participants:Array; + + constructor(artifacts: Models.ArtifactGroupModel, serviceID:string, readonly:boolean, sessionID:string, + requestID:string, diagramType:string, participants:Array){ + this.artifacts = artifacts; + this.serviceID = serviceID; + this.readonly = readonly; + this.sessionID = sessionID; + this.requestID = requestID; + this.diagramType = diagramType; + this.participants = participants; + } + } + + export class ManagementWorkflowViewModel { + + static '$inject' = [ + '$scope', + 'uuid4' + ]; + + constructor(private $scope:IManagementWorkflowViewModelScope, + private uuid4:any) { + + this.initScope(); + this.$scope.updateSelectedMenuItem(); + } + + + private static getParticipants():Array { + return [ + { + "id": "1", + "name": "Customer"}, + { + "id": "2", + "name": "CCD" + }, + { + "id": "3", + "name": "Infrastructure" + }, + { + "id": "4", + "name": "MSO" + }, + { + "id": "5", + "name": "SDN-C" + }, + { + "id": "6", + "name": "A&AI" + }, + { + "id": "7", + "name": "APP-C" + }, + { + "id": "8", + "name": "Cloud" + }, + { + "id": "9", + "name": "DCAE" + }, + { + "id": "10", + "name": "ALTS" + }, + { + "id": "11", + "name": "VF" + } + ] + } + + + private initScope():void { + this.$scope.vendorModel = new VendorModel( + this.$scope.component.artifacts.filteredByType(Utils.Constants.ArtifactType.THIRD_PARTY_RESERVED_TYPES.WORKFLOW), + this.$scope.component.uniqueId, + this.$scope.isViewMode(), + this.$scope.user.userId, + this.uuid4.generate(), + Utils.Constants.ArtifactType.THIRD_PARTY_RESERVED_TYPES.WORKFLOW, + ManagementWorkflowViewModel.getParticipants() + ); + + this.$scope.thirdParty = true; + this.$scope.setValidState(true); + } + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/management-workflow/management-workflow-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/management-workflow/management-workflow-view.html new file mode 100644 index 0000000000..bd196daec8 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/management-workflow/management-workflow-view.html @@ -0,0 +1,3 @@ +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/network-call-flow/network-call-flow-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/network-call-flow/network-call-flow-view-model.ts new file mode 100644 index 0000000000..064f1c5896 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/network-call-flow/network-call-flow-view-model.ts @@ -0,0 +1,80 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + export interface INetworkCallFlowViewModelScope extends IWorkspaceViewModelScope { + vendorMessageModel:VendorModel; + } + + export class participant { + name:string; + id:string; + + constructor(instance:Models.ComponentsInstances.ComponentInstance){ + this.name = instance.name; + this.id = instance.uniqueId; + } + } + + + export class NetworkCallFlowViewModel { + + static '$inject' = [ + '$scope', + 'uuid4' + ]; + + constructor(private $scope:INetworkCallFlowViewModelScope, + private uuid4:any) { + + this.initScope(); + this.$scope.updateSelectedMenuItem(); + } + + private getVFParticipantsFromInstances(instances:Array):Array { + let participants = []; + _.forEach(instances,(instance)=> { + if(Utils.Constants.ResourceType.VF == instance.originType){ + participants.push(new participant(instance)); + } + }); + return participants; + } + + + private initScope():void { + this.$scope.vendorMessageModel = new VendorModel( + this.$scope.component.artifacts.filteredByType(Utils.Constants.ArtifactType.THIRD_PARTY_RESERVED_TYPES.NETWORK_CALL_FLOW), + this.$scope.component.uniqueId, + this.$scope.isViewMode(), + this.$scope.user.userId, + this.uuid4.generate(), + Utils.Constants.ArtifactType.THIRD_PARTY_RESERVED_TYPES.NETWORK_CALL_FLOW, + this.getVFParticipantsFromInstances(this.$scope.component.componentInstances) + ); + + this.$scope.thirdParty = true; + this.$scope.setValidState(true); + } + + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/network-call-flow/network-call-flow-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/network-call-flow/network-call-flow-view.html new file mode 100644 index 0000000000..6ce3e8e2b7 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/network-call-flow/network-call-flow-view.html @@ -0,0 +1,3 @@ +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/product-hierarchy/product-hierarchy-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/product-hierarchy/product-hierarchy-view-model.ts new file mode 100644 index 0000000000..faf77a5215 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/product-hierarchy/product-hierarchy-view-model.ts @@ -0,0 +1,134 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 4/7/2016. + */ +/// +module Sdc.ViewModels { + 'use strict'; + + export interface IProductHierarchyScope extends IWorkspaceViewModelScope { + + categoriesOptions: Array; + product:Models.Components.Product; + isLoading:boolean; + showDropDown:boolean; + + onInputTextClicked():void; + onGroupSelected(category: Models.IMainCategory, subcategory: Models.ISubCategory, group: Models.IGroup):void; + clickOutside():void; + deleteGroup(uniqueId:string):void; + } + + export class ProductHierarchyViewModel { + + static '$inject' = [ + '$scope', + 'Sdc.Services.CacheService', + 'ComponentFactory', + '$state' + ]; + + constructor(private $scope:IProductHierarchyScope, + private cacheService:Sdc.Services.CacheService, + private ComponentFactory: Sdc.Utils.ComponentFactory, + private $state:ng.ui.IStateService) { + + + this.$scope.product = this.$scope.getComponent(); + this.$scope.setValidState(true); + this.initScope(); + this.$scope.updateSelectedMenuItem(); + } + + private initCategories = () => { + this.$scope.categoriesOptions = angular.copy(this.cacheService.get('productCategories')); + let selectedGroup:Array = []; + _.forEach(this.$scope.product.categories, (category: Models.IMainCategory) => { + _.forEach(category.subcategories, (subcategory:Models.ISubCategory) => { + selectedGroup = selectedGroup.concat(subcategory.groupings); + }); + }); + _.forEach(this.$scope.categoriesOptions, (category: Models.IMainCategory) => { + _.forEach(category.subcategories, (subcategory:Models.ISubCategory) => { + _.forEach(subcategory.groupings, (group:Models.ISubCategory) => { + let componentGroup:Models.IGroup = _.find(selectedGroup, (componentGroupObj) => { + return componentGroupObj.uniqueId == group.uniqueId; + }); + if(componentGroup){ + group.isDisabled = true; + } + }); + }); + }); + }; + + private setFormValidation = ():void => { + //if(!this.$scope.product.categories || this.$scope.product.categories.length === 0){ + // this.$scope.setValidState(false); + //} + //else{ + this.$scope.setValidState(true); + // } + + }; + + private initScope = ():void => { + this.$scope.isLoading= false; + this.$scope.showDropDown =false; + this.initCategories(); + this.setFormValidation(); + + this.$scope.onGroupSelected = (category: Models.IMainCategory, subcategory: Models.ISubCategory, group: Models.IGroup):void => { + this.$scope.product.addGroup(category, subcategory, group); + this.$state.current.data.unsavedChanges = !this.$scope.isViewMode(); + group.isDisabled = true; + this.$scope.showDropDown = false; + this.setFormValidation(); + }; + + this.$scope.onInputTextClicked = ():void => {//just edit the component in place, no pop up nor server update ? + this.$scope.showDropDown = !this.$scope.showDropDown; + }; + + this.$scope.clickOutside = (): any => { + this.$scope.showDropDown = false; + }; + + this.$scope.deleteGroup = (uniqueId:string) : void => { + //delete group from component + this.$scope.product.deleteGroup(uniqueId); + this.$state.current.data.unsavedChanges = !this.$scope.isViewMode(); + this.setFormValidation(); + //enabled group + _.forEach(this.$scope.categoriesOptions, (category: Models.IMainCategory) => { + _.forEach(category.subcategories, (subcategory:Models.ISubCategory) => { + let groupObj:Models.IGroup = _.find (subcategory.groupings, (group) => { + return group.uniqueId === uniqueId; + }); + if(groupObj){ + groupObj.isDisabled = false; + } + }); + }); + } + }; + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/product-hierarchy/product-hierarchy-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/product-hierarchy/product-hierarchy-view.html new file mode 100644 index 0000000000..2335ad7c74 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/product-hierarchy/product-hierarchy-view.html @@ -0,0 +1,40 @@ +
        + +
        + +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/product-hierarchy/product-hierarchy.less b/catalog-ui/app/scripts/view-models/workspace/tabs/product-hierarchy/product-hierarchy.less new file mode 100644 index 0000000000..c992558ed2 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/product-hierarchy/product-hierarchy.less @@ -0,0 +1,130 @@ +.workspace-hierarchy { + display: inline-block; + width: 93%; + + .scrollbar-container{ + max-height:400px; + .perfect-scrollbar; + } + + .dropdown-container { + position: relative; + display: inline-block; + width: 100%; + + &:after{ + top: 47%; + right: 1%; + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; + pointer-events: none; + border-color: rgba(0, 0, 0, 0); + border-top-color: black; + border-width: 4px; + margin-left: -4px; + } + + .dropdown-input-text { + width: 100%; + padding: 4px 10px; + } + + .dropdown-content { + .perfect-scrollbar; + border: 1px solid #d8d8d8; + display: none; + position: absolute; + overflow: hidden; + width: 100%; + .bg_c; + max-height: 400px; + z-index: 999999; + + .dropdown-option { + border-bottom: 1px solid #d8d8d8; + display: inline-block; + width: 100%; + } + + .category-container{ + width: 250px; + float: left; + padding-left: 5px; + + .category { + .bold; + padding: 3px 3px 2px 3px; + &:after{ + .sprite; + .arrow-left; + content: ''; + margin-left: 5px; + transform: rotate(180deg); + } + } + .subcategory { + padding-left: 3px; + } + } + + .groupings-container{ + display: inline-block; + width: 424px; + border-left: 1px solid #d8d8d8; + min-height: 55px; + .group{ + padding: 3px 3px 3px 10px; + &:hover{ + .hand; + .bg_n; + } + &.disabled-group { + opacity: 0.5; + &:hover{ + cursor: auto; + .bg_c; + } + } + } + } + + .seperator { + height: 1px; + width: 100%; + .bg_j; + margin: 5px 0px; + } + } + .show { + display: block; + } + } + + .hierarchy-groups-container{ + .b_9; + width: 100%; + border: 1px solid #d8d8d8; + height: 425px; + padding: 15px; + text-align: center; + + .scrollbar-container { + z-index: 0; + } + + .no-group-text{ + text-align: center; + margin-top:25px; + a { + cursor: pointer; + } + } + .group-tag{ + display: inline-block; + float: left; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/properties/properties-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/properties/properties-view-model.ts new file mode 100644 index 0000000000..9b824bfca9 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/properties/properties-view-model.ts @@ -0,0 +1,114 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + + interface IPropertiesViewModelScope extends IWorkspaceViewModelScope { + tableHeadersList: Array; + reverse: boolean; + sortBy:string; + filteredProperties:any; + + addOrUpdateProperty(property?:Models.PropertyModel): void; + delete(property:Models.PropertyModel): void; + sort(sortBy:string): void; + } + + export class PropertiesViewModel { + + static '$inject' = [ + '$scope', + '$filter', + '$modal', + '$templateCache', + 'ModalsHandler' + ]; + + + constructor(private $scope:IPropertiesViewModelScope, + private $filter:ng.IFilterService, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService, + private ModalsHandler:Utils.ModalsHandler) { + this.initScope(); + this.$scope.updateSelectedMenuItem(); + } + + + private openEditPropertyModal = (property:Models.PropertyModel):void => { + let viewModelsHtmlBasePath:string = '/app/scripts/view-models/'; + + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get(viewModelsHtmlBasePath + 'forms/property-form/property-form-view.html'), + controller: 'Sdc.ViewModels.PropertyFormViewModel', + size: 'sdc-l', + backdrop: 'static', + keyboard: false, + resolve: { + property: ():Models.PropertyModel => { + return property; + }, + component: ():Models.Components.Component => { + return this.$scope.component; + }, + filteredProperties: ():Array => { + return this.$scope.filteredProperties.properties; + } + } + }; + this.$modal.open(modalOptions); + }; + + private initScope = ():void => { + + //let self = this; + this.$scope.filteredProperties={properties:[]}; + this.$scope.sortBy = 'name'; + this.$scope.reverse = false; + this.$scope.setValidState(true); + this.$scope.tableHeadersList = [ + {title: 'Name', property: 'name'}, + {title: 'Type', property: 'type'}, + {title: 'Schema', property: 'schema.property.type'}, + {title: 'Description', property: 'description'}, + ]; + this.$scope.sort = (sortBy:string):void => { + this.$scope.reverse = (this.$scope.sortBy === sortBy) ? !this.$scope.reverse : false; + this.$scope.sortBy = sortBy; + }; + + + this.$scope.addOrUpdateProperty = (property?:Models.PropertyModel):void => { + this.openEditPropertyModal(property ? property : new Models.PropertyModel()); + }; + + this.$scope.delete = (property:Models.PropertyModel):void => { + + let onOk = ():void => { + this.$scope.component.deleteProperty(property.uniqueId); + }; + let title:string = this.$filter('translate')("PROPERTY_VIEW_DELETE_MODAL_TITLE"); + let message:string = this.$filter('translate')("PROPERTY_VIEW_DELETE_MODAL_TEXT", "{'name': '" + property.name + "'}"); + this.ModalsHandler.openConfirmationModal(title, message, false).then(onOk); + }; + } + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/properties/properties-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/properties/properties-view.html new file mode 100644 index 0000000000..e9a4c3879d --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/properties/properties-view.html @@ -0,0 +1,62 @@ +
        +
        + Total Properties: {{component.properties.length}} + + +
        +
        Add Property
        +
        +
        +
        +
        {{header.title}} + +
        +
        + +
        + +
        + +
        + There are no properties to display
        + click here to add one + +
        +
        + + + +
        +
        +
        +
        +
        + +
        +
        + +
        +
        +
        +
        + +
        +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/properties/properties.less b/catalog-ui/app/scripts/view-models/workspace/tabs/properties/properties.less new file mode 100644 index 0000000000..3e8d6c3fbd --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/properties/properties.less @@ -0,0 +1,115 @@ +.workspace-properties { + + width: 93%; + display: inline-block; + + #left-top-bar{ + float: left; + width: 155px; + ::-webkit-input-placeholder { + font-style: italic; + } + :-moz-placeholder { + font-style: italic; + } + ::-moz-placeholder { + font-style: italic; + } + :-ms-input-placeholder { + font-style: italic; + } + + #properties-count{ + font-weight: bold; + float: left; + } + + #search-by-name{ + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + width: 245px; + height: 32px; + line-height: 32px; + border: 1px solid @main_color_o; + text-indent: 10px; + } + + .search-button{ + .hand; + cursor: pointer; + float: right; + position: relative; + top: -22px; + right: -80px; + } + } + + .add-btn { + margin: 36px 0 0 0; + } + + .delete-col-header{ + .sprite; + .sprite.e-sdc-small-icon-delete; + } + + .w-sdc-classic-btn { + float: right; + margin-bottom: 10px; + } + + .table{ + height:490px; + margin-bottom: 0; + } + + .data-row{ + .table-delete-btn{ + display: none !important; + } + &:hover{ + .table-delete-btn{ + display: inline-block !important; + } + } + } + + .table-container-flex { + margin-top: 27px; + + .text{ + overflow: hidden; + text-overflow: ellipsis; + display: inline-block; + white-space: nowrap; + } + + .flex-item:nth-child(1) { + flex-grow: 15; + a{ + .hand + } + } + + .flex-item:nth-child(2) { + flex-grow: 6; + } + + .flex-item:nth-child(3) { + flex-grow: 6; + } + + .flex-item:nth-child(4) { + flex-grow: 20; + + } + .flex-item:nth-child(5) { + flex-grow: 3; + padding-top: 10px; + } + + + } + +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-view-model.ts new file mode 100644 index 0000000000..97a117e8b7 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-view-model.ts @@ -0,0 +1,165 @@ +/*- + * ============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========================================================= + */ +/** + * Created by rcohen on 9/22/2016. + */ +/// +module Sdc.ViewModels { + 'use strict'; + import tree = d3.layout.tree; + + export class SortTableDefined { + reverse:boolean; + sortByField:string; + } + + interface IReqAndCapabilitiesViewModelScope extends IWorkspaceViewModelScope { + requirementsTableHeadersList: Array; + capabilitiesTableHeadersList: Array; + capabilityPropertiesTableHeadersList: Array; + requirementsSortTableDefined: SortTableDefined; + capabilitiesSortTableDefined: SortTableDefined; + propertiesSortTableDefined: SortTableDefined; + requirements:Array; + capabilities:Array; + mode:string; + filteredProperties:Array>; + searchText:string; + + sort(sortBy:string, sortByTableDefined:SortTableDefined):void; + updateProperty(property:Models.PropertyModel, indexInFilteredProperties:number):void; + allCapabilitiesSelected(selected:boolean):void; + } + + export class ReqAndCapabilitiesViewModel { + + static '$inject' = [ + '$scope', + '$filter', + '$modal', + '$templateCache', + 'ModalsHandler' + ]; + + + constructor(private $scope:IReqAndCapabilitiesViewModelScope, + private $filter:ng.IFilterService, + private $modal:ng.ui.bootstrap.IModalService, + private $templateCache:ng.ITemplateCacheService) { + this.initScope(); + this.$scope.updateSelectedMenuItem(); + } + + + private openEditPropertyModal = (property:Models.PropertyModel, indexInFilteredProperties:number):void => { + let viewModelsHtmlBasePath:string = '/app/scripts/view-models/'; + //...because there is not be api + _.forEach(this.$scope.filteredProperties[indexInFilteredProperties],(prop:Models.PropertyModel)=>{ + prop.readonly = true; + }); + let modalOptions:ng.ui.bootstrap.IModalSettings = { + template: this.$templateCache.get(viewModelsHtmlBasePath + 'forms/property-form/property-form-view.html'), + controller: 'Sdc.ViewModels.PropertyFormViewModel', + size: 'sdc-l', + backdrop: 'static', + keyboard: false, + resolve: { + property: ():Models.PropertyModel => { + return property; + }, + component: ():Models.Components.Component => { + return this.$scope.component; + }, + filteredProperties: ():Array => { + return this.$scope.filteredProperties[indexInFilteredProperties]; + } + } + }; + this.$modal.open(modalOptions); + }; + + private initScope = ():void => { + + this.$scope.requirementsSortTableDefined = { + reverse: false, + sortByField: 'name' + }; + this.$scope.capabilitiesSortTableDefined = { + reverse: false, + sortByField: 'name' + }; + this.$scope.propertiesSortTableDefined = { + reverse: false, + sortByField: 'name' + }; + + this.$scope.setValidState(true); + this.$scope.requirementsTableHeadersList = [ + {title: 'Name', property: 'name'}, + {title: 'Capability', property: 'capability'}, + {title: 'Node', property: 'node'}, + {title: 'Relationship', property: 'relationship'}, + {title: 'Connected To', property: ''}, + {title: 'Occurrences', property: ''} + ]; + this.$scope.capabilitiesTableHeadersList = [ + {title: 'Name', property: 'name'}, + {title: 'Type', property: 'type'}, + {title: 'Description', property: ''}, + {title: 'Valid Source', property: ''}, + {title: 'Occurrences', property: ''} + ]; + this.$scope.capabilityPropertiesTableHeadersList = [ + {title: 'Name', property: 'name'}, + {title: 'Type', property: 'type'}, + {title: 'Schema', property: 'schema.property.type'}, + {title: 'Description', property: 'description'}, + ]; + this.$scope.filteredProperties=[]; + + this.$scope.mode='requirements'; + this.$scope.requirements=[]; + _.forEach(this.$scope.component.requirements,(req:Array,capName)=>{ + this.$scope.requirements=this.$scope.requirements.concat(req); + }); + + this.$scope.capabilities=[]; + _.forEach(this.$scope.component.capabilities,(cap:Array,capName)=>{ + this.$scope.capabilities=this.$scope.capabilities.concat(cap); + }); + + this.$scope.sort = (sortBy:string, sortByTableDefined:SortTableDefined):void => { + sortByTableDefined.reverse = (sortByTableDefined.sortByField === sortBy) ? !sortByTableDefined.reverse : false; + sortByTableDefined.sortByField = sortBy; + }; + + this.$scope.updateProperty = (property:Models.PropertyModel, indexInFilteredProperties:number):void => { + this.openEditPropertyModal(property, indexInFilteredProperties); + }; + + this.$scope.allCapabilitiesSelected = (selected:boolean):void => { + _.forEach(this.$scope.capabilities,(cap:Models.Capability)=>{ + cap.selected = selected; + }); + }; + } + } +} + diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-view.html new file mode 100644 index 0000000000..047768689a --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-view.html @@ -0,0 +1,144 @@ +
        +
        + + +
        +
        + + +
        + +
        +
        +
        +
        {{header.title}} + +
        +
        + +
        + +
        + There are no requirements to display + +
        +
        + +
        + {{req.name}} +
        +
        + {{req.capability.substring("tosca.capabilities.".length)}} +
        +
        + {{req.node.substring("tosca.nodes.".length)}} +
        +
        + {{req.relationship.substring("tosca.relationships.".length)}} +
        +
        +
        + {{req.minOccurrences}},{{req.maxOccurrences}} +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        {{header.title}} + +
        +
        + +
        + +
        + There are no capabilities to display + +
        +
        + +
        + + {{capability.name}} +
        +
        + {{capability.type.substring("tosca.capabilities.".length)}} +
        + +
        + {{capability.description}} +
        + +
        + {{capability.validSourceTypes.join(',')}} +
        + +
        + {{capability.minOccurrences}},{{capability.maxOccurrences}} +
        +
        +
        +

        Properties

        +
        +
        +
        +
        {{header.title}} + +
        +
        + +
        +
        + There are no properties to display +
        +
        + + + +
        +
        +
        +
        +
        + +
        +
        +
        + +
        +
        +
        +
        +
        + +
        +
        +
        + diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities.less b/catalog-ui/app/scripts/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities.less new file mode 100644 index 0000000000..9b52fad411 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities.less @@ -0,0 +1,196 @@ +.workspace-req-and-cap { + + width: 93%; + display: inline-block; + + .tabs{ + float: left; + position: relative; + top: 6px; + button{ + float: left; + width: 233px; + height: 38px; + background-color: @tlv_color_t; + border: 1px solid @main_color_o; + color: black; + &:nth-child(1){ + border-radius: 10px 0 0 0; + } + &:nth-child(2){ + border-radius: 0 10px 0 0; + } + &.selected{ + background-color: @main_color_a; + border: 1px solid @main_color_a; + color: white; + } + } + } + .search{ + margin-bottom: 12px; + float: right; + ::-webkit-input-placeholder { + font-style: italic; + } + :-moz-placeholder { + font-style: italic; + } + ::-moz-placeholder { + font-style: italic; + } + :-ms-input-placeholder { + font-style: italic; + } + #search-box{ + -webkit-border-radius: 2px 0 0 2px; + -moz-border-radius: 2px 0 0 2px; + border-radius: 2px 0 0 2px; + width: 213px; + height: 32px; + line-height: 32px; + border: 1px solid @main_color_o; + text-indent: 10px; + float: left; + } + .search-icon-container{ + background-color: @main_color_a; + height: 32px; + width: 32px; + border-radius: 0 2px 2px 0; + float: left; + .search-icon{ + position: relative; + top: 9px; + } + } + } + .expand-collapse-buttons{ + float: right; + width: 44px; + margin-left: 11px; + margin-top: 10px; + span{ + vertical-align: bottom; + .hand; + } + } + + + + .table{ + height:490px; + margin-bottom: 0; + } + + .arrow-up-small{ + &.opened{ + .arrow-up-small-hover; + } + } + + .item-opened{ + background-color: @tlv_color_t; + } + + .properties-title{ + margin:0; + font-weight: bold; + } + + .table-container-flex { + margin-top: 10px; + + .text{ + overflow: hidden; + text-overflow: ellipsis; + display: inline-block; + white-space: nowrap; + } + + &.requirements-table{ + border-top: 4px solid @main_color_a; + .flex-item:nth-child(1) { + flex-grow: 20; + } + + .flex-item:nth-child(2) { + flex-grow: 20; + } + + .flex-item:nth-child(3) { + flex-grow: 20; + } + + .flex-item:nth-child(4) { + flex-grow: 20; + } + + .flex-item:nth-child(5) { + flex-grow: 20; + } + + .flex-item:nth-child(6) { + flex-grow: 20; + } + } + + &.capabilities-table{ + border-top: 4px solid @main_color_a; + .selected{ + .flex-item:nth-child(1) { + border-left: 4px solid @main_color_a; + padding-right: 11px; + } + } + .flex-item:nth-child(1) { + flex-grow: 10; + } + + .flex-item:nth-child(2) { + flex-grow: 10; + } + + .flex-item:nth-child(3) { + flex-grow: 10; + } + + .flex-item:nth-child(4) { + flex-grow: 10; + } + + .flex-item:nth-child(5) { + flex-grow: 10; + } + + } + + &.properties-table{ + .table{ + height: auto; + } + + .flex-item:nth-child(1) { + flex-grow: 15; + a{ + .hand + } + } + + .flex-item:nth-child(2) { + flex-grow: 6; + } + + .flex-item:nth-child(3) { + flex-grow: 6; + } + + .flex-item:nth-child(4) { + flex-grow: 20; + + } + } + + } + +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts-view-model.ts new file mode 100644 index 0000000000..1e6bc04924 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts-view-model.ts @@ -0,0 +1,87 @@ +/*- + * ============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========================================================= + */ +/// +module Sdc.ViewModels { + 'use strict'; + import ArtifactModel = Sdc.Models.ArtifactModel; + + export interface IToscaArtifactsScope extends IWorkspaceViewModelScope { + artifacts: Array; + tableHeadersList: Array; + artifactType: string; + downloadFile:Models.IFileDownload; + isLoading:boolean; + sortBy:string; + reverse:boolean; + + getTitle(): string; + download(artifact:Models.ArtifactModel): void; + sort(sortBy:string): void; + showNoArtifactMessage():boolean; + } + + export class ToscaArtifactsViewModel { + + static '$inject' = [ + '$scope', + '$filter' + ]; + + constructor(private $scope:IToscaArtifactsScope, + private $filter:ng.IFilterService) { + this.initScope(); + this.$scope.updateSelectedMenuItem(); + } + + private initScope = ():void => { + let self = this; + this.$scope.isLoading = false; + this.$scope.sortBy = 'artifactDisplayName'; + this.$scope.reverse = false; + this.$scope.setValidState(true); + this.$scope.artifactType = 'normal'; + this.$scope.getTitle = ():string => { + return this.$filter("resourceName")(this.$scope.component.name) + ' Artifacts'; + + }; + + this.$scope.tableHeadersList = [ + {title: 'Name', property: 'artifactDisplayName'}, + {title: 'Type', property: 'artifactType'} + ]; + + this.$scope.artifacts = _.values(this.$scope.component.toscaArtifacts); + this.$scope.sort = (sortBy:string):void => { + this.$scope.reverse = (this.$scope.sortBy === sortBy) ? !this.$scope.reverse : false; + this.$scope.sortBy = sortBy; + }; + + + + this.$scope.showNoArtifactMessage = ():boolean => { + if (this.$scope.artifacts.length === 0) { + return true; + } + return false; + }; + + } + } +} diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts-view.html b/catalog-ui/app/scripts/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts-view.html new file mode 100644 index 0000000000..947b37db93 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts-view.html @@ -0,0 +1,45 @@ +
        +
        +
        +
        +
        {{header.title}} + +
        +
        +
        +
        + +
        + There are no TOSCA artifacts to display +
        +
        + +
        + + {{artifact.artifactDisplayName}} +
        + +
        + {{artifact.artifactType}} +
        + +
        + +
        +
        +
        +
        Label: {{artifact.artifactLabel}}
        +
        UUID: {{artifact.uniqueId}}
        +
        Description: {{artifact.description}}
        + + +
        + +
        +
        +
        +
        +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts.less b/catalog-ui/app/scripts/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts.less new file mode 100644 index 0000000000..f792bb8c53 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts.less @@ -0,0 +1,74 @@ +.workspace-tosca-artifact { + width: 93%; + display: inline-block; + .w-sdc-classic-btn { + float: right; + margin-bottom: 10px; + } + + .details-title{ + font-weight: bold; + margin-right: 5px; + } + + .table{ + height: 490px; + margin-bottom: 0; + } + + + .table-container-flex { + margin-top: 27px; + + .item-opened{ + word-wrap: break-word; + } + + + .flex-item:nth-child(1) { + flex-grow: 15; + .hand; + span.table-arrow { + margin-right: 7px; + } + } + + .flex-item:nth-child(2) { + flex-grow: 6; + } + + .flex-item:nth-child(3) { + flex-grow: 1; + } + + + + + .table-download-btn{ + &.tosca{ + margin-left: 0; + margin-top: 8px; + } + } + + .download-icon-container{ + position: relative; + + .loader{ + left: 60%; + top: 45px; + border: none; + background-color: transparent; + height: 0px; + width: 63px; + outline: none; + + } + } + + + } + +} + + diff --git a/catalog-ui/app/scripts/view-models/workspace/workspace-view-model.ts b/catalog-ui/app/scripts/view-models/workspace/workspace-view-model.ts new file mode 100644 index 0000000000..a8523f24f5 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/workspace-view-model.ts @@ -0,0 +1,703 @@ +/*- + * ============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========================================================= + */ +/** + * Created by obarda on 3/30/2016. + */ +/// +module Sdc.ViewModels { + + 'use strict'; + import Resource = Sdc.Models.Components.Resource; + import ResourceType = Sdc.Utils.Constants.ResourceType; + + export interface IWorkspaceViewModelScope extends ng.IScope { + + isLoading: boolean; + isCreateProgress: boolean; + component: Models.Components.Component; + originComponent: Models.Components.Component; + componentType: string; + importFile: any; + leftBarTabs: Utils.MenuItemGroup; + isNew: boolean; + isFromImport: boolean; + isValidForm: boolean; + mode: Utils.Constants.WorkspaceMode; + breadcrumbsModel: Array; + sdcMenu: Models.IAppMenu; + changeLifecycleStateButtons: any; + version: string; + versionsList: Array; + changeVersion: any; + isComposition: boolean; + isDeployment: boolean; + $state: ng.ui.IStateService; + user: Models.IUserProperties; + thirdParty: boolean; + disabledButtons: boolean; + menuComponentTitle: string; + progressService: Sdc.Services.ProgressService; + progressMessage: string; + // leftPanelComponents:Array; //this is in order to load the left panel once, and not wait long time when moving to composition + + showChangeStateButton(): boolean; + getComponent(): Sdc.Models.Components.Component; + setComponent(component: Sdc.Models.Components.Component): void; + onMenuItemPressed(state: string): ng.IPromise; + save(): ng.IPromise; + setValidState(isValid: boolean): void; + revert(): void; + changeLifecycleState(state: string): void; + enabledTabs(): void + isDesigner(): boolean; + isViewMode(): boolean; + isEditMode(): boolean; + isCreateMode(): boolean; + isDisableMode(): boolean; + showFullIcons(): boolean; + goToBreadcrumbHome(): void; + onVersionChanged(selectedId: string): void; + getLatestVersion(): void; + getStatus(): string; + showLifecycleIcon(): boolean; + updateSelectedMenuItem(): void; + uploadFileChangedInGeneralTab(): void; + updateMenuComponentName(ComponentName: string): void; + } + + export class WorkspaceViewModel { + + static '$inject' = [ + '$scope', + 'injectComponent', + 'ComponentFactory', + '$state', + 'sdcMenu', + '$q', + 'MenuHandler', + 'Sdc.Services.CacheService', + 'ChangeLifecycleStateHandler', + 'ModalsHandler', + 'LeftPaletteLoaderService', + '$filter', + 'EventListenerService', + 'Sdc.Services.EntityService', + 'Notification', + '$stateParams', + 'Sdc.Services.ProgressService' + ]; + + constructor(private $scope: IWorkspaceViewModelScope, + private injectComponent: Models.Components.Component, + private ComponentFactory: Utils.ComponentFactory, + private $state: ng.ui.IStateService, + private sdcMenu: Models.IAppMenu, + private $q: ng.IQService, + private MenuHandler: Utils.MenuHandler, + private cacheService: Services.CacheService, + private ChangeLifecycleStateHandler: Sdc.Utils.ChangeLifecycleStateHandler, + private ModalsHandler: Sdc.Utils.ModalsHandler, + private LeftPaletteLoaderService: Services.Components.LeftPaletteLoaderService, + private $filter: ng.IFilterService, + private EventListenerService: Services.EventListenerService, + private EntityService: Sdc.Services.EntityService, + private Notification: any, + private $stateParams: any, + private progressService: Sdc.Services.ProgressService) { + + this.initScope(); + this.initAfterScope(); + } + + private role: string; + private components: Array; + + private initViewMode = (): Utils.Constants.WorkspaceMode => { + let mode = Utils.Constants.WorkspaceMode.VIEW; + + if (!this.$state.params['id']) { //&& !this.$state.params['vspComponent'] + mode = Utils.Constants.WorkspaceMode.CREATE; + } else { + if (this.$scope.component.lifecycleState === Utils.Constants.ComponentState.NOT_CERTIFIED_CHECKOUT && + this.$scope.component.lastUpdaterUserId === this.cacheService.get("user").userId) { + if (this.$scope.component.isProduct() && this.role == Utils.Constants.Role.PRODUCT_MANAGER) { + mode = Utils.Constants.WorkspaceMode.EDIT; + } + if ((this.$scope.component.isService() || this.$scope.component.isResource()) && this.role == Utils.Constants.Role.DESIGNER) { + mode = Utils.Constants.WorkspaceMode.EDIT; + } + } + } + return mode; + }; + + private initChangeLifecycleStateButtons = (): void => { + let state = this.$scope.component.isService() && (Utils.Constants.Role.OPS == this.role || Utils.Constants.Role.GOVERNOR == this.role) ? this.$scope.component.distributionStatus : this.$scope.component.lifecycleState; + this.$scope.changeLifecycleStateButtons = this.sdcMenu.roles[this.role].changeLifecycleStateButtons[state]; + }; + + private isNeedSave = (): boolean => { + if (this.$scope.isEditMode() && //this is a workaround for onboarding - we need to get the artifact in order to avoid saving the vf when moving from their tabs + (this.$state.current.name === Utils.Constants.States.WORKSPACE_MANAGEMENT_WORKFLOW || this.$state.current.name === Utils.Constants.States.WORKSPACE_NETWORK_CALL_FLOW)) { + return true; + } + return this.$scope.isEditMode() && + this.$state.current.data && this.$state.current.data.unsavedChanges; + }; + + private initScope = (): void => { + + this.$scope.component = this.injectComponent; + this.$scope.menuComponentTitle = this.$scope.component.name; + this.$scope.disabledButtons = false; + this.$scope.originComponent = this.ComponentFactory.createComponent(this.$scope.component); + this.$scope.componentType = this.$scope.component.componentType; + this.$scope.version = this.cacheService.get('version'); + this.$scope.user = this.cacheService.get("user"); + this.role = this.$scope.user.role; + this.$scope.mode = this.initViewMode(); + this.$scope.isValidForm = true; + this.initChangeLifecycleStateButtons(); + this.initVersionObject(); + this.$scope.$state = this.$state; + this.$scope.isLoading = false; + this.$scope.isComposition = (this.$state.current.name.indexOf(Utils.Constants.States.WORKSPACE_COMPOSITION) > -1); + this.$scope.isDeployment = (this.$state.current.name.indexOf(Utils.Constants.States.WORKSPACE_DEPLOYMENT) > -1); + this.$scope.progressService = this.progressService; + + this.$scope.getComponent = (): Sdc.Models.Components.Component => { + return this.$scope.component; + }; + + this.$scope.updateMenuComponentName = (ComponentName: string): void => { + this.$scope.menuComponentTitle = ComponentName; + }; + + this.$scope.sdcMenu = this.sdcMenu; + // Will be called from each step after save to update the resource. + this.$scope.setComponent = (component: Sdc.Models.Components.Component): void => { + this.$scope.component = component; + }; + + this.$scope.uploadFileChangedInGeneralTab = (): void => { + // In case user select browse file, and in update mode, need to disable submit for testing and checkin buttons. + if (this.$scope.isEditMode() && this.$scope.component.isResource() && (this.$scope.component).resourceType == ResourceType.VF) { + this.$scope.disabledButtons = true; + } + }; + + this.$scope.onMenuItemPressed = (state: string): ng.IPromise => { + let deferred = this.$q.defer(); + if (this.isNeedSave()) { + if (this.$scope.isValidForm) { + let onSuccess = (): void => { + this.$state.go(state, { + id: this.$scope.component.uniqueId, + type: this.$scope.component.componentType.toLowerCase(), + components: this.components + }); + deferred.resolve(true); + }; + this.$scope.save().then(onSuccess); + } else { + console.log('form is not valid'); + deferred.reject(false); + } + } else { + this.$state.go(state, { + id: this.$scope.component.uniqueId, + type: this.$scope.component.componentType.toLowerCase(), + components: this.components + }); + deferred.resolve(true); + } + return deferred.promise; + }; + + this.$scope.setValidState = (isValid: boolean): void => { + this.$scope.isValidForm = isValid; + }; + + this.$scope.onVersionChanged = (selectedId: string): void => { + this.$scope.isLoading = true; + if (this.$state.current.data && this.$state.current.data.unsavedChanges) { + this.$scope.changeVersion.selectedVersion = _.find(this.$scope.versionsList, {versionId: this.$scope.component.uniqueId}); + } + this.$state.go(this.$state.current.name, { + id: selectedId, + type: this.$scope.componentType.toLowerCase(), + mode: Utils.Constants.WorkspaceMode.VIEW, + components: this.$state.params['components'] + }); + + }; + + this.$scope.getLatestVersion = (): void => { + this.$scope.onVersionChanged(_.first(this.$scope.versionsList).versionId); + }; + + this.$scope.save = (state?: string): ng.IPromise => { + this.EventListenerService.notifyObservers(Utils.Constants.EVENTS.ON_WORKSPACE_SAVE_BUTTON_CLICK); + + this.progressService.initCreateComponentProgress(this.$scope.component.uniqueId); + + let deferred = this.$q.defer(); + let modalInstance: ng.ui.bootstrap.IModalServiceInstance; + + let onFailed = () => { + this.EventListenerService.notifyObservers(Utils.Constants.EVENTS.ON_WORKSPACE_SAVE_BUTTON_ERROR); + this.progressService.deleteProgressValue(this.$scope.component.uniqueId); + modalInstance && modalInstance.close(); // Close the modal in case it is opened. + this.$scope.isCreateProgress = false; + this.$scope.isLoading = false; // stop the progress. + + this.$scope.setValidState(true); // Set the form valid (if sent form is valid, the error from server). + if (!this.$scope.isCreateMode()) { + this.$scope.component = this.$scope.originComponent; // Set the component back to the original. + this.enableMenuItems(); // Enable the menu items (left tabs), so user can press on them. + this.$scope.disabledButtons = false; // Enable "submit for testing" & checking buttons. + } + + deferred.reject(false); + }; + + let onSuccessCreate = (component: Models.Components.Component) => { + + this.EventListenerService.notifyObservers(Utils.Constants.EVENTS.ON_WORKSPACE_SAVE_BUTTON_SUCCESS); + this.progressService.deleteProgressValue(this.$scope.component.uniqueId); + //update components for breadcrumbs + this.components.unshift(component); + this.$state.go(Utils.Constants.States.WORKSPACE_GENERAL, { + id: component.uniqueId, + type: component.componentType.toLowerCase(), + components: this.components + }); + + deferred.resolve(true); + }; + + let onSuccessUpdate = (component: Models.Components.Component) => { + this.$scope.isCreateProgress = false; + this.$scope.disabledButtons = false; + this.EventListenerService.notifyObservers(Utils.Constants.EVENTS.ON_WORKSPACE_SAVE_BUTTON_SUCCESS); + this.progressService.deleteProgressValue(this.$scope.component.uniqueId); + + // Stop the circle loader. + this.$scope.isLoading = false; + + component.tags = _.reject(component.tags, (item)=> { + return item === component.name + }); + + // Update the components + this.$scope.component = component; + this.$scope.originComponent = this.ComponentFactory.createComponent(this.$scope.component); + + //update components for breadcrumbs + this.components.unshift(component); + + // Enable left tags + this.$scope.enabledTabs(); + + + if (this.$state.current.data) { + this.$state.current.data.unsavedChanges = false; + } + + deferred.resolve(true); + }; + + if (this.$scope.isCreateMode()) { + this.$scope.progressMessage = "Creating Asset..."; + // CREATE MODE + this.$scope.isCreateProgress = true; + + // Start creating the component + this.ComponentFactory.createComponentOnServer(this.$scope.component).then(onSuccessCreate, onFailed); + + // In case we import CSAR. Notify user that import VF will take long time (the create is performed in the background). + if (this.$scope.component.isResource() && (this.$scope.component).csarUUID) { + this.Notification.info({ + message: this.$filter('translate')("IMPORT_VF_MESSAGE_CREATE_TAKES_LONG_TIME_DESCRIPTION"), + title: this.$filter('translate')("IMPORT_VF_MESSAGE_CREATE_TAKES_LONG_TIME_TITLE") + }); + } + } else { + // UPDATE MODE + this.$scope.isCreateProgress = true; + this.$scope.progressMessage = "Updating Asset..."; + this.disableMenuItems(); + + + // Work around to change the csar version + if (this.cacheService.get(Utils.Constants.CHANGE_COMPONENT_CSAR_VERSION_FLAG)) { + (this.$scope.component).csarVersion = this.cacheService.get(Utils.Constants.CHANGE_COMPONENT_CSAR_VERSION_FLAG); + this.cacheService.remove(Utils.Constants.CHANGE_COMPONENT_CSAR_VERSION_FLAG); + } + + this.$scope.component.updateComponent().then(onSuccessUpdate, onFailed); + } + return deferred.promise; + }; + + this.$scope.revert = (): void => { + //in state of import file leave the file in place + if (this.$scope.component.isResource() && (this.$scope.component).importedFile) { + let tempFile: Sdc.Directives.FileUploadModel = (this.$scope.component).importedFile; + this.$scope.component = this.ComponentFactory.createComponent(this.$scope.originComponent); + (this.$scope.component).importedFile = tempFile; + } else { + this.$scope.component = this.ComponentFactory.createComponent(this.$scope.originComponent); + } + + }; + + this.$scope.changeLifecycleState = (state: string): void => { + if (this.isNeedSave() && state !== 'deleteVersion') { + this.$scope.save().then(() => { + changeLifecycleState(state); + }) + } else { + changeLifecycleState(state); + } + }; + + let defaultActionAfterChangeLifecycleState = (): void => { + if (this.$state.current.data && this.$state.current.data.unsavedChanges) { + this.$state.current.data.unsavedChanges = false; + } + this.$state.go('dashboard'); + }; + + let changeLifecycleState = (state: string) => { + if ('monitor' === state) { + this.$state.go('workspace.distribution'); + return; + } + + let data = this.$scope.changeLifecycleStateButtons[state]; + let onSuccess = (component: Models.Components.Component): void => { + //Updating the component from server response + + //the server returns only metaData (small component) except checkout (Full component) ,so we update only the statuses of distribution & lifecycle + this.$scope.component.lifecycleState = component.lifecycleState; + this.$scope.component.distributionStatus = component.distributionStatus; + + switch (data.url) { + case 'lifecycleState/CHECKOUT': + // only checkOut get the full component from server + this.$scope.component = component; + // Work around to change the csar version + if (this.cacheService.get(Utils.Constants.CHANGE_COMPONENT_CSAR_VERSION_FLAG)) { + (this.$scope.component).csarVersion = this.cacheService.get(Utils.Constants.CHANGE_COMPONENT_CSAR_VERSION_FLAG); + } + + //when checking out a minor version uuid remains + let bcComponent: Sdc.Models.Components.Component = _.find(this.components, (item) => { + return item.uuid === component.uuid; + }); + if (bcComponent) { + this.components[this.components.indexOf(bcComponent)] = component; + } else { + //when checking out a major(certified) version + this.components.unshift(component); + } + + this.$state.go(this.$state.current.name, { + id: component.uniqueId, + type: component.componentType.toLowerCase(), + components: this.components + }); + this.Notification.success({ + message: this.$filter('translate')("CHECKOUT_SUCCESS_MESSAGE_TEXT"), + title: this.$filter('translate')("CHECKOUT_SUCCESS_MESSAGE_TITLE") + }); + break; + case 'lifecycleState/CHECKIN': + defaultActionAfterChangeLifecycleState(); + this.Notification.success({ + message: this.$filter('translate')("CHECKIN_SUCCESS_MESSAGE_TEXT"), + title: this.$filter('translate')("CHECKIN_SUCCESS_MESSAGE_TITLE") + }); + break; + case 'lifecycleState/UNDOCHECKOUT': + defaultActionAfterChangeLifecycleState(); + this.Notification.success({ + message: this.$filter('translate')("DELETE_SUCCESS_MESSAGE_TEXT"), + title: this.$filter('translate')("DELETE_SUCCESS_MESSAGE_TITLE") + }); + break; + case 'lifecycleState/certificationRequest': + defaultActionAfterChangeLifecycleState(); + this.Notification.success({ + message: this.$filter('translate')("SUBMIT_FOR_TESTING_SUCCESS_MESSAGE_TEXT"), + title: this.$filter('translate')("SUBMIT_FOR_TESTING_SUCCESS_MESSAGE_TITLE") + }); + break; + //Tester Role + case 'lifecycleState/failCertification': + defaultActionAfterChangeLifecycleState(); + this.Notification.success({ + message: this.$filter('translate')("REJECT_SUCCESS_MESSAGE_TEXT"), + title: this.$filter('translate')("REJECT_SUCCESS_MESSAGE_TITLE") + }); + break; + case 'lifecycleState/certify': + defaultActionAfterChangeLifecycleState(); + this.Notification.success({ + message: this.$filter('translate')("ACCEPT_TESTING_SUCCESS_MESSAGE_TEXT"), + title: this.$filter('translate')("ACCEPT_TESTING_SUCCESS_MESSAGE_TITLE") + }); + break; + //DE203504 Bug Fix Start + case 'lifecycleState/startCertification': + this.initChangeLifecycleStateButtons(); + this.Notification.success({ + message: this.$filter('translate')("START_TESTING_SUCCESS_MESSAGE_TEXT"), + title: this.$filter('translate')("START_TESTING_SUCCESS_MESSAGE_TITLE") + }); + break; + case 'lifecycleState/cancelCertification': + this.initChangeLifecycleStateButtons(); + this.Notification.success({ + message: this.$filter('translate')("CANCEL_TESTING_SUCCESS_MESSAGE_TEXT"), + title: this.$filter('translate')("CANCEL_TESTING_SUCCESS_MESSAGE_TITLE") + }); + break; + //Ops Role + case 'distribution/PROD/activate': + this.initChangeLifecycleStateButtons(); + this.Notification.success({ + message: this.$filter('translate')("DISTRIBUTE_SUCCESS_MESSAGE_TEXT"), + title: this.$filter('translate')("DISTRIBUTE_SUCCESS_MESSAGE_TITLE") + }); + break; + //Governor Role + case 'distribution-state/reject': + this.initChangeLifecycleStateButtons(); + this.Notification.success({ + message: this.$filter('translate')("REJECT_SUCCESS_MESSAGE_TEXT"), + title: this.$filter('translate')("REJECT_SUCCESS_MESSAGE_TITLE") + }); + break; + case 'distribution-state/approve': + this.initChangeLifecycleStateButtons(); + this.$state.go('catalog'); + this.Notification.success({ + message: this.$filter('translate')("APPROVE_SUCCESS_MESSAGE_TEXT"), + title: this.$filter('translate')("APPROVE_SUCCESS_MESSAGE_TITLE") + }); + break; + //DE203504 Bug Fix End + + default : + defaultActionAfterChangeLifecycleState(); + + } + if (data.url != 'lifecycleState/CHECKOUT') { + this.$scope.isLoading = false; + } + }; + //this.$scope.isLoading = true; + this.ChangeLifecycleStateHandler.changeLifecycleState(this.$scope.component, data, this.$scope, onSuccess); + }; + + this.$scope.enabledTabs = (): void => { + this.$scope.leftBarTabs.menuItems.forEach((item: Utils.MenuItem) => { + item.isDisabled = false; + }); + }; + + this.$scope.isViewMode = (): boolean => { + return this.$scope.mode === Utils.Constants.WorkspaceMode.VIEW; + }; + + this.$scope.isDesigner = (): boolean => { + return this.role == Utils.Constants.Role.DESIGNER; + }; + + this.$scope.isDisableMode = (): boolean => { + return this.$scope.mode === Utils.Constants.WorkspaceMode.VIEW && this.$scope.component.lifecycleState === Utils.Constants.ComponentState.NOT_CERTIFIED_CHECKIN; + }; + + this.$scope.showFullIcons = (): boolean => { + //we show revert and save icons only in general\icon view + return this.$state.current.name === Utils.Constants.States.WORKSPACE_GENERAL || + this.$state.current.name === Utils.Constants.States.WORKSPACE_ICONS; + }; + + this.$scope.isCreateMode = (): boolean => { + return this.$scope.mode === Utils.Constants.WorkspaceMode.CREATE; + }; + + this.$scope.isEditMode = (): boolean => { + return this.$scope.mode === Utils.Constants.WorkspaceMode.EDIT; + }; + + this.$scope.goToBreadcrumbHome = (): void => { + let bcHome: Sdc.Utils.MenuItemGroup = this.$scope.breadcrumbsModel[0]; + this.$state.go(bcHome.menuItems[bcHome.selectedIndex].state); + }; + + this.$scope.showLifecycleIcon = (): boolean => { + return this.role == Utils.Constants.Role.DESIGNER || + this.role == Utils.Constants.Role.PRODUCT_MANAGER; + }; + + this.$scope.getStatus = (): string => { + if (this.$scope.isCreateMode()) { + return 'IN DESIGN'; + } + + return this.$scope.component.getStatus(this.sdcMenu); + }; + + this.initMenuItems(); + + this.$scope.showChangeStateButton = (): boolean => { + let result: boolean = true; + if (!this.$scope.component.isLatestVersion() && Utils.Constants.Role.OPS != this.role && Utils.Constants.Role.GOVERNOR != this.role) { + result = false; + } + if (this.role === Utils.Constants.Role.PRODUCT_MANAGER && !this.$scope.component.isProduct()) { + result = false; + } + if ((this.role === Utils.Constants.Role.DESIGNER || this.role === Utils.Constants.Role.TESTER) + && this.$scope.component.isProduct()) { + result = false; + } + if (Utils.Constants.ComponentState.NOT_CERTIFIED_CHECKOUT === this.$scope.component.lifecycleState && this.$scope.isViewMode()) { + result = false; + } + if (Utils.Constants.ComponentState.CERTIFIED != this.$scope.component.lifecycleState && + (Utils.Constants.Role.OPS == this.role || Utils.Constants.Role.GOVERNOR == this.role)) { + result = false; + } + return result; + }; + + this.$scope.updateSelectedMenuItem = (): void => { + let selectedItem: Sdc.Utils.MenuItem = _.find(this.$scope.leftBarTabs.menuItems, (item: Sdc.Utils.MenuItem) => { + return item.state === this.$state.current.name; + }); + this.$scope.leftBarTabs.selectedIndex = selectedItem ? this.$scope.leftBarTabs.menuItems.indexOf(selectedItem) : 0; + }; + + this.$scope.$watch('$state.current.name', (newVal: string): void => { + if (newVal) { + this.$scope.isComposition = (newVal.indexOf(Utils.Constants.States.WORKSPACE_COMPOSITION) > -1); + this.$scope.isDeployment = (newVal.indexOf(Utils.Constants.States.WORKSPACE_DEPLOYMENT) > -1); + } + }); + }; + + private initAfterScope = (): void => { + // In case user select csar from the onboarding modal, need to disable checkout and submit for testing. + if (this.$state.params['disableButtons'] === true) { + this.$scope.uploadFileChangedInGeneralTab(); + } + }; + + private initVersionObject = (): void => { + this.$scope.versionsList = (this.$scope.component.getAllVersionsAsSortedArray()).reverse(); + this.$scope.changeVersion = {selectedVersion: _.find(this.$scope.versionsList, {versionId: this.$scope.component.uniqueId})}; + }; + + private getNewComponentBreadcrumbItem = (): Utils.MenuItem => { + let text = ""; + if (this.$scope.component.isResource() && (this.$scope.component).isCsarComponent()) { + text = this.$scope.component.getComponentSubType() + ': ' + this.$scope.component.name; + } else { + text = 'Create new ' + this.$state.params['type']; + } + return new Utils.MenuItem(text, null, Utils.Constants.States.WORKSPACE_GENERAL, 'goToState', [this.$state.params]); + }; + + private updateMenuItemByRole = (menuItems: Array, role: string) => { + let tempMenuItems: Array = new Array(); + menuItems.forEach((item: Utils.MenuItem) => { + //remove item if role is disabled + if (!(item.disabledRoles && item.disabledRoles.indexOf(role) > -1)) { + tempMenuItems.push(item); + } + }); + return tempMenuItems; + }; + + private initBreadcrumbs = () => { + this.components = this.cacheService.get('breadcrumbsComponents'); + let breadcrumbsComponentsLvl = this.MenuHandler.generateBreadcrumbsModelFromComponents(this.components, this.$scope.component); + + if (this.$scope.isCreateMode()) { + let createItem = this.getNewComponentBreadcrumbItem(); + if (!breadcrumbsComponentsLvl.menuItems) { + breadcrumbsComponentsLvl.menuItems = []; + } + breadcrumbsComponentsLvl.menuItems.unshift(createItem); + breadcrumbsComponentsLvl.selectedIndex = 0; + } + + this.$scope.breadcrumbsModel = [breadcrumbsComponentsLvl, this.$scope.leftBarTabs]; + }; + + private initMenuItems() { + + let inCreateMode = this.$scope.isCreateMode(); + this.$scope.leftBarTabs = new Utils.MenuItemGroup(); + this.$scope.leftBarTabs.menuItems = this.updateMenuItemByRole(this.sdcMenu.component_workspace_menu_option[this.$scope.component.getComponentSubType()], this.role); + + this.$scope.leftBarTabs.menuItems.forEach((item: Utils.MenuItem) => { + item.params = [item.state]; + item.callback = this.$scope.onMenuItemPressed; + item.isDisabled = (inCreateMode && Utils.Constants.States.WORKSPACE_GENERAL != item.state) || + (Utils.Constants.States.WORKSPACE_DEPLOYMENT === item.state && this.$scope.component.groups.length === 0 && this.$scope.component.isResource()); + }); + + if (this.cacheService.get('breadcrumbsComponents')) { + this.initBreadcrumbs(); + } else { + let onSuccess = (components: Array) => { + this.cacheService.set('breadcrumbsComponents', components); + this.initBreadcrumbs(); + }; + this.EntityService.getCatalog().then(onSuccess); //getAllComponents() doesnt return components from catalog + } + } + + private disableMenuItems() { + this.$scope.leftBarTabs.menuItems.forEach((item: Utils.MenuItem) => { + item.params = [item.state]; + item.callback = this.$scope.onMenuItemPressed; + item.isDisabled = (Utils.Constants.States.WORKSPACE_GENERAL != item.state); + }); + } + + private enableMenuItems() { + this.$scope.leftBarTabs.menuItems.forEach((item: Utils.MenuItem) => { + item.params = [item.state]; + item.callback = this.$scope.onMenuItemPressed; + item.isDisabled = false; + }); + } + + } +} + + diff --git a/catalog-ui/app/scripts/view-models/workspace/workspace-view.html b/catalog-ui/app/scripts/view-models/workspace/workspace-view.html new file mode 100644 index 0000000000..118f7474be --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/workspace-view.html @@ -0,0 +1,86 @@ +
        + + + + + +
        + +
        +
        + +
        +
        + +
        + + + + +
        +
        + + + + +
        + +
        +
        + {{getStatus()}} +
        + + +
        + +
        + +
        + + Switch to the latest version + + + + + + + + Delete + + Revert + + + + Close + +
        +
        + +
        Created: {{component.creationDate | date:'MM/dd/yyyy'}}, {{component.creatorFullName}} | Modifed: {{component.lastUpdateDate | date:'MM/dd/yyyy'}} | UUID: {{component.uuid}} Invariant UUID: {{component.invariantUUID}}
        + +
        +
        +
        + +
        diff --git a/catalog-ui/app/scripts/view-models/workspace/workspace.less b/catalog-ui/app/scripts/view-models/workspace/workspace.less new file mode 100644 index 0000000000..d8bff1b634 --- /dev/null +++ b/catalog-ui/app/scripts/view-models/workspace/workspace.less @@ -0,0 +1,144 @@ +.sdc-workspace-container { + .bg_p; + + .add-btn { + .f-color.a; + .f-type._12_m; + .hand; + float: right; + margin-bottom: 15px; + + &:before { + .sprite-new; + .plus-icon; + margin-right: 5px; + content: ""; + + } + &:hover { + .f-color.b; + &:before { + .sprite-new; + .plus-icon-hover; + } + } + + } + .w-sdc-left-sidebar { + padding: 3px 3px 0px 0px; + background-color: @main_color_p; + box-shadow: 7px -3px 6px -8px @main_color_n; + z-index: 2; + } + + .sdc-asset-creation-info { + .n_12_r; + float: right; + margin: 8px 20px 0 0; + } + + .w-sdc-main-right-container { + + padding: 0px 0px 0px 0px; + background-color: @main_color_p; + z-index: 1; + + .sdc-workspace-top-bar { + height: @action_nav_height; + padding: 12px 10px 0px 50px; + border-bottom: 1px solid @main_color_o; + display: flex; + justify-content: space-between; + + .version-container { + + } + + .progress-container { + flex-grow: 4; + z-index: 10000000; + + .general-view-top-progress { + width: 30%; + margin: 0 auto; + } + } + + .not-latest { + position: absolute; + left: 24px; + top: 20px; + .sprite-new; + .asdc-warning; + } + + .sdc-workspace-top-bar-buttons { + + > button, > span:not(.delimiter) { + margin-right: 10px; + vertical-align: middle; + .hand; + + &.sprite-new { + text-indent: 100%; + } + &.disabled, &:hover.disabled { + pointer-events: none; + } + } + .delimiter { + height: 32px; + width: 1px; + background-color: #959595; + display: inline-block; + vertical-align: middle; + margin-right: 20px; + } + + } + + .lifecycle-state { + padding: 7px 0 0 10px; + margin: 2px 0 7px 10px; + border-left: 1px solid @main_color_o; + line-height: 15px; + font-family: @font-omnes-medium; + color: @main_color_m; + + .lifecycle-state-icon { + .sprite-new; + } + .lifecycle-state-text { + + font-weight: bold; + text-transform: uppercase; + vertical-align: top; + padding: 3px; + } + } + + .version-selector { + // float:left; + background-color: transparent; + border: none; + margin-top: 6px; + } + } + .w-sdc-main-container-body-content { + height:100%; + + text-align: center; + align-items: center; + padding: 40px 14% 20px 14%; + &.third-party { + text-align: left; + padding: 0; + position: absolute; + top: @action_nav_height; + left: 0; + right: 0; + bottom: 0; + } + } + } +} diff --git a/catalog-ui/app/styles/animation.less b/catalog-ui/app/styles/animation.less new file mode 100644 index 0000000000..014b33a454 --- /dev/null +++ b/catalog-ui/app/styles/animation.less @@ -0,0 +1,51 @@ +.animation_flex (@value){ + -webkit-animation: @value; + -moz-animation: @value; + -o-animation: @value; + -ms-transition: @value; + animation: @value; +} + +.animation (@name, @duration: 300ms, @delay: 0, @ease: ease) { + -webkit-animation: @name @duration @delay @ease; + -moz-animation: @name @duration @delay @ease; + -o-animation: @name @duration @delay @ease; + -ms-animation: @name @duration @delay @ease; + animation: @name @duration @delay @ease; +} + +/* ============ flash ============ */ +.flash-frames () { + 0% { opacity: 1; } + 20% { opacity: 1; } + 50% { opacity: 0; } + 80% { opacity: 1; } + 100% { opacity: 1; } +} +@-webkit-keyframes flash {.flash-frames;} /* Safari, Chrome and Opera > 12.1 */ +@-moz-keyframes flash {.flash-frames;} /* Firefox < 16 */ +@-o-keyframes flash {.flash-frames;} /* Opera < 12.1 */ +@-ms-keyframes flash {.flash-frames;} /* Internet Explorer */ +@keyframes flash {.flash-frames;} + +/* ============ fadein ============ */ +.fadein-frames () { + from { opacity: 0; } + to { opacity: 1; } +} +@-webkit-keyframes fadein {.fadein-frames;} /* Safari, Chrome and Opera > 12.1 */ +@-moz-keyframes fadein {.fadein-frames;} /* Firefox < 16 */ +@-o-keyframes fadein {.fadein-frames;} /* Opera < 12.1 */ +@-ms-keyframes fadein {.fadein-frames;} /* Internet Explorer */ +@keyframes fadein {.fadein-frames;} + +/* ============ fadeout ============ */ +.fadeout-frames () { + from { opacity: 1; } + to { opacity: 0; } +} +@-webkit-keyframes fadeout {.fadeout-frames;} /* Safari, Chrome and Opera > 12.1 */ +@-moz-keyframes fadeout {.fadeout-frames;} /* Firefox < 16 */ +@-o-keyframes fadeout {.fadeout-frames;} /* Opera < 12.1 */ +@-ms-keyframes fadeout {.fadeout-frames;} /* Internet Explorer */ +@keyframes fadeout {.fadeout-frames;} diff --git a/catalog-ui/app/styles/app.less b/catalog-ui/app/styles/app.less new file mode 100644 index 0000000000..cec5b86753 --- /dev/null +++ b/catalog-ui/app/styles/app.less @@ -0,0 +1,122 @@ +.sdc-main-container{ + width: 100%; + height: 100%; +} + +// injector:less +@import 'animation.less'; +@import 'buttons.less'; +@import 'dark-header.less'; +@import 'fonts.less'; +@import 'form-elements.less'; +@import 'global.less'; +@import 'layout/header.less'; +@import 'layout/main.less'; +@import 'layout/sidebar.less'; +@import 'mixins.less'; +@import 'mixins_old.less'; +@import 'modal.less'; +@import 'scroller.less'; +@import 'sprite-old.less'; +@import 'sprite-product-icons.less'; +@import 'sprite-resource-icons.less'; +@import 'sprite-services-icons.less'; +@import 'sprite.less'; +@import 'table-flex.less'; +@import 'tlv-buttons.less'; +@import 'tlv-checkbox.less'; +@import 'tlv-loader.less'; +@import 'tlv-sprite.less'; +@import 'tooltips.less'; +@import 'variables-old.less'; +@import 'variables.less'; +@import 'welcome-sprite.less'; +@import 'welcome-style.less'; +@import '../scripts/directives/ecomp-header/ecomp-header.less'; +@import '../scripts/directives/edit-name-popover/edit-name-popover.less'; +@import '../scripts/directives/elements/checkbox/checkbox.less'; +@import '../scripts/directives/elements/radiobutton/radiobutton.less'; +@import '../scripts/directives/ellipsis/ellipsis-directive.less'; +@import '../scripts/directives/file-upload/file-upload.less'; +@import '../scripts/directives/graphs-v2/composition-graph/composition-graph.less'; +@import '../scripts/directives/graphs-v2/deployment-graph/deployment-graph.less'; +@import '../scripts/directives/graphs-v2/palette/palette.less'; +@import '../scripts/directives/graphs-v2/relation-menu/relation-menu.less'; +@import '../scripts/directives/info-tooltip/info-tooltip.less'; +@import '../scripts/directives/layout/top-nav/top-nav.less'; +@import '../scripts/directives/layout/top-progress/top-progress.less'; +@import '../scripts/directives/loader/loader-directive.less'; +@import '../scripts/directives/modal/sdc-modal.less'; +@import '../scripts/directives/page-scroller/page-scroller.less'; +@import '../scripts/directives/property-types/data-type-fields-structure/data-type-fields-structure.less'; +@import '../scripts/directives/property-types/type-list/type-list-directive.less'; +@import '../scripts/directives/property-types/type-map/type-map-directive.less'; +@import '../scripts/directives/sdc-tabs/sdc-single-tab/sdc-single-tab.less'; +@import '../scripts/directives/sdc-tabs/sdc-tabs.less'; +@import '../scripts/directives/structure-tree/structure-tree-directive.less'; +@import '../scripts/directives/tag/tag-directive.less'; +@import '../scripts/directives/tutorial/tutorial-directive.less'; +@import '../scripts/directives/user-header-details/user-header-details-directive.less'; +@import '../scripts/directives/utils/expand-collapse-menu-box/expand-collapse-menu-box.less'; +@import '../scripts/directives/utils/expand-collapse/expand-collapse.less'; +@import '../scripts/directives/utils/page-selector/page-selector.less'; +@import '../scripts/directives/utils/sdc-tags/sdc-tags.less'; +@import '../scripts/directives/utils/sdc_messages/sdc-messages.less'; +@import '../scripts/directives/utils/wizard_steps/sdc-wizard-steps.less'; +@import '../scripts/view-models/admin-dashboard/add-category-modal/add-category-modal-view.less'; +@import '../scripts/view-models/admin-dashboard/admin-dashboard.less'; +@import '../scripts/view-models/admin-dashboard/category-management/category-management.less'; +@import '../scripts/view-models/admin-dashboard/user-management/user-management.less'; +@import '../scripts/view-models/catalog/catalog.less'; +@import '../scripts/view-models/component-viewer/activity-log/activity-log-view.less'; +@import '../scripts/view-models/component-viewer/component-viewer.less'; +@import '../scripts/view-models/component-viewer/properties/properties-view.less'; +@import '../scripts/view-models/dashboard/dashboard.less'; +@import '../scripts/view-models/forms/artifact-form/artifact-form.less'; +@import '../scripts/view-models/forms/env-parameters-form/env-parameters-form.less'; +@import '../scripts/view-models/forms/property-form/property-form.less'; +@import '../scripts/view-models/forms/resource-instance-name-form/resource-instance-name.less'; +@import '../scripts/view-models/modals/confirmation-modal/confirmation-modal.less'; +@import '../scripts/view-models/modals/email-modal/email-modal.less'; +@import '../scripts/view-models/modals/error-modal/error.less'; +@import '../scripts/view-models/modals/message-modal/message-client-modal/client-message-modal.less'; +@import '../scripts/view-models/modals/message-modal/message-server-modal/server-message-modal.less'; +@import '../scripts/view-models/modals/onboarding-modal/onboarding-modal.less'; +@import '../scripts/view-models/onboard-vendor/onboard-vendor.less'; +@import '../scripts/view-models/preloading/preloading-view.less'; +@import '../scripts/view-models/support/support.less'; +@import '../scripts/view-models/tabs/general-tab.less'; +@import '../scripts/view-models/tabs/hierarchy/hierarchy.less'; +@import '../scripts/view-models/tutorial-end/tutorial-end.less'; +@import '../scripts/view-models/wizard/artifact-deployment-step/artifact-deployment-step.less'; +@import '../scripts/view-models/wizard/artifact-form-step/artifact-form-step.less'; +@import '../scripts/view-models/wizard/artifact-information-step/artifact-information-step.less'; +@import '../scripts/view-models/wizard/general-step/general-step.less'; +@import '../scripts/view-models/wizard/hierarchy-step/hierarchy-step.less'; +@import '../scripts/view-models/wizard/icons-step/icons-step.less'; +@import '../scripts/view-models/wizard/properties-step/properties-step.less'; +@import '../scripts/view-models/wizard/property-form/property-form.less'; +@import '../scripts/view-models/wizard/wizard-creation-base.less'; +@import '../scripts/view-models/workspace/tabs/activity-log/activity-log.less'; +@import '../scripts/view-models/workspace/tabs/attributes/attributes.less'; +@import '../scripts/view-models/workspace/tabs/composition/composition.less'; +@import '../scripts/view-models/workspace/tabs/composition/tabs/artifacts/artifacts.less'; +@import '../scripts/view-models/workspace/tabs/composition/tabs/details/details.less'; +@import '../scripts/view-models/workspace/tabs/composition/tabs/properties-and-attributes/properties.less'; +@import '../scripts/view-models/workspace/tabs/composition/tabs/relations/relations.less'; +@import '../scripts/view-models/workspace/tabs/deployment-artifacts/deployment-artifacts.less'; +@import '../scripts/view-models/workspace/tabs/deployment/deployment.less'; +@import '../scripts/view-models/workspace/tabs/distribution/disribution-status-modal/disribution-status-modal.less'; +@import '../scripts/view-models/workspace/tabs/distribution/distribution.less'; +@import '../scripts/view-models/workspace/tabs/general/general.less'; +@import '../scripts/view-models/workspace/tabs/icons/icons.less'; +@import '../scripts/view-models/workspace/tabs/information-artifacts/information-artifacts.less'; +@import '../scripts/view-models/workspace/tabs/inputs/inputs.less'; +@import '../scripts/view-models/workspace/tabs/inputs/resource-input/resource-inputs.less'; +@import '../scripts/view-models/workspace/tabs/inputs/service-input/service-inputs.less'; +@import '../scripts/view-models/workspace/tabs/product-hierarchy/product-hierarchy.less'; +@import '../scripts/view-models/workspace/tabs/properties/properties.less'; +@import '../scripts/view-models/workspace/tabs/req-and-capabilities/req-and-capabilities.less'; +@import '../scripts/view-models/workspace/tabs/tosca-artifacts/tosca-artifacts.less'; +@import '../scripts/view-models/workspace/workspace.less'; +// endinjector:less diff --git a/catalog-ui/app/styles/buttons.less b/catalog-ui/app/styles/buttons.less new file mode 100644 index 0000000000..7215d7a3d4 --- /dev/null +++ b/catalog-ui/app/styles/buttons.less @@ -0,0 +1,274 @@ +.w-sdc-btn { + .c_4; + .hand; + .border-radius(5px); + border: 0; + height: 38px; + line-height: 38px; + width: 195px; + margin: 0 6px; + padding: 0; + vertical-align: middle; + outline: none; + &:disabled { .bg_e; } +} + +.w-sdc-btn-small { + .c_9; + .hand; + .border-radius(5px); + border: 0; + height: 30px; + line-height: 30px; + width: 71px; + margin: 0 6px; + padding: 0; + outline: none; + vertical-align: middle; + position: relative; + &:disabled { .bg_e; } +} + + + +.w-sdc-btn-red-small{ + + .w-sdc-btn-small; + .bg_h; + &:hover:enabled { .bg_h_hover; } + padding-left: 15px; + + span { + position: absolute; + top: 7px; + left: 10px; + } +} + +.w-sdc-btn-green-small{ + .w-sdc-btn-small; + .bg_z; + &:hover:enabled { .bg_z_hover; } + +} + + +.w-sdc-btn-light-green { + .w-sdc-btn; + .bg_z; + &:hover:enabled { .bg_z_hover; } +} + +.w-sdc-btn-green { + .w-sdc-btn; + .bg_d; + &:hover:enabled { .bg_d_hover; } +} + +.w-sdc-btn-blue { + .w-sdc-btn; + .bg_a; + &:hover:enabled { .bg_a_hover; } +} + +.w-sdc-btn-dark-gray { + .w-sdc-btn; + .bg_i; + &:hover:enabled { .bg_i_hover; } +} + +.w-sdc-form-action { + .c_6; + //.bg_d; + background-color: #28bd6e; //TO DO: add to variables + .border-radius(5px); + .hand; + border: 0; + height: 38px; + line-height: 38px; + width: 264px; + + &:hover { background-color: #23aa63; } //TO DO: add to variables + &:disabled { background-color: #93deb6; } //TO DO: add to variables +} + +/* +CLASSIC BUTTON +Examples: +------------------------------------------------------------------- + + + + + +*/ +.w-sdc-classic-btn { + .p_14_m; + text-align: center; + .border-radius(2px); + border-style: solid; + border-width: 1px; + width: 94px; + height: 30px; + display: block; + vertical-align: middle; + line-height: 30px; + cursor: pointer; + text-decoration: none; + box-sizing: border-box; + .noselect; + position: relative; + + &:focus, + &:active:focus { + outline: 0 none; + } + + &.primary { + border-color: @main_color_b; + background-color: @main_color_a; + color: @main_color_p; + + &:hover { + background-color: #1ec2ff; + } + } + + &.white { + + } + + &.grey { + + } + + &.positive { + + } + + &.negative { + + } + + &.blue { + .c_7; + ._w-sdc-classic-btn-configuration(#036698, #3b7b9b, #023c59); // Normal + &:hover { ._w-sdc-classic-btn-configuration(#036698, #458eb2, #023c59); } // Hover + &:active { ._w-sdc-classic-btn-configuration(#036698, #336c88, #023c59); } // Pressed + &:focus { &:before { ._w-sdc-classic-btn-focus(#ffffff, 0px); } } // Focus + &:disabled, + &.disabled { + .c_7; + opacity: 0.3; + ._w-sdc-classic-btn-configuration(#036698, #3b7b9b, #023c59); // Disabled + } + } + + &.green { + .c_7; + ._w-sdc-classic-btn-configuration(#25a762, #28bd6e, #235600); // Normal + &:hover { ._w-sdc-classic-btn-configuration(#25a762, #2bcd77, #235600); } // Hover + &:active { ._w-sdc-classic-btn-configuration(#45a006, #24a862, #235600); } // Pressed + &:focus { &:before { ._w-sdc-classic-btn-focus(#ffffff, 0px); } } // Focus + &:disabled, + &.disabled { + .c_7; + opacity: 0.3; + ._w-sdc-classic-btn-configuration(#45a006, #28bd6e, #235600); // Disabled + } + } + + &.gray { + .b_7; + ._w-sdc-classic-btn-configuration(#d8d8d8, #f6f6f6, #aaaaaa); // Normal + &:hover { ._w-sdc-classic-btn-configuration(#d8d8d8, #ececec, #aaaaaa); } // Hover + &:active { ._w-sdc-classic-btn-configuration(#d8d8d8, #d7d7d7, #aaaaaa); } // Pressed + &:focus { &:before { ._w-sdc-classic-btn-focus(#666666, -1px); } } // Focus + &:disabled, + &.disabled { + .b_7; + opacity: 0.3; + ._w-sdc-classic-btn-configuration(#d8d8d8, #f6f6f6, #aaaaaa); // Disabled + } + } + + &.white { + .b_7; + ._w-sdc-classic-btn-configuration(#d8d8d8, #ffffff, #aaaaaa); // Normal + &:hover { ._w-sdc-classic-btn-configuration(#d8d8d8, #f6f6f6, #aaaaaa); } // Hover + &:active { ._w-sdc-classic-btn-configuration(#d8d8d8, #ececec, #aaaaaa); } // Pressed + &:focus { &:before { ._w-sdc-classic-btn-focus(#666666, -1px); } } // Focus + &:disabled, + &.disabled { + .b_7; + opacity: 0.3; + ._w-sdc-classic-btn-configuration(#d8d8d8, #ffffff, #aaaaaa); // Disabled + } + } +} + +._w-sdc-classic-btn-configuration(@border-color; @background-color; @shadow-color) { + border-color: @border-color; + background-color: @background-color; + .box-shadow(0px 1px 0.99px 0.01px @shadow-color); +} + +._w-sdc-classic-btn-focus(@border-color, @position) { + content: " "; + position: absolute; + top: @position; + left: @position; + right: @position; + bottom: -1px + @position; + border: 1px solid @border-color; + z-index: 1; + .border-radius(2px); +} + +/* +WIZARD STEP CIRCLE BUTTON +Examples: +------------------------------------------------------------------- + + + + + +*/ +.w-sdc-wizard-step-btn { + ._w-sdc-wizard-step-btn(18px); +} +._w-sdc-wizard-step-btn(@circle-radius) { + // I'm not using border, so the text inside will be vertical aligned. + .circle(@circle-radius * 2, #f6f6f6); + .noselect; + outline: 0 none; + position: relative; + vertical-align: top; + cursor: pointer; + vertical-align: middle; + border: none; + .box-shadow(inset 0px 0px 0px 1px #d8d8d8); + .b_17; + + &:active { .box-shadow(none); background-color: #eaeaea;} // Pressed + &.disabled { color: #a8b3b9; cursor: default; } + &.disabled:active { .box-shadow(inset 0px 0px 0px 1px #d8d8d8); background-color: #f6f6f6; } + &.valid { + .circle(@circle-radius * 2, #ffffff); + .box-shadow(inset 0px 0px 0px 2px #28bd6e); + .b_17; + } + &.selected { + .c_17; + background-color: #3b7b9b; + .box-shadow(none); + &:active {background-color: #336c88;} // Pressed + } +} + + + + + + diff --git a/catalog-ui/app/styles/dark-header.less b/catalog-ui/app/styles/dark-header.less new file mode 100644 index 0000000000..38b4175daa --- /dev/null +++ b/catalog-ui/app/styles/dark-header.less @@ -0,0 +1,51 @@ +.w-sdc-dark-header { + .c_11; + .bg_i; + height: 94px; + width: 100%; + display: flex; + align-items: center; + + .w-sdc-dark-header-logo { + .hand; + height: 92px; + width: 240px; + padding: 28px 28px 28px 60px; + .flex-fixed(240px); + + .w-sdc-dark-header-logo-icon { + display: inline-block; + margin-right: 8px; + vertical-align: -6px; + } + a.w-sdc-dark-header-logo-link { + .c_5; + text-decoration: none; + } + .w-sdc-dark-header-version{ + .c_16; + .opacity(0.6); + } + } + + .i-sdc-dark-header-caption { + min-width: 175px; + text-align: left; + cursor: default; + text-overflow: ellipsis; + overflow: hidden; + flex-grow: 10; + padding-left: 27px; + white-space: nowrap; + + .i-sdc-dark-header-caption-text { + + text-overflow: ellipsis; + overflow: hidden; + } + } + + .w-sdc-header-user-container { + .c_7; + } +} diff --git a/catalog-ui/app/styles/fonts.less b/catalog-ui/app/styles/fonts.less new file mode 100644 index 0000000000..752f41f86a --- /dev/null +++ b/catalog-ui/app/styles/fonts.less @@ -0,0 +1,72 @@ +//Omnes_ATT W02 Italic +@font-face { + font-family: omnes-italic; + src: url('fonts/OmnesATT/Omnes_ATTW02Italic.eot'); + src: url('fonts/OmnesATT/Omnes_ATTW02Italic.eot?#iefix') format('embedded-opentype'), + url('fonts/OmnesATT/Omnes_ATTW02Italic.ttf'); +} + +//Omnes_ATT W02 Light +@font-face { + font-family: omnes-light; + src: url('fonts/OmnesATT/Omnes_ATTW02Light.eot'); + src: url('fonts/OmnesATT/Omnes_ATTW02Light.eot?#iefix') format('embedded-opentype'), + url('fonts/OmnesATT/Omnes_ATTW02Light.ttf'); +} + +//Omnes_ATT W02 Light Italic +@font-face { + font-family: omnes-light-italic; + src: url('fonts/OmnesATT/Omnes_ATTW02LightItalic.eot'); + src: url('fonts/OmnesATT/Omnes_ATTW02LightItalic.eot?#iefix') format('embedded-opentype'), + url('fonts/OmnesATT/Omnes_ATTW02LightItalic.ttf'); +} + +//Omnes_ATT W02 Medium +@font-face { + font-family: omnes-medium; + src: url('fonts/OmnesATT/Omnes_ATTW02Medium.eot'); + src: url('fonts/OmnesATT/Omnes_ATTW02Medium.eot?#iefix') format('embedded-opentype'), + url('fonts/OmnesATT/Omnes_ATTW02Medium.ttf'); +} + +//Omnes_ATT W02 Medium Italic +@font-face { + font-family: omnes-medium-italic; + src: url('fonts/OmnesATT/Omnes_ATTW02MediumItalic.eot'); + src: url('fonts/OmnesATT/Omnes_ATTW02MediumItalic.eot?#iefix') format('embedded-opentype'), + url('fonts/OmnesATT/Omnes_ATTW02MediumItalic.ttf'); +} + +//Omnes_ATT W02 Regular +@font-face { + font-family: omnes-regular; + src: url('fonts/OmnesATT/Omnes_ATTW02.eot'); + src: url('fonts/OmnesATT/Omnes_ATTW02.eot?#iefix') format('embedded-opentype'), + url('fonts/OmnesATT/Omnes_ATTW02.ttf'); +} + +//Omnes_ATT W02 Bold +@font-face { + font-family: omnes-bold; + src: url('fonts/OmnesATT/Omnes_ATTW02Bold.eot'); + src: url('fonts/OmnesATT/Omnes_ATTW02Bold.eot?#iefix') format('embedded-opentype'), + url('fonts/OmnesATT/Omnes_ATTW02Bold.ttf'); +} + +//Omnes_ATT W02 Bold Italic +@font-face { + font-family: omnes-bold-italic; + src: url('fonts/OmnesATT/OmnesATTW02BoldItalic.eot'); + src: url('fonts/OmnesATT/OmnesATTW02BoldItalic.eot?#iefix') format('embedded-opentype'), + url('fonts/OmnesATT/OmnesATTW02BoldItalic.ttf'); +} + + +//ClearviewATT Book +@font-face { + font-family: clearview-book; + src: url('fonts/ClearviewATT/ClearviewATT-Bk.eot'); + src: url('fonts/ClearviewATT/ClearviewATT-Bk.eot?#iefix') format('embedded-opentype'), + url('fonts/ClearviewATT/ClearviewATT-Bk.ttf'); +} diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.eot b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.eot new file mode 100644 index 0000000000..83074fbe2b Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.eot differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.svg b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.svg new file mode 100644 index 0000000000..564f750d99 --- /dev/null +++ b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.svg @@ -0,0 +1,424 @@ + + + + +1.0 +ClearviewATT Bd +Monotype Imaging Inc. + +Fonts.com WebFonts +http://webfonts.fonts.com +Home of the Web fonts + + +http://webfonts.fonts.com/Legal + +Copyright (c) Terminal Design, Inc, 2005. All rights reserved. +Clearview is a trademark of Terminal Design, Inc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz AÁÀÂÄÅÃÆ CÇ DÐ EÉÈÊË I Í Ì Î Ï NÑ +OÓÒÔÖÕØŒ SŠ UÚÙÛÜ YÝŸ ZŽ Þ aáàâäåãæ cç dð eéèêë i ı í ì î ï nñ oóòôöõøœ sšß uúùûü yýÿ zž +þ 1234567890 ½ ¼ ¾ % ‰ $¢£¥ƒ€¤ † ‡ § ¶ # ^~µ +×± < = > ÷¬ !¡?¿ " & ' * ° . , : ; () [ \ ] {} / | +¦ _ ‚ „ … ‹› «» ‘ ’ “ ” • ­ - – — @ © ® ™ ªº ¹²³ ´ ` ˆ ˜ ¨ ¯ · ¸ + diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.ttf b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.ttf new file mode 100644 index 0000000000..7bfb9d5cc2 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.ttf differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.woff b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.woff new file mode 100644 index 0000000000..b1f00eeac9 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bd.woff differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.eot b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.eot new file mode 100644 index 0000000000..22646213e6 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.eot differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.svg b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.svg new file mode 100644 index 0000000000..0996bb5eec --- /dev/null +++ b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.svg @@ -0,0 +1,425 @@ + + + + +1.0 +ClearviewATT BdIt +Monotype Imaging Inc. + +Fonts.com WebFonts +http://webfonts.fonts.com +Home of the Web fonts + + +http://webfonts.fonts.com/Legal + +Copyright (c) Terminal Design, Inc, 2005. All rights reserved. +Clearview is a trademark of Terminal Design, Inc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz AÁÀÂÄÅÃÆ CÇ DÐ EÉÈÊË I Í Ì Î Ï NÑ +OÓÒÔÖÕØŒ SŠ UÚÙÛÜ YÝŸ ZŽ Þ aáàâäåãæ cç dð eéèêë i ı í ì î ï nñ oóòôöõøœ sšß uúùûü yýÿ zž +þ 1234567890 ½ ¼ ¾ % ‰ $¢£¥ƒ€¤ † ‡ § ¶ # ^~µ +×± < = > ÷¬ !¡?¿ " & ' * ° . , : ; () [ \ ] {} / | +¦ _ ‚ „ … ‹› «» ‘ ’ “ ” • ­ - – — @ © ® ™ ªº ¹²³ ´ ` ˆ ˜ ¨ ¯ · ¸ + diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.ttf b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.ttf new file mode 100644 index 0000000000..69b3c834e6 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.ttf differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.woff b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.woff new file mode 100644 index 0000000000..f2850a6f53 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BdIt.woff differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.eot b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.eot new file mode 100644 index 0000000000..a945fb3592 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.eot differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.svg b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.svg new file mode 100644 index 0000000000..279204943f --- /dev/null +++ b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.svg @@ -0,0 +1,425 @@ + + + + +1.0 +ClearviewATT Bk +Monotype Imaging Inc. + +Fonts.com WebFonts +http://webfonts.fonts.com +Home of the Web fonts + + +http://webfonts.fonts.com/Legal + +Copyright (c) Terminal Design, Inc, 2005. All rights reserved. +Clearview is a trademark of Terminal Design, Inc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz AÁÀÂÄÅÃÆ CÇ DÐ EÉÈÊË I Í Ì Î Ï NÑ +OÓÒÔÖÕØŒ SŠ UÚÙÛÜ YÝŸ ZŽ Þ aáàâäåãæ cç dð eéèêë i ı í ì î ï nñ oóòôöõøœ sšß uúùûü yýÿ zž +þ 1234567890 ½ ¼ ¾ % ‰ $¢£¥ƒ€¤ † ‡ § ¶ # ^~µ +×± < = > ÷¬ !¡?¿ " & ' * ° . , : ; () [ \ ] {} / | +¦ _ ‚ „ … ‹› «» ‘ ’ “ ” • ­ - – — @ © ® ™ ªº ¹²³ ´ ` ˆ ˜ ¨ ¯ · ¸ + diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.ttf b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.ttf new file mode 100644 index 0000000000..b4390461c6 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.ttf differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.woff b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.woff new file mode 100644 index 0000000000..5373567803 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Bk.woff differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.eot b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.eot new file mode 100644 index 0000000000..4ab6695752 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.eot differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.svg b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.svg new file mode 100644 index 0000000000..c2337a7f89 --- /dev/null +++ b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.svg @@ -0,0 +1,425 @@ + + + + +1.0 +ClearviewATT BkIt +Monotype Imaging Inc. + +Fonts.com WebFonts +http://webfonts.fonts.com +Home of the Web fonts + + +http://webfonts.fonts.com/Legal + +Copyright (c) Terminal Design, Inc, 2005. All rights reserved. +Clearview is a trademark of Terminal Design, Inc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz AÁÀÂÄÅÃÆ CÇ DÐ EÉÈÊË I Í Ì Î Ï NÑ +OÓÒÔÖÕØŒ SŠ UÚÙÛÜ YÝŸ ZŽ Þ aáàâäåãæ cç dð eéèêë i ı í ì î ï nñ oóòôöõøœ sšß uúùûü yýÿ zž +þ 1234567890 ½ ¼ ¾ % ‰ $¢£¥ƒ€¤ † ‡ § ¶ # ^~µ +×± < = > ÷¬ !¡?¿ " & ' * ° . , : ; () [ \ ] {} / | +¦ _ ‚ „ … ‹› «» ‘ ’ “ ” • ­ - – — @ © ® ™ ªº ¹²³ ´ ` ˆ ˜ ¨ ¯ · ¸ + diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.ttf b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.ttf new file mode 100644 index 0000000000..7e7aa05778 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.ttf differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.woff b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.woff new file mode 100644 index 0000000000..55fbfd6896 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-BkIt.woff differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.eot b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.eot new file mode 100644 index 0000000000..06a4bf9949 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.eot differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.svg b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.svg new file mode 100644 index 0000000000..40656e14f8 --- /dev/null +++ b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.svg @@ -0,0 +1,425 @@ + + + + +1.0 +ClearviewATT Lt +Monotype Imaging Inc. + +Fonts.com WebFonts +http://webfonts.fonts.com +Home of the Web fonts + + +http://webfonts.fonts.com/Legal + +Copyright (c) Terminal Design, Inc, 2005. All rights reserved. +Clearview is a trademark of Terminal Design, Inc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz AÁÀÂÄÅÃÆ CÇ DÐ EÉÈÊË I Í Ì Î Ï NÑ +OÓÒÔÖÕØŒ SŠ UÚÙÛÜ YÝŸ ZŽ Þ aáàâäåãæ cç dð eéèêë i ı í ì î ï nñ oóòôöõøœ sšß uúùûü yýÿ zž +þ 1234567890 ½ ¼ ¾ % ‰ $¢£¥ƒ€¤ † ‡ § ¶ # ^~µ +×± < = > ÷¬ !¡?¿ " & ' * ° . , : ; () [ \ ] {} / | +¦ _ ‚ „ … ‹› «» ‘ ’ “ ” • ­ - – — @ © ® ™ ªº ¹²³ ´ ` ˆ ˜ ¨ ¯ · ¸ + diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.ttf b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.ttf new file mode 100644 index 0000000000..c9a45c0e51 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.ttf differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.woff b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.woff new file mode 100644 index 0000000000..521ee2e918 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-Lt.woff differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.eot b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.eot new file mode 100644 index 0000000000..06772919e7 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.eot differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.svg b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.svg new file mode 100644 index 0000000000..bff63e5524 --- /dev/null +++ b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.svg @@ -0,0 +1,424 @@ + + + + +1.0 +ClearviewATT LtIt +Monotype Imaging Inc. + +Fonts.com WebFonts +http://webfonts.fonts.com +Home of the Web fonts + + +http://webfonts.fonts.com/Legal + +Copyright (c) Terminal Design, Inc, 2005. All rights reserved. +Clearview is a trademark of Terminal Design, Inc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz AÁÀÂÄÅÃÆ CÇ DÐ EÉÈÊË I Í Ì Î Ï NÑ +OÓÒÔÖÕØŒ SŠ UÚÙÛÜ YÝŸ ZŽ Þ aáàâäåãæ cç dð eéèêë i ı í ì î ï nñ oóòôöõøœ sšß uúùûü yýÿ zž +þ 1234567890 ½ ¼ ¾ % ‰ $¢£¥ƒ€¤ † ‡ § ¶ # ^~µ +×± < = > ÷¬ !¡?¿ " & ' * ° . , : ; () [ \ ] {} / | +¦ _ ‚ „ … ‹› «» ‘ ’ “ ” • ­ - – — @ © ® ™ ªº ¹²³ ´ ` ˆ ˜ ¨ ¯ · ¸ + diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.ttf b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.ttf new file mode 100644 index 0000000000..bd7ac47137 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.ttf differ diff --git a/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.woff b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.woff new file mode 100644 index 0000000000..7f8a274165 Binary files /dev/null and b/catalog-ui/app/styles/fonts/ClearviewATT/ClearviewATT-LtIt.woff differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/AT&T Variation ID.tab b/catalog-ui/app/styles/fonts/OmnesATT/AT&T Variation ID.tab new file mode 100644 index 0000000000..e0085fd9ac --- /dev/null +++ b/catalog-ui/app/styles/fonts/OmnesATT/AT&T Variation ID.tab @@ -0,0 +1,9 @@ + Variation ID tier +602 24875 1243116 Omnes_ATT W02 Italic 1243117 38 CUS24875W02 +602 24872 1243119 Omnes_ATT W02 Light 1243120 38 CUS24872W02 +602 24873 1243122 Omnes_ATT W02 Light Italic 1243123 38 CUS24873W02 +602 24876 1243125 Omnes_ATT W02 Medium 1243126 38 CUS24876W02 +602 24877 1243128 Omnes_ATT W02 Medium Italic 1243129 38 CUS24877W02 +602 24874 1243131 Omnes_ATT W02 Regular 1243132 38 CUS24874W02 +602 26730 1418220 Omnes_ATT W02 Bold 1418221 38 CUS26730W02 +602 26731 1418223 Omnes_ATT W02 Bold Italic 1418224 38 CUS26731W02 diff --git a/catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.eot b/catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.eot new file mode 100644 index 0000000000..da1c1d1ebe Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.eot differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.svg b/catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.svg new file mode 100644 index 0000000000..916075aa05 --- /dev/null +++ b/catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.svg @@ -0,0 +1,3671 @@ + + + + +1.0 +Omnes_ATT W02 Bold Italic +Monotype Imaging Inc. + +Fonts.com WebFonts +http://webfonts.fonts.com +Home of the Web fonts + + +http://webfonts.fonts.com/Legal + +Generated in 2010 by FontLab Studio. Copyright info pending. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz AÁÀÂÄÅÃÆ CÇ DÐ EÉÈÊË I Í Ì Î Ï NÑ +OÓÒÔÖÕØŒ SŠ UÚÙÛÜ YÝŸ ZŽ Þ aáàâäåãæ cç dð eéèêë i ı í ì î ï nñ oóòôöõøœ sšß uúùûü yýÿ zž +þ 1234567890 ½ ¼ ¾ % ‰ $¢£¥ƒ€¤ † ‡ § ¶ # ^~µ +×± < = > ÷¬ !¡?¿ " & ' * ° . , : ; () [ \ ] {} / | +¦ _ ‚ „ … ‹› «» ‘ ’ “ ” • ­ - – — @ © ® ™ ªº ¹²³ ´ ` ˆ ˜ ¨ ¯ · ¸ + diff --git a/catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.ttf b/catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.ttf new file mode 100644 index 0000000000..4f35e1f9b8 Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.ttf differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.woff b/catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.woff new file mode 100644 index 0000000000..1722dce99e Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/OmnesATTW02BoldItalic.woff differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.eot b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.eot new file mode 100644 index 0000000000..39e1eae7c7 Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.eot differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.svg b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.svg new file mode 100644 index 0000000000..73923de097 --- /dev/null +++ b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.svg @@ -0,0 +1,3694 @@ + + + + +1.0 +Omnes_ATT W02 +Monotype Imaging Inc. + +Fonts.com WebFonts +http://webfonts.fonts.com +Home of the Web fonts + + +http://webfonts.fonts.com/Legal + +Generated by RoboFog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz AÁÀÂÄÅÃÆ CÇ DÐ EÉÈÊË I Í Ì Î Ï NÑ +OÓÒÔÖÕØŒ SŠ UÚÙÛÜ YÝŸ ZŽ Þ aáàâäåãæ cç dð eéèêë i ı í ì î ï nñ oóòôöõøœ sšß uúùûü yýÿ zž +þ 1234567890 ½ ¼ ¾ % ‰ $¢£¥ƒ€¤ † ‡ § ¶ # ^~µ +×± < = > ÷¬ !¡?¿ " & ' * ° . , : ; () [ \ ] {} / | +¦ _ ‚ „ … ‹› «» ‘ ’ “ ” • ­ - – — @ © ® ™ ªº ¹²³ ´ ` ˆ ˜ ¨ ¯ · ¸ + diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.ttf b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.ttf new file mode 100644 index 0000000000..2342be4be5 Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.ttf differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.woff b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.woff new file mode 100644 index 0000000000..0acf1f027f Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02.woff differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.eot b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.eot new file mode 100644 index 0000000000..0e5892d1e0 Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.eot differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.svg b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.svg new file mode 100644 index 0000000000..9670981b29 --- /dev/null +++ b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.svg @@ -0,0 +1,4365 @@ + + + + +1.0 +Omnes_ATT W02 Bold +Monotype Imaging Inc. + +Fonts.com WebFonts +http://webfonts.fonts.com +Home of the Web fonts + + +http://webfonts.fonts.com/Legal + +Generated in 2010 by FontLab Studio. Copyright info pending. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz AÁÀÂÄÅÃÆ CÇ DÐ EÉÈÊË I Í Ì Î Ï NÑ +OÓÒÔÖÕØŒ SŠ UÚÙÛÜ YÝŸ ZŽ Þ aáàâäåãæ cç dð eéèêë i ı í ì î ï nñ oóòôöõøœ sšß uúùûü yýÿ zž +þ 1234567890 ½ ¼ ¾ % ‰ $¢£¥ƒ€¤ † ‡ § ¶ # ^~µ +×± < = > ÷¬ !¡?¿ " & ' * ° . , : ; () [ \ ] {} / | +¦ _ ‚ „ … ‹› «» ‘ ’ “ ” • ­ - – — @ © ® ™ ªº ¹²³ ´ ` ˆ ˜ ¨ ¯ · ¸ + diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.ttf b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.ttf new file mode 100644 index 0000000000..94934087bb Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.ttf differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.woff b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.woff new file mode 100644 index 0000000000..1dfd28f299 Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Bold.woff differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.eot b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.eot new file mode 100644 index 0000000000..8723e66fa0 Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.eot differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.svg b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.svg new file mode 100644 index 0000000000..dbf33a9768 --- /dev/null +++ b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.svg @@ -0,0 +1,3799 @@ + + + + +1.0 +Omnes_ATT W02 Italic +Monotype Imaging Inc. + +Fonts.com WebFonts +http://webfonts.fonts.com +Home of the Web fonts + + +http://webfonts.fonts.com/Legal + +Generated by RoboFog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz AÁÀÂÄÅÃÆ CÇ DÐ EÉÈÊË I Í Ì Î Ï NÑ +OÓÒÔÖÕØŒ SŠ UÚÙÛÜ YÝŸ ZŽ Þ aáàâäåãæ cç dð eéèêë i ı í ì î ï nñ oóòôöõøœ sšß uúùûü yýÿ zž +þ 1234567890 ½ ¼ ¾ % ‰ $¢£¥ƒ€¤ † ‡ § ¶ # ^~µ +×± < = > ÷¬ !¡?¿ " & ' * ° . , : ; () [ \ ] {} / | +¦ _ ‚ „ … ‹› «» ‘ ’ “ ” • ­ - – — @ © ® ™ ªº ¹²³ ´ ` ˆ ˜ ¨ ¯ · ¸ + diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.ttf b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.ttf new file mode 100644 index 0000000000..4ef76763bd Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.ttf differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.woff b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.woff new file mode 100644 index 0000000000..750d90d387 Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Italic.woff differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.eot b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.eot new file mode 100644 index 0000000000..280d111fe4 Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.eot differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.svg b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.svg new file mode 100644 index 0000000000..85f39f5008 --- /dev/null +++ b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.svg @@ -0,0 +1,3872 @@ + + + + +1.0 +Omnes_ATT W02 Light +Monotype Imaging Inc. + +Fonts.com WebFonts +http://webfonts.fonts.com +Home of the Web fonts + + +http://webfonts.fonts.com/Legal + +Generated in 2010 by FontLab Studio. Copyright info pending. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz AÁÀÂÄÅÃÆ CÇ DÐ EÉÈÊË I Í Ì Î Ï NÑ +OÓÒÔÖÕØŒ SŠ UÚÙÛÜ YÝŸ ZŽ Þ aáàâäåãæ cç dð eéèêë i ı í ì î ï nñ oóòôöõøœ sšß uúùûü yýÿ zž +þ 1234567890 ½ ¼ ¾ % ‰ $¢£¥ƒ€¤ † ‡ § ¶ # ^~µ +×± < = > ÷¬ !¡?¿ " & ' * ° . , : ; () [ \ ] {} / | +¦ _ ‚ „ … ‹› «» ‘ ’ “ ” • ­ - – — @ © ® ™ ªº ¹²³ ´ ` ˆ ˜ ¨ ¯ · ¸ + diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.ttf b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.ttf new file mode 100644 index 0000000000..273761ab3d Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.ttf differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.woff b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.woff new file mode 100644 index 0000000000..b12120a86e Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Light.woff differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.eot b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.eot new file mode 100644 index 0000000000..2da6a99ec6 Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.eot differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.svg b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.svg new file mode 100644 index 0000000000..ab6936ceeb --- /dev/null +++ b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.svg @@ -0,0 +1,3030 @@ + + + + +1.0 +Omnes_ATT W02 Light Italic +Monotype Imaging Inc. + +Fonts.com WebFonts +http://webfonts.fonts.com +Home of the Web fonts + + +http://webfonts.fonts.com/Legal + +Generated in 2010 by FontLab Studio. Copyright info pending. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz AÁÀÂÄÅÃÆ CÇ DÐ EÉÈÊË I Í Ì Î Ï NÑ +OÓÒÔÖÕØŒ SŠ UÚÙÛÜ YÝŸ ZŽ Þ aáàâäåãæ cç dð eéèêë i ı í ì î ï nñ oóòôöõøœ sšß uúùûü yýÿ zž +þ 1234567890 ½ ¼ ¾ % ‰ $¢£¥ƒ€¤ † ‡ § ¶ # ^~µ +×± < = > ÷¬ !¡?¿ " & ' * ° . , : ; () [ \ ] {} / | +¦ _ ‚ „ … ‹› «» ‘ ’ “ ” • ­ - – — @ © ® ™ ªº ¹²³ ´ ` ˆ ˜ ¨ ¯ · ¸ + diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.ttf b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.ttf new file mode 100644 index 0000000000..5153cee682 Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.ttf differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.woff b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.woff new file mode 100644 index 0000000000..cf9993a1d6 Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02LightItalic.woff differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.eot b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.eot new file mode 100644 index 0000000000..37c715f5be Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.eot differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.svg b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.svg new file mode 100644 index 0000000000..ad72d0be51 --- /dev/null +++ b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.svg @@ -0,0 +1,2473 @@ + + + + +1.0 +Omnes_ATT W02 Medium +Monotype Imaging Inc. + +Fonts.com WebFonts +http://webfonts.fonts.com +Home of the Web fonts + + +http://webfonts.fonts.com/Legal + +Generated in 2010 by FontLab Studio. Copyright info pending. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz AÁÀÂÄÅÃÆ CÇ DÐ EÉÈÊË I Í Ì Î Ï NÑ +OÓÒÔÖÕØŒ SŠ UÚÙÛÜ YÝŸ ZŽ Þ aáàâäåãæ cç dð eéèêë i ı í ì î ï nñ oóòôöõøœ sšß uúùûü yýÿ zž +þ 1234567890 ½ ¼ ¾ % ‰ $¢£¥ƒ€¤ † ‡ § ¶ # ^~µ +×± < = > ÷¬ !¡?¿ " & ' * ° . , : ; () [ \ ] {} / | +¦ _ ‚ „ … ‹› «» ‘ ’ “ ” • ­ - – — @ © ® ™ ªº ¹²³ ´ ` ˆ ˜ ¨ ¯ · ¸ + diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.ttf b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.ttf new file mode 100644 index 0000000000..2740425412 Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.ttf differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.woff b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.woff new file mode 100644 index 0000000000..5cff69add1 Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02Medium.woff differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.eot b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.eot new file mode 100644 index 0000000000..84ba4acc6b Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.eot differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.svg b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.svg new file mode 100644 index 0000000000..eca8f73836 --- /dev/null +++ b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.svg @@ -0,0 +1,3837 @@ + + + + +1.0 +Omnes_ATT W02 Medium Italic +Monotype Imaging Inc. + +Fonts.com WebFonts +http://webfonts.fonts.com +Home of the Web fonts + + +http://webfonts.fonts.com/Legal + +Generated in 2010 by FontLab Studio. Copyright info pending. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz AÁÀÂÄÅÃÆ CÇ DÐ EÉÈÊË I Í Ì Î Ï NÑ +OÓÒÔÖÕØŒ SŠ UÚÙÛÜ YÝŸ ZŽ Þ aáàâäåãæ cç dð eéèêë i ı í ì î ï nñ oóòôöõøœ sšß uúùûü yýÿ zž +þ 1234567890 ½ ¼ ¾ % ‰ $¢£¥ƒ€¤ † ‡ § ¶ # ^~µ +×± < = > ÷¬ !¡?¿ " & ' * ° . , : ; () [ \ ] {} / | +¦ _ ‚ „ … ‹› «» ‘ ’ “ ” • ­ - – — @ © ® ™ ªº ¹²³ ´ ` ˆ ˜ ¨ ¯ · ¸ + diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.ttf b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.ttf new file mode 100644 index 0000000000..46bfd531b0 Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.ttf differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.woff b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.woff new file mode 100644 index 0000000000..20419ed3b3 Binary files /dev/null and b/catalog-ui/app/styles/fonts/OmnesATT/Omnes_ATTW02MediumItalic.woff differ diff --git a/catalog-ui/app/styles/fonts/OmnesATT/demo-async.htm b/catalog-ui/app/styles/fonts/OmnesATT/demo-async.htm new file mode 100644 index 0000000000..f7a43e6a34 --- /dev/null +++ b/catalog-ui/app/styles/fonts/OmnesATT/demo-async.htm @@ -0,0 +1,169 @@ + + + + Webfonts Demo + + + + + + +
        +

        Fonts.com Web fonts

        +

        @font-face implementation instructions

        +

        The asynchronous script loads in the background allowing the other elements of your website to load first and undeterred.

        +
        +

        The fonts contained in this kit are:

        +
        +
        Omnes_ATT W02 Italic
        +
        Omnes_ATT W02 Light
        +
        Omnes_ATT W02 Light Italic
        +
        Omnes_ATT W02 Medium
        +
        Omnes_ATT W02 Medium Italic
        +
        Omnes_ATT W02 Regular
        +
        Omnes_ATT W02 Bold
        +
        Omnes_ATT W02 Bold Italic
        + +
        +
        + Click here for css only web fonts implementation +
        +
        +

        CSS Implementation Guidelines

        +

        You and any third party web font hosting service are responsible for ensuring that the font software in the self-hosting kit, in its original format, can only be used on the Web Sites for which the self-hosting kit was downloaded and cannot be used or referenced by any other web site. This includes, but is not limited to installing adequate technical protection measures that restrict the use and/or access to the font software, for instance by utilizing JavaScript or access control mechanism for cross-origin resource sharing and protecting against use on web sites other than the Web Sites for which the self-hosting kit was downloaded by restricting domain access only to such Web Sites. You must also retain the pageview tracking code on any Web Site that you self-host. In the event this Agreement terminates for any reason, the font software included with the self-hosting kit must be deleted from the server and all copies must be destroyed or returned to Monotype Imaging.

        +

        View "WEB FONT SOFTWARE" LICENSE AGREEMENT

        +

        Asynchronous Implementation (Requires JavaScript)

        +

        Font file names have been obfuscated to protect the font software. You can identify font format based on file ending:

        +
          +
        • 1 - TrueType (ttf)
        • +
        • 2 - Embedded OpenType (eot)
        • +
        • 3 - Web Open Font Format (woff)
        • +
        • 4 - Scalable Vector Graphics (svg)
        • +
        +

        Copy and paste following code in head section of the page

        +
        + +

        Licensing information should be included within the CSS

        +
        /*
        +This CSS resource incorporates links to font software which is the valuable copyrighted
        +property of Monotype Imaging and/or its suppliers. You may not attempt to copy, install,
        +redistribute, convert, modify or reverse engineer this font software. Please contact Monotype
        +Imaging with any questions regarding Web Fonts:  http://webfonts.fonts.com
        +*/
        +
        +
        + + diff --git a/catalog-ui/app/styles/fonts/OmnesATT/demo.htm b/catalog-ui/app/styles/fonts/OmnesATT/demo.htm new file mode 100644 index 0000000000..edb62ad34a --- /dev/null +++ b/catalog-ui/app/styles/fonts/OmnesATT/demo.htm @@ -0,0 +1,155 @@ + + + + Webfonts Demo + + + + + +
        +

        Fonts.com Web fonts

        +

        @font-face implementation instructions

        +
        +

        The fonts contained in this kit are:

        +
        +
        Omnes_ATT W02 Italic
        +
        Omnes_ATT W02 Light
        +
        Omnes_ATT W02 Light Italic
        +
        Omnes_ATT W02 Medium
        +
        Omnes_ATT W02 Medium Italic
        +
        Omnes_ATT W02 Regular
        +
        Omnes_ATT W02 Bold
        +
        Omnes_ATT W02 Bold Italic
        + +
        +
        + Click here for asynchronous web fonts implementation +
        +
        +

        CSS Implementation Guidelines

        +

        You and any third party web font hosting service are responsible for ensuring that the font software in the self-hosting kit, in its original format, can only be used on the Web Sites for which the self-hosting kit was downloaded and cannot be used or referenced by any other web site. This includes, but is not limited to installing adequate technical protection measures that restrict the use and/or access to the font software, for instance by utilizing JavaScript or access control mechanism for cross-origin resource sharing and protecting against use on web sites other than the Web Sites for which the self-hosting kit was downloaded by restricting domain access only to such Web Sites. You must also retain the pageview tracking code on any Web Site that you self-host. In the event this Agreement terminates for any reason, the font software included with the self-hosting kit must be deleted from the server and all copies must be destroyed or returned to Monotype Imaging.

        +

        View "WEB FONT SOFTWARE" LICENSE AGREEMENT

        +

        Font file names have been obfuscated to protect the font software. You can identify font format based on file ending:

        +
          +
        • 1 - TrueType (ttf)
        • +
        • 2 - Embedded OpenType (eot)
        • +
        • 3 - Web Open Font Format (woff)
        • +
        • 4 - Scalable Vector Graphics (svg)
        • +
        +

        Copy and paste following code in head section of the page

        +
        + +

        Licensing information should be included within the CSS

        +
        /*
        +This CSS resource incorporates links to font software which is the valuable copyrighted
        +property of Monotype Imaging and/or its suppliers. You may not attempt to copy, install,
        +redistribute, convert, modify or reverse engineer this font software. Please contact Monotype
        +Imaging with any questions regarding Web Fonts:  http://webfonts.fonts.com
        +*/
        +
        +
        + + diff --git a/catalog-ui/app/styles/form-elements.less b/catalog-ui/app/styles/form-elements.less new file mode 100644 index 0000000000..9f8146d3f5 --- /dev/null +++ b/catalog-ui/app/styles/form-elements.less @@ -0,0 +1,199 @@ +// --------------------------------------------------------------------------------------------------- +// Form +// --------------------------------------------------------------------------------------------------- +.w-sdc-form { + padding: 0; + + .w-sdc-form-actions-container { + margin: 20px auto; // -10px; + width: 100%; // 320px; + } + + .w-sdc-form-columns-wrapper { + + display: flex; + justify-content: space-between; + + .w-sdc-form-column { + width: 100%; + margin: 0; + padding: 0 6% 0 0; + text-align: left; + + &:last-child { + padding: 0; + } + } + + } + + .i-sdc-form-item { + margin-bottom: 10px; + position: relative; + text-align: left; + + &.error { + input[type="text"], + input[type="url"], + input[type="number"], + input[type="password"], + select, + textarea { + .h_1; + border-color: @main_color_g; + outline: none; + box-sizing: border-box; + + &:hover { + .h_1; + border-color: @main_color_g; + } + } + label { + .m_14_m; + } + } + + label { + .m_14_m; + margin: 0 0 2px 0; + padding: 0; + display: block; + + &.required::before { + color: #f33; + content: '*'; + margin: 0 4px 0 0; + } + } + + input[type="text"], + input[type="url"], + input[type="number"], + input[type="password"], + select, + textarea { + .m_14_r; + background-color: @main_color_p; + .border-radius(2px); + margin: 0; + padding: 0; + border: solid 1px @main_color_o; + height: 30px; + width: 100%; + display: block; + + &::-webkit-input-placeholder { font-style: italic; } /* Safari, Chrome and Opera */ + &:-moz-placeholder { font-style: italic; } /* Firefox 18- */ + &::-moz-placeholder { font-style: italic; } /* Firefox 19+ */ + &:-ms-input-placeholder { font-style: italic; } /* IE 10+ */ + &:-ms-input-placeholder { font-style: italic; } /* Edge */ + + &:disabled { + opacity: 0.4; + } + &.view-mode { + opacity: 1; + border: solid 1px @main_color_o; + background-color: #f8f8f8 !important; + pointer-events: none; + cursor: auto; + } + + } + + input[type="text"], + input[type="url"], + input[type="number"], + input[type="password"] { padding: 4px 10px;} + select { padding: 4px 7px;} + textarea { padding: 6px 10px;} + + select { + optgroup { + color: @color_a; + option { + color: @color_b; + } + + } + } + + textarea { + min-height: 110px; + resize: none; + } + + } + + .i-sdc-form-item-error-icon { + .sprite; + .exclamation-mark-red-icon; + width: 13px; + height: 11px; + position: absolute; + + .i-sdc-form-item-error-message { + .bg_h; + .c_3; + cursor: default; + position: absolute; + top: -10px; + left: -8px; + height: 30px; + padding: 6px 10px 6px 30px; + z-index: 999; + text-align: left; + .border-radius-top-right(4px); + .border-radius-bottom-right(4px); + .box-shadow(0px 1px 1px 0px rgba(24, 24, 25, 0.43)); + + &:before { + .arrow(5px, @color_h); + } + + span { + white-space: nowrap; + } + + span.error { + .sprite; + .exclamation-mark-red-icon; + position: absolute; + top: 9px; + left: 8px; + } + + span.ok { + .c_3; + .hand; + position: absolute; + right: 10px; + text-decoration: underline; + } + + .i-sdc-form-item-error-icon-open { + .sprite; + .exclamation-mark-white-icon; + width: 13px; + height: 11px; + position: absolute; + top: 9px; + left: 8px; + } + + } + + } + + .input-error { + .q_12_m; + text-align: left; + } + + .input-error-file-upload { + .input-error; + margin-top: -10px; + margin-bottom: 10px; + } +} diff --git a/catalog-ui/app/styles/global.less b/catalog-ui/app/styles/global.less new file mode 100644 index 0000000000..9faf4aeb0e --- /dev/null +++ b/catalog-ui/app/styles/global.less @@ -0,0 +1,52 @@ +html { + height: 100%; +} + +body { + .b_7; + height: 100%; + margin: auto; + position: relative; +} + +* { + box-sizing: border-box; + margin: 0; +} + +html, body { + height: 100%; + overflow: hidden; +} + +a { + text-decoration: none; +} + +canvas { + outline: none; +} + +.download-artifact { + .hand; +} + +// --------------------------------------------------------------------------------------------------- +// bootstrap overrides +// --------------------------------------------------------------------------------------------------- +html { + + .w-sdc-resource-container { + padding: 20px 0; + } + + // Hover on notification should keep it with opacity 1. + .ui-notification { + &.clickable { + &:hover { + opacity: 1; + } + } + } + +} diff --git a/catalog-ui/app/styles/images/anonymous.jpg b/catalog-ui/app/styles/images/anonymous.jpg new file mode 100644 index 0000000000..863af35321 Binary files /dev/null and b/catalog-ui/app/styles/images/anonymous.jpg differ diff --git a/catalog-ui/app/styles/images/att_logo_white.png b/catalog-ui/app/styles/images/att_logo_white.png new file mode 100644 index 0000000000..6321b7582d Binary files /dev/null and b/catalog-ui/app/styles/images/att_logo_white.png differ diff --git a/catalog-ui/app/styles/images/relationship-icons/AttachesTo.svg b/catalog-ui/app/styles/images/relationship-icons/AttachesTo.svg new file mode 100644 index 0000000000..68b57a08c8 --- /dev/null +++ b/catalog-ui/app/styles/images/relationship-icons/AttachesTo.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/catalog-ui/app/styles/images/relationship-icons/BindsTo.svg b/catalog-ui/app/styles/images/relationship-icons/BindsTo.svg new file mode 100644 index 0000000000..ae5647dda9 --- /dev/null +++ b/catalog-ui/app/styles/images/relationship-icons/BindsTo.svg @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/catalog-ui/app/styles/images/relationship-icons/ConnectedTo.svg b/catalog-ui/app/styles/images/relationship-icons/ConnectedTo.svg new file mode 100644 index 0000000000..4ee7672305 --- /dev/null +++ b/catalog-ui/app/styles/images/relationship-icons/ConnectedTo.svg @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/catalog-ui/app/styles/images/relationship-icons/DependsOn.svg b/catalog-ui/app/styles/images/relationship-icons/DependsOn.svg new file mode 100644 index 0000000000..e38808e2df --- /dev/null +++ b/catalog-ui/app/styles/images/relationship-icons/DependsOn.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/catalog-ui/app/styles/images/relationship-icons/HostedOn.svg b/catalog-ui/app/styles/images/relationship-icons/HostedOn.svg new file mode 100644 index 0000000000..5daf84a334 --- /dev/null +++ b/catalog-ui/app/styles/images/relationship-icons/HostedOn.svg @@ -0,0 +1,25 @@ + + + + + + + + + + diff --git a/catalog-ui/app/styles/images/relationship-icons/LinksTo.svg b/catalog-ui/app/styles/images/relationship-icons/LinksTo.svg new file mode 100644 index 0000000000..fb4c687774 --- /dev/null +++ b/catalog-ui/app/styles/images/relationship-icons/LinksTo.svg @@ -0,0 +1,22 @@ + + + + + + + + + + diff --git a/catalog-ui/app/styles/images/relationship-icons/RoutesTo.svg b/catalog-ui/app/styles/images/relationship-icons/RoutesTo.svg new file mode 100644 index 0000000000..4c3caf5886 --- /dev/null +++ b/catalog-ui/app/styles/images/relationship-icons/RoutesTo.svg @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/catalog-ui/app/styles/images/relationship-icons/arrow.png b/catalog-ui/app/styles/images/relationship-icons/arrow.png new file mode 100644 index 0000000000..d7c0ec8a86 Binary files /dev/null and b/catalog-ui/app/styles/images/relationship-icons/arrow.png differ diff --git a/catalog-ui/app/styles/images/relationship-icons/arrow.svg b/catalog-ui/app/styles/images/relationship-icons/arrow.svg new file mode 100644 index 0000000000..4696e50d57 --- /dev/null +++ b/catalog-ui/app/styles/images/relationship-icons/arrow.svg @@ -0,0 +1,11 @@ + + + + + + diff --git a/catalog-ui/app/styles/images/relationship-icons/arrow_connection_right.svg b/catalog-ui/app/styles/images/relationship-icons/arrow_connection_right.svg new file mode 100644 index 0000000000..ea2d9f258d --- /dev/null +++ b/catalog-ui/app/styles/images/relationship-icons/arrow_connection_right.svg @@ -0,0 +1,11 @@ + + + + + + diff --git a/catalog-ui/app/styles/images/relationship-icons/attach.png b/catalog-ui/app/styles/images/relationship-icons/attach.png new file mode 100644 index 0000000000..f01ebd86ca Binary files /dev/null and b/catalog-ui/app/styles/images/relationship-icons/attach.png differ diff --git a/catalog-ui/app/styles/images/relationship-icons/binding.png b/catalog-ui/app/styles/images/relationship-icons/binding.png new file mode 100644 index 0000000000..15307d8267 Binary files /dev/null and b/catalog-ui/app/styles/images/relationship-icons/binding.png differ diff --git a/catalog-ui/app/styles/images/relationship-icons/conected.png b/catalog-ui/app/styles/images/relationship-icons/conected.png new file mode 100644 index 0000000000..1243146c3f Binary files /dev/null and b/catalog-ui/app/styles/images/relationship-icons/conected.png differ diff --git a/catalog-ui/app/styles/images/relationship-icons/conected.svg b/catalog-ui/app/styles/images/relationship-icons/conected.svg new file mode 100644 index 0000000000..4ee7672305 --- /dev/null +++ b/catalog-ui/app/styles/images/relationship-icons/conected.svg @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/catalog-ui/app/styles/images/relationship-icons/dependency.png b/catalog-ui/app/styles/images/relationship-icons/dependency.png new file mode 100644 index 0000000000..1bfd3e41c6 Binary files /dev/null and b/catalog-ui/app/styles/images/relationship-icons/dependency.png differ diff --git a/catalog-ui/app/styles/images/relationship-icons/host.png b/catalog-ui/app/styles/images/relationship-icons/host.png new file mode 100644 index 0000000000..cf314d1d4a Binary files /dev/null and b/catalog-ui/app/styles/images/relationship-icons/host.png differ diff --git a/catalog-ui/app/styles/images/relationship-icons/link.png b/catalog-ui/app/styles/images/relationship-icons/link.png new file mode 100644 index 0000000000..9b81a4de57 Binary files /dev/null and b/catalog-ui/app/styles/images/relationship-icons/link.png differ diff --git a/catalog-ui/app/styles/images/relationship-icons/local_storage.png b/catalog-ui/app/styles/images/relationship-icons/local_storage.png new file mode 100644 index 0000000000..f01ebd86ca Binary files /dev/null and b/catalog-ui/app/styles/images/relationship-icons/local_storage.png differ diff --git a/catalog-ui/app/styles/images/relationship-icons/local_storage.svg b/catalog-ui/app/styles/images/relationship-icons/local_storage.svg new file mode 100644 index 0000000000..e255a4f058 --- /dev/null +++ b/catalog-ui/app/styles/images/relationship-icons/local_storage.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/catalog-ui/app/styles/images/relationship-icons/rout.png b/catalog-ui/app/styles/images/relationship-icons/rout.png new file mode 100644 index 0000000000..6a3aefac44 Binary files /dev/null and b/catalog-ui/app/styles/images/relationship-icons/rout.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Red_PLUS_HOVER.png b/catalog-ui/app/styles/images/resource-icons/Red_PLUS_HOVER.png new file mode 100644 index 0000000000..eb623b0204 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Red_PLUS_HOVER.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_COLLABORATION-.png b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_COLLABORATION-.png new file mode 100644 index 0000000000..b0de76e4eb Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_COLLABORATION-.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_COMPUTE-AS-SERVICE-.png b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_COMPUTE-AS-SERVICE-.png new file mode 100644 index 0000000000..ec2723b766 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_COMPUTE-AS-SERVICE-.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_MESSAGING-.png b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_MESSAGING-.png new file mode 100644 index 0000000000..e745e20604 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_MESSAGING-.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_MOBILITY.png b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_MOBILITY.png new file mode 100644 index 0000000000..4993ffe1f5 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_MOBILITY.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-.png b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-.png new file mode 100644 index 0000000000..fb7a2518c2 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-CLOUD-.png b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-CLOUD-.png new file mode 100644 index 0000000000..a06093726a Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-CLOUD-.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-L-1-3.png b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-L-1-3.png new file mode 100644 index 0000000000..a9f876afd9 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-L-1-3.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-L-4.png b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-L-4.png new file mode 100644 index 0000000000..e1023e743b Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NETWORK-L-4.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NOTIFICATION-.png b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NOTIFICATION-.png new file mode 100644 index 0000000000..dfa21d6d34 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_NOTIFICATION-.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_ORPHAN.png b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_ORPHAN.png new file mode 100644 index 0000000000..91619e0ae8 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_ORPHAN.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_PLATFORM-AS-SERVICE-.png b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_PLATFORM-AS-SERVICE-.png new file mode 100644 index 0000000000..8c763391e6 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_PLATFORM-AS-SERVICE-.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_SECURITY-.png b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_SECURITY-.png new file mode 100644 index 0000000000..c015ffe569 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_SECURITY-.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_SETTING-.png b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_SETTING-.png new file mode 100644 index 0000000000..b9db3ced5a Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_SETTING-.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_avater.png b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_avater.png new file mode 100644 index 0000000000..209e6e7e34 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_NB_avater.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/Resource_Icons_STORAGE-AS-SERVICE.png b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_STORAGE-AS-SERVICE.png new file mode 100644 index 0000000000..86111d0842 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/Resource_Icons_STORAGE-AS-SERVICE.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/alcatelLucent.png b/catalog-ui/app/styles/images/resource-icons/alcatelLucent.png new file mode 100644 index 0000000000..259096fea4 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/alcatelLucent.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/applicationServer.png b/catalog-ui/app/styles/images/resource-icons/applicationServer.png new file mode 100644 index 0000000000..f50b392249 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/applicationServer.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/aricent.png b/catalog-ui/app/styles/images/resource-icons/aricent.png new file mode 100644 index 0000000000..6cc36f679f Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/aricent.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/att.png b/catalog-ui/app/styles/images/resource-icons/att.png new file mode 100644 index 0000000000..80a814a34f Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/att.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/borderElement.png b/catalog-ui/app/styles/images/resource-icons/borderElement.png new file mode 100644 index 0000000000..b3525c2e55 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/borderElement.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/broadsoft.png b/catalog-ui/app/styles/images/resource-icons/broadsoft.png new file mode 100644 index 0000000000..2539d30d57 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/broadsoft.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/brocade.png b/catalog-ui/app/styles/images/resource-icons/brocade.png new file mode 100644 index 0000000000..29b713105c Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/brocade.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/call_controll.png b/catalog-ui/app/styles/images/resource-icons/call_controll.png new file mode 100644 index 0000000000..afedac5ad3 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/call_controll.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/canvasPlusIcon-red.png b/catalog-ui/app/styles/images/resource-icons/canvasPlusIcon-red.png new file mode 100644 index 0000000000..bf56d13d6d Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/canvasPlusIcon-red.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/canvasPlusIcon.png b/catalog-ui/app/styles/images/resource-icons/canvasPlusIcon.png new file mode 100644 index 0000000000..f2c289cea6 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/canvasPlusIcon.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/cisco.png b/catalog-ui/app/styles/images/resource-icons/cisco.png new file mode 100644 index 0000000000..e83c771bf3 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/cisco.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/closeModule.png b/catalog-ui/app/styles/images/resource-icons/closeModule.png new file mode 100644 index 0000000000..994cf2c4a5 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/closeModule.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/closeModuleHover.png b/catalog-ui/app/styles/images/resource-icons/closeModuleHover.png new file mode 100644 index 0000000000..47f7cb2c6a Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/closeModuleHover.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/cloud.png b/catalog-ui/app/styles/images/resource-icons/cloud.png new file mode 100644 index 0000000000..8e4c77694e Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/cloud.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/cloudep.png b/catalog-ui/app/styles/images/resource-icons/cloudep.png new file mode 100644 index 0000000000..bdaadbd272 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/cloudep.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/compute-uncertified.png b/catalog-ui/app/styles/images/resource-icons/compute-uncertified.png new file mode 100644 index 0000000000..f1254d2dfc Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/compute-uncertified.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/compute.png b/catalog-ui/app/styles/images/resource-icons/compute.png new file mode 100644 index 0000000000..6deb0a0db6 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/compute.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/connector.png b/catalog-ui/app/styles/images/resource-icons/connector.png new file mode 100644 index 0000000000..c479eea892 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/connector.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/cp.png b/catalog-ui/app/styles/images/resource-icons/cp.png new file mode 100644 index 0000000000..f337d35afa Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/cp.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/database.png b/catalog-ui/app/styles/images/resource-icons/database.png new file mode 100644 index 0000000000..b2e7684222 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/database.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/dcae_analytics.png b/catalog-ui/app/styles/images/resource-icons/dcae_analytics.png new file mode 100644 index 0000000000..dd7180479d Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/dcae_analytics.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/dcae_collector.png b/catalog-ui/app/styles/images/resource-icons/dcae_collector.png new file mode 100644 index 0000000000..2870362601 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/dcae_collector.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/dcae_database.png b/catalog-ui/app/styles/images/resource-icons/dcae_database.png new file mode 100644 index 0000000000..b2e7684222 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/dcae_database.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/dcae_microservice.png b/catalog-ui/app/styles/images/resource-icons/dcae_microservice.png new file mode 100644 index 0000000000..933abb106e Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/dcae_microservice.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/dcae_policy.png b/catalog-ui/app/styles/images/resource-icons/dcae_policy.png new file mode 100644 index 0000000000..befb65ecc6 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/dcae_policy.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/dcae_source.png b/catalog-ui/app/styles/images/resource-icons/dcae_source.png new file mode 100644 index 0000000000..58bfa34553 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/dcae_source.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/dcae_utilty.png b/catalog-ui/app/styles/images/resource-icons/dcae_utilty.png new file mode 100644 index 0000000000..fd68ebf135 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/dcae_utilty.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/default.png b/catalog-ui/app/styles/images/resource-icons/default.png new file mode 100644 index 0000000000..91619e0ae8 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/default.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/defaulticon.png b/catalog-ui/app/styles/images/resource-icons/defaulticon.png new file mode 100644 index 0000000000..168859d253 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/defaulticon.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/ericsson.png b/catalog-ui/app/styles/images/resource-icons/ericsson.png new file mode 100644 index 0000000000..7e3147593e Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/ericsson.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/firewall.png b/catalog-ui/app/styles/images/resource-icons/firewall.png new file mode 100644 index 0000000000..5650f2276d Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/firewall.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/fortinet.png b/catalog-ui/app/styles/images/resource-icons/fortinet.png new file mode 100644 index 0000000000..e4e52be0c4 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/fortinet.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/gateway.png b/catalog-ui/app/styles/images/resource-icons/gateway.png new file mode 100644 index 0000000000..478a3af494 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/gateway.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/juniper.png b/catalog-ui/app/styles/images/resource-icons/juniper.png new file mode 100644 index 0000000000..ed9b183b3b Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/juniper.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/loadBalancer.png b/catalog-ui/app/styles/images/resource-icons/loadBalancer.png new file mode 100644 index 0000000000..5c5e555883 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/loadBalancer.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/metaswitch.png b/catalog-ui/app/styles/images/resource-icons/metaswitch.png new file mode 100644 index 0000000000..970dfdd756 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/metaswitch.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/module.png b/catalog-ui/app/styles/images/resource-icons/module.png new file mode 100644 index 0000000000..24574f5ac8 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/module.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/mysql.png b/catalog-ui/app/styles/images/resource-icons/mysql.png new file mode 100644 index 0000000000..07eeaa7d2a Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/mysql.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/network.png b/catalog-ui/app/styles/images/resource-icons/network.png new file mode 100644 index 0000000000..c98eef324e Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/network.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/networkrules.png b/catalog-ui/app/styles/images/resource-icons/networkrules.png new file mode 100644 index 0000000000..4fe91fa7e5 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/networkrules.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/nokia_siemens.png b/catalog-ui/app/styles/images/resource-icons/nokia_siemens.png new file mode 100644 index 0000000000..37a702d79f Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/nokia_siemens.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/objectStorage.png b/catalog-ui/app/styles/images/resource-icons/objectStorage.png new file mode 100644 index 0000000000..27212b71c8 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/objectStorage.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/openModule.png b/catalog-ui/app/styles/images/resource-icons/openModule.png new file mode 100644 index 0000000000..291d0c0361 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/openModule.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/openModuleHover.png b/catalog-ui/app/styles/images/resource-icons/openModuleHover.png new file mode 100644 index 0000000000..0206c5e4d3 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/openModuleHover.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/oracle.png b/catalog-ui/app/styles/images/resource-icons/oracle.png new file mode 100644 index 0000000000..b58acc0823 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/oracle.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/ossep.png b/catalog-ui/app/styles/images/resource-icons/ossep.png new file mode 100644 index 0000000000..0c921dbc76 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/ossep.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/personep.png b/catalog-ui/app/styles/images/resource-icons/personep.png new file mode 100644 index 0000000000..5b743b62d2 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/personep.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/port.png b/catalog-ui/app/styles/images/resource-icons/port.png new file mode 100644 index 0000000000..95285b5b61 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/port.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/premisesep.png b/catalog-ui/app/styles/images/resource-icons/premisesep.png new file mode 100644 index 0000000000..bedd82073f Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/premisesep.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/router.png b/catalog-ui/app/styles/images/resource-icons/router.png new file mode 100644 index 0000000000..27d4897f33 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/router.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/securityrules.png b/catalog-ui/app/styles/images/resource-icons/securityrules.png new file mode 100644 index 0000000000..520ab278cb Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/securityrules.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/selectedCPInstance.png b/catalog-ui/app/styles/images/resource-icons/selectedCPInstance.png new file mode 100644 index 0000000000..2f63077037 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/selectedCPInstance.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/selectedInstance.png b/catalog-ui/app/styles/images/resource-icons/selectedInstance.png new file mode 100644 index 0000000000..f2f5c90ac9 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/selectedInstance.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/selectedUcpeInstance.png b/catalog-ui/app/styles/images/resource-icons/selectedUcpeInstance.png new file mode 100644 index 0000000000..f168929ed6 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/selectedUcpeInstance.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/selectedVLInstance.png b/catalog-ui/app/styles/images/resource-icons/selectedVLInstance.png new file mode 100644 index 0000000000..17407f2609 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/selectedVLInstance.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/server.png b/catalog-ui/app/styles/images/resource-icons/server.png new file mode 100644 index 0000000000..b51305d58f Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/server.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/tropo.png b/catalog-ui/app/styles/images/resource-icons/tropo.png new file mode 100644 index 0000000000..88a5ea5e68 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/tropo.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/ucpe.png b/catalog-ui/app/styles/images/resource-icons/ucpe.png new file mode 100644 index 0000000000..8e8e430e3c Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/ucpe.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/uncertified.png b/catalog-ui/app/styles/images/resource-icons/uncertified.png new file mode 100644 index 0000000000..35d747a7d0 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/uncertified.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/vfw.png b/catalog-ui/app/styles/images/resource-icons/vfw.png new file mode 100644 index 0000000000..b8adc1f09c Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/vfw.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/vl.png b/catalog-ui/app/styles/images/resource-icons/vl.png new file mode 100644 index 0000000000..1fb2fc07ce Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/vl.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/vrouter.png b/catalog-ui/app/styles/images/resource-icons/vrouter.png new file mode 100644 index 0000000000..70e89e5125 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/vrouter.png differ diff --git a/catalog-ui/app/styles/images/resource-icons/wanx.png b/catalog-ui/app/styles/images/resource-icons/wanx.png new file mode 100644 index 0000000000..daa493a0f2 Binary files /dev/null and b/catalog-ui/app/styles/images/resource-icons/wanx.png differ diff --git a/catalog-ui/app/styles/images/service-icons/call_controll.png b/catalog-ui/app/styles/images/service-icons/call_controll.png new file mode 100644 index 0000000000..ef1d92757e Binary files /dev/null and b/catalog-ui/app/styles/images/service-icons/call_controll.png differ diff --git a/catalog-ui/app/styles/images/service-icons/collaboration.png b/catalog-ui/app/styles/images/service-icons/collaboration.png new file mode 100644 index 0000000000..3d34b914f5 Binary files /dev/null and b/catalog-ui/app/styles/images/service-icons/collaboration.png differ diff --git a/catalog-ui/app/styles/images/service-icons/collaboration1.png b/catalog-ui/app/styles/images/service-icons/collaboration1.png new file mode 100644 index 0000000000..6780931e2b Binary files /dev/null and b/catalog-ui/app/styles/images/service-icons/collaboration1.png differ diff --git a/catalog-ui/app/styles/images/service-icons/compute.png b/catalog-ui/app/styles/images/service-icons/compute.png new file mode 100644 index 0000000000..cb2b127ef1 Binary files /dev/null and b/catalog-ui/app/styles/images/service-icons/compute.png differ diff --git a/catalog-ui/app/styles/images/service-icons/defaulticon.png b/catalog-ui/app/styles/images/service-icons/defaulticon.png new file mode 100644 index 0000000000..5afead32d8 Binary files /dev/null and b/catalog-ui/app/styles/images/service-icons/defaulticon.png differ diff --git a/catalog-ui/app/styles/images/service-icons/messaging.png b/catalog-ui/app/styles/images/service-icons/messaging.png new file mode 100644 index 0000000000..eb5f14d178 Binary files /dev/null and b/catalog-ui/app/styles/images/service-icons/messaging.png differ diff --git a/catalog-ui/app/styles/images/service-icons/mobility.png b/catalog-ui/app/styles/images/service-icons/mobility.png new file mode 100644 index 0000000000..285c442aba Binary files /dev/null and b/catalog-ui/app/styles/images/service-icons/mobility.png differ diff --git a/catalog-ui/app/styles/images/service-icons/network_l_1-3.png b/catalog-ui/app/styles/images/service-icons/network_l_1-3.png new file mode 100644 index 0000000000..128c2bec8b Binary files /dev/null and b/catalog-ui/app/styles/images/service-icons/network_l_1-3.png differ diff --git a/catalog-ui/app/styles/images/service-icons/network_l_4.png b/catalog-ui/app/styles/images/service-icons/network_l_4.png new file mode 100644 index 0000000000..7b05e1b101 Binary files /dev/null and b/catalog-ui/app/styles/images/service-icons/network_l_4.png differ diff --git a/catalog-ui/app/styles/images/service-icons/notification.png b/catalog-ui/app/styles/images/service-icons/notification.png new file mode 100644 index 0000000000..a5de34c40f Binary files /dev/null and b/catalog-ui/app/styles/images/service-icons/notification.png differ diff --git a/catalog-ui/app/styles/images/service-icons/platform.png b/catalog-ui/app/styles/images/service-icons/platform.png new file mode 100644 index 0000000000..934eae9136 Binary files /dev/null and b/catalog-ui/app/styles/images/service-icons/platform.png differ diff --git a/catalog-ui/app/styles/images/service-icons/storage.png b/catalog-ui/app/styles/images/service-icons/storage.png new file mode 100644 index 0000000000..9abfd2d3a4 Binary files /dev/null and b/catalog-ui/app/styles/images/service-icons/storage.png differ diff --git a/catalog-ui/app/styles/images/service-icons/uncertified.png b/catalog-ui/app/styles/images/service-icons/uncertified.png new file mode 100644 index 0000000000..35d747a7d0 Binary files /dev/null and b/catalog-ui/app/styles/images/service-icons/uncertified.png differ diff --git a/catalog-ui/app/styles/images/sprites/sprite-global-old.png b/catalog-ui/app/styles/images/sprites/sprite-global-old.png new file mode 100644 index 0000000000..a1014f55d7 Binary files /dev/null and b/catalog-ui/app/styles/images/sprites/sprite-global-old.png differ diff --git a/catalog-ui/app/styles/images/sprites/sprite-global.png b/catalog-ui/app/styles/images/sprites/sprite-global.png new file mode 100644 index 0000000000..bb2334216a Binary files /dev/null and b/catalog-ui/app/styles/images/sprites/sprite-global.png differ diff --git a/catalog-ui/app/styles/images/sprites/sprite-product-icons.png b/catalog-ui/app/styles/images/sprites/sprite-product-icons.png new file mode 100644 index 0000000000..e85467a09c Binary files /dev/null and b/catalog-ui/app/styles/images/sprites/sprite-product-icons.png differ diff --git a/catalog-ui/app/styles/images/sprites/sprite-resource-icons.png b/catalog-ui/app/styles/images/sprites/sprite-resource-icons.png new file mode 100644 index 0000000000..61989d63e1 Binary files /dev/null and b/catalog-ui/app/styles/images/sprites/sprite-resource-icons.png differ diff --git a/catalog-ui/app/styles/images/sprites/sprite-services-icons.png b/catalog-ui/app/styles/images/sprites/sprite-services-icons.png new file mode 100644 index 0000000000..ac19fa186b Binary files /dev/null and b/catalog-ui/app/styles/images/sprites/sprite-services-icons.png differ diff --git a/catalog-ui/app/styles/images/sprites/tlv-sprite.png b/catalog-ui/app/styles/images/sprites/tlv-sprite.png new file mode 100644 index 0000000000..7f11c2ece1 Binary files /dev/null and b/catalog-ui/app/styles/images/sprites/tlv-sprite.png differ diff --git a/catalog-ui/app/styles/images/tutorial/10.png b/catalog-ui/app/styles/images/tutorial/10.png new file mode 100644 index 0000000000..312d48f99a Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/10.png differ diff --git a/catalog-ui/app/styles/images/tutorial/11.png b/catalog-ui/app/styles/images/tutorial/11.png new file mode 100644 index 0000000000..8c4f8aec39 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/11.png differ diff --git a/catalog-ui/app/styles/images/tutorial/13.png b/catalog-ui/app/styles/images/tutorial/13.png new file mode 100644 index 0000000000..d2c35ddb47 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/13.png differ diff --git a/catalog-ui/app/styles/images/tutorial/14.png b/catalog-ui/app/styles/images/tutorial/14.png new file mode 100644 index 0000000000..0aabc9fd11 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/14.png differ diff --git a/catalog-ui/app/styles/images/tutorial/15.png b/catalog-ui/app/styles/images/tutorial/15.png new file mode 100644 index 0000000000..d6720989c2 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/15.png differ diff --git a/catalog-ui/app/styles/images/tutorial/16.png b/catalog-ui/app/styles/images/tutorial/16.png new file mode 100644 index 0000000000..95005bd5a2 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/16.png differ diff --git a/catalog-ui/app/styles/images/tutorial/17.png b/catalog-ui/app/styles/images/tutorial/17.png new file mode 100644 index 0000000000..c22875e6d3 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/17.png differ diff --git a/catalog-ui/app/styles/images/tutorial/18.png b/catalog-ui/app/styles/images/tutorial/18.png new file mode 100644 index 0000000000..e5b9b5a8b0 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/18.png differ diff --git a/catalog-ui/app/styles/images/tutorial/19.png b/catalog-ui/app/styles/images/tutorial/19.png new file mode 100644 index 0000000000..f7374928ba Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/19.png differ diff --git a/catalog-ui/app/styles/images/tutorial/2.png b/catalog-ui/app/styles/images/tutorial/2.png new file mode 100644 index 0000000000..4e141bd764 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/2.png differ diff --git a/catalog-ui/app/styles/images/tutorial/20.png b/catalog-ui/app/styles/images/tutorial/20.png new file mode 100644 index 0000000000..c3849b0a17 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/20.png differ diff --git a/catalog-ui/app/styles/images/tutorial/21.png b/catalog-ui/app/styles/images/tutorial/21.png new file mode 100644 index 0000000000..aa60a153a0 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/21.png differ diff --git a/catalog-ui/app/styles/images/tutorial/22.png b/catalog-ui/app/styles/images/tutorial/22.png new file mode 100644 index 0000000000..0d4a71c1e4 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/22.png differ diff --git a/catalog-ui/app/styles/images/tutorial/23.png b/catalog-ui/app/styles/images/tutorial/23.png new file mode 100644 index 0000000000..6854d0e4e5 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/23.png differ diff --git a/catalog-ui/app/styles/images/tutorial/24.png b/catalog-ui/app/styles/images/tutorial/24.png new file mode 100644 index 0000000000..099fa28874 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/24.png differ diff --git a/catalog-ui/app/styles/images/tutorial/25.png b/catalog-ui/app/styles/images/tutorial/25.png new file mode 100644 index 0000000000..718cf4a65f Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/25.png differ diff --git a/catalog-ui/app/styles/images/tutorial/26.png b/catalog-ui/app/styles/images/tutorial/26.png new file mode 100644 index 0000000000..cd4885ec4a Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/26.png differ diff --git a/catalog-ui/app/styles/images/tutorial/27.png b/catalog-ui/app/styles/images/tutorial/27.png new file mode 100644 index 0000000000..85c7378e39 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/27.png differ diff --git a/catalog-ui/app/styles/images/tutorial/28.png b/catalog-ui/app/styles/images/tutorial/28.png new file mode 100644 index 0000000000..54c5ada0d7 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/28.png differ diff --git a/catalog-ui/app/styles/images/tutorial/29.png b/catalog-ui/app/styles/images/tutorial/29.png new file mode 100644 index 0000000000..ae07010492 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/29.png differ diff --git a/catalog-ui/app/styles/images/tutorial/3.png b/catalog-ui/app/styles/images/tutorial/3.png new file mode 100644 index 0000000000..ff1a86b4d0 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/3.png differ diff --git a/catalog-ui/app/styles/images/tutorial/30.png b/catalog-ui/app/styles/images/tutorial/30.png new file mode 100644 index 0000000000..ef83db0e01 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/30.png differ diff --git a/catalog-ui/app/styles/images/tutorial/4.png b/catalog-ui/app/styles/images/tutorial/4.png new file mode 100644 index 0000000000..dfc148868e Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/4.png differ diff --git a/catalog-ui/app/styles/images/tutorial/5.png b/catalog-ui/app/styles/images/tutorial/5.png new file mode 100644 index 0000000000..f18e52527d Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/5.png differ diff --git a/catalog-ui/app/styles/images/tutorial/6.png b/catalog-ui/app/styles/images/tutorial/6.png new file mode 100644 index 0000000000..173dc55d1c Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/6.png differ diff --git a/catalog-ui/app/styles/images/tutorial/7.png b/catalog-ui/app/styles/images/tutorial/7.png new file mode 100644 index 0000000000..3e31376143 Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/7.png differ diff --git a/catalog-ui/app/styles/images/tutorial/8.png b/catalog-ui/app/styles/images/tutorial/8.png new file mode 100644 index 0000000000..59f95dfa2e Binary files /dev/null and b/catalog-ui/app/styles/images/tutorial/8.png differ diff --git a/catalog-ui/app/styles/images/welcome.png b/catalog-ui/app/styles/images/welcome.png new file mode 100644 index 0000000000..8534a33088 Binary files /dev/null and b/catalog-ui/app/styles/images/welcome.png differ diff --git a/catalog-ui/app/styles/images/welcome/SD&C_Welcome15.jpg b/catalog-ui/app/styles/images/welcome/SD&C_Welcome15.jpg new file mode 100644 index 0000000000..b53b229546 Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/SD&C_Welcome15.jpg differ diff --git a/catalog-ui/app/styles/images/welcome/SD&C_Welcome15_b.jpg b/catalog-ui/app/styles/images/welcome/SD&C_Welcome15_b.jpg new file mode 100644 index 0000000000..bae42eb7d6 Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/SD&C_Welcome15_b.jpg differ diff --git a/catalog-ui/app/styles/images/welcome/bg/001.jpg b/catalog-ui/app/styles/images/welcome/bg/001.jpg new file mode 100644 index 0000000000..19bc76b300 Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/bg/001.jpg differ diff --git a/catalog-ui/app/styles/images/welcome/bg/002.jpg b/catalog-ui/app/styles/images/welcome/bg/002.jpg new file mode 100644 index 0000000000..7d5fc2ef12 Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/bg/002.jpg differ diff --git a/catalog-ui/app/styles/images/welcome/bg/002.png b/catalog-ui/app/styles/images/welcome/bg/002.png new file mode 100644 index 0000000000..f3e7a7c3ed Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/bg/002.png differ diff --git a/catalog-ui/app/styles/images/welcome/bg/003.png b/catalog-ui/app/styles/images/welcome/bg/003.png new file mode 100644 index 0000000000..c33b14fe9c Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/bg/003.png differ diff --git a/catalog-ui/app/styles/images/welcome/bg/004.png b/catalog-ui/app/styles/images/welcome/bg/004.png new file mode 100644 index 0000000000..08578bb1ec Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/bg/004.png differ diff --git a/catalog-ui/app/styles/images/welcome/bg/bg02.png b/catalog-ui/app/styles/images/welcome/bg/bg02.png new file mode 100644 index 0000000000..3b10aa45f7 Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/bg/bg02.png differ diff --git a/catalog-ui/app/styles/images/welcome/bg/bg03.png b/catalog-ui/app/styles/images/welcome/bg/bg03.png new file mode 100644 index 0000000000..50fe924f5d Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/bg/bg03.png differ diff --git a/catalog-ui/app/styles/images/welcome/bg/connection02.png b/catalog-ui/app/styles/images/welcome/bg/connection02.png new file mode 100644 index 0000000000..157acba384 Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/bg/connection02.png differ diff --git a/catalog-ui/app/styles/images/welcome/bg/connection03.png b/catalog-ui/app/styles/images/welcome/bg/connection03.png new file mode 100644 index 0000000000..01f21fcf41 Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/bg/connection03.png differ diff --git a/catalog-ui/app/styles/images/welcome/bg/connection04.png b/catalog-ui/app/styles/images/welcome/bg/connection04.png new file mode 100644 index 0000000000..174dbfe5dd Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/bg/connection04.png differ diff --git a/catalog-ui/app/styles/images/welcome/bg/global.png b/catalog-ui/app/styles/images/welcome/bg/global.png new file mode 100644 index 0000000000..09b366404e Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/bg/global.png differ diff --git a/catalog-ui/app/styles/images/welcome/bg/shape02.png b/catalog-ui/app/styles/images/welcome/bg/shape02.png new file mode 100644 index 0000000000..91400da15d Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/bg/shape02.png differ diff --git a/catalog-ui/app/styles/images/welcome/bg/shape03.png b/catalog-ui/app/styles/images/welcome/bg/shape03.png new file mode 100644 index 0000000000..af6384674b Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/bg/shape03.png differ diff --git a/catalog-ui/app/styles/images/welcome/bg/shape04.png b/catalog-ui/app/styles/images/welcome/bg/shape04.png new file mode 100644 index 0000000000..36759df6e5 Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/bg/shape04.png differ diff --git a/catalog-ui/app/styles/images/welcome/bg/shape05.png b/catalog-ui/app/styles/images/welcome/bg/shape05.png new file mode 100644 index 0000000000..336411fd80 Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/bg/shape05.png differ diff --git a/catalog-ui/app/styles/images/welcome/laptop.png b/catalog-ui/app/styles/images/welcome/laptop.png new file mode 100644 index 0000000000..160e743d1b Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/laptop.png differ diff --git a/catalog-ui/app/styles/images/welcome/logo_att.png b/catalog-ui/app/styles/images/welcome/logo_att.png new file mode 100644 index 0000000000..e145a1ae5d Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/logo_att.png differ diff --git a/catalog-ui/app/styles/images/welcome/sprite.png b/catalog-ui/app/styles/images/welcome/sprite.png new file mode 100644 index 0000000000..3bb7542446 Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/sprite.png differ diff --git a/catalog-ui/app/styles/images/welcome/ss-01.png b/catalog-ui/app/styles/images/welcome/ss-01.png new file mode 100644 index 0000000000..abd4cd7a46 Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/ss-01.png differ diff --git a/catalog-ui/app/styles/images/welcome/ss-02.png b/catalog-ui/app/styles/images/welcome/ss-02.png new file mode 100644 index 0000000000..d4d0038b64 Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/ss-02.png differ diff --git a/catalog-ui/app/styles/images/welcome/ss-03.png b/catalog-ui/app/styles/images/welcome/ss-03.png new file mode 100644 index 0000000000..9a259ca7c2 Binary files /dev/null and b/catalog-ui/app/styles/images/welcome/ss-03.png differ diff --git a/catalog-ui/app/styles/layout/header.less b/catalog-ui/app/styles/layout/header.less new file mode 100644 index 0000000000..f8e95e8b41 --- /dev/null +++ b/catalog-ui/app/styles/layout/header.less @@ -0,0 +1,78 @@ +.w-sdc-header { + .bg_j; + border-bottom: 1px solid @border_color_c; + height: 94px; + width: 100%; + display: flex; + align-items: center; +} + +.w-sdc-header-logo { + .bg_i; + .hand; + border-bottom: 1px solid @border_color_a; + height: 94px; + width: 240px; + padding: 28px; + .flex-fixed(240px); + z-index: 1020; +} + +.w-sdc-header-logo-icon { + display: inline-block; + margin-right: 8px; + vertical-align: -6px; +} + +a.w-sdc-header-logo-link { + .c_5; + text-decoration: none; +} + +.w-sdc-header-version{ + .c_16; + .opacity(0.6); +} + +.i-sdc-header-caption { + min-width: 175px; + text-align: left; + cursor: default; + text-overflow: ellipsis; + overflow: hidden; + flex-grow: 10; + padding-left: 27px; + white-space: nowrap; + + .i-sdc-header-caption-text { + .i_11; + text-overflow: ellipsis; + overflow: hidden; + + } + + .i-sdc-header-help { + .i_1; + .hand; + margin-left: 26px; + position: relative; + display: inline-block; + + &::before { + .bg_a; + border-radius: 50%; + color: @color_c; + content: '?'; + display: block; + height: 20px; + position: absolute; + left: -26px; + text-align: center; + width: 20px; + } + } +} + +.sdc-error-403-container-title { + .b_11; +} diff --git a/catalog-ui/app/styles/layout/main.less b/catalog-ui/app/styles/layout/main.less new file mode 100644 index 0000000000..925da09431 --- /dev/null +++ b/catalog-ui/app/styles/layout/main.less @@ -0,0 +1,124 @@ +.full-height { + height: 100%; + background-color: @main_color_l +} + +.w-sdc-main-container { + position: absolute; + top: @header_height + @top_nav_height; + left: 0; + right: 0; + bottom: 0; + + .w-sdc-main-right-container { + .bg_n; + bottom: 0; + padding: 22px 12px; + position: absolute; + left: 240px; + right: 0; + top: 0; + overflow: hidden; + + + & > div:first-child { /* scroll fix */ + padding-bottom: 80px; + } + } +} + +.sdc-loading-page { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + position: absolute; + height: 100%; + width: 100%; + + .caption1 { + .p_24; + text-align: center; + } + + .caption2 { + .p_16_m; + display: block; + } +} + +.main-loader { + @green: #cccccc; + @blue: #dddddd; + @red: #eeeeee; + @yellow: #bbbbbb; + @white: #ffffff; + + @width: 80px; + + .loader { + position: relative; + margin: 0px auto; + width: @width; + &:before { + content:''; + display: block; + padding-top: 100%; + } + } + + .circular { + animation: rotate 2s linear infinite; + height: 100%; + transform-origin: center center; + width: 100%; + position: absolute; + top: 0; bottom: 0; left: 0; right: 0; + margin: auto; + } + + + .path { + stroke-dasharray: 1,200; + stroke-dashoffset: 0; + animation: + dash 1.5s ease-in-out infinite, + color 6s ease-in-out infinite; + stroke-linecap: round; + } + + @keyframes rotate{ + 100%{ + transform: rotate(360deg); + } + } + @keyframes dash{ + 0%{ + stroke-dasharray: 1,200; + stroke-dashoffset: 0; + } + 50%{ + stroke-dasharray: 89,200; + stroke-dashoffset: -35px; + } + 100%{ + stroke-dasharray: 89,200; + stroke-dashoffset: -124px; + } + } + @keyframes color{ + 100%, 0%{ + stroke: @red; + } + 40%{ + stroke: @blue; + } + 66%{ + stroke: @green; + } + 80%, 90%{ + stroke: @yellow; + } + } + +} diff --git a/catalog-ui/app/styles/layout/sidebar.less b/catalog-ui/app/styles/layout/sidebar.less new file mode 100644 index 0000000000..9b8dc240c7 --- /dev/null +++ b/catalog-ui/app/styles/layout/sidebar.less @@ -0,0 +1,163 @@ +.w-sdc-left-sidebar { + width: 242px; + overflow: hidden; + background-color: @main_color_p; + .box-shadow(1px 0px 4px 0px rgba(24, 24, 25, 0.17)); + position: absolute; + left: 0; + top: 0; + bottom: 0; + padding: 12px 18px; + z-index: 1; +} + +.w-sdc-left-sidebar-menu { + margin: 0; + padding: 0; + + ul { + margin: 0; + padding: 0; + } +} + +/* Catalog */ +.i-sdc-left-sidebar-nav-item { + .c_6; + .hand; + .border-radius(4px); + width: 220px; + height: 60px; + line-height: 19px; + margin: 0 auto 10px; + padding: 20px 10px 20px 60px; + box-shadow: 0 0 2px 0 rgba(0, 0, 0, .3); + text-align: left; + + &::before { + .sprite; + content: ''; + position: absolute; + left: 50px; + top: 18px; + } + + &.catalog { + .c_4; + .bg_a; + .uppercase; + position: relative; + text-indent: 20px; + + &:hover { .bg_a_hover; } + &::before {.sprite.catalog;} + } + + &.distribution { + .bg_o; + display: none; + position: relative; + } + &.distribution::before { + .sprite.distribution; + } + + &.support { + .bg_a; + position: relative; + } + + &.support::before { + .sprite.support; + + } +} + + +/* */ +.i-sdc-left-sidebar-nav-item-hierachy { + .c_6; + .hand; + .border-radius(4px); + width: 220px; + height: 60px; + line-height: 19px; + margin: 0 auto 10px; + padding: 20px 10px 20px 60px; + box-shadow: 0 0 2px 0 rgba(0, 0, 0, .3); + text-align: left; + + &::before { + .sprite; + content: ''; + position: absolute; + left: 50px; + top: 18px; + } + + &.catalog { + .c_4; + .bg_a; + .uppercase; + position: relative; + text-indent: 20px; + + &:hover { .bg_a_hover; } + &::before {.sprite.catalog;} + } + + &.distribution { + .bg_o; + display: none; + position: relative; + } + &.distribution::before { + .sprite.distribution; + } + + &.support { + .bg_a; + position: relative; + } + + &.support::before { + .sprite.support; + + } +} + +/* Dashboard (Non Catalog) */ +.i-sdc-left-sidebar-item { + list-style: none; + .m_14_r; + line-height: 24px; + + &.category-title { + text-transform: uppercase; + .l_14_m; + line-height: 30px; + } + + input[type="checkbox"] { + margin-right: 10px; + vertical-align: sub; + } + + /*&.selectedLink { + .c_7; + }*/ + + .i-sdc-left-sidebar-item-state-count { + float: right; + } + + .sdc-element-checkbox { + display: inline-flex; + } + +} + +.i-sdc-left-sidebar-item-seperator { + border-bottom: solid 1px @func_color_r; + width: 208px; +} diff --git a/catalog-ui/app/styles/mixins.less b/catalog-ui/app/styles/mixins.less new file mode 100644 index 0000000000..7bd413ed05 --- /dev/null +++ b/catalog-ui/app/styles/mixins.less @@ -0,0 +1,217 @@ +@import "variables"; + +.f-color { + .a {color: @main_color_a;} + .b {color: @main_color_b;} + .c {color: @main_color_c;} + .d {color: @main_color_d;} + .e {color: @main_color_e;} + .f {color: @main_color_f;} + .g {color: @main_color_g;} + .h {color: @main_color_h;} + .i {color: @main_color_i;} + .j {color: @main_color_j;} + .k {color: @main_color_k;} + .l {color: @main_color_l;} + .m {color: @main_color_m;} + .n {color: @main_color_n;} + .o {color: @main_color_o;} + .p {color: @main_color_p;} + + .q {color: @func_color_q;} + .r {color: @func_color_r;} + .s {color: @func_color_s;} + + .t {color: @tlv_color_t;} + .u {color: @tlv_color_u;} + .v {color: @tlv_color_v;} + + +} + +.f-type { + ._36 { + font-family: @font-omnes-light; + font-size: 36px; + } + ._24 { + font-family: @font-omnes-light; + font-size: 24px; + } + ._18_r { + font-family: @font-omnes-regular; + font-size: 18px; + } + ._18_m { + font-family: @font-omnes-medium; + font-size: 18px; + } + ._16_r { + font-family: @font-omnes-regular; + font-size: 16px; + } + ._16_m { + font-family: @font-omnes-medium; + font-size: 16px; + } + ._14_r { + font-family: @font-omnes-regular; + font-size: 14px; + } + ._14_m { + font-family: @font-omnes-medium; + font-size: 14px; + } + ._14_i { + font-family: @font-omnes-medium-italic; + font-size: 14px; + } + ._13_r { + font-family: @font-omnes-regular; + font-size: 13px; + } + ._13_m { + font-family: @font-omnes-medium; + font-size: 13px; + } + ._13_i { + font-family: @font-omnes-medium-italic; + font-size: 13px; + } + ._12_r { + font-family: @font-omnes-regular; + font-size: 12px; + } + ._12_m { + font-family: @font-omnes-medium; + font-size: 12px; + } + ._12_i { + font-family: @font-omnes-medium-italic; + font-size: 12px; + } +} + +.buildForColor(a); +.buildForColor(b); +.buildForColor(c); +.buildForColor(d); +.buildForColor(e); +.buildForColor(f); +.buildForColor(g); +.buildForColor(h); +.buildForColor(i); +.buildForColor(j); +.buildForColor(k); +.buildForColor(l); +.buildForColor(m); +.buildForColor(n); +.buildForColor(o); +.buildForColor(p); + +.buildForFuncColor(q); +.buildForFuncColor(r); +.buildForFuncColor(s); + +.buildForTlvColor(t); +.buildForTlvColor(u); +.buildForTlvColor(v); + + +.buildForColor(@c){ + .@{c}_36 { color: ~"@{main_color_@{c}}"; .f-type > ._36;} + .@{c}_24 { color: ~"@{main_color_@{c}}"; .f-type > ._24;} + .@{c}_18_r { color: ~"@{main_color_@{c}}"; .f-type > ._18_r;} + .@{c}_18_m { color: ~"@{main_color_@{c}}"; .f-type > ._18_m;} + .@{c}_16_r { color: ~"@{main_color_@{c}}"; .f-type > ._16_r;} + .@{c}_16_m { color: ~"@{main_color_@{c}}"; .f-type > ._16_m;} + .@{c}_14_r { color: ~"@{main_color_@{c}}"; .f-type > ._14_r;} + .@{c}_14_m { color: ~"@{main_color_@{c}}"; .f-type > ._14_m;} + .@{c}_14_i { color: ~"@{main_color_@{c}}"; .f-type > ._14_i;} + .@{c}_13_r { color: ~"@{main_color_@{c}}"; .f-type > ._13_r;} + .@{c}_13_m { color: ~"@{main_color_@{c}}"; .f-type > ._13_m;} + .@{c}_13_i { color: ~"@{main_color_@{c}}"; .f-type > ._13_i;} + .@{c}_12_r { color: ~"@{main_color_@{c}}"; .f-type > ._12_r;} + .@{c}_12_m { color: ~"@{main_color_@{c}}"; .f-type > ._12_m;} + .@{c}_12_i { color: ~"@{main_color_@{c}}"; .f-type > ._12_i;} +} + +.buildForFuncColor(@c){ + .@{c}_36 { color: ~"@{func_color_@{c}}"; .f-type > ._36;} + .@{c}_24 { color: ~"@{func_color_@{c}}"; .f-type > ._24;} + .@{c}_18_r { color: ~"@{func_color_@{c}}"; .f-type > ._18_r;} + .@{c}_18_m { color: ~"@{func_color_@{c}}"; .f-type > ._18_m;} + .@{c}_16_r { color: ~"@{func_color_@{c}}"; .f-type > ._16_r;} + .@{c}_16_m { color: ~"@{func_color_@{c}}"; .f-type > ._16_m;} + .@{c}_14_r { color: ~"@{func_color_@{c}}"; .f-type > ._14_r;} + .@{c}_14_m { color: ~"@{func_color_@{c}}"; .f-type > ._14_m;} + .@{c}_14_i { color: ~"@{func_color_@{c}}"; .f-type > ._14_i;} + .@{c}_13_r { color: ~"@{func_color_@{c}}"; .f-type > ._13_r;} + .@{c}_13_m { color: ~"@{func_color_@{c}}"; .f-type > ._13_m;} + .@{c}_13_i { color: ~"@{func_color_@{c}}"; .f-type > ._13_i;} + .@{c}_12_r { color: ~"@{func_color_@{c}}"; .f-type > ._12_r;} + .@{c}_12_m { color: ~"@{func_color_@{c}}"; .f-type > ._12_m;} + .@{c}_12_i { color: ~"@{func_color_@{c}}"; .f-type > ._12_i;} +} + + +.buildForTlvColor(@c){ + .@{c}_36 { color: ~"@{tlv_color_@{c}}"; .f-type > ._36;} + .@{c}_24 { color: ~"@{tlv_color_@{c}}"; .f-type > ._24;} + .@{c}_18_r { color: ~"@{tlv_color_@{c}}"; .f-type > ._18_r;} + .@{c}_18_m { color: ~"@{tlv_color_@{c}}"; .f-type > ._18_m;} + .@{c}_16_r { color: ~"@{tlv_color_@{c}}"; .f-type > ._16_r;} + .@{c}_16_m { color: ~"@{tlv_color_@{c}}"; .f-type > ._16_m;} + .@{c}_14_r { color: ~"@{tlv_color_@{c}}"; .f-type > ._14_r;} + .@{c}_14_m { color: ~"@{tlv_color_@{c}}"; .f-type > ._14_m;} + .@{c}_14_i { color: ~"@{tlv_color_@{c}}"; .f-type > ._14_i;} + .@{c}_13_r { color: ~"@{tlv_color_@{c}}"; .f-type > ._13_r;} + .@{c}_13_m { color: ~"@{tlv_color_@{c}}"; .f-type > ._13_m;} + .@{c}_13_i { color: ~"@{tlv_color_@{c}}"; .f-type > ._13_i;} + .@{c}_12_r { color: ~"@{tlv_color_@{c}}"; .f-type > ._12_r;} + .@{c}_12_m { color: ~"@{tlv_color_@{c}}"; .f-type > ._12_m;} + .@{c}_12_i { color: ~"@{tlv_color_@{c}}"; .f-type > ._12_i;} +} + +.disabled { + opacity: 0.4 !important; + cursor: auto; + background-color: transparent; + pointer-events: none; +} + +/* I'm not using hidden name, can not override bower_components/bootstrap/dist/css/less/responsive-utilities.less */ +.hideme { + visibility: hidden; +} + +.view-mode { + opacity: 1; + border: solid 1px @main_color_o; + background-color: #f8f8f8; + cursor: auto; + + & + &:not(.icons-text), &.no-border-top { + border-top: none; + } +} + +.no-pointer-events { + pointer-events: none; +} + +.unselectable { + -moz-user-select: -moz-none; + -khtml-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.selectable { + -moz-user-select: text; + -khtml-user-select: text; + -webkit-user-select: text; + -ms-user-select: text; + user-select: text; +} diff --git a/catalog-ui/app/styles/mixins_old.less b/catalog-ui/app/styles/mixins_old.less new file mode 100644 index 0000000000..8a4f609497 --- /dev/null +++ b/catalog-ui/app/styles/mixins_old.less @@ -0,0 +1,558 @@ +@import "variables"; + +.font-color { + .a {color: @color_a;} + .b {color: @color_b;} + .c {color: @color_c;} + .d {color: @color_d;} + .e {color: @color_e;} + .f {color: @color_f;} + .g {color: @color_g;} + .h {color: @color_h;} + .i {color: @color_i;} + .j {color: @color_j;} + .k {color: @color_k;} + .l {color: @color_l;} + .m {color: @color_m;} + .n {color: @color_n;} + .o {color: @color_o;} + .p {color: @color_p;} + .q {color: @color_q;} + .r {color: @color_r;} + .s {color: @color_s;} + .t {color: @color_t;} + .u {color: @color_t;} + .v {color: @color_t;} + .w {color: @color_t;} + .x {color: @color_t;} + .y {color: @color_t;} + .z {color: @color_z;} + .zz {color: @color_zz;} + + .hover { + .a {color: @color_a_hover;} + .b {color: @color_b_hover;} + .c {color: @color_c_hover;} + .d {color: @color_d_hover;} + .e {color: @color_e_hover;} + .f {color: @color_f_hover;} + .g {color: @color_g_hover;} + .h {color: @color_h_hover;} + .i {color: @color_i_hover;} + .j {color: @color_j_hover;} + .k {color: @color_k_hover;} + .l {color: @color_l_hover;} + .m {color: @color_m_hover;} + .n {color: @color_n_hover;} + .o {color: @color_o_hover;} + .p {color: @color_p_hover;} + .q {color: @color_q_hover;} + .r {color: @color_r_hover;} + .s {color: @color_s_hover;} + .t {color: @color_t_hover;} + .u {color: @color_u_hover;} + .v {color: @color_v_hover;} + .w {color: @color_w_hover;} + .x {color: @color_x_hover;} + .y {color: @color_y_hover;} + .z {color: @color_z_hover;} + .zz {color: @color_zz_hover;} + } +} + +.font-type { + ._1 { + font-family: @font-omnes-regular; + font-size: 14px; + } + ._2 { + font-family: @font-omnes-regular; + font-size: 20px; + } + ._3 { + font-family: @font-omnes-regular; + font-size: 12px; + } + ._4 { + font-family: @font-omnes-regular; + font-size: 16px; + } + ._5 { + font-family: @font-omnes-medium; + font-size: 30px; + } + ._6 { + font-family: @font-omnes-medium; + font-size: 16px; + } + ._7 { + font-family: @font-omnes-medium; + font-size: 14px; + } + ._8 { + font-family: @font-omnes-regular; + font-size: 11px; + } + ._9 { + font-family: @font-omnes-regular; + font-size: 13px; + } + ._10 { + font-family: @font-omnes-regular; + font-size: 18px; + } + ._11 { + font-family: @font-omnes-medium; + font-size: 20px; + } + ._12 { + font-family: @font-omnes-medium; + font-size: 17px; + } + ._13 { + font-family: @font-omnes-medium; + font-size: 12px; + } + ._14 { + font-family: @font-omnes-medium; + font-size: 11px; + } + ._15 { + font-family: @font-omnes-medium; + font-size: 24px; + } + ._16 { + font-family: @font-omnes-regular; + font-size: 10px; + } + ._17 { + font-family: @font-omnes-medium; + font-size: 15px; + } + ._18 { + font-family: @font-omnes-regular; + font-size: 15px; + } + ._19 { + font-family: @font-omnes-medium; + font-size: 18px; + } +} + +.a_1 {.font-color > .a; .font-type > ._1;} +.a_2 {.font-color > .a; .font-type > ._2;} +.a_3 {.font-color > .a; .font-type > ._3;} +.a_4 {.font-color > .a; .font-type > ._4;} +.a_5 {.font-color > .a; .font-type > ._5;} +.a_6 {.font-color > .a; .font-type > ._6;} +.a_7 {.font-color > .a; .font-type > ._7;} +.a_8 {.font-color > .a; .font-type > ._8;} +.a_9 {.font-color > .a; .font-type > ._9;} +.a_10 {.font-color > .a; .font-type > ._10;} +.a_15 {.font-color > .a; .font-type > ._15;} + +.b_1 {.font-color > .b; .font-type > ._1;} +.b_3 {.font-color > .b; .font-type > ._3;} +.b_4 {.font-color > .b; .font-type > ._4;} +.b_5 {.font-color > .b; .font-type > ._5;} +.b_6 {.font-color > .b; .font-type > ._6;} +.b_7 {.font-color > .b; .font-type > ._7;} +.b_9 {.font-color > .b; .font-type > ._9;} +.b_10 {.font-color > .b; .font-type > ._10;} +.b_11 {.font-color > .b; .font-type > ._11;} +.b_13 {.font-color > .b; .font-type > ._13;} +.b_15 {.font-color > .b; .font-type > ._15;} +.b_17 {.font-color > .b; .font-type > ._17;} +.b_19 {.font-color > .b; .font-type > ._19;} + +.c_1 {.font-color > .c; .font-type > ._1;} +.c_2 {.font-color > .c; .font-type > ._2;} +.c_3 {.font-color > .c; .font-type > ._3;} +.c_4 {.font-color > .c; .font-type > ._4;} +.c_5 {.font-color > .c; .font-type > ._5;} +.c_6 {.font-color > .c; .font-type > ._6;} +.c_7 {.font-color > .c; .font-type > ._7;} +.c_8 {.font-color > .c; .font-type > ._8;} +.c_9 {.font-color > .c; .font-type > ._9;} +.c_10 {.font-color > .c; .font-type > ._10;} +.c_11 {.font-color > .c; .font-type > ._11;} +.c_15 {.font-color > .c; .font-type > ._15;} +.c_16 {.font-color > .c; .font-type > ._16;} +.c_17 {.font-color > .c; .font-type > ._17;} +.c_18 {.font-color > .c; .font-type > ._18;} + +.d_1 {.font-color > .d; .font-type > ._1;} +.d_2 {.font-color > .d; .font-type > ._2;} +.d_3 {.font-color > .d; .font-type > ._3;} +.d_4 {.font-color > .d; .font-type > ._4;} +.d_5 {.font-color > .d; .font-type > ._5;} +.d_6 {.font-color > .d; .font-type > ._6;} +.d_12 {.font-color > .d; .font-type > ._12;} + +.e_1 {.font-color > .e; .font-type > ._1;} +.e_2 {.font-color > .e; .font-type > ._2;} +.e_3 {.font-color > .e; .font-type > ._3;} +.e_4 {.font-color > .e; .font-type > ._4;} +.e_5 {.font-color > .e; .font-type > ._5;} +.e_6 {.font-color > .e; .font-type > ._6;} +.e_7 {.font-color > .e; .font-type > ._7;} + +.f_1 {.font-color > .f; .font-type > ._1;} +.f_2 {.font-color > .f; .font-type > ._2;} + +.g_1 {.font-color > .g; .font-type > ._1;} +.g_2 {.font-color > .g; .font-type > ._2;} +.g_3 {.font-color > .g; .font-type > ._3;} +.g_4 {.font-color > .g; .font-type > ._4;} +.g_5 {.font-color > .g; .font-type > ._5;} +.g_6 {.font-color > .g; .font-type > ._6;} +.g_7 {.font-color > .g; .font-type > ._7;} +.g_8 {.font-color > .g; .font-type > ._8;} +.g_9 {.font-color > .g; .font-type > ._9;} +.g_10 {.font-color > .g; .font-type > ._10;} +.g_13 {.font-color > .g; .font-type > ._13;} +.g_14 {.font-color > .g; .font-type > ._14;} + +.h_1 {.font-color > .h; .font-type > ._1;} +.h_7 {.font-color > .h; .font-type > ._7;} +.h_9 {.font-color > .h; .font-type > ._9;} + +.i_1 {.font-color > .i; .font-type > ._1;} +.i_6 {.font-color > .i; .font-type > ._6;} +.i_11 {.font-color > .i; .font-type > ._11;} +.i_17 {.font-color > .i; .font-type > ._17;} + +.l_1 {.font-color > .l; .font-type > ._1;} +.l_9 {.font-color > .l; .font-type > ._9;} + +.m_4 {.font-color > .m; .font-type > ._4;} +.m_7 {.font-color > .m; .font-type > ._7;} + +.p_1 {.font-color > .p; .font-type > ._1;} +.p_3 {.font-color > .p; .font-type > ._3;} +.p_9 {.font-color > .p; .font-type > ._9;} + +.q_7 {.font-color > .q; .font-type > ._7;} +.q_9 {.font-color > .q; .font-type > ._9;} +.q_11 {.font-color > .q; .font-type > ._11;} + +.r_12 {.font-color > .r; .font-type > ._12;} + +.t_1 {.font-color > .t; .font-type > ._1;} +.t_7 {.font-color > .t; .font-type > ._7;} +.t_15 {.font-color > .t; .font-type > ._15;} + +/* Added by ikram - */ +.s_12 {.font-color > .s; .font-type > ._12;} + +.z_9 {.font-color > .z; .font-type > ._9;} +.backgroundColor { + .a {background-color: @color_a;} + .b {background-color: @color_b;} + .c {background-color: @color_c;} + .d {background-color: @color_d;} + .e {background-color: @color_e;} + .f {background-color: @color_f;} + .g {background-color: @color_g;} + .h {background-color: @color_h;} + .i {background-color: @color_i;} + .j {background-color: @color_j;} + .k {background-color: @color_k;} + .l {background-color: @color_l;} + .m {background-color: @color_m;} + .n {background-color: @color_n;} + .o {background-color: @color_o;} + .p {background-color: @color_p;} + .q {background-color: @color_q;} + .r {background-color: @color_r;} + .s {background-color: @color_s;} + .t {background-color: @color_t;} + .u {background-color: @color_u;} + .v {background-color: @color_v;} + .w {background-color: @color_w;} + .x {background-color: @color_x;} + .y {background-color: @color_y;} + .z {background-color: @color_z;} + .zz {background-color: @color_zz;} + + .hover { + .a {background-color: @color_a_hover;} + .b {background-color: @color_b_hover;} + .c {background-color: @color_c_hover;} + .d {background-color: @color_d_hover;} + .e {background-color: @color_e_hover;} + .f {background-color: @color_f_hover;} + .g {background-color: @color_g_hover;} + .h {background-color: @color_h_hover;} + .i {background-color: @color_i_hover;} + .j {background-color: @color_j_hover;} + .k {background-color: @color_k_hover;} + .l {background-color: @color_l_hover;} + .m {background-color: @color_m_hover;} + .n {background-color: @color_n_hover;} + .o {background-color: @color_o_hover;} + .p {background-color: @color_p_hover;} + .q {background-color: @color_q_hover;} + .r {background-color: @color_r_hover;} + .s {background-color: @color_s_hover;} + .t {background-color: @color_t_hover;} + .u {background-color: @color_u_hover;} + .v {background-color: @color_v_hover;} + .w {background-color: @color_w_hover;} + .x {background-color: @color_x_hover;} + .y {background-color: @color_y_hover;} + .z {background-color: @color_z_hover;} + .zz {background-color: @color_zz_hover;} + } +} + +.bg_a {.backgroundColor > .a;} +.bg_b {.backgroundColor > .b;} +.bg_c {.backgroundColor > .c;} +.bg_d {.backgroundColor > .d;} +.bg_e {.backgroundColor > .e;} +.bg_f {.backgroundColor > .f;} +.bg_g {.backgroundColor > .g;} +.bg_h {.backgroundColor > .h;} +.bg_i {.backgroundColor > .i;} +.bg_j {.backgroundColor > .j;} +.bg_k {.backgroundColor > .k;} +.bg_l {.backgroundColor > .l;} +.bg_m {.backgroundColor > .m;} +.bg_n {.backgroundColor > .n;} +.bg_o {.backgroundColor > .o;} +.bg_p {.backgroundColor > .p;} +.bg_q {.backgroundColor > .q;} +.bg_r {.backgroundColor > .r;} +.bg_s {.backgroundColor > .s;} +.bg_t {.backgroundColor > .t;} +.bg_u {.backgroundColor > .u;} +.bg_v {.backgroundColor > .v;} +.bg_w {.backgroundColor > .w;} +.bg_x {.backgroundColor > .x;} +.bg_y {.backgroundColor > .y;} +.bg_z {.backgroundColor > .z;} +.bg_zz {.backgroundColor > .zz;} + +.bg_a_hover {.backgroundColor > .hover > .a;} +.bg_b_hover {.backgroundColor > .hover > .b;} +.bg_c_hover {.backgroundColor > .hover > .c;} +.bg_d_hover {.backgroundColor > .hover > .d;} +.bg_e_hover {.backgroundColor > .hover > .e;} +.bg_f_hover {.backgroundColor > .hover > .f;} +.bg_g_hover {.backgroundColor > .hover > .g;} +.bg_h_hover {.backgroundColor > .hover > .h;} +.bg_i_hover {.backgroundColor > .hover > .i;} +.bg_j_hover {.backgroundColor > .hover > .j;} +.bg_l_hover {.backgroundColor > .hover > .l;} +.bg_m_hover {.backgroundColor > .hover > .m;} +.bg_n_hover {.backgroundColor > .hover > .n;} +.bg_o_hover {.backgroundColor > .hover > .o;} +.bg_p_hover {.backgroundColor > .hover > .p;} +.bg_q_hover {.backgroundColor > .hover > .q;} +.bg_r_hover {.backgroundColor > .hover > .r;} +.bg_s_hover {.backgroundColor > .hover > .s;} +.bg_t_hover {.backgroundColor > .hover > .t;} +.bg_u_hover {.backgroundColor > .hover > .u;} +.bg_v_hover {.backgroundColor > .hover > .v;} +.bg_w_hover {.backgroundColor > .hover > .w;} +.bg_x_hover {.backgroundColor > .hover > .x;} +.bg_y_hover {.backgroundColor > .hover > .y;} +.bg_z_hover {.backgroundColor > .hover > .z;} +.bg_zz_hover {.backgroundColor > .hover > .zz;} + +.center {margin: 0 auto;} +.vcenter {display: table-cell;vertical-align: middle;} +.left {float: left;} +.right {float: right;} +.hand {cursor: pointer;} +.default-pointer {cursor: default;} +.text-center {text-align: center;} +.display-none {display: none;} +.nowrap {white-space: nowrap;} +.bold {font-weight: bold;} +.full-height {height: 100%;} +.uppercase {text-transform: uppercase;} +.capitalize {text-transform: capitalize;} +.disabled { + //background-color: #f2f2f2; + //border-color: #d8d8d8; + //background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAIklEQVQIW2NkQAKrVq36zwjjgzhhYWGMYAEYB8RmROaABADeOQ8CXl/xfgAAAABJRU5ErkJggg==) repeat; + //color: @color_m; +} + +.border-radius(@radius) { + -webkit-border-radius: @radius; + -moz-border-radius: @radius; + border-radius: @radius; +} + +.border-radius-top-left(@radius) { + -webkit-border-top-left-radius: @radius; + -moz-border-radius-topleft: @radius; + -khtml-border-top-left-radius: @radius; + border-top-left-radius: @radius; +} + +.border-radius-top-right(@radius) { + -webkit-border-top-right-radius: @radius; + -moz-border-radius-topright: @radius; + -khtml-border-top-right-radius: @radius; + border-top-right-radius: @radius; +} + +.border-radius-bottom-left(@radius) { + -webkit-border-bottom-left-radius: @radius; + -moz-border-radius-bottomleft: @radius; + -khtml-border-bottom-left-radius: @radius; + border-bottom-left-radius: @radius; +} + +.border-radius-bottom-right(@radius) { + -webkit-border-bottom-right-radius: @radius; + -moz-border-radius-bottomright: @radius; + -khtml-border-bottom-right-radius: @radius; + border-bottom-right-radius: @radius; +} + +.opacity(@opacity: 0.5) { + -moz-opacity: @opacity; + -khtml-opacity: @opacity; + -webkit-opacity: @opacity; + opacity: @opacity; +} + +.box-shadow(@arguments) { + -webkit-box-shadow: @arguments; + -moz-box-shadow: @arguments; + box-shadow: @arguments; +} + +.square(@size) { + width: @size; + height: @size; +} + +.selfClear:after { + content: "."; + display: block; + height: 0px; + clear: both; + visibility: hidden; +} +.selfClear { + display: inline-block; +} + +.clearfix:after { + content: "."; + display: block; + clear: both; + visibility: hidden; + line-height: 0; + height: 0; +} + +.clearfix { + display: inline-block; + clear: both; +} + +.gradient(@d; @st; @st_o; @ec; @ec_0;){ + background: -webkit-linear-gradient(@d, @st @st_o, @ec @ec_0); + background: -moz-linear-gradient(@d, @st @st_o, @ec @ec_0); + background: -o-linear-gradient(@d, @st @st_o, @ec @ec_0); + background: -ms-linear-gradient(@d, @st @st_o, @ec @ec_0); + background: linear-gradient(@d, @st @st_o, @ec @ec_0); +} + +.hyphenate { + -ms-word-break: break-all; + word-break: break-all; + + // Non standard for webkit + word-break: break-word; + + -webkit-hyphens: auto; + -moz-hyphens: auto; + hyphens: auto; +} + +.user-select (@val;) { + -webkit-touch-callout: none; + -webkit-user-select: @val; + -khtml-user-select: @val; + -moz-user-select: @val; + -ms-user-select: @val; + user-select: @val; +} + +.flex-fixed (@width) { + flex-basis: @width; + flex-grow: 0; + flex-shrink: 0; +} + +.perfect-scrollbar { + position: relative; + overflow: hidden; +} + +.noselect { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.arrow(@size, @color){ + content: ''; + position: absolute; + top: 50%; + right: 100%; + margin-top: -@size; + width: 0; + height: 0; + border-right: @size solid @color; + border-top: @size solid transparent; + border-bottom: @size solid transparent; +} + +.circle(@size, @color){ + background-color: @color; + .border-radius(50%); + color: @color_c; + content: ''; + height: @size; + width: @size; + text-align: center; + display: block; +} + +.sdc-ellipsis{ + text-overflow: ellipsis; + overflow: hidden; + display: inline-block; + white-space: nowrap; + } + +// Works with animate.css +.animation-duration(@seconds) { + animation-duration: @seconds; //3s + -webkit-animation-duration: @seconds; + -moz-animation-duration: @seconds; +} + +.animation-delay(@seconds) { + animation-delay: @seconds; //3s + -webkit-animation-delay: @seconds; + -moz-animation-delay: @seconds; +} + +.animation-iterations(@iterations) { + animation-iteration-count: @iterations; // infinite; + -webkit-animation-iteration-count: @iterations; + -moz-animation-iteration-count: @iterations; +} diff --git a/catalog-ui/app/styles/modal.less b/catalog-ui/app/styles/modal.less new file mode 100644 index 0000000000..7c8bcd7c1d --- /dev/null +++ b/catalog-ui/app/styles/modal.less @@ -0,0 +1,356 @@ +/* ----------------------------------------------------- +OVERRIDE BOOTSTRAP TO CENTER MODAL VERTICALLY. +----------------------------------------------------- */ +.modal { + text-align: center; + padding: 0!important; +} + +.modal:before { + content: ''; + display: inline-block; + height: 100%; + vertical-align: middle; + margin-right: -4px; +} + +/* ----------------------------------------------------- +MODAL SIZES +----------------------------------------------------- */ +.modal-dialog.modal-sdc-xl { + width: 1200px; +} + +.modal-dialog.modal-sdc-l { + width: 875px; +} + +.modal-dialog.modal-sdc-md { + width: 650px; +} + +.modal-dialog.modal-sdc-sm { + width: 552px; +} + +.modal-dialog.modal-sdc-xsm { + width: 432px; +} + +/* ----------------------------------------------------- +MODAL WRAPPER +----------------------------------------------------- */ +.modal-dialog { + /* + margin-top: 110px; + width: 1000px; + */ + display: inline-block; + text-align: left; + vertical-align: middle; +} + +.modal-content { + /*.border-radius(4px); + background-color: #ffffff; + box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.5); + min-height: 200px;*/ +} + +.modal-backdrop.in { + // opacity: .8; +} + +.modal-backdrop { + background-color: #111922; //TODO: Replace the color +} + +/* ----------------------------------------------------- +PREVIOUS MODAL +----------------------------------------------------- */ +/*.w-sdc-modal, +.modal-dialog, +.w-sdc-modal-confirmation { + + .w-sdc-modal-head { + .s_18_r; + height: 48px; + line-height: 48px; + text-align: center; + } + + .w-sdc-modal-body { + height: auto; + padding: 20px 40px 20px 40px; + border-bottom: solid 1px @color_a; + position: relative; + } + + .w-sdc-modal-body-content { + .b_1; + padding: 10px 0 0 0; + } + + .w-sdc-modal-icon { + display: inline-block; + } + + .w-sdc-modal-icon-DEBUG { .sprite; .message-DEBUG;} + .w-sdc-modal-icon-INFO { .sprite; .message-INFO;} + .w-sdc-modal-icon-WARNING { .sprite; .message-WARNING;} + .w-sdc-modal-icon-ERROR { .sprite; .message-ERROR;} + + .w-sdc-modal-caption { + .a_6; + display: inline-block; + padding: 0 0 0 25px; + vertical-align: top; + } + + .w-sdc-modal-action { + height: 99px; + text-align: center; + vertical-align: middle; + line-height: 105px; + } + + .sdc-resource-viewer-modal-head { + .c_2; + border-radius: 6px 6px 0 0; + height: 30px; + line-height: 30px; + text-align: center; + } + + .w-sdc-modal-close { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAANCAYAAACdKY9CAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDE0IDc5LjE1Njc5NywgMjAxNC8wOC8yMC0wOTo1MzowMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTQgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkZDQUM1MUVFMDg1NDExRTVBMzdBQ0IxMzM2OTYwNjM2IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkZDQUM1MUVGMDg1NDExRTVBMzdBQ0IxMzM2OTYwNjM2Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RkNBQzUxRUMwODU0MTFFNUEzN0FDQjEzMzY5NjA2MzYiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RkNBQzUxRUQwODU0MTFFNUEzN0FDQjEzMzY5NjA2MzYiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4EGRD0AAAAhElEQVR42mL8/+8fAxAIAvF7BvwArIYJSKQB8V0gNsajGKEGaMMZIP4PxO+A2BhkIxpOg8qDcAdIQBCPJmTFM8HOh0pg04ShGFkDNk0YitE1wDTdRVK8Ct1P+DyINSAY8HgQa0DgDA1coYdLMc7QQ464mVgiDV0TPOLKcShG1gRWAxBgACObyGI1tr+eAAAAAElFTkSuQmCC'); + color: #3499F7; //TODO: Replace the color, should be sprite + .hand; + position: absolute; + right: 20px; + top: 20px; + display: block; + height: 13px; + width: 12px; + border-radius: 50%; + } + + .w-sdc-resource-viewer-modal-close { + color: #3499F7; //TODO: Replace the color, should be sprite + .hand; + position: absolute; + right: 20px; + top: 5px; + display: block; + line-height: normal; + font-size: 18px; + font-weight: bold; + } + +}*/ + +/* ----------------------------------------------------- +NEW DESIGN MODAL +----------------------------------------------------- */ +.modal-type-standard.w-sdc-classic-modal { + .w-sdc-modal-head { + border-bottom: solid 3px @main_color_a; + } +} +.modal-type-error.w-sdc-classic-modal { + .w-sdc-modal-head { + border-bottom: solid 3px @func_color_q; + } +} +.modal-type-alert.w-sdc-classic-modal { + .w-sdc-modal-head { + border-bottom: solid 3px @main_color_h; + } +} + +.w-sdc-classic-modal { + + display: flex; + flex-direction: column; + .border-radius(4px); + background-color: #ffffff; + box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.5); + min-height: 165px; + min-width: 430px; + + .w-sdc-modal-head { + flex-grow: 1; + .s_18_m; + height: 48px; + line-height: 48px; + display: flex; + text-align: left; + border-bottom: solid 3px @main_color_a; + align-items: center; + + .w-sdc-modal-head-text { + .s_18_m; + flex-grow: 999; + } + + .w-sdc-modal-close { + flex-grow: 1; + .sprite; + .sprite.x-btn-black; + cursor: pointer; + } + } + + .w-sdc-modal-body { + flex-grow: 999; + .m_14_r; + padding-top: 20px; + position: relative; + border-bottom: none; + } + + .w-sdc-modal-footer { + clear: both; + flex-grow: 1; + display: flex; + align-items: center; + justify-content: flex-end; + border-radius: 6px; + background-color: #f8f8f8; + + button { + display: block; + margin-right: 11px; + } + + button:last-child { + margin-right: 0; + } + + } + +} + +.w-sdc-classic-top-line-modal { + + display: flex; + flex-direction: column; + background-color: #ffffff; + box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.5); + min-height: 165px; + min-width: 430px; + border-top: solid 3px @main_color_a; + + .w-sdc-modal-head { + flex-grow: 1; + .s_18_r; + height: 48px; + line-height: 48px; + display: flex; + text-align: left; + align-items: center; + + .w-sdc-modal-head-text { + .s_18_m; + flex-grow: 999; + } + + .w-sdc-modal-close { + flex-grow: 1; + .sprite; + .sprite.x-btn-black; + cursor: pointer; + } + } + + .w-sdc-modal-body { + flex-grow: 999; + .m_14_r; + padding-top: 10px; + position: relative; + border-bottom: none; + } + + .w-sdc-modal-footer { + flex-grow: 1; + display: flex; + align-items: center; + justify-content: flex-end; + + button { + display: block; + margin-right: 11px; + } + + button:last-child { + margin-right: 0; + } + + } + +} + +.modal-sdc-xl { + .w-sdc-classic-modal { + padding: 0 40px; + + .w-sdc-modal-head { + .b_15; + height: 60px; + line-height: 60px; + + .w-sdc-modal-head-text { + flex-grow: 999; + } + + .w-sdc-modal-close { + top: 27px; + right: 41px; + } + } + + .w-sdc-modal-footer { + height: 80px; + margin: 0 -40px; + padding: 0 40px; + background-color: #f2f2f2; + } + + } +} + +.modal-sdc-xl, +.modal-sdc-l, +.modal-sdc-md, +.modal-sdc-sm, +.modal-sdc-xsm { + + .w-sdc-classic-top-line-modal { + padding: 0 30px; + + .w-sdc-modal-footer { + margin: 0 -30px; + padding: 17px 30px; + } + } + + .w-sdc-classic-modal { + padding: 0 30px; + + .w-sdc-modal-head { + .b_19; + height: 50px; + line-height: 50px; + + .w-sdc-modal-close { + top: 21px; + right: 30px; + } + } + + .w-sdc-modal-footer { + margin: 0 -30px; + padding: 17px 30px; + } + } +} diff --git a/catalog-ui/app/styles/scroller.less b/catalog-ui/app/styles/scroller.less new file mode 100644 index 0000000000..fcdaf12f3f --- /dev/null +++ b/catalog-ui/app/styles/scroller.less @@ -0,0 +1,15 @@ +// Inside +.ps-container > .ps-scrollbar-y-rail > .ps-scrollbar-y { + .bg_b; + .border-radius(0px); + opacity: 1; + width: 6px; + margin: 0 2px; +} +// Outside +.ps-container > .ps-scrollbar-y-rail{ + .border-radius(0px); + width: 10px ; + background-color: rgba(255,255,255,0.5); + z-index: 1000; +} diff --git a/catalog-ui/app/styles/sprite-old.less b/catalog-ui/app/styles/sprite-old.less new file mode 100644 index 0000000000..cb2dc2fbe0 --- /dev/null +++ b/catalog-ui/app/styles/sprite-old.less @@ -0,0 +1,132 @@ +.sprite { + background-image: url('images/sprites/sprite-global-old.png'); + display: inline-block; +} + +.sprite.logo { background-position: -50px -100px; width: 39px; height: 32px;} +.sprite.white-arrow-down { background-position: -50px -200px; width: 15px; height: 9px;} +.sprite.white-arrow-up { background-position: -100px -200px; width: 15px; height: 9px;} +.arrow-left { background-position: -262px -4041px; width: 11px; height: 10px;} +.sprite.tab-info { background-position: -50px -300px; width: 18px; height: 20px;} +.sprite.edit { background-position: -51px -689px; width: 31px; height: 30px;} +.sprite.details { background-position: -50px -900px; width: 19px; height: 19px;} +.sprite.structure { background-position: -212px -3880px; width: 23px; height: 21px;} +.sprite.artifacts { background-position: -50px -1098px; width: 20px; height: 20px;} +.sprite.menu { background-position: -50px -1200px; width: 17px; height: 14px;} +.sprite.catalog { background-position: -53px -1303px; width: 20px; height: 20px;} +.sprite.distribution { background-position: -50px -1400px; width: 24px; height: 14px;} +.sprite.support { background-position: -50px -1500px; width: 22px; height: 22px;} +.sprite.filter { background-position: -50px -1600px; width: 15px; height: 16px;} +.sprite.card-menu { background-position: -50px -2000px; width: 4px; height: 16px;} +.sprite.relationships { background-position: -50px -2097px; width: 26px; height: 19px;} +.sprite.lifecycle { background-position: -50px -2200px; width: 20px; height: 20px;} +.sprite.properties { background-position: -50px -2300px; width: 19px; height: 19px;} +.sprite.e-sdc-small-icon-delete { background-position: -64px -2771px; width: 11px; height: 13px;} +.sprite.magnification-glass { background-position: -49px -3138px; width: 12px; height: 12px;} +.sprite.clear-text { background-position: -104px -4040px; width: 10px; height: 11px;} +/*new tabs icons*/ +.sprite.info { background-position: -105px -3583px; width: 18px; height: 18px;} +.sprite.information-artifacts { background-position: -105px -3632px; width: 20px; height: 21px;} +.sprite.deployment-artifacts { background-position: -105px -3682px; width: 19px; height: 19px;} +.sprite.properties { background-position: -105px -3733px; width: 18px; height: 18px;} +.sprite.relations { background-position: -105px -3781px; width: 20px; height: 20px;} +.sprite.inputs { background-position: -104px -3887px; width: 18px; height: 14px;} +.sprite.api { background-position: -104px -3930px; width: 25px; height: 21px;} + +.sprite.NOT_CERTIFIED_CHECKOUT { background-position: -54px -2887px; width: 13px; height: 13px;} +.sprite.CERTIFICATION_IN_PROGRESS { background-position: -54px -2934px; width: 13px; height: 16px;} +.sprite.NOT_CERTIFIED_CHECKIN { background-position: -54px -2985px; width: 13px; height: 15px;} +.sprite.CERTIFIED { background-position: -54px -3034px; width: 13px; height: 16px;} +.sprite.READY_FOR_CERTIFICATION { background-position: -49px -3087px; width: 23px; height: 16px;} + +.message-DEBUG { background-position: -51px -3187px; width: 47px; height: 47px;} +.message-INFO { background-position: -51px -3187px; width: 47px; height: 47px;} +.message-WARNING { background-position: -51px -3187px; width: 47px; height: 47px;} +.message-ERROR { background-position: -51px -3187px; width: 47px; height: 47px;} + +.e-sdc-small-icon-eye { background-position: -60px -2722px; width: 20px; height: 20px;} +.e-sdc-small-icon-pencil { background-position: -51px -3339px; width: 12px; height: 12px;} +.e-sdc-small-icon-pad { background-position: -157px -2772px; width: 15px; height: 12px;} +.sprite.e-sdc-small-icon-trash { background-position: -48px -300px; width: 20px; height: 20px;} +.sprite.e-sdc-small-check { background-position: -48px -399px; width: 20px; height: 20px;} +.sprite.e-sdc-small-clone { background-position: -49px -501px; width: 20px; height: 20px;} +.sprite.e-sdc-small-print-screen { background-position: -49px -351px; width: 19px; height: 20px;} +.sprite.e-sdc-small-certification { background-position: -48px -602px; width: 20px; height: 20px;} +.sprite.e-sdc-small-download { background-position: -51px -3390px; width: 12px; height: 11px;} +.sprite.e-sdc-cloud { background-position: -51px -3278px; width: 24px; height: 23px;} +.sprite.e-sdc-pencil { background-position: -53px -2404px; width: 16px; height: 16px;} +.sprite.e-sdc-green-save { background-position: -157px -4089px; width: 12px; height: 12px;} + +/* canvas items non-certified indicator */ +.s-sdc-state-non-certified { background-position: -157px -3386px; width: 15px; height: 15px;} + +/* dashboard card main icons */ +.s-sdc-service { background-position: -60px -2654px; width: 14px; height: 17px;} +.s-sdc-resource { background-position: -54px -2585px; width: 16px; height: 16px;} + +/* dashboard card statuses icons */ +.s-sdc-state.NOT_CERTIFIED_CHECKIN { background-position: -47px -2839px; width: 20px; height: 19px;} +.s-sdc-state.NOT_CERTIFIED_CHECKIN.green { background-position: -70px -2839px;} +.s-sdc-state.NOT_CERTIFIED_CHECKIN.red { background-position: -93px -2839px;} + +.s-sdc-state.NOT_CERTIFIED_CHECKOUT { background-position: -53px -2889px; width: 14px; height: 14px;} +.s-sdc-state.NOT_CERTIFIED_CHECKOUT.green { background-position: -76px -2889px;} +.s-sdc-state.NOT_CERTIFIED_CHECKOUT.red { background-position: -99px -2889px;} + +.s-sdc-state.CERTIFIED { background-position: -53px -3034px; width: 14px; height: 16px;} +.s-sdc-state.CERTIFIED.green { background-position: -76px -3034px;} +.s-sdc-state.CERTIFIED.red { background-position: -99px -3034px;} + +.s-sdc-state.READY_FOR_CERTIFICATION { background-position: -53px -2985px; width: 14px; height: 16px;} +.s-sdc-state.READY_FOR_CERTIFICATION.green { background-position: -76px -2985px;} +.s-sdc-state.READY_FOR_CERTIFICATION.red { background-position: -99px -2985px;} + +.s-sdc-state.CERTIFICATION_IN_PROGRESS { background-position: -53px -2934px; width: 14px; height: 16px;} +.s-sdc-state.CERTIFICATION_IN_PROGRESS.green { background-position: -76px -2934px;} +.s-sdc-state.CERTIFICATION_IN_PROGRESS.red { background-position: -99px -2934px; } + +.s-sdc-state.DISTRIBUTED { background-position: -43px -3087px; width: 24px; height: 14px;} +.s-sdc-state.DISTRIBUTED.green { background-position: -76px -3087px;} +.s-sdc-state.DISTRIBUTED.red { background-position: -113px -3087px;} + +.sprite.e-sdc-small-blue-down-arrow { background-position: -51px -3262px; width: 10px; height: 7px;} +.sprite.e-sdc-small-blue-up-arrow { background-position: -111px -3262px; width: 10px; height: 7px;} + +.e-checkbox-unchecked { background-position: -51px -3490px; width: 12px; height: 11px;} +.e-checkbox-checked { background-position: -103px -3490px; width: 12px; height: 11px;} +.e-checkbox-unchecked-disabled { background-position: -265px -3490px; width: 12px; height: 11px;} + +/* viewer modal */ +.sprite.x-btn { background-position: -50px -3438px; width: 14px; height: 13px;} +.sprite.x-btn:hover { background-position: -103px -3438px; width: 14px; height: 13px;} +.sprite.x-btn-white { background-position: -157px -3437px; width: 14px; height: 13px;} +.sprite.x-btn-white:hover { background-position: -211px -3438px; width: 14px; height: 13px;} +.sprite.x-btn-black { background-position: -52px -4041px; width: 10px; height: 11px;} +.sprite.x-btn-black:hover { background-position: -104px -4041px; width: 10px; height: 11px;} +.sprite.small-x-btn-black { background-position: -157px -4044px; width: 8px; height: 8px;} +.sprite.small-x-btn-black:hover { background-position: -211px -4044px; width: 8px; height: 8px;} + + +/* input file upload icons */ +.sprite.upload-icon { background-position: -51px -3286px; width: 16px; height: 15px; } +.sprite.upload-icon-hover { background-position: -104px -3286px; } +.sprite.uploaded { background-position: -143px -3283px; width: 18px; height: 18px; } +.sprite.change-file { background-position: -261px -3285px; width: 22px; height: 16px; } +.sprite.change-file-hover { background-position: -211px -3285px; } +.sprite.e-sdc-small-icon-upload { background-position: -104px -4188px; width: 12px; height: 13px; } + +/* error messages icons */ +.exclamation-mark-white-icon { background-position: -51px -3990px; width: 13px; height: 11px; } +.exclamation-mark-red-icon { background-position: -212px -3990px; width: 13px; height: 11px; } +.question-message-icon-gray { background-position: -104px -3987px; width: 14px; height: 14px; } +.question-message-icon-white { background-position: -158px -3987px; width: 14px; height: 14px; } + +/* wizard icons */ +.sprite.table-arrow { background-position: -57px -4241px; width: 7px; height: 10px; } +.sprite.table-arrow.opened { background-position: -54px -4295px; width: 10px; height: 6px; } + +.sprite-green-tick { background-position: -157px -3290px; width: 15px; height: 11px; } + +/* tags category relation icon*/ +.sprite.relation-icon { background-position: -100px -4351px; width: 24px; height: 24px; } +.sprite.relation-icon-hover { background-position: -52px -4351px; width: 24px; height: 24px; } diff --git a/catalog-ui/app/styles/sprite-product-icons.less b/catalog-ui/app/styles/sprite-product-icons.less new file mode 100644 index 0000000000..3485ec89a3 --- /dev/null +++ b/catalog-ui/app/styles/sprite-product-icons.less @@ -0,0 +1,71 @@ +.sprite-product-icons { + background-image: url('images/sprites/sprite-product-icons.png'); + display: inline-block; +} + +.sprite-product-icons.disable { opacity:0.5;} + +.sprite-product-icons.setting { background-position: -291px -102px; width: 61px; height: 67px;} +.sprite-product-icons.setting.small { background-position: -217px -142px; width: 29px; height: 28px;} +.sprite-product-icons.setting.medium { background-position: -148px -130px; width: 41px; height: 40px;} +.sprite-product-icons.setting.large { background-position: -77px -110px; width: 60px; height: 60px;} + +.sprite-product-icons.cloud { background-position: -290px -215px; width: 64px; height: 43px;} +.sprite-product-icons.cloud.small { background-position: -217px -232px; width: 29px; height: 28px;} +.sprite-product-icons.cloud.medium { background-position: -148px -220px; width: 41px; height: 40px;} +.sprite-product-icons.cloud.large { background-position: -77px -200px; width: 60px; height: 60px;} + +.sprite-product-icons.security { background-position: -289px -293px; width: 50px; height: 57px;} +.sprite-product-icons.security.small { background-position: -217px -321px; width: 29px; height: 28px;} +.sprite-product-icons.security.medium { background-position: -148px -310px; width: 41px; height: 40px;} +.sprite-product-icons.security.large { background-position: -77px -290px; width: 60px; height: 60px;} + +.sprite-product-icons.network { background-position: -290px -383px; width: 56px; height: 57px;} +.sprite-product-icons.network.small { background-position: -217px -411px; width: 29px; height: 29px;} +.sprite-product-icons.network.medium { background-position: -148px -399px; width: 41px; height: 41px;} +.sprite-product-icons.network.large { background-position: -77px -380px; width: 60px; height: 60px;} + +.sprite-product-icons.orphan { background-position: -290px -478px; width: 52px; height: 52px;} +.sprite-product-icons.orphan.small { background-position: -217px -500px; width: 29px; height: 29px;} +.sprite-product-icons.orphan.medium { background-position: -148px -488px; width: 41px; height: 41px;} +.sprite-product-icons.orphan.large { background-position: -77px -470px; width: 60px; height: 60px;} + +.sprite-product-icons.defaulticon { background-position: -290px -478px; width: 52px; height: 52px;} +.sprite-product-icons.defaulticon.small { background-position: -217px -500px; width: 29px; height: 29px;} +.sprite-product-icons.defaulticon.medium { background-position: -148px -488px; width: 41px; height: 41px;} +.sprite-product-icons.defaulticon.large { background-position: -77px -470px; width: 60px; height: 60px;} + +.sprite-product-icons.vfw { background-position: -289px -548px; width: 73px; height: 73px;} +.sprite-product-icons.vfw.small { background-position: -217px -591px; width: 29px; height: 29px;} +.sprite-product-icons.vfw.medium { background-position: -148px -580px; width: 41px; height: 41px;} +.sprite-product-icons.vfw.large { background-position: -77px -560px; width: 60px; height: 61px;} + +.sprite-product-icons.wanx { background-position: -290px -664px; width: 59px; height: 47px;} +.sprite-product-icons.wanx.small { background-position: -217px -681px; width: 30px; height: 30px;} +.sprite-product-icons.wanx.medium { background-position: -148px -670px; width: 41px; height: 41px;} +.sprite-product-icons.wanx.large { background-position: -77px -651px; width: 60px; height: 60px;} + +.sprite-product-icons.vrouter { background-position: -289px -758px; width: 69px; height: 43px;} +.sprite-product-icons.vrouter.small { background-position: -217px -772px; width: 29px; height: 29px;} +.sprite-product-icons.vrouter.medium { background-position: -148px -760px; width: 41px; height: 41px;} +.sprite-product-icons.vrouter.large { background-position: -77px -741px; width: 60px; height: 60px;} + +.sprite-product-icons.ucpe { background-position: -289px -832px; width: 59px; height: 60px;} +.sprite-product-icons.ucpe.small { background-position: -217px -862px; width: 28px; height: 29px;} +.sprite-product-icons.ucpe.medium { background-position: -148px -849px; width: 41px; height: 41px;} +.sprite-product-icons.ucpe.large { background-position: -77px -831px; width: 60px; height: 61px;} + +.sprite-product-icons.mobility { background-position: -288px -919px; width: 64px; height: 62px;} +.sprite-product-icons.mobility.small { background-position: -216px -952px; width: 29px; height: 29px;} +.sprite-product-icons.mobility.medium { background-position: -147px -940px; width: 41px; height: 41px;} +.sprite-product-icons.mobility.large { background-position: -76px -921px; width: 60px; height: 60px;} + +.sprite-product-icons.wanx_customer_managed { background-position: -290px -1024px; width: 58px; height: 62px;} +.sprite-product-icons.wanx.small_customer_managed { background-position: -217px -1041px; width: 30px; height: 38px;} +.sprite-product-icons.wanx.medium_customer_managed { background-position: -148px -1030px; width: 42px; height: 47px;} +.sprite-product-icons.wanx.large_customer_managed { background-position: -77px -1011px; width: 61px; height: 66px;} + +.sprite-product-icons.wanx_attr_managed { background-position: -290px -1114px; width: 59px; height: 62px;} +.sprite-product-icons.wanx.small_att_managed { background-position: -218px -1131px; width: 31px; height: 36px;} +.sprite-product-icons.wanx.medium_att_managed { background-position: -149px -1120px; width: 42px; height: 47px;} +.sprite-product-icons.wanx.large_att_managed { background-position: -77px -1101px; width: 60px; height: 67px;} diff --git a/catalog-ui/app/styles/sprite-resource-icons.less b/catalog-ui/app/styles/sprite-resource-icons.less new file mode 100644 index 0000000000..0f36527dda --- /dev/null +++ b/catalog-ui/app/styles/sprite-resource-icons.less @@ -0,0 +1,258 @@ +.sprite-resource-icons { + background-image: url('images/sprites/sprite-resource-icons.png'); + display: inline-block; +} + +.sprite-resource-icons.disable { opacity:0.5;} + +.sprite-resource-icons.borderElement { background-position: -282px -41px; width: 66px; height: 58px;} +.sprite-resource-icons.borderElement.small { background-position: -210px -71px; width: 28px; height: 28px;} +.sprite-resource-icons.borderElement.medium { background-position: -140px -59px; width: 40px; height: 40px;} +.sprite-resource-icons.borderElement.large { background-position: -70px -39px; width: 60px; height: 60px;} + +.sprite-resource-icons.router { background-position: -282px -109px; width: 60px; height: 60px;} +.sprite-resource-icons.router.small { background-position: -210px -141px; width: 28px; height: 28px;} +.sprite-resource-icons.router.medium { background-position: -140px -129px; width: 40px; height: 40px;} +.sprite-resource-icons.router.large { background-position: -70px -109px; width: 60px; height: 60px;} + +.sprite-resource-icons.database { background-position: -282px -180px; width: 63px; height: 56px;} +.sprite-resource-icons.database.small { background-position: -210px -211px; width: 28px; height: 28px;} +.sprite-resource-icons.database.medium { background-position: -140px -199px; width: 40px; height: 40px;} +.sprite-resource-icons.database.large { background-position: -70px -179px; width: 60px; height: 60px;} + +.sprite-resource-icons.network { background-position: -282px -252px; width: 57px; height: 57px;} +.sprite-resource-icons.network.small { background-position: -210px -281px; width: 28px; height: 28px;} +.sprite-resource-icons.network.medium { background-position: -140px -269px; width: 40px; height: 40px;} +.sprite-resource-icons.network.large { background-position: -70px -249px; width: 60px; height: 60px;} + +.sprite-resource-icons.applicationServer { background-position: -282px -327px; width: 37px; height: 51px;} +.sprite-resource-icons.applicationServer.small { background-position: -210px -351px; width: 28px; height: 28px;} +.sprite-resource-icons.applicationServer.medium { background-position: -140px -339px; width: 40px; height: 40px;} +.sprite-resource-icons.applicationServer.large { background-position: -70px -319px; width: 60px; height: 60px;} + +.sprite-resource-icons.server { background-position: -282px -398px; width: 31px; height: 51px;} +.sprite-resource-icons.server.small { background-position: -210px -421px; width: 28px; height: 28px;} +.sprite-resource-icons.server.medium { background-position: -140px -409px; width: 40px; height: 40px;} +.sprite-resource-icons.server.large { background-position: -70px -389px; width: 60px; height: 60px;} + +.sprite-resource-icons.port { background-position: -281px -484px; width: 41px; height: 35px;} +.sprite-resource-icons.port.small { background-position: -210px -491px; width: 28px; height: 28px;} +.sprite-resource-icons.port.medium { background-position: -140px -479px; width: 40px; height: 40px;} +.sprite-resource-icons.port.large { background-position: -70px -459px; width: 60px; height: 60px;} + +.sprite-resource-icons.loadBalancer { background-position: -282px -539px; width: 45px; height: 49px;} +.sprite-resource-icons.loadBalancer.small { background-position: -210px -561px; width: 28px; height: 28px;} +.sprite-resource-icons.loadBalancer.medium { background-position: -140px -549px; width: 40px; height: 40px;} +.sprite-resource-icons.loadBalancer.large { background-position: -70px -529px; width: 60px; height: 60px;} + +.sprite-resource-icons.objectStorage { background-position: -282px -611px; width: 50px; height: 47px;} +.sprite-resource-icons.objectStorage.small { background-position: -210px -631px; width: 28px; height: 28px;} +.sprite-resource-icons.objectStorage.medium { background-position: -140px -619px; width: 40px; height: 40px;} +.sprite-resource-icons.objectStorage.large { background-position: -70px -599px; width: 60px; height: 60px;} + +.sprite-resource-icons.compute { background-position: -282px -683px; width: 45px; height: 45px;} +.sprite-resource-icons.compute.small { background-position: -210px -701px; width: 28px; height: 28px;} +.sprite-resource-icons.compute.medium { background-position: -141px -688px; width: 40px; height: 40px;} +.sprite-resource-icons.compute.large { background-position: -70px -669px; width: 60px; height: 60px;} + +.sprite-resource-icons.gateway { background-position: -282px -758px; width: 45px; height: 41px} +.sprite-resource-icons.gateway.small { background-position: -210px -772px; width: 28px; height: 27px;} +.sprite-resource-icons.gateway.medium { background-position: -140px -759px; width: 40px; height: 40px;} +.sprite-resource-icons.gateway.large { background-position: -70px -739px; width: 60px; height: 60px;} + +.sprite-resource-icons.connector { background-position: -282px -830px; width: 44px; height: 38px;} +.sprite-resource-icons.connector.small { background-position: -210px -842px; width: 28px; height: 27px;} +.sprite-resource-icons.connector.medium { background-position: -140px -829px; width: 40px; height: 40px;} +.sprite-resource-icons.connector.large { background-position: -70px -809px; width: 60px; height: 60px;} + +.sprite-resource-icons.brocade { background-position: -282px -922px; width: 91px; height: 16px;} +.sprite-resource-icons.brocade.small { background-position: -210px -911px; width: 28px; height: 28px;} +.sprite-resource-icons.brocade.medium { background-position: -140px -899px; width: 40px; height: 40px;} +.sprite-resource-icons.brocade.large { background-position: -70px -879px; width: 60px; height: 60px;} + +.sprite-resource-icons.cisco { background-position: -282px -975px; width: 63px; height: 33px;} +.sprite-resource-icons.cisco.small { background-position: -210px -981px; width: 28px; height: 28px;} +.sprite-resource-icons.cisco.medium { background-position: -140px -969px; width: 40px; height: 40px;} +.sprite-resource-icons.cisco.large { background-position: -70px -949px; width: 60px; height: 60px;} + +.sprite-resource-icons.ericsson { background-position: -282px -1059px; width: 101px; height: 20px;} +.sprite-resource-icons.ericsson.small { background-position: -210px -1051px; width: 28px; height: 28px;} +.sprite-resource-icons.ericsson.medium { background-position: -140px -1039px; width: 40px; height: 40px;} +.sprite-resource-icons.ericsson.large { background-position: -70px -1019px; width: 60px; height: 60px;} + +.sprite-resource-icons.tropo { background-position: -282px -1109px; width: 48px; height: 39px;} +.sprite-resource-icons.tropo.small { background-position: -210px -1121px; width: 28px; height: 28px;} +.sprite-resource-icons.tropo.medium { background-position: -140px -1109px; width: 40px; height: 40px;} +.sprite-resource-icons.tropo.large { background-position: -70px -1089px; width: 60px; height: 60px;} + +.sprite-resource-icons.mySql { background-position: -282px -1172px; width: 89px; height: 46px;} +.sprite-resource-icons.mySql.small { background-position: -210px -1191px; width: 28px; height: 28px;} +.sprite-resource-icons.mySql.medium { background-position: -140px -1179px; width: 40px; height: 40px;} +.sprite-resource-icons.mySql.large { background-position: -70px -1159px; width: 60px; height: 60px;} + +.sprite-resource-icons.oracle { background-position: -282px -1277px; width: 97px; height: 11px;} +.sprite-resource-icons.oracle.small { background-position: -210px -1261px; width: 28px; height: 28px;} +.sprite-resource-icons.oracle.medium { background-position: -140px -1249px; width: 40px; height: 40px;} +.sprite-resource-icons.oracle.large { background-position: -70px -1229px; width: 60px; height: 60px;} + +.sprite-resource-icons.defaulticon { background-position: -282px -2069px; width: 60px; height: 60px;} +.sprite-resource-icons.defaulticon.small { background-position: -210px -2101px; width: 28px; height: 28px;} +.sprite-resource-icons.defaulticon.medium { background-position: -141px -2089px; width: 40px; height: 40px;} +.sprite-resource-icons.defaulticon.large { background-position: -70px -2069px; width: 60px; height: 60px;} + +.sprite-resource-icons.fortinet { background-position: -282px -1419px; width: 94px; height: 10px;} +.sprite-resource-icons.fortinet.small { background-position: -210px -1401px; width: 28px; height: 28px;} +.sprite-resource-icons.fortinet.medium { background-position: -140px -1389px; width: 40px; height: 40px;} +.sprite-resource-icons.fortinet.large { background-position: -70px -1369px; width: 60px; height: 60px;} + +.sprite-resource-icons.nokia_siemens { background-position: -281px -1474px; width: 89px; height: 25px;} +.sprite-resource-icons.nokia_siemens.small { background-position: -210px -1471px; width: 28px; height: 28px;} +.sprite-resource-icons.nokia_siemens.medium { background-position: -140px -1459px; width: 40px; height: 40px;} +.sprite-resource-icons.nokia_siemens.large { background-position: -70px -1439px; width: 60px; height: 60px;} + +.sprite-resource-icons.att { background-position: -281px -1538px; width: 77px; height: 31px;} +.sprite-resource-icons.att.small { background-position: -210px -1541px; width: 28px; height: 28px;} +.sprite-resource-icons.att.medium { background-position: -140px -1529px; width: 40px; height: 40px;} +.sprite-resource-icons.att.large { background-position: -70px -1509px; width: 60px; height: 60px;} + +.sprite-resource-icons.juniper { background-position: -281px -1609px; width: 93px; height: 31px;} +.sprite-resource-icons.juniper.small { background-position: -210px -1611px; width: 28px; height: 28px;} +.sprite-resource-icons.juniper.medium { background-position: -140px -1599px; width: 40px; height: 40px;} +.sprite-resource-icons.juniper.large { background-position: -70px -1579px; width: 60px; height: 60px;} + +.sprite-resource-icons.cloud { background-position: -281px -1664px; width: 44px; height: 45px;} +.sprite-resource-icons.cloud.small { background-position: -210px -1681px; width: 28px; height: 28px;} +.sprite-resource-icons.cloud.medium { background-position: -140px -1669px; width: 40px; height: 40px;} +.sprite-resource-icons.cloud.large { background-position: -70px -1649px; width: 60px; height: 60px;} + +.sprite-resource-icons.call_controll { background-position: -278px -1739px; width: 35px; height: 40px;} +.sprite-resource-icons.call_controll.small { background-position: -210px -1751px; width: 28px; height: 28px;} +.sprite-resource-icons.call_controll.medium { background-position: -140px -1739px; width: 40px; height: 40px;} +.sprite-resource-icons.call_controll.large { background-position: -70px -1719px; width: 60px; height: 60px;} + +.sprite-resource-icons.broadsoft { background-position: -282px -1824px; width: 108px; height: 22px;} +.sprite-resource-icons.broadsoft.small { background-position: -210px -1821px; width: 28px; height: 28px;} +.sprite-resource-icons.broadsoft.medium { background-position: -140px -1809px; width: 40px; height: 40px;} +.sprite-resource-icons.broadsoft.large { background-position: -70px -1789px; width: 60px; height: 60px;} + +.sprite-resource-icons.alcatelLucent { background-position: -281px -1901px; width: 118px; height: 25px;} +.sprite-resource-icons.alcatelLucent.small { background-position: -210px -1891px; width: 28px; height: 28px;} +.sprite-resource-icons.alcatelLucent.medium { background-position: -140px -1879px; width: 40px; height: 40px;} +.sprite-resource-icons.alcatelLucent.large { background-position: -70px -1859px; width: 60px; height: 60px;} + +.sprite-resource-icons.metaswitch { background-position: -282px -1961px; width: 115px; height: 27px;} +.sprite-resource-icons.metaswitch.small { background-position: -210px -1961px; width: 28px; height: 28px;} +.sprite-resource-icons.metaswitch.medium { background-position: -140px -1949px; width: 40px; height: 40px;} +.sprite-resource-icons.metaswitch.large { background-position: -70px -1929px; width: 61px; height: 60px;} + +.sprite-resource-icons.aricent { background-position: -282px -2046px; width: 93px; height: 13px;} +.sprite-resource-icons.aricent.small { background-position: -210px -2031px; width: 28px; height: 28px;} +.sprite-resource-icons.aricent.medium { background-position: -140px -2019px; width: 40px; height: 40px;} +.sprite-resource-icons.aricent.large { background-position: -70px -1999px; width: 60px; height: 60px;} + +.sprite-resource-icons.cp { background-position: -90px -4038px; width: 21px; height: 21px;} +.sprite-resource-icons.cp.small { background-position: -90px -4038px; width: 21px; height: 21px;} +.sprite-resource-icons.cp.medium { background-position: -151px -4048px; width: 21px; height: 21px;} +.sprite-resource-icons.cp.large { background-position: -194px -4034px; width: 60px; height: 60px;} + +.sprite-resource-icons.vl { background-position: -210px -2591px; width: 28px; height: 28px;} +.sprite-resource-icons.vl.small { background-position: -210px -2591px; width: 28px; height: 28px;} +.sprite-resource-icons.vl.medium { background-position: -141px -2579px; width: 40px; height: 40px;} +.sprite-resource-icons.vl.large { background-position: -70px -2560px; width: 60px; height: 60px;} + +.sprite-resource-icons.cloudep { background-position: -282px -2225px; width: 63px; height: 43px;} +.sprite-resource-icons.cloudep.small { background-position: -209px -2241px; width: 28px; height: 28px;} +.sprite-resource-icons.cloudep.medium { background-position: -141px -2229px; width: 40px; height: 40px;} +.sprite-resource-icons.cloudep.large { background-position: -70px -2209px; width: 60px; height: 60px;} + +.sprite-resource-icons.personep { background-position: -282px -2292px; width: 47px; height: 47px;} +.sprite-resource-icons.personep.small { background-position: -210px -2311px; width: 28px; height: 28px;} +.sprite-resource-icons.personep.medium { background-position: -141px -2299px; width: 40px; height: 40px;} +.sprite-resource-icons.personep.large { background-position: -70px -2279px; width: 60px; height: 60px;} + +.sprite-resource-icons.premisesep { background-position: -281px -2360px; width: 41px; height: 50px;} +.sprite-resource-icons.premisesep.small { background-position: -210px -2380px; width: 28px; height: 28px;} +.sprite-resource-icons.premisesep.medium { background-position: -141px -2368px; width: 40px; height: 40px;} +.sprite-resource-icons.premisesep.large { background-position: -70px -2349px; width: 60px; height: 60px;} + +.sprite-resource-icons.ossep { background-position: -281px -2420px; width: 67px; height: 59px;} +.sprite-resource-icons.ossep.small { background-position: -210px -2451px; width: 28px; height: 28px;} +.sprite-resource-icons.ossep.medium { background-position: -141px -2439px; width: 40px; height: 40px;} +.sprite-resource-icons.ossep.large { background-position: -70px -2419px; width: 60px; height: 60px;} + +.sprite-resource-icons.firewall { background-position: -282px -3257px; width: 73px; height: 74px;} +.sprite-resource-icons.firewall.small { background-position: -210px -3301px; width: 29px; height: 29px;} +.sprite-resource-icons.firewall.medium { background-position: -141px -3289px; width: 41px; height: 41px;} +.sprite-resource-icons.firewall.large { background-position: -70px -3270px; width: 60px; height: 60px;} + +.sprite-resource-icons.vfw { background-position: -282px -3257px; width: 73px; height: 74px;} +.sprite-resource-icons.vfw.small { background-position: -210px -3301px; width: 29px; height: 29px;} +.sprite-resource-icons.vfw.medium { background-position: -141px -3289px; width: 41px; height: 41px;} +.sprite-resource-icons.vfw.large { background-position: -70px -3270px; width: 60px; height: 60px;} + +.sprite-resource-icons.ucpe { background-position: -282px -3120px; width: 59px; height: 60px;} +.sprite-resource-icons.ucpe.small { background-position: -210px -3150px; width: 28px; height: 28px;} +.sprite-resource-icons.ucpe.medium { background-position: -141px -3137px; width: 41px; height: 41px;} +.sprite-resource-icons.ucpe.large { background-position: -70px -3119px; width: 60px; height: 60px;} + +.sprite-resource-icons.vrouter { background-position: -282px -3066px; width: 69px; height: 43px;} +.sprite-resource-icons.vrouter.small { background-position: -210px -3080px; width: 29px; height: 29px;} +.sprite-resource-icons.vrouter.medium { background-position: -141px -3068px; width: 41px; height: 41px;} +.sprite-resource-icons.vrouter.large { background-position: -70px -3049px; width: 60px; height: 60px;} + +.sprite-resource-icons.wanx { background-position: -283px -2992px; width: 58px; height: 47px;} +.sprite-resource-icons.wanx.small { background-position: -210px -3009px; width: 30px; height: 30px;} +.sprite-resource-icons.wanx.medium { background-position: -141px -2998px; width: 41px; height: 41px;} +.sprite-resource-icons.wanx.large { background-position: -70px -2979px; width: 60px; height: 60px;} + +//.sprite-resource-icons.roles { background-position: -282px -2069px; width: 60px; height: 60px;} +//.sprite-resource-icons.roles.small { background-position: -210px -2101px; width: 28px; height: 28px;} +//.sprite-resource-icons.roles.medium { background-position: -141px -2089px; width: 40px; height: 40px;} +//.sprite-resource-icons.roles.large { background-position: -70px -2069px; width: 60px; height: 60px;} + +.sprite-resource-icons.networkrules { background-position: -282px -4731px; width: 49px; height: 58px;} +.sprite-resource-icons.networkrules.small { background-position: -210px -4749px; width: 31px; height: 36px;} +.sprite-resource-icons.networkrules.medium { background-position: -141px -4737px; width: 42px; height: 47px;} +.sprite-resource-icons.networkrules.large { background-position: -70px -4718px; width: 60px; height: 67px;} + +.sprite-resource-icons.securityrules { background-position: -282px -4651px; width: 49px; height: 58px;} +.sprite-resource-icons.securityrules.small { background-position: -210px -4669px; width: 31px; height: 36px;} +.sprite-resource-icons.securityrules.medium { background-position: -141px -4657px; width: 42px; height: 47px;} +.sprite-resource-icons.securityrules.large { background-position: -70px -4638px; width: 60px; height: 67px;} + +.sprite-resource-icons.dcae_source { background-position: -282px -4563px; width: 60px; height: 60px;} +.sprite-resource-icons.dcae_source.small { background-position: -210px -4588px; width: 29px; height: 29px;} +.sprite-resource-icons.dcae_source.medium { background-position: -141px -4576px; width: 41px; height: 41px;} +.sprite-resource-icons.dcae_source.large { background-position: -70px -4558px; width: 60px; height: 60px;} + +.sprite-resource-icons.dcae_collector { background-position: -280px -4500px; width: 60px; height: 60px;} +.sprite-resource-icons.dcae_collector.small { background-position: -210px -4508px; width: 29px; height: 29px;} +.sprite-resource-icons.dcae_collector.medium { background-position: -141px -4496px; width: 41px; height: 41px;} +.sprite-resource-icons.dcae_collector.large { background-position: -69px -4477px; width: 60px; height: 60px;} + +.sprite-resource-icons.dcae_utilty { background-position: -283px -4246px; width: 60px; height: 60px;} +.sprite-resource-icons.dcae_utilty.small { background-position: -210px -4268px; width: 29px; height: 29px;} +.sprite-resource-icons.dcae_utilty.medium { background-position: -141px -4256px; width: 41px; height: 41px;} +.sprite-resource-icons.dcae_utilty.large { background-position: -70px -4238px; width: 60px; height: 60px;} + +.sprite-resource-icons.dcae_microservice { background-position: -281px -4167px; width: 60px; height: 60px;} +.sprite-resource-icons.dcae_microservice.small { background-position: -210px -4188px; width: 28px; height: 28px;} +.sprite-resource-icons.dcae_microservice.medium { background-position: -140px -4176px; width: 41px; height: 41px;} +.sprite-resource-icons.dcae_microservice.large { background-position: -71px -4157px; width: 60px; height: 60px;} + +.sprite-resource-icons.dcae_analytics { background-position: -282px -4409px; width: 60px; height: 60px;} +.sprite-resource-icons.dcae_analytics.small { background-position: -210px -4424px; width: 29px; height: 29px;} +.sprite-resource-icons.dcae_analytics.medium { background-position: -141px -4413px; width: 41px; height: 41px;} +.sprite-resource-icons.dcae_analytics.large { background-position: -70px -4394px; width: 60px; height: 60px;} + +.sprite-resource-icons.dcae_database { background-position: -282px -180px; width: 63px; height: 56px;} +.sprite-resource-icons.dcae_database.small { background-position: -210px -211px; width: 29px; height: 29px;} +.sprite-resource-icons.dcae_database.medium { background-position: -140px -199px; width: 40px; height: 40px;} +.sprite-resource-icons.dcae_database.large { background-position: -70px -179px; width: 60px; height: 60px;} + + +.sprite-resource-icons.dcae_policy { background-position: -282px -4332px; width: 60px; height: 60px;} +.sprite-resource-icons.dcae_policy.small { background-position: -210px -4348px; width: 29px; height: 29px;} +.sprite-resource-icons.dcae_policy.medium { background-position: -141px -4336px; width: 41px; height: 41px;} +.sprite-resource-icons.dcae_policy.large { background-position: -70px -4317px; width: 60px; height: 60px;} + diff --git a/catalog-ui/app/styles/sprite-services-icons.less b/catalog-ui/app/styles/sprite-services-icons.less new file mode 100644 index 0000000000..d1e666ff12 --- /dev/null +++ b/catalog-ui/app/styles/sprite-services-icons.less @@ -0,0 +1,66 @@ +.sprite-services-icons { + background-image: url('images/sprites/sprite-services-icons.png'); + display: inline-block; +} + +.sprite-services-icons.disable { opacity:0.5;} + +.sprite-services-icons.compute { background-position: -282px -46px; width: 55px; height: 53px;} +.sprite-services-icons.compute.small { background-position: -210px -71px; width: 29px; height: 28px;} +.sprite-services-icons.compute.medium { background-position: -140px -59px; width: 41px; height: 40px;} +.sprite-services-icons.compute.large { background-position: -70px -41px; width: 61px; height: 60px;} + +.sprite-services-icons.platform { background-position: -282px -122px; width: 55px; height: 45px;} +.sprite-services-icons.platform.small { background-position: -210px -140px; width: 29px; height: 29px;} +.sprite-services-icons.platform.medium { background-position: -140px -128px; width: 41px; height: 41px;} +.sprite-services-icons.platform.large { background-position: -70px -109px; width: 61px; height: 60px;} + +.sprite-services-icons.storage { background-position: -282px -194px; width: 55px; height: 44px;} +.sprite-services-icons.storage.small { background-position: -210px -210px; width: 29px; height: 29px;} +.sprite-services-icons.storage.medium { background-position: -140px -198px; width: 41px; height: 41px;} +.sprite-services-icons.storage.large { background-position: -70px -178px; width: 61px; height: 61px;} + +.sprite-services-icons.call_controll { background-position: -282px -268px; width: 36px; height: 41px;} +.sprite-services-icons.call_controll.small { background-position: -210px -280px; width: 29px; height: 29px;} +.sprite-services-icons.call_controll.medium { background-position: -140px -268px; width: 41px; height: 41px;} +.sprite-services-icons.call_controll.large { background-position: -70px -248px; width: 61px; height: 61px;} + +.sprite-services-icons.collaboration { background-position: -282px -335px; width: 43px; height: 44px;} +.sprite-services-icons.collaboration.small { background-position: -210px -350px; width: 29px; height: 29px;} +.sprite-services-icons.collaboration.medium { background-position: -140px -338px; width: 41px; height: 41px;} +.sprite-services-icons.collaboration.large { background-position: -70px -318px; width: 61px; height: 61px;} + +.sprite-services-icons.collaboration1 { background-position: -280px -417px; width: 49px; height: 32px;} +.sprite-services-icons.collaboration1.small { background-position: -209px -419px; width: 29px; height: 29px;} +.sprite-services-icons.collaboration1.medium { background-position: -140px -408px; width: 41px; height: 41px;} +.sprite-services-icons.collaboration1.large { background-position: -70px -388px; width: 61px; height: 61px;} + +.sprite-services-icons.messaging { background-position: -282px -482px; width: 43px; height: 40px;} +.sprite-services-icons.messaging.small { background-position: -210px -491px; width: 28px; height: 28px;} +.sprite-services-icons.messaging.medium { background-position: -140px -478px; width: 41px; height: 41px;} +.sprite-services-icons.messaging.large { background-position: -70px -458px; width: 61px; height: 61px;} + +.sprite-services-icons.notification { background-position: -282px -538px; width: 43px; height: 52px;} +.sprite-services-icons.notification.small { background-position: -210px -561px; width: 28px; height: 28px;} +.sprite-services-icons.notification.medium { background-position: -140px -548px; width: 41px; height: 41px;} +.sprite-services-icons.notification.large { background-position: -70px -528px; width: 60px; height: 60px;} + +.sprite-services-icons.mobility { background-position: -282px -598px; width: 64px; height: 62px;} +.sprite-services-icons.mobility.small { background-position: -210px -630px; width: 29px; height: 29px;} +.sprite-services-icons.mobility.medium { background-position: -140px -618px; width: 41px; height: 41px;} +.sprite-services-icons.mobility.large { background-position: -70px -601px; width: 60px; height: 60px;} + +.sprite-services-icons.network_l_1-3 { background-position: -282px -672px; width: 63px; height: 57px;} +.sprite-services-icons.network_l_1-3.small { background-position: -210px -701px; width: 28px; height: 28px;} +.sprite-services-icons.network_l_1-3.medium { background-position: -139px -688px; width: 41px; height: 41px;} +.sprite-services-icons.network_l_1-3.large { background-position: -70px -671px; width: 60px; height: 60px;} + +.sprite-services-icons.network_l_4 { background-position: -286px -744px; width: 63px; height: 57px;} +.sprite-services-icons.network_l_4.small { background-position: -210px -771px; width: 28px; height: 28px;} +.sprite-services-icons.network_l_4.medium { background-position: -140px -758px; width: 41px; height: 41px;} +.sprite-services-icons.network_l_4.large { background-position: -70px -740px; width: 61px; height: 61px;} + +.sprite-services-icons.defaulticon { background-position: -270px -810px; width: 60px; height: 60px;} +.sprite-services-icons.defaulticon.small { background-position: -220px -842px; width: 28px; height: 28px;} +.sprite-services-icons.defaulticon.medium { background-position: -169px -830px; width: 40px; height: 40px;} +.sprite-services-icons.defaulticon.large { background-position: -70px -809px; width: 60px; height: 60px;} diff --git a/catalog-ui/app/styles/sprite.html b/catalog-ui/app/styles/sprite.html new file mode 100644 index 0000000000..875c26fe2a --- /dev/null +++ b/catalog-ui/app/styles/sprite.html @@ -0,0 +1,65 @@ + + + + + + + + + +

        Sprite icons

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        checkbox_checkedcheckbox_uncheckedcheckbox_disabledcheckbox_focus
        add-iconimport-icon
        video-iconvideo-icon_1video-icon_2video-icon_disabledvideo-icon_focus
        info-iconinfo-icon_1
        + + + + diff --git a/catalog-ui/app/styles/sprite.less b/catalog-ui/app/styles/sprite.less new file mode 100644 index 0000000000..b7c0146059 --- /dev/null +++ b/catalog-ui/app/styles/sprite.less @@ -0,0 +1,212 @@ +.sprite-new { + background-image: url('images/sprites/sprite-global.png'); + display: inline-block; +} + +.add-icon { background-position: -50px -77px; width: 23px; height: 23px;} +.add-icon-hover { background-position: -150px -77px; width: 23px; height: 23px;} +.import-icon { background-position: -100px -81px; width: 23px; height: 23px;} + +.add-icon-blue { background-position: -350px -125px; width: 18px; height: 18px;} +.add-icon-blue-hover { background-position: -400px -125px; width: 18px; height: 18px;} + +.video-icon { background-position: -54px -113px; width: 33px; height: 26px;} +.video-icon_1 { background-position: -104px -113px; width: 33px; height: 26px;} +.video-icon_2 { background-position: -154px -113px; width: 33px; height: 26px;} +.video-icon_disabled { background-position: -204px -113px; width: 33px; height: 26px;} +.video-icon_focus { background-position: -250px -111px; width: 41px; height: 32px;} + +.vsp-list-icon { background-position: -54px -143px; width: 26px; height: 29px;} +.vsp-list-icon-active { background-position: -104px -143px; width: 26px; height: 29px;} +.vsp-list-icon:active:not(.disable) { background-position: -104px -143px; width: 26px; height: 29px;} +.vsp-list-icon-hover { background-position: -154px -143px; width: 26px; height: 29px;} +.vsp-list-icon:hover:not(.disable) { background-position: -154px -143px; width: 26px; height: 29px;} +.vsp-list-icon.disable { background-position: -204px -143px; width: 26px; height: 29px;} + +.info-icon { background-position: -50px -179px; width: 14px; height: 14px;} +.info-icon_1 { background-position: -100px -179px; width: 14px; height: 14px;} + +.plus-icon { background-position: -50px -231px; width: 12px; height: 12px;} +.plus-icon-hover { background-position: -100px -231px; width: 12px; height: 12px;} + +.delete-icon { background-position: -650px -231px; width: 11px; height: 13px;} +.delete-icon-hover { background-position: -702px -231px; width: 11px; height: 13px;} + +.arrow-up { background-position: -350px -236px; width: 12px; height: 7px;} +.arrow-up-hover { background-position: -400px -236px; width: 12px; height: 7px;} + +.arrow-up-small { background-position: -250px -237px; width: 12px; height: 6px;} +.arrow-up-small-hover { background-position: -300px -237px; width: 12px; height: 6px;} + +.sort-arrows { background-position: -450px -231px; width: 8px; height: 12px;} +.sort-arrows-hover { background-position: -500px -231px; width: 8px; height: 12px;} + +.arrow-right { background-position: -550px -235px; width: 5px; height: 8px;} +.arrow-right-hover { background-position: -600px -235px; width: 5px; height: 8px;} + +.menu-open-left { background-position: -350px -283px; width: 6px; height: 10px;} +.menu-open-right { background-position: -400px -283px; width: 6px; height: 10px;} + + +.private-status-icon { background-position: -50px -326px; width: 21px; height: 17px;} +.in-design-status-icon { background-position: -307px -327px; width: 16px; height: 16px;} +.checkout-editable-status-icon { background-position: -100px -326px; width: 24px; height: 17px;} +.checkin-status-icon { background-position: -200px -326px; width: 24px; height: 17px;} +.checkout-not-editable-status-icon { background-position: -150px -326px; width: 24px; height: 17px;} + + +//workspace buttons +.x-btn { background-position: -50px -419px; width: 24px; height: 24px; } +.x-btn:hover { background-position: -50px -447px; width: 24px; height: 24px; } +.x-btn:active { background-position: -50px -479px; width: 24px; height: 24px; } + +.delete-btn { background-position: -140px -419px; width: 24px; height: 24px; } +.delete-btn:hover:not(.disable) { background-position: -140px -447px; width: 24px; height: 24px; } +.delete-btn:active:not(.disable) { background-position: -140px -479px; width: 24px; height: 24px; } +.delete-btn.disable { background-position: -140px -539px; width: 24px; height: 24px; } + +.save-btn { background-position: -230px -419px; width: 24px; height: 24px; } +.save-btn:hover:not(.disable) { background-position: -230px -447px; width: 24px; height: 24px; } +.save-btn:active:not(.disable) { background-position: -230px -479px; width: 24px; height: 24px; } +.save-btn.disable { background-position: -230px -539px; width: 24px; height: 24px; } + +.revert-btn { background-position: -200px -419px; width: 24px; height: 24px; } +.revert-btn:hover:not(.disable) { background-position: -200px -447px; width: 24px; height: 24px; } +.revert-btn:active:not(.disable) { background-position: -200px -479px; width: 24px; height: 24px; } +.revert-btn.disable { background-position: -200px -539px; width: 24px; height: 24px; } + +.success-circle { background-position: -50px -703px; width: 20px; height: 20px; } +.success-circle-small { background-position: -170px -706px; width: 12px; height: 12px; } +.sdc-success { background-position: -101px -707px; width: 10px; height: 10px; } +.sdc-error { background-position: -151px -707px; width: 10px; height: 10px; } + +.print-screen-btn { background-position: -259px -419px; width: 24px; height: 24px; } +.print-screen-btn:hover:not(.disable) { background-position: -259px -447px; width: 24px; height: 24px; } +.print-screen-btn:active:not(.disable) { background-position: -259px -479px; width: 24px; height: 24px; } +.print-screen-btn.disable { background-position: -259px -539px; width: 24px; height: 24px; } + +.url-btn { background-position: -636px -424px; width: 19px; height: 19px; } +.url-btn:hover { background-position: -636px -424px; width: 19px; height: 19px; } +.url-btn:active { background-position: -636px -482px; width: 19px; height: 19px; } + + + + +/*new tabs icons*/ +.sprite-new.info { background-position: -51px -631px; width: 18px; height: 18px;} +.sprite-new.info:active { background-position: -51px -669px; width: 18px; height: 18px;} +.active > .sprite-new.info { background-position: -51px -669px; width: 18px; height: 18px;} + + +.sprite-new.structure { background-position: -101px -630px; width: 18px; height: 17px;} +.sprite-new.structure:active { background-position: -101px -668px; width: 18px; height: 17px;} +.active > .sprite-new.structure { background-position: -101px -668px; width: 18px; height: 17px;} + + +.sprite-new.deployment-artifacts { background-position: -150px -629px; width: 17px; height: 19px;} +.sprite-new.deployment-artifacts:active { background-position: -150px -667px; width: 17px; height: 19px;} +.active > .deployment-artifacts { background-position: -150px -667px; width: 17px; height: 19px;} + +.sprite-new.inputs { background-position: -200px -634px; width: 20px; height: 12px;} +.sprite-new.inputs:active { background-position: -200px -672px; width: 20px; height: 12px;} +.active > .sprite-new.inputs { background-position: -200px -672px; width: 20px; height: 12px;} + + +.sprite-new.information-artifacts { background-position: -250px -631px; width: 17px; height: 19px;} +.sprite-new.information-artifacts:active { background-position: -250px -669px; width: 17px; height: 19px;} +.active > .sprite-new.information-artifacts { background-position: -250px -669px; width: 17px; height: 19px;} + +.sprite-new.relations { background-position: -300px -632px; width: 20px; height: 20px;} +.sprite-new.relations:active { background-position: -300px -632px; width: 20px; height: 20px;} +.active > .sprite-new.relations { background-position: -300px -632px; width: 20px; height: 20px;} + + +.sprite-new.api { background-position: -400px -631px; width: 23px; height: 19px;} +.sprite-new.api:active { background-position: -400px -671px; width: 23px; height: 19px;} +.active > .sprite-new.api { background-position: -400px -671px; width: 23px; height: 19px;} + +.sprite-new.properties { background-position: -350px -631px; width: 19px; height: 19px;} +.sprite-new.properties:active { background-position: -350px -671px; width: 19px; height: 19px;} +.active > .sprite-new.properties { background-position: -350px -671px; width: 19px; height: 19px;} + +.sprite-new.distribution-bth { background-position: -399px -716px; width: 55px; height: 21px;} +.sprite-new.distribution-bth.disable { background-position: -464px -716px; width: 55px; height: 21px;} + +.Distributed { background-position: -547px -718px; width: 16px; height: 16px;} +.Deployed { background-position: -573px -718px; width: 16px; height: 16px;} + +.error-icon { background-position: -51px -751px; width: 13px; height: 11px;} +.asdc-warning { background-position: -100px -748px; width: 17px; height: 15px;} + +.link-btn { background-position: -636px -424px; width: 19px; height: 19px;} +.link-btn:hover { background-position: -636px -453px; width: 19px; height: 19px;} +.link-btn:active { background-position: -636px -482px; width: 19px; height: 19px;} + +.refresh-btn { background-position: -293px -419px; width: 24px; height: 24px;} +.refresh-btn:hover:not(.disable) { background-position: -293px -447px; width: 24px; height: 24px;} +.refresh-btn:active:not(.disable) { background-position: -293px -479px; width: 24px; height: 24px;} +.refresh-btn.focus { background-position: -293px -508px; width: 24px; height: 24px;} +.refresh-btn.disable { background-position: -293px -539px; width: 24px; height: 24px;} + +.download-btn { background-position: -530px -419px; width: 24px; height: 24px;} +.download-btn:hover:not(.disable) { background-position: -530px -448px; width: 24px; height: 24px;} +.download-btn:active:not(.disable) { background-position: -530px -479px; width: 24px; height: 24px;} +.download-btn.focus { background-position: -530px -508px; width: 24px; height: 24px;} +.download-btn.disable { background-position: -530px -539px; width: 24px; height: 24px;} + +.expand-collapse-plus-icon { background-position: -334px -888px; width: 14px; height: 14px;} +.expand-collapse-plus-icon.hover { background-position: -422px -888px; width: 14px; height: 14px;} +.expand-collapse-minus-icon { background-position: -378px -888px; width: 14px; height: 14px;} +.expand-collapse-minus-icon.hover { background-position: -466px -888px; width: 14px; height: 14px;} + + +//tabs +.close-open-left-arrow { background-position: -507px -942px; width: 6px; height: 10px;} +.close-open-right-arrow { background-position: -506px -922px; width: 6px; height: 10px;} + +.hierarchy { background-position: -560px -887px; width: 21px; height: 15px;} +.hierarchy.hover { background-position: -500px -887px; width: 21px; height: 15px;} +.hierarchy.disable { background-position: -531px -887px; width: 21px; height: 15px;} +.hierarchy.selected { background-position: -500px -887px; width: 21px; height: 15px;} + +.refresh-small-btn { background-position: -598px -419px; width: 24px; height: 24px;} +.refresh-small-btn:hover:not(.disable) { background-position: -598px -448px; width: 24px; height: 24px;} +.refresh-small-btn:active:not(.disable) { background-position: -598px -479px; width: 24px; height: 24px;} +.refresh-small-btn.focus { background-position: -598px -508px; width: 24px; height: 24px;} +.refresh-small-btn.disable { background-position: -598px -539px; width: 24px; height: 24px;} + +.download-file-btn { background-position: -673px -419px; width: 24px; height: 24px;} +.download-file-btn:hover:not(.disable) { background-position: -673px -448px; width: 24px; height: 24px;} +.download-file-btn:active:not(.disable) { background-position: -673px -479px; width: 24px; height: 24px;} +.download-file-btn.focus { background-position: -673px -508px; width: 24px; height: 24px;} +.download-file-btn.disable { background-position: -673px -539px; width: 24px; height: 24px;} + +.refresh-file-btn { background-position: -707px -419px; width: 24px; height: 24px;} +.refresh-file-btn:hover:not(.disable) { background-position: -707px -448px; width: 24px; height: 24px;} +.refresh-file-btn:active:not(.disable) { background-position: -707px -479px; width: 24px; height: 24px;} +.refresh-file-btn.focus { background-position: -707px -508px; width: 24px; height: 24px;} +.refresh-file-btn.disable { background-position: -707px -539px; width: 24px; height: 24px;} + +.import-file-btn { background-position: -745px -419px; width: 24px; height: 24px;} +.import-file-btn:hover:not(.disable) { background-position: -745px -448px; width: 24px; height: 24px;} +.import-file-btn:active:not(.disable) { background-position: -745px -479px; width: 24px; height: 24px;} +.import-file-btn.focus { background-position: -745px -508px; width: 24px; height: 24px;} +.import-file-btn.disable { background-position: -745px -539px; width: 24px; height: 24px;} + +.left-arrow { background-position: -590px -876px; width: 26px; height: 26px;} +.left-arrow:hover { background-position: -662px -876px; width: 26px; height: 26px;} +.right-arrow { background-position: -626px -876px; width: 26px; height: 26px;} +.right-arrow:hover { background-position: -698px -876px; width: 26px; height: 26px;} +.search-white-icon { background-position: -434px -128px; width: 14px; height: 14px;} + +.blue-right-arrow-circle { background-position: -650px -619px; width: 29px; height: 29px;} +.blue-right-arrow-circle:hover { background-position: -689px -619px; width: 29px; height: 29px;} + +.small-x-button { background-position: -190px -282px; width: 11px; height: 11px;} +.small-x-button:hover { background-position: -210px -283px; width: 11px; height: 11px;} +.close-info-tooltip-button {.small-x-button} +.close-info-tooltip-button:hover { background-position: -230px -283px; width: 11px; height: 11px;} +.expand-all { background-position: -500px -420px; width: 20px; height: 22px;} +.expand-all:hover { background-position: -500px -449px; width: 20px; height: 22px;} +.collapse-all { background-position: -465px -420px; width: 20px; height: 22px;} +.collapse-all:hover { background-position: -465px -449px; width: 20px; height: 22px;} diff --git a/catalog-ui/app/styles/table-flex.less b/catalog-ui/app/styles/table-flex.less new file mode 100644 index 0000000000..3ac014cc1b --- /dev/null +++ b/catalog-ui/app/styles/table-flex.less @@ -0,0 +1,178 @@ +.table-container-flex { + /* height: 650px; */ + margin-top: 35px; + clear: both; + .table { + width: 100%; + border: 1px solid #d8d8d8; + .head { + background-color: #eaeaea; + .head-row { + color: #333333; + font-weight: bold; + text-align: center; + border-right: 1px solid @border_color_d; + padding: 8px 15px; + + &:last-child { + border-right: none; + } + + .table-header-sort-arrow { + display: inline-block; + background-color: transparent; + border: none; + color: #AAA; + margin: 8px 0 0 5px; + &.up { + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid; + } + &.down { + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid; + } + } + } + } + .body { + .scrollbar-container { + max-height: 430px; + .perfect-scrollbar; + } + .b_9; + + .data-row { + border-bottom: 1px solid @border_color_d; + div { + + border-right: 1px solid @border_color_d; + + + &:last-child { + border-right: none; + } + + .table-role-select { + background-color: transparent; + border: 0; + width: 100%; + + } + .table-role-label { + margin-left:4px; + } + + } + + &.selected { + background-color: #e6f6fb; + } + + & + div.item-opened { + border-bottom: 1px solid @border_color_d; + padding: 10px 23px; + text-align: left; + word-break: break-all; + } + } + .data-row:hover { + .bg_j; + } + + + button.add-button { + margin: 10px auto; + display: block; + border: 1px solid #eaeaea; + background-color: @func_color_r; + box-shadow: 0px 1px 1px 0px rgba(24, 24, 25, 0.05); + width: 297px; + height: 39px; + color: #666666; + font-size: 14px; + font-weight: bold; + + &:before { + .sprite-new; + .add-icon-blue; + float: left; + margin-left: 5px; + content: ""; + } + } + } + + .no-row-text{ + text-align: center; + margin-top:25px; + + a { + cursor: pointer; + } + } + + .table-btn-col { + + line-height: 0px; + text-align: center; + .table-delete-btn { + background-color: transparent; + border: none; + .sprite; + .sprite.e-sdc-small-icon-delete; + opacity: 0.8; + + } + .table-edit-btn { + background-color: transparent; + border: none; + .sprite; + .e-sdc-small-icon-pencil; + opacity: 0.8; + margin-right: 10px; + } + .table-save-btn { + background-color: transparent; + border: none; + .sprite; + .sprite.e-sdc-green-save; + } + .table-download-btn { + background-color: transparent; + border: none; + .hand; + margin-left: 10px; + opacity: 0.8; + .sprite; + .sprite.e-sdc-small-download; + } + } + + } + + .no-row-text { + text-align: center; + font-size: 15px; + border-bottom: 1px solid #d8d8d8; + width: 300px; + margin: 26px auto; + padding-bottom: 22px; + } + + .flex-container { + display: flex; + } + + .flex-item { + width:10px; + line-height: 25px; + padding: 5px 15px; + flex-grow: 1; + text-align: left; + + } + +} diff --git a/catalog-ui/app/styles/tlv-buttons.less b/catalog-ui/app/styles/tlv-buttons.less new file mode 100644 index 0000000000..0e42a92231 --- /dev/null +++ b/catalog-ui/app/styles/tlv-buttons.less @@ -0,0 +1,234 @@ +.tlv-btn { + border-radius: 2px; + cursor: pointer; + display: inline-block; + font-family: omnes-medium, Sans-Serif; + height: 32px; + min-width: 96px; + line-height: 30px; + padding: 0 16px; + text-align: center; + vertical-align: middle; + font-size: 14px; + + &:disabled { + opacity: .4; + pointer-events: none; + } + + &.blue { + background-color: #009fdb; + border: 1px solid #0091c8; + color: #fff; + + &:hover { + background-color: #1ec2ff; + } + + &:active { + background-color: #0091c7; + border: 1px solid #006186; + outline: none; + } + + &:focus { + border-color: #009fdb; + box-shadow: inset 0 0 0 1px #fff; + outline: none; + } + } + + &.white { + background-color: #fff; + border: 1px solid #d8d8d8; + color: @main_color_n; + + &:hover { + border-color: #959595; + } + + &:active { + background-color: #f2f2f2; + border: 1px solid #595959; + outline: none; + } + + &:focus { + border-color: #959595; + box-shadow: inset 0 0 0 1px #fff, inset 0 0 0 2px #959595; + outline: none; + + } + + } + + &.grey { + background-color: #f8f8f8; + border: 1px solid #d8d8d8; + color: #000; + + &:hover { + border-color: #959595; + } + + &:active { + background-color: #d7d7d7; + border: 1px solid #595959; + outline: none; + } + + &:focus { + background-color: @tlv_color_t; + border-color: @main_color_n; + box-shadow: inset 0 0 0 1px @main_color_p, inset 0 0 0 2px @main_color_n; + outline: none; + + } + + } + + + &.green { + background-color: #4ca90c; + border: 1px solid #45a006; + color: #fff; + + &:hover { + background-color: #5ec616; + } + + &:active { + background-color: #3f8c0a; + border: 1px solid #2c6604; + outline: none; + } + + &:focus { + box-shadow: inset 0 0 0 1px #fff; + outline: none; + } + } + + &.red { + background-color: #fc2727; + border: 1px solid #a01a1a; + color: #fff; + + &:hover { + background-color: #fc2727; + } + + &:active { + background-color: #a01a1a; + border: 1px solid #730202; + outline: none; + } + + &:focus { + box-shadow: inset 0 0 0 1px @main_color_p; + outline: none; + } + } + + + &.outline { + &.blue { + background-color: #fff; + border: 1px solid #009fdb; + color: #009fdb; + + &:hover { + background-color: #e5f5fb; + } + + &:active { + background-color: #b2e2f4; + border: 1px solid #009fdb; + outline: none; + } + + &:focus { + background-color: #fff; + border-color: #009fdb; + box-shadow: inset 0 0 0 1px #fff, inset 0 0 0 2px #009fdb; + outline: none; + } + } + + &.grey { + background-color: #ffffff; + border: 1px solid #959595; + color: #5a5a5a; + + &:hover { + background-color: #f4f4f4; + border-color: #959595; + } + + &:active { + background-color: #dfdfdf; + border: 1px solid #959595; + outline: none; + } + + &:focus { + background-color: #fff; + border-color: #959595; + box-shadow: inset 0 0 0 1px #fff, inset 0 0 0 2px #959595; + outline: none; + + } + + } + + + &.green { + background-color: #ffffff; + border: 1px solid #4ca90c; + color: #4ca90c; + + &:hover { + background-color: #edf6e6; + border-color: #4ca90c; + } + + &:active { + background-color: #c9e5b6; + border: 1px solid #4ca90c; + outline: none; + } + + &:focus { + background-color: #fff; + border-color: #4ca90c; + box-shadow: inset 0 0 0 1px #fff, inset 0 0 0 2px #4ca90c; + outline: none; + } + } + + &.red { + background-color: #ffffff; + border: 1px solid #cf2a2a; + color: #cf2a2a; + + &:hover { + background-color: #fae9e9; + border-color: #cf2a2a; + } + + &:active { + background-color: #c9e5b6; + border: 1px solid #cf2a2a; + outline: none; + } + + &:focus { + background-color: #fff; + border-color: #cf2a2a; + box-shadow: inset 0 0 0 1px #fff, inset 0 0 0 2px #cf2a2a; + outline: none; + } + } + } +} + diff --git a/catalog-ui/app/styles/tlv-checkbox.less b/catalog-ui/app/styles/tlv-checkbox.less new file mode 100644 index 0000000000..9dd5873545 --- /dev/null +++ b/catalog-ui/app/styles/tlv-checkbox.less @@ -0,0 +1,87 @@ +.tlv-checkbox { + font-family: clearview-book, Sans-Serif; + font-size: 14px; + display: inline-block; + + .tlv-checkbox-i { + height: 0; + /*visibility: hidden;*/ + display: none; + width: 0; + + &:checked ~ .tlv-checkbox-label, + &:checked:hover ~ .tlv-checkbox-label{ + &::before { + .tlv-sprite; + .checkbox-checked; + } + } + + &:disabled ~ .tlv-checkbox-label{ + pointer-events: none; + } + + &:hover ~ .tlv-checkbox-label{ + &::before { + .tlv-sprite; + .checkbox-hover; + } + } + } + + .tlv-checkbox-label { + /*display: inline-block;*/ + display: block; + vertical-align: middle; + + &::before { + .tlv-sprite; + .checkbox; + content: ''; + display: inline-block; + margin-right: 4px; + margin-top: -2px; + vertical-align: middle; + } + } +} + + +.tlv-radio { + font-size: 14px; + display: inline-block; + + .tlv-radio-i { + height: 0; + visibility: hidden; + width: 0; + + &:checked ~ .tlv-radio-label{ + &::before { + .tlv-sprite; + .radio-checked; + + } + } + + &:disabled ~ .tlv-radio-label{ + opacity: .6; + } + } + + .tlv-radio-label { + display: inline-block; + vertical-align: middle; + margin-bottom: 0; + + &::before { + .tlv-sprite; + .radio; + content: ''; + display: inline-block; + margin-right: 4px; + margin-top: -2px; + vertical-align: middle; + } + } +} diff --git a/catalog-ui/app/styles/tlv-loader.less b/catalog-ui/app/styles/tlv-loader.less new file mode 100644 index 0000000000..efe39916e2 --- /dev/null +++ b/catalog-ui/app/styles/tlv-loader.less @@ -0,0 +1,164 @@ +.tlv-loader { + height: 63px; + width: 63px; + position: absolute; + top: 50%; + left: 50%; +} + +.tlv-loader.small { + transform: scale(0.26); + margin-top: -36.5px; + margin-left: -36.5px; +} + +.tlv-loader.medium { + transform: scale(0.5); + margin-top: -26.5px; + margin-left: -26.5px; +} + +.tlv-loader.large { + transform: scale(1); + margin-top: -10.5px; + margin-left: -10.5px; +} + +.tlv-loader::before { + background-color: #eaeaea; + border-radius: 50%; + box-shadow: 21px 21px 0px 0px #eaeaea, 0px 42px 0px 0px #eaeaea, -21px 21px 0px 0px #eaeaea; + content: ''; + display: block; + height: 21px; + width: 21px; + position: absolute; + left: 50%; + margin-left: -10.5px; +} + +.tlv-loader::after { + border-radius: 50%; + content: ''; + display: block; + position: absolute; + height: 21px; + width: 21px; + animation: dot-move-2 4.5s infinite ease-in; +} + +@keyframes dot-move { + 0% { + background-color: #3bb2df; + left: 21px; + top: 0; + } + 25% { + background-color: #ffb81c; + left: 42px; + top: 21px; + } + 50% { + background-color: #caa2dd; + left: 21px; + top: 42px; + } + 75% { + background-color: #d9e51c; + left: 0; + top: 21px; + } + 100% { + background-color: #3bb2df; + left: 21px; + top: 0; + } +} + +@keyframes dot-move-2 { + 0% { + background-color: #3bb2df; + left: 21px; + top: 0; + } + 6.25% { + background-color: #3bb2df; + left: 42px; + top: 21px; + } + 12.5% { + background-color: #3bb2df; + left: 21px; + top: 42px; + } + 18.75% { + background-color: #3bb2df; + left: 0; + top: 21px; + } + 25% { + background-color: #ffb81c; + left: 21px; + top: 0; + } + 31.25% { + background-color: #ffb81c; + left: 42px; + top: 21px; + } + 37.5% { + background-color: #ffb81c; + left: 21px; + top: 42px; + } + 43.75% { + background-color: #ffb81c; + left: 0; + top: 21px; + } + 50% { + background-color: #caa2dd; + left: 21px; + top: 0; + } + 56.25% { + background-color: #caa2dd; + left: 42px; + top: 21px; + } + 62.5% { + background-color: #caa2dd; + left: 21px; + top: 42px; + } + 68.75% { + background-color: #caa2dd; + left: 0; + top: 21px; + } + 75% { + background-color: #d9e51c; + left: 21px; + top: 0; + } + 81.25% { + background-color: #d9e51c; + left: 42px; + top: 21px; + } + 87.5% { + background-color: #d9e51c; + left: 21px; + top: 42px; + } + 93.75% { + background-color: #d9e51c; + left: 0; + top: 21px; + } + 100% { + background-color: #3bb2df; + left: 21px; + top: 0; + } +} diff --git a/catalog-ui/app/styles/tlv-sprite.less b/catalog-ui/app/styles/tlv-sprite.less new file mode 100644 index 0000000000..472e2fb313 --- /dev/null +++ b/catalog-ui/app/styles/tlv-sprite.less @@ -0,0 +1,138 @@ +.tlv-sprite { + background-image: url("images/sprites/tlv-sprite.png"); + display: inline-block; + vertical-align: middle; + + &.logo-blue { + background-position: -10px -20px; + width: 28px; + height: 28px; + } + + &.user { + background-position: -50px -20px; + width: 15px; + height: 20px; + } + + .facebook { + background-position: -10px -260px; + width: 36px; + height: 36px; + } + + .facebook-hover { + background-position: -10px -300px; + width: 36px; + height: 36px; + } + + .twitter { + background-position: -50px -260px; + width: 36px; + height: 36px; + } + + .twitter-hover { + background-position: -50px -300px; + width: 36px; + height: 36px; + } + + .linkedin { + background-position: -89px -260px; + width: 36px; + height: 36px; + } + + .linkedin-hover { + background-position: -89px -300px; + width: 36px; + height: 36px; + } + + .youtube { + background-position: -130px -260px; + width: 36px; + height: 36px; + } + + .youtube-hover { + background-position: -130px -300px; + width: 36px; + height: 36px; + } + + .footer-open { + background-position: -250px -59px; + width: 14px; + height: 10px; + } + + .footer-open-hover { + background-position: -250px -79px; + width: 14px; + height: 10px; + } + + .footer-close { + background-position: -230px -59px; + width: 14px; + height: 10px; + } + + .footer-close-hover { + background-position: -230px -79px; + width: 14px; + height: 10px; + } + + .checkbox-disadbled { + background-position: -10px -60px; + width: 14px; + height: 14px; + } + + .checkbox { + background-position: -10px -60px; + width: 14px; + height: 14px; + } + + .checkbox-hover { + background-position: -10px -100px; + width: 14px; + height: 14px; + } + + .checkbox-checked { + background-position: -10px -120px; + width: 14px; + height: 14px; + } + + .radio-disabled { + background-position: -50px -60px; + width: 14px; + height: 14px; + } + + .radio { + background-position: -50px -80px; + width: 14px; + height: 14px; + } + + .radio-checked { + background-position: -50px -120px; + width: 14px; + height: 14px; + } +} + +.tlv-x-btn, .tlv-x-btn:hover { + background-position: -17px -147px; + width: 10px; + height: 10px; +} + diff --git a/catalog-ui/app/styles/tooltips.less b/catalog-ui/app/styles/tooltips.less new file mode 100644 index 0000000000..f4c618e2dc --- /dev/null +++ b/catalog-ui/app/styles/tooltips.less @@ -0,0 +1,110 @@ +// --------------------------------------------------------------------------------------------------- +// tooltips +// --------------------------------------------------------------------------------------------------- +div.tooltips { + position: relative; + display: inline; + float: right; + z-index: 1; + top: 30px; + left: 85px; + + span { + .bg_s; + position: absolute; + width: 230px; + color: @color_c; + height: 30px; + line-height: 30px; + text-align: center; + border-radius: 6px; + visibility: hidden; + + &:after { + .arrow(8px, @color_s); + } + } +} + +// --------------------------------------------------------------------------------------------------- +// Qtip +// --------------------------------------------------------------------------------------------------- +.qtip-custom { + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + background-color: rgb(80,99,113); + border-color:rgb(80,99,113); + color:white; + font-size:14px; + +} + + +.tooltip-custom { + background-color: rgba(80, 99, 113, 0.9); + z-index: 1100; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + max-width: 280px; + text-align: center; + word-break: normal; + word-wrap: break-word; + padding-right: 10px; + padding-left: 10px; +} + +._720kb-tooltip-caret:before + { + border: 6px solid rgba(80, 99, 113, 0.9); + + } + +.tooltip-rightside{ + right: 2px; + left: initial !important; + + ._720kb-tooltip-caret:before{ + right: 21px; + left: initial; + } +} + +.tab-tooltip{ + max-width: 220px; + white-space: nowrap; +} +.break-word-tooltip{ + word-break: break-all; + margin-right: 2px; +} + +.icon-tooltip{ + margin-left: 12px; + right: initial !important; + + ._720kb-tooltip-caret:before{ + left: 44px; + right: initial; + } +} + +.uib-custom-tooltip { + z-index: 999999; + + .tooltip-inner { + background-color: rgba(80, 99, 113, 0.9); + padding: 5px 10px 5px 10px; + border-radius: 2px; + } +} +.tooltip { + &.bottom .tooltip-arrow { + + margin-left: -6px !important; + border-width: 0 6px 6px !important; + border-bottom-color: rgba(80, 99, 113, 0.9) !important; + } +} + diff --git a/catalog-ui/app/styles/variables-old.less b/catalog-ui/app/styles/variables-old.less new file mode 100644 index 0000000000..29eb61de7c --- /dev/null +++ b/catalog-ui/app/styles/variables-old.less @@ -0,0 +1,77 @@ +/*---------------------------------------------- General ----------------------------------------------*/ +@images: "images"; + +// Colors +@color_a: #3b7b9b; // product category +@color_b: #666666; +@color_c: #ffffff; +@color_d: #1d9a95; // dashboard service (S at the top left of the card) +@color_e: #cdcdcd; +@color_f: #506472; // #e0e5e9 composition right side tabs +@color_g: #263d4d; // dashboard left sidebar categories +@color_h: #da1f3d; // not valid +@color_i: #445663; // dashboard left sidebar +@color_j: #D3DBE0; // dashboard header | view left side +@color_k: #e1e7ec; // composition item | composition right side background +@color_l: #1e9a33; // valid +@color_m: #a8b3b9; // composition sub category +@color_n: #ECEFF3; // dashboard main section +@color_o: #798996; // composition category +@color_p: #8c8c8c; // composition relation tab? +@color_q: #b5b5b5; // Liz please change from b6b5b5 to b5b5b5 +@color_r: #e85858; // dashboard resource (R at the top left of the card) +@color_s: #000000; // #62727f +@color_t: #3196c9; // #346d8a +@color_u: #23aa63; +@color_v: #198682; +@color_w: #384752; +@color_x: #c91d39; +@color_y: #697a87; +@color_z: #28bd6e; +@color_zz: #93deb6; + + +// Color hover +@color_a_hover: darken(@color_a, 10.0%); +@color_b_hover: darken(@color_b, 10.0%); +@color_c_hover: darken(@color_c, 10.0%); +@color_d_hover: darken(@color_d, 10.0%); +@color_e_hover: darken(@color_e, 10.0%); +@color_f_hover: darken(@color_f, 10.0%); +@color_g_hover: darken(@color_g, 10.0%); +@color_h_hover: darken(@color_h, 10.0%); +@color_i_hover: darken(@color_i, 10.0%); +@color_j_hover: darken(@color_j, 10.0%); +@color_k_hover: darken(@color_k, 10.0%); +@color_l_hover: darken(@color_l, 10.0%); +@color_m_hover: darken(@color_m, 10.0%); +@color_n_hover: darken(@color_n, 10.0%); +@color_o_hover: darken(@color_o, 10.0%); +@color_q_hover: darken(@color_q, 10.0%); +@color_p_hover: darken(@color_p, 10.0%); +@color_r_hover: darken(@color_r, 10.0%); +@color_s_hover: darken(@color_s, 10.0%); +@color_t_hover: darken(@color_t, 10.0%); +@color_u_hover: darken(@color_u, 10.0%); +@color_v_hover: darken(@color_v, 10.0%); +@color_w_hover: darken(@color_w, 10.0%); +@color_x_hover: darken(@color_x, 10.0%); +@color_y_hover: darken(@color_y, 10.0%); +@color_z_hover: darken(@color_z, 10.0%); +@color_zz_hover: darken(@color_zz, 10.0%); + +/* to check if can delete */ +@border_color_a: #1D3A52; +@border_color_c: #C1CDD5; +@border_color_d: rgba(120, 136, 148, 0.26); +@border_color_e: rgba(59, 123, 155, 0.5); +@border_color_f: #cfcfcf; +@border_color_g: @color_a; +@border_color_view-mode: #ededed; + +// Fonts +@font-omnes-light: omnes-light, sans-serif; +@font-omnes-regular: omnes-regular, sans-serif; +@font-omnes-medium: omnes-medium, sans-serif; +@font-omnes-medium-italic: omnes-medium-italic, sans-serif; +@font-omnes-bold: omnes-bold, sans-serif; diff --git a/catalog-ui/app/styles/variables.less b/catalog-ui/app/styles/variables.less new file mode 100644 index 0000000000..bf8854a5bb --- /dev/null +++ b/catalog-ui/app/styles/variables.less @@ -0,0 +1,48 @@ +// Fonts +@font-omnes-light: omnes-light, sans-serif; +@font-omnes-regular: omnes-regular, sans-serif; +@font-omnes-medium: omnes-medium, sans-serif; +@font-omnes-medium-italic: omnes-medium-italic, sans-serif; +@font-omnes-bold: omnes-bold, sans-serif; + +/*---------------------------------------------- General ----------------------------------------------*/ +@images: "images"; + +// Main Colors +@main_color_a: #009fdb; +@main_color_b: #056bae; +@main_color_c: #71c5eb; +@main_color_d: #4ca90c; +@main_color_e: #007a3e; +@main_color_f: #b5bd00; +@main_color_g: #ea7499; +@main_color_h: #ffb81c; +@main_color_i: #702f8a; +@main_color_j: #9063cd; +@main_color_k: #caa2dd; +@main_color_l: #000000; +@main_color_m: #5a5a5a; +@main_color_n: #959595; +@main_color_o: #d2d2d2; +@main_color_p: #ffffff; + +// Functional Colors +@func_color_q: #cf2a2a; +@func_color_r: #f2f2f2; +@func_color_s: #191919; +@func_color_b: #0568ae; +@func_color_e: #007a3e; +@func_color_h: #ffb81c; + +// Tlv Colors +@tlv_color_t: #f8f8f8; +@tlv_color_u: #eaeaea; +@tlv_color_v: #e6f6fb; + +/*---------------------------------------------- Parameters ----------------------------------------------*/ +@header_height: 0px; +@top_nav_height: 50px; +@top_nav_admin_height: 44px; +@action_nav_height: 53px; + +@border_color_view-mode: #ededed; diff --git a/catalog-ui/app/styles/welcome-sprite.less b/catalog-ui/app/styles/welcome-sprite.less new file mode 100644 index 0000000000..010d30c9ef --- /dev/null +++ b/catalog-ui/app/styles/welcome-sprite.less @@ -0,0 +1,57 @@ +.sprite-welcome { + background-image: url(images/welcome/sprite.png); + display: inline-block; + vertical-align: middle; + + &.logo { + background-position: 0 0; + width: 149px; + height: 47px; + position: absolute; + top: 25px; + left: 20px; + } + + &.play { + background-position: 0 -60px; + width: 120px; + height: 120px; + } + + &.close { + background-position: -166px -11px; + width: 25px; + height: 25px; + } + + &.close_white { + background-position: -166px -37px; + width: 25px; + height: 25px; + } + + &.recycle { + background-position: -125px -60px; + width: 24px; + height: 24px; + } + + &.idea { + background-position: -159px -57px; + width: 23px; + height: 25px; + } + + &.jigsaw { + background-position: -125px -94px; + width: 25px; + height: 25px; + } + + &.ball { + background-position: -159px -95px; + width: 23px; + height: 23px; + } + +} diff --git a/catalog-ui/app/styles/welcome-style.less b/catalog-ui/app/styles/welcome-style.less new file mode 100644 index 0000000000..0d969878c7 --- /dev/null +++ b/catalog-ui/app/styles/welcome-style.less @@ -0,0 +1,651 @@ +@zoom-in-animation-play: 2s; +@zoom-in-animation: 3s; +@slide-fade-in-text-main-animation: 2s; + +html, +body { + height: 100%; + /*overflow-x: hidden;*/ +} + +* { + box-sizing: border-box; +} + +body { + background-image: url(images/welcome/bg/global.png); +} + +.sdc-welcome-new-page { + + opacity: 1; + height: 100%; + background-color: @main_color_l; + + .os-welcome { + top: 47%; + position: fixed; + left: 42%; + font-size: 40px; + } + + #slide-2, #slide-3, #slide-4, #slide-5 { + padding: 0 50px 0 30px; + } + + .visible { + visibility: visible; + } + + .asdc-welcome-close { + position: absolute; + right: 38px; + top: 30px; + z-index: 101; + cursor: pointer; + + .sprite-welcome; + .sprite-welcome.close; + + &:hover { + .sprite-welcome.close_white; + } + } + + .asdc-welcome-frame { + height: 100vh; + width: 100%; + background-size: cover; + position: relative; + display: flex; + align-items: center; + justify-content: center; + } + + .asdc-welcome-frame.frame-0 { + background-image: url(images/welcome/bg/002.jpg); + background-size: cover; + + .asdc-whats-new { + + z-index: 1; + + .news-items-row { + display: flex; + flex-direction: row; + + .news-item-wrapper { + width: 250px; + height: 343px; + background-color: @main_color_p; + margin: 16px; + padding: 40px 20px 20px 20px; + border-radius: 4px; + opacity: 0; + + ul { + padding-left: 17px; + li { + list-style: disc; + } + } + + ol { + padding-left: 12px; + } + + &.bg-1 {border-bottom: solid 5px @main_color_a;} + &.bg-2 {border-bottom: solid 5px @main_color_j;} + &.bg-3 {border-bottom: solid 5px @main_color_d;} + &.bg-4 {border-bottom: solid 5px @main_color_i;} + &.bg-5 {border-bottom: solid 5px @main_color_e;} + &.bg-6 {border-bottom: solid 5px @func_color_b;} + &.bg-7 {border-bottom: solid 5px @main_color_c;} + &.bg-8 {border-bottom: solid 5px @main_color_k;} + + .news-body { + .m_14_r; + } + .news-title { + margin-bottom: 20px; + .s_18_m; + } + } + } + + + } + } + + .asdc-welcome-frame.frame-01 { + background-image: url(images/welcome/bg/002.png); + background-size: cover; + } + + .asdc-welcome-frame.frame-02 .asdc-welcome-slide-image-box { + position: absolute; + right: 11.6vw; + top: 10.5vw; + z-index: 1; + } + + .asdc-welcome-frame.frame-02 .asdc-welcome-slide-text-box { + position: absolute; + top: 33%; + left: 10%; + z-index: 1; + } + + .asdc-welcome-frame.frame-02 .asdc-welcome-frame-shape { + background-image: url(images/welcome/bg/shape02.png); + position: absolute; + height: 19vw; + width: 19vw; + top: 2.1vw; + left: 32.1vw; + /* opacity: .3; */ + background-size: contain; + /* background-repeat: no-repeat; */ + z-index: 0; + visibility: hidden; + + animation-duration: @zoom-in-animation; + -moz-animation-duration: @zoom-in-animation; + -webkit-animation-duration: @zoom-in-animation; + } + + .asdc-welcome-frame.frame-02 .asdc-welcome-frame-connection { + background-image: url(images/welcome/bg/connection02.png); + width: 56px; + height: 27vw; + position: absolute; + bottom: 0; + right: 295px; + background-position: 0px 35vw; + } + + .asdc-welcome-frame.frame-03 .asdc-welcome-slide-image-box { + position: absolute; + left: 6%; + top: 20%; + z-index: 1; + } + + .asdc-welcome-frame.frame-03 .asdc-welcome-slide-text-box { + position: absolute; + top: 38%; + right: 14.2vw; + z-index: 1; + } + + .asdc-welcome-frame.frame-03 .asdc-welcome-frame-shape { + background-image: url(images/welcome/bg/shape03.png); + position: absolute; + height: 378px; + width: 252px; + top: 0vw; + right: 195px; + background-size: contain; + z-index: 0; + visibility: hidden; + + animation-duration: @zoom-in-animation; + -moz-animation-duration: @zoom-in-animation; + -webkit-animation-duration: @zoom-in-animation; + } + + .asdc-welcome-frame.frame-03 .asdc-welcome-frame-connection { + background-image: url(images/welcome/bg/connection03.png); + width: 204px; + height: 371px; + position: absolute; + bottom: -109px; + right: 590px; + } + + .asdc-welcome-frame.frame-04 .asdc-welcome-slide-image-box { + position: absolute; + right: 10%; + top: 20%; + z-index: 5; + } + + .asdc-welcome-frame.frame-04 .asdc-welcome-slide-text-box { + position: absolute; + top: 34%; + left: 8%; + z-index: 5; + } + + .asdc-welcome-frame.frame-04 .asdc-welcome-frame-connection { + background-image: url(images/welcome/bg/connection04.png); + width: 56px; + height: 752px; + position: absolute; + bottom: -143px; + right: 946px; + } + + .asdc-welcome-frame.frame-04 .asdc-welcome-frame-shape { + background-image: url(images/welcome/bg/shape04.png); + position: absolute; + height: 412px; + width: 355px; + top: 0; + right: 734px; + z-index: 1; + visibility: hidden; + + animation-duration: @zoom-in-animation; + -moz-animation-duration: @zoom-in-animation; + -webkit-animation-duration: @zoom-in-animation; + } + + .asdc-welcome-frame.frame-05 .asdc-welcome-slide-text-box { + position: absolute; + top: 29%; + right: 10%; + z-index: 5; + } + + .asdc-welcome-frame.frame-05 .asdc-welcome-frame-shape { + background-image: url(images/welcome/bg/shape05.png); + position: absolute; + height: 794px; + width: 597px; + top: 0; + right: 40%; + z-index: 1; + visibility: hidden; + + animation-duration: @zoom-in-animation; + -moz-animation-duration: @zoom-in-animation; + -webkit-animation-duration: @zoom-in-animation; + } + + .asdc-welcome-frame.frame-06 { + background-image: url(images/welcome/bg/004.png); + background-size: cover; + } + + .asdc-welcome-frame.frame-06 .asdc-welcome-main { + bottom: 30%; + } + + .asdc-welcome-header { + /*background-color: rgba(17, 21, 33, 0.52);*/ + height: 70px; + width: 100%; + padding: 55px 0 0 65px; + color: #fff; + z-index: 1; + position: absolute; + left: 0; + top: 0; + } + + .welcome-nav { + visibility: hidden; + } + + .welcome-logo { + cursor: pointer; + } + + #sdc-welcome-video-wrapper { + opacity: 0; + } + + .asdc-welcome-video-close { + position: absolute; + top: 30px; + right: 30px; + z-index: 1; + } + + .asdc-welcome-video { + position: fixed; + top: 50%; + left: 50%; + min-width: 100%; + min-height: 100%; + width: auto; + height: auto; + -webkit-transform: translateX(-50%) translateY(-50%); + transform: translateX(-50%) translateY(-50%); + } + + .asdc-welcome-video-icon { + cursor: pointer; + /*margin-bottom: 80px;*/ + visibility: hidden; + width: 140px; + margin: 0 auto; + right: -24px; + position: relative; + + animation-duration: @zoom-in-animation-play; + -moz-animation-duration: @zoom-in-animation-play; + -webkit-animation-duration: @zoom-in-animation-play; + + .asdc-welcome-video-icon-play { + position: absolute; + top: -11px; + left: -11px; + z-index: 1; + } + + .asdc-welcome-video-icon-play:hover + .asdc-welcome-inner-circle { + -webkit-animation-play-state: running; + -moz-animation-play-state: running; + animation-play-state: running; + + -webkit-transform: rotate(360deg); + -moz-transform: rotate(360deg); + transform: rotate(360deg); + + -webkit-animation:turning_acw 3s; + -moz-animation:turning_acw 3s; + animation:turning_acw 3s; + + -webkit-animation-iteration-count: 99; + -moz-animation-iteration-count: 99; + animation-iteration-count: 99; + } + + .asdc-welcome-inner-circle { + border: 2px solid #ECEBFA; + border-left-color:#666666; + border-right-color:#999999; + .opacity(0.5); + + -webkit-transform: rotate(360deg); + -moz-transform: rotate(360deg); + transform: rotate(360deg); + + position:absolute; + + width: 96px; + height: 96px; + + .border-radius(96px); + + -webkit-animation:turning_acw 3s; + -moz-animation:turning_acw 3s; + animation:turning_acw 3s; + + -webkit-animation-iteration-count: 3; + -moz-animation-iteration-count: 3; + animation-iteration-count: 3; + } + } + + /*@-webkit-keyframes turning_acw { + 0%{ + -webkit-transform: rotate(360deg); } + 100%{ + -webkit-transform: rotate(0deg); } + } + + @-moz-keyframes turning_acw { + 0%{ + -moz-transform: rotate(360deg); } + 100%{ + -moz-transform: rotate(0deg); } + }*/ + + @keyframes turning_acw { + 0%{ + transform: rotate(360deg); } + 100%{ + transform: rotate(0deg); } + } + + .asdc-welcome-title { + color: #373f51; + font-size: 2.4vw; + font-family: omnes-light; + line-height: 1.0em; + letter-spacing: -0.01em; + } + + .asdc-welcome-main { + text-align: center; + position: absolute; + bottom: 40%; + z-index: 1; + color: #fff; + left: 0; + width: 100%; + } + + .whats-new { + .p_16_r; + position: absolute; + left: 205px; + top: 45px; + cursor: pointer; + text-decoration: none; + } + + .asdc-welcome-main-title { + color: #fff; + font-size: 62px; + font-family: omnes-light; + visibility: hidden; + height: 72px; + + animation-duration: @slide-fade-in-text-main-animation; + -moz-animation-duration: @slide-fade-in-text-main-animation; + -webkit-animation-duration: @slide-fade-in-text-main-animation; + } + + .asdc-welcome-main-message { + font-size: 28px; + font-family: omnes-light; + line-height: 1.8em; + visibility: hidden; + + animation-duration: @slide-fade-in-text-main-animation; + -moz-animation-duration: @slide-fade-in-text-main-animation; + -webkit-animation-duration: @slide-fade-in-text-main-animation; + } + + .asdc-welcome-main-back-btn-ph { + margin: 24px 0 70px; + } + + .asdc-welcome-main-back-btn { + font-size: 16px; + color: #009fdb; + font-family: omnes-medium; + border: 2px solid; + border-radius: 3px; + line-height: 40px; + min-width: 242px; + display: inline-block; + visibility: hidden; + text-decoration: none; + + &:hover { + color: #33bfec; + border-color: #33bfec; + } + } + + .asdc-welcome-cover { + position: absolute; + top: 0px; + right: 0; + left: 0; + bottom: 0; + background-color: rgba(14, 13, 12, 0.8); + z-index: 0; + } + + .asdc-welcome-slide-text-box { + border-radius: 10px; + background-color: #fff; + padding: 10px; + } + + .asdc-welcome-slide-text-box-title { + color: #373f51; + font-size: 2.4vw; + font-family: omnes-light; + letter-spacing: -0.015em; + line-height: 1.04em; + visibility: hidden; + + animation-duration: @slide-fade-in-text-main-animation; + -moz-animation-duration: @slide-fade-in-text-main-animation; + -webkit-animation-duration: @slide-fade-in-text-main-animation; + } + + .asdc-welcome-slide-text-box-content { + color: #737b81; + font-size: 1vw; + font-family: omnes-light; + padding-top: .5vw; + line-height: 1.3em; + visibility: hidden; + + animation-duration: @slide-fade-in-text-main-animation; + -moz-animation-duration: @slide-fade-in-text-main-animation; + -webkit-animation-duration: @slide-fade-in-text-main-animation; + } + + .asdc-welcome-slide-image-box { + box-shadow: 1px 1px 5px 0px rgba(0, 0, 0, 0.2); + height: 29.6vw; + width: 40vw; + } + + .asdc-welcome-slide-image { + height: 100%; + width: 100%; + } + + /*.asdc-welcome-frame-content {*/ + /*display: flex;*/ + /*justify-content: center;*/ + /*align-items: center;*/ + /*}*/ + /*.asdc-welcome-frame-content-text {*/ + /*color: #666;*/ + /*font-size: 16px;*/ + /*font-family: omnes-light;*/ + /*margin-top: 30px;*/ + /*line-height: 1.6em;*/ + /*}*/ + /*.asdc-welcome-frame-content-text-p {*/ + /*position: relative;*/ + /*}*/ + /*.asdc-welcome-frame-content-text-p-icon {*/ + /*position: absolute;*/ + /*height: 25px;*/ + /*width: 25px;*/ + /*left: -40px;*/ + /*top: 10px;*/ + /*}*/ + /*.asdc-welcome-frame.frame-02 .asdc-welcome-frame-content-right,*/ + /*.asdc-welcome-frame.frame-04 .asdc-welcome-frame-content-right {*/ + /*max-width: 30%;*/ + /*flex: 1;*/ + /*margin-left: 5%;*/ + /*}*/ + /*.asdc-welcome-frame.frame-02 .asdc-welcome-frame-content-left,*/ + /*.asdc-welcome-frame.frame-04 .asdc-welcome-frame-content-left {*/ + /*max-width: 55%;*/ + /*flex: 1;*/ + /*}*/ + /*.asdc-welcome-frame.frame-04 .asdc-welcome-frame-content-img {*/ + /*width: 36vw;*/ + /*}*/ + /*.asdc-welcome-frame.frame-03 .asdc-welcome-frame-content-left {*/ + /*max-width: 30%;*/ + /*flex: 1;*/ + /*margin-right: 5%;*/ + /*}*/ + /*.asdc-welcome-frame.frame-03 .asdc-welcome-frame-content-right {*/ + /*max-width: 55%;*/ + /*flex: 1;*/ + /*}*/ + /*.asdc-welcome-frame.frame-03 .asdc-welcome-frame-content-img {*/ + /*left: 0;*/ + /*right: auto;*/ + /*}*/ + /*.asdc-welcome-frame.frame-03 .asdc-welcome-frame-content-img-bubble {*/ + /*left: auto;*/ + /*top: 0;*/ + /*position: absolute;*/ + /*right: 0;*/ + /*top: -7vh;*/ + /*}*/ + /*.asdc-welcome-frame.frame-05 .asdc-welcome-frame-content{*/ + /*color: #fff;*/ + /*font-size: 37px;*/ + /*font-family: omnes-light;*/ + /*flex-direction: column;*/ + /*}*/ + /*.asdc-welcome-frame-content-img-ph {*/ + /*position: relative;*/ + /*!*width: 42%*!*/ + /*!*width: 840px;*!*/ + /*!*height: 674px;*!*/ + /*width: 52vw;*/ + /*height: 39vw;*/ + /*}*/ + /*.asdc-welcome-frame-content-img {*/ + /*width: 45vw;*/ + /*position: absolute;*/ + /*z-index: 1;*/ + /*right: 0;*/ + /*bottom: 0;*/ + /*}*/ + /*.asdc-welcome-frame-content-img-bubble {*/ + /*border-radius: 50%;*/ + /*height: 38vw;*/ + /*width: 38vw;*/ + /*position: absolute;*/ + /*left: 0;*/ + /*top: 0;*/ + /*position: absolute;*/ + /*right: 0;*/ + /*top: -7vh;*/ + /*}*/ + /*.asdc-welcome-frame-content-img-bubble.blue {*/ + /*background: linear-gradient(to right, #067ab4 0%, #44c8f5 100%);*/ + /*}*/ + /*.asdc-welcome-frame-content-img-bubble.green {*/ + /*background: linear-gradient(to right, #77be46 0%, #d2e15f 100%);*/ + /*}*/ + /*.asdc-welcome-frame-content-img-bubble.purple {*/ + /*background: linear-gradient(to right, #8a559f 0%, #d6b7e5 100%);*/ + /*}*/ + /*.asdc-welcome-button {*/ + /*font-family: omnes-medium;*/ + /*font-size: 14px;*/ + /*background-color: #009fdb;*/ + /*text-decoration: none;*/ + /*border: 0;*/ + /*border-radius: 4px;*/ + /*color: #fff;*/ + /*text-align: center;*/ + /*line-height: 30px;*/ + /*min-width: 200px;*/ + /*margin-top: 50px;*/ + /*}*/ + .asdc-welcome-footer { + background-color: #000; + position: absolute; + bottom: 0; + width: 100%; + font-size: 12px; + padding: 20px 10%; + left: 0; + color: #fff; + text-align: center; + } + +} diff --git a/catalog-ui/app/third-party/PunchOutRegistry.js b/catalog-ui/app/third-party/PunchOutRegistry.js new file mode 100644 index 0000000000..bc93453dc1 --- /dev/null +++ b/catalog-ui/app/third-party/PunchOutRegistry.js @@ -0,0 +1,98 @@ +/*- + * ============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========================================================= + */ + +(function(window) { + "use strict"; + + if (window.PunchOutRegistry) { + return; + } + + var queuedFactoryRequests = new Map(); + var factoryPromises = new Map(); + var instancePromises = new Map(); + + function registerFactory(name, factory) { + if (factoryPromises.has(name) && !queuedFactoryRequests.has(name)) { + console.error("PunchOut \"" + name + "\" has been already registered"); + return; + } + if (queuedFactoryRequests.has(name)) { + var factoryRequest = queuedFactoryRequests.get(name); + factoryRequest(factory); + queuedFactoryRequests.delete(name); + } else { + factoryPromises.set(name, Promise.resolve(factory)); + } + } + + function getFactoryPromise(name) { + var factoryPromise = factoryPromises.get(name); + if (!factoryPromise) { + factoryPromise = new Promise(function (resolveFactory) { + queuedFactoryRequests.set(name, resolveFactory); + }); + factoryPromises.set(name, factoryPromise); + } + return factoryPromise; + } + + function getInstancePromise(name, element) { + var factoryPromise; + var instancePromise = instancePromises.get(element); + if (!instancePromise) { + instancePromise = getFactoryPromise(name).then(function(factory) { + return factory(); + }); + instancePromises.set(element, instancePromise); + } + return instancePromise; + } + + function renderPunchOut(params, element) { + var name = params.name; + var options = params.options || {}; + var onEvent = params.onEvent || function () {}; + + getInstancePromise(name, element).then(function (punchOut) { + punchOut.render({options: options, onEvent: onEvent}, element); + }); + } + + function unmountPunchOut(element) { + if (!instancePromises.has(element)) { + console.error("There is no PunchOut in element", element); + return; + } + instancePromises.get(element).then(function(punchOut) { + punchOut.unmount(element); + }); + instancePromises.delete(element); + } + + var PunchOutRegistry = Object.freeze({ + register: registerFactory, + render: renderPunchOut, + unmount: unmountPunchOut + }); + + window.PunchOutRegistry = PunchOutRegistry; + +})(this); diff --git a/catalog-ui/app/third-party/ng-infinite-scroll/.npmignore b/catalog-ui/app/third-party/ng-infinite-scroll/.npmignore new file mode 100644 index 0000000000..dcbd092327 --- /dev/null +++ b/catalog-ui/app/third-party/ng-infinite-scroll/.npmignore @@ -0,0 +1,3 @@ +compile/* +node_modules +.tmp diff --git a/catalog-ui/app/third-party/ng-infinite-scroll/.travis.yml b/catalog-ui/app/third-party/ng-infinite-scroll/.travis.yml new file mode 100644 index 0000000000..ee95ccb343 --- /dev/null +++ b/catalog-ui/app/third-party/ng-infinite-scroll/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - 0.10 + +install: + - npm install + +before_script: + - npm install -g grunt-cli + +script: + - grunt test:protractor-travis diff --git a/catalog-ui/app/third-party/ng-infinite-scroll/Gruntfile.coffee b/catalog-ui/app/third-party/ng-infinite-scroll/Gruntfile.coffee new file mode 100644 index 0000000000..a9b9405731 --- /dev/null +++ b/catalog-ui/app/third-party/ng-infinite-scroll/Gruntfile.coffee @@ -0,0 +1,110 @@ +module.exports = (grunt) -> + grunt.loadNpmTasks 'grunt-coffeelint' + grunt.loadNpmTasks 'grunt-contrib-clean' + grunt.loadNpmTasks 'grunt-contrib-coffee' + grunt.loadNpmTasks 'grunt-contrib-concat' + grunt.loadNpmTasks 'grunt-contrib-connect' + grunt.loadNpmTasks 'grunt-contrib-uglify' + grunt.loadNpmTasks 'grunt-protractor-runner' + + sauceUser = 'pomerantsevp' + sauceKey = '497ab04e-f31b-4a7b-9b18-ae3fbe023222' + + grunt.initConfig + pkg: grunt.file.readJSON 'package.json' + meta: + banner: '/* <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n' + coffeelint: + src: 'src/**/*.coffee' + options: + max_line_length: + level: 'ignore' + line_endings: + value: 'unix' + level: 'error' + no_stand_alone_at: + level: 'error' + clean: + options: + force: true + build: ["compile/**", "build/**"] + coffee: + compile: + files: [ + { + expand: true + cwd: 'src/' + src: '**/*.coffee' + dest: 'compile/' + ext: '.js' + } + ], + options: + bare: true + concat: + options: + banner: '<%= meta.banner %>' + dist: + src: 'compile/**/*.js' + dest: 'build/ng-infinite-scroll.js' + uglify: + options: + banner: '<%= meta.banner %>' + dist: + src: ['build/ng-infinite-scroll.js'] + dest: 'build/ng-infinite-scroll.min.js' + connect: + testserver: + options: + port: 8000 + hostname: '0.0.0.0' + middleware: (connect, options) -> + base = if Array.isArray(options.base) then options.base[options.base.length - 1] else options.base + [connect.static(base)] + protractor: + local: + options: + configFile: 'test/protractor-local.conf.js' + args: + params: + testThrottleValue: 500 + travis: + options: + configFile: 'test/protractor-travis.conf.js' + args: + params: + # When using Sauce Connect, we should use a large timeout + # since everything is generally much slower than when testing locally. + testThrottleValue: 10000 + sauceUser: sauceUser + sauceKey: sauceKey + + grunt.registerTask 'webdriver', () -> + done = this.async() + p = require('child_process').spawn('node', ['node_modules/protractor/bin/webdriver-manager', 'update']) + p.stdout.pipe(process.stdout) + p.stderr.pipe(process.stderr) + p.on 'exit', (code) -> + if code isnt 0 then grunt.fail.warn('Webdriver failed to update') + done() + + grunt.registerTask 'sauce-connect', () -> + done = this.async() + require('sauce-connect-launcher')({username: sauceUser, accessKey: sauceKey}, (err, sauceConnectProcess) -> + if err then console.error(err.message) + else done() + ) + + grunt.registerTask 'default', ['coffeelint', 'clean', 'coffee', 'concat', 'uglify'] + grunt.registerTask 'test:protractor-local', [ + 'default', + 'webdriver', + 'connect:testserver', + 'protractor:local' + ] + + grunt.registerTask 'test:protractor-travis', [ + 'connect:testserver', + 'sauce-connect', + 'protractor:travis' + ] diff --git a/catalog-ui/app/third-party/ng-infinite-scroll/LICENSE b/catalog-ui/app/third-party/ng-infinite-scroll/LICENSE new file mode 100644 index 0000000000..44ae2bfc40 --- /dev/null +++ b/catalog-ui/app/third-party/ng-infinite-scroll/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2012 Michelle Tilley + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/catalog-ui/app/third-party/ng-infinite-scroll/README.md b/catalog-ui/app/third-party/ng-infinite-scroll/README.md new file mode 100644 index 0000000000..aa8d8630e2 --- /dev/null +++ b/catalog-ui/app/third-party/ng-infinite-scroll/README.md @@ -0,0 +1,71 @@ +[**Maintainer help needed**: I'm looking for fellows that are willing to help me maintain and improve this project.](https://github.com/sroze/ngInfiniteScroll/issues/267) + +--- + +![logo](http://sroze.github.com/ngInfiniteScroll/images/logo-resized.png) + +[![Build Status](https://travis-ci.org/sroze/ngInfiniteScroll.png?branch=master)](https://travis-ci.org/sroze/ngInfiniteScroll) + +ngInfiniteScroll is a directive for [AngularJS](http://angularjs.org/) to evaluate an expression when the bottom of the directive's element approaches the bottom of the browser window, which can be used to implement infinite scrolling. + +Demos +----- + +Check out the running demos [at the ngInfiniteScroll web site](http://sroze.github.com/ngInfiniteScroll/demos.html). + +Version Numbers +--------------- + +ngInfinite Scroll follows [semantic versioning](http://semver.org/) and uses the following versioning scheme: + + * Versions starting with 0 (e.g. 0.1.0, 0.2.0, etc.) are for initial development, and the API is not stable + * Versions with an even minor version (1.0.0, 1.4.0, 2.2.0, etc.) are stable releases + * Versions with an odd minor version (1.1.0, 1.3.0, 2.1.0, etc.) are development releases + +The [download page](http://sroze.github.com/ngInfiniteScroll/#download) allows you to pick among various versions and specify which releases are stable (not including pre-release builds). + +Getting Started +--------------- + + * Download ngInfiniteScroll from [the download page on the ngInfiniteScroll web site](http://sroze.github.com/ngInfiniteScroll/#download) or install it with: + * [Bower](http://bower.io/) via `bower install ngInfiniteScroll` + * [NPM](https://www.npmjs.com) via `npm install --save ng-infinite-scroll` + * [Nuget](https://www.nuget.org) via `PM> Install-Package ng-infinite-scroll` + * Include the script tag on your page after the AngularJS script tag (ngInfiniteScroll *doesn't* require jQuery) + + + + + * Ensure that your application module specifies `infinite-scroll` as a dependency: + + angular.module('myApplication', ['infinite-scroll']); + + * Use the directive by specifying an `infinite-scroll` attribute on an element. + +
        + +Note that neither the module nor the directive use the `ng` prefix, as that prefix is reserved for the core Angular module. + +Detailed Documentation +---------------------- + +ngInfiniteScroll accepts several attributes to customize the behavior of the directive; detailed instructions can be found [on the ngInfiniteScroll web site](http://sroze.github.com/ngInfiniteScroll/documentation.html). + +Ports +----- + +If you use [AngularDart](https://github.com/angular/angular.dart), Juha Komulainen has [a port of the project](http://pub.dartlang.org/packages/ng_infinite_scroll) you can use. + +License +------- + +ngInfiniteScroll is licensed under the MIT license. See the LICENSE file for more details. + +Testing +------- + +ngInfiniteScroll uses Protractor for testing. Note that you will need to have Chrome browser, and the `grunt-cli` npm package installed globally if you wish to use grunt (`npm install -g grunt-cli`). Then, install the dependencies with `npm install`. + +* `grunt test:protractor-local` - run tests + +Thank you very much @pomerantsev for your work on these Protractor tests. diff --git a/catalog-ui/app/third-party/ng-infinite-scroll/bower.json b/catalog-ui/app/third-party/ng-infinite-scroll/bower.json new file mode 100644 index 0000000000..1171c45190 --- /dev/null +++ b/catalog-ui/app/third-party/ng-infinite-scroll/bower.json @@ -0,0 +1,16 @@ +{ + "name": "ngInfiniteScroll", + "main": "build/ng-infinite-scroll.js", + "ignore": [ + "**/.*", + "_*", + "node_modules", + "compile", + "test", + "Gruntfile.coffee", + ".*" + ], + "dependencies": { + "angular": ">=1.2.0" + } +} diff --git a/catalog-ui/app/third-party/ng-infinite-scroll/build/ng-infinite-scroll.js b/catalog-ui/app/third-party/ng-infinite-scroll/build/ng-infinite-scroll.js new file mode 100644 index 0000000000..0585004832 --- /dev/null +++ b/catalog-ui/app/third-party/ng-infinite-scroll/build/ng-infinite-scroll.js @@ -0,0 +1,209 @@ +/*- + * ============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========================================================= + */ + +/* ng-infinite-scroll - v1.3.0 - 2016-06-30 */ +angular.module('infinite-scroll', []).value('THROTTLE_MILLISECONDS', null).directive('infiniteScroll', [ + '$rootScope', '$window', '$interval', 'THROTTLE_MILLISECONDS', function($rootScope, $window, $interval, THROTTLE_MILLISECONDS) { + return { + scope: { + infiniteScroll: '&', + infiniteScrollContainer: '=', + infiniteScrollDistance: '=', + infiniteScrollDisabled: '=', + infiniteScrollUseDocumentBottom: '=', + infiniteScrollListenForEvent: '@' + }, + link: function(scope, elem, attrs) { + var changeContainer, checkInterval, checkWhenEnabled, container, handleInfiniteScrollContainer, handleInfiniteScrollDisabled, handleInfiniteScrollDistance, handleInfiniteScrollUseDocumentBottom, handler, height, immediateCheck, offsetTop, pageYOffset, scrollDistance, scrollEnabled, throttle, unregisterEventListener, useDocumentBottom, windowElement; + windowElement = angular.element($window); + scrollDistance = null; + scrollEnabled = null; + checkWhenEnabled = null; + container = null; + immediateCheck = true; + useDocumentBottom = false; + unregisterEventListener = null; + checkInterval = false; + height = function(elem) { + elem = elem[0] || elem; + if (isNaN(elem.offsetHeight)) { + return elem.document.documentElement.clientHeight; + } else { + return elem.offsetHeight; + } + }; + offsetTop = function(elem) { + if (!elem[0].getBoundingClientRect || elem.css('none')) { + return; + } + return elem[0].getBoundingClientRect().top + pageYOffset(elem); + }; + pageYOffset = function(elem) { + elem = elem[0] || elem; + if (isNaN(window.pageYOffset)) { + return elem.document.documentElement.scrollTop; + } else { + return elem.ownerDocument.defaultView.pageYOffset; + } + }; + handler = function() { + var containerBottom, containerTopOffset, elementBottom, remaining, shouldScroll; + if (container === windowElement) { + containerBottom = height(container) + pageYOffset(container[0].document.documentElement); + elementBottom = offsetTop(elem) + height(elem); + } else { + containerBottom = height(container); + containerTopOffset = 0; + if (offsetTop(container) !== void 0) { + containerTopOffset = offsetTop(container); + } + elementBottom = offsetTop(elem) - containerTopOffset + height(elem); + } + if (useDocumentBottom) { + elementBottom = height((elem[0].ownerDocument || elem[0].document).documentElement); + } + remaining = elementBottom - containerBottom; + shouldScroll = remaining <= height(container) * scrollDistance + 1; + if (shouldScroll) { + checkWhenEnabled = true; + if (scrollEnabled) { + if (scope.$$phase || $rootScope.$$phase) { + return scope.infiniteScroll(); + } else { + return scope.$apply(scope.infiniteScroll); + } + } + } else { + if (checkInterval) { + $interval.cancel(checkInterval); + } + return checkWhenEnabled = false; + } + }; + throttle = function(func, wait) { + var later, previous, timeout; + timeout = null; + previous = 0; + later = function() { + previous = new Date().getTime(); + $interval.cancel(timeout); + timeout = null; + return func.call(); + }; + return function() { + var now, remaining; + now = new Date().getTime(); + remaining = wait - (now - previous); + if (remaining <= 0) { + $interval.cancel(timeout); + timeout = null; + previous = now; + return func.call(); + } else { + if (!timeout) { + return timeout = $interval(later, remaining, 1); + } + } + }; + }; + if (THROTTLE_MILLISECONDS != null) { + handler = throttle(handler, THROTTLE_MILLISECONDS); + } + scope.$on('$destroy', function() { + container.unbind('scroll', handler); + if (unregisterEventListener != null) { + unregisterEventListener(); + unregisterEventListener = null; + } + if (checkInterval) { + return $interval.cancel(checkInterval); + } + }); + handleInfiniteScrollDistance = function(v) { + return scrollDistance = parseFloat(v) || 0; + }; + scope.$watch('infiniteScrollDistance', handleInfiniteScrollDistance); + handleInfiniteScrollDistance(scope.infiniteScrollDistance); + handleInfiniteScrollDisabled = function(v) { + scrollEnabled = !v; + if (scrollEnabled && checkWhenEnabled) { + checkWhenEnabled = false; + return handler(); + } + }; + scope.$watch('infiniteScrollDisabled', handleInfiniteScrollDisabled); + handleInfiniteScrollDisabled(scope.infiniteScrollDisabled); + handleInfiniteScrollUseDocumentBottom = function(v) { + return useDocumentBottom = v; + }; + scope.$watch('infiniteScrollUseDocumentBottom', handleInfiniteScrollUseDocumentBottom); + handleInfiniteScrollUseDocumentBottom(scope.infiniteScrollUseDocumentBottom); + changeContainer = function(newContainer) { + if (container != null) { + container.unbind('scroll', handler); + } + container = newContainer; + if (newContainer != null) { + return container.bind('scroll', handler); + } + }; + changeContainer(windowElement); + if (scope.infiniteScrollListenForEvent) { + unregisterEventListener = $rootScope.$on(scope.infiniteScrollListenForEvent, handler); + } + handleInfiniteScrollContainer = function(newContainer) { + if ((newContainer == null) || newContainer.length === 0) { + return; + } + if (newContainer.nodeType && newContainer.nodeType === 1) { + newContainer = angular.element(newContainer); + } else if (typeof newContainer.append === 'function') { + newContainer = angular.element(newContainer[newContainer.length - 1]); + } else if (typeof newContainer === 'string') { + newContainer = angular.element(document.querySelector(newContainer)); + } + if (newContainer != null) { + return changeContainer(newContainer); + } else { + throw new Error("invalid infinite-scroll-container attribute."); + } + }; + scope.$watch('infiniteScrollContainer', handleInfiniteScrollContainer); + handleInfiniteScrollContainer(scope.infiniteScrollContainer || []); + if (attrs.infiniteScrollParent != null) { + changeContainer(angular.element(elem.parent())); + } + if (attrs.infiniteScrollImmediateCheck != null) { + immediateCheck = scope.$eval(attrs.infiniteScrollImmediateCheck); + } + return checkInterval = $interval((function() { + if (immediateCheck) { + handler(); + } + return $interval.cancel(checkInterval); + })); + } + }; + } +]); + +if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports) { + module.exports = 'infinite-scroll'; +} diff --git a/catalog-ui/app/third-party/ng-infinite-scroll/build/ng-infinite-scroll.min.js b/catalog-ui/app/third-party/ng-infinite-scroll/build/ng-infinite-scroll.min.js new file mode 100644 index 0000000000..e2a3036422 --- /dev/null +++ b/catalog-ui/app/third-party/ng-infinite-scroll/build/ng-infinite-scroll.min.js @@ -0,0 +1,22 @@ +/*- + * ============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========================================================= + */ + +/* ng-infinite-scroll - v1.3.0 - 2016-06-30 */ +angular.module("infinite-scroll",[]).value("THROTTLE_MILLISECONDS",null).directive("infiniteScroll",["$rootScope","$window","$interval","THROTTLE_MILLISECONDS",function(a,b,c,d){return{scope:{infiniteScroll:"&",infiniteScrollContainer:"=",infiniteScrollDistance:"=",infiniteScrollDisabled:"=",infiniteScrollUseDocumentBottom:"=",infiniteScrollListenForEvent:"@"},link:function(e,f,g){var h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;return z=angular.element(b),u=null,v=null,j=null,k=null,r=!0,y=!1,x=null,i=!1,q=function(a){return a=a[0]||a,isNaN(a.offsetHeight)?a.document.documentElement.clientHeight:a.offsetHeight},s=function(a){if(a[0].getBoundingClientRect&&!a.css("none"))return a[0].getBoundingClientRect().top+t(a)},t=function(a){return a=a[0]||a,isNaN(window.pageYOffset)?a.document.documentElement.scrollTop:a.ownerDocument.defaultView.pageYOffset},p=function(){var b,d,g,h,l;return k===z?(b=q(k)+t(k[0].document.documentElement),g=s(f)+q(f)):(b=q(k),d=0,void 0!==s(k)&&(d=s(k)),g=s(f)-d+q(f)),y&&(g=q((f[0].ownerDocument||f[0].document).documentElement)),h=g-b,l=h<=q(k)*u+1,l?(j=!0,v?e.$$phase||a.$$phase?e.infiniteScroll():e.$apply(e.infiniteScroll):void 0):(i&&c.cancel(i),j=!1)},w=function(a,b){var d,e,f;return f=null,e=0,d=function(){return e=(new Date).getTime(),c.cancel(f),f=null,a.call()},function(){var g,h;return g=(new Date).getTime(),h=b-(g-e),h<=0?(c.cancel(f),f=null,e=g,a.call()):f?void 0:f=c(d,h,1)}},null!=d&&(p=w(p,d)),e.$on("$destroy",function(){if(k.unbind("scroll",p),null!=x&&(x(),x=null),i)return c.cancel(i)}),n=function(a){return u=parseFloat(a)||0},e.$watch("infiniteScrollDistance",n),n(e.infiniteScrollDistance),m=function(a){if(v=!a,v&&j)return j=!1,p()},e.$watch("infiniteScrollDisabled",m),m(e.infiniteScrollDisabled),o=function(a){return y=a},e.$watch("infiniteScrollUseDocumentBottom",o),o(e.infiniteScrollUseDocumentBottom),h=function(a){if(null!=k&&k.unbind("scroll",p),k=a,null!=a)return k.bind("scroll",p)},h(z),e.infiniteScrollListenForEvent&&(x=a.$on(e.infiniteScrollListenForEvent,p)),l=function(a){if(null!=a&&0!==a.length){if(a.nodeType&&1===a.nodeType?a=angular.element(a):"function"==typeof a.append?a=angular.element(a[a.length-1]):"string"==typeof a&&(a=angular.element(document.querySelector(a))),null!=a)return h(a);throw new Error("invalid infinite-scroll-container attribute.")}},e.$watch("infiniteScrollContainer",l),l(e.infiniteScrollContainer||[]),null!=g.infiniteScrollParent&&h(angular.element(f.parent())),null!=g.infiniteScrollImmediateCheck&&(r=e.$eval(g.infiniteScrollImmediateCheck)),i=c(function(){return r&&p(),c.cancel(i)})}}}]),"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="infinite-scroll"); diff --git a/catalog-ui/app/third-party/ng-infinite-scroll/package.json b/catalog-ui/app/third-party/ng-infinite-scroll/package.json new file mode 100644 index 0000000000..8859faecdc --- /dev/null +++ b/catalog-ui/app/third-party/ng-infinite-scroll/package.json @@ -0,0 +1,80 @@ +{ + "name": "ng-infinite-scroll", + "version": "1.3.0", + "description": "Infinite scrolling for AngularJS", + "repository": { + "type": "git", + "url": "git://github.com/sroze/ngInfiniteScroll.git" + }, + "main": "build/ng-infinite-scroll.js", + "browser": "build/ng-infinite-scroll.js", + "scripts": { + "test": "grunt test:protractor-local" + }, + "author": { + "name": "Michelle Tilley", + "email": "michelle@michelletilley.net", + "url": "http://michelletilley.net" + }, + "contributors": [ + { + "name": "Samuel ROZE", + "email": "samuel.roze@gmail.com", + "url": "http://sroze.io" + } + ], + "license": "MIT", + "devDependencies": { + "coffee-script": "~1.8.0", + "grunt": "~0.4.5", + "grunt-coffeelint": "~0.0.13", + "grunt-contrib-clean": "~0.6.0", + "grunt-contrib-coffee": "~0.12.0", + "grunt-contrib-concat": "~0.5.0", + "grunt-contrib-connect": "0.8.0", + "grunt-contrib-uglify": "~0.6.0", + "grunt-protractor-runner": "1.1.4", + "mkdirp": "0.5.0", + "protractor": "1.4.0", + "sauce-connect-launcher": "0.9.0" + }, + "gitHead": "6fbf4b41947f9a3023b4aba0e613231950ccc4a1", + "bugs": { + "url": "https://github.com/sroze/ngInfiniteScroll/issues" + }, + "homepage": "https://github.com/sroze/ngInfiniteScroll#readme", + "_id": "ng-infinite-scroll@1.3.0", + "_shasum": "c2e98d8fd134b0525a4d2cf58c95d9b583755112", + "_from": "ng-infinite-scroll@>=1.3.0 <2.0.0", + "_npmVersion": "3.9.5", + "_nodeVersion": "6.2.2", + "_npmUser": { + "name": "graingert", + "email": "tagrain@gmail.com" + }, + "dist": { + "shasum": "c2e98d8fd134b0525a4d2cf58c95d9b583755112", + "tarball": "https://registry.npmjs.org/ng-infinite-scroll/-/ng-infinite-scroll-1.3.0.tgz" + }, + "maintainers": [ + { + "name": "binarymuse", + "email": "michelle@michelletilley.net" + }, + { + "name": "graingert", + "email": "tagrain@gmail.com" + }, + { + "name": "sroze", + "email": "samuel.roze@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/ng-infinite-scroll-1.3.0.tgz_1467302375605_0.8192659560590982" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/ng-infinite-scroll/-/ng-infinite-scroll-1.3.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/catalog-ui/app/third-party/ng-infinite-scroll/src/infinite-scroll.coffee b/catalog-ui/app/third-party/ng-infinite-scroll/src/infinite-scroll.coffee new file mode 100644 index 0000000000..cf2f90fc19 --- /dev/null +++ b/catalog-ui/app/third-party/ng-infinite-scroll/src/infinite-scroll.coffee @@ -0,0 +1,209 @@ +angular.module('infinite-scroll', []) + .value('THROTTLE_MILLISECONDS', null) + .directive 'infiniteScroll', [ + '$rootScope', '$window', '$interval', 'THROTTLE_MILLISECONDS', +($rootScope, $window, $interval, THROTTLE_MILLISECONDS) -> + scope: + infiniteScroll: '&' + infiniteScrollContainer: '=' + infiniteScrollDistance: '=' + infiniteScrollDisabled: '=' + infiniteScrollUseDocumentBottom: '=', + infiniteScrollListenForEvent: '@' + + link: (scope, elem, attrs) -> + windowElement = angular.element($window) + + scrollDistance = null + scrollEnabled = null + checkWhenEnabled = null + container = null + immediateCheck = true + useDocumentBottom = false + unregisterEventListener = null + checkInterval = false + + height = (elem) -> + elem = elem[0] or elem + + if isNaN(elem.offsetHeight) then elem.document.documentElement.clientHeight else elem.offsetHeight + + offsetTop = (elem) -> + if not elem[0].getBoundingClientRect or elem.css('none') + return + + elem[0].getBoundingClientRect().top + pageYOffset(elem) + + pageYOffset = (elem) -> + elem = elem[0] or elem + + if isNaN(window.pageYOffset) then elem.document.documentElement.scrollTop else elem.ownerDocument.defaultView.pageYOffset + + # infinite-scroll specifies a function to call when the window, + # or some other container specified by infinite-scroll-container, + # is scrolled within a certain range from the bottom of the + # document. It is recommended to use infinite-scroll-disabled + # with a boolean that is set to true when the function is + # called in order to throttle the function call. + handler = -> + if container == windowElement + containerBottom = height(container) + pageYOffset(container[0].document.documentElement) + elementBottom = offsetTop(elem) + height(elem) + else + containerBottom = height(container) + containerTopOffset = 0 + if offsetTop(container) != undefined + containerTopOffset = offsetTop(container) + elementBottom = offsetTop(elem) - containerTopOffset + height(elem) + + if(useDocumentBottom) + elementBottom = height((elem[0].ownerDocument || elem[0].document).documentElement) + + remaining = elementBottom - containerBottom + shouldScroll = remaining <= height(container) * scrollDistance + 1 + + if shouldScroll + checkWhenEnabled = true + + if scrollEnabled + if scope.$$phase || $rootScope.$$phase + scope.infiniteScroll() + else + scope.$apply(scope.infiniteScroll) + else + if checkInterval then $interval.cancel checkInterval + checkWhenEnabled = false + + # The optional THROTTLE_MILLISECONDS configuration value specifies + # a minimum time that should elapse between each call to the + # handler. N.b. the first call the handler will be run + # immediately, and the final call will always result in the + # handler being called after the `wait` period elapses. + # A slimmed down version of underscore's implementation. + throttle = (func, wait) -> + timeout = null + previous = 0 + later = -> + previous = new Date().getTime() + $interval.cancel(timeout) + timeout = null + func.call() + + return -> + now = new Date().getTime() + remaining = wait - (now - previous) + if remaining <= 0 + $interval.cancel(timeout) + timeout = null + previous = now + func.call() + else timeout = $interval(later, remaining, 1) unless timeout + + if THROTTLE_MILLISECONDS? + handler = throttle(handler, THROTTLE_MILLISECONDS) + + scope.$on '$destroy', -> + container.unbind 'scroll', handler + if unregisterEventListener? + unregisterEventListener() + unregisterEventListener = null + if checkInterval + $interval.cancel checkInterval + + # infinite-scroll-distance specifies how close to the bottom of the page + # the window is allowed to be before we trigger a new scroll. The value + # provided is multiplied by the container height; for example, to load + # more when the bottom of the page is less than 3 container heights away, + # specify a value of 3. Defaults to 0. + handleInfiniteScrollDistance = (v) -> + scrollDistance = parseFloat(v) or 0 + + scope.$watch 'infiniteScrollDistance', handleInfiniteScrollDistance + # If I don't explicitly call the handler here, tests fail. Don't know why yet. + handleInfiniteScrollDistance scope.infiniteScrollDistance + + # infinite-scroll-disabled specifies a boolean that will keep the + # infnite scroll function from being called; this is useful for + # debouncing or throttling the function call. If an infinite + # scroll is triggered but this value evaluates to true, then + # once it switches back to false the infinite scroll function + # will be triggered again. + handleInfiniteScrollDisabled = (v) -> + scrollEnabled = !v + if scrollEnabled && checkWhenEnabled + checkWhenEnabled = false + handler() + + scope.$watch 'infiniteScrollDisabled', handleInfiniteScrollDisabled + # If I don't explicitly call the handler here, tests fail. Don't know why yet. + handleInfiniteScrollDisabled scope.infiniteScrollDisabled + + # use the bottom of the document instead of the element's bottom. + # This useful when the element does not have a height due to its + # children being absolute positioned. + handleInfiniteScrollUseDocumentBottom = (v) -> + useDocumentBottom = v + + scope.$watch 'infiniteScrollUseDocumentBottom', handleInfiniteScrollUseDocumentBottom + handleInfiniteScrollUseDocumentBottom scope.infiniteScrollUseDocumentBottom + + # infinite-scroll-container sets the container which we want to be + # infinte scrolled, instead of the whole window. Must be an + # Angular or jQuery element, or, if jQuery is loaded, + # a jQuery selector as a string. + changeContainer = (newContainer) -> + if container? + container.unbind 'scroll', handler + + container = newContainer + if newContainer? + container.bind 'scroll', handler + + changeContainer windowElement + + if scope.infiniteScrollListenForEvent + unregisterEventListener = $rootScope.$on scope.infiniteScrollListenForEvent, handler + + handleInfiniteScrollContainer = (newContainer) -> + # TODO: For some reason newContainer is sometimes null instead + # of the empty array, which Angular is supposed to pass when the + # element is not defined + # (https://github.com/sroze/ngInfiniteScroll/pull/7#commitcomment-5748431). + # So I leave both checks. + if (not newContainer?) or newContainer.length == 0 + return + + if newContainer.nodeType && newContainer.nodeType == 1 + newContainer = angular.element newContainer + else if typeof newContainer.append == 'function' + newContainer = angular.element newContainer[newContainer.length - 1] + else if typeof newContainer == 'string' + newContainer = angular.element document.querySelector newContainer + + if newContainer? + changeContainer newContainer + else + throw new Error("invalid infinite-scroll-container attribute.") + + scope.$watch 'infiniteScrollContainer', handleInfiniteScrollContainer + handleInfiniteScrollContainer(scope.infiniteScrollContainer or []) + + # infinite-scroll-parent establishes this element's parent as the + # container infinitely scrolled instead of the whole window. + if attrs.infiniteScrollParent? + changeContainer angular.element elem.parent() + + # infinte-scoll-immediate-check sets whether or not run the + # expression passed on infinite-scroll for the first time when the + # directive first loads, before any actual scroll. + if attrs.infiniteScrollImmediateCheck? + immediateCheck = scope.$eval(attrs.infiniteScrollImmediateCheck) + + checkInterval = $interval (-> + if immediateCheck + handler() + $interval.cancel checkInterval + ) +] +if typeof module != "undefined" && typeof exports != "undefined" && module.exports == exports + module.exports = 'infinite-scroll' diff --git a/catalog-ui/app/third-party/ng-infinite-scroll/test/protractor-local.conf.js b/catalog-ui/app/third-party/ng-infinite-scroll/test/protractor-local.conf.js new file mode 100644 index 0000000000..134c723f91 --- /dev/null +++ b/catalog-ui/app/third-party/ng-infinite-scroll/test/protractor-local.conf.js @@ -0,0 +1,27 @@ +/*- + * ============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========================================================= + */ + +var config = require('./protractor-shared.conf').config; + +config.multiCapabilities = [ + { browserName: 'chrome' } +]; + +exports.config = config; diff --git a/catalog-ui/app/third-party/ng-infinite-scroll/test/protractor-shared.conf.js b/catalog-ui/app/third-party/ng-infinite-scroll/test/protractor-shared.conf.js new file mode 100644 index 0000000000..d1e567d7b4 --- /dev/null +++ b/catalog-ui/app/third-party/ng-infinite-scroll/test/protractor-shared.conf.js @@ -0,0 +1,26 @@ +/*- + * ============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========================================================= + */ + +exports.config = { + specs: ['**/*.spec.coffee'], + baseUrl: 'http://localhost:8000/', + allScriptsTimeout: 30000, + getPageTimeout: 30000 +}; diff --git a/catalog-ui/app/third-party/ng-infinite-scroll/test/protractor-travis.conf.js b/catalog-ui/app/third-party/ng-infinite-scroll/test/protractor-travis.conf.js new file mode 100644 index 0000000000..54fe0bd828 --- /dev/null +++ b/catalog-ui/app/third-party/ng-infinite-scroll/test/protractor-travis.conf.js @@ -0,0 +1,32 @@ +/*- + * ============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========================================================= + */ + +var config = require('./protractor-shared.conf').config; + +// All available platform / browser combinations can be found on https://saucelabs.com/platforms +config.multiCapabilities = [ + { + browserName: 'chrome', + platform: 'OS X 10.10', + version: '37' + } +]; + +exports.config = config; diff --git a/catalog-ui/app/third-party/ng-infinite-scroll/test/spec/ng-infinite-scroll.spec.coffee b/catalog-ui/app/third-party/ng-infinite-scroll/test/spec/ng-infinite-scroll.spec.coffee new file mode 100644 index 0000000000..07e6fec8be --- /dev/null +++ b/catalog-ui/app/third-party/ng-infinite-scroll/test/spec/ng-infinite-scroll.spec.coffee @@ -0,0 +1,221 @@ +fs = require "fs" +mkdirp = require "mkdirp" + +getTemplate = (angularVersion, container, attrs, throttle) -> + """ + + + + + + + + + Enable + Force + Trigger + #{containers[container].start} +
        +

        + {{$index}} +

        +
        + #{containers[container].end} + + """ + +containers = + window: + start: "" + end: "" + attr: "" + parent: + start: "
        " + end: "
        " + attr: "infinite-scroll-parent" + ancestor: + start: "
        " + end: "
        " + attr: "infinite-scroll-container='\"#ancestor\"'" + +getElementByIdScript = (id) -> + "document.getElementById('#{id}')" + +calculateChildrenHeightScript = (id) -> + """ + [].concat.apply([], #{getElementByIdScript(id)}.childNodes) + .map(function (el) { return el.offsetHeight ? el.offsetHeight : 0; }) + .reduce(function (cur, prev) { return prev + cur; }, 0) + """ + +scrollToBottomScript = (container) -> + if container is "window" + "window.scrollTo(0, document.body.scrollHeight)" + else + "#{getElementByIdScript(container)}.scrollTop = #{calculateChildrenHeightScript(container)}" + +scrollToLastScreenScript = (container, offset) -> + # 2 * window.innerHeight means that the bottom of the screen should be somewhere close to + # body height - window height. That means that the top of the window is body height - 2 * window height. + if container is "window" + "window.scrollTo(0, document.body.scrollHeight - 2 * window.innerHeight + #{offset})" + else + """ + #{getElementByIdScript(container)}.scrollTop = + #{calculateChildrenHeightScript(container)} - 2 * #{getElementByIdScript(container)}.offsetHeight + #{offset} + """ + +collapseItemsScript = (container) -> + """ + var items = document.getElementsByTagName('p') + for (i = 0; i < items.length; ++i) { + items[i].style.display = 'none' + } + """ + +getItems = -> + element.all(By.repeater "item in items") + +tmpDir = ".tmp" +pathToDocument = "#{tmpDir}/index.html" + +describe "ng-infinite-scroll", -> + for angularVersion in ["1.2.0", "1.3.4"] + describe "with Angular #{angularVersion}", -> + for container in ["window", "ancestor", "parent"] + describe "with #{container} as container", -> + + replaceIndexFile = (attrs, throttle) -> + mkdirp tmpDir + fs.writeFileSync(pathToDocument, getTemplate(angularVersion, container, attrs, throttle)) + + describe "without throttling", -> + + throttle = null + + it "should be triggered immediately and when container is scrolled to the bottom", -> + replaceIndexFile "", throttle + browser.get pathToDocument + expect(getItems().count()).toBe 100 + browser.driver.executeScript(scrollToBottomScript(container)) + expect(getItems().count()).toBe 200 + + it "does not trigger immediately when infinite-scroll-immediate-check is false", -> + replaceIndexFile "infinite-scroll-immediate-check='false'", throttle + browser.get pathToDocument + expect(getItems().count()).toBe 0 + element(By.id("force")).click() + expect(getItems().count()).toBe 100 + browser.driver.executeScript(scrollToBottomScript(container)) + expect(getItems().count()).toBe 200 + + it "respects the disabled attribute", -> + replaceIndexFile "infinite-scroll-disabled='busy'", throttle + browser.get pathToDocument + expect(getItems().count()).toBe 0 + element(By.id("action")).click() + expect(getItems().count()).toBe 100 + + it "respects the infinite-scroll-distance attribute", -> + replaceIndexFile "infinite-scroll-distance='1'", throttle + browser.get pathToDocument + expect(getItems().count()).toBe 100 + browser.driver.executeScript(scrollToLastScreenScript(container, -20)) + expect(getItems().count()).toBe 100 + browser.driver.executeScript(scrollToLastScreenScript(container, 20)) + expect(getItems().count()).toBe 200 + + describe "with an event handler", -> + + it "calls the event handler on an event", -> + replaceIndexFile "infinite-scroll-listen-for-event='anEvent'", throttle + browser.get pathToDocument + expect(getItems().count()).toBe 100 + browser.driver.executeScript(collapseItemsScript(container)) + expect(getItems().count()).toBe 100 + element(By.id("trigger")).click() + expect(getItems().count()).toBe 200 + + describe "with throttling", -> + + throttle = browser.params.testThrottleValue + + it "should be triggered immediately and when container is scrolled to the bottom", -> + replaceIndexFile "", throttle + browser.get pathToDocument + expect(getItems().count()).toBe 100 + browser.driver.executeScript(scrollToBottomScript(container)) + expect(getItems().count()).toBe 100 + browser.sleep(throttle) + expect(getItems().count()).toBe 200 + + it "does not trigger immediately when infinite-scroll-immediate-check is false", -> + replaceIndexFile "infinite-scroll-immediate-check='false'", throttle + browser.get pathToDocument + expect(getItems().count()).toBe 0 + element(By.id("force")).click() + expect(getItems().count()).toBe 100 + + it "respects the disabled attribute and is throttled when page loads", -> + replaceIndexFile "infinite-scroll-disabled='busy'", throttle + browser.get pathToDocument + expect(getItems().count()).toBe 0 + element(By.id("action")).click() + expect(getItems().count()).toBe 0 + browser.sleep(throttle) + expect(getItems().count()).toBe 100 + + it "is not throttled when re-enabled if the throttle time has already elapsed", -> + replaceIndexFile "infinite-scroll-disabled='busy'", throttle + browser.get pathToDocument + expect(getItems().count()).toBe 0 + browser.sleep(throttle) + element(By.id("action")).click() + expect(getItems().count()).toBe 100 + + it "respects the infinite-scroll-distance attribute", -> + replaceIndexFile "infinite-scroll-distance='1'", throttle + browser.get pathToDocument + expect(getItems().count()).toBe 100 + browser.driver.executeScript(scrollToLastScreenScript(container, 20)) + expect(getItems().count()).toBe 100 + browser.sleep(throttle) + expect(getItems().count()).toBe 200 + + describe "with an event handler", -> + + it "calls the event handler on an event", -> + replaceIndexFile "infinite-scroll-listen-for-event='anEvent'", throttle + browser.get pathToDocument + expect(getItems().count()).toBe 100 + browser.driver.executeScript(collapseItemsScript(container)) + expect(getItems().count()).toBe 100 + element(By.id("trigger")).click() + expect(getItems().count()).toBe 100 + browser.sleep(throttle) + expect(getItems().count()).toBe 200 diff --git a/catalog-ui/bower dependecies b/catalog-ui/bower dependecies new file mode 100644 index 0000000000..7a21bbcef7 --- /dev/null +++ b/catalog-ui/bower dependecies @@ -0,0 +1,29 @@ +{ + "name": "catalog-ui", + "private": true, + "dependencies": { + "angular": "~1.3.x", + "angular-base64": "~2.0.5", //for translate base 64 + "angular-base64-upload": "~0.1.8", //upload file base 64 + "angular-bootstrap": "~0.13.0", + "angular-dragdrop": "~1.0.11", //for drag & drop elements in canvas + "angular-filter": "~0.5.6", // for filter categories + "angular-md5": "~0.1.7", //translate from & to md5 + "angular-perfect-scrollbar": "~0.0.4", // fir design cross browser scrollbar + "angular-qtip2-directive": "~0.1.2", // for design tooltips + "angular-resource": "~1.3.15", // for restfully Api + "angular-sanitize": "~1.4.4", //https://docs.angularjs.org/api/ngSanitize/service/$sanitize + "angular-ui-router": "~0.2.14", + "angular-uuid4": "~0.3.0", + "bootstrap": "3.3.4", // dependency for angular bootstrap + "checklist-model": "~0.2.4", // for categories check list model + "jquery": "~1.11.1", + "lodash": "~3.7.0", // js utils functions + "angular-translate": "~2.8.0", // dependencies for language support + "angular-translate-loader-static-files": "~2.8.0" // for language support + }, + "resolutions": { + "angular": "~1.3.x", + "jquery": "~2.0.3" + } +} diff --git a/catalog-ui/bower.json b/catalog-ui/bower.json new file mode 100644 index 0000000000..d941f1620a --- /dev/null +++ b/catalog-ui/bower.json @@ -0,0 +1,42 @@ +{ + "name": "catalog-ui", + "private": true, + "dependencies": { + "angular": "1.5.0", + "angular-base64": "2.0.5", + "angular-base64-upload": "0.1.19", + "angular-bootstrap": "0.14.3", + "angular-dragdrop": "https://github.com/dimkinv/angular-dragdrop.git#1.0.14", + "angular-filter": "0.5.14", + "angular-mocks": "1.5.0", + "angular-perfect-scrollbar": "0.0.4", + "angular-resource": "1.5.11", + "angular-sanitize": "1.4.4", + "angular-tooltips": "0.1.23", + "angular-translate": "2.8.0", + "angular-translate-loader-static-files": "2.8.0", + "angular-ui-router": "0.2.14", + "angular-uuid4": "0.3.0", + "bootstrap": "3.3.4", + "checklist-model": "0.2.4", + "jquery": "2.2.4", + "jspdf": "1.0.272", + "animate.css": "~3.5.1", + "angular-clipboard": "1.5.0", + "ui-bootstrap": "1.3.3", + "angular-resizable": "1.2.0", + "angular-ui-notification": "0.2.0", + "js-md5": "md5#0.4.1", + "cytoscape": "^2.7.10", + "lodash": "^4.17.2", + "restangular": "^1.5.2", + "cytoscape-expand-collapse": "https://github.com/bardit/cytoscape.js-expand-collapse.git", + "cytoscape-qtip": "https://github.com/bardit/cytoscape.js-qtip.git", + "qtip2": "^2.2.1" + }, + "resolutions": { + "angular": "1.5.0", + "jquery": "2.2.4", + "angular-translate": "2.8.1" + } +} diff --git a/catalog-ui/build_catalog_ui.bat b/catalog-ui/build_catalog_ui.bat new file mode 100644 index 0000000000..7a153e9ae7 --- /dev/null +++ b/catalog-ui/build_catalog_ui.bat @@ -0,0 +1,29 @@ + +rem nvmw use v0.12.4 + +echo "npm install" +call npm install + +if %errorlevel% NEQ 0 GOTO BAD_EXIT + +echo "bower install" +call bower install +if %errorlevel% NEQ 0 GOTO BAD_EXIT + + +echo "build --v" +grunt build --v + +if %errorlevel% NEQ 0 GOTO BAD_EXIT + +GOTO SMOOTH + + +:BAD_EXIT +echo BOO +exit/ b 1 + + +:SMOOTH +echo "OK." +exit /b 0 diff --git a/catalog-ui/build_catalog_ui.sh b/catalog-ui/build_catalog_ui.sh new file mode 100644 index 0000000000..8bae776893 --- /dev/null +++ b/catalog-ui/build_catalog_ui.sh @@ -0,0 +1,84 @@ + +#!/bin/sh + +### Set the node environment. +#NODE_VERSION="v6.2.2" + +#echo "Set the node environment." +#. "$NVM_DIR/nvm.sh" +#echo "OK." +#echo "" + + + +### Add newer c++ compiler. +#if [ -f /opt/rh/devtoolset-4/enable ]; then +# . /opt/rh/devtoolset-4/enable +#fi + + + + +### Set the node version manager version. +#echo "Set the node version manager version." +#nvm use ${NODE_VERSION} +#echo "OK." +#echo "" + + +### Run install bower. +echo "Run install bower." +#if [ -e $NVM_DIR/versions/node/${NODE_VERSION}/lib/node_modules/bower/bin/bower ]; then +# echo " - bower is already installed." +#else +npm install bower +#fi +#echo "OK." +#echo "" + + + +### Run install grunt-cli. +echo "Run install grunt-cli." +#if [ -e $NVM_DIR/versions/node/${NODE_VERSION}/lib/node_modules/grunt-cli/bin/grunt ]; then +# echo " - grunt-cli is already installed." +#else +npm install grunt-cli +#fi +#echo "OK." +#echo "" + + + +### Clean the Node cache. +#echo "Clean the Node cache - if stuck." +#npm cache clean +#echo "OK." +#echo "" + + + +### Run the Node package manager (NPM). +echo "Run the Node package manager (NPM)." +#npm config set proxy http://one.proxy.att.com:8080 +#npm config set https-proxy http://one.proxy.att.com:8080 +#npm config set registry https://registry.npmjs.org + +npm install +echo "OK." +echo "" + + + +### Install the Bower components. +echo "Install the Bower components." +bower install +echo "OK." +echo "" + + + +### Build the application. +echo "Build the application." +grunt build + diff --git a/catalog-ui/configurations/MenuReadMe.txt b/catalog-ui/configurations/MenuReadMe.txt new file mode 100644 index 0000000000..660427e5c9 --- /dev/null +++ b/catalog-ui/configurations/MenuReadMe.txt @@ -0,0 +1,60 @@ +******************************************************************* +******* Explanation about menu.json ******* +******************************************************************* + +The menu.json defines the menu to show for each type of "roles": + +Supported roles: +----------------------------- +ADMIN +DESIGNER +PRODUCT_STRATEGIST +PRODUCT_MANAGER +TESTER +OPS +GOVERNOR + +The JSON is separated to roles, and for each role we define "states", +what menu to show the user for each state of the component: + +Supported states: +----------------------------- +NOT_CERTIFIED_CHECKOUT +NOT_CERTIFIED_CHECKIN +READY_FOR_CERTIFICATION +CERTIFICATION_IN_PROGRESS +CERTIFIED + +For each state we can define the user that will see this menu, the available parameters are: + +Supported users: +----------------------------- +ANY +NOT_OWNER + +Example: +For designer, if the component state is checkout and the component was created by other user, the NOT_OWNER will be used. + +"DESIGNER":{ + "states":{ + "NOT_CERTIFIED_CHECKOUT":{ + "ANY":[ + {"text":"Edit" ,"action":"goToEntity"}, + {"text":"Check in","action":"changeLifecycleState", "url":"lifecycleState/CHECKIN", "confirmationModal": "lifecycleState/CHECKIN"}, + {"text":"Submit for Testing","action":"changeLifecycleState", "url":"lifecycleState/certificationRequest", "emailModal": "lifecycleState/CERTIFICATIONREQUEST"}, + {"text":"View" ,"action":"openViewerModal"} + ], + "NOT_OWNER":[ + {"text":"View" ,"action":"openViewerModal"} + ] + }, + + +Definition of the menu item: +----------------------------- +text - The text to show +action - Function that will be called when pressing on the menu item +url - Data added to menu item, in case the function need to use it, example: for function "changeLifecycleState", I need to pass also the url "lifecycleState/CHECKOUT" that I want the state to change to. +confirmationModal - Open confirmation modal (user should select "OK" or "Cancel"), and continue with the action. +emailModal - Open email modal (user should fill email details), and continue with the action. +blockedForTypes - This item will not be shown for specific components types. diff --git a/catalog-ui/configurations/dev.json b/catalog-ui/configurations/dev.json new file mode 100644 index 0000000000..4cc09d3c31 --- /dev/null +++ b/catalog-ui/configurations/dev.json @@ -0,0 +1,430 @@ +{ + "environment": "dev", + "api": { + "GET_component": "/v1/catalog/:type/:id", + "PUT_component": "/v1/catalog/:type/:id/metadata", + "GET_component_validate_name": "/v1/catalog/:type/validate-name/:name", + "POST_changeLifecycleState": "/v1/catalog/", + "component_api_root": "/v1/catalog/", + "welcome_page_video_url": "http://0.0.0.0:8282/moti/movie", + + "GET_user": "/v1/user/:id", + "GET_user_authorize": "/v1/user/authorize", + "GET_all_users": "/v1/user/users", + "POST_create_user": "/v1/user", + "DELETE_delete_user": "/v1/user/:id", + "POST_edit_user_role": "/v1/user/:id/role", + "GET_resource": "/v1/catalog/resources/:id", + "GET_resources_latestversion_notabstract":"/v1/catalog/:type/latestversion/notabstract/:id", + "GET_resources_certified_not_abstract": "/v1/catalog/resources/certified/notabstract/:id", + "GET_resources_certified_abstract": "/v1/catalog/resources/certified/abstract/:id", + "GET_resource_property": "/v1/catalog/:type/:entityId/properties/:id", + "PUT_resource": "/v1/catalog/resources/:id/metadata", + "GET_resource_artifact": "/v1/catalog/:type/:entityId/artifacts/:id", + "GET_download_instance_artifact": "/v1/catalog/:type/:entityId/resourceInstances/:instanceId/artifacts/:id", + "POST_instance_artifact": "/v1/catalog/:type/:entityId/resourceInstance/:instanceId/artifacts/:id", + "GET_resource_additional_information": "/v1/catalog/:type/:entityId/additionalinfo/:id", + "GET_service_artifact": "/v1/catalog/services/:serviceId/artifacts/:id", + "GET_resource_interface_artifact": "/v1/catalog/:type/:entityId/standard/:operation/artifacts/:id", + "GET_resource_api_artifact": "/v1/catalog/:type/:entityId/artifacts/api/:id", + "GET_configuration_ui": "/v1/configuration/ui", + "GET_resource_validate_name": "/v1/catalog/resources/validate-name/:name", + "GET_activity_log": "/v1/catalog/audit-records/:type/:id", + "GET_service": "/v1/catalog/services/:id", + "GET_service_validate_name": "/v1/catalog/services/validate-name/:name", + "GET_service_distributions":"/v1/catalog/services/:uuid/distribution", + "GET_service_distributions_components":"/v1/catalog/services/distribution/:distributionId", + "POST_service_distribution_deploy" : "/v1/catalog/services/:serviceId/distribution/:distributionId/markDeployed", + "GET_element": "/v1/followed", + "GET_catalog": "/v1/screen", + "GET_ecomp_menu_items": "/v1/user/:userId/functionalmenu", + "GET_resource_category": "/v1/resourceCategories", + "GET_service_category": "/v1/serviceCategories", + "resource_instance": "/v1/catalog/:entityType/:entityId/resourceInstance/:id", + "GET_resource_instance_property": "/v1/catalog/:type/:entityId/resourceInstance/:componentInstanceId/property/:propertyValueId", + "GET_relationship": "/v1/catalog/:entityType/:entityId/resourceInstance/:action", + "GET_lifecycle_state_resource": "/v1/catalog/:type/:id/lifecycleState/:action", + "GET_lifecycle_state_CHECKIN":"lifecycleState/CHECKIN", + "GET_lifecycle_state_CERTIFICATIONREQUEST":"lifecycleState/CERTIFICATIONREQUEST", + "GET_lifecycle_state_UNDOCHECKOUT":"lifecycleState/UNDOCHECKOUT", + "root": "http://feHost:8181/sdc1/feProxy/rest", + "PUT_service": "/v1/catalog/services/:id/metadata", + "GET_download_artifact": "/v1/catalog/", + "GET_SDC_Version": "/version", + "GET_categories": "/v1/categories/:types", + "POST_category": "/v1/category/:types/:categoryId", + "POST_subcategory": "/v1/category/:types/:categoryId/subCategory/:subCategoryId", + "POST_change_instance_version": "/v1/catalog/:entityType/:entityId/resourceInstance/:id/changeVersion", + "GET_requirements_capabilities": "/v1/catalog/requirmentsCapabilities/:type/:id", + "GET_resource_artifact_types": "/v1/artifactTypes", + "GET_product_catalog": "/v1/productScreen", + "GET_product_category": "/v1/productCategories", + "GET_product_category_temp": "/v1/artifactTypes", + "POST_product": "/v1/catalog/products/:id/metadata", + "GET_product_validate_name": "/v1/catalog/services/validate-name/:name", + "GET_product": "/v1/catalog/products/:id", + "GET_product_sub_category": "/v1/productSubCategories", + "GET_onboarding": "http://fehost:8181/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products/packages", + "GET_component_from_csar_uuid": "/v1/catalog/resources/csar/:csar_uuid", + "kibana": "/sdc1/kibanaProxy/" + }, + "resourceTypesFilter":{ + "resource":["CP","VFC"], + "service":["CP","VF"], + "product":[] + }, + "logConfig": { + "minLogLevel": "debug", + "prefix": "sdcApp" + }, + "cookie": { + "junctionName": "IV_JCT", + "prefix": "AMWEBJCT!", + "userIdSuffix": "USER_ID", + "userFirstName": "HTTP_CSP_FIRSTNAME", + "userLastName": "HTTP_CSP_LASTNAME", + "userEmail": "HTTP_CSP_EMAIL", + "xEcompRequestId": " X-ECOMP-RequestID" + }, + "imagesPath": "", + "cpEndPointInstances" : ["cloudep","ossep","personep","premisesep"], + "toscaFileExtension":"yaml,yml", + "csarFileExtension":"csar", + "openSource": true, + "categories": {}, + "testers": { + "RESOURCE": { + "Network L2-3": "DL-ASDCL1-3ResourceCertificationTeam", + "Network L4+": "DL-ASDCL4-7ResourceCertificationTeam", + "Application L4+": "DL-ASDCL4-7ResourceCertificationTeam", + "default": "DL-ASDCL1-3ResourceCertificationTeam;DL-ASDCL4-7ResourceCertificationTeam" + }, + "SERVICE": { + "Network L1-3": "DL-ASDCL1-4ServiceCertificationTeam", + "Network L4+": "DL-ASDCL4-7ServiceCertificationTeam", + "default": "DL-ASDCL1-4ServiceCertificationTeam;DL-ASDCL4-7ServiceCertificationTeam" + } + }, + "roles": ["ADMIN", "TESTER", "GOVERNOR", "OPS", "DESIGNER", "PRODUCT_MANAGER", "PRODUCT_STRATEGIST"], + "tutorial": { + "tabs": [ + { + "id":1, + "name":"TUTRIAL_GENERAL_TAB_1", + "defaultPage":1 + }, + { + "id":2, + "name":"TUTRIAL_GENERAL_TAB_2", + "defaultPage":9 + }, + { + "id":3, + "name":"TUTRIAL_GENERAL_TAB_3", + "defaultPage":12 + } + ], + "pages": + [ + { + "id":1, + "template": "text-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE1_TITLE", + "description":"TUTORIAL_PAGE1_TEXT" + } + + }, + { + "id":2, + "template": "image-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE2_TITLE", + "description":"TUTORIAL_PAGE2_TEXT", + "imageClass":"sdc-tutorial-page-2-image" + } + }, + { + "id":3, + "template": "image-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE3_TITLE", + "description":"TUTORIAL_PAGE3_TEXT", + "imageClass":"sdc-tutorial-page-3-image" + } + }, + { + "id":4, + "template": "image-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE4_TITLE", + "description":"TUTORIAL_PAGE4_TEXT", + "imageClass":"sdc-tutorial-page-4-image" + } + }, + { + "id":5, + "template": "image-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE5_TITLE", + "description":"TUTORIAL_PAGE5_TEXT", + "imageClass":"sdc-tutorial-page-5-image" + } + }, + { + "id":6, + "template": "image-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE6_TITLE", + "description":"TUTORIAL_PAGE6_TEXT", + "imageClass":"sdc-tutorial-page-6-image" + } + }, + { + "id":7, + "template": "image-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE7_TITLE", + "description":"TUTORIAL_PAGE7_TEXT", + "imageClass":"sdc-tutorial-page-7-image" + } + }, + { + "id":8, + "template": "image-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE8_TITLE", + "description":"TUTORIAL_PAGE8_TEXT", + "imageClass":"sdc-tutorial-page-8-image" + } + }, + { + "id":9, + "template": "text-template", + "tab": 2, + "data":{ + "title":"TUTORIAL_PAGE9_TITLE", + "description":"TUTORIAL_PAGE9_TEXT" + } + }, + { + "id":10, + "template": "image-template", + "tab": 2, + "data":{ + "title":"TUTORIAL_PAGE10_TITLE", + "description":"TUTORIAL_PAGE10_TEXT", + "imageClass":"sdc-tutorial-page-10-image" + } + }, + { + "id":11, + "template": "image-template", + "tab": 2, + "data":{ + "title":"TUTORIAL_PAGE11_TITLE", + "description":"TUTORIAL_PAGE11_TEXT", + "imageClass":"sdc-tutorial-page-11-image" + } + }, + { + "id":12, + "template": "text-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE12_TITLE", + "description":"TUTORIAL_PAGE12_TEXT" + } + }, + { + "id":13, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE13_TITLE", + "description":"TUTORIAL_PAGE13_TEXT", + "imageClass":"sdc-tutorial-page-13-image" + } + }, + { + "id":14, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE14_TITLE", + "description":"TUTORIAL_PAGE14_TEXT", + "imageClass":"sdc-tutorial-page-14-image" + } + }, + { + "id":15, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE15_TITLE", + "description":"TUTORIAL_PAGE15_TEXT", + "imageClass":"sdc-tutorial-page-15-image" + } + }, + { + "id":16, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE16_TITLE", + "description":"TUTORIAL_PAGE16_TEXT", + "imageClass":"sdc-tutorial-page-16-image" + } + }, + { + "id":17, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE17_TITLE", + "description":"TUTORIAL_PAGE17_TEXT", + "imageClass":"sdc-tutorial-page-17-image" + } + }, + { + "id":18, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE18_TITLE", + "description":"TUTORIAL_PAGE18_TEXT", + "imageClass":"sdc-tutorial-page-18-image" + } + }, + { + "id":19, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE19_TITLE", + "description":"TUTORIAL_PAGE19_TEXT", + "imageClass":"sdc-tutorial-page-19-image" + } + }, + { + "id":20, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE20_TITLE", + "description":"TUTORIAL_PAGE20_TEXT", + "imageClass":"sdc-tutorial-page-20-image" + } + }, + { + "id":21, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE21_TITLE", + "description":"TUTORIAL_PAGE21_TEXT", + "imageClass":"sdc-tutorial-page-21-image" + } + }, + { + "id":22, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE22_TITLE", + "description":"TUTORIAL_PAGE22_TEXT", + "imageClass":"sdc-tutorial-page-22-image" + } + }, + { + "id":23, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE23_TITLE", + "description":"TUTORIAL_PAGE23_TEXT", + "imageClass":"sdc-tutorial-page-23-image" + } + }, + { + "id":24, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE24_TITLE", + "description":"TUTORIAL_PAGE24_TEXT", + "imageClass":"sdc-tutorial-page-24-image" + } + }, + { + "id":25, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE25_TITLE", + "description":"TUTORIAL_PAGE25_TEXT", + "imageClass":"sdc-tutorial-page-25-image" + } + }, + { + "id":26, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE26_TITLE", + "description":"TUTORIAL_PAGE26_TEXT", + "imageClass":"sdc-tutorial-page-26-image" + } + }, + { + "id":27, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE27_TITLE", + "description":"TUTORIAL_PAGE27_TEXT", + "imageClass":"sdc-tutorial-page-27-image" + } + }, + { + "id":28, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE28_TITLE", + "description":"TUTORIAL_PAGE28_TEXT", + "imageClass":"sdc-tutorial-page-28-image" + } + }, + { + "id":29, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE29_TITLE", + "description":"TUTORIAL_PAGE29_TEXT", + "imageClass":"sdc-tutorial-page-29-image" + } + }, + { + "id":30, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE30_TITLE", + "description":"TUTORIAL_PAGE30_TEXT", + "imageClass":"sdc-tutorial-page-30-image" + } + } + + ] + } +} diff --git a/catalog-ui/configurations/menu.json b/catalog-ui/configurations/menu.json new file mode 100644 index 0000000000..cd451e79f1 --- /dev/null +++ b/catalog-ui/configurations/menu.json @@ -0,0 +1,576 @@ +{ + "roles":{ + "ADMIN":{ + "title": "Admin's Workspace", + "pages":[], + "states":{ + "NOT_CERTIFIED_CHECKOUT":{ + "ANY":[ + {"text":"Submit for Testing","action":"changeLifecycleState", "url":"lifecycleState/certificationRequest" , "emailModal": "lifecycleState/CERTIFICATIONREQUEST"}, + {"text":"View" ,"action":"openViewerModal"} + ] + }, + "NOT_CERTIFIED_CHECKIN": { + "ANY": [ + {"text": "Submit for Testing", "action": "changeLifecycleState", "url": "lifecycleState/certificationRequest", "emailModal": "lifecycleState/CERTIFICATIONREQUEST"}, + {"text": "View","action": "openViewerModal"} + ] + }, + "READY_FOR_CERTIFICATION": { + "ANY":[ + {"text": "View","action": "openViewerModal"} + ] + }, + "CERTIFICATION_IN_PROGRESS":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + }, + "CERTIFIED":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + } + } + }, + "DESIGNER":{ + "title": "Designer's Workspace", + "pages":[], + "dashboard": { + "showCreateNew": true, + "showCreateNewProduct": false + }, + "changeLifecycleStateButtons":{ + "NOT_CERTIFIED_CHECKOUT":{ "submitForTesting": {"text":"Submit for Testing", "url":"lifecycleState/certificationRequest", "emailModal": "lifecycleState/CERTIFICATIONREQUEST"}, + "checkIn": {"text":"Check in", "url":"lifecycleState/CHECKIN", "confirmationModal": "lifecycleState/CHECKIN"}, + "deleteVersion": {"text":"Delete Version", "url":"lifecycleState/UNDOCHECKOUT", "alertModal": "lifecycleState/UNDOCHECKOUT"} + }, + "CERTIFIED":{ "checkOut": {"text":"Check Out", "url":"lifecycleState/CHECKOUT"} + }, + "NOT_CERTIFIED_CHECKIN":{ "submitForTesting": {"text":"Submit for Testing", "url":"lifecycleState/certificationRequest", "emailModal": "lifecycleState/CERTIFICATIONREQUEST"}, + "checkOut": {"text":"Check Out", "url":"lifecycleState/CHECKOUT"} + } + }, + "states":{ + "NOT_CERTIFIED_CHECKOUT":{ + "ANY":[ + {"text":"Submit for Testing","action":"changeLifecycleState", "url":"lifecycleState/certificationRequest", "emailModal": "lifecycleState/CERTIFICATIONREQUEST"}, + {"text":"View" ,"action":"openViewerModal"} + ] + }, + "NOT_CERTIFIED_CHECKIN": { + "ANY": [ + {"text": "Submit for Testing", "action": "changeLifecycleState", "url": "lifecycleState/certificationRequest", "emailModal": "lifecycleState/CERTIFICATIONREQUEST"}, + {"text": "View","action": "openViewerModal"} + ] + }, + "READY_FOR_CERTIFICATION": { + "ANY":[ + {"text": "View","action": "openViewerModal"} + ] + }, + "CERTIFICATION_IN_PROGRESS":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + }, + "CERTIFIED":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + } + }, + "folder":[ + {"text": "Active Projects", "groupname": "IN_PROGRESS" }, + {"text": "Check Out", "group": "IN_PROGRESS", "state": "NOT_CERTIFIED_CHECKOUT"}, + {"text": "Check In", "group": "IN_PROGRESS", "state": "NOT_CERTIFIED_CHECKIN"}, + {"text": "Followed Projects", "groupname": "FOLLOWING" }, + {"text": "Ready For Testing", "group": "FOLLOWING", "state": "READY_FOR_CERTIFICATION"}, + {"text": "In Testing", "group": "FOLLOWING", "state": "CERTIFICATION_IN_PROGRESS"}, + {"text": "Certified", "group": "FOLLOWING", "state": "CERTIFIED"} + ] + + }, + "PRODUCT_STRATEGIST":{ + "title": "Product Strategist's Workspace", + "pages":[], + "dashboard": { + "showCreateNew": false, + "showCreateNewProduct": false + }, + "changeLifecycleStateButtons":{}, + + "states":{ + "NOT_CERTIFIED_CHECKOUT":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + }, + "NOT_CERTIFIED_CHECKIN": { + "ANY": [ + {"text": "View","action": "openViewerModal"} + ] + }, + "READY_FOR_CERTIFICATION": { + "ANY":[ + {"text": "View","action": "openViewerModal"} + ] + }, + "CERTIFICATION_IN_PROGRESS":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + }, + "CERTIFIED":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + } + }, + "folder":[ + {"text": "Active Projects", "groupname": "IN_PROGRESS" }, + {"text": "Check Out", "group": "IN_PROGRESS", "state": "NOT_CERTIFIED_CHECKOUT"}, + {"text": "Check In", "group": "IN_PROGRESS", "state": "NOT_CERTIFIED_CHECKIN"}, + {"text": "Followed Projects", "groupname": "FOLLOWING" }, + {"text": "Ready For Testing", "group": "FOLLOWING", "state": "READY_FOR_CERTIFICATION"}, + {"text": "In Testing", "group": "FOLLOWING", "state": "CERTIFICATION_IN_PROGRESS"}, + {"text": "Certified", "group": "FOLLOWING", "state": "CERTIFIED"} + ] + }, + "PRODUCT_MANAGER":{ + "title": "Product Manager Workspace", + "pages":[], + "dashboard": { + "showCreateNew": false, + "showCreateNewProduct": true + }, + "changeLifecycleStateButtons":{ + "NOT_CERTIFIED_CHECKOUT":{ "checkIn": {"text":"Check in", "url":"lifecycleState/CHECKIN", "confirmationModal": "lifecycleState/CHECKIN"}, + "deleteVersion":{"text":"Delete Version", "url":"lifecycleState/UNDOCHECKOUT", "alertModal": "lifecycleState/UNDOCHECKOUT"} + }, + "NOT_CERTIFIED_CHECKIN":{ "checkOut": {"text":"Check Out", "url":"lifecycleState/CHECKOUT"} + } + }, + "states":{ + "NOT_CERTIFIED_CHECKOUT":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + }, + "NOT_CERTIFIED_CHECKIN": { + "ANY": [ + {"text": "View","action": "openViewerModal"} + ] + }, + "READY_FOR_CERTIFICATION": { + "ANY":[ + {"text": "View","action": "openViewerModal"} + ] + }, + "CERTIFICATION_IN_PROGRESS":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + }, + "CERTIFIED":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + } + }, + "folder":[ + {"text": "Active Projects", "groupname": "IN_PROGRESS" }, + {"text": "Check Out", "group": "IN_PROGRESS", "state": "NOT_CERTIFIED_CHECKOUT"}, + {"text": "Check In", "group": "IN_PROGRESS", "state": "NOT_CERTIFIED_CHECKIN"}, + {"text": "Followed Projects", "groupname": "FOLLOWING" }, + {"text": "Ready For Testing", "group": "FOLLOWING", "state": "READY_FOR_CERTIFICATION"}, + {"text": "In Testing", "group": "FOLLOWING", "state": "CERTIFICATION_IN_PROGRESS"}, + {"text": "Certified", "group": "FOLLOWING", "state": "CERTIFIED"} + ] + }, + "TESTER":{ + "title": "Tester's Workspace", + "pages":[], + "dashboard": { + "showCreateNew": false, + "showCreateNewProduct": false + }, + "changeLifecycleStateButtons":{ + "READY_FOR_CERTIFICATION":{ "startTesting": {"text":"Start Testing", "url":"lifecycleState/startCertification"} + + }, + "CERTIFICATION_IN_PROGRESS":{ "accept": {"text":"Accept", "url":"lifecycleState/certify", "confirmationModal": "lifecycleState/certify"}, + "reject": {"text":"Reject", "url":"lifecycleState/failCertification", "confirmationModal": "lifecycleState/failCertification"}, + "cancel": {"text":"Cancel","action":"changeLifecycleState", "url":"lifecycleState/cancelCertification", "confirmationModal": "lifecycleState/cancel"} + } + }, + "states": { + "READY_FOR_CERTIFICATION":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"}, + {"text":"Start Testing","action":"changeLifecycleState", "url":"lifecycleState/startCertification"} + ] + }, + "CERTIFICATION_IN_PROGRESS":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"}, + {"text":"Accept","action":"changeLifecycleState", "url":"lifecycleState/certify", "confirmationModal": "lifecycleState/certify"}, + {"text":"Reject","action":"changeLifecycleState", "url":"lifecycleState/failCertification", "confirmationModal": "lifecycleState/failCertification"}, + {"text":"Cancel","action":"changeLifecycleState", "url":"lifecycleState/cancelCertification", "confirmationModal": "lifecycleState/cancel" } + ] + } + }, + "folder":[ + {"text": "Active Projects", "groupname": "FOLLOWING" }, + {"text": "Ready For Testing", "group": "FOLLOWING", "state": "READY_FOR_CERTIFICATION"}, + {"text": "In Testing", "group": "FOLLOWING", "state": "CERTIFICATION_IN_PROGRESS"} + ] + }, + "OPS":{ + "title": "Operations Workspace", + "pages":[], + "dashboard": { + "showCreateNew": false, + "showCreateNewProduct": false + }, + "changeLifecycleStateButtons":{ + "DISTRIBUTION_APPROVED":{ "distribute": {"text":"Distribute", "url":"distribution/PROD/activate"}, + "monitor": {"text":"Monitor", "disabled":true} + }, + "DISTRIBUTED":{ "redistribute": {"text":"Redistribute", "url":"distribution/PROD/activate"}, + "monitor": {"text":"Monitor", "url":"distribution-state/monitor"} + } + }, + "states": { + "CERTIFIED": { + "DISTRIBUTION_APPROVED": [ + {"text": "View","action": "openViewerModal"}, + {"text": "Distribute","action":"changeLifecycleState", "url":"distribution/PROD/activate"} + ], + "DISTRIBUTED": [ + {"text": "View","action": "openViewerModal"}, + {"text": "Monitor","action":"openDistributionModal", "url":"distribution-state/monitor"}, + {"text": "Redistribute","action":"changeLifecycleState", "url":"distribution/PROD/activate"} + ] + } + }, + "folder":[ + {"text": "Active Projects", "groupname": "FOLLOWING" }, + {"text": "Waiting For Distribution", "group": "FOLLOWING", "state": "CERTIFIED", "dist": "DISTRIBUTION_APPROVED"}, + {"text": "Distributed", "group": "FOLLOWING", "state": "CERTIFIED", "dist": "DISTRIBUTED"} + ] + }, + "GOVERNOR":{ + "title": "Governance Rep's Workspace", + "pages":[], + "dashboard": { + "showCreateNew": false, + "showCreateNewProduct": false + }, + "changeLifecycleStateButtons":{ + "DISTRIBUTION_NOT_APPROVED":{ "approve": {"text":"Approve", "url":"distribution-state/approve", "confirmationModal": "distribution-state/approve"}, + "reject": {"text":"Reject", "url":"distribution-state/reject", "confirmationModal": "distribution-state/reject"} + }, + "DISTRIBUTION_APPROVED":{ "reject": {"text":"Reject", "url":"distribution-state/reject", "confirmationModal": "distribution-state/reject"} + }, + "DISTRIBUTED": { "reject": {"text":"Reject", "url":"distribution-state/reject", "confirmationModal": "distribution-state/reject"} + }, + "DISTRIBUTION_REJECTED": { "approve": {"text": "Approve", "url": "distribution-state/approve", "confirmationModal": "distribution-state/approve"} + } + }, + "states": { + "CERTIFIED": { + "DISTRIBUTION_NOT_APPROVED": [ + {"text": "View","action": "openViewerModal"}, + {"text":"Approve","action":"changeLifecycleState", "url":"distribution-state/approve", "confirmationModal": "distribution-state/approve"}, + {"text":"Reject","action":"changeLifecycleState", "url":"distribution-state/reject", "confirmationModal": "distribution-state/reject"} + ], + "DISTRIBUTION_APPROVED": [ + {"text": "View","action": "openViewerModal"}, + {"text":"Reject","action":"changeLifecycleState", "url":"distribution-state/reject", "confirmationModal": "distribution-state/reject"} + ], + "DISTRIBUTED": [ + {"text": "View","action": "openViewerModal"}, + {"text":"Reject","action":"changeLifecycleState", "url":"distribution-state/reject", "confirmationModal": "distribution-state/reject"} + ], + "DISTRIBUTION_REJECTED": [ + {"text": "View","action": "openViewerModal"}, + {"text":"Approve","action":"changeLifecycleState", "url":"distribution-state/approve", "confirmationModal": "distribution-state/approve"} + ] + } + }, + "folder":[ + {"text": "Active Projects", "groupname": "FOLLOWING" }, + {"text": "Waiting For Approval", "group": "FOLLOWING", "state": "CERTIFIED", "dist": "DISTRIBUTION_NOT_APPROVED"}, + {"text": "Distribution Rejected", "group": "FOLLOWING", "state": "CERTIFIED", "dist": "DISTRIBUTION_REJECTED"}, + {"text": "Distribution Approved", "group": "FOLLOWING", "state": "CERTIFIED", "dist": "DISTRIBUTION_APPROVED,DISTRIBUTED"} + + ] + } + }, + "confirmationMessages": { + "lifecycleState/CHECKIN": {"showComment":true, "title": "Check in confirmation", "message": "Please add comment and confirm the check in."}, + "lifecycleState/CHECKOUT": {"showComment":true, "title": "Check out confirmation", "message": "Please add comment and confirm the check out."}, + "lifecycleState/certify": {"showComment":true, "title": "Distribution confirmation", "message": "Please add comment and confirm test results."}, + "lifecycleState/cancel": {"showComment":true, "title": "Cancel test", "message": "Please add comment and cancel test."}, + "lifecycleState/failCertification": {"showComment":true, "title": "Rejection confirmation", "message": "Please add comment and confirm test results."}, + "lifecycleState/CERTIFICATIONREQUEST": {"showComment":true, "title": "Submit for testing", "message": "Please add comment and submit for testing."}, + "distribution-state/approve": {"showComment":true, "title": "Distribution confirmation", "message": "Please add comment and confirm %1 approval for distribution."}, + "distribution-state/reject": {"showComment":true, "title": "Rejection confirmation", "message": "Please add comment and confirm %1 rejection for distribution."}, + "updateTemplate": {"showComment":false, "title": "Update Template Confirmation", "message": "Modifying the Template might cause losing of previous information"} + }, + "alertMessages": { + "lifecycleState/UNDOCHECKOUT": {"title": "Delete Version Confirmation", "message": "Are you sure you want to delete this version?"}, + "exitWithoutSaving": {"title": "Exit Without Saving Confirmation", "message": "All unsaved changes will be lost. Are you sure you want to exit this page?"}, + "deleteInstance": {"title": "Delete Confirmation", "message": "Are you sure you would like to delete %1 ?"}, + "deleteInput": {"title": "Delete Confirmation", "message": "Are you sure you would like to delete %1 ?"} + }, + "statuses": { + "inDesign": { + "name": "In Design", + "values": [ + "NOT_CERTIFIED_CHECKOUT", + "NOT_CERTIFIED_CHECKIN" + ] + }, + "readyForCertification": { + "name": "Ready For Testing", + "values": ["READY_FOR_CERTIFICATION"] + }, + "inCertification": { + "name": "In Testing", + "values": ["CERTIFICATION_IN_PROGRESS"] + }, + "certified": { + "name": "Certified", + "values": ["CERTIFIED"] + }, + "distributed": { + "name": "Distributed", + "values": ["DISTRIBUTED"] + } + }, + "categoriesDictionary": { + "Mobility": "Application Layer 4+", + "Network L1-3": "Network Layer 2-3", + "Network L4": "Network Layer 4+", + "VoIP Call Control": "Application Layer 4+" + }, + "catalogMenuItem":{ + "DESIGNER":{ + "states":{ + "NOT_CERTIFIED_CHECKOUT":{ + "ANY":[ + {"text":"Submit for Testing","action":"changeLifecycleState", "url":"lifecycleState/certificationRequest", "emailModal": "lifecycleState/CERTIFICATIONREQUEST"}, + {"text":"View" ,"action":"openViewerModal"} + ], + "NOT_OWNER":[ + {"text":"View" ,"action":"openViewerModal"} + ] + }, + "NOT_CERTIFIED_CHECKIN": { + "ANY": [ + {"text": "Submit for Testing", "action": "changeLifecycleState", "url": "lifecycleState/certificationRequest", "emailModal": "lifecycleState/CERTIFICATIONREQUEST"}, + {"text": "View","action": "openViewerModal"} + ] + }, + "READY_FOR_CERTIFICATION": { + "ANY":[ + {"text": "View","action": "openViewerModal"} + ] + }, + "CERTIFICATION_IN_PROGRESS":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + }, + "CERTIFIED":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + } + + } + }, + "PRODUCT_MANAGER":{ + "states":{ + "NOT_CERTIFIED_CHECKOUT":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ], + "NOT_OWNER":[ + {"text":"View" ,"action":"openViewerModal"} + ] + }, + "NOT_CERTIFIED_CHECKIN": { + "ANY": [ + {"text": "View","action": "openViewerModal"} + ] + }, + "READY_FOR_CERTIFICATION": { + "ANY":[ + {"text": "View","action": "openViewerModal"} + ] + }, + "CERTIFICATION_IN_PROGRESS":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + }, + "CERTIFIED":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + } + }, + "folder":[ + {"text": "Active Projects", "groupname": "IN_PROGRESS" }, + {"text": "Check Out", "group": "IN_PROGRESS", "state": "NOT_CERTIFIED_CHECKOUT"}, + {"text": "Check In", "group": "IN_PROGRESS", "state": "NOT_CERTIFIED_CHECKIN"}, + {"text": "Followed Projects", "groupname": "FOLLOWING" }, + {"text": "Ready For Testing", "group": "FOLLOWING", "state": "READY_FOR_CERTIFICATION"}, + {"text": "In Testing", "group": "FOLLOWING", "state": "CERTIFICATION_IN_PROGRESS"}, + {"text": "Certified", "group": "FOLLOWING", "state": "CERTIFIED"} + ] + }, + "PRODUCT_STRATEGIST":{ + "title": "Product Strategist's Workspace", + "pages":[], + "dashboard": { + "showCreateNew": false, + "showCreateNewProduct": true + }, + "states":{ + "NOT_CERTIFIED_CHECKOUT":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ], + "NOT_OWNER":[ + {"text":"View" ,"action":"openViewerModal"} + ] + }, + "NOT_CERTIFIED_CHECKIN": { + "ANY": [ + {"text": "View","action": "openViewerModal"} + ] + }, + "READY_FOR_CERTIFICATION": { + "ANY":[ + {"text": "View","action": "openViewerModal"} + ] + }, + "CERTIFICATION_IN_PROGRESS":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + }, + "CERTIFIED":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + } + }, + "folder":[ + {"text": "Active Projects", "groupname": "IN_PROGRESS" }, + {"text": "Check Out", "group": "IN_PROGRESS", "state": "NOT_CERTIFIED_CHECKOUT"}, + {"text": "Check In", "group": "IN_PROGRESS", "state": "NOT_CERTIFIED_CHECKIN"}, + {"text": "Followed Projects", "groupname": "FOLLOWING" }, + {"text": "Ready For Testing", "group": "FOLLOWING", "state": "READY_FOR_CERTIFICATION"}, + {"text": "In Testing", "group": "FOLLOWING", "state": "CERTIFICATION_IN_PROGRESS"}, + {"text": "Certified", "group": "FOLLOWING", "state": "CERTIFIED"} + ] + }, + "OTHER":{ + "states":{ + "ANY":{ + "ANY":[ + {"text":"View" ,"action":"openViewerModal"} + ] + } + } + } + }, + "LifeCycleStatuses":{ + "NOT_CERTIFIED_CHECKOUT": { "text":"In Design Check Out", "icon": "checkout-editable-status-icon"}, + "NOT_CERTIFIED_CHECKIN" : { "text":"In Design Check In", "icon": "checkin-status-icon "}, + "READY_FOR_CERTIFICATION": { "text":"Ready for testing"}, + "CERTIFICATION_IN_PROGRESS": { "text":"In Testing"}, + "CERTIFIED": { "text":"Certified", "icon": "checkin-status-icon "} + }, + "DistributionStatuses":{ + "DISTRIBUTION_NOT_APPROVED": { "text":"Waiting For Distribution"}, + "DISTRIBUTION_APPROVED" : { "text":"Distribution Approved"}, + "DISTRIBUTION_REJECTED": { "text":"Distribution Rejected"}, + "DISTRIBUTED": { "text":"Distributed"} + }, + "canvas_buttons":{ + "checkIn": {"text":"Check in","action":"changeLifecycleState", "url":"lifecycleState/CHECKIN", "confirmationModal": "lifecycleState/CHECKIN"}, + "submitForTesting": {"text":"Submit for Testing","action":"changeLifecycleState", "url":"lifecycleState/certificationRequest", "emailModal": "lifecycleState/CERTIFICATIONREQUEST"}, + "deleteVersion": {"text":"Delete Version", "action":"changeLifecycleState", "url":"lifecycleState/UNDOCHECKOUT", "alertModal": "lifecycleState/UNDOCHECKOUT"} + }, + + "component_workspace_menu_option": { + "VFC":[ + {"text":"General", "action":"onMenuItemPressed", "state": "workspace.general"}, + {"text":"Icon", "action":"onMenuItemPressed", "state": "workspace.icons"}, + {"text":"Information Artifact", "action":"onMenuItemPressed", "state": "workspace.information_artifacts"}, + {"text":"TOSCA Artifacts", "action":"onMenuItemPressed", "state": "workspace.tosca_artifacts"}, + {"text":"Properties", "action":"onMenuItemPressed", "state": "workspace.properties"}, + {"text":"Attributes", "action":"onMenuItemPressed", "state": "workspace.attributes"}, + {"text":"Req. & Capabilities", "action":"onMenuItemPressed", "state": "workspace.reqAndCap"}, + {"text":"Activity Log", "action":"onMenuItemPressed", "state": "workspace.activity_log"} + ], + "VL":[ + {"text":"General", "action":"onMenuItemPressed", "state": "workspace.general"}, + {"text":"Icon", "action":"onMenuItemPressed", "state": "workspace.icons"}, + {"text":"Information Artifact", "action":"onMenuItemPressed", "state": "workspace.information_artifacts"}, + {"text":"TOSCA Artifacts", "action":"onMenuItemPressed", "state": "workspace.tosca_artifacts"}, + {"text":"Properties", "action":"onMenuItemPressed", "state": "workspace.properties"}, + {"text":"Attributes", "action":"onMenuItemPressed", "state": "workspace.attributes"}, + {"text":"Req. & Capabilities", "action":"onMenuItemPressed", "state": "workspace.reqAndCap"}, + {"text":"Activity Log", "action":"onMenuItemPressed", "state": "workspace.activity_log"} + ], + "CP":[ + {"text":"General", "action":"onMenuItemPressed", "state": "workspace.general"}, + {"text":"Icon", "action":"onMenuItemPressed", "state": "workspace.icons"}, + {"text":"Information Artifact", "action":"onMenuItemPressed", "state": "workspace.information_artifacts"}, + {"text":"TOSCA Artifacts", "action":"onMenuItemPressed", "state": "workspace.tosca_artifacts"}, + {"text":"Properties", "action":"onMenuItemPressed", "state": "workspace.properties"}, + {"text":"Attributes", "action":"onMenuItemPressed", "state": "workspace.attributes"}, + {"text":"Req. & Capabilities", "action":"onMenuItemPressed", "state": "workspace.reqAndCap"}, + {"text":"Activity Log", "action":"onMenuItemPressed", "state": "workspace.activity_log"} + ], + "VF":[ + {"text":"General", "action":"onMenuItemPressed", "state": "workspace.general"}, + {"text":"Icon", "action":"onMenuItemPressed", "state": "workspace.icons"}, + {"text":"Deployment Artifact", "action":"onMenuItemPressed", "state": "workspace.deployment_artifacts"}, + {"text":"Information Artifact", "action":"onMenuItemPressed", "state": "workspace.information_artifacts"}, + {"text":"TOSCA Artifacts", "action":"onMenuItemPressed", "state": "workspace.tosca_artifacts"}, + {"text":"Properties", "action":"onMenuItemPressed", "state": "workspace.properties"}, + {"text":"Composition", "action":"onMenuItemPressed", "state": "workspace.composition.details"}, + {"text":"Activity Log", "action":"onMenuItemPressed", "state": "workspace.activity_log"}, + {"text":"Deployment", "action":"onMenuItemPressed", "state": "workspace.deployment"}, + {"text":"Inputs", "action":"onMenuItemPressed", "state": "workspace.resource_inputs"} + ], + "SERVICE":[ + {"text":"General", "action":"onMenuItemPressed", "state": "workspace.general"}, + {"text":"Icon", "action":"onMenuItemPressed", "state": "workspace.icons"}, + {"text":"TOSCA Artifacts", "action":"onMenuItemPressed", "state": "workspace.tosca_artifacts"}, + {"text":"Composition", "action":"onMenuItemPressed", "state": "workspace.composition.details"}, + {"text":"Activity Log", "action":"onMenuItemPressed", "state": "workspace.activity_log"}, + {"text":"Management Workflow", "action":"onMenuItemPressed", "state": "workspace.management_workflow"}, + {"text":"Network Call Flow ", "action":"onMenuItemPressed", "state": "workspace.network_call_flow"}, + {"text":"Monitor ", "action":"onMenuItemPressed", "state": "workspace.distribution", "disabledRoles": ["ADMIN", "TESTER", "GOVERNOR", "DESIGNER", "PRODUCT_MANAGER", "PRODUCT_STRATEGIST"]}, + {"text":"Deployment", "action":"onMenuItemPressed", "state": "workspace.deployment"}, + {"text":"Inputs", "action":"onMenuItemPressed", "state": "workspace.service_inputs"} + ], + "PRODUCT":[ + {"text":"General", "action":"onMenuItemPressed", "state": "workspace.general"}, + {"text":"Hierarchy", "action":"onMenuItemPressed", "state": "workspace.hierarchy"}, + {"text":"Icon", "action":"onMenuItemPressed", "state": "workspace.icons"}, + {"text":"Composition", "action":"onMenuItemPressed", "state": "workspace.composition.details"} + ] + } + + +} diff --git a/catalog-ui/configurations/mock.json b/catalog-ui/configurations/mock.json new file mode 100644 index 0000000000..21836a837d --- /dev/null +++ b/catalog-ui/configurations/mock.json @@ -0,0 +1,192 @@ +{ + "sdcConfig": { + "api": { + "GET_user": "/v1/user/:id", + "GET_user_authorize": "/v1/user/authorize", + "GET_resource": "/v1/resource/:id", + "GET_resources_certified_not_abstract": "/v1/catalog/resources/certified/notabstract/:id", + "GET_resources_certified_abstract": "/v1/catalog/resources/certified/abstract/:id", + "GET_resource_property": "/v1/:type/:entityId/property/:id", + "GET_resource_artifact": "/v1/catalog/:type/:entityId/artifacts/:id", + "GET_service_artifact": "/v1/catalog/services/:serviceId/artifacts/:id", + "GET_resource_artifact_types": "/v1/artifactTypes", + "GET_resource_validate_name": "/v1/resource/validate-name/:name", + "GET_service": "/v1/catalog/services/:id", + "GET_service_validate_name": "/v1/catalog/services/validate-name/:name", + "GET_service_distributions":"/v1/catalog/services/:uuid/distribution", + "GET_service_distributions_components":"/v1/catalog/services/distribution/:distributionId", + "POST_service_distribution_deploy" : "/v1/catalog/services/:serviceId/distribution/:distributionId/markDeployed", + "GET_element": "/v1/followed", + "GET_catalog": "/v1/screen", + "GET_resource_category": "/v1/resourceCategories", + "GET_service_category": "/v1/serviceCategories", + "resource_instance": "/v1/catalog/services/:serviceId/resourceInstance/:id", + "GET_resource_instance_property": "/v1/catalog/services/:serviceId/resourceInstance/:resourceInstanceId/property/:propertyValueId", + "GET_relationship": "/v1/catalog/services/:serviceId/resourceInstance/:action", + "GET_lifecycle_state_resource": "/v1/catalog/:type/:id/lifecycleState/:action", + "GET_lifecycle_state_CHECKIN":"lifecycleState/CHECKIN", + "GET_lifecycle_state_CERTIFICATIONREQUEST":"lifecycleState/CERTIFICATIONREQUEST", + "GET_lifecycle_state_UNDOCHECKOUT":"lifecycleState/UNDOCHECKOUT", + "root": "http://localhost:9999" + }, + "logConfig": { + "minLogLevel": "debug", + "prefix": "sdcApp" + }, + "cookie": { + "junctionName": "IV_JCT", + "prefix": "AMWEBJCT!", + "userIdSuffix": "USER_ID", + "userFirstName": "HTTP_CSP_FIRSTNAME", + "userLastName": "HTTP_CSP_LASTNAME", + "userEmail": "HTTP_CSP_EMAIL", + "xEcompRequestId": " X-ECOMP-RequestID" + }, + "userTypes": { + "admin": { + "userId": "jh0003", + "email": "mail@gmail.com", + "firstName": "Jimmy", + "lastName": "Hendrix", + "xEcompRequestId": "ccccc" + }, + "designer": { + "userId": "cs0008", + "email": "designer@sdc.com", + "firstName": "Carlos", + "lastName": "Santana", + "xEcompRequestId": "ccccc" + }, + "tester": { + "userId": "kb0004", + "email": "tester@sdc.com", + "firstName": "Kate", + "lastName": "Bush", + "xEcompRequestId": "ccccc" + }, + "governor": { + "userId": "gv0001", + "email": "governor@sdc.com", + "firstName": "gover", + "lastName": "nor", + "xEcompRequestId": "ccccc" + }, + "ops": { + "userId": "op0001", + "email": "ops@sdc.com", + "firstName": "op", + "lastName": "ss", + "xEcompRequestId": "ccccc" + }, + "product_strategist": { + "userId": "ps0001", + "email": "product_strategist@sdc.com", + "firstName": "Orit", + "lastName": "Barda", + "xEcompRequestId": "ccccc" + }, + "product_manager": { + "userId": "pm0001", + "email": "product_manager@sdc.com", + "firstName": "Orit", + "lastName": "Barda", + "xEcompRequestId": "ccccc" + } + }, + "statuses": { + "inDesign": { + "name": "In Design", + "values": [ + "NOT_CERTIFIED_CHECKOUT", + "NOT_CERTIFIED_CHECKIN" + ] + }, + "readyForCertification": { + "name": "Ready for certification", + "values": "READY_FOR_CERTIFICATION" + }, + "inCertification": { + "name": "In Certification", + "values": "CERTIFICATION_IN_PROGRESS" + }, + "certified": { + "name": "Certified", + "values": "CERTIFIED" + }, + "distributed": { + "name": "Distributed", + "values": "TBD" + } + }, + "imagesPath": "" + }, + "roles":{ + "ADMIN":{ + "pages":[], + "states":{ + "NOT_CERTIFIED_CHECKOUT":[ + {"text":"Check in","action":"changeLifecycleState", "url":"CHECKIN"}, + {"text":"View" ,"action":"openViewerModal"}, + {"text":"Edit" ,"action":"goToEntity"} + ], + "NOT_CERTIFIED_CHECKIN":[ + {"text":"Check out","action":"changeLifecycleState", "url":"CHECKOUT"}, + {"text":"Submit for Testing","action":"changeLifecycleState", "url":"certificationRequest"}, + {"text":"View" ,"action":"openViewerModal"} + + ], + "READY_FOR_CERTIFICATION":[], + "CERTIFICATION_IN_PROGRESS":[], + "CERTIFIED":[] + } + }, + "DESIGNER":{ + "pages":[ + ], + "states":{ + "NOT_CERTIFIED_CHECKOUT":[ + {"text":"Edit" ,"action":"goToEntity"}, + {"text":"Check in","action":"changeLifecycleState", "url":"CHECKIN"}, + {"text":"Submit for Testing","action":"changeLifecycleState", "url":"certificationRequest"}, + {"text":"View" ,"action":"openViewerModal"} + ], + "NOT_CERTIFIED_CHECKIN":[ + {"text":"Check out","action":"changeLifecycleState", "url":"CHECKOUT"}, + {"text":"Submit for Testing","action":"changeLifecycleState", "url":"certificationRequest"}, + {"text":"View" ,"action":"openViewerModal"} + ], + "READY_FOR_CERTIFICATION":[ + {"text":"View" ,"action":"openViewerModal"} + ], + "CERTIFICATION_IN_PROGRESS":[ + {"text":"View" ,"action":"openViewerModal"} + ], + "CERTIFIED":[ + {"text":"View" ,"action":"openViewerModal"} + ] + } + + }, + "TESTER":{ + "pages":[], + "READY_FOR_CERTIFICATION":[], + "CERTIFICATION_IN_PROGRESS":[], + "CERTIFIED":[] + + }, + "OPS":{ + "pages":[], + "READY_FOR_CERTIFICATION":[], + "CERTIFICATION_IN_PROGRESS":[], + "CERTIFIED":[] + + }, + "GOVERNOR":{ + "pages":[], + "READY_FOR_CERTIFICATION":[], + "CERTIFICATION_IN_PROGRESS":[], + "CERTIFIED":[] + + } + } +} diff --git a/catalog-ui/configurations/prod.json b/catalog-ui/configurations/prod.json new file mode 100644 index 0000000000..cbe579c3e9 --- /dev/null +++ b/catalog-ui/configurations/prod.json @@ -0,0 +1,432 @@ +{ + "environment": "prod", + "api": { + + "GET_component": "/v1/catalog/:type/:id", + "PUT_component": "/v1/catalog/:type/:id/metadata", + "GET_component_validate_name": "/v1/catalog/:type/validate-name/:name", + "POST_changeLifecycleState": "/v1/catalog/", + "component_api_root": "/v1/catalog/", + "welcome_page_video_url": "http://0.0.0.0:8282/moti/movie", + + "GET_user": "/v1/user/:id", + "GET_user_authorize": "/v1/user/authorize", + "GET_all_users": "/v1/user/users", + "POST_create_user": "/v1/user", + "DELETE_delete_user": "/v1/user/:id", + "POST_edit_user_role": "/v1/user/:id/role", + "GET_resource": "/v1/catalog/resources/:id", + "GET_resources_latestversion_notabstract":"/v1/catalog/:type/latestversion/notabstract/:id", + "GET_resources_certified_not_abstract": "/v1/catalog/resources/certified/notabstract/:id", + "GET_resources_certified_abstract": "/v1/catalog/resources/certified/abstract/:id", + "GET_resource_property": "/v1/catalog/:type/:entityId/properties/:id", + "PUT_resource": "/v1/catalog/resources/:id/metadata", + "GET_resource_artifact": "/v1/catalog/:type/:entityId/artifacts/:id", + "GET_download_instance_artifact": "/v1/catalog/:type/:entityId/resourceInstances/:instanceId/artifacts/:id", + "POST_instance_artifact": "/v1/catalog/:type/:entityId/resourceInstance/:instanceId/artifacts/:id", + "GET_resource_additional_information": "/v1/catalog/:type/:entityId/additionalinfo/:id", + "GET_service_artifact": "/v1/catalog/services/:serviceId/artifacts/:id", + "GET_resource_interface_artifact": "/v1/catalog/:type/:entityId/standard/:operation/artifacts/:id", + "GET_resource_api_artifact": "/v1/catalog/:type/:entityId/artifacts/api/:id", + "GET_configuration_ui": "/v1/configuration/ui", + "GET_resource_validate_name": "/v1/catalog/resources/validate-name/:name", + "GET_activity_log": "/v1/catalog/audit-records/:type/:id", + "GET_service": "/v1/catalog/services/:id", + "GET_service_validate_name": "/v1/catalog/services/validate-name/:name", + "GET_service_distributions":"/v1/catalog/services/:uuid/distribution", + "GET_service_distributions_components":"/v1/catalog/services/distribution/:distributionId", + "POST_service_distribution_deploy" : "/v1/catalog/services/:serviceId/distribution/:distributionId/markDeployed", + "GET_element": "/v1/followed", + "GET_catalog": "/v1/screen", + "GET_ecomp_menu_items": "/v1/user/:userId/functionalmenu", + "GET_resource_category": "/v1/resourceCategories", + "GET_service_category": "/v1/serviceCategories", + "resource_instance": "/v1/catalog/:entityType/:entityId/resourceInstance/:id", + "GET_resource_instance_property": "/v1/catalog/:type/:entityId/resourceInstance/:componentInstanceId/property/:propertyValueId", + "GET_relationship": "/v1/catalog/:entityType/:entityId/resourceInstance/:action", + "GET_lifecycle_state_resource": "/v1/catalog/:type/:id/lifecycleState/:action", + "GET_lifecycle_state_CHECKIN":"lifecycleState/CHECKIN", + "GET_lifecycle_state_CERTIFICATIONREQUEST":"lifecycleState/CERTIFICATIONREQUEST", + "GET_lifecycle_state_UNDOCHECKOUT":"lifecycleState/UNDOCHECKOUT", + "root": "/sdc1/feProxy/rest", + "PUT_service": "/v1/catalog/services/:id/metadata", + "GET_download_artifact": "/v1/catalog/", + "GET_SDC_Version": "/version", + "GET_categories": "/v1/categories/:types", + "POST_category": "/v1/category/:types/:categoryId", + "POST_subcategory": "/v1/category/:types/:categoryId/subCategory/:subCategoryId", + "POST_change_instance_version": "/v1/catalog/:entityType/:entityId/resourceInstance/:id/changeVersion", + "GET_requirements_capabilities": "/v1/catalog/requirmentsCapabilities/:type/:id", + "GET_resource_artifact_types": "/v1/artifactTypes", + "GET_product_catalog": "/v1/productScreen", + "GET_product_category": "/v1/productCategories", + "GET_product_category_temp": "/v1/artifactTypes", + "POST_product": "/v1/catalog/products/:id/metadata", + "GET_product_validate_name": "/v1/catalog/services/validate-name/:name", + "GET_product": "/v1/catalog/products/:id", + "GET_product_sub_category": "/v1/productSubCategories", + "GET_onboarding": "/sdc1/feProxy/onboarding-api/v1.0/vendor-software-products/packages", + "GET_component_from_csar_uuid": "/v1/catalog/resources/csar/:csar_uuid", + "kibana": "/sdc1/kibanaProxy/" + }, + "resourceTypesFilter":{ + "resource":["CP","VFC"], + "service":["CP","VF"], + "product":[] + }, + "logConfig": { + "minLogLevel": "debug", + "prefix": "sdcApp" + }, + "cookie": { + "junctionName": "IV_JCT", + "prefix": "AMWEBJCT!", + "userIdSuffix": "USER_ID", + "userFirstName": "HTTP_CSP_FIRSTNAME", + "userLastName": "HTTP_CSP_LASTNAME", + "userEmail": "HTTP_CSP_EMAIL", + "xEcompRequestId": " X-ECOMP-RequestID" + }, + "imagesPath": "/sdc1", + "cpEndPointInstances" : ["cloudep","ossep","personep","premisesep"], + "toscaFileExtension":"yaml,yml", + "csarFileExtension":"csar", + "openSource": true, + "categories": {}, + "testers": { + "RESOURCE": { + "Network L2-3": "DL-ASDCL1-3ResourceCertificationTeam", + "Network L4+": "DL-ASDCL4-7ResourceCertificationTeam", + "Application L4+": "DL-ASDCL4-7ResourceCertificationTeam", + "default": "DL-ASDCL1-3ResourceCertificationTeam;DL-ASDCL4-7ResourceCertificationTeam" + }, + "SERVICE": { + "Network L1-3": "DL-ASDCL1-4ServiceCertificationTeam", + "Network L4+": "DL-ASDCL4-7ServiceCertificationTeam", + "default": "DL-ASDCL1-4ServiceCertificationTeam;DL-ASDCL4-7ServiceCertificationTeam" + } + }, + "roles": ["ADMIN", "TESTER", "GOVERNOR", "OPS", "DESIGNER", "PRODUCT_MANAGER", "PRODUCT_STRATEGIST"], + "tutorial": { + "tabs": [ + { + "id":1, + "name":"TUTRIAL_GENERAL_TAB_1", + "defaultPage":1 + }, + { + "id":2, + "name":"TUTRIAL_GENERAL_TAB_2", + "defaultPage":9 + }, + { + "id":3, + "name":"TUTRIAL_GENERAL_TAB_3", + "defaultPage":12 + } + ], + "pages": + [ + { + "id":1, + "template": "text-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE1_TITLE", + "description":"TUTORIAL_PAGE1_TEXT" + } + + }, + { + "id":2, + "template": "image-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE2_TITLE", + "description":"TUTORIAL_PAGE2_TEXT", + "imageClass":"sdc-tutorial-page-2-image" + } + }, + { + "id":3, + "template": "image-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE3_TITLE", + "description":"TUTORIAL_PAGE3_TEXT", + "imageClass":"sdc-tutorial-page-3-image" + } + }, + { + "id":4, + "template": "image-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE4_TITLE", + "description":"TUTORIAL_PAGE4_TEXT", + "imageClass":"sdc-tutorial-page-4-image" + } + }, + { + "id":5, + "template": "image-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE5_TITLE", + "description":"TUTORIAL_PAGE5_TEXT", + "imageClass":"sdc-tutorial-page-5-image" + } + }, + { + "id":6, + "template": "image-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE6_TITLE", + "description":"TUTORIAL_PAGE6_TEXT", + "imageClass":"sdc-tutorial-page-6-image" + } + }, + { + "id":7, + "template": "image-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE7_TITLE", + "description":"TUTORIAL_PAGE7_TEXT", + "imageClass":"sdc-tutorial-page-7-image" + } + }, + { + "id":8, + "template": "image-template", + "tab": 1, + "data":{ + "title":"TUTORIAL_PAGE8_TITLE", + "description":"TUTORIAL_PAGE8_TEXT", + "imageClass":"sdc-tutorial-page-8-image" + } + }, + { + "id":9, + "template": "text-template", + "tab": 2, + "data":{ + "title":"TUTORIAL_PAGE9_TITLE", + "description":"TUTORIAL_PAGE9_TEXT" + } + }, + { + "id":10, + "template": "image-template", + "tab": 2, + "data":{ + "title":"TUTORIAL_PAGE10_TITLE", + "description":"TUTORIAL_PAGE10_TEXT", + "imageClass":"sdc-tutorial-page-10-image" + } + }, + { + "id":11, + "template": "image-template", + "tab": 2, + "data":{ + "title":"TUTORIAL_PAGE11_TITLE", + "description":"TUTORIAL_PAGE11_TEXT", + "imageClass":"sdc-tutorial-page-11-image" + } + }, + { + "id":12, + "template": "text-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE12_TITLE", + "description":"TUTORIAL_PAGE12_TEXT" + } + }, + { + "id":13, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE13_TITLE", + "description":"TUTORIAL_PAGE13_TEXT", + "imageClass":"sdc-tutorial-page-13-image" + } + }, + { + "id":14, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE14_TITLE", + "description":"TUTORIAL_PAGE14_TEXT", + "imageClass":"sdc-tutorial-page-14-image" + } + }, + { + "id":15, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE15_TITLE", + "description":"TUTORIAL_PAGE15_TEXT", + "imageClass":"sdc-tutorial-page-15-image" + } + }, + { + "id":16, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE16_TITLE", + "description":"TUTORIAL_PAGE16_TEXT", + "imageClass":"sdc-tutorial-page-16-image" + } + }, + { + "id":17, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE17_TITLE", + "description":"TUTORIAL_PAGE17_TEXT", + "imageClass":"sdc-tutorial-page-17-image" + } + }, + { + "id":18, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE18_TITLE", + "description":"TUTORIAL_PAGE18_TEXT", + "imageClass":"sdc-tutorial-page-18-image" + } + }, + { + "id":19, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE19_TITLE", + "description":"TUTORIAL_PAGE19_TEXT", + "imageClass":"sdc-tutorial-page-19-image" + } + }, + { + "id":20, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE20_TITLE", + "description":"TUTORIAL_PAGE20_TEXT", + "imageClass":"sdc-tutorial-page-20-image" + } + }, + { + "id":21, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE21_TITLE", + "description":"TUTORIAL_PAGE21_TEXT", + "imageClass":"sdc-tutorial-page-21-image" + } + }, + { + "id":22, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE22_TITLE", + "description":"TUTORIAL_PAGE22_TEXT", + "imageClass":"sdc-tutorial-page-22-image" + } + }, + { + "id":23, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE23_TITLE", + "description":"TUTORIAL_PAGE23_TEXT", + "imageClass":"sdc-tutorial-page-23-image" + } + }, + { + "id":24, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE24_TITLE", + "description":"TUTORIAL_PAGE24_TEXT", + "imageClass":"sdc-tutorial-page-24-image" + } + }, + { + "id":25, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE25_TITLE", + "description":"TUTORIAL_PAGE25_TEXT", + "imageClass":"sdc-tutorial-page-25-image" + } + }, + { + "id":26, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE26_TITLE", + "description":"TUTORIAL_PAGE26_TEXT", + "imageClass":"sdc-tutorial-page-26-image" + } + }, + { + "id":27, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE27_TITLE", + "description":"TUTORIAL_PAGE27_TEXT", + "imageClass":"sdc-tutorial-page-27-image" + } + }, + { + "id":28, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE28_TITLE", + "description":"TUTORIAL_PAGE28_TEXT", + "imageClass":"sdc-tutorial-page-28-image" + } + }, + { + "id":29, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE29_TITLE", + "description":"TUTORIAL_PAGE29_TEXT", + "imageClass":"sdc-tutorial-page-29-image" + } + }, + { + "id":30, + "template": "image-template", + "tab": 3, + "data":{ + "title":"TUTORIAL_PAGE30_TITLE", + "description":"TUTORIAL_PAGE30_TEXT", + "imageClass":"sdc-tutorial-page-30-image" + } + } + + ] + } + +} diff --git a/catalog-ui/docs/colors.jpg b/catalog-ui/docs/colors.jpg new file mode 100644 index 0000000000..edc038c0d2 Binary files /dev/null and b/catalog-ui/docs/colors.jpg differ diff --git a/catalog-ui/non_bower_components/cytoscape.js-edge-editation/CytoscapeEdgeEditation.js b/catalog-ui/non_bower_components/cytoscape.js-edge-editation/CytoscapeEdgeEditation.js new file mode 100644 index 0000000000..147f19ce54 --- /dev/null +++ b/catalog-ui/non_bower_components/cytoscape.js-edge-editation/CytoscapeEdgeEditation.js @@ -0,0 +1,554 @@ +(function (scope) { + var Class = function (param1, param2) { + + var extend, mixins, definition; + if (param2) { //two parameters passed, first is extends, second definition object + extend = Array.isArray(param1) ? param1[0] : param1; + mixins = Array.isArray(param1) ? param1.slice(1) : null; + definition = param2; + } else { //only one parameter passed => no extend, only definition + extend = null; + definition = param1; + } + + + var Definition = definition.hasOwnProperty("constructor") ? definition.constructor : function () { + }; + + Definition.prototype = Object.create(extend ? extend.prototype : null); + var propertiesObject = definition.propertiesObject ? definition.propertiesObject : {}; + if (mixins) { + var i, i2; + for (i in mixins) { + for (i2 in mixins[i].prototype) { + Definition.prototype[i2] = mixins[i].prototype[i2]; + } + for (var i2 in mixins[i].prototype.propertiesObject) { + propertiesObject[i2] = mixins[i].prototype.propertiesObject[i2]; + } + } + } + + Definition.prototype.propertiesObject = propertiesObject; + + Object.defineProperties(Definition.prototype, propertiesObject); + + for (var key in definition) { + if (definition.hasOwnProperty(key)) { + Definition.prototype[key] = definition[key]; + } + } + + Definition.prototype.constructor = Definition; + + return Definition; + }; + + + var Interface = function (properties) { + this.properties = properties; + }; + + var InterfaceException = function (message) { + this.name = "InterfaceException"; + this.message = message || ""; + }; + + InterfaceException.prototype = new Error(); + + Interface.prototype.implements = function (target) { + for (var i in this.properties) { + if (target[this.properties[i]] == undefined) { + throw new InterfaceException("Missing property " + this.properties[i]); + } + } + return true; + }; + + Interface.prototype.doesImplement = function (target) { + for (var i in this.properties) { + if (target[this.properties[i]] === undefined) { + return false; + } + } + return true; + }; + + var VectorMath = { + distance: function (vector1, vector2) { + return Math.sqrt(Math.pow(vector1.x - vector2.x, 2) + Math.pow(vector1.y - vector2.y, 2)); + } + }; + + var EventDispatcher = Class({ + constructor: function () { + this.events = {}; + }, + on: function (name, listener, context) { + this.events[name] = this.events[name] ? this.events[name] : []; + this.events[name].push({ + listener: listener, + context: context + }) + }, + once: function (name, listener, context) { + this.off(name, listener, context); + this.on(name, listener, context); + }, + off: function (name, listener, context) { + //no event with this name registered? => finish + if (!this.events[name]) { + return; + } + if (listener) { //searching only for certains listeners + for (var i in this.events[name]) { + if (this.events[name][i].listener === listener) { + if (!context || this.events[name][i].context === context) { + this.events[name].splice(i, 1); + } + } + } + } else { + delete this.events[name]; + } + }, + trigger: function (name) { + var listeners = this.events[name]; + + for (var i in listeners) { + listeners[i].listener.apply(listeners[i].context, Array.prototype.slice.call(arguments, 1)); + } + } + }); + + scope.CytoscapeEdgeEditation = Class({ + + init: function (cy, handleSize) { + this.DOUBLE_CLICK_INTERVAL = 300; + this.HANDLE_SIZE = handleSize ? handleSize : 5; + this.ARROW_END_ID = "ARROW_END_ID"; + + this._handles = {}; + this._dragging = false; + this._hover = null; + + + this._cy = cy; + this._$container = $(cy.container()); + + this._cy.on('mouseover tap', 'node', this._mouseOver.bind(this)); + this._cy.on('mouseout', 'node', this._mouseOut.bind(this)); + + this._$container.on('mouseout', function (e) { + if (this.permanentHandle) { + return; + } + + this._clear(); + }.bind(this)); + + this._$container.on('mouseover', function (e) { + if (this._hover) { + this._mouseOver({cyTarget: this._hover}); + } + }.bind(this)); + + this._cy.on("select", "node", this._redraw.bind(this)) + + this._cy.on("mousedown", "node", function () { + this._nodeClicked = true; + }.bind(this)); + + this._cy.on("mouseup", "node", function () { + this._nodeClicked = false; + }.bind(this)); + + this._cy.on("remove", "node", function () { + this._hover = false; + this._clear(); + }.bind(this)); + + this._cy.on('showhandle', function (cy, target) { + this.permanentHandle = true; + this._showHandles(target); + }.bind(this)); + + this._cy.on('hidehandles', this._hideHandles.bind(this)); + + this._cy.bind('zoom pan', this._redraw.bind(this)); + + + this._$canvas = $(''); + this._$canvas.css("top", 0); + this._$canvas.on("mousedown", this._mouseDown.bind(this)); + this._$canvas.on("mousemove", this._mouseMove.bind(this)); + + this._ctx = this._$canvas[0].getContext('2d'); + this._$container.children("div").append(this._$canvas); + + $(window).bind('mouseup', this._mouseUp.bind(this)); + + /*$(window).bind('resize', this._resizeCanvas.bind(this)); + $(window).bind('resize', this._resizeCanvas.bind(this));*/ + + this._cy.on("resize", this._resizeCanvas.bind(this)); + + this._$container.bind('resize', function () { + this._resizeCanvas(); + }.bind(this)); + + this._resizeCanvas(); + + this._arrowEnd = this._cy.add({ + group: "nodes", + data: { + "id": this.ARROW_END_ID, + "position": {x: 150, y: 150} + } + }); + + this._arrowEnd.css({ + "opacity": 0, + 'width': 0.0001, + 'height': 0.0001 + }); + + }, + registerHandle: function (handle) { + if (handle.nodeTypeNames) { + for (var i in handle.nodeTypeNames) { + var nodeTypeName = handle.nodeTypeNames[i]; + this._handles[nodeTypeName] = this._handles[nodeTypeName] || []; + this._handles[nodeTypeName].push(handle); + } + } else { + this._handles["*"] = this._handles["*"] || []; + this._handles["*"].push(handle); + } + + }, + _showHandles: function (target) { + var nodeTypeName = target.data().type; + if (nodeTypeName) { + + var handles = this._handles[nodeTypeName] ? this._handles[nodeTypeName] : this._handles["*"]; + + for (var i in handles) { + if (handles[i].type != null) { + this._drawHandle(handles[i], target); + } + } + } + + }, + _clear: function () { + + var w = this._$container.width(); + var h = this._$container.height(); + this._ctx.clearRect(0, 0, w, h); + }, + _drawHandle: function (handle, target) { + + var position = this._getHandlePosition(handle, target); + + this._ctx.beginPath(); + + if (handle.imageUrl) { + var base_image = new Image(); + base_image.src = handle.imageUrl; + this._ctx.drawImage(base_image, position.x, position.y, this.HANDLE_SIZE, this.HANDLE_SIZE); + } else { + this._ctx.arc(position.x, position.y, this.HANDLE_SIZE, 0, 2 * Math.PI, false); + this._ctx.fillStyle = handle.color; + this._ctx.strokeStyle = "white"; + this._ctx.lineWidth = 0; + this._ctx.fill(); + this._ctx.stroke(); + } + + }, + _drawArrow: function (fromNode, toPosition, handle) { + var toNode; + if (this._hover) { + toNode = this._hover; + } else { + this._arrowEnd.renderedPosition(toPosition); + toNode = this._arrowEnd; + } + + + if (this._edge) { + this._edge.remove(); + } + + this._edge = this._cy.add({ + group: "edges", + data: { + id: "edge", + source: fromNode.id(), + target: toNode.id(), + type: 'temporary-link' + }, + css: $.extend( + this._getEdgeCSSByHandle(handle), + {opacity: 0.5} + ) + }); + + }, + _clearArrow: function () { + if (this._edge) { + this._edge.remove(); + this._edge = null; + } + }, + _resizeCanvas: function () { + this._$canvas + .attr('height', this._$container.height()) + .attr('width', this._$container.width()) + .css({ + 'position': 'absolute', + 'z-index': '999' + }); + }, + _mouseDown: function (e) { + this._hit = this._hitTestHandles(e); + + if (this._hit) { + this._lastClick = Date.now(); + this._dragging = this._hover; + this._hover = null; + e.stopImmediatePropagation(); + } + }, + _hideHandles: function () { + this.permanentHandle = false; + this._clear(); + + if(this._hover){ + this._showHandles(this._hover); + } + }, + _mouseUp: function () { + if (this._hover) { + if (this._hit) { + //check if custom listener was passed, if so trigger it and do not add edge + var listeners = this._cy._private.listeners; + for (var i = 0; i < listeners.length; i++) { + if (listeners[i].type === 'addedgemouseup') { + this._cy.trigger('addedgemouseup', { + source: this._dragging, + target: this._hover, + edge: this._edge + }); + var that = this; + setTimeout(function () { + that._dragging = false; + that._clearArrow(); + that._hit = null; + }, 0); + + + return; + } + } + + var edgeToRemove = this._checkSingleEdge(this._hit.handle, this._dragging); + if (edgeToRemove) { + this._cy.remove("#" + edgeToRemove.id()); + } + var edge = this._cy.add({ + data: { + source: this._dragging.id(), + target: this._hover.id(), + type: this._hit.handle.type + } + }); + this._initEdgeEvents(edge); + } + } + this._cy.trigger('handlemouseout', { + node: this._hover + }); + $("body").css("cursor", "inherit"); + this._dragging = false; + this._clearArrow(); + }, + _mouseMove: function (e) { + if (this._hover) { + if (!this._dragging) { + var hit = this._hitTestHandles(e); + if (hit) { + this._cy.trigger('handlemouseover', { + node: this._hover + }); + $("body").css("cursor", "pointer"); + + } else { + this._cy.trigger('handlemouseout', { + node: this._hover + }); + $("body").css("cursor", "inherit"); + } + } + } else { + $("body").css("cursor", "inherit"); + } + + if (this._dragging && this._hit.handle) { + this._drawArrow(this._dragging, this._getRelativePosition(e), this._hit.handle); + } + + if (this._nodeClicked) { + this._clear(); + } + }, + _mouseOver: function (e) { + + if (this._dragging) { + if ( (e.cyTarget.id() != this._dragging.id()) && e.cyTarget.data().allowConnection || this._hit.handle.allowLoop) { + this._hover = e.cyTarget; + } + } else { + this._hover = e.cyTarget; + this._showHandles(this._hover); + } + }, + _mouseOut: function (e) { + if(!this._dragging) { + if (this.permanentHandle) { + return; + } + + this._clear(); + } + this._hover = null; + }, + _removeEdge: function (edge) { + edge.off("mousedown"); + this._cy.remove("#" + edge.id()); + }, + _initEdgeEvents: function (edge) { + var self = this; + edge.on("mousedown", function () { + if (self.__lastClick && Date.now() - self.__lastClick < self.DOUBLE_CLICK_INTERVAL) { + self._removeEdge(this); + } + self.__lastClick = Date.now(); + }) + }, + _hitTestHandles: function (e) { + var mousePoisition = this._getRelativePosition(e); + + if (this._hover) { + var nodeTypeName = this._hover.data().type; + if (nodeTypeName) { + var handles = this._handles[nodeTypeName] ? this._handles[nodeTypeName] : this._handles["*"]; + + for (var i in handles) { + var handle = handles[i]; + + var position = this._getHandlePosition(handle, this._hover); + if (VectorMath.distance(position, mousePoisition) < this.HANDLE_SIZE) { + return { + handle: handle, + position: position + }; + } + } + } + } + }, + _getHandlePosition: function (handle, target) { + var position = target.renderedPosition(); + var width = target.renderedOuterWidth(); + var height = target.renderedOuterHeight(); + var xpos = null; + var ypos = null; + + switch (handle.positionX) { + case "left": + xpos = position.x - width / 2 + this.HANDLE_SIZE; + break; + case "right": + xpos = position.x + width / 2 - this.HANDLE_SIZE; + break; + case "center": + xpos = position.x; + break; + } + + switch (handle.positionY) { + case "top": + ypos = position.y - height / 2 + this.HANDLE_SIZE; + break; + case "center": + ypos = position.y; + break; + case "bottom": + ypos = position.y + height / 2 - this.HANDLE_SIZE; + break; + } + + var offsetX = handle.offsetX ? handle.offsetX : 0; + var offsetY = handle.offsetY ? handle.offsetY : 0; + return {x: xpos + offsetX, y: ypos + offsetY}; + }, + _getEdgeCSSByHandle: function (handle) { + var color = handle.lineColor ? handle.lineColor : handle.color; + return { + "line-color": color, + "target-arrow-color": color, + "line-style": handle.lineStyle? handle.lineStyle: 'solid', + "width": handle.width? handle.width : 3 + }; + }, + _getHandleByType: function (type) { + for (var i in this._handles) { + var byNodeType = this._handles[i]; + for (var i2 in byNodeType) { + var handle = byNodeType[i2]; + if (handle.type == type) { + return handle; + } + } + } + }, + _getRelativePosition: function (e) { + var containerPosition = this._$container.offset(); + return { + x: e.pageX - containerPosition.left, + y: e.pageY - containerPosition.top + } + }, + _checkSingleEdge: function (handle, node) { + + if (handle.noMultigraph) { + var edges = this._cy.edges("[source='" + this._hover.id() + "'][target='" + node.id() + "'],[source='" + node.id() + "'][target='" + this._hover.id() + "']"); + + for (var i = 0; i < edges.length; i++) { + return edges[i]; + } + } else { + + if (handle.single == false) { + return; + } + var edges = this._cy.edges("[source='" + node.id() + "']"); + + for (var i = 0; i < edges.length; i++) { + if (edges[i].data()["type"] == handle.type) { + return edges[i]; + } + } + } + }, + _redraw: function () { + this._clear(); + if (this._hover) { + this._showHandles(this._hover); + } + } + }); + +})(this); \ No newline at end of file diff --git a/catalog-ui/non_bower_components/cytoscape.js-edge-editation/README.md b/catalog-ui/non_bower_components/cytoscape.js-edge-editation/README.md new file mode 100644 index 0000000000..909dcb06d1 --- /dev/null +++ b/catalog-ui/non_bower_components/cytoscape.js-edge-editation/README.md @@ -0,0 +1,58 @@ +# cytoscape.js-edge-editation +Extension for Cytoscape.js, which adds handles to nodes and allows to create different types of edges + + +## Dependencies + +Extension was tested with these versions of libraries: + +* jQuery 2.1.1 +* Cytoscape.js 2.6.0 + +## Install + +Use git clone or direct zip download and unpack archive into your project. Then, simply insert \ tag after +Cytoscape.js and jQuery: + +```html + + + +``` + +## How to use + +First, you need to initialize extension. After initializing Cytoscape.js: + +```js +var cy = cytoscape({...}); +var handles = new CytoscapeEdgeEditation; +handles.init(cy); +``` + +Then, you need to register handles to certain node types: + +```js +handles.registerHandle({ + positionX: "left", //horizontal position of the handle (left | center | right) + positionY: "center", //vertical position of the handle (top | center | bottom) + color: "#48FF00", //color of the handle + type: "some_type", //stored as data() attribute, can be used for styling + single: true, //wheter only one edge of this type can start from same node (default false) + nodeTypeNames: ["type2"] //which types of nodes will contain this handle + noMultigraph: false //whereter two nodes can't be connected with multiple edges (does not consider orientation) +}); + +handles.registerHandle({...}); +handles.registerHandle({...}); +``` + +Type of node is stored in data section: + +```js +cy.add({ + data: { id: 'n4', type: "type2"}, +}); +``` +![Screenshot](http://i.imgbox.com/drCuXQqu.png) +![Screenshot](http://i.imgbox.com/23jr7qPa.png) diff --git a/catalog-ui/non_bower_components/cytoscape.js-edge-editation/index.html b/catalog-ui/non_bower_components/cytoscape.js-edge-editation/index.html new file mode 100644 index 0000000000..d19fd36c24 --- /dev/null +++ b/catalog-ui/non_bower_components/cytoscape.js-edge-editation/index.html @@ -0,0 +1,169 @@ + + + + + CytoscapeEdgeEditation + + + + + + + +
        + + \ No newline at end of file diff --git a/catalog-ui/package.json b/catalog-ui/package.json new file mode 100644 index 0000000000..beb2af9996 --- /dev/null +++ b/catalog-ui/package.json @@ -0,0 +1,67 @@ +{ + "name": "catalog-ui", + "description": "ASDC Single page application", + "repository": { + "type": "git", + "url": "git@gitlab:root/D2-SDnC.git" + }, + "devDependencies": { + "apache-server-configs": "^2.7.1", + "cors": "2.7.1", + "grunt": "1.0.1", + "grunt-angular-templates": "1.1.0", + "grunt-autoprefixer": "3.0.4", + "grunt-concurrent": "0.5.0", + "grunt-contrib-clean": "1.0.0", + "grunt-contrib-concat": "1.0.1", + "grunt-contrib-connect": "0.10.1", + "grunt-contrib-copy": "1.0.0", + "grunt-contrib-cssmin": "0.10.0", + "grunt-contrib-htmlmin": "2.1.0", + "grunt-contrib-imagemin": "1.0.1", + "grunt-contrib-jshint": "1.1.0", + "grunt-contrib-uglify": "2.0.0", + "grunt-contrib-watch": "1.0.0", + "grunt-include-source": "1.0.0", + "grunt-karma": "2.0.0", + "grunt-mocha": "1.0.2", + "grunt-newer": "0.7.0", + "grunt-ng-constant": "1.1.0", + "grunt-rev": "0.1.0", + "grunt-svgmin": "4.0.0", + "grunt-text-replace": "0.4.0", + "grunt-tslint": "^3.3.0", + "grunt-usemin": "3.1.1", + "grunt-wiredep": "2.0.0", + "http-proxy-middleware": "^0.14.0", + "jasmine-core": "2.5.2", + "jshint-stylish": "2.2.1", + "karma": "1.4.0", + "karma-chrome-launcher": "0.2.2", + "karma-coverage": "1.1.1", + "karma-jasmine": "1.1.0", + "karma-junit-reporter": "0.3.8", + "karma-mocha-reporter": "2.2.2", + "karma-ng-html2js-preprocessor": "1.0.0", + "karma-ng-scenario": "1.0.0", + "karma-phantomjs-launcher": "0.2.1", + "load-grunt-tasks": "3.5.2", + "phantomjs": "2.1.7", + "time-grunt": "1.4.0", + "tslint": "^3.15.1" + }, + "engines": { + "node": ">=6.9.4" + }, + "dependencies": { + "cytoscape.js-undo-redo": "^1.0.1", + "express": "4.14.0", + "grunt-asset-injector": "0.1.0", + "grunt-contrib-less": "1.4.0", + "grunt-express-server": "0.5.3", + "grunt-ts": "5.5.1", + "grunt-html2js": "0.3.6", + "multer": "1.2.1", + "ng-html2js": "2.0.0" + } +} diff --git a/catalog-ui/pom.xml b/catalog-ui/pom.xml new file mode 100644 index 0000000000..02d045a9fe --- /dev/null +++ b/catalog-ui/pom.xml @@ -0,0 +1,231 @@ + + + 4.0.0 + + org.openecomp.sdc + catalog-ui + pom + + + + org.openecomp.sdc + sdc-main + 1.0.0-SNAPSHOT + + + + + + + + + + + + maven-clean-plugin + 2.6.1 + + + clean.fe.webapp.folder + initialize + + clean + + + + + + ${project.parent.basedir}/catalog-fe/src/main/webapp + + **/* + * + + + META-INF/* + WEB-INF/* + + false + + + + + + + + + + maven-resources-plugin + 2.7 + + + copy-resources + package + + copy-resources + + + ${project.parent.basedir}/catalog-fe/src/main/webapp + + + ${project.basedir}/app/dist + false + + + + + + + + + + + + + + CI + + false + + + + + + maven-resources-plugin + 2.7 + + + copy-resources + package + + copy-resources + + + + ${project.parent.basedir}/catalog-fe/src/main/webapp + + + ${project.basedir}/app/dist + false + + + + + + + + + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.4.0 + + + execute grant build + generate-sources + + exec + + + + ./build_catalog_ui.sh + ${project.basedir} + + + + + + + + + + + + WINDOWS_ONLY + + + Windows + + + + + + + exec-maven-plugin + org.codehaus.mojo + 1.4.0 + + + execute grant build + generate-sources + + exec + + + build_catalog_ui.bat + ${basedir} + + + + + + + + + + + not-minified + + false + + + + + + maven-resources-plugin + 2.7 + + + copy-resources + package + + copy-resources + + + ${project.parent.basedir}/catalog-fe/src/main/webapp + + + ${project.basedir}/app + + languages/** + scripts/** + styles/** + third-party/** + index.html + robots.txt + favicon.png + + false + + + ${project.basedir} + + bower_components/** + + false + + + + + + + + + + + + diff --git a/catalog-ui/server-mock/mock-data/artifact/artifact-types.json b/catalog-ui/server-mock/mock-data/artifact/artifact-types.json new file mode 100644 index 0000000000..b9cdabee51 --- /dev/null +++ b/catalog-ui/server-mock/mock-data/artifact/artifact-types.json @@ -0,0 +1,23 @@ +[ + { + "name": "CHEF" + }, + { + "name": "PUPPET" + }, + { + "name": "SHELL" + }, + { + "name": "YANG" + }, + { + "name": "HEAT" + }, + { + "name": "BPEL" + }, + { + "name": "DG-XML" + } +] diff --git a/catalog-ui/server-mock/mock-data/category/category.json b/catalog-ui/server-mock/mock-data/category/category.json new file mode 100644 index 0000000000..2dabb50ba6 --- /dev/null +++ b/catalog-ui/server-mock/mock-data/category/category.json @@ -0,0 +1,65 @@ +[ + { + "name": "Infrastructure" + }, + { + "name": "Databases" + }, + { + "name": "Web Servers" + }, + { + "name": "Web Applications" + }, + { + "name": "Network Elements" + }, + { + "name": "VoIP" + }, + { + "name": "IMS" + }, + { + "name": "Security" + }, + { + "name": "Video" + }, + { + "name": "Mobility" + }, + { + "name": "IoT" + }, + { + "name": "Big Data" + }, + { + "name": "WAN Connectivity" + }, + { + "name": "LAN Connectivity" + }, + { + "name": "Compute as a Service" + }, + { + "name": "Platform as a Service" + }, + { + "name": "Storage as a Service" + }, + { + "name": "Call Control" + }, + { + "name": "Collaboration" + }, + { + "name": "Messaging" + }, + { + "name": "Abstract" + } +] diff --git a/catalog-ui/server-mock/mock-data/element/element.json b/catalog-ui/server-mock/mock-data/element/element.json new file mode 100644 index 0000000000..181c0edcf2 --- /dev/null +++ b/catalog-ui/server-mock/mock-data/element/element.json @@ -0,0 +1,2915 @@ +{ + "resources": [ + { + "uniqueId": "res_hgdgg.0.1", + "resourceName": "hgdgg", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1435825652946, + "lastUpdateDate": 1435825652946, + "description": "hfhdgfdgfh", + "icon": "icon-red2", + "tags": [ + "hgdgg" + ], + "category": "Call Control", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.WebApplication" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "app_endpoint": { + "uniqueId": "capability.res_tosca.nodes.webapplication.1.0.app_endpoint", + "type": "tosca.capabilities.Endpoint" + }, + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + }, + "host": { + "uniqueId": "res_tosca.nodes.webapplication.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.WebServer", + "relationship": "tosca.relationships.HostedOn" + } + }, + "vendorName": "fhgghf", + "vendorRelease": "fggf", + "contactId": "hg1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_martin223.0.1", + "resourceName": "martin223", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1435842460057, + "lastUpdateDate": 1435842460057, + "description": "desc", + "icon": "icon-red2", + "tags": [ + "martin223", + "tag" + ], + "category": "Databases", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.Root" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + } + }, + "vendorName": "Oracle", + "vendorRelease": "1.2.5", + "contactId": "Al1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_mlrlv.0.1", + "resourceName": "mlrlv", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436079916172, + "lastUpdateDate": 1436079916172, + "description": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬-®¯°±²³´µ¶•¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ", + "icon": "icon-red2", + "tags": [ + "mlrlvtag" + ], + "category": "Databases", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.Root" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + } + }, + "vendorName": "Oracle", + "vendorRelease": "1.2.4", + "contactId": "Al1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_%&+-.0.1", + "resourceName": "%&+-", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436079975445, + "lastUpdateDate": 1436079975445, + "description": "%&+-%&+-%&+-%&+-%&+-%&+-", + "icon": "icon-red2", + "tags": [ + "%&+-%&+-" + ], + "category": "Databases", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.Root" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + } + }, + "vendorName": "%&+-", + "vendorRelease": "%&+-", + "contactId": "Al1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_1.0.1", + "resourceName": "1", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436080002091, + "lastUpdateDate": 1436080002091, + "description": "1", + "icon": "icon-red2", + "tags": [ + "11" + ], + "category": "Databases", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.Root" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + } + }, + "vendorName": "1", + "vendorRelease": "1", + "contactId": "Al1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_jjjjjj.0.1", + "resourceName": "jjjjjj", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436080425475, + "lastUpdateDate": 1436080425475, + "description": "h", + "icon": "icon-red2", + "tags": [ + "jjjjjj" + ], + "category": "Collaboration", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.WebServer" + ], + "artifacts": { + "10 numbers limit reached": { + "uniqueId": "res_jjjjjj.0.1.10 numbers limit reached", + "artifactType": "CHEF", + "artifactName": "10 numbers limit reached.png", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436081038417, + "lastUpdateDate": 1436081038417, + "esId": "res_jjjjjj.0.1:10 numbers limit reached.png", + "logicalName": "10 numbers limit reached", + "description": "dsfsdfs" + } + }, + "interfaces": { + + }, + "capabilities": { + "host": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.WebApplication" + ] + }, + "admin_endpoint": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.admin_endpoint", + "type": "tosca.capabilities.Endpoint.Admin" + }, + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + }, + "data_endpoint": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.data_endpoint", + "type": "tosca.capabilities.Endpoint" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + }, + "host": { + "uniqueId": "res_tosca.nodes.softwarecomponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "relationship": "tosca.relationships.HostedOn" + } + }, + "vendorName": "g", + "vendorRelease": "f", + "contactId": "aa1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_qfdsy.0.1", + "resourceName": "qfdsy", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436084743821, + "lastUpdateDate": 1436084743821, + "description": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬-®¯°±²³´µ¶•¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ", + "icon": "icon-red2", + "tags": [ + "qfdsytag" + ], + "category": "Messaging", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.Root" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + } + }, + "vendorName": "Oracle", + "vendorRelease": "1.2.4", + "contactId": "Al1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_nqstw.0.1", + "resourceName": "nqstw", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436084798999, + "lastUpdateDate": 1436084798999, + "description": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬-®¯°±²³´µ¶•¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ", + "icon": "icon-red2", + "tags": [ + "nqstwtag" + ], + "category": "WAN Connectivity", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.Root" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + } + }, + "vendorName": "Oracle", + "vendorRelease": "1.2.4", + "contactId": "Al1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_rfpjx.0.1", + "resourceName": "rfpjx", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436084844179, + "lastUpdateDate": 1436084844179, + "description": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬-®¯°±²³´µ¶•¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ", + "icon": "icon-red2", + "tags": [ + "rfpjxtag" + ], + "category": "Messaging", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.Root" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + } + }, + "vendorName": "Oracle", + "vendorRelease": "1.2.4", + "contactId": "Al1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_martin22.0.1", + "resourceName": "martin22", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436093847314, + "lastUpdateDate": 1436093847314, + "description": "desc", + "icon": "icon-red2", + "tags": [ + "martin22", + "martin22tag" + ], + "category": "Security", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.Root" + ], + "artifacts": { + "gizmorambo": { + "uniqueId": "res_martin22.0.1.gizmorambo", + "artifactType": "YANG", + "artifactName": "gizmorambo.jpg", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436093856933, + "lastUpdateDate": 1436093856933, + "esId": "res_martin22.0.1:gizmorambo.jpg", + "logicalName": "gizmorambo", + "description": "BlaBla" + } + }, + "properties": { + "Test1": { + "uniqueId": "res_martin22.0.1.Test1", + "type": "string", + "required": false, + "defaultValue": "10", + "description": "BlaBla", + "constraints": [ + { + "rangeMinValue": "100", + "rangeMaxValue": "990" + } + ], + "definition": true, + "password": false + } + }, + "interfaces": { + + }, + "capabilities": { + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + } + }, + "vendorName": "Oracle", + "vendorRelease": "1.2.5", + "contactId": "Al1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_jkjk.0.1", + "resourceName": "jkjk", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436095288548, + "lastUpdateDate": 1436095288548, + "description": "jkjkj", + "icon": "icon-red2", + "tags": [ + "jkjk" + ], + "category": "Big Data", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.Container.Runtime" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "host": { + "uniqueId": "capability.res_tosca.nodes.container.runtime.1.0.host", + "type": "tosca.capabilities.Container" + }, + "scalable": { + "uniqueId": "capability.res_tosca.nodes.container.runtime.1.0.scalable", + "type": "tosca.capabilities.Scalable" + }, + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + }, + "host": { + "uniqueId": "res_tosca.nodes.softwarecomponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "relationship": "tosca.relationships.HostedOn" + } + }, + "vendorName": "gggg", + "vendorRelease": "fffff", + "contactId": "ff1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_bvbvcxb.0.1", + "resourceName": "bvbvcxb", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436164182890, + "lastUpdateDate": 1436164182890, + "description": "vcbcv", + "icon": "icon-red2", + "tags": [ + "bvbvcxb" + ], + "category": "Call Control", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.WebServer" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "host": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.WebApplication" + ] + }, + "admin_endpoint": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.admin_endpoint", + "type": "tosca.capabilities.Endpoint.Admin" + }, + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + }, + "data_endpoint": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.data_endpoint", + "type": "tosca.capabilities.Endpoint" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + }, + "host": { + "uniqueId": "res_tosca.nodes.softwarecomponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "relationship": "tosca.relationships.HostedOn" + } + }, + "vendorName": "vcbxcvb", + "vendorRelease": "cvbvc", + "contactId": "qw1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_sd.0.1", + "resourceName": "sd", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436255440040, + "lastUpdateDate": 1436255440040, + "description": "de", + "icon": "icon-red3", + "tags": [ + "sdde" + ], + "category": "Call Control", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.Root" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + } + }, + "vendorName": "ded", + "vendorRelease": "ede", + "contactId": "dd2222", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_martin221.0.1", + "resourceName": "martin221", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436275310912, + "lastUpdateDate": 1436275310912, + "description": "desc", + "icon": "icon-red2", + "tags": [ + "martin221", + "martin221tag" + ], + "category": "Security", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.WebServer" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "host": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.WebApplication" + ] + }, + "admin_endpoint": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.admin_endpoint", + "type": "tosca.capabilities.Endpoint.Admin" + }, + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + }, + "data_endpoint": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.data_endpoint", + "type": "tosca.capabilities.Endpoint" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + }, + "host": { + "uniqueId": "res_tosca.nodes.softwarecomponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "relationship": "tosca.relationships.HostedOn" + } + }, + "vendorName": "Oracle", + "vendorRelease": "1.2.5", + "contactId": "Al1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_gfnfgf.0.1", + "resourceName": "gfnfgf", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436275654252, + "lastUpdateDate": 1436275654252, + "description": "hfghfgh", + "icon": "icon-red2", + "tags": [ + "gfnfgf" + ], + "category": "Call Control", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.WebServer" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "host": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.WebApplication" + ] + }, + "admin_endpoint": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.admin_endpoint", + "type": "tosca.capabilities.Endpoint.Admin" + }, + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + }, + "data_endpoint": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.data_endpoint", + "type": "tosca.capabilities.Endpoint" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + }, + "host": { + "uniqueId": "res_tosca.nodes.softwarecomponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "relationship": "tosca.relationships.HostedOn" + } + }, + "vendorName": "gfhgf", + "vendorRelease": "gfhgf", + "contactId": "gg1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_ddd.0.1", + "resourceName": "ddd", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436338105711, + "lastUpdateDate": 1436338105711, + "description": "dsff", + "icon": "icon-red1", + "tags": [ + "sddd" + ], + "category": "Big Data", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.SoftwareComponent" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + }, + "host": { + "uniqueId": "res_tosca.nodes.softwarecomponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "relationship": "tosca.relationships.HostedOn" + } + }, + "vendorName": "sadfasdf", + "vendorRelease": "adsfadsf", + "contactId": "ds200p", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_hhdfd.0.1", + "resourceName": "hhdfd", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436342424025, + "lastUpdateDate": 1436342424025, + "description": "fdhdffh", + "icon": "icon-red2", + "tags": [ + "hhdfd" + ], + "category": "Big Data", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.Root" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + } + }, + "vendorName": "fdhfddfh", + "vendorRelease": "fdhdf", + "contactId": "fg1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_infobae.0.1", + "resourceName": "infobae", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436346185743, + "lastUpdateDate": 1436346185743, + "description": "es el", + "icon": "icon-red2", + "tags": [ + "infobae" + ], + "category": "Big Data", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.WebApplication" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "app_endpoint": { + "uniqueId": "capability.res_tosca.nodes.webapplication.1.0.app_endpoint", + "type": "tosca.capabilities.Endpoint" + }, + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + }, + "host": { + "uniqueId": "res_tosca.nodes.webapplication.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.WebServer", + "relationship": "tosca.relationships.HostedOn" + } + }, + "vendorName": "ffff", + "vendorRelease": "ffff", + "contactId": "ss1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_df.0.1", + "resourceName": "df", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436352980564, + "lastUpdateDate": 1436352980564, + "description": "sdf", + "icon": "icon-red2", + "tags": [ + "dfsdf" + ], + "category": "Messaging", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.WebServer" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "host": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.WebApplication" + ] + }, + "admin_endpoint": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.admin_endpoint", + "type": "tosca.capabilities.Endpoint.Admin" + }, + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + }, + "data_endpoint": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.data_endpoint", + "type": "tosca.capabilities.Endpoint" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + }, + "host": { + "uniqueId": "res_tosca.nodes.softwarecomponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "relationship": "tosca.relationships.HostedOn" + } + }, + "vendorName": "sdf", + "vendorRelease": "sdf", + "contactId": "jh7654", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_ddddd.0.1", + "resourceName": "ddddd", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436353021637, + "lastUpdateDate": 1436353021637, + "description": "ddsd", + "icon": "icon-red2", + "tags": [ + "ddddd" + ], + "category": "Compute as a Service", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.Root" + ], + "artifacts": { + "misdevices": { + "uniqueId": "res_ddddd.0.1.misdevices", + "artifactType": "PUPPET", + "artifactName": "misdevices.docx", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436353036161, + "lastUpdateDate": 1436353036161, + "esId": "res_ddddd.0.1:misdevices.docx", + "logicalName": "misdevices", + "description": "eeeeee" + } + }, + "interfaces": { + + }, + "capabilities": { + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + } + }, + "vendorName": "dfsd", + "vendorRelease": "ddddd", + "contactId": "ss1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_yo.0.1", + "resourceName": "yo", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436369145382, + "lastUpdateDate": 1436369145382, + "description": "dddd", + "icon": "icon-red2", + "tags": [ + "yo" + ], + "category": "Collaboration", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.WebServer" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "host": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.WebApplication" + ] + }, + "admin_endpoint": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.admin_endpoint", + "type": "tosca.capabilities.Endpoint.Admin" + }, + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + }, + "data_endpoint": { + "uniqueId": "capability.res_tosca.nodes.webserver.1.0.data_endpoint", + "type": "tosca.capabilities.Endpoint" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + }, + "host": { + "uniqueId": "res_tosca.nodes.softwarecomponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "relationship": "tosca.relationships.HostedOn" + } + }, + "vendorName": "dds", + "vendorRelease": "ssss", + "contactId": "ss1234", + "abstract": false, + "highestVersion": true + }, + { + "uniqueId": "res_martin2213.0.1", + "resourceName": "martin2213", + "resourceVersion": "0.1", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "creationDate": 1436369231581, + "lastUpdateDate": 1436369231581, + "description": "desc", + "icon": "icon-red2", + "tags": [ + "martin2213", + "martin2213tag" + ], + "category": "Messaging", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT", + "derivedFrom": [ + "tosca.nodes.DBMS" + ], + "artifacts": { + + }, + "interfaces": { + + }, + "capabilities": { + "host": { + "uniqueId": "capability.res_tosca.nodes.dbms.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.Database" + ] + }, + "feature": { + "uniqueId": "capability.res_tosca.nodes.root.1.0.feature", + "type": "tosca.capabilities.Node" + } + }, + "requirements": { + "dependency": { + "uniqueId": "res_tosca.nodes.root.1.0.dependency", + "capability": "tosca.capabilities.Node", + "node": "tosca.nodes.Root", + "relationship": "tosca.relationships.DependsOn" + }, + "host": { + "uniqueId": "res_tosca.nodes.softwarecomponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "relationship": "tosca.relationships.HostedOn" + } + }, + "vendorName": "Oracle", + "vendorRelease": "1.2.5", + "contactId": "Al1234", + "abstract": false, + "highestVersion": true + } + ], + "services": [ + { + "componentMetadataDefinition": { + "uniqueId": "svc_wduma.0.1", + "name": "wduma", + "version": "0.1", + "creationDate": 1436081587500, + "lastUpdateDate": 1436081587500, + "description": "BLa BLa", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "wduma", + "wdumatag" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Databases", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "wduma", + "creationDate": 1436081587500, + "icon": "network_l_4", + "version": "0.1", + "description": "BLa BLa", + "tags": [ + "wduma", + "wdumatag" + ], + "uniqueId": "svc_wduma.0.1", + "lastUpdateDate": 1436081587500, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_r.0.1", + "name": "r", + "version": "0.1", + "creationDate": 1436083434172, + "lastUpdateDate": 1436083434172, + "description": "r", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "rrrr" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "IoT", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "r", + "creationDate": 1436083434172, + "icon": "network_l_4", + "version": "0.1", + "description": "r", + "tags": [ + "rrrr" + ], + "uniqueId": "svc_r.0.1", + "lastUpdateDate": 1436083434172, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_otdiz.0.1", + "name": "otdiz", + "version": "0.1", + "creationDate": 1436094819610, + "lastUpdateDate": 1436094819610, + "description": "BLa BLa", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "otdiz", + "otdiztag" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Platform as a Service", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "otdiz", + "creationDate": 1436094819610, + "icon": "network_l_4", + "version": "0.1", + "description": "BLa BLa", + "tags": [ + "otdiz", + "otdiztag" + ], + "uniqueId": "svc_otdiz.0.1", + "lastUpdateDate": 1436094819610, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_gxkvl.0.1", + "name": "gxkvl", + "version": "0.1", + "creationDate": 1436094992972, + "lastUpdateDate": 1436094992972, + "description": "BLa BLa", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "gxkvl", + "gxkvltag" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Security", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "gxkvl", + "creationDate": 1436094992972, + "icon": "network_l_4", + "version": "0.1", + "description": "BLa BLa", + "tags": [ + "gxkvl", + "gxkvltag" + ], + "uniqueId": "svc_gxkvl.0.1", + "lastUpdateDate": 1436094992972, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_testservice.0.1", + "name": "testService", + "version": "0.1", + "creationDate": 1436098158942, + "lastUpdateDate": 1436098158942, + "description": "description", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "tag1" + ], + "icon": "myICON.jpg", + "highestVersion": true + }, + "artifacts": { + "install_apache": { + "uniqueId": "svc_testservice.0.1.install_apache", + "artifactType": "SHELL", + "artifactName": "install_apache.sh", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436098195328, + "lastUpdateDate": 1436098195328, + "esId": "svc_testservice.0.1:install_apache.sh", + "logicalName": "install_apache" + } + }, + "category": "Databases", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "testService", + "creationDate": 1436098158942, + "icon": "myICON.jpg", + "version": "0.1", + "description": "description", + "tags": [ + "tag1" + ], + "uniqueId": "svc_testservice.0.1", + "lastUpdateDate": 1436098158942, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_newtestservice5.0.1", + "name": "newTestService5", + "version": "0.1", + "creationDate": 1436111412660, + "lastUpdateDate": 1436111412660, + "description": "service Description", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "newTestService5", + "serviceTag" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Big Data", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "newTestService5", + "creationDate": 1436111412660, + "icon": "network_l_4", + "version": "0.1", + "description": "service Description", + "tags": [ + "newTestService5", + "serviceTag" + ], + "uniqueId": "svc_newtestservice5.0.1", + "lastUpdateDate": 1436111412660, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_newtestservice.0.1", + "name": "newTestService", + "version": "0.1", + "creationDate": 1436114463660, + "lastUpdateDate": 1436114463660, + "description": "service Description", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "serviceTag" + ], + "icon": "myIcon.jpg", + "vendorName": "Oracle", + "vendorRelease": "0.1", + "contactId": "al1976", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Big Data", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "newTestService", + "creationDate": 1436114463660, + "icon": "myIcon.jpg", + "version": "0.1", + "description": "service Description", + "tags": [ + "serviceTag" + ], + "uniqueId": "svc_newtestservice.0.1", + "lastUpdateDate": 1436114463660, + "contactId": "al1976", + "vendorName": "Oracle", + "vendorRelease": "0.1", + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_éø⦹.0.1", + "name": "éø¦¹", + "version": "0.1", + "creationDate": 1436168481712, + "lastUpdateDate": 1436168481712, + "description": "service Description", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "éø¦¹", + "éø¦¹serviceTag" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Big Data", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "éø¦¹", + "creationDate": 1436168481712, + "icon": "network_l_4", + "version": "0.1", + "description": "service Description", + "tags": [ + "éø¦¹", + "éø¦¹serviceTag" + ], + "uniqueId": "svc_éø⦹.0.1", + "lastUpdateDate": 1436168481712, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_mmmm.0.1", + "name": "mmmm", + "version": "0.1", + "creationDate": 1436175721980, + "lastUpdateDate": 1436175721980, + "description": "jjjj", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "mmmm" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + "Subtitle": { + "uniqueId": "svc_mmmm.0.1.Subtitle", + "artifactType": "SHELL", + "artifactName": "Subtitle.png", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436180446882, + "lastUpdateDate": 1436180446882, + "esId": "svc_mmmm.0.1:Subtitle.png", + "logicalName": "Subtitle", + "description": "dfdssfsd" + }, + "10 numbers limit reached": { + "uniqueId": "svc_mmmm.0.1.10 numbers limit reached", + "artifactType": "SHELL", + "artifactName": "10 numbers limit reached.png", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436178322094, + "lastUpdateDate": 1436178322094, + "esId": "svc_mmmm.0.1:10 numbers limit reached.png", + "logicalName": "10 numbers limit reached", + "description": "hdfhdfhddf" + }, + "Screenshot_2014-09-08-13-07-49": { + "uniqueId": "svc_mmmm.0.1.Screenshot_2014-09-08-13-07-49", + "artifactType": "SHELL", + "artifactName": "Screenshot_2014-09-08-13-07-49.png", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436180394486, + "lastUpdateDate": 1436180394486, + "esId": "svc_mmmm.0.1:Screenshot_2014-09-08-13-07-49.png", + "logicalName": "Screenshot_2014-09-08-13-07-49", + "description": "fdgfdgfdg" + }, + "Slow upload ": { + "uniqueId": "svc_mmmm.0.1.Slow upload ", + "artifactType": "SHELL", + "artifactName": "Slow upload .png", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436180490467, + "lastUpdateDate": 1436180490467, + "esId": "svc_mmmm.0.1:Slow upload .png", + "logicalName": "Slow upload ", + "description": "sdffdsfds" + }, + "img009": { + "uniqueId": "svc_mmmm.0.1.img009", + "artifactType": "PUPPET", + "artifactName": "img009.jpg", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436178135843, + "lastUpdateDate": 1436178135843, + "esId": "svc_mmmm.0.1:img009.jpg", + "logicalName": "img009", + "description": "hhhhh" + }, + "casa1": { + "uniqueId": "svc_mmmm.0.1.casa1", + "artifactType": "HEAT", + "artifactName": "casa1.JPG", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436180424159, + "lastUpdateDate": 1436180424159, + "esId": "svc_mmmm.0.1:casa1.JPG", + "logicalName": "casa1", + "description": "fgsdfsdsdf" + } + }, + "category": "Call Control", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "mmmm", + "creationDate": 1436175721980, + "icon": "network_l_4", + "version": "0.1", + "description": "jjjj", + "tags": [ + "mmmm" + ], + "uniqueId": "svc_mmmm.0.1", + "lastUpdateDate": 1436175721980, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_fgfdgdfg.0.1", + "name": "fgfdgdfg", + "version": "0.1", + "creationDate": 1436189750913, + "lastUpdateDate": 1436189750913, + "description": "fgdfgdf", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "fgfdgdfg" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Databases", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "fgfdgdfg", + "creationDate": 1436189750913, + "icon": "network_l_4", + "version": "0.1", + "description": "fgdfgdf", + "tags": [ + "fgfdgdfg" + ], + "uniqueId": "svc_fgfdgdfg.0.1", + "lastUpdateDate": 1436189750913, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_jujuy.0.1", + "name": "jujuy", + "version": "0.1", + "creationDate": 1436190515151, + "lastUpdateDate": 1436190515151, + "description": "gfhdf", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "jujuyggg" + ], + "icon": "network_l_1-3", + "highestVersion": true + }, + "artifacts": { + "ServicePanel": { + "uniqueId": "svc_jujuy.0.1.ServicePanel", + "artifactType": "SHELL", + "artifactName": "ServicePanel.JPG", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436191109314, + "lastUpdateDate": 1436191109314, + "esId": "svc_jujuy.0.1:ServicePanel.JPG", + "logicalName": "ServicePanel", + "description": "ddddddddddddddddddd" + }, + "IconEnd": { + "uniqueId": "svc_jujuy.0.1.IconEnd", + "artifactType": "PUPPET", + "artifactName": "IconEnd.JPG", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436190528852, + "lastUpdateDate": 1436190528852, + "esId": "svc_jujuy.0.1:IconEnd.JPG", + "logicalName": "IconEnd", + "description": "fffffff" + }, + "IconCenter": { + "uniqueId": "svc_jujuy.0.1.IconCenter", + "artifactType": "SHELL", + "artifactName": "IconCenter.JPG", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436190584441, + "lastUpdateDate": 1436190584441, + "esId": "svc_jujuy.0.1:IconCenter.JPG", + "logicalName": "IconCenter", + "description": "fffff" + }, + "udateresource": { + "uniqueId": "svc_jujuy.0.1.udateresource", + "artifactType": "YANG", + "artifactName": "udateresource.JPG", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436191131313, + "lastUpdateDate": 1436191131313, + "esId": "svc_jujuy.0.1:udateresource.JPG", + "logicalName": "udateresource", + "description": "dddd" + }, + "toobolar": { + "uniqueId": "svc_jujuy.0.1.toobolar", + "artifactType": "SHELL", + "artifactName": "toobolar.JPG", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436191146471, + "lastUpdateDate": 1436191146471, + "esId": "svc_jujuy.0.1:toobolar.JPG", + "logicalName": "toobolar", + "description": "sssssssssssssss" + } + }, + "category": "Collaboration", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "jujuy", + "creationDate": 1436190515151, + "icon": "network_l_1-3", + "version": "0.1", + "description": "gfhdf", + "tags": [ + "jujuyggg" + ], + "uniqueId": "svc_jujuy.0.1", + "lastUpdateDate": 1436190515151, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_martin39.0.1", + "name": "martin39", + "version": "0.1", + "creationDate": 1436252371041, + "lastUpdateDate": 1436252371041, + "description": "fffffff", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "martin39" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + "toobolar": { + "uniqueId": "svc_martin39.0.1.toobolar", + "artifactType": "SHELL", + "artifactName": "toobolar.JPG", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436252434415, + "lastUpdateDate": 1436252434415, + "esId": "svc_martin39.0.1:toobolar.JPG", + "logicalName": "toobolar", + "description": "ffff" + } + }, + "category": "Compute as a Service", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "martin39", + "creationDate": 1436252371041, + "icon": "network_l_4", + "version": "0.1", + "description": "fffffff", + "tags": [ + "martin39" + ], + "uniqueId": "svc_martin39.0.1", + "lastUpdateDate": 1436252371041, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_asdasd.0.1", + "name": "asdasd", + "version": "0.1", + "creationDate": 1436253177668, + "lastUpdateDate": 1436253177668, + "description": "asdasd", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "asdasd" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Collaboration", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "asdasd", + "creationDate": 1436253177668, + "icon": "network_l_4", + "version": "0.1", + "description": "asdasd", + "tags": [ + "asdasd" + ], + "uniqueId": "svc_asdasd.0.1", + "lastUpdateDate": 1436253177668, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_fgdfgfd.0.1", + "name": "fgdfgfd", + "version": "0.1", + "creationDate": 1436255258481, + "lastUpdateDate": 1436255258481, + "description": "dfgdfg", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "fgdfgfd" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Compute as a Service", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "fgdfgfd", + "creationDate": 1436255258481, + "icon": "network_l_4", + "version": "0.1", + "description": "dfgdfg", + "tags": [ + "fgdfgfd" + ], + "uniqueId": "svc_fgdfgfd.0.1", + "lastUpdateDate": 1436255258481, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_fdgd.0.1", + "name": "fdgd", + "version": "0.1", + "creationDate": 1436257427821, + "lastUpdateDate": 1436257427821, + "description": "fdg", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "fdgd" + ], + "icon": "call_controll", + "highestVersion": true + }, + "artifacts": { + "toobolar": { + "uniqueId": "svc_fdgd.0.1.toobolar", + "artifactType": "SHELL", + "artifactName": "toobolar.JPG", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436257614747, + "lastUpdateDate": 1436257614747, + "esId": "svc_fdgd.0.1:toobolar.JPG", + "logicalName": "toobolar", + "description": "dfsdfsd" + } + }, + "category": "Compute as a Service", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "fdgd", + "creationDate": 1436257427821, + "icon": "call_controll", + "version": "0.1", + "description": "fdg", + "tags": [ + "fdgd" + ], + "uniqueId": "svc_fdgd.0.1", + "lastUpdateDate": 1436257427821, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_fdgdfgfd.0.1", + "name": "fdgdfgfd", + "version": "0.1", + "creationDate": 1436266653797, + "lastUpdateDate": 1436266653797, + "description": "fdfdgf", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "fdgdfgfd" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + "IMG_20141222_072027": { + "uniqueId": "svc_fdgdfgfd.0.1.IMG_20141222_072027", + "artifactType": "SHELL", + "artifactName": "IMG_20141222_072027.jpg", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436267970999, + "lastUpdateDate": 1436267970999, + "esId": "svc_fdgdfgfd.0.1:IMG_20141222_072027.jpg", + "logicalName": "IMG_20141222_072027", + "description": "FEDF" + } + }, + "category": "Call Control", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "fdgdfgfd", + "creationDate": 1436266653797, + "icon": "network_l_4", + "version": "0.1", + "description": "fdfdgf", + "tags": [ + "fdgdfgfd" + ], + "uniqueId": "svc_fdgdfgfd.0.1", + "lastUpdateDate": 1436266653797, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_fbgvdfb.0.1", + "name": "fbgvdfb", + "version": "0.1", + "creationDate": 1436267394596, + "lastUpdateDate": 1436267394596, + "description": "sdbdbs", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "fbgvdfb" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + "IMG_20140413_185621": { + "uniqueId": "svc_fbgvdfb.0.1.IMG_20140413_185621", + "artifactType": "YANG", + "artifactName": "IMG_20140413_185621.jpg", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436267701461, + "lastUpdateDate": 1436267701461, + "esId": "svc_fbgvdfb.0.1:IMG_20140413_185621.jpg", + "logicalName": "IMG_20140413_185621", + "description": "ACSCA" + }, + "IMG_20140413_185643": { + "uniqueId": "svc_fbgvdfb.0.1.IMG_20140413_185643", + "artifactType": "CHEF", + "artifactName": "IMG_20140413_185643.jpg", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436267871628, + "lastUpdateDate": 1436267871628, + "esId": "svc_fbgvdfb.0.1:IMG_20140413_185643.jpg", + "logicalName": "IMG_20140413_185643", + "description": "ASDFAWSE" + } + }, + "category": "Call Control", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "fbgvdfb", + "creationDate": 1436267394596, + "icon": "network_l_4", + "version": "0.1", + "description": "sdbdbs", + "tags": [ + "fbgvdfb" + ], + "uniqueId": "svc_fbgvdfb.0.1", + "lastUpdateDate": 1436267394596, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_asdasds.0.1", + "name": "asdasds", + "version": "0.1", + "creationDate": 1436268972057, + "lastUpdateDate": 1436268972057, + "description": "asdasdasd", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "asdasds" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Collaboration", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "asdasds", + "creationDate": 1436268972057, + "icon": "network_l_4", + "version": "0.1", + "description": "asdasdasd", + "tags": [ + "asdasds" + ], + "uniqueId": "svc_asdasds.0.1", + "lastUpdateDate": 1436268972057, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_kkkkk.0.1", + "name": "kkkkk", + "version": "0.1", + "creationDate": 1436271848416, + "lastUpdateDate": 1436271848416, + "description": "hggh", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "kkkkk" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + "dessaper": { + "uniqueId": "svc_kkkkk.0.1.dessaper", + "artifactType": "SHELL", + "artifactName": "dessaper.JPG", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436271866025, + "lastUpdateDate": 1436271866025, + "esId": "svc_kkkkk.0.1:dessaper.JPG", + "logicalName": "dessaper", + "description": "fgdf" + } + }, + "category": "Call Control", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "kkkkk", + "creationDate": 1436271848416, + "icon": "network_l_4", + "version": "0.1", + "description": "hggh", + "tags": [ + "kkkkk" + ], + "uniqueId": "svc_kkkkk.0.1", + "lastUpdateDate": 1436271848416, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_alex.0.1", + "name": "alex", + "version": "0.1", + "creationDate": 1436276482974, + "lastUpdateDate": 1436276482974, + "description": "Bla Bla", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "alex", + "ddd" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + "pencil": { + "uniqueId": "svc_alex.0.1.pencil", + "artifactType": "CHEF", + "artifactName": "pencil.JPG", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436276810898, + "lastUpdateDate": 1436276810898, + "esId": "svc_alex.0.1:pencil.JPG", + "logicalName": "pencil", + "description": "nk" + }, + "Web Accessibility": { + "uniqueId": "svc_alex.0.1.Web Accessibility", + "artifactType": "HEAT", + "artifactName": "Web Accessibility.pptx", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436276689984, + "lastUpdateDate": 1436276689984, + "esId": "svc_alex.0.1:Web Accessibility.pptx", + "logicalName": "Web Accessibility", + "description": "dfhgf" + }, + "toobolar": { + "uniqueId": "svc_alex.0.1.toobolar", + "artifactType": "CHEF", + "artifactName": "toobolar.JPG", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436276821186, + "lastUpdateDate": 1436276821186, + "esId": "svc_alex.0.1:toobolar.JPG", + "logicalName": "toobolar", + "description": "dgrt" + } + }, + "category": "IoT", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "alex", + "creationDate": 1436276482974, + "icon": "network_l_4", + "version": "0.1", + "description": "Bla Bla", + "tags": [ + "alex", + "ddd" + ], + "uniqueId": "svc_alex.0.1", + "lastUpdateDate": 1436276482974, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_martin392.0.1", + "name": "martin392", + "version": "0.1", + "creationDate": 1436276986104, + "lastUpdateDate": 1436276986104, + "description": "ddddd", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "martin392" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Collaboration", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "martin392", + "creationDate": 1436276986104, + "icon": "network_l_4", + "version": "0.1", + "description": "ddddd", + "tags": [ + "martin392" + ], + "uniqueId": "svc_martin392.0.1", + "lastUpdateDate": 1436276986104, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_alex1.0.1", + "name": "Alex1", + "version": "0.1", + "creationDate": 1436277034499, + "lastUpdateDate": 1436277034499, + "description": "vvg", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "Alex1" + ], + "icon": "network_l_1-3", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "IoT", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "Alex1", + "creationDate": 1436277034499, + "icon": "network_l_1-3", + "version": "0.1", + "description": "vvg", + "tags": [ + "Alex1" + ], + "uniqueId": "svc_alex1.0.1", + "lastUpdateDate": 1436277034499, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_alex2.0.1", + "name": "Alex2", + "version": "0.1", + "creationDate": 1436277071235, + "lastUpdateDate": 1436277071235, + "description": "sas", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "Alex2" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Big Data", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "Alex2", + "creationDate": 1436277071235, + "icon": "network_l_4", + "version": "0.1", + "description": "sas", + "tags": [ + "Alex2" + ], + "uniqueId": "svc_alex2.0.1", + "lastUpdateDate": 1436277071235, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_gfhgfhfg.0.1", + "name": "gfhgfhfg", + "version": "0.1", + "creationDate": 1436337425800, + "lastUpdateDate": 1436337425800, + "description": "fghg", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "gfhgfhgfgfhfg" + ], + "icon": "network_l_1-3", + "highestVersion": true + }, + "artifacts": { + "Footer_menu": { + "uniqueId": "svc_gfhgfhfg.0.1.Footer_menu", + "artifactType": "SHELL", + "artifactName": "Footer_menu.JPG", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436337460108, + "lastUpdateDate": 1436337460108, + "esId": "svc_gfhgfhfg.0.1:Footer_menu.JPG", + "logicalName": "Footer_menu", + "description": "gfhgfh" + } + }, + "category": "Call Control", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "gfhgfhfg", + "creationDate": 1436337425800, + "icon": "network_l_1-3", + "version": "0.1", + "description": "fghg", + "tags": [ + "gfhgfhgfgfhfg" + ], + "uniqueId": "svc_gfhgfhfg.0.1", + "lastUpdateDate": 1436337425800, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_fffffdd.0.1", + "name": "fffffdd", + "version": "0.1", + "creationDate": 1436342516321, + "lastUpdateDate": 1436342516321, + "description": "fdgg", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "fffffdd" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Call Control", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "fffffdd", + "creationDate": 1436342516321, + "icon": "network_l_4", + "version": "0.1", + "description": "fdgg", + "tags": [ + "fffffdd" + ], + "uniqueId": "svc_fffffdd.0.1", + "lastUpdateDate": 1436342516321, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_martin.0.1", + "name": "martin", + "version": "0.1", + "creationDate": 1436342857036, + "lastUpdateDate": 1436342857036, + "description": "gggg", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "martin" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Call Control", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "martin", + "creationDate": 1436342857036, + "icon": "network_l_4", + "version": "0.1", + "description": "gggg", + "tags": [ + "martin" + ], + "uniqueId": "svc_martin.0.1", + "lastUpdateDate": 1436342857036, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_fghj.0.1", + "name": "fghj", + "version": "0.1", + "creationDate": 1436343201655, + "lastUpdateDate": 1436343201655, + "description": "fghjfhj", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "fghj" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Big Data", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "fghj", + "creationDate": 1436343201655, + "icon": "network_l_4", + "version": "0.1", + "description": "fghjfhj", + "tags": [ + "fghj" + ], + "uniqueId": "svc_fghj.0.1", + "lastUpdateDate": 1436343201655, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_lol.0.1", + "name": "lol", + "version": "0.1", + "creationDate": 1436343380208, + "lastUpdateDate": 1436343380208, + "description": "ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggddddddddddddddddddddddddddddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssss", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "lol" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + "10 numbers limit reached": { + "uniqueId": "svc_lol.0.1.10 numbers limit reached", + "artifactType": "SHELL", + "artifactName": "10 numbers limit reached.png", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436344950166, + "lastUpdateDate": 1436344950166, + "esId": "svc_lol.0.1:10 numbers limit reached.png", + "logicalName": "10 numbers limit reached", + "description": "yyyyyyy" + }, + "Addproperty": { + "uniqueId": "svc_lol.0.1.Addproperty", + "artifactType": "PUPPET", + "artifactName": "Addproperty.JPG", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436344939800, + "lastUpdateDate": 1436344939800, + "esId": "svc_lol.0.1:Addproperty.JPG", + "logicalName": "Addproperty", + "description": "hhhhhhh" + }, + "IMG_20140418_142614": { + "uniqueId": "svc_lol.0.1.IMG_20140418_142614", + "artifactType": "SHELL", + "artifactName": "IMG_20140418_142614.jpg", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436344895625, + "lastUpdateDate": 1436344895625, + "esId": "svc_lol.0.1:IMG_20140418_142614.jpg", + "logicalName": "IMG_20140418_142614", + "description": "bbbbbb" + }, + "IMG_20140618_195014": { + "uniqueId": "svc_lol.0.1.IMG_20140618_195014", + "artifactType": "CHEF", + "artifactName": "IMG_20140618_195014.jpg", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436344912378, + "lastUpdateDate": 1436344912378, + "esId": "svc_lol.0.1:IMG_20140618_195014.jpg", + "logicalName": "IMG_20140618_195014", + "description": "bbbbb" + }, + "IMG_20161213_222041": { + "uniqueId": "svc_lol.0.1.IMG_20161213_222041", + "artifactType": "HEAT", + "artifactName": "IMG_20161213_222041.jpg", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436343693049, + "lastUpdateDate": 1436343693049, + "esId": "svc_lol.0.1:IMG_20161213_222041.jpg", + "logicalName": "IMG_20161213_222041", + "description": "jjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjjjjjjjjjjjjjjjjjjdfjjjjjjj4444444444444444444444444444444444444444444444444444444444444444444" + }, + "IMG_20140418_142634": { + "uniqueId": "svc_lol.0.1.IMG_20140418_142634", + "artifactType": "PUPPET", + "artifactName": "IMG_20140418_142634.jpg", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436344878280, + "lastUpdateDate": 1436344878280, + "esId": "svc_lol.0.1:IMG_20140418_142634.jpg", + "logicalName": "IMG_20140418_142634", + "description": "bbbbbb" + } + }, + "category": "Web Servers", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "lol", + "creationDate": 1436343380208, + "icon": "network_l_4", + "version": "0.1", + "description": "ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggddddddddddddddddddddddddddddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssssssssssswwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpopopoddddssssssssss", + "tags": [ + "lol" + ], + "uniqueId": "svc_lol.0.1", + "lastUpdateDate": 1436343380208, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_clarin.0.1", + "name": "clarin", + "version": "0.1", + "creationDate": 1436346144421, + "lastUpdateDate": 1436346144421, + "description": "soy yo", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "clarin" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Infrastructure", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "clarin", + "creationDate": 1436346144421, + "icon": "network_l_4", + "version": "0.1", + "description": "soy yo", + "tags": [ + "clarin" + ], + "uniqueId": "svc_clarin.0.1", + "lastUpdateDate": 1436346144421, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_jkhkjh.0.1", + "name": "jkhkjh", + "version": "0.1", + "creationDate": 1436356292329, + "lastUpdateDate": 1436356292329, + "description": "kjhlk", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "jkhkjh" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + "Screenshot_1": { + "uniqueId": "svc_jkhkjh.0.1.Screenshot_1", + "artifactType": "PUPPET", + "artifactName": "Screenshot_1.png", + "userIdLastUpdater": "cs0008", + "creatorFullName": "Carlos Santana", + "updaterFullName": "Carlos Santana", + "creationDate": 1436356484212, + "lastUpdateDate": 1436356484212, + "esId": "svc_jkhkjh.0.1:Screenshot_1.png", + "logicalName": "Screenshot_1", + "description": "zfvbgsadfgsdhsdghsdhdsghsdhzfvbgsadfgsdhsdghsdhdsghsdhzfvbgsadfgsdhsdghsdhdsghsdhzfvbgsadfgsdhsdghsdhdsghsdhzfvbgsadfgsdhsdghsdhdsghsdhzfvbgsadfgsdhsdghsdhdsghsdhzfvbgsadfgsdhsdghsdhdsghsdhzfvbgsadfgsdhsdghsdhdsghsdhzfvbgsadfgsdhsdghsdhdsghsdhzfvbgsadfgsdhsdghsdhdsghsdhzfvbgsadfgsdhsdghsdhdsghsdhzfvbgsadfgsdhsdghsdhdsghsdhzfvbgsadfgsdhsdghsdhdsghsdhzfvbgsadfgsdhsdghsdhdsghsdh" + } + }, + "category": "Call Control", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "resourceInstances": [ + { + "uniqueId": "svc_jkhkjh.0.1.res_tosca.nodes.compute.1.0.compute_1", + "name": "compute_1", + "resourceUid": "res_tosca.nodes.compute.1.0", + "creationTime": 1436356602608, + "modificationTime": 1436356602608, + "description": "Represents a real or virtual machine or server. Information specified on the Compute\r\t node will be used to find the machine that fits the given requirements in the cloud\r\t available machines. If no sizing information are specified the cloud provider default\r\t machine will be used. It is strongly recommended to specify the required CPUs and memory\r\t at least.", + "posX": "781", + "posY": "241", + "icon": "defaulticon" + }, + { + "uniqueId": "svc_jkhkjh.0.1.res_tosca.nodes.compute.1.0.compute_2", + "name": "compute_2", + "resourceUid": "res_tosca.nodes.compute.1.0", + "creationTime": 1436356789445, + "modificationTime": 1436356789445, + "description": "Represents a real or virtual machine or server. Information specified on the Compute\r\t node will be used to find the machine that fits the given requirements in the cloud\r\t available machines. If no sizing information are specified the cloud provider default\r\t machine will be used. It is strongly recommended to specify the required CPUs and memory\r\t at least.", + "posX": "695", + "posY": "204", + "icon": "defaulticon" + }, + { + "uniqueId": "svc_jkhkjh.0.1.res_tosca.nodes.network.network.1.0.network_3", + "name": "network_3", + "resourceUid": "res_tosca.nodes.network.network.1.0", + "creationTime": 1436356792215, + "modificationTime": 1436356792215, + "description": "Represents a simple , logical network service.", + "posX": "706", + "posY": "381", + "icon": "defaulticon" + }, + { + "uniqueId": "svc_jkhkjh.0.1.res_tosca.nodes.network.port.1.0.port_4", + "name": "port_4", + "resourceUid": "res_tosca.nodes.network.port.1.0", + "creationTime": 1436356793840, + "modificationTime": 1436356793840, + "description": "Represents a logical entity that associates between Compute and Network normative types.", + "posX": "662", + "posY": "552", + "icon": "defaulticon" + } + ], + "resourceInstancesRelations": [ + + ], + "serviceName": "jkhkjh", + "creationDate": 1436356292329, + "icon": "network_l_4", + "version": "0.1", + "description": "kjhlk", + "tags": [ + "jkhkjh" + ], + "uniqueId": "svc_jkhkjh.0.1", + "lastUpdateDate": 1436356292329, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_resrw.0.1", + "name": "resrw", + "version": "0.1", + "creationDate": 1436358721893, + "lastUpdateDate": 1436358721893, + "description": "rer", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "resrwrer", + "lklkl" + ], + "icon": "network_l_1-3", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Call Control", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "resourceInstances": [ + { + "uniqueId": "svc_resrw.0.1.res_tosca.nodes.compute.1.0.compute_1", + "name": "compute_1", + "resourceUid": "res_tosca.nodes.compute.1.0", + "creationTime": 1436358725759, + "modificationTime": 1436358725759, + "description": "Represents a real or virtual machine or server. Information specified on the Compute\r\t node will be used to find the machine that fits the given requirements in the cloud\r\t available machines. If no sizing information are specified the cloud provider default\r\t machine will be used. It is strongly recommended to specify the required CPUs and memory\r\t at least.", + "posX": "221", + "posY": "251", + "icon": "defaulticon" + }, + { + "uniqueId": "svc_resrw.0.1.res_tosca.nodes.network.network.1.0.network_2", + "name": "network_2", + "resourceUid": "res_tosca.nodes.network.network.1.0", + "creationTime": 1436358727329, + "modificationTime": 1436358727329, + "description": "Represents a simple , logical network service.", + "posX": "626", + "posY": "340", + "icon": "defaulticon" + }, + { + "uniqueId": "svc_resrw.0.1.res_tosca.nodes.network.port.1.0.port_3", + "name": "port_3", + "resourceUid": "res_tosca.nodes.network.port.1.0", + "creationTime": 1436358729466, + "modificationTime": 1436358729466, + "description": "Represents a logical entity that associates between Compute and Network normative types.", + "posX": "558", + "posY": "275", + "icon": "defaulticon" + } + ], + "resourceInstancesRelations": [ + + ], + "serviceName": "resrw", + "creationDate": 1436358721893, + "icon": "network_l_1-3", + "version": "0.1", + "description": "rer", + "tags": [ + "resrwrer", + "lklkl" + ], + "uniqueId": "svc_resrw.0.1", + "lastUpdateDate": 1436358721893, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_coco.0.1", + "name": "coco", + "version": "0.1", + "creationDate": 1436362653722, + "lastUpdateDate": 1436362653722, + "description": "hhh", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "coco" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Call Control", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "coco", + "creationDate": 1436362653722, + "icon": "network_l_4", + "version": "0.1", + "description": "hhh", + "tags": [ + "coco" + ], + "uniqueId": "svc_coco.0.1", + "lastUpdateDate": 1436362653722, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_nermartin.0.1", + "name": "nerMartin", + "version": "0.1", + "creationDate": 1436366670488, + "lastUpdateDate": 1436366670488, + "description": "gggggggggg", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "nerMartin" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "IMS", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "nerMartin", + "creationDate": 1436366670488, + "icon": "network_l_4", + "version": "0.1", + "description": "gggggggggg", + "tags": [ + "nerMartin" + ], + "uniqueId": "svc_nermartin.0.1", + "lastUpdateDate": 1436366670488, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + }, + { + "componentMetadataDefinition": { + "uniqueId": "svc_susana.0.1", + "name": "susana", + "version": "0.1", + "creationDate": 1436367239625, + "lastUpdateDate": 1436367239625, + "description": "fff", + "state": "NOT_CERTIFIED_CHECKOUT", + "tags": [ + "susana" + ], + "icon": "network_l_4", + "highestVersion": true + }, + "artifacts": { + + }, + "category": "Call Control", + "creatorUserId": "cs0008", + "creatorFullName": "Carlos Santana", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "serviceName": "susana", + "creationDate": 1436367239625, + "icon": "network_l_4", + "version": "0.1", + "description": "fff", + "tags": [ + "susana" + ], + "uniqueId": "svc_susana.0.1", + "lastUpdateDate": 1436367239625, + "lifecycleState": "NOT_CERTIFIED_CHECKOUT" + } + ] +} diff --git a/catalog-ui/server-mock/mock-data/resource/properties.json b/catalog-ui/server-mock/mock-data/resource/properties.json new file mode 100644 index 0000000000..8ed7e78970 --- /dev/null +++ b/catalog-ui/server-mock/mock-data/resource/properties.json @@ -0,0 +1,35 @@ +[ + { + "uniqueId": "uniqueId_1", + "name": "disk_size", + "type": "integer", + "required": false, + "defaultValue": "10", + "description": "Size of the local disk, in Gigabytes (GB), available to applications running on the Compute node.", + "constraints": [ + { + "inRange": [ + "100" + ] + } + ], + "isPassword": false + }, + { + "uniqueId": "uniqueId_2", + "name": "num_cpus", + "type": "integer", + "required": false, + "defaultValue": "2", + "description": "Number of (actual or virtual) CPUs associated with the Compute node.", + "constraints": [ + { + "inRange": [ + "1", + "4" + ] + } + ], + "isPassword": false + } +] diff --git a/catalog-ui/server-mock/mock-data/resource/resource.json b/catalog-ui/server-mock/mock-data/resource/resource.json new file mode 100644 index 0000000000..bc04f40730 --- /dev/null +++ b/catalog-ui/server-mock/mock-data/resource/resource.json @@ -0,0 +1,153 @@ +{ + "uniqueId": "my-resource.1.0.0", + "isAbstract": false, + "resourceName": "my-resource", + "resourceVersion": "1.0.0", + "isHighestVersion": false, + "vendorName": "vendorName", + "vendorRelease": "vendorRelease", + "contactId": "contactId", + "olderVersions": [ + "bla" + ], + "resourceIconSrc": "images/resource-icons/firewall.png", + "icon":"icon-red2", + "creatorUserId": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "lastUpdaterUserId": "jh000322", + "lastUpdaterFullName": "JHaval Jimmy Hendrix", + "creationDate": 1431525184379, + "lastUpdateDate": 1431525184394, + "description": "Description bla bla", + "tags": [ + "some tag", + "tag2", + "tag3", + "tag4" + ], + "category": "Infrastructure", + "lifecycleState": "CERTIFIED", + "derivedFrom": [ + "template1" + ], + "artifacts": { + "db_content": { + "uniqueId": "my-resource.1.0.0.db_content", + "artifactType": "puppet", + "artifactRef": "http://swift OR CATALOG FE /myfile", + "artifactName": "some Artifact Name1", + "artifactRepository": "SWIFT", + "artifactData": "base 64 dajfvsd fsdfsfs s==", + "artifactChecksum": "base 64 dsdsd==", + "userIdCreator": "jh0003", + "userIdLastUpdater": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "updaterFullName": "Jimmy Hendrix", + "creationDate": 1431525184377, + "lastUpdateDate": 1431525184377 + }, + "db_content_2": { + "uniqueId": "my-resource.1.0.0.db_content_2", + "artifactType": "puppet", + "artifactRef": "http://swift OR CATALOG FE /myfile", + "artifactName": "some Artifact Name2", + "artifactRepository": "SWIFT", + "artifactData": "base 64 dajfvsd fsdfsfs s==", + "artifactChecksum": "base 64 dsdsd==", + "userIdCreator": "jh0003", + "userIdLastUpdater": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "updaterFullName": "Jimmy Hendrix", + "creationDate": 1431525184377, + "lastUpdateDate": 1431525184377 + }, + "db_content_3": { + "uniqueId": "my-resource.1.0.0.db_content_3", + "artifactType": "puppet", + "artifactRef": "http://swift OR CATALOG FE /myfile", + "artifactName": "some Artifact Name3", + "artifactRepository": "SWIFT", + "artifactData": "base 64 dajfvsd fsdfsfs s==", + "artifactChecksum": "base 64 dsdsd==", + "userIdCreator": "jh0003", + "userIdLastUpdater": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "updaterFullName": "Jimmy Hendrix", + "creationDate": 1431525184377, + "lastUpdateDate": 1431525184377 + } + }, + "properties": { + "disk_size": { + "uniqueId": "uniqueId_1", + "type": "integer", + "required": false, + "defaultValue": "10", + "description": "Size of the local disk, in Gigabytes (GB), available to applications running on the Compute node.", + "constraints": [ + { + "inRange": [ + "100" + ] + } + ], + "isPassword": false + }, + "num_cpus": { + "uniqueId": "uniqueId_2", + "type": "integer", + "required": false, + "defaultValue": "2", + "description": "Number of (actual or virtual) CPUs associated with the Compute node.", + "constraints": [ + { + "inRange": [ + "1", + "4" + ] + } + ], + "isPassword": false + } + }, + "attributes": { + "tmp": {} + }, + "interfaces": { + "tmp": { + "operations": {} + } + }, + "capabilities": { + "host": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + } + }, + "requirements": { + "host": { + "uniqueId": "tosca.nodes.SoftwareComponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "requirementImpl": { + "uniqueId": "requirementImpl.my-resource.1.0.host", + "nodeId": "tosca.nodes.Compute.1.0", + "requirementProperties": { + "host": { + "uniqueId": "capabilityInst.requirementImpl.my-resource.1.0.host.host", + "properties": { + "disk_size": "10", + "num_cpus": "2" + } + } + } + } + } + }, + "defaultCapabilities": [ + "defaultCapabilities" + ] +} diff --git a/catalog-ui/server-mock/mock-data/resources/resourcesAbstract.json b/catalog-ui/server-mock/mock-data/resources/resourcesAbstract.json new file mode 100644 index 0000000000..b678ea9b6b --- /dev/null +++ b/catalog-ui/server-mock/mock-data/resources/resourcesAbstract.json @@ -0,0 +1,284 @@ +[ + { + "uniqueId": "tosca.nodes.root.1.0", + "resourceName": "tosca.nodes.root", + "resourceVersion": "1.0", + "creatorUserId": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "lastUpdaterUserId": "jh0003", + "lastUpdaterFullName": "Jimmy Hendrix", + "creationDate": 1433412546396, + "lastUpdateDate": 1433412546396, + "description": "Represents a generic software component that can be managed and run by a Compute Node Type.", + "icon": "icon-red1", + "tags": [ + "Root" + ], + "category": "Abstract", + "lifecycleState": "CERTIFIED", + "vendorName": "ATT (Tosca)", + "vendorRelease": "1.0.0.wd03", + "contactId": "jh0003", + "abstract": true, + "highestVersion": false + }, + { + "uniqueId": "tosca.nodes.softwarecomponent.1.0", + "resourceName": "tosca.nodes.softwarecomponent", + "resourceVersion": "1.0", + "creatorUserId": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "lastUpdaterUserId": "jh0003", + "lastUpdaterFullName": "Jimmy Hendrix", + "creationDate": 1433412547841, + "lastUpdateDate": 1433412547841, + "description": "Represents a generic software component that can be managed and run by a Compute Node Type.", + "icon": "icon-red2", + "tags": [ + "Software Component" + ], + "category": "Abstract", + "lifecycleState": "CERTIFIED", + "derivedFrom": [ + "tosca.nodes.root" + ], + "properties": { + "component_version": { + "uniqueId": "tosca.nodes.softwarecomponent.1.0.component_version", + "type": "version", + "required": false, + "definition": true, + "password": false + }, + "admin_credential": { + "uniqueId": "tosca.nodes.softwarecomponent.1.0.admin_credential", + "type": "tosca.datatypes.Credential", + "required": false, + "definition": true, + "password": false + } + }, + "vendorName": "ATT (Tosca)", + "vendorRelease": "1.0.0.wd03", + "contactId": "jh0003", + "abstract": true, + "highestVersion": false + }, + { + "uniqueId": "tosca.nodes.webserver.1.0", + "resourceName": "tosca.nodes.webserver", + "resourceVersion": "1.0", + "creatorUserId": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "lastUpdaterUserId": "jh0003", + "lastUpdaterFullName": "Jimmy Hendrix", + "creationDate": 1433412548140, + "lastUpdateDate": 1433412548140, + "description": "Represents an abstract software component or service that is capable of hosting and providing management operations for one or more Web Application nodes.", + "icon": "icon-red1", + "tags": [ + "Web Server" + ], + "category": "Abstract", + "lifecycleState": "CERTIFIED", + "derivedFrom": [ + "tosca.nodes.softwarecomponent" + ], + "vendorName": "ATT (Tosca)", + "vendorRelease": "1.0.0.wd03", + "contactId": "jh0003", + "abstract": true, + "highestVersion": false + }, + { + "uniqueId": "tosca.nodes.webapplication.1.0", + "resourceName": "tosca.nodes.webapplication", + "resourceVersion": "1.0", + "creatorUserId": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "lastUpdaterUserId": "jh0003", + "lastUpdaterFullName": "Jimmy Hendrix", + "creationDate": 1433412548382, + "lastUpdateDate": 1433412548382, + "description": "Represents a software application that can be managed and run by a Web Server node. Specific types of web applications such as Java, etc. could be derived from this type.", + "icon": "icon-red3", + "tags": [ + "Web Application" + ], + "category": "Abstract", + "lifecycleState": "CERTIFIED", + "derivedFrom": [ + "tosca.nodes.root" + ], + "properties": { + "context_root": { + "uniqueId": "tosca.nodes.webapplication.1.0.context_root", + "type": "string", + "required": false, + "definition": true, + "password": false + } + }, + "vendorName": "ATT (Tosca)", + "vendorRelease": "1.0.0.wd03", + "contactId": "jh0003", + "abstract": true, + "highestVersion": false + }, + { + "uniqueId": "tosca.nodes.dbms.1.0", + "resourceName": "tosca.nodes.dbms", + "resourceVersion": "1.0", + "creatorUserId": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "lastUpdaterUserId": "jh0003", + "lastUpdaterFullName": "Jimmy Hendrix", + "creationDate": 1433412548607, + "lastUpdateDate": 1433412548607, + "description": "Represents a typical relational, SQL Database Management System software component or service.", + "icon": "icon-red4", + "tags": [ + "DBMS" + ], + "category": "Abstract", + "lifecycleState": "CERTIFIED", + "derivedFrom": [ + "tosca.nodes.softwarecomponent" + ], + "properties": { + "port": { + "uniqueId": "tosca.nodes.dbms.1.0.port", + "type": "integer", + "required": false, + "description": "the port the DBMS service will listen to for data and requests", + "definition": true, + "password": false + }, + "root_password": { + "uniqueId": "tosca.nodes.dbms.1.0.root_password", + "type": "string", + "required": false, + "description": "the optional root password for the DBMS service", + "definition": true, + "password": false + } + }, + "vendorName": "ATT (Tosca)", + "vendorRelease": "1.0.0.wd03", + "contactId": "jh0003", + "abstract": true, + "highestVersion": false + }, + { + "uniqueId": "tosca.nodes.database.1.0", + "resourceName": "tosca.nodes.database", + "resourceVersion": "1.0", + "creatorUserId": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "lastUpdaterUserId": "jh0003", + "lastUpdaterFullName": "Jimmy Hendrix", + "creationDate": 1433412548836, + "lastUpdateDate": 1433412548836, + "description": "Represents a logical database that can be managed and hosted by a DBMS node.", + "icon": "icon-red3", + "tags": [ + "Database" + ], + "category": "Abstract", + "lifecycleState": "CERTIFIED", + "derivedFrom": [ + "tosca.nodes.root" + ], + "properties": { + "port": { + "uniqueId": "tosca.nodes.database.1.0.port", + "type": "integer", + "required": false, + "description": "the port the underlying database service will listen to for data", + "definition": true, + "password": false + }, + "name": { + "uniqueId": "tosca.nodes.database.1.0.name", + "type": "string", + "required": false, + "description": "the logical name of the database", + "definition": true, + "password": false + }, + "user": { + "uniqueId": "tosca.nodes.database.1.0.user", + "type": "string", + "required": false, + "description": "the optional user account name for DB administration", + "definition": true, + "password": false + }, + "password": { + "uniqueId": "tosca.nodes.database.1.0.password", + "type": "string", + "required": false, + "description": "the optional password for the DB user account", + "definition": true, + "password": false + } + }, + "vendorName": "ATT (Tosca)", + "vendorRelease": "1.0.0.wd03", + "contactId": "jh0003", + "abstract": true, + "highestVersion": false + }, + { + "uniqueId": "tosca.nodes.container.runtime.1.0", + "resourceName": "tosca.nodes.container.runtime", + "resourceVersion": "1.0", + "creatorUserId": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "lastUpdaterUserId": "jh0003", + "lastUpdaterFullName": "Jimmy Hendrix", + "creationDate": 1433412549532, + "lastUpdateDate": 1433412549532, + "description": "Represents operating system-level virtualization technology used to run multiple application services on a single Compute host.", + "icon": "icon-red12", + "tags": [ + "Container" + ], + "category": "Abstract", + "lifecycleState": "CERTIFIED", + "derivedFrom": [ + "tosca.nodes.softwarecomponent" + ], + "vendorName": "ATT (Tosca)", + "vendorRelease": "1.0.0.wd03", + "contactId": "jh0003", + "abstract": true, + "highestVersion": false + }, + { + "uniqueId": "tosca.nodes.container.application.1.0", + "resourceName": "tosca.nodes.container.application", + "resourceVersion": "1.0", + "creatorUserId": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "lastUpdaterUserId": "jh0003", + "lastUpdaterFullName": "Jimmy Hendrix", + "creationDate": 1433412549709, + "lastUpdateDate": 1433412549709, + "description": "Represents an application that requires Container-level virtualization technology.", + "icon": "icon-red4", + "tags": [ + "Container Application" + ], + "category": "Abstract", + "lifecycleState": "CERTIFIED", + "derivedFrom": [ + "tosca.nodes.root" + ], + "vendorName": "ATT (Tosca)", + "vendorRelease": "1.0.0.wd03", + "contactId": "jh0003", + "abstract": true, + "highestVersion": false + } +] diff --git a/catalog-ui/server-mock/mock-data/resources/resourcesNotAbstract.json b/catalog-ui/server-mock/mock-data/resources/resourcesNotAbstract.json new file mode 100644 index 0000000000..eab325c9cf --- /dev/null +++ b/catalog-ui/server-mock/mock-data/resources/resourcesNotAbstract.json @@ -0,0 +1,510 @@ +[ + { + "uniqueId": "tosca.nodes.compute.1.0", + "resourceName": "tosca.nodes.compute", + "resourceVersion": "1.0", + "creatorUserId": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "lastUpdaterUserId": "jh0003", + "lastUpdaterFullName": "Jimmy Hendrix", + "creationDate": 1433412547566, + "lastUpdateDate": 1433412547566, + "coordinates": { + "x":150, + "y":250 + }, + "description": "Represents a real or virtual machine or server. Information specified on the Compute\t node will be used to find the machine that fits the given requirements in the cloud\t available machines. If no sizing information are specified the cloud provider default\t machine will be used. It is strongly recommended to specify the required CPUs and memory\t at least.", + "icon": "icon-red2", + "tags": [ + "Compute" + ], + "category": "Infrastructure", + "lifecycleState": "CERTIFIED", + "derivedFrom": [ + "tosca.nodes.root" + ], + "vendorName": "ATT (Tosca)", + "vendorRelease": "1.0.0.wd03", + "contactId": "jh0003", + "abstract": false, + "highestVersion": false, + "capabilities": { + "host": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + }, + "db1": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + }, + "linux1": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + } + }, + "requirements": { + "host": { + "uniqueId": "tosca.nodes.SoftwareComponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "requirementImpl": { + "uniqueId": "requirementImpl.my-resource.1.0.host", + "nodeId": "tosca.nodes.Compute.1.0", + "requirementProperties": { + "host": { + "uniqueId": "capabilityInst.requirementImpl.my-resource.1.0.host.host", + "properties": { + "disk_size": "10", + "num_cpus": "2" + } + } + } + } + } + } + }, + { + "uniqueId": "tosca.nodes.objectstorage.1.0", + "resourceName": "tosca.nodes.objectstorage", + "resourceVersion": "1.0", + "creatorUserId": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "lastUpdaterUserId": "jh0003", + "lastUpdaterFullName": "Jimmy Hendrix", + "creationDate": 1433412549091, + "lastUpdateDate": 1433412549091, + "coordinates": { + "x":150, + "y":250 + }, + "description": "Represents storage that provides the ability to store data as objects (or BLOBs of data) without consideration for the underlying filesystem or devices.", + "icon": "icon-red1", + "tags": [ + "ObjectStorage" + ], + "category": "Infrastructure", + "lifecycleState": "CERTIFIED", + "derivedFrom": [ + "tosca.nodes.root" + ], + "properties": { + "maxsize": { + "uniqueId": "tosca.nodes.objectstorage.1.0.maxsize", + "type": "scalar-unit.size", + "required": false, + "constraints": [ + { + + } + ], + "definition": true, + "password": false + }, + "name": { + "uniqueId": "tosca.nodes.objectstorage.1.0.name", + "type": "string", + "required": false, + "definition": true, + "password": false + }, + "size": { + "uniqueId": "tosca.nodes.objectstorage.1.0.size", + "type": "scalar-unit.size", + "required": false, + "constraints": [ + { + + } + ], + "definition": true, + "password": false + } + }, + "vendorName": "ATT (Tosca)", + "vendorRelease": "1.0.0.wd03", + "contactId": "jh0003", + "abstract": false, + "highestVersion": false, + "capabilities": { + "host2": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + }, + "db": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + }, + "linux2": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + } + }, + "requirements": { + "db": { + "uniqueId": "tosca.nodes.SoftwareComponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "requirementImpl": { + "uniqueId": "requirementImpl.my-resource.1.0.host", + "nodeId": "tosca.nodes.Compute.1.0", + "requirementProperties": { + "host": { + "uniqueId": "capabilityInst.requirementImpl.my-resource.1.0.host.host", + "properties": { + "disk_size": "10", + "num_cpus": "2" + } + } + } + } + } + } + }, + { + "uniqueId": "tosca.nodes.blockstorage.1.0", + "resourceName": "tosca.nodes.blockstorage", + "resourceVersion": "1.0", + "creatorUserId": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "lastUpdaterUserId": "jh0003", + "lastUpdaterFullName": "Jimmy Hendrix", + "creationDate": 1433412549327, + "lastUpdateDate": 1433412549327, + "coordinates": { + "x":150, + "y":250 + }, + "description": "Represents a server-local block storage device (i.e., not shared) offering evenly sized blocks of data from which raw storage volumes can be created.", + "icon": "icon-red3", + "tags": [ + "BlockStorage" + ], + "category": "Infrastructure", + "lifecycleState": "CERTIFIED", + "derivedFrom": [ + "tosca.nodes.root" + ], + "properties": { + "volume_id": { + "uniqueId": "tosca.nodes.blockstorage.1.0.volume_id", + "type": "string", + "required": false, + "definition": true, + "password": false + }, + "snapshot_id": { + "uniqueId": "tosca.nodes.blockstorage.1.0.snapshot_id", + "type": "string", + "required": false, + "definition": true, + "password": false + }, + "size": { + "uniqueId": "tosca.nodes.blockstorage.1.0.size", + "type": "scalar-unit.size", + "required": false, + "constraints": [ + { + + } + ], + "definition": true, + "password": false + } + }, + "vendorName": "ATT (Tosca)", + "vendorRelease": "1.0.0.wd03", + "contactId": "jh0003", + "abstract": false, + "highestVersion": false, + "capabilities": { + "host3": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + }, + "db3": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + }, + "linux": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + } + }, + "requirements": { + "linux": { + "uniqueId": "tosca.nodes.SoftwareComponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "requirementImpl": { + "uniqueId": "requirementImpl.my-resource.1.0.host", + "nodeId": "tosca.nodes.Compute.1.0", + "requirementProperties": { + "host": { + "uniqueId": "capabilityInst.requirementImpl.my-resource.1.0.host.host", + "properties": { + "disk_size": "10", + "num_cpus": "2" + } + } + } + } + } + } + }, + { + "uniqueId": "tosca.nodes.loadbalancer.1.0", + "resourceName": "tosca.nodes.loadbalancer", + "resourceVersion": "1.0", + "creatorUserId": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "lastUpdaterUserId": "jh0003", + "lastUpdaterFullName": "Jimmy Hendrix", + "creationDate": 1433412549878, + "lastUpdateDate": 1433412549878, + "coordinates": { + "x":150, + "y":250 + }, + "description": "Represents logical function that be used in conjunction with a Floating Address to distribute an application’s traffic (load) across a number of instances of the application (e.g., for a clustered or scaled application).", + "icon": "icon-red4", + "tags": [ + "Load Balancer" + ], + "category": "Infrastructure", + "lifecycleState": "CERTIFIED", + "derivedFrom": [ + "tosca.nodes.root" + ], + "properties": { + "algorithm": { + "uniqueId": "tosca.nodes.loadbalancer.1.0.algorithm", + "type": "string", + "required": false, + "definition": true, + "password": false + } + }, + "vendorName": "ATT (Tosca)", + "vendorRelease": "1.0.0.wd03", + "contactId": "jh0003", + "abstract": false, + "highestVersion": false, + "capabilities": { + "host": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + }, + "db4": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + }, + "linux4": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + } + }, + "requirements": { + "linux": { + "uniqueId": "tosca.nodes.SoftwareComponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "requirementImpl": { + "uniqueId": "requirementImpl.my-resource.1.0.host", + "nodeId": "tosca.nodes.Compute.1.0", + "requirementProperties": { + "host": { + "uniqueId": "capabilityInst.requirementImpl.my-resource.1.0.host.host", + "properties": { + "disk_size": "10", + "num_cpus": "2" + } + } + } + } + } + } + }, + { + "uniqueId": "tosca.nodes.titan.1.0", + "resourceName": "tosca.nodes.titan", + "resourceVersion": "1.0", + "creatorUserId": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "lastUpdaterUserId": "jh0003", + "lastUpdaterFullName": "Jimmy Hendrix", + "creationDate": 1433412550046, + "lastUpdateDate": 1433412550046, + "coordinates": { + "x":150, + "y":250 + }, + "description": "Titan is a scalable graph database optimized for storing and querying graphs containing hundreds of billions of vertices and edges distributed across a multi-machine cluster. Titan is a transactional database that can support thousands of concurrent users executing complex graph traversals in real time.", + "icon": "icon-red4", + "tags": [ + "Titan" + ], + "category": "Big Data", + "lifecycleState": "CERTIFIED", + "derivedFrom": [ + "tosca.nodes.root" + ], + "vendorName": "ATT (Tosca)", + "vendorRelease": "1.0.0.wd03", + "contactId": "jh0003", + "abstract": false, + "highestVersion": false, + "capabilities": { + "host5": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + }, + "db": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + }, + "linux5": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + } + }, + "requirements": { + "linux": { + "uniqueId": "tosca.nodes.SoftwareComponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "requirementImpl": { + "uniqueId": "requirementImpl.my-resource.1.0.host", + "nodeId": "tosca.nodes.Compute.1.0", + "requirementProperties": { + "host": { + "uniqueId": "capabilityInst.requirementImpl.my-resource.1.0.host.host", + "properties": { + "disk_size": "10", + "num_cpus": "2" + } + } + } + } + } + } + }, + { + "uniqueId": "tosca.nodes.tas.1.0", + "resourceName": "tosca.nodes.tas", + "resourceVersion": "1.0", + "creatorUserId": "jh0003", + "creatorFullName": "Jimmy Hendrix", + "lastUpdaterUserId": "jh0003", + "lastUpdaterFullName": "Jimmy Hendrix", + "creationDate": 1433412550197, + "lastUpdateDate": 1433412550197, + "coordinates": { + "x":150, + "y":250 + }, + "description": "Telephony application server.", + "icon": "icon-red1", + "tags": [ + "TAS" + ], + "category": "VoIP", + "lifecycleState": "CERTIFIED", + "derivedFrom": [ + "tosca.nodes.root" + ], + "vendorName": "ATT (Tosca)", + "vendorRelease": "1.0.0.wd03", + "contactId": "jh0003", + "abstract": false, + "highestVersion": false, + "capabilities": { + "host": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + }, + "db6": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + }, + "linux6": { + "uniqueId": "capability.tosca.nodes.Compute.1.0.host", + "type": "tosca.capabilities.Container", + "validSourceTypes": [ + "tosca.nodes.SC" + ] + } + }, + "requirements": { + "db": { + "uniqueId": "tosca.nodes.SoftwareComponent.1.0.host", + "capability": "tosca.capabilities.Container", + "node": "tosca.nodes.Compute", + "requirementImpl": { + "uniqueId": "requirementImpl.my-resource.1.0.host", + "nodeId": "tosca.nodes.Compute.1.0", + "requirementProperties": { + "host": { + "uniqueId": "capabilityInst.requirementImpl.my-resource.1.0.host.host", + "properties": { + "disk_size": "10", + "num_cpus": "2" + } + } + } + } + } + } + } +] diff --git a/catalog-ui/server-mock/mock-data/template/template.json b/catalog-ui/server-mock/mock-data/template/template.json new file mode 100644 index 0000000000..2747491c0e --- /dev/null +++ b/catalog-ui/server-mock/mock-data/template/template.json @@ -0,0 +1,37 @@ +[ + { + "uniqueId": "1", + "resourceName": "template1", + "description":"description description description description description " + }, + { + "uniqueId": "2", + "resourceName": "template2", + "description":"description description description description description " + }, + { + "uniqueId": "3", + "resourceName": "template3", + "description":"description description description description description " + }, + { + "uniqueId": "4", + "resourceName": "template4", + "description":"description description description description description " + }, + { + "uniqueId": "5", + "resourceName": "template5", + "description":"description description description description description " + }, + { + "uniqueId": "6", + "resourceName": "template6", + "description":"description description description description description " + }, + { + "uniqueId": "7", + "resourceName": "template7", + "description":"description description description description description " + } + ] diff --git a/catalog-ui/server-mock/mock-data/user/user.json b/catalog-ui/server-mock/mock-data/user/user.json new file mode 100644 index 0000000000..5e793db6c6 --- /dev/null +++ b/catalog-ui/server-mock/mock-data/user/user.json @@ -0,0 +1,7 @@ +{ + "firstName": "James", + "lastName": "Brown", + "userId": "jb1234u", + "email": "jb1234u@sdc.com", + "role": "ADMIN" +} diff --git a/catalog-ui/server-mock/mock-server.js b/catalog-ui/server-mock/mock-server.js new file mode 100644 index 0000000000..6f4c88a62d --- /dev/null +++ b/catalog-ui/server-mock/mock-server.js @@ -0,0 +1,140 @@ +/*- + * ============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========================================================= + */ + +var express = require('express'); +var mockApis = require('../configurations/mock.json').sdcConfig; +//var mockUris = require('../configurations/mock.json'); +var cors = require('cors'); +var multer = require('multer') +var basePathToMockData = './mock-data/'; +var app = express(); + +var allowedHeaders = 'Content-Type,Authorization,If-Modified-Since,'; +allowedHeaders += mockApis.cookie.userIdSuffix; +allowedHeaders += ','+mockApis.cookie.userEmail; +allowedHeaders += ','+mockApis.cookie.userFirstName; +allowedHeaders += ','+mockApis.cookie.userLastName; +allowedHeaders += ','+mockApis.cookie.xEcompRequestId; + + + +app.use(cors({ + // origin: '*', + origin: function(origin, callback) { + callback(null, true); + }, + methods: 'GET, POST, PUT, DELETE', + allowedHeaders: allowedHeaders, + credentials: true +})); + +//set cookie middleware +app.use(function(req, res, next) { + + res.cookie(mockApis.cookie.userIdSuffix, req.headers[mockApis.cookie.userIdSuffix] || mockApis.userTypes.designer.userId ); + res.cookie(mockApis.cookie.userEmail, req.headers[mockApis.cookie.userEmail] || mockApis.userTypes.designer.email); + res.cookie(mockApis.cookie.userFirstName, req.headers[mockApis.cookie.userFirstName] || mockApis.userTypes.designer.firstName); + res.cookie(mockApis.cookie.userLastName, req.headers[mockApis.cookie.userLastName] || mockApis.userTypes.designer.lastName); + res.cookie(mockApis.cookie.xEcompRequestId, req.headers[mockApis.cookie.xEcompRequestId] || mockApis.userTypes.designer.lastName); + next(); +}); + +var userRoutes = require('./routes/user'); +app.use('/v1/user', userRoutes); +var resourceRoutes = require('./routes/resource'); +app.use('/v1/resource', resourceRoutes); +var templateRoutes = require('./routes/template'); +app.use('/v1/template', templateRoutes); +var propertyRoutes = require('./routes/property'); +app.use('/v1/resource/:resourceId/property', propertyRoutes); +var resourcesRoutes = require('./routes/resources'); +app.use('/v1/catalog/resources', resourcesRoutes); + +/******************************************* MOCKS ENPOINTS *************************************************/ +/* get user details */ +// app.get(mockApis.api.GET_user, function (req, res) { +// var user = require(basePathToMockData+'user/user.json'); +// res.send(user); +// }); + +/* get elements */ +app.get(mockApis.api.GET_element, function (req, res) { + + var element = require(basePathToMockData+'element/element.json'); + res.send(element); +}); + +/* get elements */ +app.get(mockApis.api.GET_catalog, function (req, res) { + + var element = require(basePathToMockData+'element/element.json'); + res.send(element); +}); + +/* get categories */ +app.get(mockApis.api.GET_category, function (req, res) { + + var categories = require(basePathToMockData+'category/category.json'); + res.send(categories); +}); + + +/* get categories */ +app.get(mockApis.api.GET_configuration_ui, function (req, res) { + + var categories = require(basePathToMockData+'artifact/artifact-types.json'); + res.send(categories); +}); + + + + + + + + +//upload artifact file +app.use(multer({ dest: './uploads/', + rename: function (fieldname, filename) { + return filename+Date.now(); + }, + onFileUploadStart: function (file) { + console.log(file.originalname + ' is starting ...') + }, + onFileUploadComplete: function (file) { + console.log(file.fieldname + ' uploaded to ' + file.path) + done=true; + } +})); + +var done=false; +app.post(mockApis.api.GET_resource_artifact,function(req,res){ + if(done==true){ + console.log(req.files); + res.end("File uploaded."); + } +}); + + +/**************************************************** *******************************************************/ + +var server = app.listen(9999, function () { + console.log('mock server listening on port %d', server.address().port); +}); diff --git a/catalog-ui/server-mock/routes/property.js b/catalog-ui/server-mock/routes/property.js new file mode 100644 index 0000000000..2756018035 --- /dev/null +++ b/catalog-ui/server-mock/routes/property.js @@ -0,0 +1,45 @@ +/*- + * ============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========================================================= + */ + +var express = require('express'); +var properties = require('../mock-data/resource/properties.json'); + +var router = express.Router(); + +router.get('/', function (req, res) { + console.log('query'); + res.send(properties); +}); + +router.post('/:id', function (req, res) { + console.log("post /:id", req); + res.send(properties[0]); +}); + +router.get('/:id', function (req, res) { + res.send(properties[0]); +}); + + +router.post('/', function (req, res) { + console.log("post ", req); + res.send(properties[0]); +}); +module.exports= router; diff --git a/catalog-ui/server-mock/routes/resource.js b/catalog-ui/server-mock/routes/resource.js new file mode 100644 index 0000000000..f02b6227e8 --- /dev/null +++ b/catalog-ui/server-mock/routes/resource.js @@ -0,0 +1,60 @@ +/*- + * ============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========================================================= + */ + +var express = require('express'); +var resource = require('../mock-data/resource/resource.json'); + +var router = express.Router(); + +router.get('/', function (req, res) { + console.log('query'); + res.send([resource]); +}); + +router.post('/:id', function (req, res) { + console.log("post /:id"); + res.send(resource); +}); + +router.get('/:id', function (req, res) { + console.log("post "); + res.send(resource); +}); + + +router.post('/', function (req, res) { + console.log("post "); + res.send(resource); +}); + +router.get('/validate-name/:name', function (req, res) { + + var name = req.params.name; + var response = {'isValid':true}; + if (name==='exist'){ + response = {'isValid':false}; + } + res.send(response); + +}); + + + +module.exports= router; diff --git a/catalog-ui/server-mock/routes/resources.js b/catalog-ui/server-mock/routes/resources.js new file mode 100644 index 0000000000..589848981c --- /dev/null +++ b/catalog-ui/server-mock/routes/resources.js @@ -0,0 +1,38 @@ +/*- + * ============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========================================================= + */ + +var express = require('express'); +var resourcesNotAbstract = require('../mock-data/resources/resourcesNotAbstract.json'); +var resourcesAbstract = require('../mock-data/resources/resourcesAbstract.json'); + +var router = express.Router(); + +router.get('/certified/notabstract', function (req, res) { + res.send(resourcesNotAbstract); +}); + + +router.get('/certified/abstract', function (req, res) { + res.send(resourcesAbstract); +}); + + + +module.exports= router; diff --git a/catalog-ui/server-mock/routes/template.js b/catalog-ui/server-mock/routes/template.js new file mode 100644 index 0000000000..3b7653967e --- /dev/null +++ b/catalog-ui/server-mock/routes/template.js @@ -0,0 +1,45 @@ +/*- + * ============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========================================================= + */ + +var express = require('express'); +var templates = require('../mock-data/template/template.json'); + +var router = express.Router(); + +router.get('/', function (req, res) { + console.log('query'); + res.send(templates); +}); + +router.post('/:id', function (req, res) { + console.log("post /:id", req); + res.send(templates[0]); +}); + +router.get('/:id', function (req, res) { + res.send(templates[0]); +}); + + +router.post('/', function (req, res) { + console.log("post ", req); + res.send(templates[0]); +}); +module.exports= router; diff --git a/catalog-ui/server-mock/routes/user.js b/catalog-ui/server-mock/routes/user.js new file mode 100644 index 0000000000..d01f4397e9 --- /dev/null +++ b/catalog-ui/server-mock/routes/user.js @@ -0,0 +1,45 @@ +/*- + * ============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========================================================= + */ + +var express = require('express'); +var user = require('../mock-data/user/user.json'); + +var router = express.Router(); + +router.get('/', function (req, res) { + console.log('query'); + res.send([user]); +}); + +router.post('/:id', function (req, res) { + console.log("post /:id", req); + res.send(user); +}); + +router.get('/:id', function (req, res) { + res.send(user); +}); + + +router.post('/', function (req, res) { + console.log("post ", req); + res.send(user); +}); +module.exports= router; diff --git a/catalog-ui/tests/karma.unit.conf.js b/catalog-ui/tests/karma.unit.conf.js new file mode 100644 index 0000000000..1b8277faed --- /dev/null +++ b/catalog-ui/tests/karma.unit.conf.js @@ -0,0 +1,149 @@ +// Karma configuration + +module.exports = function (config) { + config.set({ + + // base path, that will be used to resolve files and exclude + basePath: '../', + + + // frameworks to use + frameworks: ['jasmine'], + + // list of files / patterns to load in the browser + files: [ + 'bower_components/jquery/dist/jquery.js', + 'bower_components/angular/angular.js', + 'bower_components/angular-base64/angular-base64.js', + 'bower_components/angular-base64-upload/src/angular-base64-upload.js', + 'bower_components/angular-bootstrap/ui-bootstrap-tpls.js', + 'bower_components/jquery-ui/jquery-ui.js', + 'bower_components/angular-dragdrop/src/angular-dragdrop.js', + 'bower_components/angular-filter/dist/angular-filter.min.js', + 'bower_components/angular-md5/angular-md5.js', + 'bower_components/perfect-scrollbar/src/perfect-scrollbar.js', + 'bower_components/angular-perfect-scrollbar/src/angular-perfect-scrollbar.js', + 'bower_components/angular-mocks/angular-mocks.js', + 'bower_components/angular-resource/angular-resource.js', + 'bower_components/angular-sanitize/angular-sanitize.js', + 'bower_components/angular-tooltips/dist/angular-tooltips.min.js', + 'bower_components/angular-translate/angular-translate.js', + 'bower_components/angular-translate-loader-static-files/angular-translate-loader-static-files.js', + 'bower_components/angular-ui-router/release/angular-ui-router.js', + 'bower_components/angular-uuid4/angular-uuid4.js', + 'bower_components/bootstrap/dist/js/bootstrap.js', + 'bower_components/checklist-model/checklist-model.js', + 'bower_components/angular-clipboard/angular-clipboard.js', + 'bower_components/angular-resizable/src/angular-resizable.js', + 'bower_components/angular-ui-notification/src/angular-ui-notification.js', + 'bower_components/lodash/lodash.js', + 'bower_components/restangular/dist/restangular.js', + 'bower_components/jspdf/dist/jspdf.min.js', + 'app/scripts/utils/**/*.js', + 'app/scripts/services/**/*.js', + 'app/scripts/models/**/*.js', + 'app/scripts/view-models/**/*.js', + 'app/scripts/filters/**/*.js', + 'app/scripts/directives/**/*.js', + 'app/scripts/modules/**/*.js', + + 'app/scripts/app.js', + 'app/languages/**/*.js', + + 'app/scripts/templates.js', + + + + + + //'app/scripts/view-models/dashboard/dashboard-view-model-tests.js', + + + 'app/scripts/**/*-tests.js', + //'app/scripts/app.js', + + + //definition to allow to debug TS tests file in browser + {pattern: 'app/scripts/**/*-tests.ts', included: false}, + {pattern: 'app/scripts/**/*-tests.js.map', included: false}, + + + //definition to allow to debug TS sources files in browser + {pattern: 'app/scripts/**/*.ts', included: false}, + {pattern: 'app/scripts/**/*.js.map', included: false} + + ], + + // list of files to exclude + exclude: [ + + ], + + junitReporter: { + outputFile: 'tests/testOutput.xml', + suite: '' + }, + + //NOTE: This is handled from gruntfile.js + coverageReporter : { + type : 'html', + dir: 'tests/Coverage' + }, + // test results reporter to use + // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage' + reporters: [ + 'mocha',//uncomment this line if you need to debug your unit test and print out the 'describe' of the test + 'junit', + 'dots', + 'progress', + 'coverage' + ], + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + // logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + preprocessors: { + '**/*.html': 'html2js', + 'app/scripts/**/!(*-tests|*Tests|*Test).js': 'coverage' + }, + + //ngHtml2JsPreprocessor: { + // stripPrefix: 'client/' + //}, + + // Start these browsers, currently available: + // - Chrome + // - ChromeCanary + // - Firefox + // - Opera (has to be installed with `npm install karma-opera-launcher`) + // - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`) + // - PhantomJS + // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`) + + //NOTE: This is handled from gruntfile.js + + browsers: ['Chrome'], + + + // If browser does not capture in given timeout [ms], kill it + captureTimeout: 60000, + + + // Continuous Integration mode + // if true, it capture browsers, run tests and exit + singleRun: false + }); +}; diff --git a/catalog-ui/tsd.json b/catalog-ui/tsd.json new file mode 100644 index 0000000000..1f8ffec3cb --- /dev/null +++ b/catalog-ui/tsd.json @@ -0,0 +1,15 @@ +{ + "version": "v4", + "repo": "borisyankov/DefinitelyTyped", + "ref": "master", + "path": "typings", + "bundle": "typings/tsd.d.ts", + "installed": { + "notifyjs/notifyjs.d.ts": { + "commit": "581563c4684d405afec14260ba79a89a52666c09" + }, + "jasmine/jasmine.d.ts": { + "commit": "14ab703f435375194360cdba3abab61afc879c18" + } + } +} diff --git a/catalog-ui/tslint.json b/catalog-ui/tslint.json new file mode 100644 index 0000000000..2cd2dece6f --- /dev/null +++ b/catalog-ui/tslint.json @@ -0,0 +1,58 @@ +{ + "rules": { + "class-name": true, + "comment-format": [ + false, + "check-space" + ], + "indent": [ + true, + "spaces" + ], + "no-duplicate-variable": true, + "no-eval": true, + "no-internal-module": true, + "no-trailing-whitespace": true, + "no-unsafe-finally": true, + "no-var-keyword": true, + "one-line": [ + true, + "check-open-brace", + "check-whitespace" + ], + "quotemark": [ + false, + "single" + ], + "semicolon": [ + true, + "always" + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "variable-name": [ + true, + "ban-keywords" + ], + "whitespace": [ + false, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ] + } +} \ No newline at end of file diff --git a/catalog-ui/typings/angular-ui-bootstrap/angular-ui-bootstrap.d.ts b/catalog-ui/typings/angular-ui-bootstrap/angular-ui-bootstrap.d.ts new file mode 100644 index 0000000000..4062f141f1 --- /dev/null +++ b/catalog-ui/typings/angular-ui-bootstrap/angular-ui-bootstrap.d.ts @@ -0,0 +1,658 @@ +/*- + * ============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========================================================= + */ +// Type definitions for Angular UI Bootstrap 0.11.0 +// Project: https://github.com/angular-ui/bootstrap +// Definitions by: Brian Surowiec +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module angular.ui.bootstrap { + + interface IAccordionConfig { + /** + * Controls whether expanding an item will cause the other items to close. + * + * @default true + */ + closeOthers?: boolean; + } + + + interface IButtonConfig { + /** + * @default: 'active' + */ + activeClass?: string; + + /** + * @default: 'Click' + */ + toggleEvent?: string; + } + + + interface IDatepickerConfig { + /** + * Format of day in month. + * + * @default 'dd' + */ + dayFormat?: string; + + /** + * Format of month in year. + * + * @default 'MMM' + */ + monthFormat?: string; + + /** + * Format of year in year range. + * + * @default 'yyyy' + */ + yearFormat?: string; + + /** + * Format of day in week header. + * + * @default 'EEE' + */ + dayHeaderFormat?: string; + + /** + * Format of title when selecting day. + * + * @default 'MMM yyyy' + */ + dayTitleFormat?: string; + + /** + * Format of title when selecting month. + * + * @default 'yyyy' + */ + monthTitleFormat?: string; + + /** + * Whether to display week numbers. + * + * @default true + */ + showWeeks?: boolean; + + /** + * Starting day of the week from 0-6 where 0=Sunday and 6=Saturday. + * + * @default 0 + */ + startingDay?: number; + + /** + * Number of years displayed in year selection. + * + * @default 20 + */ + yearRange?: number; + + /** + * Defines the minimum available date. + * + * @default null + */ + minDate?: any; + + /** + * Defines the maximum available date. + * + * @default null + */ + maxDate?: any; + } + + interface IDatepickerPopupConfig { + /** + * The format for displayed dates. + * + * @default 'yyyy-MM-dd' + */ + dateFormat?: string; + + /** + * The text to display for the current day button. + * + * @default 'Today' + */ + currentText?: string; + + /** + * The text to display for the toggling week numbers button. + * + * @default 'Weeks' + */ + toggleWeeksText?: string; + + /** + * The text to display for the clear button. + * + * @default 'Clear' + */ + clearText?: string; + + /** + * The text to display for the close button. + * + * @default 'Done' + */ + closeText?: string; + + /** + * Whether to close calendar when a date is chosen. + * + * @default true + */ + closeOnDateSelection?: boolean; + + /** + * Append the datepicker popup element to `body`, rather than inserting after `datepicker-popup`. + * + * @default false + */ + appendToBody?: boolean; + + /** + * Whether to display a button bar underneath the datepicker. + * + * @default true + */ + showButtonBar?: boolean; + } + + + interface IModalService { + /** + * @param {IModalSettings} options + * @returns {IModalServiceInstance} + */ + open(options: IModalSettings): IModalServiceInstance; + } + + interface IModalServiceInstance { + /** + * a method that can be used to close a modal, passing a result + */ + close(result?: any): void; + + /** + * a method that can be used to dismiss a modal, passing a reason + */ + dismiss(reason?: any): void; + + /** + * a promise that is resolved when a modal is closed and rejected when a modal is dismissed + */ + result: angular.IPromise; + + /** + * a promise that is resolved when a modal gets opened after downloading content's template and resolving all variables + */ + opened: angular.IPromise; + } + + interface IModalScope extends angular.IScope { + /** + * Those methods make it easy to close a modal window without a need to create a dedicated controller + */ + + /** + * Dismiss the dialog without assigning a value to the promise output + */ + $dismiss(reason?: any): void; + + /** + * Close the dialog resolving the promise to the given value + */ + $close(result?: any): void; + } + + interface IModalSettings { + /** + * a path to a template representing modal's content + */ + templateUrl?: string; + + /** + * inline template representing the modal's content + */ + template?: string; + + /** + * a scope instance to be used for the modal's content (actually the $modal service is going to create a child scope of a provided scope). + * Defaults to `$rootScope`. + */ + scope?: angular.IScope|IModalScope; + + /** + * a controller for a modal instance - it can initialize scope used by modal. + * A controller can be injected with `$modalInstance` + */ + controller?: any; + + /** + * an alternative to the controller-as syntax, matching the API of directive definitions. + * Requires the controller option to be provided as well + */ + controllerAs?: string; + + /** + * members that will be resolved and passed to the controller as locals; it is equivalent of the `resolve` property for AngularJS routes + */ + resolve?: any; + + /** + * controls the presence of a backdrop + * Allowed values: + * - true (default) + * - false (no backdrop) + * - 'static' backdrop is present but modal window is not closed when clicking outside of the modal window + * + * @default true + */ + backdrop?: any; + + /** + * indicates whether the dialog should be closable by hitting the ESC key, defaults to true + */ + keyboard?: boolean; + + /** + * additional CSS class(es) to be added to a modal window template + */ + windowClass?: string; + + /** + * optional size of modal window. Allowed values: 'sm' (small) or 'lg' (large). Requires Bootstrap 3.1.0 or later + */ + size?: string; + + /** + * a path to a template overriding modal's window template + */ + windowTemplateUrl?: string; + } + + interface IModalStackService { + /** + * Opens a new modal instance. + */ + open(modalInstance: IModalServiceInstance, modal: any): void; + + /** + * Closes a modal instance with an optional result. + */ + close(modalInstance: IModalServiceInstance, result?: any): void; + + /** + * Dismisses a modal instance with an optional reason. + */ + dismiss(modalInstance: IModalServiceInstance, reason?: any): void; + + /** + * Dismiss all open modal instances with an optional reason that will be passed to each instance. + */ + dismissAll(reason?: any): void; + + /** + * Gets the topmost modal instance that is open. + */ + getTop(): IModalStackedMapKeyValuePair; + } + + interface IModalStackedMapKeyValuePair { + key: IModalServiceInstance; + value: any; + } + + + interface IPaginationConfig { + /** + * Current page number. First page is 1. + */ + page?: number; + + /** + * Total number of items in all pages. + */ + totalItems?: number; + + /** + * Maximum number of items per page. A value less than one indicates all items on one page. + * + * @default 10 + */ + itemsPerPage?: number; + + /** + * Limit number for pagination size. + * + * @default: null + */ + maxSize?: number; + + /** + * An optional expression assigned the total number of pages to display. + * + * @default angular.noop + */ + numPages?: number; + + /** + * Whether to keep current page in the middle of the visible ones. + * + * @default true + */ + rotate?: boolean; + + /** + * An optional expression called when a page is selected having the page number as argument. + * + * @default null + */ + onSelectPage?(page: number): void; + + /** + * Whether to display Previous / Next buttons. + * + * @default true + */ + directionLinks?: boolean; + + /** + * Text for Previous button. + * + * @default 'Previous' + */ + previousText?: string; + + /** + * Text for Next button. + * + * @default 'Next' + */ + nextText?: string; + + /** + * Whether to display First / Last buttons. + * + * @default false + */ + boundaryLinks?: boolean; + + /** + * Text for First button. + * + * @default 'First' + */ + firstText?: string; + + /** + * Text for Last button. + * + * @default 'Last' + */ + lastText?: string; + } + + interface IPagerConfig { + /** + * Whether to align each link to the sides. + * + * @default true + */ + align?: boolean; + + /** + * Current page number. First page is 1. + */ + page?: number; + + /** + * Total number of items in all pages. + */ + totalItems?: number; + + /** + * Maximum number of items per page. A value less than one indicates all items on one page. + * + * @default 10 + */ + itemsPerPage?: number; + + /** + * An optional expression assigned the total number of pages to display. + * + * @default angular.noop + */ + numPages?: number; + + /** + * An optional expression called when a page is selected having the page number as argument. + * + * @default null + */ + onSelectPage?(page: number): void; + + /** + * Text for Previous button. + * + * @default '« Previous' + */ + previousText?: string; + + /** + * Text for Next button. + * + * @default 'Next »' + */ + nextText?: string; + } + + + interface IPositionCoordinates { + width?: number; + height?: number; + top?: number; + left?: number; + } + + interface IPositionService { + /** + * Provides a read-only equivalent of jQuery's position function. + */ + position(element: JQuery): IPositionCoordinates; + + /** + * Provides a read-only equivalent of jQuery's offset function. + */ + offset(element: JQuery): IPositionCoordinates; + } + + + interface IProgressConfig { + /** + * Whether bars use transitions to achieve the width change. + * + * @default: true + */ + animate?: boolean; + + /** + * A number that specifies the total value of bars that is required. + * + * @default: 100 + */ + max?: number; + } + + + interface IRatingConfig { + /** + * Changes the number of icons. + * + * @default: 5 + */ + max?: number; + + /** + * A variable used in the template to specify the state for selected icons. + * + * @default: null + */ + stateOn?: string; + + /** + * A variable used in the template to specify the state for unselected icons. + * + * @default: null + */ + stateOff?: string; + } + + + interface ITimepickerConfig { + /** + * Number of hours to increase or decrease when using a button. + * + * @default 1 + */ + hourStep?: number; + + /** + * Number of minutes to increase or decrease when using a button. + * + * @default 1 + */ + minuteStep?: number; + + /** + * Whether to display 12H or 24H mode. + * + * @default true + */ + showMeridian?: boolean; + + /** + * Meridian labels based on locale. To override you must supply an array like ['AM', 'PM']. + * + * @default null + */ + meridians?: Array; + + /** + * Whether the user can type inside the hours & minutes input. + * + * @default false + */ + readonlyInput?: boolean; + + /** + * Whether the user can scroll inside the hours & minutes input to increase or decrease it's values. + * + * @default true + */ + mousewheel?: boolean; + } + + + interface ITooltipOptions { + /** + * Where to place it? Defaults to 'top', but also accepts 'right', 'bottom', or 'left'. + * + * @default 'top' + */ + placement?: string; + + /** + * Should it fade in and out? + * + * @default true + */ + animation?: boolean; + + /** + * For how long should the user have to have the mouse over the element before the tooltip shows (in milliseconds)? + * + * @default 0 + */ + popupDelay?: number; + + /** + * Should the tooltip be appended to `$body` instead of the parent element? + * + * @default false + */ + appendtoBody?: boolean; + } + + interface ITooltipProvider { + /** + * Provide a set of defaults for certain tooltip and popover attributes. + */ + options(value: ITooltipOptions): void; + + /** + * Extends the default trigger mappings with mappings of your own. E.g. `{ 'openTrigger': 'closeTrigger' }`. + */ + setTriggers(triggers: Object): void; + } + + + interface ITransitionService { + /** + * The browser specific animation event name. + */ + animationEndEventName: string; + + /** + * The browser specific transition event name. + */ + transitionEndEventName: string; + + /** + * Provides a consistent interface to trigger CSS 3 transitions and to be informed when they complete. + * + * @param element The DOMElement that will be animated + * @param trigger The thing that will cause the transition to start: + * - As a string, it represents the css class to be added to the element. + * - As an object, it represents a hash of style attributes to be applied to the element. + * - As a function, it represents a function to be called that will cause the transition to occur. + * @param options Optional settings for the transition. + * + * @return A promise that is resolved when the transition finishes. + */ + (element: angular.IAugmentedJQuery, trigger: any, options?: ITransitionServiceOptions): angular.IPromise; + } + + interface ITransitionServiceOptions { + animation?: boolean; + } + +} diff --git a/catalog-ui/typings/angular-ui-router/angular-ui-router.d.ts b/catalog-ui/typings/angular-ui-router/angular-ui-router.d.ts new file mode 100644 index 0000000000..c27425e39c --- /dev/null +++ b/catalog-ui/typings/angular-ui-router/angular-ui-router.d.ts @@ -0,0 +1,207 @@ +/*- + * ============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========================================================= + */ +// Type definitions for Angular JS 1.1.5+ (ui.router module) +// Project: https://github.com/angular-ui/ui-router +// Definitions by: Michel Salib +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module angular.ui { + + interface IState { + name?: string; + /** + * String HTML content, or function that returns an HTML string + */ + template?: string | {(): string}; + /** + * String URL path to template file OR Function, returns URL path string + */ + templateUrl?: string | {(): string}; + /** + * Function, returns HTML content string + */ + templateProvider?: Function; + /** + * A controller paired to the state. Function OR name as String + */ + controller?: Function | string; + controllerAs?: string; + /** + * Function (injectable), returns the actual controller function or string. + */ + controllerProvider?: Function; + resolve?: {}; + /** + * A url with optional parameters. When a state is navigated or transitioned to, the $stateParams service will be populated with any parameters that were passed. + */ + url?: string; + /** + * A map which optionally configures parameters declared in the url, or defines additional non-url parameters. Only use this within a state if you are not using url. Otherwise you can specify your parameters within the url. When a state is navigated or transitioned to, the $stateParams service will be populated with any parameters that were passed. + */ + params?: any; + /** + * Use the views property to set up multiple views. If you don't need multiple views within a single state this property is not needed. Tip: remember that often nested views are more useful and powerful than multiple sibling views. + */ + views?: {}; + abstract?: boolean; + /** + * Callback function for when a state is entered. Good way to trigger an action or dispatch an event, such as opening a dialog. + * If minifying your scripts, make sure to explictly annotate this function, because it won't be automatically annotated by your build tools. + */ + onEnter?: Function|(string|Function)[]; + /** + * Callback functions for when a state is entered and exited. Good way to trigger an action or dispatch an event, such as opening a dialog. + * If minifying your scripts, make sure to explictly annotate this function, because it won't be automatically annotated by your build tools. + */ + onExit?: Function|(string|Function)[]; + /** + * Arbitrary data object, useful for custom configuration. + */ + data?: any; + /** + * Boolean (default true). If false will not retrigger the same state just because a search/query parameter has changed. Useful for when you'd like to modify $location.search() without triggering a reload. + */ + reloadOnSearch?: boolean; + } + + interface IStateProvider extends ng.IServiceProvider { + state(name:string, config:IState): IStateProvider; + state(config:IState): IStateProvider; + decorator(name?: string, decorator?: (state: IState, parent: Function) => any): any; + } + + interface IUrlMatcher { + concat(pattern: string): IUrlMatcher; + exec(path: string, searchParams: {}): {}; + parameters(): string[]; + format(values: {}): string; + } + + interface IUrlMatcherFactory { + compile(pattern: string): IUrlMatcher; + isMatcher(o: any): boolean; + type(name: string, definition: any, definitionFn?: any): any; + } + + interface IUrlRouterProvider extends ng.IServiceProvider { + when(whenPath: RegExp, handler: Function): IUrlRouterProvider; + when(whenPath: RegExp, handler: any[]): IUrlRouterProvider; + when(whenPath: RegExp, toPath: string): IUrlRouterProvider; + when(whenPath: IUrlMatcher, hanlder: Function): IUrlRouterProvider; + when(whenPath: IUrlMatcher, handler: any[]): IUrlRouterProvider; + when(whenPath: IUrlMatcher, toPath: string): IUrlRouterProvider; + when(whenPath: string, handler: Function): IUrlRouterProvider; + when(whenPath: string, handler: any[]): IUrlRouterProvider; + when(whenPath: string, toPath: string): IUrlRouterProvider; + otherwise(handler: Function): IUrlRouterProvider; + otherwise(handler: any[]): IUrlRouterProvider; + otherwise(path: string): IUrlRouterProvider; + rule(handler: Function): IUrlRouterProvider; + rule(handler: any[]): IUrlRouterProvider; + } + + interface IStateOptions { + /** + * {boolean=true|string=} - If true will update the url in the location bar, if false will not. If string, must be "replace", which will update url and also replace last history record. + */ + location?: boolean | string; + /** + * {boolean=true}, If true will inherit url parameters from current url. + */ + inherit?: boolean; + /** + * {object=$state.$current}, When transitioning with relative path (e.g '^'), defines which state to be relative from. + */ + relative?: IState; + /** + * {boolean=true}, If true will broadcast $stateChangeStart and $stateChangeSuccess events. + */ + notify?: boolean; + /** + * {boolean=false}, If true will force transition even if the state or params have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd use this when you want to force a reload when everything is the same, including search params. + */ + reload?: boolean; + } + + interface IHrefOptions { + lossy?: boolean; + inherit?: boolean; + relative?: IState; + absolute?: boolean; + } + + interface IStateService { + /** + * Convenience method for transitioning to a new state. $state.go calls $state.transitionTo internally but automatically sets options to { location: true, inherit: true, relative: $state.$current, notify: true }. This allows you to easily use an absolute or relative to path and specify only the parameters you'd like to update (while letting unspecified parameters inherit from the currently active ancestor states). + * + * @param to Absolute state name or relative state path. Some examples: + * + * $state.go('contact.detail') - will go to the contact.detail state + * $state.go('^') - will go to a parent state + * $state.go('^.sibling') - will go to a sibling state + * $state.go('.child.grandchild') - will go to grandchild state + * + * @param params A map of the parameters that will be sent to the state, will populate $stateParams. Any parameters that are not specified will be inherited from currently defined parameters. This allows, for example, going to a sibling state that shares parameters specified in a parent state. Parameter inheritance only works between common ancestor states, I.e. transitioning to a sibling will get you the parameters for all parents, transitioning to a child will get you all current parameters, etc. + * + * @param options Options object. + */ + go(to: string, params?: {}, options?: IStateOptions): ng.IPromise; + transitionTo(state: string, params?: {}, updateLocation?: boolean): void; + transitionTo(state: string, params?: {}, options?: IStateOptions): void; + includes(state: string, params?: {}): boolean; + is(state:string, params?: {}): boolean; + is(state: IState, params?: {}): boolean; + href(state: IState, params?: {}, options?: IHrefOptions): string; + href(state: string, params?: {}, options?: IHrefOptions): string; + get(state: string): IState; + get(): IState[]; + current: IState; + params: IStateParamsService; + reload(): void; + } + + interface IStateParamsService { + [key: string]: any; + } + + interface IUrlRouterService { + /* + * Triggers an update; the same update that happens when the address bar + * url changes, aka $locationChangeSuccess. + * + * This method is useful when you need to use preventDefault() on the + * $locationChangeSuccess event, perform some custom logic (route protection, + * auth, config, redirection, etc) and then finally proceed with the transition + * by calling $urlRouter.sync(). + * + */ + sync(): void; + } + + interface IUiViewScrollProvider { + /* + * Reverts back to using the core $anchorScroll service for scrolling + * based on the url anchor. + */ + useAnchorScroll(): void; + } +} diff --git a/catalog-ui/typings/angularjs/angular-mocks.d.ts b/catalog-ui/typings/angularjs/angular-mocks.d.ts new file mode 100644 index 0000000000..65b0ac1a09 --- /dev/null +++ b/catalog-ui/typings/angularjs/angular-mocks.d.ts @@ -0,0 +1,337 @@ +/*- + * ============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========================================================= + */ +// Type definitions for Angular JS 1.3 (ngMock, ngMockE2E module) +// Project: http://angularjs.org +// Definitions by: Diego Vilar , Tony Curtis +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "angular-mocks/ngMock" { + var _: string; + export = _; +} + +declare module "angular-mocks/ngMockE2E" { + var _: string; + export = _; +} + +declare module "angular-mocks/ngAnimateMock" { + var _: string; + export = _; +} + +/////////////////////////////////////////////////////////////////////////////// +// ngMock module (angular-mocks.js) +/////////////////////////////////////////////////////////////////////////////// +declare module angular { + + /////////////////////////////////////////////////////////////////////////// + // AngularStatic + // We reopen it to add the MockStatic definition + /////////////////////////////////////////////////////////////////////////// + interface IAngularStatic { + mock: IMockStatic; + } + + // see https://docs.angularjs.org/api/ngMock/function/angular.mock.inject + interface IInjectStatic { + (...fns: Function[]): any; + (...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works + strictDi(val?: boolean): void; + } + + interface IMockStatic { + // see https://docs.angularjs.org/api/ngMock/function/angular.mock.dump + dump(obj: any): string; + + inject: IInjectStatic + + // see https://docs.angularjs.org/api/ngMock/function/angular.mock.module + module(...modules: any[]): any; + + // see https://docs.angularjs.org/api/ngMock/type/angular.mock.TzDate + TzDate(offset: number, timestamp: number): Date; + TzDate(offset: number, timestamp: string): Date; + } + + /////////////////////////////////////////////////////////////////////////// + // ExceptionHandlerService + // see https://docs.angularjs.org/api/ngMock/service/$exceptionHandler + // see https://docs.angularjs.org/api/ngMock/provider/$exceptionHandlerProvider + /////////////////////////////////////////////////////////////////////////// + interface IExceptionHandlerProvider extends IServiceProvider { + mode(mode: string): void; + } + + /////////////////////////////////////////////////////////////////////////// + // TimeoutService + // see https://docs.angularjs.org/api/ngMock/service/$timeout + // Augments the original service + /////////////////////////////////////////////////////////////////////////// + interface ITimeoutService { + flush(delay?: number): void; + flushNext(expectedDelay?: number): void; + verifyNoPendingTasks(): void; + } + + /////////////////////////////////////////////////////////////////////////// + // IntervalService + // see https://docs.angularjs.org/api/ngMock/service/$interval + // Augments the original service + /////////////////////////////////////////////////////////////////////////// + interface IIntervalService { + flush(millis?: number): number; + } + + /////////////////////////////////////////////////////////////////////////// + // LogService + // see https://docs.angularjs.org/api/ngMock/service/$log + // Augments the original service + /////////////////////////////////////////////////////////////////////////// + interface ILogService { + assertEmpty(): void; + reset(): void; + } + + interface ILogCall { + logs: string[]; + } + + /////////////////////////////////////////////////////////////////////////// + // HttpBackendService + // see https://docs.angularjs.org/api/ngMock/service/$httpBackend + /////////////////////////////////////////////////////////////////////////// + interface IHttpBackendService { + /** + * Flushes all pending requests using the trained responses. + * @param count Number of responses to flush (in the order they arrived). If undefined, all pending requests will be flushed. + */ + flush(count?: number): void; + + /** + * Resets all request expectations, but preserves all backend definitions. + */ + resetExpectations(): void; + + /** + * Verifies that all of the requests defined via the expect api were made. If any of the requests were not made, verifyNoOutstandingExpectation throws an exception. + */ + verifyNoOutstandingExpectation(): void; + + /** + * Verifies that there are no outstanding requests that need to be flushed. + */ + verifyNoOutstandingRequest(): void; + + /** + * Creates a new request expectation. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param method HTTP method. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + expect(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)) :mock.IRequestHandler; + + /** + * Creates a new request expectation for DELETE requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url is as expected. + * @param headers HTTP headers object to be compared with the HTTP headers in the request. + */ + expectDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler; + + /** + * Creates a new request expectation for GET requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object to be compared with the HTTP headers in the request. + */ + expectGET(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler; + + /** + * Creates a new request expectation for HEAD requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object to be compared with the HTTP headers in the request. + */ + expectHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object): mock.IRequestHandler; + + /** + * Creates a new request expectation for JSONP requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + */ + expectJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler; + + /** + * Creates a new request expectation for PATCH requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + expectPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler; + + /** + * Creates a new request expectation for POST requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + expectPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler; + + /** + * Creates a new request expectation for PUT requests. + * Throws a preformatted error if expectation(s) don't match supplied string, regular expression, object, or if function returns false. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + expectPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object): mock.IRequestHandler; + + /** + * Creates a new backend definition. + * Returns an object with respond method that controls how a matched request is handled. + * @param method HTTP method. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + when(method: string, url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + + /** + * Creates a new backend definition for DELETE requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + whenDELETE(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + + /** + * Creates a new backend definition for GET requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + whenGET(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + + /** + * Creates a new backend definition for HEAD requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + whenHEAD(url: string | RegExp | ((url: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + + /** + * Creates a new backend definition for JSONP requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + whenJSONP(url: string | RegExp | ((url: string) => boolean)): mock.IRequestHandler; + + /** + * Creates a new backend definition for PATCH requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + whenPATCH(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + + /** + * Creates a new backend definition for POST requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + whenPOST(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + + /** + * Creates a new backend definition for PUT requests. + * Returns an object with respond method that controls how a matched request is handled. + * @param url HTTP url string, regular expression or function that receives a url and returns true if the url matches the current expctation. + * @param data HTTP request body string, json object, regular expression or function that receives the data and returns true if the data matches the current expectation. + * @param headers HTTP headers object or function that receives the headers and returns true if the headers match the current expectation. + */ + whenPUT(url: string | RegExp | ((url: string) => boolean), data?: string | RegExp | Object | ((data: string) => boolean), headers?: Object | ((object: Object) => boolean)): mock.IRequestHandler; + } + + export module mock { + // returned interface by the the mocked HttpBackendService expect/when methods + interface IRequestHandler { + + /** + * Controls the response for a matched request using a function to construct the response. + * Returns the RequestHandler object for possible overrides. + * @param func Function that receives the request HTTP method, url, data, and headers and returns an array containing response status (number), data, headers, and status text. + */ + respond(func: ((method: string, url: string, data: string | Object, headers: Object) => [number, string | Object, Object, string])): IRequestHandler; + + /** + * Controls the response for a matched request using supplied static data to construct the response. + * Returns the RequestHandler object for possible overrides. + * @param status HTTP status code to add to the response. + * @param data Data to add to the response. + * @param headers Headers object to add to the response. + * @param responseText Response text to add to the response. + */ + respond(status: number, data: string | Object, headers?: Object, responseText?: string): IRequestHandler; + + /** + * Controls the response for a matched request using the HTTP status code 200 and supplied static data to construct the response. + * Returns the RequestHandler object for possible overrides. + * @param data Data to add to the response. + * @param headers Headers object to add to the response. + * @param responseText Response text to add to the response. + */ + respond(data: string | Object, headers?: Object, responseText?: string): IRequestHandler; + + // Available when ngMockE2E is loaded + /** + * Any request matching a backend definition or expectation with passThrough handler will be passed through to the real backend (an XHR request will be made to the server.) + */ + passThrough(): IRequestHandler; + } + + } + +} + +/////////////////////////////////////////////////////////////////////////////// +// functions attached to global object (window) +/////////////////////////////////////////////////////////////////////////////// +//Use `angular.mock.module` instead of `module`, as `module` conflicts with commonjs. +//declare var module: (...modules: any[]) => any; +declare var inject: angular.IInjectStatic; diff --git a/catalog-ui/typings/angularjs/angular-resource.d.ts b/catalog-ui/typings/angularjs/angular-resource.d.ts new file mode 100644 index 0000000000..969997b1bc --- /dev/null +++ b/catalog-ui/typings/angularjs/angular-resource.d.ts @@ -0,0 +1,183 @@ +/*- + * ============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========================================================= + */ +// Type definitions for Angular JS 1.3 (ngResource module) +// Project: http://angularjs.org +// Definitions by: Diego Vilar , Michael Jess +// Definitions: https://github.com/daptiv/DefinitelyTyped + +/// +/////////////////////////////////////////////////////////////////////////////// +// ngResource module (angular-resource.js) +/////////////////////////////////////////////////////////////////////////////// +declare module angular.resource { + + /** + * Currently supported options for the $resource factory options argument. + */ + interface IResourceOptions { + /** + * If true then the trailing slashes from any calculated URL will be stripped (defaults to true) + */ + stripTrailingSlashes?: boolean; + } + + /////////////////////////////////////////////////////////////////////////// + // ResourceService + // see http://docs.angularjs.org/api/ngResource.$resource + // Most part of the following definitions were achieved by analyzing the + // actual implementation, since the documentation doesn't seem to cover + // that deeply. + /////////////////////////////////////////////////////////////////////////// + interface IResourceService { + (url: string, paramDefaults?: any, + /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } + where deleteDescriptor : IActionDescriptor */ + actions?: any, options?: IResourceOptions): IResourceClass>; + (url: string, paramDefaults?: any, + /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } + where deleteDescriptor : IActionDescriptor */ + actions?: any, options?: IResourceOptions): U; + (url: string, paramDefaults?: any, + /** example: {update: { method: 'PUT' }, delete: deleteDescriptor } + where deleteDescriptor : IActionDescriptor */ + actions?: any, options?: IResourceOptions): IResourceClass; + } + + // Just a reference to facilitate describing new actions + interface IActionDescriptor { + method: string; + isArray?: boolean; + params?: any; + headers?: any; + url?: any; + cache?: Boolean; + transformRequest?: Function; + transformResponse?: Function; + } + + // Baseclass for everyresource with default actions. + // If you define your new actions for the resource, you will need + // to extend this interface and typecast the ResourceClass to it. + // + // In case of passing the first argument as anything but a function, + // it's gonna be considered data if the action method is POST, PUT or + // PATCH (in other words, methods with body). Otherwise, it's going + // to be considered as parameters to the request. + // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L461-L465 + // + // Only those methods with an HTTP body do have 'data' as first parameter: + // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L463 + // More specifically, those methods are POST, PUT and PATCH: + // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L432 + // + // Also, static calls always return the IResource (or IResourceArray) retrieved + // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L538-L549 + interface IResourceClass { + new(dataOrParams? : any) : T; + get(): T; + get(params: Object): T; + get(success: Function, error?: Function): T; + get(params: Object, success: Function, error?: Function): T; + get(params: Object, data: Object, success?: Function, error?: Function): T; + + query(): IResourceArray; + query(params: Object): IResourceArray; + query(success: Function, error?: Function): IResourceArray; + query(params: Object, success: Function, error?: Function): IResourceArray; + query(params: Object, data: Object, success?: Function, error?: Function): IResourceArray; + + save(): T; + save(data: Object): T; + save(success: Function, error?: Function): T; + save(data: Object, success: Function, error?: Function): T; + save(params: Object, data: Object, success?: Function, error?: Function): T; + + remove(): T; + remove(params: Object): T; + remove(success: Function, error?: Function): T; + remove(params: Object, success: Function, error?: Function): T; + remove(params: Object, data: Object, success?: Function, error?: Function): T; + + delete(): T; + delete(params: Object): T; + delete(success: Function, error?: Function): T; + delete(params: Object, success: Function, error?: Function): T; + delete(params: Object, data: Object, success?: Function, error?: Function): T; + } + + // Instance calls always return the the promise of the request which retrieved the object + // https://github.com/angular/angular.js/blob/v1.2.0/src/ngResource/resource.js#L538-L546 + interface IResource { + $get(): angular.IPromise; + $get(params?: Object, success?: Function, error?: Function): angular.IPromise; + $get(success: Function, error?: Function): angular.IPromise; + + $query(): angular.IPromise>; + $query(params?: Object, success?: Function, error?: Function): angular.IPromise>; + $query(success: Function, error?: Function): angular.IPromise>; + + $save(): angular.IPromise; + $save(params?: Object, success?: Function, error?: Function): angular.IPromise; + $save(success: Function, error?: Function): angular.IPromise; + + $remove(): angular.IPromise; + $remove(params?: Object, success?: Function, error?: Function): angular.IPromise; + $remove(success: Function, error?: Function): angular.IPromise; + + $delete(): angular.IPromise; + $delete(params?: Object, success?: Function, error?: Function): angular.IPromise; + $delete(success: Function, error?: Function): angular.IPromise; + + /** the promise of the original server interaction that created this instance. **/ + $promise : angular.IPromise; + $resolved : boolean; + } + + /** + * Really just a regular Array object with $promise and $resolve attached to it + */ + interface IResourceArray extends Array { + /** the promise of the original server interaction that created this collection. **/ + $promise : angular.IPromise>; + $resolved : boolean; + } + + /** when creating a resource factory via IModule.factory */ + interface IResourceServiceFactoryFunction { + ($resource: angular.resource.IResourceService): IResourceClass; + >($resource: angular.resource.IResourceService): U; + } +} + +/** extensions to base ng based on using angular-resource */ +declare module angular { + + interface IModule { + /** creating a resource service factory */ + factory(name: string, resourceServiceFactoryFunction: angular.resource.IResourceServiceFactoryFunction): IModule; + } +} + +interface Array +{ + /** the promise of the original server interaction that created this collection. **/ + $promise : angular.IPromise>; + $resolved : boolean; +} diff --git a/catalog-ui/typings/angularjs/angular.d.ts b/catalog-ui/typings/angularjs/angular.d.ts new file mode 100644 index 0000000000..a5f56c0ccd --- /dev/null +++ b/catalog-ui/typings/angularjs/angular.d.ts @@ -0,0 +1,1613 @@ +/*- + * ============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========================================================= + */ +// Type definitions for Angular JS 1.3+ +// Project: http://angularjs.org +// Definitions by: Diego Vilar +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// + +declare var angular: angular.IAngularStatic; + +// Support for painless dependency injection +interface Function { + $inject?: string[]; +} + +// Collapse angular into ng +import ng = angular; +// Support AMD require +declare module 'angular' { + export = angular; +} + +/////////////////////////////////////////////////////////////////////////////// +// ng module (angular.js) +/////////////////////////////////////////////////////////////////////////////// +declare module angular { + + // not directly implemented, but ensures that constructed class implements $get + interface IServiceProviderClass { + new (...args: any[]): IServiceProvider; + } + + interface IServiceProviderFactory { + (...args: any[]): IServiceProvider; + } + + // All service providers extend this interface + interface IServiceProvider { + $get: any; + } + + interface IAngularBootstrapConfig { + strictDi?: boolean; + } + + /////////////////////////////////////////////////////////////////////////// + // AngularStatic + // see http://docs.angularjs.org/api + /////////////////////////////////////////////////////////////////////////// + interface IAngularStatic { + bind(context: any, fn: Function, ...args: any[]): Function; + + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. + */ + bootstrap(element: string, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. + */ + bootstrap(element: string, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. + */ + bootstrap(element: string, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. + */ + bootstrap(element: JQuery, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. + */ + bootstrap(element: JQuery, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. + */ + bootstrap(element: JQuery, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. + */ + bootstrap(element: Element, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. + */ + bootstrap(element: Element, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. + */ + bootstrap(element: Element, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. + */ + bootstrap(element: Document, modules?: string, config?: IAngularBootstrapConfig): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. + */ + bootstrap(element: Document, modules?: Function, config?: IAngularBootstrapConfig): auto.IInjectorService; + /** + * Use this function to manually start up angular application. + * + * @param element DOM element which is the root of angular application. + * @param modules An array of modules to load into the application. + * Each item in the array should be the name of a predefined module or a (DI annotated) + * function that will be invoked by the injector as a run block. + * @param config an object for defining configuration options for the application. The following keys are supported: + * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. + */ + bootstrap(element: Document, modules?: string[], config?: IAngularBootstrapConfig): auto.IInjectorService; + + /** + * Creates a deep copy of source, which should be an object or an array. + * + * - If no destination is supplied, a copy of the object or array is created. + * - If a destination is provided, all of its elements (for array) or properties (for objects) are deleted and then all elements/properties from the source are copied to it. + * - If source is not an object or array (inc. null and undefined), source is returned. + * - If source is identical to 'destination' an exception will be thrown. + * + * @param source The source that will be used to make a copy. Can be any type, including primitives, null, and undefined. + * @param destination Destination into which the source is copied. If provided, must be of the same type as source. + */ + copy(source: T, destination?: T): T; + + /** + * Wraps a raw DOM element or HTML string as a jQuery element. + * + * If jQuery is available, angular.element is an alias for the jQuery function. If jQuery is not available, angular.element delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite." + */ + element: IAugmentedJQueryStatic; + equals(value1: any, value2: any): boolean; + extend(destination: any, ...sources: any[]): any; + + /** + * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional. + * + * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method. + * + * @param obj Object to iterate over. + * @param iterator Iterator function. + * @param context Object to become context (this) for the iterator function. + */ + forEach(obj: T[], iterator: (value: T, key: number) => any, context?: any): any; + /** + * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional. + * + * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method. + * + * @param obj Object to iterate over. + * @param iterator Iterator function. + * @param context Object to become context (this) for the iterator function. + */ + forEach(obj: { [index: string]: T; }, iterator: (value: T, key: string) => any, context?: any): any; + /** + * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional. + * + * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method. + * + * @param obj Object to iterate over. + * @param iterator Iterator function. + * @param context Object to become context (this) for the iterator function. + */ + forEach(obj: any, iterator: (value: any, key: any) => any, context?: any): any; + + fromJson(json: string): any; + identity(arg?: any): any; + injector(modules?: any[]): auto.IInjectorService; + isArray(value: any): boolean; + isDate(value: any): boolean; + isDefined(value: any): boolean; + isElement(value: any): boolean; + isFunction(value: any): boolean; + isNumber(value: any): boolean; + isObject(value: any): boolean; + isString(value: any): boolean; + isUndefined(value: any): boolean; + lowercase(str: string): string; + + /** + * The angular.module is a global place for creating, registering and retrieving Angular modules. All modules (angular core or 3rd party) that should be available to an application must be registered using this mechanism. + * + * When passed two or more arguments, a new module is created. If passed only one argument, an existing module (the name passed as the first argument to module) is retrieved. + * + * @param name The name of the module to create or retrieve. + * @param requires The names of modules this module depends on. If specified then new module is being created. If unspecified then the module is being retrieved for further configuration. + * @param configFn Optional configuration function for the module. + */ + module( + name: string, + requires?: string[], + configFn?: Function): IModule; + + noop(...args: any[]): void; + reloadWithDebugInfo(): void; + toJson(obj: any, pretty?: boolean): string; + uppercase(str: string): string; + version: { + full: string; + major: number; + minor: number; + dot: number; + codeName: string; + }; + } + + /////////////////////////////////////////////////////////////////////////// + // Module + // see http://docs.angularjs.org/api/angular.Module + /////////////////////////////////////////////////////////////////////////// + interface IModule { + animation(name: string, animationFactory: Function): IModule; + animation(name: string, inlineAnnotatedFunction: any[]): IModule; + animation(object: Object): IModule; + /** + * Use this method to register work which needs to be performed on module loading. + * + * @param configFn Execute this function on module load. Useful for service configuration. + */ + config(configFn: Function): IModule; + /** + * Use this method to register work which needs to be performed on module loading. + * + * @param inlineAnnotatedFunction Execute this function on module load. Useful for service configuration. + */ + config(inlineAnnotatedFunction: any[]): IModule; + /** + * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator. + * + * @param name The name of the constant. + * @param value The constant value. + */ + constant(name: string, value: any): IModule; + constant(object: Object): IModule; + /** + * The $controller service is used by Angular to create new controllers. + * + * This provider allows controller registration via the register method. + * + * @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors. + * @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation). + */ + controller(name: string, controllerConstructor: Function): IModule; + /** + * The $controller service is used by Angular to create new controllers. + * + * This provider allows controller registration via the register method. + * + * @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors. + * @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation). + */ + controller(name: string, inlineAnnotatedConstructor: any[]): IModule; + controller(object: Object): IModule; + /** + * Register a new directive with the compiler. + * + * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind) + * @param directiveFactory An injectable directive factory function. + */ + directive(name: string, directiveFactory: IDirectiveFactory): IModule; + /** + * Register a new directive with the compiler. + * + * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind) + * @param directiveFactory An injectable directive factory function. + */ + directive(name: string, inlineAnnotatedFunction: any[]): IModule; + directive(object: Object): IModule; + /** + * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider. + * + * @param name The name of the instance. + * @param $getFn The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}). + */ + factory(name: string, $getFn: Function): IModule; + /** + * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider. + * + * @param name The name of the instance. + * @param inlineAnnotatedFunction The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}). + */ + factory(name: string, inlineAnnotatedFunction: any[]): IModule; + factory(object: Object): IModule; + filter(name: string, filterFactoryFunction: Function): IModule; + filter(name: string, inlineAnnotatedFunction: any[]): IModule; + filter(object: Object): IModule; + provider(name: string, serviceProviderFactory: IServiceProviderFactory): IModule; + provider(name: string, serviceProviderConstructor: IServiceProviderClass): IModule; + provider(name: string, inlineAnnotatedConstructor: any[]): IModule; + provider(name: string, providerObject: IServiceProvider): IModule; + provider(object: Object): IModule; + /** + * Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests. + */ + run(initializationFunction: Function): IModule; + /** + * Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests. + */ + run(inlineAnnotatedFunction: any[]): IModule; + service(name: string, serviceConstructor: Function): IModule; + service(name: string, inlineAnnotatedConstructor: any[]): IModule; + service(object: Object): IModule; + /** + * Register a value service with the $injector, such as a string, a number, an array, an object or a function. This is short for registering a service where its provider's $get property is a factory function that takes no arguments and returns the value service. + + Value services are similar to constant services, except that they cannot be injected into a module configuration function (see config) but they can be overridden by an Angular decorator. + * + * @param name The name of the instance. + * @param value The value. + */ + value(name: string, value: any): IModule; + value(object: Object): IModule; + + // Properties + name: string; + requires: string[]; + } + + /////////////////////////////////////////////////////////////////////////// + // Attributes + // see http://docs.angularjs.org/api/ng.$compile.directive.Attributes + /////////////////////////////////////////////////////////////////////////// + interface IAttributes { + /** + * this is necessary to be able to access the scoped attributes. it's not very elegant + * because you have to use attrs['foo'] instead of attrs.foo but I don't know of a better way + * this should really be limited to return string but it creates this problem: http://stackoverflow.com/q/17201854/165656 + */ + [name: string]: any; + + /** + * Adds the CSS class value specified by the classVal parameter to the + * element. If animations are enabled then an animation will be triggered + * for the class addition. + */ + $addClass(classVal: string): void; + + /** + * Removes the CSS class value specified by the classVal parameter from the + * element. If animations are enabled then an animation will be triggered for + * the class removal. + */ + $removeClass(classVal: string): void; + + /** + * Set DOM element attribute value. + */ + $set(key: string, value: any): void; + + /** + * Observes an interpolated attribute. + * The observer function will be invoked once during the next $digest + * following compilation. The observer is then invoked whenever the + * interpolated value changes. + */ + $observe(name: string, fn: (value?: any) => any): Function; + + /** + * A map of DOM element attribute names to the normalized name. This is needed + * to do reverse lookup from normalized name back to actual name. + */ + $attr: Object; + } + + /** + * form.FormController - type in module ng + * see https://docs.angularjs.org/api/ng/type/form.FormController + */ + interface IFormController { + + /** + * Indexer which should return ng.INgModelController for most properties but cannot because of "All named properties must be assignable to string indexer type" constraint - see https://github.com/Microsoft/TypeScript/issues/272 + */ + [name: string]: any; + + $pristine: boolean; + $dirty: boolean; + $valid: boolean; + $invalid: boolean; + $submitted: boolean; + $error: any; + $addControl(control: INgModelController): void; + $removeControl(control: INgModelController): void; + $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController): void; + $setDirty(): void; + $setPristine(): void; + $commitViewValue(): void; + $rollbackViewValue(): void; + $setSubmitted(): void; + $setUntouched(): void; + } + + /////////////////////////////////////////////////////////////////////////// + // NgModelController + // see http://docs.angularjs.org/api/ng.directive:ngModel.NgModelController + /////////////////////////////////////////////////////////////////////////// + interface INgModelController { + $render(): void; + $setValidity(validationErrorKey: string, isValid: boolean): void; + // Documentation states viewValue and modelValue to be a string but other + // types do work and it's common to use them. + $setViewValue(value: any, trigger?: string): void; + $setPristine(): void; + $validate(): void; + $setTouched(): void; + $setUntouched(): void; + $rollbackViewValue(): void; + $commitViewValue(): void; + $isEmpty(value: any): boolean; + + $viewValue: any; + + $modelValue: any; + + $parsers: IModelParser[]; + $formatters: IModelFormatter[]; + $viewChangeListeners: IModelViewChangeListener[]; + $error: any; + $name: string; + + $touched: boolean; + $untouched: boolean; + + $validators: IModelValidators; + $asyncValidators: IAsyncModelValidators; + + $pending: any; + $pristine: boolean; + $dirty: boolean; + $valid: boolean; + $invalid: boolean; + } + + interface IModelValidators { + [index: string]: (...args: any[]) => boolean; + } + + interface IAsyncModelValidators { + [index: string]: (...args: any[]) => IPromise; + } + + interface IModelParser { + (value: any): any; + } + + interface IModelFormatter { + (value: any): any; + } + + interface IModelViewChangeListener { + (): void; + } + + /** + * $rootScope - $rootScopeProvider - service in module ng + * see https://docs.angularjs.org/api/ng/type/$rootScope.Scope and https://docs.angularjs.org/api/ng/service/$rootScope + */ + interface IRootScopeService { + [index: string]: any; + + $apply(): any; + $apply(exp: string): any; + $apply(exp: (scope: IScope) => any): any; + + $applyAsync(): any; + $applyAsync(exp: string): any; + $applyAsync(exp: (scope: IScope) => any): any; + + $broadcast(name: string, ...args: any[]): IAngularEvent; + $destroy(): void; + $digest(): void; + $emit(name: string, ...args: any[]): IAngularEvent; + + $eval(): any; + $eval(expression: string, locals?: Object): any; + $eval(expression: (scope: IScope) => any, locals?: Object): any; + + $evalAsync(): void; + $evalAsync(expression: string): void; + $evalAsync(expression: (scope: IScope) => any): void; + + // Defaults to false by the implementation checking strategy + $new(isolate?: boolean, parent?: IScope): IScope; + + /** + * Listens on events of a given type. See $emit for discussion of event life cycle. + * + * The event listener function format is: function(event, args...). + * + * @param name Event name to listen on. + * @param listener Function to call when the event is emitted. + */ + $on(name: string, listener: (event: IAngularEvent, ...args: any[]) => any): Function; + + $watch(watchExpression: string, listener?: string, objectEquality?: boolean): Function; + $watch(watchExpression: string, listener?: (newValue: any, oldValue: any, scope: IScope) => any, objectEquality?: boolean): Function; + $watch(watchExpression: (scope: IScope) => any, listener?: string, objectEquality?: boolean): Function; + $watch(watchExpression: (scope: IScope) => any, listener?: (newValue: any, oldValue: any, scope: IScope) => any, objectEquality?: boolean): Function; + + $watchCollection(watchExpression: string, listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; + $watchCollection(watchExpression: (scope: IScope) => any, listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; + + $watchGroup(watchExpressions: any[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; + $watchGroup(watchExpressions: { (scope: IScope): any }[], listener: (newValue: any, oldValue: any, scope: IScope) => any): Function; + + $parent: IScope; + $root: IRootScopeService; + $id: number; + + // Hidden members + $$isolateBindings: any; + $$phase: any; + } + + interface IScope extends IRootScopeService { } + + /** + * $scope for ngRepeat directive. + * see https://docs.angularjs.org/api/ng/directive/ngRepeat + */ + interface IRepeatScope extends IScope { + + /** + * iterator offset of the repeated element (0..length-1). + */ + $index: number; + + /** + * true if the repeated element is first in the iterator. + */ + $first: boolean; + + /** + * true if the repeated element is between the first and last in the iterator. + */ + $middle: boolean; + + /** + * true if the repeated element is last in the iterator. + */ + $last: boolean; + + /** + * true if the iterator position $index is even (otherwise false). + */ + $even: boolean; + + /** + * true if the iterator position $index is odd (otherwise false). + */ + $odd: boolean; + + } + + interface IAngularEvent { + /** + * the scope on which the event was $emit-ed or $broadcast-ed. + */ + targetScope: IScope; + /** + * the scope that is currently handling the event. Once the event propagates through the scope hierarchy, this property is set to null. + */ + currentScope: IScope; + /** + * name of the event. + */ + name: string; + /** + * calling stopPropagation function will cancel further event propagation (available only for events that were $emit-ed). + */ + stopPropagation?: Function; + /** + * calling preventDefault sets defaultPrevented flag to true. + */ + preventDefault: Function; + /** + * true if preventDefault was called. + */ + defaultPrevented: boolean; + } + + /////////////////////////////////////////////////////////////////////////// + // WindowService + // see http://docs.angularjs.org/api/ng.$window + /////////////////////////////////////////////////////////////////////////// + interface IWindowService extends Window { + [key: string]: any; + } + + /////////////////////////////////////////////////////////////////////////// + // BrowserService + // TODO undocumented, so we need to get it from the source code + /////////////////////////////////////////////////////////////////////////// + interface IBrowserService { + defer: angular.ITimeoutService; + [key: string]: any; + } + + /////////////////////////////////////////////////////////////////////////// + // TimeoutService + // see http://docs.angularjs.org/api/ng.$timeout + /////////////////////////////////////////////////////////////////////////// + interface ITimeoutService { + (func: Function, delay?: number, invokeApply?: boolean): IPromise; + cancel(promise: IPromise): boolean; + } + + /////////////////////////////////////////////////////////////////////////// + // IntervalService + // see http://docs.angularjs.org/api/ng.$interval + /////////////////////////////////////////////////////////////////////////// + interface IIntervalService { + (func: Function, delay: number, count?: number, invokeApply?: boolean): IPromise; + cancel(promise: IPromise): boolean; + } + + /////////////////////////////////////////////////////////////////////////// + // AngularProvider + // see http://docs.angularjs.org/api/ng/provider/$animateProvider + /////////////////////////////////////////////////////////////////////////// + interface IAnimateProvider { + /** + * Registers a new injectable animation factory function. + * + * @param name The name of the animation. + * @param factory The factory function that will be executed to return the animation object. + */ + register(name: string, factory: () => IAnimateCallbackObject): void; + + /** + * Gets and/or sets the CSS class expression that is checked when performing an animation. + * + * @param expression The className expression which will be checked against all animations. + * @returns The current CSS className expression value. If null then there is no expression value. + */ + classNameFilter(expression?: RegExp): RegExp; + } + + /** + * The animation object which contains callback functions for each event that is expected to be animated. + */ + interface IAnimateCallbackObject { + eventFn(element: Node, doneFn: () => void): Function; + } + + /////////////////////////////////////////////////////////////////////////// + // FilterService + // see http://docs.angularjs.org/api/ng.$filter + // see http://docs.angularjs.org/api/ng.$filterProvider + /////////////////////////////////////////////////////////////////////////// + interface IFilterService { + (name: string): Function; + } + + interface IFilterProvider extends IServiceProvider { + register(name: string, filterFactory: Function): IServiceProvider; + } + + /////////////////////////////////////////////////////////////////////////// + // LocaleService + // see http://docs.angularjs.org/api/ng.$locale + /////////////////////////////////////////////////////////////////////////// + interface ILocaleService { + id: string; + + // These are not documented + // Check angular's i18n files for exemples + NUMBER_FORMATS: ILocaleNumberFormatDescriptor; + DATETIME_FORMATS: ILocaleDateTimeFormatDescriptor; + pluralCat: (num: any) => string; + } + + interface ILocaleNumberFormatDescriptor { + DECIMAL_SEP: string; + GROUP_SEP: string; + PATTERNS: ILocaleNumberPatternDescriptor[]; + CURRENCY_SYM: string; + } + + interface ILocaleNumberPatternDescriptor { + minInt: number; + minFrac: number; + maxFrac: number; + posPre: string; + posSuf: string; + negPre: string; + negSuf: string; + gSize: number; + lgSize: number; + } + + interface ILocaleDateTimeFormatDescriptor { + MONTH: string[]; + SHORTMONTH: string[]; + DAY: string[]; + SHORTDAY: string[]; + AMPMS: string[]; + medium: string; + short: string; + fullDate: string; + longDate: string; + mediumDate: string; + shortDate: string; + mediumTime: string; + shortTime: string; + } + + /////////////////////////////////////////////////////////////////////////// + // LogService + // see http://docs.angularjs.org/api/ng.$log + // see http://docs.angularjs.org/api/ng.$logProvider + /////////////////////////////////////////////////////////////////////////// + interface ILogService { + debug: ILogCall; + error: ILogCall; + info: ILogCall; + log: ILogCall; + warn: ILogCall; + } + + interface ILogProvider { + debugEnabled(): boolean; + debugEnabled(enabled: boolean): ILogProvider; + } + + // We define this as separate interface so we can reopen it later for + // the ngMock module. + interface ILogCall { + (...args: any[]): void; + } + + /////////////////////////////////////////////////////////////////////////// + // ParseService + // see http://docs.angularjs.org/api/ng.$parse + // see http://docs.angularjs.org/api/ng.$parseProvider + /////////////////////////////////////////////////////////////////////////// + interface IParseService { + (expression: string): ICompiledExpression; + } + + interface IParseProvider { + logPromiseWarnings(): boolean; + logPromiseWarnings(value: boolean): IParseProvider; + + unwrapPromises(): boolean; + unwrapPromises(value: boolean): IParseProvider; + } + + interface ICompiledExpression { + (context: any, locals?: any): any; + + // If value is not provided, undefined is gonna be used since the implementation + // does not check the parameter. Let's force a value for consistency. If consumer + // whants to undefine it, pass the undefined value explicitly. + assign(context: any, value: any): any; + } + + /** + * $location - $locationProvider - service in module ng + * see https://docs.angularjs.org/api/ng/service/$location + */ + interface ILocationService { + absUrl(): string; + hash(): string; + hash(newHash: string): ILocationService; + host(): string; + + /** + * Return path of current url + */ + path(): string; + + /** + * Change path when called with parameter and return $location. + * Note: Path should always begin with forward slash (/), this method will add the forward slash if it is missing. + * + * @param path New path + */ + path(path: string): ILocationService; + + port(): number; + protocol(): string; + replace(): ILocationService; + + /** + * Return search part (as object) of current url + */ + search(): any; + + /** + * Change search part when called with parameter and return $location. + * + * @param search When called with a single argument the method acts as a setter, setting the search component of $location to the specified value. + * + * If the argument is a hash object containing an array of values, these values will be encoded as duplicate search parameters in the url. + */ + search(search: any): ILocationService; + + /** + * Change search part when called with parameter and return $location. + * + * @param search New search params + * @param paramValue If search is a string or a Number, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted. If paramValue is an array, it will override the property of the search component of $location specified via the first argument. If paramValue is true, the property specified via the first argument will be added with no value nor trailing equal sign. + */ + search(search: string, paramValue: string|number|string[]|boolean): ILocationService; + + state(): any; + state(state: any): ILocationService; + url(): string; + url(url: string): ILocationService; + } + + interface ILocationProvider extends IServiceProvider { + hashPrefix(): string; + hashPrefix(prefix: string): ILocationProvider; + html5Mode(): boolean; + + // Documentation states that parameter is string, but + // implementation tests it as boolean, which makes more sense + // since this is a toggler + html5Mode(active: boolean): ILocationProvider; + html5Mode(mode: { enabled?: boolean; requireBase?: boolean; rewriteLinks?: boolean; }): ILocationProvider; + } + + /////////////////////////////////////////////////////////////////////////// + // DocumentService + // see http://docs.angularjs.org/api/ng.$document + /////////////////////////////////////////////////////////////////////////// + interface IDocumentService extends IAugmentedJQuery {} + + /////////////////////////////////////////////////////////////////////////// + // ExceptionHandlerService + // see http://docs.angularjs.org/api/ng.$exceptionHandler + /////////////////////////////////////////////////////////////////////////// + interface IExceptionHandlerService { + (exception: Error, cause?: string): void; + } + + /////////////////////////////////////////////////////////////////////////// + // RootElementService + // see http://docs.angularjs.org/api/ng.$rootElement + /////////////////////////////////////////////////////////////////////////// + interface IRootElementService extends JQuery {} + + interface IQResolveReject { + (): void; + (value: T): void; + } + /** + * $q - service in module ng + * A promise/deferred implementation inspired by Kris Kowal's Q. + * See http://docs.angularjs.org/api/ng/service/$q + */ + interface IQService { + new (resolver: (resolve: IQResolveReject) => any): IPromise; + new (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise; + new (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise; + + /** + * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. + * + * Returns a single promise that will be resolved with an array of values, each value corresponding to the promise at the same index in the promises array. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value. + * + * @param promises An array of promises. + */ + all(promises: IPromise[]): IPromise; + /** + * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. + * + * Returns a single promise that will be resolved with a hash of values, each value corresponding to the promise at the same key in the promises hash. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value. + * + * @param promises A hash of promises. + */ + all(promises: { [id: string]: IPromise; }): IPromise<{ [id: string]: any; }>; + /** + * Creates a Deferred object which represents a task which will finish in the future. + */ + defer(): IDeferred; + /** + * Creates a promise that is resolved as rejected with the specified reason. This api should be used to forward rejection in a chain of promises. If you are dealing with the last promise in a promise chain, you don't need to worry about it. + * + * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of reject as the throw keyword in JavaScript. This also means that if you "catch" an error via a promise error callback and you want to forward the error to the promise derived from the current promise, you have to "rethrow" the error by returning a rejection constructed via reject. + * + * @param reason Constant, message, exception or an object representing the rejection reason. + */ + reject(reason?: any): IPromise; + /** + * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. + * + * @param value Value or a promise + */ + when(value: IPromise|T): IPromise; + /** + * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. + * + * @param value Value or a promise + */ + when(): IPromise; + } + + interface IPromise { + /** + * Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected. + * + * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method. + */ + then(successCallback: (promiseValue: T) => IHttpPromise|IPromise|TResult, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise; + + /** + * Shorthand for promise.then(null, errorCallback) + */ + catch(onRejected: (reason: any) => IHttpPromise|IPromise|TResult): IPromise; + + /** + * Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information. + * + * Because finally is a reserved word in JavaScript and reserved keywords are not supported as property names by ES3, you'll need to invoke the method like promise['finally'](callback) to make your code IE8 and Android 2.x compatible. + */ + finally(finallyCallback: () => any): IPromise; + } + + interface IDeferred { + resolve(value?: T): void; + reject(reason?: any): void; + notify(state?: any): void; + promise: IPromise; + } + + /////////////////////////////////////////////////////////////////////////// + // AnchorScrollService + // see http://docs.angularjs.org/api/ng.$anchorScroll + /////////////////////////////////////////////////////////////////////////// + interface IAnchorScrollService { + (): void; + yOffset: any; + } + + interface IAnchorScrollProvider extends IServiceProvider { + disableAutoScrolling(): void; + } + + /////////////////////////////////////////////////////////////////////////// + // CacheFactoryService + // see http://docs.angularjs.org/api/ng.$cacheFactory + /////////////////////////////////////////////////////////////////////////// + interface ICacheFactoryService { + // Lets not foce the optionsMap to have the capacity member. Even though + // it's the ONLY option considered by the implementation today, a consumer + // might find it useful to associate some other options to the cache object. + //(cacheId: string, optionsMap?: { capacity: number; }): CacheObject; + (cacheId: string, optionsMap?: { capacity: number; }): ICacheObject; + + // Methods bellow are not documented + info(): any; + get(cacheId: string): ICacheObject; + } + + interface ICacheObject { + info(): { + id: string; + size: number; + + // Not garanteed to have, since it's a non-mandatory option + //capacity: number; + }; + put(key: string, value?: T): T; + get(key: string): any; + remove(key: string): void; + removeAll(): void; + destroy(): void; + } + + /////////////////////////////////////////////////////////////////////////// + // CompileService + // see http://docs.angularjs.org/api/ng.$compile + // see http://docs.angularjs.org/api/ng.$compileProvider + /////////////////////////////////////////////////////////////////////////// + interface ICompileService { + (element: string, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction; + (element: Element, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction; + (element: JQuery, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction; + } + + interface ICompileProvider extends IServiceProvider { + directive(name: string, directiveFactory: Function): ICompileProvider; + + // Undocumented, but it is there... + directive(directivesMap: any): ICompileProvider; + + aHrefSanitizationWhitelist(): RegExp; + aHrefSanitizationWhitelist(regexp: RegExp): ICompileProvider; + + imgSrcSanitizationWhitelist(): RegExp; + imgSrcSanitizationWhitelist(regexp: RegExp): ICompileProvider; + + debugInfoEnabled(enabled?: boolean): any; + } + + interface ICloneAttachFunction { + // Let's hint but not force cloneAttachFn's signature + (clonedElement?: JQuery, scope?: IScope): any; + } + + // This corresponds to the "publicLinkFn" returned by $compile. + interface ITemplateLinkingFunction { + (scope: IScope, cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery; + } + + // This corresponds to $transclude (and also the transclude function passed to link). + interface ITranscludeFunction { + // If the scope is provided, then the cloneAttachFn must be as well. + (scope: IScope, cloneAttachFn: ICloneAttachFunction): IAugmentedJQuery; + // If one argument is provided, then it's assumed to be the cloneAttachFn. + (cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery; + } + + /////////////////////////////////////////////////////////////////////////// + // ControllerService + // see http://docs.angularjs.org/api/ng.$controller + // see http://docs.angularjs.org/api/ng.$controllerProvider + /////////////////////////////////////////////////////////////////////////// + interface IControllerService { + // Although the documentation doesn't state this, locals are optional + (controllerConstructor: Function, locals?: any): any; + (controllerName: string, locals?: any): any; + } + + interface IControllerProvider extends IServiceProvider { + register(name: string, controllerConstructor: Function): void; + register(name: string, dependencyAnnotatedConstructor: any[]): void; + allowGlobals(): void; + } + + /** + * HttpService + * see http://docs.angularjs.org/api/ng/service/$http + */ + interface IHttpService { + /** + * Object describing the request to be made and how it should be processed. + */ + (config: IRequestConfig): IHttpPromise; + + /** + * Shortcut method to perform GET request. + * + * @param url Relative or absolute URL specifying the destination of the request + * @param config Optional configuration object + */ + get(url: string, config?: IRequestShortcutConfig): IHttpPromise; + + /** + * Shortcut method to perform DELETE request. + * + * @param url Relative or absolute URL specifying the destination of the request + * @param config Optional configuration object + */ + delete(url: string, config?: IRequestShortcutConfig): IHttpPromise; + + /** + * Shortcut method to perform HEAD request. + * + * @param url Relative or absolute URL specifying the destination of the request + * @param config Optional configuration object + */ + head(url: string, config?: IRequestShortcutConfig): IHttpPromise; + + /** + * Shortcut method to perform JSONP request. + * + * @param url Relative or absolute URL specifying the destination of the request + * @param config Optional configuration object + */ + jsonp(url: string, config?: IRequestShortcutConfig): IHttpPromise; + + /** + * Shortcut method to perform POST request. + * + * @param url Relative or absolute URL specifying the destination of the request + * @param data Request content + * @param config Optional configuration object + */ + post(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise; + + /** + * Shortcut method to perform PUT request. + * + * @param url Relative or absolute URL specifying the destination of the request + * @param data Request content + * @param config Optional configuration object + */ + put(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise; + + /** + * Shortcut method to perform PATCH request. + * + * @param url Relative or absolute URL specifying the destination of the request + * @param data Request content + * @param config Optional configuration object + */ + patch(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise; + + /** + * Runtime equivalent of the $httpProvider.defaults property. Allows configuration of default headers, withCredentials as well as request and response transformations. + */ + defaults: IRequestConfig; + + /** + * Array of config objects for currently pending requests. This is primarily meant to be used for debugging purposes. + */ + pendingRequests: any[]; + } + + /** + * Object describing the request to be made and how it should be processed. + * see http://docs.angularjs.org/api/ng/service/$http#usage + */ + interface IRequestShortcutConfig { + /** + * {Object.} + * Map of strings or objects which will be turned to ?key1=value1&key2=value2 after the url. If the value is not a string, it will be JSONified. + */ + params?: any; + + /** + * Map of strings or functions which return strings representing HTTP headers to send to the server. If the return value of a function is null, the header will not be sent. + */ + headers?: any; + + /** + * Name of HTTP header to populate with the XSRF token. + */ + xsrfHeaderName?: string; + + /** + * Name of cookie containing the XSRF token. + */ + xsrfCookieName?: string; + + /** + * {boolean|Cache} + * If true, a default $http cache will be used to cache the GET request, otherwise if a cache instance built with $cacheFactory, this cache will be used for caching. + */ + cache?: any; + + /** + * whether to to set the withCredentials flag on the XHR object. See [requests with credentials]https://developer.mozilla.org/en/http_access_control#section_5 for more information. + */ + withCredentials?: boolean; + + /** + * {string|Object} + * Data to be sent as the request message data. + */ + data?: any; + + /** + * {function(data, headersGetter)|Array.} + * Transform function or an array of such functions. The transform function takes the http request body and headers and returns its transformed (typically serialized) version. + */ + transformRequest?: any; + + /** + * {function(data, headersGetter)|Array.} + * Transform function or an array of such functions. The transform function takes the http response body and headers and returns its transformed (typically deserialized) version. + */ + transformResponse?: any; + + /** + * {number|Promise} + * Timeout in milliseconds, or promise that should abort the request when resolved. + */ + timeout?: any; + + /** + * See requestType. + */ + responseType?: string; + } + + /** + * Object describing the request to be made and how it should be processed. + * see http://docs.angularjs.org/api/ng/service/$http#usage + */ + interface IRequestConfig extends IRequestShortcutConfig { + /** + * HTTP method (e.g. 'GET', 'POST', etc) + */ + method: string; + /** + * Absolute or relative URL of the resource that is being requested. + */ + url: string; + } + + interface IHttpHeadersGetter { + (): { [name: string]: string; }; + (headerName: string): string; + } + + interface IHttpPromiseCallback { + (data: T, status: number, headers: IHttpHeadersGetter, config: IRequestConfig): void; + } + + interface IHttpPromiseCallbackArg { + data?: T; + status?: number; + headers?: IHttpHeadersGetter; + config?: IRequestConfig; + statusText?: string; + } + + interface IHttpPromise extends IPromise> { + success(callback: IHttpPromiseCallback): IHttpPromise; + error(callback: IHttpPromiseCallback): IHttpPromise; + then(successCallback: (response: IHttpPromiseCallbackArg) => IPromise|TResult, errorCallback?: (response: IHttpPromiseCallbackArg) => any): IPromise; + } + + /** + * Object that controls the defaults for $http provider + * https://docs.angularjs.org/api/ng/service/$http#defaults + */ + interface IHttpProviderDefaults { + xsrfCookieName?: string; + xsrfHeaderName?: string; + withCredentials?: boolean; + headers?: { + common?: any; + post?: any; + put?: any; + patch?: any; + } + } + + interface IHttpProvider extends IServiceProvider { + defaults: IHttpProviderDefaults; + interceptors: any[]; + useApplyAsync(): boolean; + useApplyAsync(value: boolean): IHttpProvider; + } + + /////////////////////////////////////////////////////////////////////////// + // HttpBackendService + // see http://docs.angularjs.org/api/ng.$httpBackend + // You should never need to use this service directly. + /////////////////////////////////////////////////////////////////////////// + interface IHttpBackendService { + // XXX Perhaps define callback signature in the future + (method: string, url: string, post?: any, callback?: Function, headers?: any, timeout?: number, withCredentials?: boolean): void; + } + + /////////////////////////////////////////////////////////////////////////// + // InterpolateService + // see http://docs.angularjs.org/api/ng.$interpolate + // see http://docs.angularjs.org/api/ng.$interpolateProvider + /////////////////////////////////////////////////////////////////////////// + interface IInterpolateService { + (text: string, mustHaveExpression?: boolean, trustedContext?: string, allOrNothing?: boolean): IInterpolationFunction; + endSymbol(): string; + startSymbol(): string; + } + + interface IInterpolationFunction { + (context: any): string; + } + + interface IInterpolateProvider extends IServiceProvider { + startSymbol(): string; + startSymbol(value: string): IInterpolateProvider; + endSymbol(): string; + endSymbol(value: string): IInterpolateProvider; + } + + /////////////////////////////////////////////////////////////////////////// + // TemplateCacheService + // see http://docs.angularjs.org/api/ng.$templateCache + /////////////////////////////////////////////////////////////////////////// + interface ITemplateCacheService extends ICacheObject {} + + /////////////////////////////////////////////////////////////////////////// + // SCEService + // see http://docs.angularjs.org/api/ng.$sce + /////////////////////////////////////////////////////////////////////////// + interface ISCEService { + getTrusted(type: string, mayBeTrusted: any): any; + getTrustedCss(value: any): any; + getTrustedHtml(value: any): any; + getTrustedJs(value: any): any; + getTrustedResourceUrl(value: any): any; + getTrustedUrl(value: any): any; + parse(type: string, expression: string): (context: any, locals: any) => any; + parseAsCss(expression: string): (context: any, locals: any) => any; + parseAsHtml(expression: string): (context: any, locals: any) => any; + parseAsJs(expression: string): (context: any, locals: any) => any; + parseAsResourceUrl(expression: string): (context: any, locals: any) => any; + parseAsUrl(expression: string): (context: any, locals: any) => any; + trustAs(type: string, value: any): any; + trustAsHtml(value: any): any; + trustAsJs(value: any): any; + trustAsResourceUrl(value: any): any; + trustAsUrl(value: any): any; + isEnabled(): boolean; + } + + /////////////////////////////////////////////////////////////////////////// + // SCEProvider + // see http://docs.angularjs.org/api/ng.$sceProvider + /////////////////////////////////////////////////////////////////////////// + interface ISCEProvider extends IServiceProvider { + enabled(value: boolean): void; + } + + /////////////////////////////////////////////////////////////////////////// + // SCEDelegateService + // see http://docs.angularjs.org/api/ng.$sceDelegate + /////////////////////////////////////////////////////////////////////////// + interface ISCEDelegateService { + getTrusted(type: string, mayBeTrusted: any): any; + trustAs(type: string, value: any): any; + valueOf(value: any): any; + } + + + /////////////////////////////////////////////////////////////////////////// + // SCEDelegateProvider + // see http://docs.angularjs.org/api/ng.$sceDelegateProvider + /////////////////////////////////////////////////////////////////////////// + interface ISCEDelegateProvider extends IServiceProvider { + resourceUrlBlacklist(blacklist: any[]): void; + resourceUrlWhitelist(whitelist: any[]): void; + } + + /** + * $templateRequest service + * see http://docs.angularjs.org/api/ng/service/$templateRequest + */ + interface ITemplateRequestService { + /** + * Downloads a template using $http and, upon success, stores the + * contents inside of $templateCache. + * + * If the HTTP request fails or the response data of the HTTP request is + * empty then a $compile error will be thrown (unless + * {ignoreRequestError} is set to true). + * + * @param tpl The template URL. + * @param ignoreRequestError Whether or not to ignore the exception + * when the request fails or the template is + * empty. + * + * @return A promise whose value is the template content. + */ + (tpl: string, ignoreRequestError?: boolean): IPromise; + /** + * total amount of pending template requests being downloaded. + * @type {number} + */ + totalPendingRequests: number; + } + + /////////////////////////////////////////////////////////////////////////// + // Directive + // see http://docs.angularjs.org/api/ng.$compileProvider#directive + // and http://docs.angularjs.org/guide/directive + /////////////////////////////////////////////////////////////////////////// + + interface IDirectiveFactory { + (...args: any[]): IDirective; + } + + interface IDirectiveLinkFn { + ( + scope: IScope, + instanceElement: IAugmentedJQuery, + instanceAttributes: IAttributes, + controller: any, + transclude: ITranscludeFunction + ): void; + } + + interface IDirectivePrePost { + pre?: IDirectiveLinkFn; + post?: IDirectiveLinkFn; + } + + interface IDirectiveCompileFn { + ( + templateElement: IAugmentedJQuery, + templateAttributes: IAttributes, + transclude: ITranscludeFunction + ): IDirectivePrePost; + } + + interface IDirective { + compile?: IDirectiveCompileFn; + controller?: any; + controllerAs?: string; + bindToController?: boolean; + link?: IDirectiveLinkFn | IDirectivePrePost; + name?: string; + priority?: number; + replace?: boolean; + require?: any; + restrict?: string; + scope?: any; + template?: any; + templateUrl?: any; + terminal?: boolean; + transclude?: any; + } + + /** + * angular.element + * when calling angular.element, angular returns a jQuery object, + * augmented with additional methods like e.g. scope. + * see: http://docs.angularjs.org/api/angular.element + */ + interface IAugmentedJQueryStatic extends JQueryStatic { + (selector: string, context?: any): IAugmentedJQuery; + (element: Element): IAugmentedJQuery; + (object: {}): IAugmentedJQuery; + (elementArray: Element[]): IAugmentedJQuery; + (object: JQuery): IAugmentedJQuery; + (func: Function): IAugmentedJQuery; + (array: any[]): IAugmentedJQuery; + (): IAugmentedJQuery; + } + + interface IAugmentedJQuery extends JQuery { + // TODO: events, how to define? + //$destroy + + find(selector: string): IAugmentedJQuery; + find(element: any): IAugmentedJQuery; + find(obj: JQuery): IAugmentedJQuery; + controller(): any; + controller(name: string): any; + injector(): any; + scope(): IScope; + isolateScope(): IScope; + + inheritedData(key: string, value: any): JQuery; + inheritedData(obj: { [key: string]: any; }): JQuery; + inheritedData(key?: string): any; + } + + /////////////////////////////////////////////////////////////////////// + // AnimateService + // see http://docs.angularjs.org/api/ng.$animate + /////////////////////////////////////////////////////////////////////// + interface IAnimateService { + addClass(element: JQuery, className: string, done?: Function): IPromise; + enter(element: JQuery, parent: JQuery, after: JQuery, done?: Function): void; + leave(element: JQuery, done?: Function): void; + move(element: JQuery, parent: JQuery, after: JQuery, done?: Function): void; + removeClass(element: JQuery, className: string, done?: Function): void; + } + + /////////////////////////////////////////////////////////////////////////// + // AUTO module (angular.js) + /////////////////////////////////////////////////////////////////////////// + export module auto { + + /////////////////////////////////////////////////////////////////////// + // InjectorService + // see http://docs.angularjs.org/api/AUTO.$injector + /////////////////////////////////////////////////////////////////////// + interface IInjectorService { + annotate(fn: Function): string[]; + annotate(inlineAnnotatedFunction: any[]): string[]; + get(name: string): any; + has(name: string): boolean; + instantiate(typeConstructor: Function, locals?: any): any; + invoke(inlineAnnotatedFunction: any[]): any; + invoke(func: Function, context?: any, locals?: any): any; + } + + /////////////////////////////////////////////////////////////////////// + // ProvideService + // see http://docs.angularjs.org/api/AUTO.$provide + /////////////////////////////////////////////////////////////////////// + interface IProvideService { + // Documentation says it returns the registered instance, but actual + // implementation does not return anything. + // constant(name: string, value: any): any; + /** + * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator. + * + * @param name The name of the constant. + * @param value The constant value. + */ + constant(name: string, value: any): void; + + /** + * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service. + * + * @param name The name of the service to decorate. + * @param decorator This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments: + * + * $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to. + */ + decorator(name: string, decorator: Function): void; + /** + * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service. + * + * @param name The name of the service to decorate. + * @param inlineAnnotatedFunction This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments: + * + * $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to. + */ + decorator(name: string, inlineAnnotatedFunction: any[]): void; + factory(name: string, serviceFactoryFunction: Function): IServiceProvider; + factory(name: string, inlineAnnotatedFunction: any[]): IServiceProvider; + provider(name: string, provider: IServiceProvider): IServiceProvider; + provider(name: string, serviceProviderConstructor: Function): IServiceProvider; + service(name: string, constructor: Function): IServiceProvider; + value(name: string, value: any): IServiceProvider; + } + + } +} diff --git a/catalog-ui/typings/angularjs/restangular.d.ts b/catalog-ui/typings/angularjs/restangular.d.ts new file mode 100644 index 0000000000..3428b0493f --- /dev/null +++ b/catalog-ui/typings/angularjs/restangular.d.ts @@ -0,0 +1,156 @@ +/*- + * ============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========================================================= + */ +// Type definitions for Restangular v1.4.0 +// Project: https://github.com/mgonto/restangular +// Definitions by: Boris Yankov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// + +// Support AMD require (copying angular.d.ts approach) +// allows for import {IRequestConfig} from 'restangular' ES6 approach +declare module 'restangular' { + export = restangular; +} + + + +declare module restangular { + + interface IPromise extends angular.IPromise { + call(methodName: string, params?: any): IPromise; + get(fieldName: string): IPromise; + $object: T; + } + + interface ICollectionPromise extends angular.IPromise { + push(object: any): ICollectionPromise; + call(methodName: string, params?: any): ICollectionPromise; + get(fieldName: string): ICollectionPromise; + $object: T[]; + } + + interface IResponse { + status: number; + data: any; + headers(name: string): string; + config: { + method: string; + url: string; + params: any; + } + } + + interface IProvider { + setBaseUrl(baseUrl: string): void; + setExtraFields(fields: string[]): void; + setParentless(parentless: boolean, routes: string[]): void; + setDefaultHttpFields(httpFields: any): void; + addElementTransformer(route: string, transformer: Function): void; + addElementTransformer(route: string, isCollection: boolean, transformer: Function): void; + setTransformOnlyServerElements(active: boolean): void; + setOnElemRestangularized(callback: (elem: any, isCollection: boolean, what: string, restangular: IService) => any): void; + setResponseInterceptor(responseInterceptor: (data: any, operation: string, what: string, url: string, response: IResponse, deferred: angular.IDeferred) => any): void; + setResponseExtractor(responseInterceptor: (data: any, operation: string, what: string, url: string, response: IResponse, deferred: angular.IDeferred) => any): void; + addResponseInterceptor(responseInterceptor: (data: any, operation: string, what: string, url: string, response: IResponse, deferred: angular.IDeferred) => any): void; + setRequestInterceptor(requestInterceptor: (element: any, operation: string, what: string, url: string) => any): void; + addRequestInterceptor(requestInterceptor: (element: any, operation: string, what: string, url: string) => any): void; + setFullRequestInterceptor(fullRequestInterceptor: (element: any, operation: string, what: string, url: string, headers: any, params: any, httpConfig: angular.IRequestShortcutConfig) => {element: any; headers: any; params: any}): void; + addFullRequestInterceptor(requestInterceptor: (element: any, operation: string, what: string, url: string, headers: any, params: any, httpConfig: angular.IRequestShortcutConfig) => {headers: any; params: any; element: any; httpConfig: angular.IRequestShortcutConfig}): void; + setErrorInterceptor(errorInterceptor: (response: IResponse, deferred: angular.IDeferred) => any): void; + setRestangularFields(fields: {[fieldName: string]: string}): void; + setMethodOverriders(overriders: string[]): void; + setJsonp(jsonp: boolean): void; + setDefaultRequestParams(params: any): void; + setDefaultRequestParams(method: string, params: any): void; + setDefaultRequestParams(methods: string[], params: any): void; + setFullResponse(fullResponse: boolean): void; + setDefaultHeaders(headers: any): void; + setRequestSuffix(suffix: string): void; + setUseCannonicalId(useCannonicalId: boolean): void; + setEncodeIds(encode: boolean): void; + } + + interface ICustom { + customGET(path: string, params?: any, headers?: any): IPromise; + customGETLIST(path: string, params?: any, headers?: any): ICollectionPromise; + customDELETE(path: string, params?: any, headers?: any): IPromise; + customPOST(elem?: any, path?: string, params?: any, headers?: any): IPromise; + customPUT(elem?: any, path?: string, params?: any, headers?: any): IPromise; + customOperation(operation: string, path: string, params?: any, headers?: any, elem?: any): IPromise; + addRestangularMethod(name: string, operation: string, path?: string, params?: any, headers?: any, elem?: any): IPromise; + } + + interface IService extends ICustom, IProvider { + one(route: string, id?: number): IElement; + one(route: string, id?: string): IElement; + oneUrl(route: string, url: string): IElement; + all(route: string): IElement; + allUrl(route: string, url: string): IElement; + copy(fromElement: any): IElement; + withConfig(configurer: (RestangularProvider: IProvider) => any): IService; + restangularizeElement(parent: any, element: any, route: string, collection?: any, reqParams?: any): IElement; + restangularizeCollection(parent: any, element: any, route: string): ICollection; + service(route: string, parent?: any): IService; + stripRestangular(element: any): any; + extendModel(route: string, extender: (model: IElement) => any): void; + } + + interface IElement extends IService { + get(queryParams?: any, headers?: any): IPromise; + get(queryParams?: any, headers?: any): IPromise; + getList(subElement?: any, queryParams?: any, headers?: any): ICollectionPromise; + getList(subElement?: any, queryParams?: any, headers?: any): ICollectionPromise; + put(queryParams?: any, headers?: any): IPromise; + post(subElement: any, elementToPost: any, queryParams?: any, headers?: any): IPromise; + post(subElement: any, elementToPost: T, queryParams?: any, headers?: any): IPromise; + post(elementToPost: any, queryParams?: any, headers?: any): IPromise; + post(elementToPost: T, queryParams?: any, headers?: any): IPromise; + remove(queryParams?: any, headers?: any): IPromise; + head(queryParams?: any, headers?: any): IPromise; + trace(queryParams?: any, headers?: any): IPromise; + options(queryParams?: any, headers?: any): IPromise; + patch(queryParams?: any, headers?: any): IPromise; + clone(): IElement; + plain(): any; + plain(): T; + withHttpConfig(httpConfig: angular.IRequestShortcutConfig): IElement; + save(queryParams?: any, headers?: any): IPromise; + getRestangularUrl(): string; + } + + interface ICollection extends IService, Array { + getList(queryParams?: any, headers?: any): ICollectionPromise; + getList(queryParams?: any, headers?: any): ICollectionPromise; + post(elementToPost: any, queryParams?: any, headers?: any): IPromise; + post(elementToPost: T, queryParams?: any, headers?: any): IPromise; + head(queryParams?: any, headers?: any): IPromise; + trace(queryParams?: any, headers?: any): IPromise; + options(queryParams?: any, headers?: any): IPromise; + patch(queryParams?: any, headers?: any): IPromise; + putElement(idx: any, params: any, headers: any): IPromise; + withHttpConfig(httpConfig: angular.IRequestShortcutConfig): ICollection; + clone(): ICollection; + plain(): any; + plain(): T[]; + getRestangularUrl(): string; + } +} diff --git a/catalog-ui/typings/cytoscape/cytoscape-extension.js b/catalog-ui/typings/cytoscape/cytoscape-extension.js new file mode 100644 index 0000000000..dbf22c37b9 --- /dev/null +++ b/catalog-ui/typings/cytoscape/cytoscape-extension.js @@ -0,0 +1 @@ +//# sourceMappingURL=cytoscape-extension.js.map \ No newline at end of file diff --git a/catalog-ui/typings/cytoscape/cytoscape-extension.js.map b/catalog-ui/typings/cytoscape/cytoscape-extension.js.map new file mode 100644 index 0000000000..5eeda401dc --- /dev/null +++ b/catalog-ui/typings/cytoscape/cytoscape-extension.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cytoscape-extension.js","sourceRoot":"","sources":["cytoscape-extension.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/catalog-ui/typings/cytoscape/cytoscape-extension.ts b/catalog-ui/typings/cytoscape/cytoscape-extension.ts new file mode 100644 index 0000000000..88843af088 --- /dev/null +++ b/catalog-ui/typings/cytoscape/cytoscape-extension.ts @@ -0,0 +1,40 @@ +/** + * Created by obarda on 12/21/2016. + */ +declare module Cy { + + interface Instance { + + expandCollapse(options?: ExpandCollapseOptions); + collapseAll(options?: ExpandCollapseOptions); + } + + + + interface CollectionNodes { + + qtip(tooltipOptions: TooltipOption); + } + + + interface TooltipOption { + content?: string | Function; + position?: any; + style?: any; + show?:any; + hide?:any; + includeLabels?: boolean; + } + + interface ExpandCollapseOptions { + layoutBy:any; + fisheye: boolean; + undoable: boolean; + expandCueImage: string; + collapseCueImage: string; + expandCollapseCueSize: number; + expandCollapseCueSensitivity: number; + cueOffset: number; + // expandCollapseCuePosition: string; + } +} \ No newline at end of file diff --git a/catalog-ui/typings/cytoscape/cytoscape.d.ts b/catalog-ui/typings/cytoscape/cytoscape.d.ts new file mode 100644 index 0000000000..e10b6273ae --- /dev/null +++ b/catalog-ui/typings/cytoscape/cytoscape.d.ts @@ -0,0 +1,3095 @@ +// Type definitions for Cytoscape.js 2.4.2 +// Project: http://js.cytoscape.org/ +// Definitions by: Fabian Schmidt +// +// Translation from Objects in help to Typescript interface. +// cy --> Cy.Instance +// the core +// ele --> Cy.CollectionFirst +// a collection of a single element (node or edge) +// eles --> Cy.Collection +// a collection of one or more elements (nodes and edges) +// node --> Cy.CollectionFirstNode +// a collection of a single node +// nodes -> Cy.CollectionNodes +// a collection of one or more nodes +// edge --> Cy.CollectionFirstEdge +// a collection of a single edge +// edges -> Cy.CollectionEdges +// a collection of one or more edges +// +// The library makes a diferrence between input and output parameter due to the dynamic behaviour of the Cytoscape library. +// For a input parameter it will always expect: +// - Cy.Collection +// The input can be any element (node and edge) collection. +// - Cy.CollectionNodes +// The input must be a node collection. +// - Cy.CollectionEdges +// The input must be a edge collection. +// - Cy.CollectionFirst +// The input must be a single element. +// - Cy.CollectionFirstNode +// The inut must be a single node. +// - Cy.CollectionFirstEdge +// The input must be a single edge. +// +// For a output of a function it will always give: +// - Cy.CollectionElements +// The output is a collection of node and edge elements OR single element. +// - Cy.CollectionEdges +// The output is a collection of edge elements OR single edge. +// - Cy.CollectionNodes +// The output is a collection of node elements OR single node. + +declare module Cy { + /** + * See http://js.cytoscape.org/#selectors for details about writing selectors. + */ + import ClipExtent = d3.geo.ClipExtent; + type Selector = string; + + /** + * Possbile values are 'additive' or 'single'. + */ + type SelectionType = string; + + /** + * Possible values are 'nodes' or 'edges'. + */ + type ElementGroup = string; + + /** + * Possible values are 'x' or 'y'. + */ + type PositionDimension = string; + + /** + * Usually temp or nonserialisable data can be stored. + */ + type Scratchpad = any; + + interface CollectionElements extends CollectionEdges, CollectionNodes, CollectionFirstElement { + //Intentionally empty. + } + + interface Extent { + x1: number, y1: number, x2: number, y2: number, w: number, h: number + } + + interface CollectionEdges extends Collection, CollectionFirstEdge, + CollectionEdgesTraversing { + } + + interface CollectionNodes extends Collection, CollectionFirstNode, + CollectionNodesMetadata, CollectionNodesPosition, CollectionNodesTraversing, CollectionNodesCompound { + } + + interface Collection extends CollectionFirst, + CollectionManipulation, CollectionEvents, CollectionData, CollectionPosition, CollectionLayout, CollectionSelection, CollectionStyle, CollectionAnimation, CollectionComparision, CollectionIteration, CollectionBuildingUnion, CollectionAlgorithms, CollectionTraversing { + } + + interface CollectionFirstElement extends CollectionFirstEdge, CollectionFirstNode { + //Intentionally empty. + } + + interface CollectionFirstEdge extends CollectionFirst, + CollectionFirstEdgeData, CollectionFirstEdgeTraversing { + } + + interface CollectionFirstNode extends CollectionFirst, + CollectionFirstNodeMetadata, CollectionFirstNodePosition, CollectionFirstNodeCompound { + } + + interface CollectionFirst extends CollectionFirstManipulation, CollectionFirstData, CollectionFirstPosition, CollectionFirstSelection, CollectionFirstStyle, CollectionFirtsAnimation { + } + + interface CollectionManipulation { + /** + * Remove the elements from the graph. + */ + remove(): CollectionElements; + + /** + * Put removed elements back into the graph. + */ + restore(): CollectionElements; + + /** + * Get a new collection containing clones (i.e. copies) of the elements in the calling collection. + */ + clone(): CollectionElements; + /** + * Get a new collection containing clones (i.e. copies) of the elements in the calling collection. + */ + copy(): CollectionElements; + + /** + * Effectively move edges to different nodes. The modified (actually new) elements are returned. + */ + move(location: { source?: string, target?: string }): CollectionEdges; + /** + * Effectively move nodes to different parent node. The modified (actually new) elements are returned. + */ + move(location: { parent: string }): CollectionNodes; + } + + interface CollectionEvents { + //TODO: http://js.cytoscape.org/#collection/events + //TODO: http://js.cytoscape.org/#collection/events + + // on(event:string, callback: () => void); + + on(events: string, any); + } + + interface CollectionData { + //http://js.cytoscape.org/#collection/data + + // The following fields are immutable: + //id: The id field is used to uniquely identify an element in the graph. + //source & target : These fields define an edge's relationship to nodes, and this relationship can not be changed after creation. + //parent: The parent field defines the parent (compound) node. + + /** + * Remove developer-defined data associated with the elements. + */ + removeData(): CollectionElements; + /** + * Remove developer-defined data associated with the elements. + * + * @param names A space-separated list of fields to delete. + */ + removeData(names: string): CollectionElements; + /** + * Remove developer-defined data associated with the elements. + */ + removeAttr(): CollectionElements; + /** + * Remove developer-defined data associated with the elements. + * + * @param names A space-separated list of fields to delete. + */ + removeAttr(names: string): CollectionElements; + + /** + * Get an array of the plain JavaScript object representation of all elements in the collection. + */ + jsons(): string[]; + } + interface CollectionNodesMetadata { + //http://js.cytoscape.org/#collection/metadata + + /** + * Get the maximum degree of the nodes in the collection. + * + * For a node, the degree is the number of edge connections it has. Each time a node is referenced as source or target of an edge in the graph, that counts as an edge connection. + * + * For a set of nodes, the the total degree is the total number of edge connections to nodes in the set. + * + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + maxDegree(includeLoops: boolean): number; + /** + * Get the minimum indegree of the nodes in the collection. + * + * For a node, the indegree is the number of incoming edge connections it has. Each time a node is referred to as target of an edge in the graph, that counts as an incoming edge connection. + * + * For a set of nodes, the the total degree is the total number of edge connections to nodes in the set. + * + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + minIndegree(includeLoops: boolean): number; + /** + * Get the maximum indegree of the nodes in the collection. + * + * For a node, the indegree is the number of incoming edge connections it has. Each time a node is referred to as target of an edge in the graph, that counts as an incoming edge connection. + * + * For a set of nodes, the the total degree is the total number of edge connections to nodes in the set. + * + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + maxIndegree(includeLoops: boolean): number; + /** + * Get the minimum outdegree of the nodes in the collection. + * + * For a node, the outdegree is the number of outgoing edge connections it has. Each time a node is referred to as source of an edge in the graph, that counts as an outgoing edge connection. + * + * For a set of nodes, the the total degree is the total number of edge connections to nodes in the set. + * + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + minOutdegree(includeLoops: boolean): number; + /** + * Get the maximum outdegree of the nodes in the collection. + * + * For a node, the outdegree is the number of outgoing edge connections it has. Each time a node is referred to as source of an edge in the graph, that counts as an outgoing edge connection. + * + * For a set of nodes, the the total degree is the total number of edge connections to nodes in the set. + * + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + maxOutdegree(includeLoops: boolean): number; + } + + interface BoundingBox { + x1: number; + x2: number; + y1: number; + y2: number; + w: number; + h: number; + } + interface CollectionPosition { + //http://js.cytoscape.org/#collection/position--dimensions + + /** + * Get the bounding box of the elements in model coordinates. + * + * @param options An object containing options for the function. + */ + boundingBox(options: BoundingBoxOptions): BoundingBox; + /** + * Get the bounding box of the elements in model coordinates. + * + * @param options An object containing options for the function. + */ + boundingbox(options?: BoundingBoxOptions): BoundingBox; + + /** + * Get the bounding box of the elements in rendered coordinates. + * + * @param options An object containing options for the function. + */ + renderedBoundingBox(options?: BoundingBoxOptions): BoundingBox; + /** + * Get the bounding box of the elements in rendered coordinates. + * + * @param options An object containing options for the function. + */ + renderedBoundingbox(options?: BoundingBoxOptions): BoundingBox; + } + interface CollectionNodesPosition { + //http://js.cytoscape.org/#collection/position--dimensions + + /** + * Set the positions functionally. + * + * @param callback A callback function that returns the position to set for each element. + * i - The index of the element when iterating over the elements in the collection. + * ele - The element being iterated over for which the function should return a position to set. + */ + positions(callback: (i: number, ele: CollectionNodes) => Position): CollectionNodes; + /** + * Set positions for all nodes based on a single position object. + * + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + positions(pos: Position): CollectionNodes; + + /** + * Set the positions functionally. + * + * @param callback A callback function that returns the position to set for each element. + * i - The index of the element when iterating over the elements in the collection. + * ele - The element being iterated over for which the function should return a position to set. + */ + modelPositions(callback: (i: number, ele: CollectionNodes) => Position): CollectionNodes; + /** + * Set positions for all nodes based on a single position object. + * + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + modelPositions(pos: Position): CollectionNodes; + + /** + * Set the positions functionally. + * + * @param callback A callback function that returns the position to set for each element. + * i - The index of the element when iterating over the elements in the collection. + * ele - The element being iterated over for which the function should return a position to set. + */ + points(callback: (i: number, ele: CollectionNodes) => Position): CollectionNodes; + /** + * Set positions for all nodes based on a single position object. + * + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + points(pos: Position): CollectionNodes; + + /** + * Allow the user to grab the nodes. + */ + grabify(): CollectionNodes; + + /** + * Disallow the user to grab the nodes. + */ + ungrabify(): CollectionNodes; + + /** + * Lock the nodes such that their positions can not be changed. + */ + lock(): CollectionNodes; + /** + * Unlock the nodes such that their positions can be changed. + */ + unlock(): CollectionNodes; + } + interface CollectionLayout { + // http://js.cytoscape.org/#collection/layout + + /** + * Run a layout on the elements in the calling collection, algorithmically positioning the nodes. + * This function is useful for running a layout on a subset of the elements in the graph. + * + * @param options The layout options. + */ + layout(options: LayoutOptions): CollectionElements; + + /** + * Get a new layout, which can be used to algorithmically position the nodes in the collection. + * This function is useful for running a layout on a subset of the elements in the graph, perhaps in parallel to other layouts. + * + * You must specify options.name with the name of the layout you wish to use. + * + * Note: that you must call layout.run() in order for it to affect the graph. + * + * @param options The layout options. + */ + makeLayout(options: LayoutOptions): LayoutInstance; + /** + * Get a new layout, which can be used to algorithmically position the nodes in the collection. + * This function is useful for running a layout on a subset of the elements in the graph, perhaps in parallel to other layouts. + * + * You must specify options.name with the name of the layout you wish to use. + * + * Note: that you must call layout.run() in order for it to affect the graph. + * + * @param options The layout options. + */ + createLayout(options: LayoutOptions): LayoutInstance; + } + interface CollectionSelection { + // http://js.cytoscape.org/#collection/selection + + /** + * Make the elements selected (NB other elements outside the collection are not affected). + */ + select(): CollectionElements; + + /** + * Make the elements not selected (NB other elements outside the collection are not affected). + */ + unselect(): CollectionElements; + /** + * Make the elements not selected (NB other elements outside the collection are not affected). + */ + deselect(): CollectionElements; + + /** + * Make the selection states of the elements mutable. + */ + selectify(): CollectionElements; + + /** + * Make the selection states of the elements immutable. + */ + unselectify(): CollectionElements; + } + interface CollectionStyle { + // http://js.cytoscape.org/#collection/style + + /** + * Add classes to elements. + * + * @param classes A space-separated list of class names to add to the elements. + */ + addClass(classes: string): CollectionElements; + + /** + * Remove classes from elements. + * + * @param classes A space-separated list of class names to remove from the elements. + */ + removeClass(classes: string): CollectionElements; + + /** + * Toggle whether the elements have the specified classes. + * + * @param classes A space-separated list of class names to toggle on the elements. + * @param toggle [optional] Instead of automatically toggling, adds the classes on truthy values or removes them on falsey values. + */ + toggleClass(classes: string, toggle?: boolean): CollectionElements; + + /** + * Add classes to the elements, and then remove the classes after a specified duration. + * + * @param classes A space-separated list of class names to flash on the elements. + * @param duration [optional] The duration in milliseconds that the classes should be added on the elements. After the duration, the classes are removed. + */ + flashClass(classes: string, duration?: number): CollectionElements; + + + /** + * Get a name-value pair object containing visual style properties and their values for the element. + */ + style(): Css.ElementCss; + /** + * Get a particular style property value. + * + * @param name The name of the visual style property to get. + */ + style(name: string): Css.ElementCss; + + /** + * Get a name-value pair object containing visual style properties and their values for the element. + */ + css(): Css.ElementCss; + /** + * Get a particular style property value. + * + * @param name The name of the visual style property to get. + */ + css(name: string): Css.ElementCss; + + /** + * Get a name-value pair object containing visual style properties and their values for the element. + */ + bypass(): Css.ElementCss; + /** + * Get a particular style property value. + * + * @param name The name of the visual style property to get. + */ + bypass(name: string): Css.ElementCss; + + + /** + * Set the specified visual style property for the elements. + * + * You should use this function very sparingly, because it overrides the style of an element, despite the state and classes that it has. In general, it's much better to specify a better stylesheet at initialisation that reflects your application state rather than programmatically modifying style. + * + * If you would like to remove a particular overridden style property, set null to it. + * + * @param name The name of the property to set. + * @param value The value to set to the visual style property. + */ + style(name: string, value: string): CollectionElements; + /** + * Set several visual style properties at once for the elements. + * + * You should use this function very sparingly, because it overrides the style of an element, despite the state and classes that it has. In general, it's much better to specify a better stylesheet at initialisation that reflects your application state rather than programmatically modifying style. + * + * If you would like to remove a particular overridden style property, set null to it. + * + * @param props An object with name-value pairs representing properties to set on the elements. + */ + style(props: Css.ElementCss): CollectionElements; + + /** + * Set the specified visual style property for the elements. + * + * You should use this function very sparingly, because it overrides the style of an element, despite the state and classes that it has. In general, it's much better to specify a better stylesheet at initialisation that reflects your application state rather than programmatically modifying style. + * + * If you would like to remove a particular overridden style property, set null to it. + * + * @param name The name of the property to set. + * @param value The value to set to the visual style property. + */ + css(name: string, value: string): CollectionElements; + /** + * Set several visual style properties at once for the elements. + * + * You should use this function very sparingly, because it overrides the style of an element, despite the state and classes that it has. In general, it's much better to specify a better stylesheet at initialisation that reflects your application state rather than programmatically modifying style. + * + * If you would like to remove a particular overridden style property, set null to it. + * + * @param props An object with name-value pairs representing properties to set on the elements. + */ + css(props: Css.ElementCss): CollectionElements; + + /** + * Set the specified visual style property for the elements. + * + * You should use this function very sparingly, because it overrides the style of an element, despite the state and classes that it has. In general, it's much better to specify a better stylesheet at initialisation that reflects your application state rather than programmatically modifying style. + * + * If you would like to remove a particular overridden style property, set null to it. + * + * @param name The name of the property to set. + * @param value The value to set to the visual style property. + */ + bypass(name: string, value: string): CollectionElements; + /** + * Set several visual style properties at once for the elements. + * + * You should use this function very sparingly, because it overrides the style of an element, despite the state and classes that it has. In general, it's much better to specify a better stylesheet at initialisation that reflects your application state rather than programmatically modifying style. + * + * If you would like to remove a particular overridden style property, set null to it. + * + * @param props An object with name-value pairs representing properties to set on the elements. + */ + bypass(props: Css.ElementCss): CollectionElements; + + /** + * Removes all overridden style of the elements. + */ + removeStyle(): CollectionElements; + /** + * Removes particular overridden style properties of the elements. + * + * @param names A space-separated list of property names for which overridden styles will be removed. + */ + removeStyle(names: string): CollectionElements; + /** + * Removes all overridden style of the elements. + */ + removeCss(): CollectionElements; + /** + * Removes particular overridden style properties of the elements. + * + * @param names A space-separated list of property names for which overridden styles will be removed. + */ + removeCss(names: string): CollectionElements; + /** + * Removes all overridden style of the elements. + */ + removeBypass(): CollectionElements; + /** + * Removes particular overridden style properties of the elements. + * + * @param names A space-separated list of property names for which overridden styles will be removed. + */ + removeBypass(names: string): CollectionElements; + } + interface CollectionAnimation { + // http://js.cytoscape.org/#collection/animation + + /** + * Animate the elements. + * + * Note that you can specify only one of position and renderedPosition: You can not animate to two positions at once. + * + * @param anis An object containing the details of the animation. + * position - A position to which the elements will be animated. + * renderedPosition - A rendered position to which the elements will be animated. + * style - An object containing name-value pairs of style properties to animate. + * @param options An object containing animation options. + * duration - The duration of the animation in milliseconds. + * queue - A boolean indicating whether to queue the animation. + * complete - A function to call when the animation is done. + * step - A function to call each time the animation steps. + */ + animate(anis: { + postion?: Position, + renderedPosition?: Position, + style?: Css.ElementCss + }, options?: { + duration?: number, + queue?: boolean, + complete?: () => void, + step?: () => void + }): CollectionElements; + + /** + * Add a delay between animations for the elements. + * + * @param duration How long the delay should be in milliseconds. + * @param complete A function to call when the delay is complete. + */ + delay(duration: number, complete?: () => void): CollectionElements; + + /** + * Stop all animations that are currently running. + * + * @param clearQueue A boolean, indicating whether the queue of animations should be emptied. + * @param jumpToEnd A boolean, indicating whether the currently-running animations should jump to their ends rather than just stopping midway. + */ + stop(clearQueue?: boolean, jumpToEnd?: boolean): CollectionElements; + + /** + * Remove all queued animations for the elements. + */ + clearQueue(): CollectionElements; + } + interface CollectionComparision { + // http://js.cytoscape.org/#collection/comparison + + /** + * Determine whether this collection contains exactly the same elements as another collection. + * + * @param eles The other elements to compare to. + */ + same(eles: Collection): boolean; + + /** + * Determine whether this collection contains any of the same elements as another collection. + * + * @param eles The other elements to compare to. + */ + anySame(eles: Collection): boolean; + + /** + * Determine whether all elements in the specified collection are in the neighbourhood of the calling collection. + * + * @param eles The other elements to compare to. + */ + allAreNeighbors(eles: Collection): boolean; + /** + * Determine whether all elements in the specified collection are in the neighbourhood of the calling collection. + * + * @param eles The other elements to compare to. + */ + allAreNeighbours(eles: Collection): boolean; + + /** + * Determine whether any element in this collection matches a selector. + * + * @param selector The selector to match against. + */ + is(selector: Selector): boolean; + + /** + * Determine whether all elements in the collection match a selector. + * @param selector The selector to match against. + */ + allAre(selector: Selector): boolean; + + /** + * Determine whether any element in this collection satisfies the specified test function. + * + * @param test The test function that returns truthy values for elements that satisfy the test and falsey values for elements that do not satisfy the test. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being tested. + * @param thisArg [optional] The value for this within the test function. + */ + some(test: (ele: CollectionElements, i: number, eles: CollectionElements) => boolean, thisArg?: any): boolean; + + /** + * Determine whether all elements in this collection satisfy the specified test function. + * + * @param test The test function that returns truthy values for elements that satisfy the test and falsey values for elements that do not satisfy the test. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being tested. + * @param thisArg [optional] The value for this within the test function. + */ + every(test: (ele: CollectionElements, i: number, eles: CollectionElements) => boolean, thisArg?: any): boolean; + } + interface CollectionIteration { + // http://js.cytoscape.org/#collection/iteration + + /** + * Get the number of elements in the collection. + */ + size(): number; + /** + * Get the number of elements in the collection. + */ + length: number; + + /** + * Get whether the collection is empty, meaning it has no elements. + */ + empty(): boolean; + /** + * Get whether the collection is nonempty, meaning it has elements. + */ + nonempty(): boolean; + + /** + * Iterate over the elements in the collection. + * + * Note that although this function is convenient in some cases, it is less efficient than making your own loop. + * + * @param each The function executed each iteration. + * i - The index of the element in the collection. + * ele - The element at the current index. + */ + each(each: (i: number, ele: CollectionElements) => void); + + /** + * Iterate over the elements in the collection using an implementation like the native array function namesake. + * + * This function behaves like Array.prototype.forEach() with minor changes for convenience: + * You can exit the iteration early by returning false in the iterating function. The Array.prototype.forEach() implementation does not support this, but it is included anyway on account of its utility. + * + * @param each The function executed each iteration. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being iterated. + * @param thisArg [optional] The value for this within the iterating function. + */ + forEach(each: (ele: CollectionElements, i: number, eles: CollectionElements) => void|boolean, thisArg?: any); + + /** + * Get an element at a particular index in the collection. + * + * You may use eles[i] in place of eles.eq(i) as a more performant alternative. + * + * @param index The index of the element to get. + */ + eq(index: number): CollectionElements; + /** + * Get an element at a particular index in the collection. + * + * @param index The index of the element to get. + */ + [index: number]: CollectionElements; + /** + * Get the first element in the collection. + */ + first(): CollectionElements; + /** + * Get the last element in the collection. + */ + last(): CollectionElements; + + /** + * Get a subset of the elements in the collection based on specified indices. + * + * @param start [optional] An integer that specifies where to start the selection. The first element has an index of 0. Use negative numbers to select from the end of an array. + * @param end [optional] An integer that specifies where to end the selection. If omitted, all elements from the start position and to the end of the array will be selected. Use negative numbers to select from the end of an array. + */ + slice(start?: number, end?: number): CollectionElements; + } + interface CollectionBuildingUnion { + /** + * Get a new collection, resulting from adding the collection with another one + * + * @param eles The elements to add. + */ + (eles: Collection): CollectionElements; + /** + * Get a new collection, resulting from adding the collection with another one + * + * @param elesArray An array of elements to add. + */ + (elesArray: Collection[]): CollectionElements; + /** + * Get a new collection, resulting from adding the collection with another one + * + * @param selector Elements in the graph matching this selector are added. + */ + (selector: Selector): CollectionElements; + } + interface CollectionBuildingDifference { + /** + * Get a new collection, resulting from the collection without some specified elements. + * + * @param eles The elements that will not be in the resultant collection. + */ + (eles: Collection): CollectionElements; + /** + * Get a new collection, resulting from the collection without some specified elements. + * + * @param selector Elements from the calling collection matching this selector will not be in the resultant collection. + */ + (selector: Selector): CollectionElements; + } + interface CollectionBuildingIntersection { + /** + * Get the elements in both this collection and another specified collection. + * + * @param eles The elements to intersect with. + */ + (eles: Collection): CollectionElements; + /** + * Get the elements in both this collection and another specified collection. + * + * @param selector A selector representing the elements to intersect with. All elements in the graph matching the selector are used as the passed collection. + */ + (selector: Selector): CollectionElements; + } + interface CollectionSymmetricDifference { + /** + * Get the elements that are in the calling collection or the passed collection but not in both. + * + * @param eles The elements to apply the symmetric difference with. + */ + (eles: Collection): CollectionElements; + /** + * Get the elements that are in the calling collection or the passed collection but not in both. + * + * @param selector A selector representing the elements to apply the symmetric difference with. All elements in the graph matching the selector are used as the passed collection. + */ + (selector: Selector): CollectionElements; + } + interface CollectionBuildingUnion { + // http://js.cytoscape.org/#collection/building--filtering + + union: CollectionBuildingUnion; + //[index: "u"]: CollectionBuildingUnion; + add: CollectionBuildingUnion; + //[index: "+"]: CollectionBuildingUnion; + or: CollectionBuildingUnion; + //[index: "|"]: CollectionBuildingUnion; + + difference: CollectionBuildingDifference; + //[index: "\\"]: CollectionBuildingDifference; + not: CollectionBuildingDifference; + //[index: "!"]: CollectionBuildingDifference; + relativeComplement(): CollectionBuildingDifference; + //[index: "-"]: CollectionBuildingDifference; + + /** + * Get all elements in the graph that are not in the calling collection. + */ + absoluteComplement(): CollectionElements; + /** + * Get all elements in the graph that are not in the calling collection. + */ + abscomp(): CollectionElements; + /** + * Get all elements in the graph that are not in the calling collection. + */ + complement(): CollectionElements; + + intersection: CollectionBuildingIntersection; + intersect: CollectionBuildingIntersection; + and: CollectionBuildingIntersection; + //[index: "n"]: CollectionBuildingIntersection; + //[index: "&"]: CollectionBuildingIntersection; + //[index: "."]: CollectionBuildingIntersection; + + symmetricDifference: CollectionSymmetricDifference; + symdiff: CollectionSymmetricDifference; + xor: CollectionSymmetricDifference; + //[index: "^"]: CollectionSymmetricDifference; + //[index: "(+)"]: CollectionSymmetricDifference; + //[index: "(-)"]: CollectionSymmetricDifference; + + //[index: string]: CollectionBuildingDifference |CollectionBuildingUnion | CollectionBuildingIntersection | CollectionSymmetricDifference; + + /** + * Perform a traditional left/right diff on the two collections. + * + * @param eles The elements on the right side of the diff. + */ + diff(eles: Collection): CollectionElements; + /** + * Perform a traditional left/right diff on the two collections. + * + * @param selector A selector representing the elements on the right side of the diff. All elements in the graph matching the selector are used as the passed collection. + * @return This function returns a plain object of the form { left, right, both } where + * left - is the set of elements only in the calling (i.e. left) collection, + * right - is the set of elements only in the passed (i.e. right) collection, and + * both - is the set of elements in both collections. + */ + diff(selector: Selector): { + left: CollectionElements, + right: CollectionElements, + both: CollectionElements + }; + + /** + * Get a new collection containing elements that are accepted by the specified filter. + * + * @param selector The selector to match against. + */ + filter(selector: Selector): CollectionElements; + /** + * Get a new collection containing elements that are accepted by the specified filter. + * + * @filter selector The filter function that returns true for elements to include. + * i - The index of the current element being considered. + * ele - The element being considered. + */ + filter(filter: (i: number, ele: CollectionElements) => boolean): CollectionElements; + /** + * Get the nodes that match the specified selector. + * + * @param selector The selector to match against. + */ + nodes(selector: Selector): CollectionNodes; + /** + * Get the edges that match the specified selector. + * + * @param selector The selector to match against. + */ + edges(selector: Selector): CollectionEdges; + + /** + * Get a new collection containing elements that are accepted by the specified filter, using an implementation like the standard array namesake. + * + * @param filter The filter function that returns truthy values for elements to include and falsey values for elements to exclude. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being filtered. + * @param thisArg [optional] The value for this within the iterating function. + */ + filterFn(filter: (ele: CollectionElements, i: number, eles: CollectionElements) => boolean, thisArg?: any): CollectionElements; + /** + * Get a new collection containing elements that are accepted by the specified filter, using an implementation like the standard array namesake. + * + * @param filter The filter function that returns truthy values for elements to include and falsey values for elements to exclude. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being filtered. + * @param thisArg [optional] The value for this within the iterating function. + */ + fnFilter(filter: (ele: CollectionElements, i: number, eles: CollectionElements) => boolean, thisArg?: any): CollectionElements; + /** + * Get a new collection containing elements that are accepted by the specified filter, using an implementation like the standard array namesake. + * + * @param filter The filter function that returns truthy values for elements to include and falsey values for elements to exclude. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being filtered. + * @param thisArg [optional] The value for this within the iterating function. + */ + stdFilter(filter: (ele: CollectionElements, i: number, eles: CollectionElements) => boolean, thisArg?: any): CollectionElements; + + /** + * Get a new collection containing the elements sorted by the specified comparison function. + * + * @param sort The sorting comparison function that returns a negative number for ele1 before ele2, 0 for ele1 same as ele2, or a positive number for ele1 after ele2. + */ + sort(sort: (ele1: CollectionElements, ele2: CollectionElements) => number): CollectionElements; + + /** + * Get an array containing values mapped from the collection. + * + * @param fn The function that returns the mapped value for each element. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being mapped. + * @param thisArg [optional] The value for this within the iterating function. + */ + map(fn: (ele: CollectionElements, i: number, eles: CollectionElements) => any, thisArg?: any): any[]; + + /** + * Find a minimum value in a collection. + * + * @param fn The function that returns the value to compare for each element. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being mapped. + * @param thisArg [optional] The value for this within the iterating function. + */ + min(fn: (ele: CollectionElements, i: number, eles: CollectionElements) => any, thisArg?: any): { + /** + * The minimum value found. + */ + value: any, + /** + * The element that corresponds to the minimum value. + */ + ele: CollectionElements + }; + + /** + * Find a maximum value and the corresponding element. + * + * @param fn The function that returns the value to compare for each element. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being mapped. + * @param thisArg [optional] The value for this within the iterating function. + */ + max(fn: (ele: CollectionElements, i: number, eles: CollectionElements) => any, thisArg?: any): { + /** + * The maximum value found. + */ + value: any, + /** + * The element that corresponds to the maximum value. + */ + ele: CollectionElements + }; + } + interface CollectionTraversing { + // http://js.cytoscape.org/#collection/traversing + + /** + * Get the open neighbourhood of the elements. + * + * The neighbourhood returned by this function is a bit different than the traditional definition of a "neighbourhood": This returned neighbourhood includes the edges connecting the collection to the neighbourhood. This gives you more flexibility. + * An open neighbourhood is one that does not include the original set of elements. If unspecified, a neighbourhood is open by default. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + neighborhood(selector?: Selector): CollectionElements; + /** + * Get the open neighbourhood of the elements. + * + * The neighbourhood returned by this function is a bit different than the traditional definition of a "neighbourhood": This returned neighbourhood includes the edges connecting the collection to the neighbourhood. This gives you more flexibility. + * An open neighbourhood is one that does not include the original set of elements. If unspecified, a neighbourhood is open by default. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + openNeighborhood(selector?: Selector): CollectionElements; + /** + * Get the closed neighbourhood of the elements. + * + * The neighbourhood returned by this function is a bit different than the traditional definition of a "neighbourhood": This returned neighbourhood includes the edges connecting the collection to the neighbourhood. This gives you more flexibility. + * A closed neighbourhood is one that does include the original set of elements. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + closedNeighborhood(selector?: Selector): CollectionElements; + } + interface CollectionEdgesTraversing { + // http://js.cytoscape.org/#collection/traversing + + /** + * Get the nodes connected to the edges in the collection + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + connectedNodes(selector?: Selector): CollectionNodes; + + /** + * Get source nodes connected to the edges in the collection. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + sources(selector?: Selector): CollectionNodes; + + /** + * Get target nodes connected to the edges in the collection. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + targets(selector?: Selector): CollectionNodes; + + /** + * Get edges parallel to those in the collection. + * + * Two edges are said to be parallel if they connect the same two nodes. Any two parallel edges may connect nodes in the same direction, in which case the edges share the same source and target. They may alternatively connect nodes in the opposite direction, in which case the source and target are reversed in the second edge. + * That is: + * - edge1.source().id() === edge2.source().id() + * && edge1.target().id() === edge2.target().id() + * OR + * - edge1.source().id() === edge2.target().id() + * && edge1.target().id() === edge2.source().id() + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + parallelEdges(selector?: Selector): CollectionEdges; + + /** + * Get edges codirected to those in the collection. + * + * Two edges are said to be codirected if they connect the same two nodes in the same direction: The edges have the same source and target. + * That is: + * - edge1.source().id() === edge2.source().id() + * && edge1.target().id() === edge2.target().id() + + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + codirectedEdges(selector?: Selector): CollectionEdges; + } + interface CollectionNodesTraversing { + // http://js.cytoscape.org/#collection/traversing + + /** + * Get the edges connecting the collection to another collection. Direction of the edges does not matter. + * + * @param eles The other collection. + */ + edgesWith(eles: Collection): CollectionEdges; + /** + * Get the edges connecting the collection to another collection. Direction of the edges does not matter. + * + * @param selector The other collection, specified as a selector which is matched against all elements in the graph. + */ + edgesWith(selector: Selector): CollectionEdges; + + /** + * Get the edges coming from the collection (i.e. the source) going to another collection (i.e. the target). + * + * @param eles The other collection. + */ + edgesTo(eles: Collection): CollectionEdges; + /** + * Get the edges coming from the collection (i.e. the source) going to another collection (i.e. the target). + * + * @param selector The other collection, specified as a selector which is matched against all elements in the graph. + */ + edgesTo(selector: Selector): CollectionEdges; + + /** + * Get the edges connected to the nodes in the collection. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + connectedEdges(selector?: Selector): CollectionEdges; + + /** + * From the set of calling nodes, get the nodes which are leaves (i.e. no outgoing edges, as in a directed acyclic graph). + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + leaves(selector?: Selector): CollectionNodes; + + /** + * Get edges (and their targets) coming out of the nodes in the collection. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + outgoers(selector?: Selector): CollectionEdges; + + /** + * Recursively get edges (and their targets) coming out of the nodes in the collection (i.e. the outgoers, the outgoers' outgoers, ...). + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + successors(selector?: Selector): CollectionEdges; + + /** + * Get edges (and their sources) coming into the nodes in the collection. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + incomers(selector?: Selector): CollectionEdges; + + /** + * Recursively get edges (and their sources) coming into the nodes in the collection (i.e. the incomers, the incomers' incomers, ...). + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + predecessors(selector?: Selector): CollectionEdges; + } + interface SearchBreadthFirstOptions { + /** + * The root nodes (selector or collection) to start the search from. + */ + roots: Selector|Collection; + /** + * A handler function that is called when a node is visited in the search. The handler returns true when it finds the desired node, and it returns false to cancel the search. + * i - The index indicating this node is the ith visited node. + * depth - How many edge hops away this node is from the root nodes. + * v - The current node. + * e - The edge connecting the previous node to the current node. + * u - The previous node. + */ + visit?: (i: number, depth: number, v: CollectionNodes, e: CollectionEdges, u: CollectionNodes) => boolean; + /** + * A boolean indicating whether the algorithm should only go along edges from source to target (default false). + */ + directed?: boolean; + } + interface SearchBreadthFirstResult { + /** + * The path of the search. + * - The path returned includes edges such that if path[i] is a node, then path[i - 1] is the edge used to get to that node. + */ + path: CollectionElements; + /** + * The node found by the search + * - If no node was found, then found is empty. + * - If your handler function returns false, then the only the path up to that point is returned. + */ + found: CollectionNodes; + } + interface SearchDijkstraOptions { + /** + * The root node (selector or collection) where the algorithm starts. + */ + root: Selector|Collection; + + /** + * A function that returns the positive numeric weight for this edge. + * + * If no weight function is defined, a constant weight of 1 is used for each edge. + */ + weight?: (edge: CollectionEdges) => number; + + /** + * A boolean indicating whether the algorithm should only go along edges from source to target (default false). + */ + directed?: boolean; + } + interface SearchDijkstraResult { + /** + * Returns the distance from the source node to node. + */ + distanceTo: (node: CollectionFirstNode) => number; + + /** + * Returns a collection containing the shortest path from the source node to node. + * The path starts with the source node and includes the edges between the nodes in the path such that if pathTo(node)[i] is an edge, then pathTo(node)[i-1] is the previous node in the path and pathTo(node)[i+1] is the next node in the path. + */ + pathTo: (node: CollectionFirstNode) => Collection; + } + interface SearchAStarOptions { + } + interface SearchAStarResult { + } + interface CollectionAlgorithms { + // http://js.cytoscape.org/#collection/algorithms + + /** + * Perform a breadth-first search within the elements in the collection. + * + * Note that this function performs a breadth-first search on only the subset of the graph in the calling collection. + */ + breadthFirstSearch(options: SearchBreadthFirstOptions): SearchBreadthFirstResult; + /** + * Perform a breadth-first search within the elements in the collection. + * + * Note that this function performs a breadth-first search on only the subset of the graph in the calling collection. + * + * @param roots The root nodes (selector or collection) to start the search from. + * @param visit [optional] A handler function that is called when a node is visited in the search. The handler returns true when it finds the desired node, and it returns false to cancel the search. + * i - The index indicating this node is the ith visited node. + * depth - How many edge hops away this node is from the root nodes. + * v - The current node. + * e - The edge connecting the previous node to the current node. + * u - The previous node. + * @param directed [optional] A boolean indicating whether the search should only go along edges from source to target (default false). + */ + breadthFirstSearch(roots: Selector|Collection, + visit?: (i: number, depth: number, v: CollectionNodes, e: CollectionEdges, u: CollectionNodes) => boolean, + directed?: boolean): SearchBreadthFirstResult; + /** + * Perform a breadth-first search within the elements in the collection. + * + * Note that this function performs a breadth-first search on only the subset of the graph in the calling collection. + */ + bfs(options: SearchBreadthFirstOptions): SearchBreadthFirstResult; + /** + * Perform a breadth-first search within the elements in the collection. + * + * Note that this function performs a breadth-first search on only the subset of the graph in the calling collection. + * + * @param roots The root nodes (selector or collection) to start the search from. + * @param visit [optional] A handler function that is called when a node is visited in the search. The handler returns true when it finds the desired node, and it returns false to cancel the search. + * i - The index indicating this node is the ith visited node. + * depth - How many edge hops away this node is from the root nodes. + * v - The current node. + * e - The edge connecting the previous node to the current node. + * u - The previous node. + * @param directed [optional] A boolean indicating whether the search should only go along edges from source to target (default false). + */ + bfs(roots: Selector|Collection, + visit?: (i: number, depth: number, v: CollectionNodes, e: CollectionEdges, u: CollectionNodes) => boolean, + directed?: boolean): SearchBreadthFirstResult; + + /** + * Perform a depth-first search within the elements in the collection. + * + * Note that this function performs a depth-first search on only the subset of the graph in the calling collection. + */ + depthFirstSearch(options: SearchBreadthFirstOptions): SearchBreadthFirstResult; + /** + * Perform a depth-first search within the elements in the collection. + * + * Note that this function performs a depth-first search on only the subset of the graph in the calling collection. + * + * @param roots The root nodes (selector or collection) to start the search from. + * @param visit [optional] A handler function that is called when a node is visited in the search. The handler returns true when it finds the desired node, and it returns false to cancel the search. + * i - The index indicating this node is the ith visited node. + * depth - How many edge hops away this node is from the root nodes. + * v - The current node. + * e - The edge connecting the previous node to the current node. + * u - The previous node. + * @param directed [optional] A boolean indicating whether the search should only go along edges from source to target (default false). + */ + depthFirstSearch(roots: Selector|Collection, + visit?: (i: number, depth: number, v: CollectionNodes, e: CollectionEdges, u: CollectionNodes) => boolean, + directed?: boolean): SearchBreadthFirstResult; + /** + * Perform a depth-first search within the elements in the collection. + * + * Note that this function performs a depth-first search on only the subset of the graph in the calling collection. + */ + dfs(options: SearchBreadthFirstOptions): SearchBreadthFirstResult; + /** + * Perform a depth-first search within the elements in the collection. + * + * Note that this function performs a depth-first search on only the subset of the graph in the calling collection. + * + * @param roots The root nodes (selector or collection) to start the search from. + * @param visit [optional] A handler function that is called when a node is visited in the search. The handler returns true when it finds the desired node, and it returns false to cancel the search. + * i - The index indicating this node is the ith visited node. + * depth - How many edge hops away this node is from the root nodes. + * v - The current node. + * e - The edge connecting the previous node to the current node. + * u - The previous node. + * @param directed [optional] A boolean indicating whether the search should only go along edges from source to target (default false). + */ + dfs(roots: Selector|Collection, + visit?: (i: number, depth: number, v: CollectionNodes, e: CollectionEdges, u: CollectionNodes) => boolean, + directed?: boolean): SearchBreadthFirstResult; + + /** + * Perform Dijkstra's algorithm on the elements in the collection. This finds the shortest paths to all other nodes in the collection from the root node. + * + * Note that this function performs Dijkstra's algorithm on only the subset of the graph in the calling collection. + */ + dijkstra(options: SearchDijkstraOptions): SearchDijkstraResult; + /** + * Perform Dijkstra's algorithm on the elements in the collection. This finds the shortest paths to all other nodes in the collection from the root node. + * + * Note that this function performs Dijkstra's algorithm on only the subset of the graph in the calling collection. + * + * @param root The root node (selector or collection) where the algorithm starts. + * @param weight [optional] A function that returns the positive numeric weight for this edge. + * If no weight function is defined, a constant weight of 1 is used for each edge. + * @param directed [optional] A boolean indicating whether the algorithm should only go along edges from source to target (default false). + */ + dijkstra(root: Selector|Collection, + weight?: (edge: CollectionEdges) => number, + directed?: boolean): SearchDijkstraResult; + + + //TODO: continue here: http://js.cytoscape.org/#collection/algorithms/eles.dijkstra + } + interface CollectionNodesCompound { + // http://js.cytoscape.org/#collection/compound-nodes + + /** + * Get the compound parent node of each node in the collection. + * + * @param selector [optional] A selector used to filter the resultant collection. + */ + parent(selector?: Selector): CollectionNodes; + + /** + * Get all compound ancestor nodes (i.e. parents, parents' parents, etc.) of each node in the collection. + * + * @param selector [optional] A selector used to filter the resultant collection. + */ + parents(selector?: Selector): CollectionNodes; + /** + * Get all compound ancestor nodes (i.e. parents, parents' parents, etc.) of each node in the collection. + * + * @param selector [optional] A selector used to filter the resultant collection. + */ + ancestors(selector?: Selector): CollectionNodes; + + /** + * Get all compound ancestors common to all the nodes in the collection, starting with the closest and getting progressively farther. + * + * You can get the closest common ancestor via + * nodes.commonAncestors().first() + * and the farthest via + * nodes.commonAncestors().last() + * , because the common ancestors are in descending order of closeness. + * + * @param selector [optional] A selector used to filter the resultant collection + */ + commonAncestors(selector?: Selector): CollectionNodes; + + /** + * Get all orphan (i.e. has no compound parent) nodes in the calling collection. + * + * @param selector [optional] A selector used to filter the resultant collection. + */ + orphans(selector?: Selector): CollectionNodes; + + /** + * Get all nonorphan (i.e. has a compound parent) nodes in the calling collection. + * + * @param selector [optional] A selector used to filter the resultant collection. + */ + nonorphans(selector?: Selector): CollectionNodes; + + /** + * Get all compound child (i.e. direct descendant) nodes of each node in the collection. + * + * @param selector [optional] A selector used to filter the resultant collection. + */ + children(selector?: Selector): CollectionNodes; + + /** + * Get all compound descendant (i.e. children, children's children, etc.) nodes of each node in the collection. + * + * @param selector [optional] A selector used to filter the resultant collection. + */ + descendants(selector?: Selector): CollectionNodes; + + /** + * Get all sibling (i.e. same compound parent) nodes of each node in the collection. + * + * @param selector [optional] A selector used to filter the resultant collection. + */ + siblings(selector?: Selector): CollectionNodes; + } + + interface CollectionFirstManipulation { + /** + * Get whether the element has been removed from the graph. + */ + removed(): boolean; + /** + * Get whether the element is inside the graph (i.e. not removed). + */ + inside(): boolean; + + } + interface CollectionFirstData { + //http://js.cytoscape.org/#collection/data + + /** + * Get all data for the element. + */ + data(): any; + /** + * Get a particular data field for the element. + */ + data(name: string): any; + /** + * Set a particular data field for the element. + */ + data(name: string, value: any); + /** + * Update multiple data fields at once via an object. + */ + data(obj: any); + + /** + * Get the entire scratchpad object for the element, where temporary or non-JSON data can be stored. App-level scratchpad data should use namespaces prefixed with underscore, like '_foo'. + */ + scratch(): Scratchpad; + /** + * Get the scratchpad at a particular namespace, where temporary or non-JSON data can be stored. App-level scratchpad data should use namespaces prefixed with underscore, like '_foo'. + * + * @param namespace A namespace string. + */ + scratch(namespace: string): Scratchpad; + /** + * Set the scratchpad at a particular namespace, where temporary or non-JSON data can be stored. App-level scratchpad data should use namespaces prefixed with underscore, like '_foo'. + * + * @param namespace A namespace string. + * @param value The value to set at the specified namespace. + */ + scratch(namespace: string, value: any): Scratchpad; + + /** + * Remove scratchpad data. You should remove scratchpad data only at your own namespaces. + * + * @param namespace A namespace string. + */ + removeScratch(namespace: string); + + /** + * A shortcut to get the ID of an element. + */ + id(): string; + + /** + * Get the element's plain JavaScript object representation. + */ + json(): string; + + /** + * Get the group string that defines the type of the element. + * + * The group strings are 'nodes' for nodes and 'edges' for edges. In general, you should be using ele.isEdge() and ele.isNode() instead of ele.group(). + */ + group(): ElementGroup; + + /** + * Get whether the element is a node. + */ + isNode(): boolean; + + /** + * Get whether the element is an edge. + */ + isEdge(): boolean; + + + cy(): Cy.Instance + } + interface CollectionFirstEdgeData { + //http://js.cytoscape.org/#collection/data + + /** + * Get whether the edge is a loop (i.e. source same as target). + */ + isLoop(): boolean; + + /** + * Get whether the edge is simple (i.e. source different than target). + */ + isSimple(): boolean; + } + interface CollectionFirstNodeMetadata { + //http://js.cytoscape.org/#collection/metadata + + /** + * Get the degree of a node. + * + * For a node, the degree is the number of edge connections it has. Each time a node is referenced as source or target of an edge in the graph, that counts as an edge connection. + * + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + degree(includeLoops: boolean): number; + /** + * Get the indegree of a node. + * + * For a node, the indegree is the number of incoming edge connections it has. Each time a node is referred to as target of an edge in the graph, that counts as an incoming edge connection. + * + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + indegree(includeLoops: boolean): number; + /*** + * Get the outdegree of a node. + * + * For a node, the outdegree is the number of outgoing edge connections it has. Each time a node is referred to as source of an edge in the graph, that counts as an outgoing edge connection. + * + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + outdegree(includeLoops: boolean): number; + } + interface CollectionFirstNodePosition extends CollectionPosition{ + //http://js.cytoscape.org/#collection/position--dimensions + + /** + * Get the (model) position of a node. + */ + position(): Position; + /** + * Get the value of a specified position dimension. + * + * @param dimension The position dimension to get. + */ + position(dimension: PositionDimension): Position; + /** + * Set the value of a specified position dimension. + * + * @param dimension The position dimension to set. + * @param value The value to set to the dimension. + */ + position(dimension: PositionDimension, value: number): CollectionNodes; + /** + * Set the position using name-value pairs in the specified object. + * + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + position(pos: Position): CollectionNodes; + + /** + * Get the (model) position of a node. + */ + modelPosition(): Position; + /** + * Get the value of a specified position dimension. + * + * @param dimension The position dimension to get. + */ + modelPosition(dimension: PositionDimension): Position; + /** + * Set the value of a specified position dimension. + * + * @param dimension The position dimension to set. + * @param value The value to set to the dimension. + */ + modelPosition(dimension: PositionDimension, value: number): CollectionNodes; + /** + * Set the position using name-value pairs in the specified object. + * + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + modelPosition(pos: Position): CollectionNodes; + + /** + * Get the (model) position of a node. + */ + point(): Position; + /** + * Get the value of a specified position dimension. + * + * @param dimension The position dimension to get. + */ + point(dimension: PositionDimension): Position; + /** + * Set the value of a specified position dimension. + * + * @param dimension The position dimension to set. + * @param value The value to set to the dimension. + */ + point(dimension: PositionDimension, value: number): CollectionNodes; + /** + * Set the position using name-value pairs in the specified object. + * + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + point(pos: Position): CollectionNodes; + + /** + * Get the rendered (on-screen) position of a node. + */ + renderedPosition(): Position; + /** + * Get the value of a specified rendered posisition dimension. + * + * @param dimension The position dimension to get. + */ + renderedPosition(dimension: PositionDimension): number; + /** + * Set the value of a specified rendered posisition dimension. + * + * @param dimension The position dimension to get. + * @param value The value to set to the dimension. + */ + renderedPosition(dimension: PositionDimension, value: number): CollectionNodes; + /** + * Set the rendered position using name-value pairs in the specified object. + * + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + renderedPosition(pos: Position): CollectionNodes; + + /** + * Get the rendered (on-screen) position of a node. + */ + renderedPoint(): Position; + /** + * Get the rendered (on-screen) position of a node. + * + * @param dimension The position dimension to get. + */ + renderedPoint(dimension: PositionDimension): number; + /** + * Set the value of a specified rendered posisition dimension. + * + * @param dimension The position dimension to get. + * @param value The value to set to the dimension. + */ + renderedPoint(dimension: PositionDimension, value: number): CollectionNodes; + /** + * Set the rendered position using name-value pairs in the specified object. + * + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + renderedPoint(pos: Position): CollectionNodes; + + /** + * Get the position of a node, relative to its compound parent. + */ + relativePosition(): Position; + /** + * Get the position of a node, relative to its compound parent. + * + * @param dimension The position dimension to get. + */ + relativePosition(dimension: PositionDimension): number; + /** + * Set the value of a specified relative posisition dimension. + * + * @param dimension The position dimension to get. + * @param value The value to set to the dimension. + */ + relativePosition(dimension: PositionDimension, value: number): CollectionNodes; + /** + * Set the relative position using name-value pairs in the specified object. + * + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + relativePosition(pos: Position): CollectionNodes; + + /** + * Get the position of a node, relative to its compound parent. + */ + relativePoint(): Position; + /** + * Get the position of a node, relative to its compound parent. + * + * @param dimension The position dimension to get. + */ + relativePoint(dimension: PositionDimension): number; + /** + * Set the value of a specified relative posisition dimension. + * + * @param dimension The position dimension to get. + * @param value The value to set to the dimension. + */ + relativePoint(dimension: PositionDimension, value: number): CollectionNodes; + /** + * Set the relative position using name-value pairs in the specified object. + * + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + relativePoint(pos: Position): CollectionNodes; + } + interface CollectionFirstPosition { + //http://js.cytoscape.org/#collection/position--dimensions + + /** + * Get the width of the element. + */ + width(): number; + /** + * Get the outer width of the element (includes width & border). + */ + outerWidth(): number; + /** + * Get the width of the element in rendered dimensions. + */ + renderedWidth(): number; + /** + * Get the outer width of the element (includes width & border) in rendered dimensions. + */ + renderedOuterWidth(): number; + + /** + * Get the height of the element. + */ + height(): number; + /** + * Get the outer height of the element (includes height & border). + */ + outerHeight(): number; + /** + * Get the height of the element in rendered dimensions. + */ + renderedHeight(): number; + /** + * Get the outer height of the element (includes height & border) in rendered dimensions. + */ + renderedOuterHeight(): number; + + /** + * Gets whether the element is active (e.g. on user tap, grab, etc). + */ + active(): boolean; + } + interface CollectionFirstSelection { + // http://js.cytoscape.org/#collection/selection + + /** + * Get whether the element is selected. + */ + selected(): boolean; + + /** + * Get whether the element's selection state is mutable. + */ + selectable(): boolean; + } + interface CollectionFirstStyle { + // http://js.cytoscape.org/#collection/style + + /** + * Get whether an element has a particular class. + * + * @param className The name of the class to test for. + */ + hasClass(className: string): boolean; + + ///** + //* Get a name-value pair object containing visual style properties and their values for the element. + //*/ + //style(): Css.ElementCss; + ///** + // * Get a particular style property value. + // * + // * @param name The name of the visual style property to get. + // */ + //style(name: string): Css.ElementCss; + + ///** + // * Get a name-value pair object containing visual style properties and their values for the element. + // */ + //css(): Css.ElementCss; + ///** + // * Get a particular style property value. + // * + // * @param name The name of the visual style property to get. + // */ + //css(name: string): Css.ElementCss; + + ///** + // * Get a name-value pair object containing visual style properties and their values for the element. + // */ + //bypass(): Css.ElementCss; + ///** + // * Get a particular style property value. + // * + // * @param name The name of the visual style property to get. + // */ + //bypass(name: string): Css.ElementCss; + + /** + * Get a name-value pair object containing rendered visual style properties and their values for the element. + */ + renderedStyle(): Css.ElementCss; + /** + * Get a particular rendered style property value. + * + * @param name The name of the visual style property to get. + */ + renderedStyle(name: string): Css.ElementCss; + /** + * Get a name-value pair object containing rendered visual style properties and their values for the element. + */ + renderedCss(): Css.ElementCss; + /** + * Get a particular rendered style property value. + * + * @param name The name of the visual style property to get. + */ + renderedCss(name: string): Css.ElementCss; + + /** + * Get whether the element is visible. + */ + visible(): boolean; + /** + * Get whether the element is hidden. + */ + hidden(): boolean; + + /** + * Get the effective opacity of the element (i.e. on-screen opacity), which takes into consideration parent node opacity. + */ + effectiveOpacity(): number; + + /** + * Get whether the element's effective opacity is completely transparent, which takes into consideration parent node opacity. + */ + transparent(): boolean; + } + interface CollectionFirtsAnimation { + // http://js.cytoscape.org/#collection/animation + + /** + * Get whether the element is currently being animated. + */ + animated(): boolean; + } + interface CollectionFirstEdgeTraversing { + // http://js.cytoscape.org/#collection/traversing + + /** + * Get source node of this edge. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + source(selector?: Selector): CollectionNodes; + + /** + * Get target node of this edge. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + target(selector?: Selector): CollectionNodes; + } + interface CollectionFirstNodeCompound { + // http://js.cytoscape.org/#collection/compound-nodes + + /** + * Get whether the node is a compound parent (i.e. a node containing one or more child nodes) + */ + isParent(): boolean; + + /** + * Get whether the node is a compound child (i.e. contained within a node) + */ + isChild(): boolean; + } + + interface ElementsDefinition { + nodes: Sdc.Models.Graph.CommonNodeBase[]; + edges: Sdc.Models.CommonLinkBase[]; + } + + interface ElementDefinition { + + + group?: ElementGroup; + data: Sdc.Models.Graph.CommonNodeBase| Sdc.Models.CommonLinkBase; + /** + * Scratchpad data (usually temp or nonserialisable data) + */ + scatch?: Scratchpad; + /** + * The model position of the node (optional on init, mandatory after) + */ + position?: Position; + /** + * can alternatively specify position in rendered on-screen pixels + */ + renderedPosition?: Position; + /** + * Whether the element is selected (default false) + */ + selected?: boolean; + /** + * Whether the selection state is mutable (default true) + */ + selectable?: boolean; + /** + * When locked a node's position is immutable (default false) + */ + locked?: boolean; + /** + * Wether the node can be grabbed and moved by the user + */ + grabbable?: boolean; + /** + * a space separated list of class names that the element has + */ + classes?: string; + style?: CSSStyleDeclaration; + /** + * you should only use `style`/`css` for very special cases; use classes instead + */ + css?: Css.ElementCss; + } + + // interface ElementDataDefinition { + // /** + // * elided id => autogenerated id + // */ + // isSdcElement?: boolean; + // id?: string; + // position?: Position; + // label?: string; + // } + interface EdgeDefinition extends ElementDefinition { + data: Sdc.Models.CommonLinkBase; + } + + // interface EdgeDataDefinition extends ElementDataDefinition { /** + // * the source node id (edge comes from this node) + // */ + // source: string; + // /** + // * the target node id (edge goes to this node) + // */ + // target: string; + // commonGraphLink?: Sdc.Models.CompositionCiLinkBase; //this is sdc-link-data-object + // } + interface NodeDefinition extends ElementDefinition { + + data: Sdc.Models.Graph.CommonNodeBase; + + } + // interface NodeDataDefinition extends ElementDataDefinition { + // parent?: string; + // commonGraphNode?: Sdc.Models.Graph.CommonNodeBase; //this is sdc-node-data-object + // type: string + // + // } + + interface Stylesheet { + selector: string; + css: Css.ElementCss; + } + + export module Css { + //TODO: http://js.cytoscape.org/#style + + type Colour = string; + + // TODO: How to constrain to a value? + type Shape = string; // 'rectangle', 'roundrectangle', 'ellipse', 'triangle', pentagon, hexagon, heptagon, octagon, star + + // TODO: How to constrain to a value? + type Style = string; // solid, dotted, dashed, or double + + export interface NodeCss { + width?: number; + height?: number; + shape?: Shape; + backgroundColor?: Colour; + "background-color"?: any; + "background-blacken"?: number; + "background-opacity"?: number; + "background-image"?: any; + "background-width"?: number; + "background-height"?: number; + "border-width"?: number; + "border-style"?: Style; + "border-color"?: Colour; + "border-opacity"?: number; + "label"?: string; + "events"?: string; + "text-events"?: string; + "text-valign"? :string; + "text-halign"? :string; + "text-margin-y"? :any; + "active-bg-size"?: number; + "background-fit"?: string; + "background-clip"?: string; + "background-image-opacity"?: number; + "overlay-color"?: string; + "font-size"? :number; + "font-family"? :string; + "background-position-x"? :number; + "background-position-y"? :number; + 'overlay-opacity'?: number; + 'text-border-width'?: number; + 'text-border-color'?: string; + 'text-border-opacity'?: number; + } + + export interface SelectionBox { + "selection-box-color"?: string + "selection-box-border-color"?: string + "selection-box-border-width"?: number + "selection-box-opacity"?: number + + } + + export interface CompoundNodeCss extends NodeCss { + "padding-left"?: number; + "padding-right"?: number; + "padding-top"?: number; + "padding-bottom"?: number; + "compound-sizing-wrt-labels"?: string; + } + + export interface EdgeCss { + + "line-color"?: string; + "target-arrow-color"?: string; + "target-arrow-shape"?: string; + "curve-style"?: string; + "control-point-step-size"?: number; + "control-point-distances"?: string, + "control-point-weights"?: string, + "segment-distances"?: string, + "segment-weights"?: string + "line-style"? : string + } + + export interface ElementCss extends NodeCss, CompoundNodeCss, EdgeCss, SelectionBox { + } + //export interface ElementCss extends CSSStyleDeclaration { } + } + + interface Renderer { + /** + * The name of the renderer to use. By default, the 'canvas' renderer is used. If you build and register your own renderer, then you can specify its name here. + */ + name: string; + } + + interface Instance extends InstanceEvent, InstanceViewPort, InstanceAnimation, InstanceLayout, InstanceStyle, InstanceExport { + /** + * Add elements to the graph and return them. + */ + add(eleObj: ElementDefinition): CollectionElements; + /** + * Add elements to the graph and return them. + */ + add(eleObjs: ElementDefinition[]): CollectionElements; + /** + * Add elements to the graph and return them. + */ + add(eles: Collection): CollectionElements; + + /** + * Remove elements from the graph and return them. + */ + remove(eles: Collection): CollectionElements; + /** + * Remove elements in the graph matching the specified selector. + */ + remove(selector: Selector): CollectionElements; + + /** + * Get an empty collection. + */ + collection(): CollectionElements; + /** + * Get a collection from elements in the graph matching the specified selector. + */ + collection(selector: Selector): CollectionElements; + /** + * Get a collection from an array of elements. + */ + collection(elesArray: CollectionElements[]): CollectionElements; + + /** + * Get an element from its ID in a very performant way. + */ + getElementById(id: string): CollectionElements; + + /** + * Get elements in the graph matching the specified selector. + */ + $(selector: Selector): CollectionElements; + /** + * Get elements in the graph. + */ + elements(): CollectionElements; + /** + * Get elements in the graph matching the specified selector. + */ + elements(selector: Selector): CollectionElements; + /** + * Get nodes in the graph. + */ + nodes(): CollectionNodes; + /** + * Get nodes in the graph matching the specified selector. + */ + nodes(selector: Selector): CollectionNodes; + /** + * Get edges in the graph. + */ + edges(): CollectionEdges; + /** + * Get edges in the graph matching the specified selector. + */ + edges(selector: Selector): CollectionEdges; + /** + * Get elements in the graph matching the specified selector. + */ + filter(selector: Selector): CollectionElements; + /** + * Get elements in the graph matching the specified filter function. + */ + filter(filter: (i: number, ele: CollectionFirst) => boolean): CollectionElements; + + /** + * Allow for manipulation of elements without triggering multiple style calculations or multiple redraws. + * + * A callback within which you can make batch updates to elements. + */ + batch(callback: () => void): void; + /** + * Allow for manipulation of elements without triggering multiple style calculations or multiple redraws. + * Starts batching manually (useful for asynchronous cases). + */ + startBatch(): void; + /** + * Allow for manipulation of elements without triggering multiple style calculations or multiple redraws. + * Ends batching manually (useful for asynchronous cases). + */ + endBatch(): void; + + /** + * A convenience function to explicitly destroy the instance. + */ + destroy(): void; + } + + interface EventObject { + /** + * Holds a reference to the originator of the event (core or element) + */ + cyTarget: any; //CollectionElements or Cy.Instance; + data: any; + } + + interface InstanceEvent { + // http://js.cytoscape.org/#core/events + + /** + * Bind to events that occur in the graph. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + */ + on(events: string, handler: (evt: EventObject, data?: any) => void): void; + /** + * Bind to events that occur in the graph. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + */ + on(events: string, selector: Selector, handler: (evt: EventObject, data?: any) => void): void; + /** + * Bind to events that occur in the graph. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + */ + on(events: string, selector: Selector, data: any, handler: (evt: EventObject, data?: any) => void): void; + /** + * Bind to events that occur in the graph. + * + * @param eventsMap A map of event names to handler functions. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + */ + on(eventsMap: { + [value: string]: (evt: EventObject, data?: any) => void + }, selector?: Selector, data?: any); + + /** + * Bind to events that occur in the graph. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + */ + bind(events: string, handler: (evt: EventObject, data?: any) => void): void; + /** + * Bind to events that occur in the graph. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + */ + bind(events: string, selector: Selector, handler: (evt: EventObject, data?: any) => void): void; + /** + * Bind to events that occur in the graph. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + */ + bind(events: string, selector: Selector, data: any, handler: (evt: EventObject, data?: any) => void): void; + /** + * Bind to events that occur in the graph. + * + * @param eventsMap A map of event names to handler functions. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + */ + bind(eventsMap: { + [value: string]: (evt: EventObject, data?: any) => void + }, selector?: Selector, data?: any); + + /** + * Bind to events that occur in the graph. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + */ + listen(events: string, handler: (evt: EventObject) => void): void; + /** + * Bind to events that occur in the graph. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + */ + listen(events: string, selector: Selector, handler: (evt: EventObject) => void): void; + /** + * Bind to events that occur in the graph. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + */ + listen(events: string, selector: Selector, data: any, handler: (evt: EventObject) => void): void; + /** + * Bind to events that occur in the graph. + * + * @param eventsMap A map of event names to handler functions. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + */ + listen(eventsMap: { + [value: string]: (evt: EventObject) => void + }, selector?: Selector, data?: any); + + /** + * Bind to events that occur in the graph. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + */ + addListener(events: string, handler: (evt: EventObject) => void): void; + /** + * Bind to events that occur in the graph. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + */ + addListener(events: string, selector: Selector, handler: (evt: EventObject) => void): void; + /** + * Bind to events that occur in the graph. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + */ + addListener(events: string, selector: Selector, data: any, handler: (evt: EventObject) => void): void; + /** + * Bind to events that occur in the graph. + * + * @param eventsMap A map of event names to handler functions. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + */ + addListener(eventsMap: { + [value: string]: (evt: EventObject) => void + }, selector?: Selector, data?: any); + + /** + * Bind to events that occur in the graph, and trigger the handler only once. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + */ + one(events: string, handler: (evt: EventObject) => void): void; + /** + * Bind to events that occur in the graph, and trigger the handler only once. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + */ + one(events: string, selector: Selector, handler: (evt: EventObject) => void): void; + /** + * Bind to events that occur in the graph, and trigger the handler only once. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + */ + one(events: string, selector: Selector, data: any, handler: (evt: EventObject) => void): void; + /** + * Bind to events that occur in the graph, and trigger the handler only once. + * + * @param eventsMap A map of event names to handler functions. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + */ + one(eventsMap: { + [value: string]: (evt: EventObject) => void + }, selector?: Selector, data?: any); + + /** + * Remove event handlers. + * @param events A space separated list of event names. + * @param selector [optional] The same selector used to bind to the events. + * @param handler [optional] A reference to the handler function to remove. + */ + off(events: string, selector?: Selector, handler?: (evt: EventObject) => void): void; + + /** + * Remove event handlers. + * @param eventsMap A map of event names to handler functions to remove. + * @param selector [optional] The same selector used to bind to the events. + */ + off(eventsMap: { + [value: string]: (evt: EventObject) => void + }, selector?: Selector): void; + + /** + * Remove event handlers. + * @param events A space separated list of event names. + * @param selector [optional] The same selector used to bind to the events. + * @param handler [optional] A reference to the handler function to remove. + */ + unbind(events: string, selector?: Selector, handler?: (evt: EventObject) => void): void; + + /** + * Remove event handlers. + * @param eventsMap A map of event names to handler functions to remove. + * @param selector [optional] The same selector used to bind to the events. + */ + unbind(eventsMap: { + [value: string]: (evt: EventObject) => void + }, selector?: Selector): void; + + /** + * Remove event handlers. + * @param events A space separated list of event names. + * @param selector [optional] The same selector used to bind to the events. + * @param handler [optional] A reference to the handler function to remove. + */ + unlisten(events: string, selector?: Selector, handler?: (evt: EventObject) => void): void; + + /** + * Remove event handlers. + * @param eventsMap A map of event names to handler functions to remove. + * @param selector [optional] The same selector used to bind to the events. + */ + unlisten(eventsMap: { + [value: string]: (evt: EventObject) => void + }, selector?: Selector): void; + + /** + * Remove event handlers. + * @param events A space separated list of event names. + * @param selector [optional] The same selector used to bind to the events. + * @param handler [optional] A reference to the handler function to remove. + */ + removeListener(events: string, selector?: Selector, handler?: (evt: EventObject) => void): void; + + /** + * Remove event handlers. + * + * @param eventsMap A map of event names to handler functions to remove. + * @param selector [optional] The same selector used to bind to the events. + */ + removeListener(eventsMap: { + [value: string]: (evt: EventObject) => void + }, selector?: Selector): void; + + /** + * Trigger one or more events. + * + * @param events A space separated list of event names to trigger. + * @param extraParams [optional] An array of additional parameters to pass to the handler. + */ + trigger(events: string, extraParams?: any[]): void; + + /** + * Trigger one or more events. + * + * @param events A space separated list of event names to trigger. + * @param extraParams [optional] An array of additional parameters to pass to the handler. + */ + emit(events: string, extraParams?: any[]): void; + + /** + * Get whether the initial render event has occurred (useful for plugins etc). + * + * This function returns whether the initrender event has occurred on the graph, meaning that the renderer has drawn the graph at least once. This is useful when you need to grab image data from the core, as this function will let you know whether that data is available yet: You can not grab the graph scene if it has not yet been rendered. + */ + initrender(): boolean; + + /** + * Run a handler function every time a frame is rendered. + * + * @param handler The handler function to call on each frame. + */ + onRender(handler: () => void): void; + + /** + * Remove handlers function bound via cy.onRender(). + * + * @param handler [optional] A reference to the handler function to remove. All handlers are removed if this is unspecified. + */ + offRender(handler?: () => void): void; + + /** + * Run a callback as soon as the graph becomes ready. If the graph is already ready, then the callback is called immediately. + * @param fn The callback run as soon as the graph is ready, inside which this refers to the core (cy). + */ + ready(fn: () => void): void; + } + + interface InstanceViewPort { + // http://js.cytoscape.org/#core/viewport-manipulation + + /** + * Pan the graph to the centre of a collection. + * + * @param eles The collection to centre upon. + */ + center(eles?: Collection): CollectionElements; + + /** + * Pan and zooms the graph to fit to a collection. + * + * @param eles [optional] The collection to fit to. + * @param padding [optional] An amount of padding (in pixels) to have around the graph + */ + fit(eles?: Collection, padding?: number): CollectionElements; + + /** + * Reset the graph to the default zoom level and panning position. + */ + reset(): CollectionElements; + + /** + * Get the panning position of the graph. + */ + pan(): Position; + + /** + * Set the panning position of the graph. + * + * @param renderedPosition The rendered position to pan the graph to. + */ + pan(renderedPosition?: Position): void; + + /** + * Relatively pan the graph by a specified rendered position vector. + * + * @param renderedPosition The rendered position vector to pan the graph by. + */ + panBy(renderedPosition: Position): void; + + /** + * Get whether panning is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. + */ + panningEnabled(): boolean; + + /** + * Set whether panning is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. + * + * @param bool A truthy value enables panning; a falsey value disables it. + */ + panningEnabled(bool: boolean): void; + + /** + * Get whether panning by user events (e.g. dragging the graph background) is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. + */ + userPanningEnabled(): boolean; + + /** + * Set whether panning by user events (e.g. dragging the graph background) is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. + * + * @param bool A truthy value enables user panning; a falsey value disables it. + */ + userPanningEnabled(bool: boolean): void; + + /** + * Get the zoom level. + */ + zoom(): number; + /** + * Set the zoom level. + * + * @param level The zoom level to set. + */ + zoom(level: number): void; + /** + * Set the zoom level. + * + * @param options The options for zooming. + */ + zoom(options: ZoomOptions): void; + + /** + * Get whether zooming is enabled. + */ + zoomingEnabled(): boolean; + /** + * Set whether zooming is enabled. + * + * @param bool A truthy value enables zooming; a falsey value disables it. + */ + zoomingEnabled(bool: boolean): void; + + /** + * Get whether zooming by user events (e.g. mouse wheel, pinch-to-zoom) is enabled. + */ + userZoomingEnabled(): boolean; + /** + * Set whether zooming by user events (e.g. mouse wheel, pinch-to-zoom) is enabled. + * + * @param bool A truthy value enables user zooming; a falsey value disables it. + */ + userZoomingEnabled(bool: boolean): void; + + /** + * Get the minimum zoom level. + */ + minZoom(): number; + /** + * Set the minimum zoom level. + * + * @param zoom The new minimum zoom level to use. + */ + minZoom(zoom: number): void; + + /** + * Get the maximum zoom level. + */ + maxZoom(): number; + /** + * Set the maximum zoom level. + * + * @param zoom The new maximum zoom level to use. + */ + maxZoom(zoom: number): void; + + /** + * Set the viewport state (pan & zoom) in one call. + * + * @param zoom The zoom level to set. + * @param pan The pan to set (a rendered position). + */ + viewport(zoom: number, pan: Position): void; + + /** + * Get whether box selection is enabled. If enabled, the user must hold left-click to initiate panning. + */ + boxSelectionEnabled(): boolean; + /** + * Set whether box selection is enabled. If enabled, the user must hold left-click to initiate panning. + * + * @param bool A truthy value enables box selection; a falsey value disables it. + */ + boxSelectionEnabled(bool: boolean): void; + + /** + * Get the on-screen width of the viewport in pixels. + */ + width(): number; + + /** + * Get the on-screen height of the viewport in pixels. + */ + height(): number; + + /** + * Get the extent of the viewport, a bounding box in model coordinates that lets you know what model positions are visible in the viewport. + */ + extent(): Extent; + + /** + * Get whether nodes are automatically locked (i.e. if true, nodes are locked despite their individual state). + */ + autolock(): boolean; + /** + * Set whether nodes are automatically locked (i.e. if true, nodes are locked despite their individual state). + * + * @param bool A truthy value enables autolocking; a falsey value disables it. + */ + autolock(bool: boolean): void; + + /** + * Get whether nodes are automatically ungrabified (i.e. if true, nodes are ungrabbale despite their individual state). + */ + autoungrabify(): boolean; + /** + * Set whether nodes are automatically ungrabified (i.e. if true, nodes are ungrabbale despite their individual state). + * + * @param bool A truthy value enables autolocking; a falsey value disables it. + */ + autoungrabify(bool: boolean): void; + + /** + * Get whether nodes are automatically unselectified (i.e. if true, nodes are unselectable despite their individual state). + */ + autounselectify(): boolean; + /** + * Set whether nodes are automatically unselectified (i.e. if true, nodes are unselectable despite their individual state). + * + * @param bool A truthy value enables autolocking; a falsey value disables it. + */ + autounselectify(bool: boolean): void; + + /** + * Force the renderer to redraw (i.e. draw a new frame). + * + * This function forces the renderer to draw a new frame. It is useful for very specific edgecases, such as in certain UI plugins, but it should not be needed for most developers. + */ + forceRender(): void; + + /** + * Force the renderer to recalculate the viewport bounds. + * + * If your code resizes the graph's dimensions or position (i.e. by changing the style of the HTML DOM element that holds the graph), you will want to call cy.resize() to have the graph resize and redraw itself. + * + * Cytoscape.js can not automatically monitor the bounding box of the viewport, as querying the DOM for those dimensions can be expensive. Although cy.resize() is automatically called for you on the window's resize event, there is no resize or style event for arbitrary DOM elements. + */ + resize(): CollectionElements; + } + + interface InstanceAnimation { + // http://js.cytoscape.org/#core/animation + + /** + * Get whether the viewport is currently being animated. + */ + animated(): boolean; + + /** + * Animate the viewport. + * + * @param anis An object containing the details of the animation. + * zoom A zoom level to which the graph will be animated. + * pan A panning position to which the graph will be animated. + * panBy A relative panning position to which the graph will be animated. + * fit An object containing fitting options from which the graph will be animated. + * eles Elements or a selector to which the viewport will be fitted. + * padding Padding to use with the fitting. + * center An object containing centring options from which the graph will be animated. + * eles Elements or a selector to which the viewport will be centred. + * @param options An object containing animation options. + * duration - The duration of the animation in milliseconds. + * queue - A boolean indicating whether to queue the animation. + * complete - A function to call when the animation is done. + * step - A function to call each time the animation steps. + */ + animate(anis: { + zoom?: number, + pan?: Position, + panBy?: Position, + fit?: { + eles: Collection, + padding?: number + }, + center?: { + eles: Collection + } + }, options?: { + duration?: number, + queue?: boolean, + complete?: () => void, + step?: () => void + }): Cy.Instance; + + /** + * Add a delay between animations for the viewport. + * + * @param duration How long the delay should be in milliseconds. + * @param complete A function to call when the delay is complete. + */ + delay(duration: number, complete?: () => void): Cy.Instance; + + /** + * Stop all viewport animations that are currently running. + * + * @param clearQueue A boolean, indicating whether the queue of animations should be emptied. + * @param jumpToEnd A boolean, indicating whether the currently-running animations should jump to their ends rather than just stopping midway. + */ + stop(clearQueue?: boolean, jumpToEnd?: boolean): Cy.Instance; + + /** + * Remove all queued animations for the viewport. + */ + clearQueue(): Cy.Instance; + } + + interface InstanceLayout { + //TODO: http://js.cytoscape.org/#core/layout + layout(layout: LayoutOptions): void; + + } + + interface InstanceStyle { + //TODO: http://js.cytoscape.org/#core/style + } + + interface InstanceExport { + /** + * Export the current graph view as a PNG image in Base64 representation. + */ + png(): string; + /** + * Export the current graph view as a PNG image in Base64 representation. + */ + png(options: ExportOptions): string; + + /** + * Export the current graph view as a JPG image in Base64 representation. + */ + jpg(): string; + /** + * Export the current graph view as a JPG image in Base64 representation. + */ + jpg(options: ExportOptions): string; + + /** + * Export the current graph view as a JPG image in Base64 representation. + */ + jpeg(): string; + /** + * Export the current graph view as a JPG image in Base64 representation. + */ + jpeg(options: ExportOptions): string; + + /** + * Export the graph as JSON, the same format used at initialisation. + */ + json(): string; + } + + interface Position { + x: number; + y: number; + } + + interface LayoutInstance { + //TODO: http://js.cytoscape.org/#layouts/layout-manipulation + + /** + * Start running the layout. + */ + run(): void; + /** + * Start running the layout. + */ + start(): void; + + /** + * Stop running the (asynchronous/discrete) layout. + */ + stop(): void; + } + + interface LayoutOptions { + // TODO: http://js.cytoscape.org/#layouts + /** + * + * The default is 'grid'. + */ + name?: string; + padding?: number; + avoidOverlap?: boolean; + } + + interface CytoscapeOptions { + // very commonly used options: + /** + * A HTML DOM element in which the graph should be rendered. + * This is optional if Cytoscape.js is run headlessly or if you initialise using jQuery (in which case your jQuery object already has an associated DOM element). + * + * The default is undefined. + */ + container?: HTMLElement | JQuery; + /** + * The [[Stylesheet]] used to style the graph. For convenience, this option can alternatively be specified as a promise that resolves to the stylesheet. + */ + style?: Stylesheet[]|Promise; + /** + * An array of [[Elements]] specified as plain objects. For convenience, this option can alternatively be specified as a promise that resolves to the elements JSON. + */ + elements?: ElementsDefinition|ElementDefinition[]|Promise|Promise; + /** + * A plain object that specifies layout options. Which layout is initially run is specified by the name field. Refer to a layout's documentation for the options it supports. If you want to specify your node positions yourself in your elements JSON, you can use the preset layout — by default it does not set any positions, leaving your nodes in their current positions (e.g. specified in options.elements at initialisation time) + */ + layout?: LayoutOptions; + /** + * A callback function that is called when Cytoscape.js has loaded the graph and the layout has specified initial positions of the nodes. After this point, rendering can happen, the user can interact with the graph, et cetera. + */ + ready?: (evt: any) => void; + + // initial viewport state: + /** + * The initial zoom level of the graph. Make sure to disable viewport manipulation options, such as fit, in your layout so that it is not overridden when the layout is applied. You can set options.minZoom and options.maxZoom to set restrictions on the zoom level. + * + * The default value is 1. + */ + zoom?: number; + /** + * The initial panning position of the graph. Make sure to disable viewport manipulation options, such as fit, in your layout so that it is not overridden when the layout is applied. + */ + pan?: Position; + + // interaction options?: + /** + * A minimum bound on the zoom level of the graph. The viewport can not be scaled smaller than this zoom level. + * + * The default value is 1e-50. + */ + minZoom?: number; + /** + * A maximum bound on the zoom level of the graph. The viewport can not be scaled larger than this zoom level. + * + * The default value is 1e50. + */ + maxZoom?: number; + /** + * Whether zooming the graph is enabled, both by user events and programmatically. + * + * The default value is true. + */ + zoomingEnabled?: boolean; + /** + * Whether user events (e.g. mouse wheel, pinch-to-zoom) are allowed to zoom the graph. Programmatic changes to zoom are unaffected by this option. + * + * The default value is true. + */ + userZoomingEnabled?: boolean; + /** + * Whether panning the graph is enabled, both by user events and programmatically. + * + * The default value is true. + */ + panningEnabled?: boolean; + /** + * Whether user events (e.g. dragging the graph background) are allowed to pan the graph. Programmatic changes to pan are unaffected by this option. + * + * The default value is true. + */ + userPanningEnabled?: boolean; + /** + * Whether box selection (i.e. drag a box overlay around, and release it to select) is enabled. If enabled, the user must taphold to pan the graph. + * + * The default value is false. + */ + boxSelectionEnabled?: boolean; + /** + * A string indicating the selection behaviour from user input. By default, this is set automatically for you based on the type of input device detected. On touch devices, 'additive' is default — a new selection made by the user adds to the set of currenly selected elements. On mouse-input devices, 'single' is default — a new selection made by the user becomes the entire set of currently selected elements (i.e. the previous elements are unselected). + * + * The default value is (isTouchDevice ? 'additive' : 'single'). + */ + selectionType?: SelectionType; + /** + * A nonnegative integer that indicates the maximum allowable distance that a user may move during a tap gesture, on touch devices and desktop devices respectively. This makes tapping easier for users. These values have sane defaults, so it is not advised to change these options unless you have very good reason for doing so. Larger values will almost certainly have undesirable consequences. + * + * The default value is is 8. + */ + touchTapThreshold?: number; + /** + * A nonnegative integer that indicates the maximum allowable distance that a user may move during a tap gesture, on touch devices and desktop devices respectively. This makes tapping easier for users. These values have sane defaults, so it is not advised to change these options unless you have very good reason for doing so. Larger values will almost certainly have undesirable consequences. + * + * The default value is 4. + */ + desktopTapThreshold?: number; + /** + * Whether nodes should be locked (not draggable at all) by default (if true, overrides individual node state). + * + * The default value is false. + */ + autolock?: boolean; + /** + * Whether nodes should be ungrabified (not grabbable by user) by default (if true, overrides individual node state). + * + * The default value is false. + */ + autoungrabify?: boolean; + /** + * Whether nodes should be unselectified (immutable selection state) by default (if true, overrides individual element state). + * + * The default value is false. + */ + autounselectify?: boolean; + + // rendering options: + /** + * A convenience option that initialises the instance to run headlessly. You do not need to set this in environments that are implicitly headless (e.g. Node.js). However, it is handy to set headless: true if you want a headless instance in a browser. + * + * The default value is false. + */ + headless?: boolean; + /** + * A boolean that indicates whether styling should be used. For headless (i.e. outside the browser) environments, display is not necessary and so neither is styling necessary — thereby speeding up your code. You can manually enable styling in headless environments if you require it for a special case. Note that it does not make sense to disable style if you plan on rendering the graph. + * + * The default value is true. + */ + styleEnabled?: boolean; + /** + * When set to true, the renderer does not render edges while the viewport is being manipulated. This makes panning, zooming, dragging, et cetera more responsive for large graphs. + * + * The default value is false. + */ + hideEdgesOnViewport?: boolean; + /** + * hen set to true, the renderer does not render labels while the viewport is being manipulated. This makes panning, zooming, dragging, et cetera more responsive for large graphs. + * + * The default value is false. + */ + hideLabelsOnViewport?: boolean; + /** + * When set to true, the renderer uses a texture (if supported) during panning and zooming instead of drawing the elements, making large graphs more responsive. + * + * The default value is false. + */ + textureOnViewport?: boolean; + /** + * When set to true, the renderer will use a motion blur effect to make the transition between frames seem smoother. This can significantly increase the perceived performance for a large graphs. + * + * The default value is false. + */ + motionBlur?: boolean; + /** + * When motionBlur: true, this value controls the opacity of motion blur frames. Higher values make the motion blur effect more pronounced. + * + * The default value is 0.2. + */ + motionBlurOpacity?: number; + /** + * Changes the scroll wheel sensitivity when zooming. This is a multiplicative modifier. So, a value between 0 and 1 reduces the sensitivity (zooms slower), and a value greater than 1 increases the sensitivity (zooms faster). + * + * The default value is 1. + */ + wheelSensitivity?: number; + /** + * Overrides the screen pixel ratio with a manually set value (1.0 or 0.666 recommended, if set). This can be used to increase performance on high density displays by reducing the effective area that needs to be rendered. If you want to use the hardware's actual pixel ratio at the expense of performance, you can set pixelRatio: 'auto'. + * + * The default value is 1. + */ + pixelRatio?: number; + /** + * A callback function that is called when Cytoscape.js has rendered its first frame. This is useful for grabbing screenshots etc after initialision, but in general you should use ready instead. + */ + initrender?: (evt: any) => void; + /** + * A plain object containing options for the renderer to be used. The options.renderer.name field specifies which renderer is used. You need not specify anything for the renderer option, unless you want to specify one of the rendering options. + */ + renderer?: Renderer; + } + + interface ExportOptions { + /** + * The background colour of the image (transparent by default). + */ + bg?: string; + /** + * Whether to export the current viewport view (false, default) or the entire graph (true). + */ + full?: boolean; + /** + * This value specifies a positive number that scales the size of the resultant image. + */ + scale?: number; + /** + * Specifies the scale automatically in combination with maxHeight such that the resultant image is no wider than maxWidth. + */ + maxWidth?: number; + /** + * Specifies the scale automatically in combination with maxWidth such that the resultant image is no taller than maxHeight. + */ + maxHeight?: number; + } + + interface BoundingBoxOptions { + /** + * A boolean indicating whether to include nodes in the bounding box. + */ + includeNodes: boolean; + /** + * A boolean indicating whether to include edges in the bounding box. + */ + includeEdges: boolean; + /** + * A boolean indicating whether to include labels in the bounding box. + */ + includeLabels: boolean; + /** + * A boolean indicating whether to include shadows in the bounding box (default true). + */ + + includeShadows: boolean + } + + interface ZoomOptions { + /** + * The zoom level to set. + */ + level: number; + /** + * The position about which to zoom. + */ + position?: Position; + /** + * The rendered position about which to zoom. + */ + renderedPosition?: Position; + } + + interface Static { + (options?: CytoscapeOptions): Instance; + (extensionName: string, foo: string, bar: any): Instance; + version: string; + + Promise(): Cy.Promise; + } + + enum PromiseState { + STATE_PENDING = 0, + STATE_FULFILLED = 1, + STATE_REJECTED = 2 + + } + + interface Promise { + id: string; + state: PromiseState; + fulfillValue: T; + rejectReason: any; + onFulfilled: any[]; + onRejected: any[]; + + fulfill(value: T): Promise; + reject(error: any): Promise; + then(onFulfilled?: (value: T) => U | Promise, onRejected?: (error: any) => U | Promise): Promise; + then(onFulfilled?: (value: T) => U | Promise, onRejected?: (error: any) => void): Promise; + } +} + +declare module "cytoscape" { + export = cytoscape; +} + +declare var cytoscape: Cy.Static; \ No newline at end of file diff --git a/catalog-ui/typings/cytoscape/edge-editation.d.ts b/catalog-ui/typings/cytoscape/edge-editation.d.ts new file mode 100644 index 0000000000..e5ebd709b2 --- /dev/null +++ b/catalog-ui/typings/cytoscape/edge-editation.d.ts @@ -0,0 +1,28 @@ +/** + * Created by obarda on 11/6/2016. + */ + +interface CytoscapeEdgeEditation { + new(): CytoscapeEdgeEditation; + + init(cy: Cy.Instance, handleSize?: number):void; + registerHandle(handle: Handle): void; +} + +interface Handle { + positionX: string, + positionY: string, + offsetX?: number, + offsetY?: number, + color: string, + type: string, + single: boolean, + nodeTypeNames: Array; + imageUrl: string; + lineWidth: number; + lineStyle: string; +} + +declare var CytoscapeEdgeEditation: CytoscapeEdgeEditation; + +declare function require(name:string); \ No newline at end of file diff --git a/catalog-ui/typings/d3/d3.d.ts b/catalog-ui/typings/d3/d3.d.ts new file mode 100644 index 0000000000..ff4335106c --- /dev/null +++ b/catalog-ui/typings/d3/d3.d.ts @@ -0,0 +1,3308 @@ +/*- + * ============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========================================================= + */ +// Type definitions for d3JS +// Project: http://d3js.org/ +// Definitions by: Alex Ford , Boris Yankov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module d3 { + /** + * The current version of D3.js. + */ + export var version: string; + + /** + * Find the first element that matches the given selector string. + */ + export function select(selector: string): Selection; + + /** + * Create a selection from the given node reference. + */ + export function select(node: EventTarget): Selection; + + /** + * Find all elements that match the given selector string. + */ + export function selectAll(selector: string): Selection; + + /** + * Create a selection from the given list of nodes. + */ + export function selectAll(nodes: EventTarget[]): Selection; + + /** + * Returns the root selection (as if by d3.select(document.documentElement)). This function may be used for 'instanceof' tests, and extending its prototype will add properties to all selections. + */ + export function selection(): Selection; + + module selection { + export var prototype: Selection; + + /** + * Selections are grouped into arrays of nodes, with the parent tracked in the 'parentNode' property. + */ + interface Group extends Array { + parentNode: EventTarget; + } + + interface Update { + /** + * Retrieve a grouped selection. + */ + [index: number]: Group; + + /** + * The number of groups in this selection. + */ + length: number; + + /** + * Retrieve the value of the given attribute for the first node in the selection. + * + * @param name The attribute name to query. May be prefixed (see d3.ns.prefix). + */ + attr(name: string): string; + + /** + * For all nodes, set the attribute to the specified constant value. Use null to remove. + * + * @param name The attribute name, optionally prefixed. + * @param value The attribute value to use. Note that this is coerced to a string automatically. + */ + attr(name: string, value: Primitive): Update; + + /** + * Derive an attribute value for each node in the selection based on bound data. + * + * @param name The attribute name, optionally prefixed. + * @param value The function of the datum (the bound data item) and index (the position in the subgrouping) which computes the attribute value. If the function returns null, the attribute is removed. + */ + attr(name: string, value: (datum: Datum, index: number) => Primitive): Update; + + /** + * Set multiple properties at once using an Object. D3 iterates over all enumerable properties and either sets or computes the attribute's value based on the corresponding entry in the Object. + * + * @param obj A key-value mapping corresponding to attributes and values. If the value is a simple string or number, it is taken as a constant. Otherwise, it is a function that derives the attribute value. + */ + attr(obj: { [key: string]: Primitive | ((datum: Datum, index: number) => Primitive) }): Update; + + /** + * Returns true if the first node in this selection has the given class list. If multiple classes are specified (i.e., "foo bar"), then returns true only if all classes match. + * + * @param name The class list to query. + */ + classed(name: string): boolean; + + /** + * Adds (or removes) the given class list. + * + * @param name The class list to toggle. Spaces separate class names: "foo bar" is a list of two classes. + * @param value If true, add the classes. If false, remove them. + */ + classed(name: string, value: boolean): Update; + + /** + * Determine if the given class list should be toggled for each node in the selection. + * + * @param name The class list. Spaces separate multiple class names. + * @param value The function to run for each node. Should return true to add the class to the node, or false to remove it. + */ + classed(name: string, value: (datum: Datum, index: number) => boolean): Update; + + /** + * Set or derive classes for multiple class lists at once. + * + * @param obj An Object mapping class lists to values that are either plain booleans or functions that return booleans. + */ + classed(obj: { [key: string]: boolean | ((datum: Datum, index: number) => boolean) }): Update; + + /** + * Retrieve the computed style value for the first node in the selection. + * @param name The CSS property name to query + */ + style(name: string): string; + + /** + * Set a style property for all nodes in the selection. + * @param name the CSS property name + * @param value the property value + * @param priority if specified, either null or the string "important" (no exclamation mark) + */ + style(name: string, value: Primitive, priority?: string): Update; + + /** + * Derive a property value for each node in the selection. + * @param name the CSS property name + * @param value the function to derive the value + * @param priority if specified, either null or the string "important" (no exclamation mark) + */ + style(name: string, value: (datum: Datum, index: number) => Primitive, priority?: string): Update; + + /** + * Set a large number of CSS properties from an object. + * + * @param obj an Object whose keys correspond to CSS property names and values are either constants or functions that derive property values + * @param priority if specified, either null or the string "important" (no exclamation mark) + */ + style(obj: { [key: string]: Primitive | ((datum: Datum, index: number) => Primitive) }, priority?: string): Update; + + /** + * Retrieve an arbitrary node property such as the 'checked' property of checkboxes, or the 'value' of text boxes. + * + * @param name the node's property to retrieve + */ + property(name: string): any; + + /** + * For each node, set the property value. Internally, this sets the node property directly (e.g., node[name] = value), so take care not to mutate special properties like __proto__. + * + * @param name the property name + * @param value the property value + */ + property(name: string, value: any): Update; + + /** + * For each node, derive the property value. Internally, this sets the node property directly (e.g., node[name] = value), so take care not to mutate special properties like __proto__. + * + * @param name the property name + * @param value the function used to derive the property's value + */ + property(name: string, value: (datum: Datum, index: number) => any): Update; + + /** + * Set multiple node properties. Caveats apply: take care not to mutate special properties like __proto__. + * + * @param obj an Object whose keys correspond to node properties and values are either constants or functions that will compute a value. + */ + property(obj: { [key: string]: any | ((datum: Datum, index: number) => any) }): Update; + + /** + * Retrieve the textContent of the first node in the selection. + */ + text(): string; + + /** + * Set the textContent of each node in the selection. + * @param value the text to use for all nodes + */ + text(value: Primitive): Update; + + /** + * Compute the textContent of each node in the selection. + * @param value the function which will compute the text + */ + text(value: (datum: Datum, index: number) => Primitive): Update; + + /** + * Retrieve the HTML content of the first node in the selection. Uses 'innerHTML' internally and will not work with SVG or other elements without a polyfill. + */ + html(): string; + + /** + * Set the HTML content of every node in the selection. Uses 'innerHTML' internally and thus will not work with SVG or other elements without a polyfill. + * @param value the HTML content to use. + */ + html(value: string): Selection; + + /** + * Compute the HTML content for each node in the selection. Uses 'innerHTML' internally and thus will not work with SVG or other elements without a polyfill. + * @param value the function to compute HTML content + */ + html(value: (datum: Datum, index: number) => string): Selection; + + /** + * Appends a new child to each node in the selection. This child will inherit the parent's data (if available). Returns a fresh selection consisting of the newly-appended children. + * + * @param name the element name to append. May be prefixed (see d3.ns.prefix). + */ + append(name: string): Selection; + + /** + * Appends a new child to each node in the selection by computing a new node. This child will inherit the parent's data (if available). Returns a fresh selection consisting of the newly-appended children. + * + * @param name the function to compute a new element + */ + append(name: (datum: Datum, index: number) => EventTarget): Update; + + /** + * Inserts a new child to each node in the selection. This child will inherit its parent's data (if available). Returns a fresh selection consisting of the newly-inserted children. + * @param name the element name to append. May be prefixed (see d3.ns.prefix). + * @param before the selector to determine position (e.g., ":first-child") + */ + insert(name: string, before: string): Update; + + /** + * Inserts a new child to each node in the selection. This child will inherit its parent's data (if available). Returns a fresh selection consisting of the newly-inserted children. + * @param name the element name to append. May be prefixed (see d3.ns.prefix). + * @param before a function to determine the node to use as the next sibling + */ + insert(name: string, before: (datum: Datum, index: number) => EventTarget): Update; + + /** + * Inserts a new child to the end of each node in the selection by computing a new node. This child will inherit its parent's data (if available). Returns a fresh selection consisting of the newly-inserted children. + * @param name the function to compute a new child + * @param before the selector to determine position (e.g., ":first-child") + */ + insert(name: (datum: Datum, index: number) => EventTarget, before: string): Update; + + /** + * Inserts a new child to the end of each node in the selection by computing a new node. This child will inherit its parent's data (if available). Returns a fresh selection consisting of the newly-inserted children. + * @param name the function to compute a new child + * @param before a function to determine the node to use as the next sibling + */ + insert(name: (datum: Datum, index: number) => EventTarget, before: (datum: Datum, index: number) => EventTarget): Update; + + /** + * Removes the elements from the DOM. They are in a detached state and may be re-added (though there is currently no dedicated API for doing so). + */ + remove(): Update; + + /** + * Retrieves the data bound to the first group in this selection. + */ + data(): Datum[]; + + /** + * Binds data to this selection. + * @param data the array of data to bind to this selection + * @param key the optional function to determine the unique key for each piece of data. When unspecified, uses the index of the element. + */ + data(data: NewDatum[], key?: (datum: NewDatum, index: number) => string): Update; + + /** + * Derives data to bind to this selection. + * @param data the function to derive data. Must return an array. + * @param key the optional function to determine the unique key for each data item. When unspecified, uses the index of the element. + */ + data(data: (datum: Datum, index: number) => NewDatum[], key?: (datum: NewDatum, index: number) => string): Update; + + /** + * Filters the selection, returning only those nodes that match the given CSS selector. + * @param selector the CSS selector + */ + filter(selector: string): Update; + + /** + * Filters the selection, returning only those nodes for which the given function returned true. + * @param selector the filter function + */ + filter(selector: (datum: Datum, index: number) => boolean): Update; + + /** + * Return the data item bound to the first element in the selection. + */ + datum(): Datum; + + /** + * Set the data item for each node in the selection. + * @param value the constant element to use for each node + */ + datum(value: NewDatum): Update; + + /** + * Derive the data item for each node in the selection. Useful for situations such as the HTML5 'dataset' attribute. + * @param value the function to compute data for each node + */ + datum(value: (datum: Datum, index: number) => NewDatum): Update; + + /** + * Reorders nodes in the selection based on the given comparator. Nodes are re-inserted into the document once sorted. + * @param comparator the comparison function, which defaults to d3.ascending + */ + sort(comparator?: (a: Datum, b: Datum) => number): Update; + + /** + * Reorders nodes in the document to match the selection order. More efficient than calling sort() if the selection is already ordered. + */ + order(): Update; + + /** + * Returns the listener (if any) for the given event. + * @param type the type of event to load the listener for. May have a namespace (e.g., ".foo") at the end. + */ + on(type: string): (datum: Datum, index: number) => any; + + /** + * Adds a listener for the specified event. If one was already registered, it is removed before the new listener is added. The return value of the listener function is ignored. + * @param type the of event to listen to. May have a namespace (e.g., ".foo") at the end. + * @param listener an event listener function, or null to unregister + * @param capture sets the DOM useCapture flag + */ + on(type: string, listener: (datum: Datum, index: number) => any, capture?: boolean): Update; + + /** + * Begins a new transition. Interrupts any active transitions of the same name. + * @param name the transition name (defaults to "") + */ + transition(name?: string): Transition; + + /** + * Interrupts the active transition of the provided name. Does not cancel scheduled transitions. + * @param name the transition name (defaults to "") + */ + interrupt(name?: string): Update; + + /** + * Creates a subselection by finding the first descendent matching the selector string. Bound data is inherited. + * @param selector the CSS selector to match against + */ + select(selector: string): Update; + + /** + * Creates a subselection by using a function to find descendent elements. Bound data is inherited. + * @param selector the function to find matching descendants + */ + select(selector: (datum: Datum, index: number) => EventTarget): Update; + + /** + * Creates a subselection by finding all descendents that match the given selector. Bound data is not inherited. + * @param selector the CSS selector to match against + */ + selectAll(selector: string): Update; + + /** + * Creates a subselection by using a function to find descendent elements. Bound data is not inherited. + * @param selector the function to find matching descendents + */ + selectAll(selector: (datum: Datum, index: number) => Array | NodeList): Update; + + /** + * Invoke the given function for each element in the selection. The return value of the function is ignored. + * @param func the function to invoke + */ + each(func: (datum: Datum, index: number) => any): Update; + + /** + * Call a function on the selection. sel.call(foo) is equivalent to foo(sel). + * @param func the function to call on the selection + * @param args any optional args + */ + call(func: (sel: Update, ...args: any[]) => any, ...args: any[]): Update; + + /** + * Returns true if the current selection is empty. + */ + empty(): boolean; + + /** + * Returns the first non-null element in the selection, or null otherwise. + */ + node(): EventTarget; + + /** + * Returns the total number of elements in the selection. + */ + size(): number; + + /** + * Returns the placeholder nodes for each data element for which no corresponding DOM element was found. + */ + enter(): Enter; + + /** + * Returns a selection for those DOM nodes for which no new data element was found. + */ + exit(): Selection; + } + + interface Enter { + append(name: string): Selection; + append(name: (datum: Datum, index: number) => EventTarget): Selection; + + insert(name: string, before?: string): Selection; + insert(name: string, before: (datum: Datum, index: number) => EventTarget): Selection; + insert(name: (datum: Datum, index: number) => EventTarget, before?: string): Selection; + insert(name: (datum: Datum, index: number) => EventTarget, before: (datum: Datum, index: number) => EventTarget): Selection; + + select(name: (datum: Datum, index: number) => EventTarget): Selection; + call(func: (selection: Enter, ...args: any[]) => any, ...args: any[]): Enter; + } + } + + /** + * Administrivia: JavaScript primitive types, or "things that toString() predictably". + */ + export type Primitive = number | string | boolean; + + /** + * Administrivia: anything with a valueOf(): number method is comparable, so we allow it in numeric operations + */ + interface Numeric { + valueOf(): number; + } + + /** + * A grouped array of nodes. + * @param Datum the data bound to this selection. + */ + interface Selection { + /** + * Retrieve a grouped selection. + */ + [index: number]: selection.Group; + + /** + * The number of groups in this selection. + */ + length: number; + + /** + * Retrieve the value of the given attribute for the first node in the selection. + * + * @param name The attribute name to query. May be prefixed (see d3.ns.prefix). + */ + attr(name: string): string; + + /** + * For all nodes, set the attribute to the specified constant value. Use null to remove. + * + * @param name The attribute name, optionally prefixed. + * @param value The attribute value to use. Note that this is coerced to a string automatically. + */ + attr(name: string, value: Primitive): Selection; + + /** + * Derive an attribute value for each node in the selection based on bound data. + * + * @param name The attribute name, optionally prefixed. + * @param value The function of the datum (the bound data item) and index (the position in the subgrouping) which computes the attribute value. If the function returns null, the attribute is removed. + */ + attr(name: string, value: (datum: Datum, index: number) => Primitive): Selection; + + /** + * Set multiple properties at once using an Object. D3 iterates over all enumerable properties and either sets or computes the attribute's value based on the corresponding entry in the Object. + * + * @param obj A key-value mapping corresponding to attributes and values. If the value is a simple string or number, it is taken as a constant. Otherwise, it is a function that derives the attribute value. + */ + attr(obj: { [key: string]: Primitive | ((datum: Datum, index: number) => Primitive) }): Selection; + + /** + * Returns true if the first node in this selection has the given class list. If multiple classes are specified (i.e., "foo bar"), then returns true only if all classes match. + * + * @param name The class list to query. + */ + classed(name: string): boolean; + + /** + * Adds (or removes) the given class list. + * + * @param name The class list to toggle. Spaces separate class names: "foo bar" is a list of two classes. + * @param value If true, add the classes. If false, remove them. + */ + classed(name: string, value: boolean): Selection; + + /** + * Determine if the given class list should be toggled for each node in the selection. + * + * @param name The class list. Spaces separate multiple class names. + * @param value The function to run for each node. Should return true to add the class to the node, or false to remove it. + */ + classed(name: string, value: (datum: Datum, index: number) => boolean): Selection; + + /** + * Set or derive classes for multiple class lists at once. + * + * @param obj An Object mapping class lists to values that are either plain booleans or functions that return booleans. + */ + classed(obj: { [key: string]: boolean | ((datum: Datum, index: number) => boolean) }): Selection; + + /** + * Retrieve the computed style value for the first node in the selection. + * @param name The CSS property name to query + */ + style(name: string): string; + + /** + * Set a style property for all nodes in the selection. + * @param name the CSS property name + * @param value the property value + * @param priority if specified, either null or the string "important" (no exclamation mark) + */ + style(name: string, value: Primitive, priority?: string): Selection; + + /** + * Derive a property value for each node in the selection. + * @param name the CSS property name + * @param value the function to derive the value + * @param priority if specified, either null or the string "important" (no exclamation mark) + */ + style(name: string, value: (datum: Datum, index: number) => Primitive, priority?: string): Selection; + + /** + * Set a large number of CSS properties from an object. + * + * @param obj an Object whose keys correspond to CSS property names and values are either constants or functions that derive property values + * @param priority if specified, either null or the string "important" (no exclamation mark) + */ + style(obj: { [key: string]: Primitive | ((datum: Datum, index: number) => Primitive) }, priority?: string): Selection; + + /** + * Retrieve an arbitrary node property such as the 'checked' property of checkboxes, or the 'value' of text boxes. + * + * @param name the node's property to retrieve + */ + property(name: string): any; + + /** + * For each node, set the property value. Internally, this sets the node property directly (e.g., node[name] = value), so take care not to mutate special properties like __proto__. + * + * @param name the property name + * @param value the property value + */ + property(name: string, value: any): Selection; + + /** + * For each node, derive the property value. Internally, this sets the node property directly (e.g., node[name] = value), so take care not to mutate special properties like __proto__. + * + * @param name the property name + * @param value the function used to derive the property's value + */ + property(name: string, value: (datum: Datum, index: number) => any): Selection; + + /** + * Set multiple node properties. Caveats apply: take care not to mutate special properties like __proto__. + * + * @param obj an Object whose keys correspond to node properties and values are either constants or functions that will compute a value. + */ + property(obj: { [key: string]: any | ((datum: Datum, index: number) => any) }): Selection; + + /** + * Retrieve the textContent of the first node in the selection. + */ + text(): string; + + /** + * Set the textContent of each node in the selection. + * @param value the text to use for all nodes + */ + text(value: Primitive): Selection; + + /** + * Compute the textContent of each node in the selection. + * @param value the function which will compute the text + */ + text(value: (datum: Datum, index: number) => Primitive): Selection; + + /** + * Retrieve the HTML content of the first node in the selection. Uses 'innerHTML' internally and will not work with SVG or other elements without a polyfill. + */ + html(): string; + + /** + * Set the HTML content of every node in the selection. Uses 'innerHTML' internally and thus will not work with SVG or other elements without a polyfill. + * @param value the HTML content to use. + */ + html(value: string): Selection; + + /** + * Compute the HTML content for each node in the selection. Uses 'innerHTML' internally and thus will not work with SVG or other elements without a polyfill. + * @param value the function to compute HTML content + */ + html(value: (datum: Datum, index: number) => string): Selection; + + /** + * Appends a new child to each node in the selection. This child will inherit the parent's data (if available). Returns a fresh selection consisting of the newly-appended children. + * + * @param name the element name to append. May be prefixed (see d3.ns.prefix). + */ + append(name: string): Selection; + + /** + * Appends a new child to each node in the selection by computing a new node. This child will inherit the parent's data (if available). Returns a fresh selection consisting of the newly-appended children. + * + * @param name the function to compute a new element + */ + append(name: (datum: Datum, index: number) => EventTarget): Selection; + + /** + * Inserts a new child to each node in the selection. This child will inherit its parent's data (if available). Returns a fresh selection consisting of the newly-inserted children. + * @param name the element name to append. May be prefixed (see d3.ns.prefix). + * @param before the selector to determine position (e.g., ":first-child") + */ + insert(name: string, before: string): Selection; + + /** + * Inserts a new child to each node in the selection. This child will inherit its parent's data (if available). Returns a fresh selection consisting of the newly-inserted children. + * @param name the element name to append. May be prefixed (see d3.ns.prefix). + * @param before a function to determine the node to use as the next sibling + */ + insert(name: string, before: (datum: Datum, index: number) => EventTarget): Selection; + + /** + * Inserts a new child to the end of each node in the selection by computing a new node. This child will inherit its parent's data (if available). Returns a fresh selection consisting of the newly-inserted children. + * @param name the function to compute a new child + * @param before the selector to determine position (e.g., ":first-child") + */ + insert(name: (datum: Datum, index: number) => EventTarget, before: string): Selection; + + /** + * Inserts a new child to the end of each node in the selection by computing a new node. This child will inherit its parent's data (if available). Returns a fresh selection consisting of the newly-inserted children. + * @param name the function to compute a new child + * @param before a function to determine the node to use as the next sibling + */ + insert(name: (datum: Datum, index: number) => EventTarget, before: (datum: Datum, index: number) => EventTarget): Selection; + + /** + * Removes the elements from the DOM. They are in a detached state and may be re-added (though there is currently no dedicated API for doing so). + */ + remove(): Selection; + + /** + * Retrieves the data bound to the first group in this selection. + */ + data(): Datum[]; + + /** + * Binds data to this selection. + * @param data the array of data to bind to this selection + * @param key the optional function to determine the unique key for each piece of data. When unspecified, uses the index of the element. + */ + data(data: NewDatum[], key?: (datum: NewDatum, index: number) => string): selection.Update; + + /** + * Derives data to bind to this selection. + * @param data the function to derive data. Must return an array. + * @param key the optional function to determine the unique key for each data item. When unspecified, uses the index of the element. + */ + data(data: (datum: Datum, index: number) => NewDatum[], key?: (datum: NewDatum, index: number) => string): selection.Update; + + /** + * Filters the selection, returning only those nodes that match the given CSS selector. + * @param selector the CSS selector + */ + filter(selector: string): Selection; + + /** + * Filters the selection, returning only those nodes for which the given function returned true. + * @param selector the filter function + */ + filter(selector: (datum: Datum, index: number) => boolean): Selection; + + /** + * Return the data item bound to the first element in the selection. + */ + datum(): Datum; + + /** + * Derive the data item for each node in the selection. Useful for situations such as the HTML5 'dataset' attribute. + * @param value the function to compute data for each node + */ + datum(value: (datum: Datum, index: number) => NewDatum): Selection; + + /** + * Set the data item for each node in the selection. + * @param value the constant element to use for each node + */ + datum(value: NewDatum): Selection; + + /** + * Reorders nodes in the selection based on the given comparator. Nodes are re-inserted into the document once sorted. + * @param comparator the comparison function, which defaults to d3.ascending + */ + sort(comparator?: (a: Datum, b: Datum) => number): Selection; + + /** + * Reorders nodes in the document to match the selection order. More efficient than calling sort() if the selection is already ordered. + */ + order(): Selection; + + /** + * Returns the listener (if any) for the given event. + * @param type the type of event to load the listener for. May have a namespace (e.g., ".foo") at the end. + */ + on(type: string): (datum: Datum, index: number) => any; + + /** + * Adds a listener for the specified event. If one was already registered, it is removed before the new listener is added. The return value of the listener function is ignored. + * @param type the of event to listen to. May have a namespace (e.g., ".foo") at the end. + * @param listener an event listener function, or null to unregister + * @param capture sets the DOM useCapture flag + */ + on(type: string, listener: (datum: Datum, index: number) => any, capture?: boolean): Selection; + + /** + * Begins a new transition. Interrupts any active transitions of the same name. + * @param name the transition name (defaults to "") + */ + transition(name?: string): Transition; + + /** + * Interrupts the active transition of the provided name. Does not cancel scheduled transitions. + * @param name the transition name (defaults to "") + */ + interrupt(name?: string): Selection; + + /** + * Creates a subselection by finding the first descendent matching the selector string. Bound data is inherited. + * @param selector the CSS selector to match against + */ + select(selector: string): Selection; + + /** + * Creates a subselection by using a function to find descendent elements. Bound data is inherited. + * @param selector the function to find matching descendants + */ + select(selector: (datum: Datum, index: number) => EventTarget): Selection; + + /** + * Creates a subselection by finding all descendents that match the given selector. Bound data is not inherited. + * @param selector the CSS selector to match against + */ + selectAll(selector: string): Selection; + + /** + * Creates a subselection by finding all descendants that match the given selector. Bound data is not inherited. + * + * Use this overload when data-binding a subselection (that is, sel.selectAll('.foo').data(d => ...)). The type will carry over. + */ + selectAll(selector: string): Selection; + + /** + * Creates a subselection by using a function to find descendent elements. Bound data is not inherited. + * @param selector the function to find matching descendents + */ + selectAll(selector: (datum: Datum, index: number) => Array | NodeList): Selection; + + /** + * Creates a subselection by using a function to find descendent elements. Bound data is not inherited. + * + * Use this overload when data-binding a subselection (that is, sel.selectAll('.foo').data(d => ...)). The type will carry over. + * @param selector the function to find matching descendents + */ + selectAll(selector: (datum: Datum, index: number) => Array | NodeList): Selection; + + /** + * Invoke the given function for each element in the selection. The return value of the function is ignored. + * @param func the function to invoke + */ + each(func: (datum: Datum, index: number) => any): Selection; + + /** + * Call a function on the selection. sel.call(foo) is equivalent to foo(sel). + * @param func the function to call on the selection + * @param args any optional args + */ + call(func: (sel: Selection, ...args: any[]) => any, ...args: any[]): Selection; + + /** + * Returns true if the current selection is empty. + */ + empty(): boolean; + + /** + * Returns the first non-null element in the selection, or null otherwise. + */ + node(): EventTarget; + + /** + * Returns the total number of elements in the selection. + */ + size(): number; + } + + export function transition(): Transition; + module transition { + export var prototype: Transition; + } + + interface Transition { + delay(): number; + delay(delay: number): Transition; + delay(delay: (datum: Datum, index: number) => number): Transition; + + duration(): number; + duration(duration: number): Transition; + duration(duration: (datum: Datum, index: number) => number): Transition; + + ease(): (t: number) => number; + ease(value: string, ...args: any[]): Transition; + ease(value: (t: number) => number): Transition; + + attr(name: string, value: Primitive): Transition; + attr(name: string, value: (datum: Datum, index: number) => Primitive): Transition; + attr(obj: { [key: string]: Primitive | ((datum: Datum, index: number) => Primitive) }): Transition; + + attrTween(name: string, tween: (datum: Datum, index: number, attr: string) => Primitive): Transition; + + style(name: string, value: Primitive, priority?: string): Transition; + style(name: string, value: (datum: Datum, index: number) => Primitive, priority?: string): Transition; + style(obj: { [key: string]: Primitive | ((datum: Datum, index: number) => Primitive) }, priority?: string): Transition; + + styleTween(name: string, tween: (datum: Datum, index: number, attr: string) => Primitive, priority?: string): Transition; + + text(value: Primitive): Transition; + text(value: (datum: Datum, index: number) => Primitive): Transition; + + tween(name: string, factory: () => (t: number) => any): Transition; + + remove(): Transition; + + select(selector: string): Transition; + select(selector: (d: Datum, i: number) => EventTarget): Transition; + + selectAll(selector: string): Transition; + selectAll(selector: (d: Datum, i: number) => EventTarget[]): Transition; + + filter(selector: string): Transition; + filter(selector: (d: Datum, i: number) => boolean): Transition; + + each(type: string, listener: (d: Datum, i: number) => any): Transition; + each(listener: (d: Datum, i: number) => any): Transition; + + call(func: (transition: Transition, ...args: any[]) => any, ...args: any[]): Transition; + + empty(): boolean; + node(): EventTarget; + size(): number; + } + + export function ease(type: 'linear'): (t: number) => number; + export function ease(type: 'linear-in'): (t: number) => number; + export function ease(type: 'linear-out'): (t: number) => number; + export function ease(type: 'linear-in-out'): (t: number) => number; + export function ease(type: 'linear-out-in'): (t: number) => number; + + export function ease(type: 'poly', k: number): (t: number) => number; + export function ease(type: 'poly-in', k: number): (t: number) => number; + export function ease(type: 'poly-out', k: number): (t: number) => number; + export function ease(type: 'poly-in-out', k: number): (t: number) => number; + export function ease(type: 'poly-out-in', k: number): (t: number) => number; + + export function ease(type: 'quad'): (t: number) => number; + export function ease(type: 'quad-in'): (t: number) => number; + export function ease(type: 'quad-out'): (t: number) => number; + export function ease(type: 'quad-in-out'): (t: number) => number; + export function ease(type: 'quad-out-in'): (t: number) => number; + + export function ease(type: 'cubic'): (t: number) => number; + export function ease(type: 'cubic-in'): (t: number) => number; + export function ease(type: 'cubic-out'): (t: number) => number; + export function ease(type: 'cubic-in-out'): (t: number) => number; + export function ease(type: 'cubic-out-in'): (t: number) => number; + + export function ease(type: 'sin'): (t: number) => number; + export function ease(type: 'sin-in'): (t: number) => number; + export function ease(type: 'sin-out'): (t: number) => number; + export function ease(type: 'sin-in-out'): (t: number) => number; + export function ease(type: 'sin-out-in'): (t: number) => number; + + export function ease(type: 'circle'): (t: number) => number; + export function ease(type: 'circle-in'): (t: number) => number; + export function ease(type: 'circle-out'): (t: number) => number; + export function ease(type: 'circle-in-out'): (t: number) => number; + export function ease(type: 'circle-out-in'): (t: number) => number; + + export function ease(type: 'elastic', a?: number, b?: number): (t: number) => number; + export function ease(type: 'elastic-in', a?: number, b?: number): (t: number) => number; + export function ease(type: 'elastic-out', a?: number, b?: number): (t: number) => number; + export function ease(type: 'elastic-in-out', a?: number, b?: number): (t: number) => number; + export function ease(type: 'elastic-out-in', a?: number, b?: number): (t: number) => number; + + export function ease(type: 'back', s: number): (t: number) => number; + export function ease(type: 'back-in', s: number): (t: number) => number; + export function ease(type: 'back-out', s: number): (t: number) => number; + export function ease(type: 'back-in-out', s: number): (t: number) => number; + export function ease(type: 'back-out-in', s: number): (t: number) => number; + + export function ease(type: 'bounce'): (t: number) => number; + export function ease(type: 'bounce-in'): (t: number) => number; + export function ease(type: 'bounce-out'): (t: number) => number; + export function ease(type: 'bounce-in-out'): (t: number) => number; + export function ease(type: 'bounce-out-in'): (t: number) => number; + + export function ease(type: string, ...args: any[]): (t: number) => number; + + export function timer(func: () => any, delay?: number, time?: number): void; + + module timer { + export function flush(): void; + } + + /** + * The current event's value. Use this variable in a handler registered with selection.on. + */ + export var event: Event; + + /** + * Returns the x and y coordinates of the mouse relative to the provided container element, using d3.event for the mouse's position on the page. + * @param container the container element (e.g. an SVG element) + */ + export function mouse(container: EventTarget): [number, number]; + + /** + * Given a container element and a touch identifier, determine the x and y coordinates of the touch. + * @param container the container element (e.g., an SVG element) + * @param identifier the given touch identifier + */ + export function touch(container: EventTarget, identifer: number): [number, number]; + + /** + * Given a container element, a list of touches, and a touch identifier, determine the x and y coordinates of the touch. + * @param container the container element (e.g., an SVG element) + * @param identifier the given touch identifier + */ + export function touch(container: EventTarget, touches: TouchList, identifer: number): [number, number]; + + /** + * Given a container element and an optional list of touches, return the position of every touch relative to the container. + * @param container the container element + * @param touches an optional list of touches (defaults to d3.event.touches) + */ + export function touches(container: EventTarget, touches?: TouchList): Array<[number, number]>; + + // NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances. + /** + * Compares two primitive values for sorting (in ascending order). + */ + export function ascending(a: Primitive, b: Primitive): number; + + /** + * Compares two primitive values for sorting (in ascending order). + */ + export function descending(a: Primitive, b: Primitive): number; + + /** + * Return the minimum value in the array using natural order. + */ + export function min(array: number[]): number; + + /** + * Return the minimum value in the array using natural order. + */ + export function min(array: string[]): string; + + /** + * Return the minimum value in the array using natural order. + */ + export function min(array: T[]): T; + + /** + * Return the minimum value in the array using natural order. + */ + export function min(array: T[], accessor: (datum: T, index: number) => number): number; + + /** + * Return the minimum value in the array using natural order. + */ + export function min(array: T[], accessor: (datum: T, index: number) => string): string; + + /** + * Return the minimum value in the array using natural order. + */ + export function min(array: T[], accessor: (datum: T, index: number) => U): U; + + /** + * Return the maximum value in the array of numbers using natural order. + */ + export function max(array: number[]): number; + + /** + * Return the maximum value in the array of strings using natural order. + */ + export function max(array: string[]): string; + + /** + * Return the maximum value in the array of numbers using natural order. + */ + export function max(array: T[]): T; + + /** + * Return the maximum value in the array using natural order and a projection function to map values to numbers. + */ + export function max(array: T[], accessor: (datum: T, index: number) => number): number; + + /** + * Return the maximum value in the array using natural order and a projection function to map values to strings. + */ + export function max(array: T[], accessor: (datum: T, index: number) => string): string; + + /** + * Return the maximum value in the array using natural order and a projection function to map values to easily-sorted values. + */ + export function max(array: T[], accessor: (datum: T, index: number) => U): U; + + /** + * Return the min and max simultaneously. + */ + export function extent(array: number[]): [number, number]; + + /** + * Return the min and max simultaneously. + */ + export function extent(array: string[]): [string, string]; + + /** + * Return the min and max simultaneously. + */ + export function extent(array: T[]): [T, T]; + + /** + * Return the min and max simultaneously. + */ + export function extent(array: Array): [T | Primitive, T | Primitive]; + + /** + * Return the min and max simultaneously. + */ + export function extent(array: T[], accessor: (datum: T, index: number) => number): [number, number]; + + /** + * Return the min and max simultaneously. + */ + export function extent(array: T[], accessor: (datum: T, index: number) => string): [string, string]; + + /** + * Return the min and max simultaneously. + */ + export function extent(array: U[], accessor: (datum: T, index: number) => U): [U | Primitive, U | Primitive]; + + /** + * Compute the sum of an array of numbers. + */ + export function sum(array: number[]): number; + + /** + * Compute the sum of an array, using the given accessor to convert values to numbers. + */ + export function sum(array: T[], accessor: (datum: T, index: number) => number): number; + + export function mean(array: number[]): number; + export function mean(array: T[], accessor: (datum: T, index: number) => number): number; + + export function quantile(array: number[], p: number): number; + + export function variance(array: number[]): number; + export function variance(array: T[], accessor: (datum: T, index: number) => number): number; + + export function deviation(array: number[]): number; + export function deviation(array: T[], accessor: (datum: T, index: number) => number): number; + + export function bisectLeft(array: number[], x: number, lo?: number, hi?: number): number; + export function bisectLeft(array: string[], x: string, lo?: number, hi?: number): number; + + export var bisect: typeof bisectRight; + + export function bisectRight(array: T[], x: T, lo?: number, hi?: number): number; + + export function bisector(accessor: (x: T) => U): { + left: (array: T[], x: T, lo?: number, hi?: number) => number; + right: (array: T[], x: T, lo?: number, hi?: number) => number; + } + + export function bisector(comparator: (a: T, b: U) => number): { + left: (array: T[], x: U, lo?: number, hi?: number) => number; + right: (array: T[], x: U, lo?: number, hi?: number) => number; + } + + export function shuffle(array: T[], lo?: number, hi?: number): T[]; + + /** + * Returns the enumerable property names of the specified object. + * @param object a JavaScript object + */ + export function keys(object: Object): string[]; + + /** + * Returns an array containing the property values of the specified object. + */ + export function values(object: { [key: string]: T }): T[]; + /** + * Returns an array containing the property values of the specified object. + */ + export function values(object: { [key: number]: T }): T[]; + /** + * Returns an array containing the property values of the specified object. + */ + export function values(object: Object): any[]; + + /** + * Returns an array of key-value pairs containing the property values of the specified object. + */ + export function entries(object: { [key: string]: T }): { key: string; value: T }[]; + + /** + * Returns an array of key-value pairs containing the property values of the specified object. + */ + export function entries(object: { [key: number]: T }): { key: string; value: T }[]; + + /** + * Returns an array of key-value pairs containing the property values of the specified object. + */ + export function entries(object: Object): { key: string; value: any }[]; + + /** + * A shim for ES6 maps. The implementation uses a JavaScript object internally, and thus keys are limited to strings. + */ + interface Map { + /** + * Does the map contain the given key? + */ + has(key: string): boolean; + + /** + * Retrieve the value for the given key. Returns undefined if there is no value stored. + */ + get(key: string): T; + + /** + * Set the value for the given key. Returns the new value. + */ + set(key: string, value: T): T; + + /** + * Remove the value for the given key. Returns true if there was a value and false otherwise. + */ + remove(key: string): boolean; + + /** + * Returns an array of all keys in arbitrary order. + */ + keys(): string[]; + + /** + * Returns an array of all values in arbitrary order. + */ + values(): T[]; + + /** + * Returns an array of key-value objects in arbitrary order. + */ + entries(): { key: string; value: T }[]; + + /** + * Calls the function for each key and value pair in the map. The 'this' context is the map itself. + */ + forEach(func: (key: string, value: T) => any): void; + + /** + * Is this map empty? + */ + empty(): boolean; + + /** + * Returns the number of elements stored in the map. + */ + size(): number; + } + + /** + * Constructs an initially empty map. + */ + export function map(): Map; + + /** + * Construct a new map by copying keys and values from the given one. + */ + export function map(object: Map): Map; + + /** + * Construct a new map by copying enumerable properties and values from the given object. + */ + export function map(object: { [key: string]: T }): Map; + + /** + * Construct a new map by copying enumerable properties and values from the given object. + */ + export function map(object: { [key: number]: T }): Map; + + /** + * Construct a new map by copying elements from the array. The key function is used to identify each object. + */ + export function map(array: T[], key: (datum: T, index: number) => string): Map; + + /** + * Construct a new map by copying enumerable properties and values from the given object. + */ + export function map(object: Object): Map; + + /** + * A shim for ES6 sets. Is only able to store strings. + */ + interface Set { + /** + * Is the given string stored in this set? + */ + has(value: string): boolean; + + /** + * Add the string to this set. Returns the value. + */ + add(value: string): string; + + /** + * Remove the given value from the set. Returns true if it was stored, and false otherwise. + */ + remove(value: string): boolean; + + /** + * Returns an array of the strings stored in this set. + */ + values(): string[]; + + /** + * Calls a given function for each value in the set. The return value of the function is ignored. The this context of the function is the set itself. + */ + forEach(func: (value: string) => any): void; + + /** + * Is this set empty? + */ + empty(): boolean; + + /** + * Returns the number of values stored in this set. + */ + size(): number; + } + + /** + * Creates an initially-empty set. + */ + export function set(): Set; + + /** + * Initializes a set from the given array of strings. + */ + export function set(array: string[]): Set; + + /** + * Merges the specified arrays into a single array. + */ + export function merge(arrays: T[][]): T[]; + + /** + * Generates a 0-based numeric sequence. The output range does not include 'stop'. + */ + export function range(stop: number): number[]; + + /** + * Generates a numeric sequence starting from the given start and stop values. 'step' defaults to 1. The output range does not include 'stop'. + */ + export function range(start: number, stop: number, step?: number): number[]; + + /** + * Given the specified array, return an array corresponding to the list of indices in 'keys'. + */ + export function permute(array: { [key: number]: T }, keys: number[]): T[]; + + /** + * Given the specified object, return an array corresponding to the list of property names in 'keys'. + */ + export function permute(object: { [key: string]: T }, keys: string[]): T[]; + + // TODO construct n-tuples from n input arrays + export function zip(...arrays: T[][]): T[][]; + + export function transpose(matrix: T[][]): T[][]; + + /** + * For each adjacent pair of elements in the specified array, returns a new array of tuples of elements i and i - 1. + * Returns the empty array if the input array has fewer than two elements. + */ + export function pairs(array: T[]): Array<[T, T]>; + + interface Nest { + key(func: (datum: T) => string): Nest; + sortKeys(comparator: (a: string, b: string) => number): Nest; + sortValues(comparator: (a: T, b: T) => number): Nest; + rollup(func: (values: T[]) => U): Nest; + map(array: T[]): { [key: string]: any }; + map(array: T[], mapType: typeof d3.map): Map; + entries(array: T[]): { key: string; values: any }[]; + } + + export function nest(): Nest; + + export module random { + export function normal(mean?: number, deviation?: number): () => number; + export function logNormal(mean?: number, deviation?: number): () => number; + export function bates(count: number): () => number; + export function irwinHall(count: number): () => number; + } + + interface Transform { + rotate: number; + translate: [number, number]; + skew: number; + scale: [number, number]; + toString(): string; + } + + export function transform(transform: string): Transform; + + export function format(specifier: string): (n: number) => string; + + interface FormatPrefix { + symbol: string; + scale(n: number): number; + } + + export function formatPrefix(value: number, precision?: number): FormatPrefix; + + export function round(x: number, n?: number): number; + + export function requote(string: string): string; + + export var rgb: { + new (r: number, g: number, b: number): Rgb; + new (color: string): Rgb; + + (r: number, g: number, b: number): Rgb; + (color: string): Rgb; + }; + + interface Rgb extends Color { + r: number; + g: number; + b: number; + + brighter(k?: number): Rgb; + darker(k?: number): Rgb; + + hsl(): Hsl; + + toString(): string; + } + + export var hsl: { + new (h: number, s: number, l: number): Hsl; + new (color: string): Hsl; + + (h: number, s: number, l: number): Hsl; + (color: string): Hsl; + }; + + interface Hsl extends Color { + h: number; + s: number; + l: number; + + brighter(k?: number): Hsl; + darker(k?: number): Hsl; + + rgb(): Rgb; + + toString(): string; + } + + export var hcl: { + new (h: number, c: number, l: number): Hcl; + new (color: string): Hcl; + + (h: number, c: number, l: number): Hcl; + (color: string): Hcl; + }; + + interface Hcl extends Color { + h: number; + c: number; + l: number; + + brighter(k?: number): Hcl; + darker(k?: number): Hcl; + } + + export var lab: { + new (l: number, a: number, b: number): Lab; + new (color: string): Lab; + + (l: number, a: number, b: number): Lab; + (color: string): Lab; + } + + interface Lab extends Color { + l: number; + a: number; + b: number; + + brighter(k?: number): Lab; + darker(k?: number): Lab; + + rgb(): Rgb; + toString(): string; + } + + export var color: { + (): Color; + new (): Color; + }; + + interface Color { + rgb(): Rgb; + } + + export module ns { + interface Qualified { + space: string; + local: string; + } + + export var prefix: { [key: string]: string }; + export function qualify(name: string): Qualified | string; + } + + export function functor(value: T): T; + export function functor(value: T): () => T; + + export function rebind(target: {}, source: {}, ...names: string[]): any; + + export function dispatch(...names: string[]): Dispatch; + + interface Dispatch { + on(type: string): (...args: any[]) => void; + on(type: string, listener: (...args: any[]) => any): Dispatch; + [event: string]: (...args: any[]) => void; + } + + export module scale { + export function identity(): Identity; + + interface Identity { + (n: number): number; + invert(n: number): number; + + domain(): number[]; + domain(numbers: number[]): Identity; + + range(): number[]; + range(numbers: number[]): Identity; + + ticks(count?: number): number[]; + + tickFormat(count?: number, format?: string): (n: number) => string; + + copy(): Identity; + } + + export function linear(): Linear; + export function linear(): Linear; + export function linear(): Linear; + + interface Linear { + (x: number): Output; + invert(y: number): number; + + domain(): number[]; + domain(numbers: number[]): Linear; + + range(): Range[]; + range(values: Range[]): Linear; + + rangeRound(values: number[]): Linear; + + interpolate(): (a: Range, b: Range) => (t: number) => Output; + interpolate(factory: (a: Range, b: Range) => (t: number) => Output): Linear; + + clamp(): boolean; + clamp(clamp: boolean): Linear; + + nice(count?: number): Linear; + + ticks(count?: number): number[]; + + tickFormat(count?: number, format?: string): (n: number) => string; + + copy(): Linear; + } + + export function sqrt(): Pow; + export function sqrt(): Pow; + export function sqrt(): Pow; + + export function pow(): Pow; + export function pow(): Pow; + export function pow(): Pow; + + interface Pow { + (x: number): Output; + + invert(y: number): number; + + domain(): number[]; + domain(numbers: number[]): Pow; + + range(): Range[]; + range(values: Range[]): Pow; + + rangeRound(values: number[]): Pow; + + exponent(): number; + exponent(k: number): Pow; + + interpolate(): (a: Range, b: Range) => (t: number) => Output; + interpolate(factory: (a: Range, b: Range) => (t: number) => Output): Pow; + + clamp(): boolean; + clamp(clamp: boolean): Pow; + + nice(m?: number): Pow; + + ticks(count?: number): number[]; + + tickFormat(count?: number, format?: string): (n: number) => string; + + copy(): Pow; + } + + export function log(): Log; + export function log(): Log; + export function log(): Log; + + interface Log { + (x: number): Output; + + invert(y: number): number; + + domain(): number[]; + domain(numbers: number[]): Log; + + range(): Range[]; + range(values: Range[]): Log; + + rangeRound(values: number[]): Log; + + base(): number; + base(base: number): Log; + + interpolate(): (a: Range, b: Range) => (t: number) => Output; + interpolate(factory: (a: Range, b: Range) => (t: number) => Output): Log; + + clamp(): boolean; + clamp(clamp: boolean): Log; + + nice(): Log; + + ticks(): number[]; + + tickFormat(count?: number, format?: string): (t: number) => string; + + copy(): Log; + } + + export function quantize(): Quantize; + + interface Quantize { + (x: number): T; + + invertExtent(y: T): [number, number]; + + domain(): number[]; + domain(numbers: number[]): Quantize; + + range(): T[]; + range(values: T[]): Quantize; + + copy(): Quantize; + } + + export function quantile(): Quantile; + + interface Quantile { + (x: number): T; + + invertExtent(y: T): [number, number]; + + domain(): number[]; + domain(numbers: number[]): Quantile; + + range(): T[]; + range(values: T[]): Quantile; + + quantiles(): number[]; + + copy(): Quantile; + } + + export function threshold(): Threshold; + export function threshold(): Threshold; + + interface Threshold { + (x: number): Range; + + invertExtent(y: Range): [Domain, Domain]; + + domain(): Domain[]; + domain(domain: Domain[]): Threshold; + + range(): Range[]; + range(values: Range[]): Threshold; + + copy(): Threshold; + } + + export function ordinal(): Ordinal; + export function ordinal(): Ordinal; + export function category10(): Ordinal; + export function category10(): Ordinal; + export function category20(): Ordinal; + export function category20(): Ordinal; + export function category20b(): Ordinal; + export function category20b(): Ordinal; + export function category20c(): Ordinal; + export function category20c(): Ordinal; + + interface Ordinal { + (x: Domain): Range; + + domain(): Domain[]; + domain(values: Domain[]): Ordinal; + + range(): Range[]; + range(values: Range[]): Ordinal; + + rangePoints(interval: [number, number], padding?: number): Ordinal; + rangeRoundPoints(interval: [number, number], padding?: number): Ordinal; + + rangeBands(interval: [number, number], padding?: number, outerPadding?: number): Ordinal; + rangeRoundBands(interval: [number, number], padding?: number, outerPadding?: number): Ordinal; + + rangeBand(): number; + rangeExtent(): [number, number]; + + copy(): Ordinal; + } + } + + export function interpolate(a: number, b: number): (t: number) => number; + export function interpolate(a: string, b: string): (t: number) => string; + export function interpolate(a: string | Color, b: Color): (t: number) => string; + export function interpolate(a: Array, b: Color[]): (t: number) => string; + export function interpolate(a: Range[], b: Output[]): (t: number) => Output[]; + export function interpolate(a: Range[], b: Range[]): (t: number) => Output[]; + export function interpolate(a: { [key: string]: string | Color }, b: { [key: string]: Color }): (t: number) => { [key: string]: string }; + export function interpolate(a: { [key: string]: Range }, b: { [key: string]: Output }): (t: number) => { [key: string]: Output }; + export function interpolate(a: { [key: string]: Range }, b: { [key: string]: Range }): (t: number) => { [key: string]: Output }; + + export function interpolateNumber(a: number, b: number): (t: number) => number; + + export function interpolateRound(a: number, b: number): (t: number) => number; + + export function interpolateString(a: string, b: string): (t: number) => string; + + export function interpolateRgb(a: string | Color, b: string | Color): (t: number) => string; + + export function interpolateHsl(a: string | Color, b: string | Color): (t: number) => string; + + export function interpolateLab(a: string | Color, b: string | Color): (t: number) => string; + + export function interpolateHcl(a: string | Color, b: string | Color): (t: number) => string; + + export function interpolateArray(a: Array, b: Color[]): (t: number) => string[]; + export function interpolateArray(a: Range[], b: Range[]): (t: number) => Output[]; + export function interpolateArray(a: Range[], b: Output[]): (t: number) => Output[]; + + export function interpolateObject(a: { [key: string]: string | Color }, b: { [key: string]: Color }): (t: number) => { [key: string]: string }; + export function interpolateObject(a: { [key: string]: Range }, b: { [key: string]: Output }): (t: number) => { [key: string]: Output }; + export function interpolateObject(a: { [key: string]: Range }, b: { [key: string]: Range }): (t: number) => { [key: string]: Output }; + + export function interpolateTransform(a: string | Transform, b: string | Transform): (t: number) => string; + + export function interpolateZoom(a: [number, number, number], b: [number, number, number]): { + (t: number): [number, number, number]; + duration: number; + }; + + export var interpolators: Array<(a: any, b: any) => (t: number) => any>; + + export module time { + export var second: Interval; + export var minute: Interval; + export var hour: Interval; + export var day: Interval; + export var week: Interval; + export var sunday: Interval; + export var monday: Interval; + export var tuesday: Interval; + export var wednesday: Interval; + export var thursday: Interval; + export var friday: Interval; + export var saturday: Interval; + export var month: Interval; + export var year: Interval; + + interface Interval { + (d: Date): Date; + + floor(d: Date): Date; + + round(d: Date): Date; + + ceil(d: Date): Date; + + range(start: Date, stop: Date, step?: number): Date[]; + + offset(date: Date, step: number): Date; + + utc: { + (d: Date): Date; + + floor(d: Date): Date; + + round(d: Date): Date; + + ceil(d: Date): Date; + + range(start: Date, stop: Date, step?: number): Date[]; + + offset(date: Date, step: number): Date; + } + } + + export function seconds(start: Date, stop: Date, step?: number): Date[]; + export function minutes(start: Date, stop: Date, step?: number): Date[]; + export function hours(start: Date, stop: Date, step?: number): Date[]; + export function days(start: Date, stop: Date, step?: number): Date[]; + export function weeks(start: Date, stop: Date, step?: number): Date[]; + export function sundays(start: Date, stop: Date, step?: number): Date[]; + export function mondays(start: Date, stop: Date, step?: number): Date[]; + export function tuesdays(start: Date, stop: Date, step?: number): Date[]; + export function wednesdays(start: Date, stop: Date, step?: number): Date[]; + export function thursdays(start: Date, stop: Date, step?: number): Date[]; + export function fridays(start: Date, stop: Date, step?: number): Date[]; + export function saturdays(start: Date, stop: Date, step?: number): Date[]; + export function months(start: Date, stop: Date, step?: number): Date[]; + export function years(start: Date, stop: Date, step?: number): Date[]; + + export function dayOfYear(d: Date): number; + export function weekOfYear(d: Date): number; + export function sundayOfYear(d: Date): number; + export function mondayOfYear(d: Date): number; + export function tuesdayOfYear(d: Date): number; + export function wednesdayOfYear(d: Date): number; + export function fridayOfYear(d: Date): number; + export function saturdayOfYear(d: Date): number; + + export function format(specifier: string): Format; + + export module format { + export function multi(formats: Array<[string, (d: Date) => boolean]>): Format; + export function utc(specifier: string): Format; + export var iso: Format; + } + + interface Format { + (d: Date): string; + parse(input: string): Date; + } + + export function scale(): Scale; + export function scale(): Scale; + export function scale(): Scale; + + export module scale { + export function utc(): Scale; + export function utc(): Scale; + export function utc(): Scale; + } + + + interface Scale { + (x: Date): Output; + + invert(y: number): Date; + + domain(): Date[]; + domain(dates: number[]): Scale; + domain(dates: Date[]): Scale; + + nice(): Scale; + nice(interval: Interval, step?: number): Scale; + + range(): Range[]; + range(values: Range[]): Scale; + + rangeRound(values: number[]): Scale; + + interpolate(): (a: Range, b: Range) => (t: number) => Output; + interpolate(factory: (a: Range, b: Range) => (t: number) => Output): Scale; + + clamp(): boolean; + clamp(clamp: boolean): Scale; + + ticks(): Date[]; + ticks(interval: Interval, step?: number): Date[]; + ticks(count: number): Date[]; + + tickFormat(count: number): (d: Date) => string; + + copy(): Scale; + } + } + + export module behavior { + export function drag(): Drag; + + interface Drag { + (selection: Selection): void; + + on(type: string): (d: Datum, i: number) => any; + on(type: string, listener: (d: Datum, i: number) => any): Drag; + + origin(): (d: Datum, i: number) => { x: number; y: number }; + origin(accessor: (d: Datum, i: number) => { x: number; y: number }): Drag; + } + + export function zoom(): Zoom; + + module zoom { + interface Scale { + domain(): number[]; + domain(values: number[]): Scale; + + invert(y: number): number; + + range(values: number[]): Scale; + range(): number[]; + } + } + + interface Zoom { + (selection: Selection): void; + + translate(): [number, number]; + translate(translate: [number, number]): Zoom; + + scale(): number; + scale(scale: number): Zoom; + + scaleExtent(): [number, number]; + scaleExtent(extent: [number, number]): Zoom; + + center(): [number, number]; + center(center: [number, number]): Zoom; + + size(): [number, number]; + size(size: [number, number]): Zoom; + + x(): zoom.Scale; + x(x: zoom.Scale): Zoom; + + y(): zoom.Scale; + y(y: zoom.Scale): Zoom; + + on(type: string): (d: Datum, i: number) => any; + on(type: string, listener: (d: Datum, i: number) => any): Zoom; + + event(selection: Selection): void; + event(transition: Transition): void; + } + } + + export module geo { + export function path(): Path; + + interface Path { + (feature: any, index?: number): string; + + area(feature: any): number; + + centroid(feature: any): [number, number]; + + bounds(feature: any): [[number, number], [number, number]]; + + projection(): Transform | ((coordinates: [number, number]) => [number, number]); + projection(stream: Transform): Path; + projection(projection: (coordinates: [number, number]) => [number, number]): Path; + + pointRadius(): number | ((datum: any, index: number) => number); + pointRadius(radius: number): Path; + pointRadius(radius: (datum: any, index: number) => number): Path; + + context(): CanvasRenderingContext2D; + context(context: CanvasRenderingContext2D): Path; + } + + export function graticule(): Graticule; + + interface Graticule { + (): any; + + lines(): any[]; + + outline(): any; + + extent(): [[number, number], [number, number]]; + extent(extent: [[number, number], [number, number]]): Graticule; + + majorExtent(): [[number, number], [number, number]]; + majorExtent(extent: [[number, number], [number, number]]): Graticule; + + minorExtent(): [[number, number], [number, number]]; + minorExtent(extent: [[number, number], [number, number]]): Graticule; + + step(): [number, number]; + step(step: [number, number]): Graticule; + + majorStep(): [number, number]; + majorStep(step: [number, number]): Graticule; + + minorStep(): [number, number]; + minorStep(step: [number, number]): Graticule; + + precision(): number; + precision(precision: number): Graticule; + } + + export function circle(): Circle; + + interface Circle { + (...args: any[]): any; + + origin(): [number, number] | ((...args: any[]) => [number, number]); + origin(origin: [number, number]): Circle; + origin(origin: (...args: any[]) => [number, number]): Circle; + + angle(): number; + angle(angle: number): Circle; + + precision(): number; + precision(precision: number): Circle; + } + + export function area(feature: any): number; + export function centroid(feature: any): [number, number]; + export function bounds(feature: any): [[number, number], [number, number]]; + export function distance(a: [number, number], b: [number, number]): number; + export function length(feature: any): number; + export function interpolate(a: [number, number], b: [number, number]): (t: number) => [number, number]; + + export function rotation(rotate: [number, number] | [number, number, number]): Rotation; + + interface Rotation { + (location: [number, number]): [number, number]; + invert(location: [number, number]): [number, number]; + } + + export function stream(object: any, listener: Listener): void; + + interface Listener { + point(x: number, y: number, z: number): void; + lineStart(): void; + lineEnd(): void; + polygonStart(): void; + polygonEnd(): void; + sphere(): void; + } + + export function transform(methods: TransformMethods): Transform; + + interface TransformMethods { + point?(x: number, y: number, z: number): void; + lineStart?(): void; + lineEnd?(): void; + polygonStart?(): void; + polygonEnd?(): void; + sphere?(): void; + } + + interface Transform { + stream(stream: Listener): Listener; + } + + export function clipExtent(): ClipExtent; + + interface ClipExtent extends Transform { + extent(): [[number, number], [number, number]]; + extent(extent: [[number, number], [number, number]]): ClipExtent; + } + + export function projection(raw: RawInvertibleProjection): InvertibleProjection; + export function projection(raw: RawProjection): Projection; + + export function projectionMutator(factory: (...args: any[]) => RawInvertibleProjection): (...args: any[]) => InvertibleProjection; + export function projectionMutator(factory: (...args: any[]) => RawProjection): (...args: any[]) => Projection; + + export function albers(): ConicProjection; + export function albersUsa(): ConicProjection; + export function azimuthalEqualArea(): InvertibleProjection; + module azimuthalEqualArea { + export function raw(lambda: number, phi: number): [number, number]; + module raw { + export function invert(x: number, y: number): [number, number]; + } + } + + export function azimuthalEquidistant(): InvertibleProjection; + module azimuthalEquidistant { + export function raw(lambda: number, phi: number): [number, number]; + module raw { + export function invert(x: number, y: number): [number, number]; + } + } + + export function conicConformal(): ConicProjection; + module conicConformal { + export function raw(phi0: number, phi1: number): RawInvertibleProjection; + } + + export function conicEqualArea(): ConicProjection; + module conicEqualArea { + export function raw(phi0: number, phi1: number): RawInvertibleProjection; + } + + export function conicEquidistant(): ConicProjection; + module conicEquidistant { + export function raw(phi0: number, phi1: number): RawInvertibleProjection; + } + + export function equirectangular(): InvertibleProjection; + module equirectangular { + export function raw(lambda: number, phi: number): [number, number]; + module raw { + export function invert(x: number, y: number): [number, number]; + } + } + + export function gnomonic(): InvertibleProjection; + module gnomonic { + export function raw(lambda: number, phi: number): [number, number]; + module raw { + export function invert(x: number, y: number): [number, number]; + } + } + + export function mercator(): InvertibleProjection; + module mercator { + export function raw(lambda: number, phi: number): [number, number]; + module raw { + export function invert(x: number, y: number): [number, number]; + } + } + + export function orthographic(): InvertibleProjection; + module orthographic { + export function raw(lambda: number, phi: number): [number, number]; + module raw { + export function invert(x: number, y: number): [number, number]; + } + } + + export function stereographic(): InvertibleProjection; + module stereographic { + export function raw(lambda: number, phi: number): [number, number]; + module raw { + export function invert(x: number, y: number): [number, number]; + } + } + + export function transverseMercator(): InvertibleProjection; + module transverseMercator { + export function raw(lambda: number, phi: number): [number, number]; + module raw { + export function invert(x: number, y: number): [number, number]; + } + } + + interface Projection { + (location: [number, number]): [number, number]; + + rotate(): [number, number, number]; + rotate(rotation: [number, number, number]): Projection; + + center(): [number, number]; + center(location: [number, number]): Projection; + + translate(): [number, number]; + translate(point: [number, number]): Projection; + + scale(): number; + scale(scale: number): Projection; + + clipAngle(): number; + clipAngle(angle: number): Projection; + + clipExtent(): [[number, number], [number, number]]; + clipExtent(extent: [[number, number], [number, number]]): Projection; + + precision(): number; + precision(precision: number): Projection; + + stream(listener: Listener): Listener; + } + + interface InvertibleProjection extends Projection { + invert(point: [number, number]): [number, number]; + } + + interface ConicProjection extends InvertibleProjection { + parallels(): [number, number]; + parallels(parallels: [number, number]): ConicProjection; + + rotate(): [number, number, number]; + rotate(rotation: [number, number, number]): ConicProjection; + + center(): [number, number]; + center(location: [number, number]): ConicProjection; + + translate(): [number, number]; + translate(point: [number, number]): ConicProjection; + + scale(): number; + scale(scale: number): ConicProjection; + + clipAngle(): number; + clipAngle(angle: number): ConicProjection; + + clipExtent(): [[number, number], [number, number]]; + clipExtent(extent: [[number, number], [number, number]]): ConicProjection; + + precision(): number; + precision(precision: number): ConicProjection; + } + + interface RawProjection { + (lambda: number, phi: number): [number, number]; + } + + interface RawInvertibleProjection extends RawProjection { + invert(x: number, y: number): [number, number]; + } + } + + module svg { + export function line(): Line<[number, number]>; + export function line(): Line; + + interface Line { + (data: T[]): string; + + x(): number | ((d: T, i: number) => number); + x(x: number): Line; + x(x: (d: T, i: number) => number): Line; + + y(): number | ((d: T, i: number) => number); + y(x: number): Line; + y(y: (d: T, i: number) => number): Line; + + interpolate(): string | ((points: Array<[number, number]>) => string); + interpolate(interpolate: "linear"): Line; + interpolate(interpolate: "linear-closed"): Line; + interpolate(interpolate: "step"): Line; + interpolate(interpolate: "step-before"): Line; + interpolate(interpolate: "step-after"): Line; + interpolate(interpolate: "basis"): Line; + interpolate(interpolate: "basis-open"): Line; + interpolate(interpolate: "basis-closed"): Line; + interpolate(interpolate: "bundle"): Line; + interpolate(interpolate: "cardinal"): Line; + interpolate(interpolate: "cardinal-open"): Line; + interpolate(interpolate: "cardinal-closed"): Line; + interpolate(interpolate: "monotone"): Line; + interpolate(interpolate: string): Line; + interpolate(interpolate: (points: Array<[number, number]>) => string): Line; + + tension(): number; + tension(tension: number): Line; + + defined(): (d: T, i: number) => boolean; + defined(defined: (d: T, i: number) => boolean): Line; + } + + module line { + export function radial(): Radial<[number, number]>; + export function radial(): Radial; + + interface Radial { + (data: T[]): string; + + radius(): number | ((d: T, i: number) => number); + radius(radius: number): Radial; + radius(radius: (d: T, i: number) => number): Radial; + + angle(): number | ((d: T, i: number) => number); + angle(angle: number): Radial; + angle(angle: (d: T, i: number) => number): Radial; + + interpolate(): string | ((points: Array<[number, number]>) => string); + interpolate(interpolate: "linear"): Radial; + interpolate(interpolate: "linear-closed"): Radial; + interpolate(interpolate: "step"): Radial; + interpolate(interpolate: "step-before"): Radial; + interpolate(interpolate: "step-after"): Radial; + interpolate(interpolate: "basis"): Radial; + interpolate(interpolate: "basis-open"): Radial; + interpolate(interpolate: "basis-closed"): Radial; + interpolate(interpolate: "bundle"): Radial; + interpolate(interpolate: "cardinal"): Radial; + interpolate(interpolate: "cardinal-open"): Radial; + interpolate(interpolate: "cardinal-closed"): Radial; + interpolate(interpolate: "monotone"): Radial; + interpolate(interpolate: string): Radial; + interpolate(interpolate: (points: Array<[number, number]>) => string): Radial; + + tension(): number; + tension(tension: number): Radial; + + defined(): (d: T, i: number) => boolean; + defined(defined: (d: T, i: number) => boolean): Radial; + } + } + + export function area(): Area<[number, number]>; + export function area(): Area; + + interface Area { + (data: T[]): string; + + x(): number | ((d: T, i: number) => number); + x(x: number): Area; + x(x: (d: T, i: number) => number): Area; + + x0(): number | ((d: T, i: number) => number); + x0(x0: number): Area; + x0(x0: (d: T, i: number) => number): Area; + + x1(): number | ((d: T, i: number) => number); + x1(x1: number): Area; + x1(x1: (d: T, i: number) => number): Area; + + y(): number | ((d: T, i: number) => number); + y(y: number): Area; + y(y: (d: T, i: number) => number): Area; + + y0(): number | ((d: T, i: number) => number); + y0(y0: number): Area; + y0(y0: (d: T, i: number) => number): Area; + + y1(): number | ((d: T, i: number) => number); + y1(y1: number): Area; + y1(y1: (d: T, i: number) => number): Area; + + interpolate(): string | ((points: Array<[number, number]>) => string); + interpolate(interpolate: "linear"): Area; + interpolate(interpolate: "step"): Area; + interpolate(interpolate: "step-before"): Area; + interpolate(interpolate: "step-after"): Area; + interpolate(interpolate: "basis"): Area; + interpolate(interpolate: "basis-open"): Area; + interpolate(interpolate: "cardinal"): Area; + interpolate(interpolate: "cardinal-open"): Area; + interpolate(interpolate: "monotone"): Area; + interpolate(interpolate: string): Area; + + tension(): number; + tension(tension: number): Area; + + defined(): (d: T, i: number) => boolean; + defined(defined: (d: T, i: number) => boolean): Area; + } + + module area { + export function radial(): Radial<[number, number]>; + export function radial(): Radial; + + interface Radial { + (data: T[]): string; + + radius(): number | ((d: T, i: number) => number); + radius(radius: number): Radial; + radius(radius: (d: T, i: number) => number): Radial; + + innerRadius(): number | ((d: T, i: number) => number); + innerRadius(innerRadius: number): Radial; + innerRadius(innerRadius: (d: T, i: number) => number): Radial; + + outerRadius(): number | ((d: T, i: number) => number); + outerRadius(outerRadius: number): Radial; + outerRadius(outerRadius: (d: T, i: number) => number): Radial; + + angle(): number | ((d: T, i: number) => number); + angle(angle: number): Radial; + angle(angle: (d: T, i: number) => number): Radial; + + startAngle(): number | ((d: T, i: number) => number); + startAngle(startAngle: number): Radial; + startAngle(startAngle: (d: T, i: number) => number): Radial; + + endAngle(): number | ((d: T, i: number) => number); + endAngle(endAngle: number): Radial; + endAngle(endAngle: (d: T, i: number) => number): Radial; + + interpolate(): string | ((points: Array<[number, number]>) => string); + interpolate(interpolate: "linear"): Radial; + interpolate(interpolate: "step"): Radial; + interpolate(interpolate: "step-before"): Radial; + interpolate(interpolate: "step-after"): Radial; + interpolate(interpolate: "basis"): Radial; + interpolate(interpolate: "basis-open"): Radial; + interpolate(interpolate: "cardinal"): Radial; + interpolate(interpolate: "cardinal-open"): Radial; + interpolate(interpolate: "monotone"): Radial; + interpolate(interpolate: string): Radial; + interpolate(interpolate: (points: Array<[number, number]>) => string): Radial; + + tension(): number; + tension(tension: number): Radial; + + defined(): (d: T, i: number) => boolean; + defined(defined: (d: T, i: number) => boolean): Radial; + } + } + + export function arc(): Arc; + export function arc(): Arc; + + module arc { + interface Arc { + innerRadius: number; + outerRadius: number; + startAngle: number; + endAngle: number; + padAngle: number + } + } + + interface Arc { + (d: T, i: number): string; + + innerRadius(): (d: T, i: number) => number; + innerRadius(radius: number): Arc; + innerRadius(radius: (d: T, i: number) => number): Arc; + + outerRadius(): (d: T, i: number) => number; + outerRadius(radius: number): Arc; + outerRadius(radius: (d: T, i: number) => number): Arc; + + cornerRadius(): (d: T, i: number) => number; + cornerRadius(radius: number): Arc; + cornerRadius(radius: (d: T, i: number) => number): Arc; + + padRadius(): string | ((d: T, i: number) => number); + padRadius(radius: "auto"): Arc; + padRadius(radius: string): Arc; + padRadius(radius: (d: T, i: number) => number): Arc; + + startAngle(): (d: T, i: number) => number; + startAngle(angle: number): Arc; + startAngle(angle: (d: T, i: number) => number): Arc; + + endAngle(): (d: T, i: number) => number; + endAngle(angle: number): Arc; + endAngle(angle: (d: T, i: number) => number): Arc; + + padAngle(): (d: T, i: number) => number; + padAngle(angle: number): Arc; + padAngle(angle: (d: T, i: number) => number): Arc; + + centroid(d: T, i?: number): [number, number]; + } + + export function symbol(): Symbol<{}>; + export function symbol(): Symbol; + + interface Symbol { + (d: T, i?: number): string; + + type(): (d: T, i: number) => string; + type(type: string): Symbol; + type(type: (d: T, i: number) => string): Symbol; + + size(): (d: T, i: string) => number; + size(size: number): Symbol; + size(size: (d: T, i: number) => number): Symbol; + } + + export var symbolTypes: string[]; + + export function chord(): Chord, chord.Node>; + export function chord(): Chord, Node>; + export function chord(): Chord; + + module chord { + interface Link { + source: Node; + target: Node; + } + + interface Node { + radius: number; + startAngle: number; + endAngle: number + } + } + + interface Chord { + (d: Link, i: number): string; + + source(): (d: Link, i: number) => Node; + source(source: Node): Chord; + source(source: (d: Link, i: number) => Node): Chord; + + target(): (d: Link, i: number) => Node; + target(target: Node): Chord; + target(target: (d: Link, i: number) => Node): Chord; + + radius(): (d: Node, i: number) => number; + radius(radius: number): Chord; + radius(radius: (d: Node, i: number) => number): Chord; + + startAngle(): (d: Node, i: number) => number; + startAngle(angle: number): Chord; + startAngle(angle: (d: Node, i: number) => number): Chord; + + endAngle(): (d: Node, i: number) => number; + endAngle(angle: number): Chord; + endAngle(angle: (d: Node, i: number) => number): Chord; + } + + export function diagonal(): Diagonal, diagonal.Node>; + export function diagonal(): Diagonal, Node>; + export function diagonal(): Diagonal; + + module diagonal { + interface Link { + source: Node; + target: Node; + } + + interface Node { + x: number; + y: number; + } + } + + interface Diagonal { + (d: Link, i: number): string; + + source(): (d: Link, i: number) => Node; + source(source: Node): Diagonal; + source(source: (d: Link, i: number) => Node): Diagonal; + + target(): (d: Link, i: number) => Node; + target(target: Node): Diagonal; + target(target: (d: Link, i: number) => Node): Diagonal; + + projection(): (d: Node, i: number) => [number, number]; + projection(projection: (d: Node, i: number) => [number, number]): Diagonal; + } + + module diagonal { + export function radial(): Radial, Node>; + export function radial(): Radial, Node>; + export function radial(): Radial; + + interface Radial { + (d: Link, i: number): string; + + source(): (d: Link, i: number) => Node; + source(source: Node): Radial; + source(source: (d: Link, i: number) => Node): Radial; + + target(): (d: Link, i: number) => Node; + target(target: Node): Radial; + target(target: (d: Link, i: number) => Node): Radial; + + projection(): (d: Node, i: number) => [number, number]; + projection(projection: (d: Node, i: number) => [number, number]): Radial; + } + } + + export function axis(): Axis; + + interface Axis { + (selection: Selection): void; + (selection: Transition): void; + + scale(): any; + scale(scale: any): Axis; + + orient(): string; + orient(orientation: string): Axis; + + ticks(): any[]; + ticks(...args: any[]): Axis; + + tickValues(): any[]; + tickValues(values: any[]): Axis; + + tickSize(): number; + tickSize(size: number): Axis; + tickSize(inner: number, outer: number): Axis; + + innerTickSize(): number; + innerTickSize(size: number): Axis; + + outerTickSize(): number; + outerTickSize(size: number): Axis; + + tickPadding(): number; + tickPadding(padding: number): Axis; + + tickFormat(): (t: any) => string; + tickFormat(format: (t: any) => string): Axis; + } + + export function brush(): Brush; + export function brush(): Brush; + + module brush { + interface Scale { + domain(): number[]; + domain(domain: number[]): Scale; + + range(): number[]; + range(range: number[]): Scale; + + invert?(y: number): number; + } + } + + interface Brush { + (selection: Selection): void; + (selection: Transition): void; + + event(selection: Selection): void; + event(selection: Transition): void; + + x(): brush.Scale; + x(x: brush.Scale): Brush; + + y(): brush.Scale; + y(y: brush.Scale): Brush; + + extent(): [number, number] | [[number, number], [number, number]]; + extent(extent: [number, number] | [[number, number], [number, number]]): Brush; + + clamp(): boolean | [boolean, boolean]; + clamp(clamp: boolean | [boolean, boolean]): Brush; + + clear(): void; + + empty(): boolean; + + on(type: 'brushstart'): (datum: T, index: number) => void; + on(type: 'brush'): (datum: T, index: number) => void; + on(type: 'brushend'): (datum: T, index: number) => void; + on(type: string): (datum: T, index: number) => void; + + on(type: 'brushstart', listener: (datum: T, index: number) => void): Brush; + on(type: 'brush', listener: (datum: T, index: number) => void): Brush; + on(type: 'brushend', listener: (datum: T, index: number) => void): Brush; + on(type: string, listener: (datum: T, index: number) => void): Brush; + } + } + + export function xhr(url: string, mimeType?: string, callback?: (err: any, data: any) => void): Xhr; + export function xhr(url: string, callback: (err: any, data: any) => void): Xhr; + + interface Xhr { + header(name: string): string; + header(name: string, value: string): Xhr; + + mimeType(): string; + mimeType(type: string): Xhr; + + responseType(): string; + responseType(type: string): Xhr; + + response(): (request: XMLHttpRequest) => any; + response(value: (request: XMLHttpRequest) => any): Xhr; + + get(callback?: (err: any, data: any) => void): Xhr; + + post(data?: any, callback?: (err: any, data: any) => void): Xhr; + post(callback: (err: any, data: any) => void): Xhr; + + send(method: string, data?: any, callback?: (err: any, data: any) => void): Xhr; + send(method: string, callback: (err: any, data: any) => void): Xhr; + + abort(): Xhr; + + on(type: "beforesend"): (request: XMLHttpRequest) => void; + on(type: "progress"): (request: XMLHttpRequest) => void; + on(type: "load"): (response: any) => void; + on(type: "error"): (err: any) => void; + on(type: string): (...args: any[]) => void; + + on(type: "beforesend", listener: (request: XMLHttpRequest) => void): Xhr; + on(type: "progress", listener: (request: XMLHttpRequest) => void): Xhr; + on(type: "load", listener: (response: any) => void): Xhr; + on(type: "error", listener: (err: any) => void): Xhr; + on(type: string, listener: (...args: any[]) => void): Xhr; + } + + export function text(url: string, mimeType?: string, callback?: (err: any, data: string) => void): Xhr; + export function text(url: string, callback: (err: any, data: string) => void): Xhr; + + export function json(url: string, callback?: (err: any, data: any) => void): Xhr; + + export function xml(url: string, mimeType?: string, callback?: (err: any, data: any) => void): Xhr; + export function xml(url: string, callback: (err: any, data: any) => void): Xhr; + + export function html(url: string, callback?: (err: any, data: DocumentFragment) => void): Xhr; + + export var csv: Dsv; + export var tsv: Dsv; + export function dsv(delimiter: string, mimeType: string): Dsv; + + interface Dsv { + (url: string, callback: (rows: { [key: string]: string }[]) => void): DsvXhr<{ [key: string]: string }>; + (url: string, callback: (error: any, rows: { [key: string]: string }[]) => void): DsvXhr<{ [key: string]: string }>; + (url: string): DsvXhr<{ [key: string]: string }>; + (url: string, accessor: (row: { [key: string]: string }) => T, callback: (rows: T[]) => void): DsvXhr; + (url: string, accessor: (row: { [key: string]: string }) => T, callback: (error: any, rows: T[]) => void): DsvXhr; + (url: string, accessor: (row: { [key: string]: string }) => T): DsvXhr; + + parse(string: string): { [key: string]: string }[]; + parse(string: string, accessor: (row: { [key: string]: string }, index: number) => T): T[]; + + parseRows(string: string): string[][]; + parseRows(string: string, accessor: (row: string[], index: number) => T): T[]; + + format(rows: Object[]): string; + + formatRows(rows: string[][]): string; + } + + interface DsvXhr extends Xhr { + row(): (row: { [key: string]: string }) => T; + row(accessor: (row: { [key: string]: string }) => U): DsvXhr; + + header(name: string): string; + header(name: string, value: string): DsvXhr; + + mimeType(): string; + mimeType(type: string): DsvXhr; + + responseType(): string; + responseType(type: string): DsvXhr; + + response(): (request: XMLHttpRequest) => any; + response(value: (request: XMLHttpRequest) => any): DsvXhr; + + get(callback?: (err: any, data: T) => void): DsvXhr; + post(data?: any, callback?: (err: any, data: T) => void): DsvXhr; + post(callback: (err: any, data: T) => void): DsvXhr; + + send(method: string, data?: any, callback?: (err: any, data: T) => void): DsvXhr; + send(method: string, callback: (err: any, data: T) => void): DsvXhr; + + abort(): DsvXhr; + + on(type: "beforesend"): (request: XMLHttpRequest) => void; + on(type: "progress"): (request: XMLHttpRequest) => void; + on(type: "load"): (response: T) => void; + on(type: "error"): (err: any) => void; + on(type: string): (...args: any[]) => void; + + on(type: "beforesend", listener: (request: XMLHttpRequest) => void): DsvXhr; + on(type: "progress", listener: (request: XMLHttpRequest) => void): DsvXhr; + on(type: "load", listener: (response: T) => void): DsvXhr; + on(type: "error", listener: (err: any) => void): DsvXhr; + on(type: string, listener: (...args: any[]) => void): DsvXhr; + } + + export function locale(definition: LocaleDefinition): Locale; + + interface LocaleDefinition { + decimal: string; + thousands: string; + grouping: number[]; + currency: [string, string]; + dateTime: string; + date: string; + time: string; + periods: [string, string]; + days: [string, string, string, string, string, string, string]; + shortDays: [string, string, string, string, string, string, string]; + months: [string, string, string, string, string, string, string, string, string, string, string, string]; + shortMonths: [string, string, string, string, string, string, string, string, string, string, string, string]; + } + + interface Locale { + numberFormat(specifier: string): (n: number) => string; + timeFormat: { + (specifier: string): time.Format; + utc(specifier: string): time.Format; + } + } + + module layout { + export function bundle(): Bundle; + export function bundle(): Bundle + + module bundle { + interface Node { + parent: Node; + } + + interface Link { + source: T; + target: T; + } + } + + interface Bundle { + (links: bundle.Link[]): T[][]; + } + + export function chord(): Chord; + + module chord { + interface Link { + source: Node; + target: Node; + } + + interface Node { + index: number; + subindex: number; + startAngle: number; + endAngle: number; + value: number; + } + + interface Group { + index: number; + startAngle: number; + endAngle: number; + value: number; + } + } + + interface Chord { + matrix(): number[][]; + matrix(matrix: number[][]): Chord; + + padding(): number; + padding(padding: number): Chord; + + sortGroups(): (a: number, b: number) => number; + sortGroups(comparator: (a: number, b: number) => number): Chord; + + sortSubgroups(): (a: number, b: number) => number; + sortSubgroups(comparator: (a: number, b: number) => number): Chord; + + sortChords(): (a: number, b: number) => number; + sortChords(comparator: (a: number, b: number) => number): Chord; + + chords(): chord.Link[]; + groups(): chord.Group[]; + } + + export function cluster(): Cluster; + export function cluster(): Cluster; + + module cluster { + interface Result { + parent?: Result; + children?: Result[]; + depth?: number; + x?: number; + y?: number; + } + + interface Link { + source: T; + target: T; + } + } + + interface Cluster { + (root: T): T[]; + + nodes(root: T): T[]; + + links(nodes: T[]): cluster.Link; + + children(): (node: T) => T[]; + children(accessor: (node: T) => T[]): Cluster; + + sort(): (a: T, b: T) => number; + sort(comparator: (a: T, b: T) => number): Cluster; + + separation(): (a: T, b: T) => number; + separation(separation: (a: T, b: T) => number): Cluster; + + size(): [number, number]; + size(size: [number, number]): Cluster; + + nodeSize(): [number, number]; + nodeSize(nodeSize: [number, number]): Cluster; + + value(): (a: T) => number; + value(value: (a: T) => number): Cluster; + } + + export function force(): Force, force.Node>; + export function force(): Force, Node>; + export function force, Node extends force.Node>(): Force; + + module force { + interface Link { + source: T; + target: T; + } + + interface Node { + index?: number; + x?: number; + y?: number; + px?: number; + py?: number; + fixed?: boolean; + weight?: number; + } + + interface Event { + type: string; + alpha: number; + } + } + + interface Force, Node extends force.Node> { + size(): [number, number]; + size(size: [number, number]): Force; + + linkDistance(): number | ((link: Link, index: number) => number); + linkDistance(distance: number): Force; + linkDistance(distance: (link: Link, index: number) => number): Force; + + linkStrength(): number | ((link: Link, index: number) => number); + linkStrength(strength: number): Force; + linkStrength(strength: (link: Link, index: number) => number): Force; + + friction(): number; + friction(friction: number): Force; + + charge(): number | ((node: Node, index: number) => number); + charge(charge: number): Force; + charge(charge: (node: Node, index: number) => number): Force; + + chargeDistance(): number; + chargeDistance(distance: number): Force; + + theta(): number; + theta(theta: number): Force; + + gravity(): number; + gravity(gravity: number): Force; + + nodes(): Node[]; + nodes(nodes: Node[]): Force; + + links(): Link[]; + links(links: { source: number; target: number }[]): Force; + links(links: Link[]): Force; + + start(): Force; + + alpha(): number; + alpha(value: number): Force; + + resume(): Force; + + stop(): Force; + + on(type: string): (event: force.Event) => void; + on(type: string, listener: (event: force.Event) => void): Force; + + drag(): behavior.Drag; + drag(selection: Selection): void; + } + + export function hierarchy(): Hierarchy; + export function hierarchy(): Hierarchy; + + module hierarchy { + interface Result { + parent?: Result; + children?: Result[]; + value?: number; + depth?: number; + } + } + + interface Hierarchy { + (root: T): T[]; + + children(): (node: T) => T[]; + children(accessor: (node: T) => T[]): Hierarchy; + + sort(): (a: T, b: T) => number; + sort(comparator: (a: T, b: T) => number): Hierarchy; + + value(): (node: T) => number; + value(accessor: (node: T) => number): Hierarchy; + + revalue(root: T): T[]; + } + + export function histogram(): Histogram; + export function histogram(): Histogram; + + module histogram { + interface Bin extends Array { + x: number; + dx: number; + y: number; + } + } + + interface Histogram { + (values: T[], index?: number): histogram.Bin[]; + + value(): (datum: T, index: number) => number; + value(value: (datum: T, index: number) => number): Histogram; + + range(): (values: T[], index: number) => [number, number]; + range(range: (values: T[], index: number) => [number, number]): Histogram; + + bins(): (range: [number, number], values: T[], index: number) => number[]; + bins(count: number): Histogram; + bins(thresholds: number[]): Histogram; + bins(func: (range: [number, number], values: T[], index: number) => number[]): Histogram; + + frequency(): boolean; + frequency(frequency: boolean): Histogram; + } + + export function pack(): Pack; + export function pack(): Pack; + + module pack { + interface Node { + parent?: Node; + children?: Node[]; + value?: number; + depth?: number; + x?: number; + y?: number; + r?: number; + } + + interface Link { + source: Node; + target: Node; + } + } + + interface Pack { + (root: T): T[]; + + nodes(root: T): T[]; + + links(nodes: T[]): pack.Link[]; + + children(): (node: T, depth: number) => T[]; + children(children: (node: T, depth: number) => T[]): Pack; + + sort(): (a: T, b: T) => number; + sort(comparator: (a: T, b: T) => number): Pack; + + value(): (node: T) => number; + value(value: (node: T) => number): Pack; + + size(): [number, number]; + size(size: [number, number]): Pack; + + radius(): number | ((node: T) => number); + radius(radius: number): Pack; + radius(radius: (node: T) => number): Pack; + + padding(): number; + padding(padding: number): Pack; + } + + export function pie(): Pie; + export function pie(): Pie; + + module pie { + interface Arc { + value: number; + startAngle: number; + endAngle: number; + padAngle: number; + data: T; + } + } + + interface Pie { + (data: T[], index?: number): pie.Arc[]; + + value(): (datum: T, index: number) => number; + value(accessor: (datum: T, index: number) => number): Pie; + + sort(): (a: T, b: T) => number; + sort(comparator: (a: T, b: T) => number): Pie; + + startAngle(): number | ((data: T[], index: number) => number); + startAngle(angle: number): Pie; + startAngle(angle: (data: T[], index: number) => number): Pie; + + endAngle(): number | ((data: T[], index: number) => number); + endAngle(angle: number): Pie; + endAngle(angle: (data: T[], index: number) => number): Pie; + + padAngle(): number | ((data: T[], index: number) => number); + padAngle(angle: number): Pie; + padAngle(angle: (data: T[], index: number) => number): Pie; + } + + export function stack(): Stack; + export function stack(): Stack; + export function stack(): Stack; + module stack { + interface Value { + x: number; + y: number; + y0?: number; + } + } + + interface Stack { + (layers: Series[], index?: number): Series[]; + + values(): (layer: Series, index: number) => Value[]; + values(accessor: (layer: Series, index: number) => Value[]): Stack; + + offset(): (data: Array<[number, number]>) => number[]; + offset(offset: "silhouette"): Stack; + offset(offset: "wiggle"): Stack; + offset(offset: "expand"): Stack; + offset(offset: "zero"): Stack; + offset(offset: string): Stack; + offset(offset: (data: Array<[number, number]>) => number[]): Stack; + + order(): (data: Array<[number, number]>) => number[]; + order(order: "inside-out"): Stack; + order(order: "reverse"): Stack; + order(order: "default"): Stack; + order(order: string): Stack; + order(order: (data: Array<[number, number]>) => number[]): Stack; + + x(): (value: Value, index: number) => number; + x(accessor: (value: Value, index: number) => number): Stack; + + y(): (value: Value, index: number) => number; + y(accesor: (value: Value, index: number) => number): Stack; + + out(): (value: Value, y0: number, y: number) => void; + out(setter: (value: Value, y0: number, y: number) => void): Stack; + } + + export function tree(): Tree; + export function tree(): Tree; + + module tree { + interface Link { + source: T; + target: T; + } + + interface Node { + parent?: Node; + children?: Node[]; + depth?: number; + x?: number; + y?: number; + } + } + + interface Tree { + (root: T, index?: number): T[]; + + nodes(root: T, index?: number): T[]; + + links(nodes: T[]): tree.Link[]; + + children(): (datum: T, index: number) => T[]; + children(children: (datum: T, index: number) => T[]): Tree; + + separation(): (a: T, b: T) => number; + separation(separation: (a: T, b: T) => number): Tree; + + size(): [number, number]; + size(size: [number, number]): Tree; + + nodeSize(): [number, number]; + nodeSize(size: [number, number]): Tree; + + sort(): (a: T, b: T) => number; + sort(comparator: (a: T, b: T) => number): Tree; + + value(): (datum: T, index: number) => number; + value(value: (datum: T, index: number) => number): Tree; + } + + export function treemap(): Treemap; + export function treemap(): Treemap; + + module treemap { + interface Node { + parent?: Node; + children?: Node[]; + value?: number; + depth?: number; + x?: number; + y?: number; + dx?: number; + dy?: number; + } + + interface Link { + source: T; + target: T; + } + + type Padding = number | [number, number, number, number]; + } + + interface Treemap { + (root: T, index?: number): T[]; + + nodes(root: T, index?: number): T[]; + + links(nodes: T[]): treemap.Link[]; + + children(): (node: T, depth: number) => T[]; + children(children: (node: T, depth: number) => T[]): Treemap; + + sort(): (a: T, b: T) => number; + sort(comparator: (a: T, b: T) => number): Treemap; + + value(): (node: T, index: number) => number; + value(value: (node: T, index: number) => number): Treemap; + + size(): [number, number]; + size(size: [number, number]): Treemap; + + padding(): (node: T, depth: number) => treemap.Padding; + padding(padding: treemap.Padding): Treemap; + padding(padding: (node: T, depth: number) => treemap.Padding): Treemap; + + round(): boolean; + round(round: boolean): Treemap; + + sticky(): boolean; + sticky(sticky: boolean): boolean; + + mode(): string; + mode(mode: "squarify"): Treemap; + mode(mode: "slice"): Treemap; + mode(mode: "dice"): Treemap; + mode(mode: "slice-dice"): Treemap; + mode(mode: string): Treemap; + + ratio(): number; + ratio(ratio: number): Treemap; + } + } + + module geom { + export function voronoi(): Voronoi<[number, number]>; + export function voronoi(): Voronoi; + + module voronoi { + interface Link { + source: T; + target: T; + } + } + + interface Voronoi { + (data: T[]): Array<[number, number]>; + + x(): (vertex: T) => number; + x(x: (vertex: T) => number): Voronoi; + + y(): (vertex: T) => number; + y(y: (vertex: T) => number): Voronoi; + + clipExtent(): [[number, number], [number, number]]; + clipExtent(extent: [[number, number], [number, number]]): Voronoi; + + links(data: T[]): voronoi.Link[]; + + triangles(data: T[]): Array<[T, T, T]>; + } + + /** + * @deprecated use d3.geom.voronoi().triangles() instead + */ + export function delaunay(vertices: Array<[number, number]>): Array<[[number, number], [number, number], [number, number]]>; + + export function quadtree(): Quadtree<[number, number]>; + export function quadtree(): Quadtree; + + module quadtree { + interface Node { + nodes: [Node, Node, Node, Node]; + leaf: boolean; + point: T; + x: number; + y: number; + } + + interface Quadtree extends Node { + add(point: T): void; + visit(callback: (node: Node, x1: number, y1: number, x2: number, y2: number) => boolean | void): void; + find(point: [number, number]): T; + } + } + + interface Quadtree { + (points: T[]): quadtree.Quadtree; + + x(): (datum: T, index: number) => number; + x(x: number): Quadtree; + x(x: (datum: T, index: number) => number): Quadtree; + + y(): (datum: T, index: number) => number; + y(y: number): Quadtree; + y(y: (datum: T, index: number) => number): Quadtree; + + extent(): [[number, number], [number, number]]; + extent(extent: [[number, number], [number, number]]): Quadtree; + } + + export function hull(vertices: Array<[number, number]>): Array<[number, number]>; + export function hull(): Hull<[number, number]>; + export function hull(): Hull; + + interface Hull { + (vertices: T[]): Array<[number, number]>; + + x(): (datum: T) => number; + x(x: (datum: T) => number): Hull; + + y(): (datum: T) => number; + y(y: (datum: T) => number): Hull; + } + + export function polygon(vertices: Array<[number, number]>): Polygon; + + interface Polygon { + area(): number; + + centroid(): [number, number]; + + clip(subject: Array<[number, number]>): Array<[number, number]>; + } + } +} + +// we need this to exist +interface TouchList { } + +declare module 'd3' { + export = d3; +} diff --git a/catalog-ui/typings/jasmine/jasmine.d.ts b/catalog-ui/typings/jasmine/jasmine.d.ts new file mode 100644 index 0000000000..99ccb91fed --- /dev/null +++ b/catalog-ui/typings/jasmine/jasmine.d.ts @@ -0,0 +1,515 @@ +/*- + * ============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========================================================= + */ +// Type definitions for Jasmine 2.2 +// Project: http://jasmine.github.io/ +// Definitions by: Boris Yankov , Theodore Brown , David Pärsson +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +// For ddescribe / iit use : https://github.com/borisyankov/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts + +declare function describe(description: string, specDefinitions: () => void): void; +declare function fdescribe(description: string, specDefinitions: () => void): void; +declare function xdescribe(description: string, specDefinitions: () => void): void; + +declare function it(expectation: string, assertion?: () => void, timeout?: number): void; +declare function it(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; +declare function fit(expectation: string, assertion?: () => void, timeout?: number): void; +declare function fit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; +declare function xit(expectation: string, assertion?: () => void, timeout?: number): void; +declare function xit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; + +/** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */ +declare function pending(reason?: string): void; + +declare function beforeEach(action: () => void, timeout?: number): void; +declare function beforeEach(action: (done: () => void) => void, timeout?: number): void; +declare function afterEach(action: () => void, timeout?: number): void; +declare function afterEach(action: (done: () => void) => void, timeout?: number): void; + +declare function beforeAll(action: () => void, timeout?: number): void; +declare function beforeAll(action: (done: () => void) => void, timeout?: number): void; +declare function afterAll(action: () => void, timeout?: number): void; +declare function afterAll(action: (done: () => void) => void, timeout?: number): void; + +declare function expect(spy: Function): jasmine.Matchers; +declare function expect(actual: any): jasmine.Matchers; + +declare function fail(e?: any): void; + +declare function spyOn(object: any, method: string): jasmine.Spy; + +declare function runs(asyncMethod: Function): void; +declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void; +declare function waits(timeout?: number): void; + +declare module jasmine { + + var clock: () => Clock; + + function any(aclass: any): Any; + function anything(): Any; + function arrayContaining(sample: any[]): ArrayContaining; + function objectContaining(sample: any): ObjectContaining; + function createSpy(name: string, originalFn?: Function): Spy; + function createSpyObj(baseName: string, methodNames: any[]): any; + function createSpyObj(baseName: string, methodNames: any[]): T; + function pp(value: any): string; + function getEnv(): Env; + function addCustomEqualityTester(equalityTester: CustomEqualityTester): void; + function addMatchers(matchers: CustomMatcherFactories): void; + function stringMatching(str: string): Any; + function stringMatching(str: RegExp): Any; + + interface Any { + + new (expectedClass: any): any; + + jasmineMatches(other: any): boolean; + jasmineToString(): string; + } + + // taken from TypeScript lib.core.es6.d.ts, applicable to CustomMatchers.contains() + interface ArrayLike { + length: number; + [n: number]: T; + } + + interface ArrayContaining { + new (sample: any[]): any; + + asymmetricMatch(other: any): boolean; + jasmineToString(): string; + } + + interface ObjectContaining { + new (sample: any): any; + + jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean; + jasmineToString(): string; + } + + interface Block { + + new (env: Env, func: SpecFunction, spec: Spec): any; + + execute(onComplete: () => void): void; + } + + interface WaitsBlock extends Block { + new (env: Env, timeout: number, spec: Spec): any; + } + + interface WaitsForBlock extends Block { + new (env: Env, timeout: number, latchFunction: SpecFunction, message: string, spec: Spec): any; + } + + interface Clock { + install(): void; + uninstall(): void; + /** Calls to any registered callback are triggered when the clock is ticked forward via the jasmine.clock().tick function, which takes a number of milliseconds. */ + tick(ms: number): void; + mockDate(date?: Date): void; + } + + interface CustomEqualityTester { + (first: any, second: any): boolean; + } + + interface CustomMatcher { + compare(actual: T, expected: T): CustomMatcherResult; + compare(actual: any, expected: any): CustomMatcherResult; + } + + interface CustomMatcherFactory { + (util: MatchersUtil, customEqualityTesters: Array): CustomMatcher; + } + + interface CustomMatcherFactories { + [index: string]: CustomMatcherFactory; + } + + interface CustomMatcherResult { + pass: boolean; + message: string; + } + + interface MatchersUtil { + equals(a: any, b: any, customTesters?: Array): boolean; + contains(haystack: ArrayLike | string, needle: any, customTesters?: Array): boolean; + buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: Array): string; + } + + interface Env { + setTimeout: any; + clearTimeout: void; + setInterval: any; + clearInterval: void; + updateInterval: number; + + currentSpec: Spec; + + matchersClass: Matchers; + + version(): any; + versionString(): string; + nextSpecId(): number; + addReporter(reporter: Reporter): void; + execute(): void; + describe(description: string, specDefinitions: () => void): Suite; + // ddescribe(description: string, specDefinitions: () => void): Suite; Not a part of jasmine. Angular team adds these + beforeEach(beforeEachFunction: () => void): void; + beforeAll(beforeAllFunction: () => void): void; + currentRunner(): Runner; + afterEach(afterEachFunction: () => void): void; + afterAll(afterAllFunction: () => void): void; + xdescribe(desc: string, specDefinitions: () => void): XSuite; + it(description: string, func: () => void): Spec; + // iit(description: string, func: () => void): Spec; Not a part of jasmine. Angular team adds these + xit(desc: string, func: () => void): XSpec; + compareRegExps_(a: RegExp, b: RegExp, mismatchKeys: string[], mismatchValues: string[]): boolean; + compareObjects_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean; + equals_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean; + contains_(haystack: any, needle: any): boolean; + addCustomEqualityTester(equalityTester: CustomEqualityTester): void; + addMatchers(matchers: CustomMatcherFactories): void; + specFilter(spec: Spec): boolean; + } + + interface FakeTimer { + + new (): any; + + reset(): void; + tick(millis: number): void; + runFunctionsWithinRange(oldMillis: number, nowMillis: number): void; + scheduleFunction(timeoutKey: any, funcToCall: () => void, millis: number, recurring: boolean): void; + } + + interface HtmlReporter { + new (): any; + } + + interface HtmlSpecFilter { + new (): any; + } + + interface Result { + type: string; + } + + interface NestedResults extends Result { + description: string; + + totalCount: number; + passedCount: number; + failedCount: number; + + skipped: boolean; + + rollupCounts(result: NestedResults): void; + log(values: any): void; + getItems(): Result[]; + addResult(result: Result): void; + passed(): boolean; + } + + interface MessageResult extends Result { + values: any; + trace: Trace; + } + + interface ExpectationResult extends Result { + matcherName: string; + passed(): boolean; + expected: any; + actual: any; + message: string; + trace: Trace; + } + + interface Trace { + name: string; + message: string; + stack: any; + } + + interface PrettyPrinter { + + new (): any; + + format(value: any): void; + iterateObject(obj: any, fn: (property: string, isGetter: boolean) => void): void; + emitScalar(value: any): void; + emitString(value: string): void; + emitArray(array: any[]): void; + emitObject(obj: any): void; + append(value: any): void; + } + + interface StringPrettyPrinter extends PrettyPrinter { + } + + interface Queue { + + new (env: any): any; + + env: Env; + ensured: boolean[]; + blocks: Block[]; + running: boolean; + index: number; + offset: number; + abort: boolean; + + addBefore(block: Block, ensure?: boolean): void; + add(block: any, ensure?: boolean): void; + insertNext(block: any, ensure?: boolean): void; + start(onComplete?: () => void): void; + isRunning(): boolean; + next_(): void; + results(): NestedResults; + } + + interface Matchers { + + new (env: Env, actual: any, spec: Env, isNot?: boolean): any; + + env: Env; + actual: any; + spec: Env; + isNot?: boolean; + message(): any; + + toBe(expected: any, expectationFailOutput?: any): boolean; + toEqual(expected: any, expectationFailOutput?: any): boolean; + toMatch(expected: any, expectationFailOutput?: any): boolean; + toBeDefined(expectationFailOutput?: any): boolean; + toBeUndefined(expectationFailOutput?: any): boolean; + toBeNull(expectationFailOutput?: any): boolean; + toBeNaN(): boolean; + toBeTruthy(expectationFailOutput?: any): boolean; + toBeFalsy(expectationFailOutput?: any): boolean; + toHaveBeenCalled(): boolean; + toHaveBeenCalledWith(...params: any[]): boolean; + toContain(expected: any, expectationFailOutput?: any): boolean; + toBeLessThan(expected: any, expectationFailOutput?: any): boolean; + toBeGreaterThan(expected: any, expectationFailOutput?: any): boolean; + toBeCloseTo(expected: any, precision: any, expectationFailOutput?: any): boolean; + toContainHtml(expected: string): boolean; + toContainText(expected: string): boolean; + toThrow(expected?: any): boolean; + toThrowError(expected?: any, message?: string): boolean; + not: Matchers; + + Any: Any; + } + + interface Reporter { + reportRunnerStarting(runner: Runner): void; + reportRunnerResults(runner: Runner): void; + reportSuiteResults(suite: Suite): void; + reportSpecStarting(spec: Spec): void; + reportSpecResults(spec: Spec): void; + log(str: string): void; + } + + interface MultiReporter extends Reporter { + addReporter(reporter: Reporter): void; + } + + interface Runner { + + new (env: Env): any; + + execute(): void; + beforeEach(beforeEachFunction: SpecFunction): void; + afterEach(afterEachFunction: SpecFunction): void; + beforeAll(beforeAllFunction: SpecFunction): void; + afterAll(afterAllFunction: SpecFunction): void; + finishCallback(): void; + addSuite(suite: Suite): void; + add(block: Block): void; + specs(): Spec[]; + suites(): Suite[]; + topLevelSuites(): Suite[]; + results(): NestedResults; + } + + interface SpecFunction { + (spec?: Spec): void; + } + + interface SuiteOrSpec { + id: number; + env: Env; + description: string; + queue: Queue; + } + + interface Spec extends SuiteOrSpec { + + new (env: Env, suite: Suite, description: string): any; + + suite: Suite; + + afterCallbacks: SpecFunction[]; + spies_: Spy[]; + + results_: NestedResults; + matchersClass: Matchers; + + getFullName(): string; + results(): NestedResults; + log(arguments: any): any; + runs(func: SpecFunction): Spec; + addToQueue(block: Block): void; + addMatcherResult(result: Result): void; + expect(actual: any): any; + waits(timeout: number): Spec; + waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec; + fail(e?: any): void; + getMatchersClass_(): Matchers; + addMatchers(matchersPrototype: CustomMatcherFactories): void; + finishCallback(): void; + finish(onComplete?: () => void): void; + after(doAfter: SpecFunction): void; + execute(onComplete?: () => void): any; + addBeforesAndAftersToQueue(): void; + explodes(): void; + spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy; + removeAllSpies(): void; + } + + interface XSpec { + id: number; + runs(): void; + } + + interface Suite extends SuiteOrSpec { + + new (env: Env, description: string, specDefinitions: () => void, parentSuite: Suite): any; + + parentSuite: Suite; + + getFullName(): string; + finish(onComplete?: () => void): void; + beforeEach(beforeEachFunction: SpecFunction): void; + afterEach(afterEachFunction: SpecFunction): void; + beforeAll(beforeAllFunction: SpecFunction): void; + afterAll(afterAllFunction: SpecFunction): void; + results(): NestedResults; + add(suiteOrSpec: SuiteOrSpec): void; + specs(): Spec[]; + suites(): Suite[]; + children(): any[]; + execute(onComplete?: () => void): void; + } + + interface XSuite { + execute(): void; + } + + interface Spy { + (...params: any[]): any; + + identity: string; + and: SpyAnd; + calls: Calls; + mostRecentCall: { args: any[]; }; + argsForCall: any[]; + wasCalled: boolean; + } + + interface SpyAnd { + /** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */ + callThrough(): Spy; + /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */ + returnValue(val: any): void; + /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */ + callFake(fn: Function): Spy; + /** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */ + throwError(msg: string): void; + /** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */ + stub(): Spy; + } + + interface Calls { + /** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. **/ + any(): boolean; + /** By chaining the spy with calls.count(), will return the number of times the spy was called **/ + count(): number; + /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index **/ + argsFor(index: number): any[]; + /** By chaining the spy with calls.allArgs(), will return the arguments to all calls **/ + allArgs(): any[]; + /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls **/ + all(): CallInfo[]; + /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call **/ + mostRecent(): CallInfo; + /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call **/ + first(): CallInfo; + /** By chaining the spy with calls.reset(), will clears all tracking for a spy **/ + reset(): void; + } + + interface CallInfo { + /** The context (the this) for the call */ + object: any; + /** All arguments passed to the call */ + args: any[]; + } + + interface Util { + inherit(childClass: Function, parentClass: Function): any; + formatException(e: any): any; + htmlEscape(str: string): string; + argsToArray(args: any): any; + extend(destination: any, source: any): any; + } + + interface JsApiReporter extends Reporter { + + started: boolean; + finished: boolean; + result: any; + messages: any; + + new (): any; + + suites(): Suite[]; + summarize_(suiteOrSpec: SuiteOrSpec): any; + results(): any; + resultsForSpec(specId: any): any; + log(str: any): any; + resultsForSpecs(specIds: any): any; + summarizeResult_(result: any): any; + } + + interface Jasmine { + Spec: Spec; + clock: Clock; + util: Util; + } + + export var HtmlReporter: HtmlReporter; + export var HtmlSpecFilter: HtmlSpecFilter; + export var DEFAULT_TIMEOUT_INTERVAL: number; +} diff --git a/catalog-ui/typings/jquery/jquery.d.ts b/catalog-ui/typings/jquery/jquery.d.ts new file mode 100644 index 0000000000..cc20de588b --- /dev/null +++ b/catalog-ui/typings/jquery/jquery.d.ts @@ -0,0 +1,3181 @@ +/*- + * ============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========================================================= + */ +// Type definitions for jQuery 1.10.x / 2.0.x +// Project: http://jquery.com/ +// Definitions by: Boris Yankov , Christian Hoffmeister , Steve Fenton , Diullei Gomes , Tass Iliopoulos , Jason Swearingen , Sean Hill , Guus Goossens , Kelly Summerlin , Basarat Ali Syed , Nicholas Wolverson , Derek Cicerone , Andrew Gaspar , James Harrison Fisher , Seikichi Kondo , Benjamin Jackman , Poul Sorensen , Josh Strobl , John Reilly , Dick van den Brink +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/* ***************************************************************************** +Copyright (c) Microsoft Corporation. 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 + +THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +/** + * Interface for the AJAX setting that will configure the AJAX request + */ +interface JQueryAjaxSettings { + /** + * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. + */ + accepts?: any; + /** + * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). + */ + async?: boolean; + /** + * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. + */ + beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any; + /** + * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. + */ + cache?: boolean; + /** + * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + */ + complete? (jqXHR: JQueryXHR, textStatus: string): any; + /** + * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5) + */ + contents?: { [key: string]: any; }; + //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false" + // https://github.com/borisyankov/DefinitelyTyped/issues/742 + /** + * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. + */ + contentType?: any; + /** + * This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). + */ + context?: any; + /** + * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5) + */ + converters?: { [key: string]: any; }; + /** + * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5) + */ + crossDomain?: boolean; + /** + * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). + */ + data?: any; + /** + * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. + */ + dataFilter? (data: any, ty: any): any; + /** + * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). + */ + dataType?: string; + /** + * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. + */ + error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any; + /** + * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. + */ + global?: boolean; + /** + * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5) + */ + headers?: { [key: string]: any; }; + /** + * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. + */ + ifModified?: boolean; + /** + * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1) + */ + isLocal?: boolean; + /** + * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" } + */ + jsonp?: any; + /** + * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. + */ + jsonpCallback?: any; + /** + * A mime type to override the XHR mime type. (version added: 1.5.1) + */ + mimeType?: string; + /** + * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + password?: string; + /** + * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false. + */ + processData?: boolean; + /** + * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. + */ + scriptCharset?: string; + /** + * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5) + */ + statusCode?: { [key: string]: any; }; + /** + * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + */ + success? (data: any, textStatus: string, jqXHR: JQueryXHR): any; + /** + * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. + */ + timeout?: number; + /** + * Set this to true if you wish to use the traditional style of param serialization. + */ + traditional?: boolean; + /** + * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers. + */ + type?: string; + /** + * A string containing the URL to which the request is sent. + */ + url?: string; + /** + * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + username?: string; + /** + * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory. + */ + xhr?: any; + /** + * An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1) + */ + xhrFields?: { [key: string]: any; }; +} + +/** + * Interface for the jqXHR object + */ +interface JQueryXHR extends XMLHttpRequest, JQueryPromise { + /** + * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). + */ + overrideMimeType(mimeType: string): any; + /** + * Cancel the request. + * + * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled" + */ + abort(statusText?: string): void; + /** + * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details. + */ + then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise; + /** + * Property containing the parsed response if the response Content-Type is json + */ + responseJSON?: any; +} + +/** + * Interface for the JQuery callback + */ +interface JQueryCallback { + /** + * Add a callback or a collection of callbacks to a callback list. + * + * @param callbacks A function, or array of functions, that are to be added to the callback list. + */ + add(callbacks: Function): JQueryCallback; + /** + * Add a callback or a collection of callbacks to a callback list. + * + * @param callbacks A function, or array of functions, that are to be added to the callback list. + */ + add(callbacks: Function[]): JQueryCallback; + + /** + * Disable a callback list from doing anything more. + */ + disable(): JQueryCallback; + + /** + * Determine if the callbacks list has been disabled. + */ + disabled(): boolean; + + /** + * Remove all of the callbacks from a list. + */ + empty(): JQueryCallback; + + /** + * Call all of the callbacks with the given arguments + * + * @param arguments The argument or list of arguments to pass back to the callback list. + */ + fire(...arguments: any[]): JQueryCallback; + + /** + * Determine if the callbacks have already been called at least once. + */ + fired(): boolean; + + /** + * Call all callbacks in a list with the given context and arguments. + * + * @param context A reference to the context in which the callbacks in the list should be fired. + * @param arguments An argument, or array of arguments, to pass to the callbacks in the list. + */ + fireWith(context?: any, ...args: any[]): JQueryCallback; + + /** + * Determine whether a supplied callback is in a list + * + * @param callback The callback to search for. + */ + has(callback: Function): boolean; + + /** + * Lock a callback list in its current state. + */ + lock(): JQueryCallback; + + /** + * Determine if the callbacks list has been locked. + */ + locked(): boolean; + + /** + * Remove a callback or a collection of callbacks from a callback list. + * + * @param callbacks A function, or array of functions, that are to be removed from the callback list. + */ + remove(callbacks: Function): JQueryCallback; + /** + * Remove a callback or a collection of callbacks from a callback list. + * + * @param callbacks A function, or array of functions, that are to be removed from the callback list. + */ + remove(callbacks: Function[]): JQueryCallback; +} + +/** + * Allows jQuery Promises to interop with non-jQuery promises + */ +interface JQueryGenericPromise { + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + */ + then(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; + + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + */ + then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; +} + +/** + * Interface for the JQuery promise/deferred callbacks + */ +interface JQueryPromiseCallback { + (value?: T, ...args: any[]): void; +} + +interface JQueryPromiseOperator { + (callback1: JQueryPromiseCallback|JQueryPromiseCallback[], ...callbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; +} + +/** + * Interface for the JQuery promise, part of callbacks + */ +interface JQueryPromise extends JQueryGenericPromise { + /** + * Determine the current state of a Deferred object. + */ + state(): string; + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * + * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + */ + always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; + /** + * Add handlers to be called when the Deferred object is resolved. + * + * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + */ + done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + */ + fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * + * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. + */ + progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; + + // Deprecated - given no typings + pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; +} + +/** + * Interface for the JQuery deferred, part of callbacks + */ +interface JQueryDeferred extends JQueryGenericPromise { + /** + * Determine the current state of a Deferred object. + */ + state(): string; + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * + * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + */ + always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + /** + * Add handlers to be called when the Deferred object is resolved. + * + * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + */ + done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + */ + fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * + * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. + */ + progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + + /** + * Call the progressCallbacks on a Deferred object with the given args. + * + * @param args Optional arguments that are passed to the progressCallbacks. + */ + notify(value?: any, ...args: any[]): JQueryDeferred; + + /** + * Call the progressCallbacks on a Deferred object with the given context and args. + * + * @param context Context passed to the progressCallbacks as the this object. + * @param args Optional arguments that are passed to the progressCallbacks. + */ + notifyWith(context: any, value?: any, ...args: any[]): JQueryDeferred; + + /** + * Reject a Deferred object and call any failCallbacks with the given args. + * + * @param args Optional arguments that are passed to the failCallbacks. + */ + reject(value?: any, ...args: any[]): JQueryDeferred; + /** + * Reject a Deferred object and call any failCallbacks with the given context and args. + * + * @param context Context passed to the failCallbacks as the this object. + * @param args An optional array of arguments that are passed to the failCallbacks. + */ + rejectWith(context: any, value?: any, ...args: any[]): JQueryDeferred; + + /** + * Resolve a Deferred object and call any doneCallbacks with the given args. + * + * @param value First argument passed to doneCallbacks. + * @param args Optional subsequent arguments that are passed to the doneCallbacks. + */ + resolve(value?: T, ...args: any[]): JQueryDeferred; + + /** + * Resolve a Deferred object and call any doneCallbacks with the given context and args. + * + * @param context Context passed to the doneCallbacks as the this object. + * @param args An optional array of arguments that are passed to the doneCallbacks. + */ + resolveWith(context: any, value?: T, ...args: any[]): JQueryDeferred; + + /** + * Return a Deferred's Promise object. + * + * @param target Object onto which the promise methods have to be attached + */ + promise(target?: any): JQueryPromise; + + // Deprecated - given no typings + pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; +} + +/** + * Interface of the JQuery extension of the W3C event object + */ +interface BaseJQueryEventObject extends Event { + data: any; + delegateTarget: Element; + isDefaultPrevented(): boolean; + isImmediatePropagationStopped(): boolean; + isPropagationStopped(): boolean; + namespace: string; + originalEvent: Event; + preventDefault(): any; + relatedTarget: Element; + result: any; + stopImmediatePropagation(): void; + stopPropagation(): void; + target: Element; + pageX: number; + pageY: number; + which: number; + metaKey: boolean; +} + +interface JQueryInputEventObject extends BaseJQueryEventObject { + altKey: boolean; + ctrlKey: boolean; + metaKey: boolean; + shiftKey: boolean; +} + +interface JQueryMouseEventObject extends JQueryInputEventObject { + button: number; + clientX: number; + clientY: number; + offsetX: number; + offsetY: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; +} + +interface JQueryKeyEventObject extends JQueryInputEventObject { + char: any; + charCode: number; + key: any; + keyCode: number; +} + +interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{ +} + +/* + Collection of properties of the current browser +*/ + +interface JQuerySupport { + ajax?: boolean; + boxModel?: boolean; + changeBubbles?: boolean; + checkClone?: boolean; + checkOn?: boolean; + cors?: boolean; + cssFloat?: boolean; + hrefNormalized?: boolean; + htmlSerialize?: boolean; + leadingWhitespace?: boolean; + noCloneChecked?: boolean; + noCloneEvent?: boolean; + opacity?: boolean; + optDisabled?: boolean; + optSelected?: boolean; + scriptEval? (): boolean; + style?: boolean; + submitBubbles?: boolean; + tbody?: boolean; +} + +interface JQueryParam { + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + * + * @param obj An array or object to serialize. + */ + (obj: any): string; + + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + * + * @param obj An array or object to serialize. + * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. + */ + (obj: any, traditional: boolean): string; +} + +/** + * The interface used to construct jQuery events (with $.Event). It is + * defined separately instead of inline in JQueryStatic to allow + * overriding the construction function with specific strings + * returning specific event objects. + */ +interface JQueryEventConstructor { + (name: string, eventProperties?: any): JQueryEventObject; + new (name: string, eventProperties?: any): JQueryEventObject; +} + +/** + * The interface used to specify coordinates. + */ +interface JQueryCoordinates { + left: number; + top: number; +} + +/** + * Elements in the array returned by serializeArray() + */ +interface JQuerySerializeArrayElement { + name: string; + value: string; +} + +interface JQueryAnimationOptions { + /** + * A string or number determining how long the animation will run. + */ + duration?: any; + /** + * A string indicating which easing function to use for the transition. + */ + easing?: string; + /** + * A function to call once the animation is complete. + */ + complete?: Function; + /** + * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. + */ + step?: (now: number, tween: any) => any; + /** + * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8) + */ + progress?: (animation: JQueryPromise, progress: number, remainingMs: number) => any; + /** + * A function to call when the animation begins. (version added: 1.8) + */ + start?: (animation: JQueryPromise) => any; + /** + * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8) + */ + done?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + /** + * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8) + */ + fail?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + /** + * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8) + */ + always?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + /** + * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. + */ + queue?: any; + /** + * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4) + */ + specialEasing?: Object; +} + +/** + * Static members of jQuery (those on $ and jQuery themselves) + */ +interface JQueryStatic { + + /** + * Perform an asynchronous HTTP (Ajax) request. + * + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). + */ + ajax(settings: JQueryAjaxSettings): JQueryXHR; + /** + * Perform an asynchronous HTTP (Ajax) request. + * + * @param url A string containing the URL to which the request is sent. + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). + */ + ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR; + + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). + * + * @param dataTypes An optional string containing one or more space-separated dataTypes + * @param handler A handler to set default values for future Ajax requests. + */ + ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). + * + * @param handler A handler to set default values for future Ajax requests. + */ + ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; + + ajaxSettings: JQueryAjaxSettings; + + /** + * Set default values for future Ajax requests. Its use is not recommended. + * + * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. + */ + ajaxSetup(options: JQueryAjaxSettings): void; + + /** + * Load data from the server using a HTTP GET request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). + */ + get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load data from the server using a HTTP GET request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). + */ + get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + */ + getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. + */ + getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + /** + * Load a JavaScript file from the server using a GET HTTP request, then execute it. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + */ + getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + */ + param: JQueryParam; + + /** + * Load data from the server using a HTTP POST request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + */ + post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load data from the server using a HTTP POST request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + */ + post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + + /** + * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. + * + * @param flags An optional list of space-separated flags that change how the callback list behaves. + */ + Callbacks(flags?: string): JQueryCallback; + + /** + * Holds or releases the execution of jQuery's ready event. + * + * @param hold Indicates whether the ready hold is being requested or released + */ + holdReady(hold: boolean): void; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param selector A string containing a selector expression + * @param context A DOM Element, Document, or jQuery to use as context + */ + (selector: string, context?: Element|JQuery): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param element A DOM element to wrap in a jQuery object. + */ + (element: Element): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object. + */ + (elementArray: Element[]): JQuery; + + /** + * Binds a function to be executed when the DOM has finished loading. + * + * @param callback A function to execute after the DOM is ready. + */ + (callback: (jQueryAlias?: JQueryStatic) => any): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param object A plain object to wrap in a jQuery object. + */ + (object: {}): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param object An existing jQuery object to clone. + */ + (object: JQuery): JQuery; + + /** + * Specify a function to execute when the DOM is fully loaded. + */ + (): JQuery; + + /** + * Creates DOM elements on the fly from the provided string of raw HTML. + * + * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. + * @param ownerDocument A document in which the new elements will be created. + */ + (html: string, ownerDocument?: Document): JQuery; + + /** + * Creates DOM elements on the fly from the provided string of raw HTML. + * + * @param html A string defining a single, standalone, HTML element (e.g.
        or
        ). + * @param attributes An object of attributes, events, and methods to call on the newly-created element. + */ + (html: string, attributes: Object): JQuery; + + /** + * Relinquish jQuery's control of the $ variable. + * + * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). + */ + noConflict(removeAll?: boolean): Object; + + /** + * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. + * + * @param deferreds One or more Deferred objects, or plain JavaScript objects. + */ + when(...deferreds: Array/* as JQueryDeferred */>): JQueryPromise; + + /** + * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. + */ + cssHooks: { [key: string]: any; }; + cssNumber: any; + + /** + * Store arbitrary data associated with the specified element. Returns the value that was set. + * + * @param element The DOM element to associate with the data. + * @param key A string naming the piece of data to set. + * @param value The new data value. + */ + data(element: Element, key: string, value: T): T; + /** + * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. + * + * @param element The DOM element to associate with the data. + * @param key A string naming the piece of data to set. + */ + data(element: Element, key: string): any; + /** + * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. + * + * @param element The DOM element to associate with the data. + */ + data(element: Element): any; + + /** + * Execute the next function on the queue for the matched element. + * + * @param element A DOM element from which to remove and execute a queued function. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + dequeue(element: Element, queueName?: string): void; + + /** + * Determine whether an element has any jQuery data associated with it. + * + * @param element A DOM element to be checked for data. + */ + hasData(element: Element): boolean; + + /** + * Show the queue of functions to be executed on the matched element. + * + * @param element A DOM element to inspect for an attached queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + queue(element: Element, queueName?: string): any[]; + /** + * Manipulate the queue of functions to be executed on the matched element. + * + * @param element A DOM element where the array of queued functions is attached. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue An array of functions to replace the current queue contents. + */ + queue(element: Element, queueName: string, newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed on the matched element. + * + * @param element A DOM element on which to add a queued function. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param callback The new function to add to the queue. + */ + queue(element: Element, queueName: string, callback: Function): JQuery; + + /** + * Remove a previously-stored piece of data. + * + * @param element A DOM element from which to remove data. + * @param name A string naming the piece of data to remove. + */ + removeData(element: Element, name?: string): JQuery; + + /** + * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. + * + * @param beforeStart A function that is called just before the constructor returns. + */ + Deferred(beforeStart?: (deferred: JQueryDeferred) => any): JQueryDeferred; + + /** + * Effects + */ + fx: { + tick: () => void; + /** + * The rate (in milliseconds) at which animations fire. + */ + interval: number; + stop: () => void; + speeds: { slow: number; fast: number; }; + /** + * Globally disable all animations. + */ + off: boolean; + step: any; + }; + + /** + * Takes a function and returns a new one that will always have a particular context. + * + * @param fnction The function whose context will be changed. + * @param context The object to which the context (this) of the function should be set. + * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. + */ + proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any; + /** + * Takes a function and returns a new one that will always have a particular context. + * + * @param context The object to which the context (this) of the function should be set. + * @param name The name of the function whose context will be changed (should be a property of the context object). + * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. + */ + proxy(context: Object, name: string, ...additionalArguments: any[]): any; + + Event: JQueryEventConstructor; + + /** + * Takes a string and throws an exception containing it. + * + * @param message The message to send out. + */ + error(message: any): JQuery; + + expr: any; + fn: any; //TODO: Decide how we want to type this + + isReady: boolean; + + // Properties + support: JQuerySupport; + + /** + * Check to see if a DOM element is a descendant of another DOM element. + * + * @param container The DOM element that may contain the other element. + * @param contained The DOM element that may be contained by (a descendant of) the other element. + */ + contains(container: Element, contained: Element): boolean; + + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param collection The object or array to iterate over. + * @param callback The function that will be executed on every object. + */ + each( + collection: T[], + callback: (indexInArray: number, valueOfElement: T) => any + ): any; + + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param collection The object or array to iterate over. + * @param callback The function that will be executed on every object. + */ + each( + collection: any, + callback: (indexInArray: any, valueOfElement: any) => any + ): any; + + /** + * Merge the contents of two or more objects together into the first object. + * + * @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + */ + extend(target: any, object1?: any, ...objectN: any[]): any; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param deep If true, the merge becomes recursive (aka. deep copy). + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + */ + extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any; + + /** + * Execute some JavaScript code globally. + * + * @param code The JavaScript code to execute. + */ + globalEval(code: string): any; + + /** + * Finds the elements of an array which satisfy a filter function. The original array is not affected. + * + * @param array The array to search through. + * @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object. + * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false. + */ + grep(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[]; + + /** + * Search for a specified value within an array and return its index (or -1 if not found). + * + * @param value The value to search for. + * @param array An array through which to search. + * @param fromIndex he index of the array at which to begin the search. The default is 0, which will search the whole array. + */ + inArray(value: T, array: T[], fromIndex?: number): number; + + /** + * Determine whether the argument is an array. + * + * @param obj Object to test whether or not it is an array. + */ + isArray(obj: any): boolean; + /** + * Check to see if an object is empty (contains no enumerable properties). + * + * @param obj The object that will be checked to see if it's empty. + */ + isEmptyObject(obj: any): boolean; + /** + * Determine if the argument passed is a Javascript function object. + * + * @param obj Object to test whether or not it is a function. + */ + isFunction(obj: any): boolean; + /** + * Determines whether its argument is a number. + * + * @param obj The value to be tested. + */ + isNumeric(value: any): boolean; + /** + * Check to see if an object is a plain object (created using "{}" or "new Object"). + * + * @param obj The object that will be checked to see if it's a plain object. + */ + isPlainObject(obj: any): boolean; + /** + * Determine whether the argument is a window. + * + * @param obj Object to test whether or not it is a window. + */ + isWindow(obj: any): boolean; + /** + * Check to see if a DOM node is within an XML document (or is an XML document). + * + * @param node he DOM node that will be checked to see if it's in an XML document. + */ + isXMLDoc(node: Node): boolean; + + /** + * Convert an array-like object into a true JavaScript array. + * + * @param obj Any object to turn into a native Array. + */ + makeArray(obj: any): any[]; + + /** + * Translate all items in an array or object to new array of items. + * + * @param array The Array to translate. + * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. + */ + map(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[]; + /** + * Translate all items in an array or object to new array of items. + * + * @param arrayOrObject The Array or Object to translate. + * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. + */ + map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any; + + /** + * Merge the contents of two arrays together into the first array. + * + * @param first The first array to merge, the elements of second added. + * @param second The second array to merge into the first, unaltered. + */ + merge(first: T[], second: T[]): T[]; + + /** + * An empty function. + */ + noop(): any; + + /** + * Return a number representing the current time. + */ + now(): number; + + /** + * Takes a well-formed JSON string and returns the resulting JavaScript object. + * + * @param json The JSON string to parse. + */ + parseJSON(json: string): any; + + /** + * Parses a string into an XML document. + * + * @param data a well-formed XML string to be parsed + */ + parseXML(data: string): XMLDocument; + + /** + * Remove the whitespace from the beginning and end of a string. + * + * @param str Remove the whitespace from the beginning and end of a string. + */ + trim(str: string): string; + + /** + * Determine the internal JavaScript [[Class]] of an object. + * + * @param obj Object to get the internal JavaScript [[Class]] of. + */ + type(obj: any): string; + + /** + * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. + * + * @param array The Array of DOM elements. + */ + unique(array: Element[]): Element[]; + + /** + * Parses a string into an array of DOM nodes. + * + * @param data HTML string to be parsed + * @param context DOM element to serve as the context in which the HTML fragment will be created + * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string + */ + parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; + + /** + * Parses a string into an array of DOM nodes. + * + * @param data HTML string to be parsed + * @param context DOM element to serve as the context in which the HTML fragment will be created + * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string + */ + parseHTML(data: string, context?: Document, keepScripts?: boolean): any[]; +} + +/** + * The jQuery instance members + */ +interface JQuery { + /** + * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. + * + * @param handler The function to be invoked. + */ + ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery; + /** + * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery; + /** + * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery; + /** + * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxStart(handler: () => any): JQuery; + /** + * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxStop(handler: () => any): JQuery; + /** + * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery; + + /** + * Load data from the server and place the returned HTML into the matched element. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param complete A callback function that is executed when the request completes. + */ + load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; + + /** + * Encode a set of form elements as a string for submission. + */ + serialize(): string; + /** + * Encode a set of form elements as an array of names and values. + */ + serializeArray(): JQuerySerializeArrayElement[]; + + /** + * Adds the specified class(es) to each of the set of matched elements. + * + * @param className One or more space-separated classes to be added to the class attribute of each matched element. + */ + addClass(className: string): JQuery; + /** + * Adds the specified class(es) to each of the set of matched elements. + * + * @param function A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. + */ + addClass(func: (index: number, className: string) => string): JQuery; + + /** + * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. + */ + addBack(selector?: string): JQuery; + + /** + * Get the value of an attribute for the first element in the set of matched elements. + * + * @param attributeName The name of the attribute to get. + */ + attr(attributeName: string): string; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributeName The name of the attribute to set. + * @param value A value to set for the attribute. + */ + attr(attributeName: string, value: string|number): JQuery; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributeName The name of the attribute to set. + * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments. + */ + attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributes An object of attribute-value pairs to set. + */ + attr(attributes: Object): JQuery; + + /** + * Determine whether any of the matched elements are assigned the given class. + * + * @param className The class name to search for. + */ + hasClass(className: string): boolean; + + /** + * Get the HTML contents of the first element in the set of matched elements. + */ + html(): string; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param htmlString A string of HTML to set as the content of each matched element. + */ + html(htmlString: string): JQuery; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. + */ + html(func: (index: number, oldhtml: string) => string): JQuery; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. + */ + + /** + * Get the value of a property for the first element in the set of matched elements. + * + * @param propertyName The name of the property to get. + */ + prop(propertyName: string): any; + /** + * Set one or more properties for the set of matched elements. + * + * @param propertyName The name of the property to set. + * @param value A value to set for the property. + */ + prop(propertyName: string, value: string|number|boolean): JQuery; + /** + * Set one or more properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + */ + prop(properties: Object): JQuery; + /** + * Set one or more properties for the set of matched elements. + * + * @param propertyName The name of the property to set. + * @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element. + */ + prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery; + + /** + * Remove an attribute from each element in the set of matched elements. + * + * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. + */ + removeAttr(attributeName: string): JQuery; + + /** + * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + * + * @param className One or more space-separated classes to be removed from the class attribute of each matched element. + */ + removeClass(className?: string): JQuery; + /** + * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + * + * @param function A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. + */ + removeClass(func: (index: number, className: string) => string): JQuery; + + /** + * Remove a property for the set of matched elements. + * + * @param propertyName The name of the property to remove. + */ + removeProp(propertyName: string): JQuery; + + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. + * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. + */ + toggleClass(className: string, swtch?: boolean): JQuery; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param swtch A boolean value to determine whether the class should be added or removed. + */ + toggleClass(swtch?: boolean): JQuery; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments. + * @param swtch A boolean value to determine whether the class should be added or removed. + */ + toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery; + + /** + * Get the current value of the first element in the set of matched elements. + */ + val(): any; + /** + * Set the value of each element in the set of matched elements. + * + * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked. + */ + val(value: string|string[]): JQuery; + /** + * Set the value of each element in the set of matched elements. + * + * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + */ + val(func: (index: number, value: string) => string): JQuery; + + + /** + * Get the value of style properties for the first element in the set of matched elements. + * + * @param propertyName A CSS property. + */ + css(propertyName: string): string; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A value to set for the property. + */ + css(propertyName: string, value: string|number): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + */ + css(propertyName: string, value: (index: number, value: string) => string|number): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + */ + css(properties: Object): JQuery; + + /** + * Get the current computed height for the first element in the set of matched elements. + */ + height(): number; + /** + * Set the CSS height of every matched element. + * + * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). + */ + height(value: number|string): JQuery; + /** + * Set the CSS height of every matched element. + * + * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. + */ + height(func: (index: number, height: number) => number|string): JQuery; + + /** + * Get the current computed height for the first element in the set of matched elements, including padding but not border. + */ + innerHeight(): number; + + /** + * Sets the inner height on elements in the set of matched elements, including padding but not border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + innerHeight(height: number|string): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements, including padding but not border. + */ + innerWidth(): number; + + /** + * Sets the inner width on elements in the set of matched elements, including padding but not border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + innerWidth(width: number|string): JQuery; + + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the document. + */ + offset(): JQueryCoordinates; + /** + * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + * + * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + */ + offset(coordinates: JQueryCoordinates): JQuery; + /** + * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + * + * @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties. + */ + offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery; + + /** + * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + */ + outerHeight(includeMargin?: boolean): number; + + /** + * Sets the outer height on elements in the set of matched elements, including padding and border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + outerHeight(height: number|string): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements, including padding and border. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + */ + outerWidth(includeMargin?: boolean): number; + + /** + * Sets the outer width on elements in the set of matched elements, including padding and border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + outerWidth(width: number|string): JQuery; + + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. + */ + position(): JQueryCoordinates; + + /** + * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element. + */ + scrollLeft(): number; + /** + * Set the current horizontal position of the scroll bar for each of the set of matched elements. + * + * @param value An integer indicating the new position to set the scroll bar to. + */ + scrollLeft(value: number): JQuery; + + /** + * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element. + */ + scrollTop(): number; + /** + * Set the current vertical position of the scroll bar for each of the set of matched elements. + * + * @param value An integer indicating the new position to set the scroll bar to. + */ + scrollTop(value: number): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements. + */ + width(): number; + /** + * Set the CSS width of each element in the set of matched elements. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + width(value: number|string): JQuery; + /** + * Set the CSS width of each element in the set of matched elements. + * + * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. + */ + width(func: (index: number, width: number) => number|string): JQuery; + + /** + * Remove from the queue all items that have not yet been run. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + clearQueue(queueName?: string): JQuery; + + /** + * Store arbitrary data associated with the matched elements. + * + * @param key A string naming the piece of data to set. + * @param value The new data value; it can be any Javascript type including Array or Object. + */ + data(key: string, value: any): JQuery; + /** + * Store arbitrary data associated with the matched elements. + * + * @param obj An object of key-value pairs of data to update. + */ + data(obj: { [key: string]: any; }): JQuery; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + * + * @param key Name of the data stored. + */ + data(key: string): any; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + */ + data(): any; + + /** + * Execute the next function on the queue for the matched elements. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + dequeue(queueName?: string): JQuery; + + /** + * Remove a previously-stored piece of data. + * + * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete. + */ + removeData(name: string): JQuery; + /** + * Remove a previously-stored piece of data. + * + * @param list An array of strings naming the pieces of data to delete. + */ + removeData(list: string[]): JQuery; + + /** + * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. + * + * @param type The type of queue that needs to be observed. (default: fx) + * @param target Object onto which the promise methods have to be attached + */ + promise(type?: string, target?: Object): JQueryPromise; + + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + animate(properties: Object, duration?: string|number, complete?: Function): JQuery; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. (default: swing) + * @param complete A function to call once the animation is complete. + */ + animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param options A map of additional options to pass to the method. + */ + animate(properties: Object, options: JQueryAnimationOptions): JQuery; + + /** + * Set a timer to delay execution of subsequent items in the queue. + * + * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + delay(duration: number, queueName?: string): JQuery; + + /** + * Display the matched elements by fading them to opaque. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + fadeIn(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements by fading them to opaque. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements by fading them to opaque. + * + * @param options A map of additional options to pass to the method. + */ + fadeIn(options: JQueryAnimationOptions): JQuery; + + /** + * Hide the matched elements by fading them to transparent. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + fadeOut(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements by fading them to transparent. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements by fading them to transparent. + * + * @param options A map of additional options to pass to the method. + */ + fadeOut(options: JQueryAnimationOptions): JQuery; + + /** + * Adjust the opacity of the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param complete A function to call once the animation is complete. + */ + fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery; + /** + * Adjust the opacity of the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery; + + /** + * Display or hide the matched elements by animating their opacity. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + fadeToggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param options A map of additional options to pass to the method. + */ + fadeToggle(options: JQueryAnimationOptions): JQuery; + + /** + * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. + * + * @param queue The name of the queue in which to stop animations. + */ + finish(queue?: string): JQuery; + + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + hide(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + hide(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements. + * + * @param options A map of additional options to pass to the method. + */ + hide(options: JQueryAnimationOptions): JQuery; + + /** + * Display the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + show(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + show(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements. + * + * @param options A map of additional options to pass to the method. + */ + show(options: JQueryAnimationOptions): JQuery; + + /** + * Display the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + slideDown(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + */ + slideDown(options: JQueryAnimationOptions): JQuery; + + /** + * Display or hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + slideToggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + */ + slideToggle(options: JQueryAnimationOptions): JQuery; + + /** + * Hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + slideUp(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + */ + slideUp(options: JQueryAnimationOptions): JQuery; + + /** + * Stop the currently-running animation on the matched elements. + * + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + */ + stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery; + /** + * Stop the currently-running animation on the matched elements. + * + * @param queue The name of the queue in which to stop animations. + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + */ + stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery; + + /** + * Display or hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + toggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + toggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements. + * + * @param options A map of additional options to pass to the method. + */ + toggle(options: JQueryAnimationOptions): JQuery; + /** + * Display or hide the matched elements. + * + * @param showOrHide A Boolean indicating whether to show or hide the elements. + */ + toggle(showOrHide: boolean): JQuery; + + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + */ + bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. + */ + bind(eventType: string, eventData: any, preventBubble: boolean): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. + */ + bind(eventType: string, preventBubble: boolean): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param events An object containing one or more DOM event types and functions to execute for them. + */ + bind(events: any): JQuery; + + /** + * Trigger the "blur" event on an element + */ + blur(): JQuery; + /** + * Bind an event handler to the "blur" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + blur(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "blur" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "change" event on an element. + */ + change(): JQuery; + /** + * Bind an event handler to the "change" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + change(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "change" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "click" event on an element. + */ + click(): JQuery; + /** + * Bind an event handler to the "click" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + */ + click(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "click" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "dblclick" event on an element. + */ + dblclick(): JQuery; + /** + * Bind an event handler to the "dblclick" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "dblclick" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "focus" event on an element. + */ + focus(): JQuery; + /** + * Bind an event handler to the "focus" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + focus(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "focus" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Bind an event handler to the "focusin" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + focusin(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "focusin" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Bind an event handler to the "focusout" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + focusout(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "focusout" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. + * + * @param handlerIn A function to execute when the mouse pointer enters the element. + * @param handlerOut A function to execute when the mouse pointer leaves the element. + */ + hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements. + * + * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. + */ + hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "keydown" event on an element. + */ + keydown(): JQuery; + /** + * Bind an event handler to the "keydown" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; + /** + * Bind an event handler to the "keydown" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + + /** + * Trigger the "keypress" event on an element. + */ + keypress(): JQuery; + /** + * Bind an event handler to the "keypress" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; + /** + * Bind an event handler to the "keypress" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + + /** + * Trigger the "keyup" event on an element. + */ + keyup(): JQuery; + /** + * Bind an event handler to the "keyup" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; + /** + * Bind an event handler to the "keyup" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + + /** + * Bind an event handler to the "load" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + load(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "load" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "mousedown" event on an element. + */ + mousedown(): JQuery; + /** + * Bind an event handler to the "mousedown" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mousedown" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseenter" event on an element. + */ + mouseenter(): JQuery; + /** + * Bind an event handler to be fired when the mouse enters an element. + * + * @param handler A function to execute when the event is triggered. + */ + mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to be fired when the mouse enters an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseleave" event on an element. + */ + mouseleave(): JQuery; + /** + * Bind an event handler to be fired when the mouse leaves an element. + * + * @param handler A function to execute when the event is triggered. + */ + mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to be fired when the mouse leaves an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mousemove" event on an element. + */ + mousemove(): JQuery; + /** + * Bind an event handler to the "mousemove" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mousemove" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseout" event on an element. + */ + mouseout(): JQuery; + /** + * Bind an event handler to the "mouseout" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mouseout" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseover" event on an element. + */ + mouseover(): JQuery; + /** + * Bind an event handler to the "mouseover" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mouseover" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseup" event on an element. + */ + mouseup(): JQuery; + /** + * Bind an event handler to the "mouseup" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mouseup" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Remove an event handler. + */ + off(): JQuery; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + * @param handler A handler function previously attached for the event(s), or the special value false. + */ + off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + * @param handler A handler function previously attached for the event(s), or the special value false. + */ + off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove an event handler. + * + * @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s). + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + */ + off(events: { [key: string]: any; }, selector?: string): JQuery; + + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax). + */ + on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + on(events: { [key: string]: any; }, data?: any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute at the time the event is triggered. + */ + one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. + * @param data An object containing data that will be passed to the event handler. + * @param handler A function to execute at the time the event is triggered. + */ + one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + one(events: { [key: string]: any; }, data?: any): JQuery; + + + /** + * Specify a function to execute when the DOM is fully loaded. + * + * @param handler A function to execute after the DOM is ready. + */ + ready(handler: (jQueryAlias?: JQueryStatic) => any): JQuery; + + /** + * Trigger the "resize" event on an element. + */ + resize(): JQuery; + /** + * Bind an event handler to the "resize" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + */ + resize(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "resize" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "scroll" event on an element. + */ + scroll(): JQuery; + /** + * Bind an event handler to the "scroll" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + */ + scroll(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "scroll" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "select" event on an element. + */ + select(): JQuery; + /** + * Bind an event handler to the "select" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + */ + select(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "select" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "submit" event on an element. + */ + submit(): JQuery; + /** + * Bind an event handler to the "submit" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + submit(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "submit" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param extraParameters Additional parameters to pass along to the event handler. + */ + trigger(eventType: string, extraParameters?: any[]|Object): JQuery; + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * + * @param event A jQuery.Event object. + * @param extraParameters Additional parameters to pass along to the event handler. + */ + trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery; + + /** + * Execute all handlers attached to an element for an event. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param extraParameters An array of additional parameters to pass along to the event handler. + */ + triggerHandler(eventType: string, ...extraParameters: any[]): Object; + + /** + * Remove a previously-attached event handler from the elements. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param handler The function that is to be no longer executed. + */ + unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove a previously-attached event handler from the elements. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ). + */ + unbind(eventType: string, fls: boolean): JQuery; + /** + * Remove a previously-attached event handler from the elements. + * + * @param evt A JavaScript event object as passed to an event handler. + */ + unbind(evt: any): JQuery; + + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + */ + undelegate(): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" + * @param handler A function to execute at the time the event is triggered. + */ + undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param events An object of one or more event types and previously bound functions to unbind from them. + */ + undelegate(selector: string, events: Object): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param namespace A string containing a namespace to unbind all events from. + */ + undelegate(namespace: string): JQuery; + + /** + * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) + * + * @param handler A function to execute when the event is triggered. + */ + unload(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) + * + * @param eventData A plain object of data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10) + */ + context: Element; + + jquery: string; + + /** + * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) + * + * @param handler A function to execute when the event is triggered. + */ + error(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) + * + * @param eventData A plain object of data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Add a collection of DOM elements onto the jQuery stack. + * + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + */ + pushStack(elements: any[]): JQuery; + /** + * Add a collection of DOM elements onto the jQuery stack. + * + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + * @param name The name of a jQuery method that generated the array of elements. + * @param arguments The arguments that were passed in to the jQuery method (for serialization). + */ + pushStack(elements: any[], name: string, arguments: any[]): JQuery; + + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * + * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. + */ + after(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + after(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. + */ + append(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. + */ + append(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Insert every element in the set of matched elements to the end of the target. + * + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. + */ + appendTo(target: JQuery|any[]|Element|string): JQuery; + + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. + */ + before(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + before(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Create a deep copy of the set of matched elements. + * + * param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. + * param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false). + */ + clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery; + + /** + * Remove the set of matched elements from the DOM. + * + * param selector A selector expression that filters the set of matched elements to be removed. + */ + detach(selector?: string): JQuery; + + /** + * Remove all child nodes of the set of matched elements from the DOM. + */ + empty(): JQuery; + + /** + * Insert every element in the set of matched elements after the target. + * + * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. + */ + insertAfter(target: JQuery|any[]|Element|Text|string): JQuery; + + /** + * Insert every element in the set of matched elements before the target. + * + * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. + */ + insertBefore(target: JQuery|any[]|Element|Text|string): JQuery; + + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * + * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. + */ + prepend(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. + */ + prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Insert every element in the set of matched elements to the beginning of the target. + * + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. + */ + prependTo(target: JQuery|any[]|Element|string): JQuery; + + /** + * Remove the set of matched elements from the DOM. + * + * @param selector A selector expression that filters the set of matched elements to be removed. + */ + remove(selector?: string): JQuery; + + /** + * Replace each target element with the set of matched elements. + * + * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. + */ + replaceAll(target: JQuery|any[]|Element|string): JQuery; + + /** + * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + * + * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. + */ + replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery; + /** + * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + * + * param func A function that returns content with which to replace the set of matched elements. + */ + replaceWith(func: () => Element|JQuery): JQuery; + + /** + * Get the combined text contents of each element in the set of matched elements, including their descendants. + */ + text(): string; + /** + * Set the content of each element in the set of matched elements to the specified text. + * + * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation. + */ + text(text: string|number|boolean): JQuery; + /** + * Set the content of each element in the set of matched elements to the specified text. + * + * @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments. + */ + text(func: (index: number, text: string) => string): JQuery; + + /** + * Retrieve all the elements contained in the jQuery set, as an array. + */ + toArray(): any[]; + + /** + * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. + */ + unwrap(): JQuery; + + /** + * Wrap an HTML structure around each element in the set of matched elements. + * + * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. + */ + wrap(wrappingElement: JQuery|Element|string): JQuery; + /** + * Wrap an HTML structure around each element in the set of matched elements. + * + * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + wrap(func: (index: number) => string|JQuery): JQuery; + + /** + * Wrap an HTML structure around all elements in the set of matched elements. + * + * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. + */ + wrapAll(wrappingElement: JQuery|Element|string): JQuery; + wrapAll(func: (index: number) => string): JQuery; + + /** + * Wrap an HTML structure around the content of each element in the set of matched elements. + * + * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. + */ + wrapInner(wrappingElement: JQuery|Element|string): JQuery; + /** + * Wrap an HTML structure around the content of each element in the set of matched elements. + * + * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + wrapInner(func: (index: number) => string): JQuery; + + /** + * Iterate over a jQuery object, executing a function for each matched element. + * + * @param func A function to execute for each matched element. + */ + each(func: (index: number, elem: Element) => any): JQuery; + + /** + * Retrieve one of the elements matched by the jQuery object. + * + * @param index A zero-based integer indicating which element to retrieve. + */ + get(index: number): HTMLElement; + /** + * Retrieve the elements matched by the jQuery object. + */ + get(): any[]; + + /** + * Search for a given element from among the matched elements. + */ + index(): number; + /** + * Search for a given element from among the matched elements. + * + * @param selector A selector representing a jQuery collection in which to look for an element. + */ + index(selector: string|JQuery|Element): number; + + /** + * The number of elements in the jQuery object. + */ + length: number; + /** + * A selector representing selector passed to jQuery(), if any, when creating the original set. + * version deprecated: 1.7, removed: 1.9 + */ + selector: string; + [index: string]: any; + [index: number]: HTMLElement; + + /** + * Add elements to the set of matched elements. + * + * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. + * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method. + */ + add(selector: string, context?: Element): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param elements One or more elements to add to the set of matched elements. + */ + add(...elements: Element[]): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param html An HTML fragment to add to the set of matched elements. + */ + add(html: string): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param obj An existing jQuery object to add to the set of matched elements. + */ + add(obj: JQuery): JQuery; + + /** + * Get the children of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + children(selector?: string): JQuery; + + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + */ + closest(selector: string): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. + */ + closest(selector: string, context?: Element): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param obj A jQuery object to match elements against. + */ + closest(obj: JQuery): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param element An element to match elements against. + */ + closest(element: Element): JQuery; + + /** + * Get an array of all the elements and selectors matched against the current element up through the DOM tree. + * + * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object). + * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. + */ + closest(selectors: any, context?: Element): any[]; + + /** + * Get the children of each element in the set of matched elements, including text and comment nodes. + */ + contents(): JQuery; + + /** + * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state. + */ + end(): JQuery; + + /** + * Reduce the set of matched elements to the one at the specified index. + * + * @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set. + * + */ + eq(index: number): JQuery; + + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param selector A string containing a selector expression to match the current set of elements against. + */ + filter(selector: string): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param func A function used as a test for each element in the set. this is the current DOM element. + */ + filter(func: (index: number, element: Element) => any): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param element An element to match the current set of elements against. + */ + filter(element: Element): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param obj An existing jQuery object to match the current set of elements against. + */ + filter(obj: JQuery): JQuery; + + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param selector A string containing a selector expression to match elements against. + */ + find(selector: string): JQuery; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param element An element to match elements against. + */ + find(element: Element): JQuery; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param obj A jQuery object to match elements against. + */ + find(obj: JQuery): JQuery; + + /** + * Reduce the set of matched elements to the first in the set. + */ + first(): JQuery; + + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param selector A string containing a selector expression to match elements against. + */ + has(selector: string): JQuery; + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param contained A DOM element to match elements against. + */ + has(contained: Element): JQuery; + + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param selector A string containing a selector expression to match elements against. + */ + is(selector: string): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element. + */ + is(func: (index: number, element: Element) => boolean): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param obj An existing jQuery object to match the current set of elements against. + */ + is(obj: JQuery): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param elements One or more elements to match the current set of elements against. + */ + is(elements: any): boolean; + + /** + * Reduce the set of matched elements to the final one in the set. + */ + last(): JQuery; + + /** + * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values. + * + * @param callback A function object that will be invoked for each element in the current set. + */ + map(callback: (index: number, domElement: Element) => any): JQuery; + + /** + * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + next(selector?: string): JQuery; + + /** + * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + nextAll(selector?: string): JQuery; + + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + nextUntil(selector?: string, filter?: string): JQuery; + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + nextUntil(element?: Element, filter?: string): JQuery; + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + nextUntil(obj?: JQuery, filter?: string): JQuery; + + /** + * Remove elements from the set of matched elements. + * + * @param selector A string containing a selector expression to match elements against. + */ + not(selector: string): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param func A function used as a test for each element in the set. this is the current DOM element. + */ + not(func: (index: number, element: Element) => boolean): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param elements One or more DOM elements to remove from the matched set. + */ + not(...elements: Element[]): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param obj An existing jQuery object to match the current set of elements against. + */ + not(obj: JQuery): JQuery; + + /** + * Get the closest ancestor element that is positioned. + */ + offsetParent(): JQuery; + + /** + * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + parent(selector?: string): JQuery; + + /** + * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + parents(selector?: string): JQuery; + + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + */ + parentsUntil(selector?: string, filter?: string): JQuery; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + */ + parentsUntil(element?: Element, filter?: string): JQuery; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + */ + parentsUntil(obj?: JQuery, filter?: string): JQuery; + + /** + * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + prev(selector?: string): JQuery; + + /** + * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + prevAll(selector?: string): JQuery; + + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + prevUntil(selector?: string, filter?: string): JQuery; + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + prevUntil(element?: Element, filter?: string): JQuery; + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + prevUntil(obj?: JQuery, filter?: string): JQuery; + + /** + * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + siblings(selector?: string): JQuery; + + /** + * Reduce the set of matched elements to a subset specified by a range of indices. + * + * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set. + * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. + */ + slice(start: number, end?: number): JQuery; + + /** + * Show the queue of functions to be executed on the matched elements. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + queue(queueName?: string): any[]; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param newQueue An array of functions to replace the current queue contents. + */ + queue(newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. + */ + queue(callback: Function): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue An array of functions to replace the current queue contents. + */ + queue(queueName: string, newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. + */ + queue(queueName: string, callback: Function): JQuery; +} +declare module "jquery" { + export = $; +} +declare var jQuery: JQueryStatic; +declare var $: JQueryStatic; diff --git a/catalog-ui/typings/jsMd5/md5.d.ts b/catalog-ui/typings/jsMd5/md5.d.ts new file mode 100644 index 0000000000..3f06a6f509 --- /dev/null +++ b/catalog-ui/typings/jsMd5/md5.d.ts @@ -0,0 +1,55 @@ +/*- + * ============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========================================================= + */ +// Type definitions for js-md5 v0.3.0 +// Project: https://github.com/emn178/js-md5 +// Definitions by: Roland Greim +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/ + +/// + +interface JQuery { + md5(value: string): string; + md5(value: Array): string; + md5(value: Uint8Array): string; +} + +interface JQueryStatic { + md5(value: string): string; + md5(value: Array): string; + md5(value: Uint8Array): string; +} + +interface md5 { + (value: string): string; + (value: Array): string; + (value: Uint8Array): string; +} + +interface String { + md5(value: string): string; + md5(value: Array): string; + md5(value: Uint8Array): string; +} + +declare module "js-md5" { + export = md5; +} + +declare var md5: md5; diff --git a/catalog-ui/typings/lodash/lodash.d.ts b/catalog-ui/typings/lodash/lodash.d.ts new file mode 100644 index 0000000000..9d23982103 --- /dev/null +++ b/catalog-ui/typings/lodash/lodash.d.ts @@ -0,0 +1,22949 @@ +// Type definitions for Lo-Dash 4.14 +// Project: http://lodash.com/ +// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +/** + ### 4.0.0 Changelog (https://github.com/lodash/lodash/wiki/Changelog) + + #### TODO: + removed: + - [x] Removed _.support + - [x] Removed _.findWhere in favor of _.find with iteratee shorthand + - [x] Removed _.where in favor of _.filter with iteratee shorthand + - [x] Removed _.pluck in favor of _.map with iteratee shorthand + + renamed: + - [x] Renamed _.first to _.head + - [x] Renamed _.indexBy to _.keyBy + - [x] Renamed _.invoke to _.invokeMap + - [x] Renamed _.overArgs to _.overArgs + - [x] Renamed _.padLeft & _.padRight to _.padStart & _.padEnd + - [x] Renamed _.pairs to _.toPairs + - [x] Renamed _.rest to _.tail + - [x] Renamed _.restParam to _.rest + - [x] Renamed _.sortByOrder to _.orderBy + - [x] Renamed _.trimLeft & _.trimRight to _.trimStart & _.trimEnd + - [x] Renamed _.trunc to _.truncate + + split: + - [x] Split _.indexOf & _.lastIndexOf into _.sortedIndexOf & _.sortedLastIndexOf + - [x] Split _.max & _.min into _.maxBy & _.minBy + - [x] Split _.omit & _.pick into _.omitBy & _.pickBy + - [x] Split _.sample into _.sampleSize + - [x] Split _.sortedIndex into _.sortedIndexBy + - [x] Split _.sortedLastIndex into _.sortedLastIndexBy + - [x] Split _.uniq into _.sortedUniq, _.sortedUniqBy, & _.uniqBy + + changes: + - [x] Absorbed _.sortByAll into _.sortBy + - [x] Changed the category of _.at to “Object” + - [x] Changed the category of _.bindAll to “Utility” + - [x] Made _.capitalize uppercase the first character & lowercase the rest + - [x] Made _.functions return only own method names + + + added 23 array methods: + - [x] _.concat + - [x] _.differenceBy + - [x] _.differenceWith + - [x] _.flatMap + - [x] _.fromPairs + - [x] _.intersectionBy + - [x] _.intersectionWith + - [x] _.join + - [x] _.pullAll + - [x] _.pullAllBy + - [x] _.reverse + - [x] _.sortedIndexBy + - [x] _.sortedIndexOf + - [x] _.sortedLastIndexBy + - [x] _.sortedLastIndexOf + - [x] _.sortedUniq + - [x] _.sortedUniqBy + - [x] _.unionBy + - [x] _.unionWith + - [x] _.uniqBy + - [x] _.uniqWith + - [x] _.xorBy + - [x] _.xorWith + + added 18 lang methods: + - [x] _.cloneDeepWith + - [x] _.cloneWith + - [x] _.eq + - [x] _.isArrayLike + - [x] _.isArrayLikeObject + - [x] _.isEqualWith + - [x] _.isInteger + - [x] _.isLength + - [x] _.isMatchWith + - [x] _.isNil + - [x] _.isObjectLike + - [x] _.isSafeInteger + - [x] _.isSymbol + - [x] _.toInteger + - [x] _.toLength + - [x] _.toNumber + - [x] _.toSafeInteger + - [x] _.toString + + added 13 object methods: + - [x] _.assignIn + - [x] _.assignInWith + - [x] _.assignWith + - [x] _.functionsIn + - [x] _.hasIn + - [x] _.mergeWith + - [x] _.omitBy + - [x] _.pickBy + + + added 8 string methods: + - [x] _.lowerCase + - [x] _.lowerFirst + - [x] _.upperCase + - [x] _.upperFirst + - [x] _.toLower + - [x] _.toUpper + + added 8 utility methods: + - [x] _.toPath + + added 4 math methods: + - [x] _.maxBy + - [x] _.mean + - [x] _.minBy + - [x] _.sumBy + + added 2 function methods: + - [x] _.flip + - [x] _.unary + + added 2 number methods: + - [x] _.clamp + - [x] _.subtract + + added collection method: + - [x] _.sampleSize + + Added 3 aliases + + - [x] _.first as an alias of _.head + + Removed 17 aliases + - [x] Removed aliase _.all + - [x] Removed aliase _.any + - [x] Removed aliase _.backflow + - [x] Removed aliase _.callback + - [x] Removed aliase _.collect + - [x] Removed aliase _.compose + - [x] Removed aliase _.contains + - [x] Removed aliase _.detect + - [x] Removed aliase _.foldl + - [x] Removed aliase _.foldr + - [x] Removed aliase _.include + - [x] Removed aliase _.inject + - [x] Removed aliase _.methods + - [x] Removed aliase _.object + - [x] Removed aliase _.run + - [x] Removed aliase _.select + - [x] Removed aliase _.unique + + Other changes + - [x] Added support for array buffers to _.isEqual + - [x] Added support for converting iterators to _.toArray + - [x] Added support for deep paths to _.zipObject + - [x] Changed UMD to export to window or self when available regardless of other exports + - [x] Ensured debounce cancel clears args & thisArg references + - [x] Ensured _.add, _.subtract, & _.sum don’t skip NaN values + - [x] Ensured _.clone treats generators like functions + - [x] Ensured _.clone produces clones with the source’s [[Prototype]] + - [x] Ensured _.defaults assigns properties that shadow Object.prototype + - [x] Ensured _.defaultsDeep doesn’t merge a string into an array + - [x] Ensured _.defaultsDeep & _.merge don’t modify sources + - [x] Ensured _.defaultsDeep works with circular references + - [x] Ensured _.keys skips “length” on strict mode arguments objects in Safari 9 + - [x] Ensured _.merge doesn’t convert strings to arrays + - [x] Ensured _.merge merges plain-objects onto non plain-objects + - [x] Ensured _#plant resets iterator data of cloned sequences + - [x] Ensured _.random swaps min & max if min is greater than max + - [x] Ensured _.range preserves the sign of start of -0 + - [x] Ensured _.reduce & _.reduceRight use getIteratee in their array branch + - [x] Fixed rounding issue with the precision param of _.floor + - [x] Added flush method to debounced & throttled functions + + ** LATER ** + Misc: + - [ ] Made _.forEach, _.forIn, _.forOwn, & _.times implicitly end a chain sequence + - [ ] Removed thisArg params from most methods + - [ ] Made “By” methods provide a single param to iteratees + - [ ] Made _.words chainable by default + - [ ] Removed isDeep params from _.clone & _.flatten + - [ ] Removed _.bindAll support for binding all methods when no names are provided + - [ ] Removed func-first param signature from _.before & _.after + - [ ] _.extend as an alias of _.assignIn + - [ ] _.extendWith as an alias of _.assignInWith + - [ ] Added clear method to _.memoize.Cache + - [ ] Added support for ES6 maps, sets, & symbols to _.clone, _.isEqual, & _.toArray + - [ ] Enabled _.flow & _.flowRight to accept an array of functions + - [ ] Ensured “Collection” methods treat functions as objects + - [ ] Ensured _.assign, _.defaults, & _.merge coerce object values to objects + - [ ] Ensured _.bindKey bound functions call object[key] when called with the new operator + - [ ] Ensured _.isFunction returns true for generator functions + - [ ] Ensured _.merge assigns typed arrays directly + - [ ] Made _(...) an iterator & iterable + - [ ] Made _.drop, _.take, & right forms coerce n of undefined to 0 + + Methods: + - [ ] _.concat + - [ ] _.differenceBy + - [ ] _.differenceWith + - [ ] _.flatMap + - [ ] _.fromPairs + - [ ] _.intersectionBy + - [ ] _.intersectionWith + - [ ] _.join + - [ ] _.pullAll + - [ ] _.pullAllBy + - [ ] _.reverse + - [ ] _.sortedLastIndexOf + - [ ] _.unionBy + - [ ] _.unionWith + - [ ] _.uniqWith + - [ ] _.xorBy + - [ ] _.xorWith + - [ ] _.toString + + - [ ] _.invoke + - [ ] _.setWith + - [ ] _.toPairs + - [ ] _.toPairsIn + - [ ] _.unset + + - [ ] _.replace + - [ ] _.split + + - [ ] _.cond + - [ ] _.conforms + - [ ] _.nthArg + - [ ] _.over + - [ ] _.overEvery + - [ ] _.overSome + - [ ] _.rangeRight + + - [ ] _.next + */ + +declare var _: _.LoDashStatic; + +declare module _ { + interface LoDashStatic { + /** + * Creates a lodash object which wraps the given value to enable intuitive method chaining. + * + * In addition to Lo-Dash methods, wrappers also have the following Array methods: + * concat, join, pop, push, reverse, shift, slice, sort, splice, and unshift + * + * Chaining is supported in custom builds as long as the value method is implicitly or + * explicitly included in the build. + * + * The chainable wrapper functions are: + * after, assign, bind, bindAll, bindKey, chain, chunk, compact, compose, concat, countBy, + * createCallback, curry, debounce, defaults, defer, delay, difference, filter, flatten, + * forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, functions, groupBy, + * keyBy, initial, intersection, invert, invoke, keys, map, max, memoize, merge, min, + * object, omit, once, pairs, partial, partialRight, pick, pluck, pull, push, range, reject, + * remove, rest, reverse, sample, shuffle, slice, sort, sortBy, splice, tap, throttle, times, + * toArray, transform, union, uniq, unset, unshift, unzip, values, where, without, wrap, and zip + * + * The non-chainable wrapper functions are: + * clone, cloneDeep, contains, escape, every, find, findIndex, findKey, findLast, + * findLastIndex, findLastKey, has, identity, indexOf, isArguments, isArray, isBoolean, + * isDate, isElement, isEmpty, isEqual, isFinite, isFunction, isNaN, isNull, isNumber, + * isObject, isPlainObject, isRegExp, isString, isUndefined, join, lastIndexOf, mixin, + * noConflict, parseInt, pop, random, reduce, reduceRight, result, shift, size, some, + * sortedIndex, runInContext, template, unescape, uniqueId, and value + * + * The wrapper functions first and last return wrapped values when n is provided, otherwise + * they return unwrapped values. + * + * Explicit chaining can be enabled by using the _.chain method. + **/ + (value: number): LoDashImplicitWrapper; + (value: string): LoDashImplicitStringWrapper; + (value: boolean): LoDashImplicitWrapper; + (value: Array): LoDashImplicitNumberArrayWrapper; + (value: Array): LoDashImplicitArrayWrapper; + (value: T): LoDashImplicitObjectWrapper; + (value: any): LoDashImplicitWrapper; + + /** + * The semantic version number. + **/ + VERSION: string; + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby + * (ERB). Change the following template settings to use alternative delimiters. + **/ + templateSettings: TemplateSettings; + } + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby + * (ERB). Change the following template settings to use alternative delimiters. + **/ + interface TemplateSettings { + /** + * The "escape" delimiter. + **/ + escape?: RegExp; + + /** + * The "evaluate" delimiter. + **/ + evaluate?: RegExp; + + /** + * An object to import into the template as local variables. + **/ + imports?: Dictionary; + + /** + * The "interpolate" delimiter. + **/ + interpolate?: RegExp; + + /** + * Used to reference the data object in the template text. + **/ + variable?: string; + } + + /** + * Creates a cache object to store key/value pairs. + */ + interface MapCache { + /** + * Removes `key` and its value from the cache. + * @param key The key of the value to remove. + * @return Returns `true` if the entry was removed successfully, else `false`. + */ + delete(key: string): boolean; + + /** + * Gets the cached value for `key`. + * @param key The key of the value to get. + * @return Returns the cached value. + */ + get(key: string): any; + + /** + * Checks if a cached value for `key` exists. + * @param key The key of the entry to check. + * @return Returns `true` if an entry for `key` exists, else `false`. + */ + has(key: string): boolean; + + /** + * Sets `value` to `key` of the cache. + * @param key The key of the value to cache. + * @param value The value to cache. + * @return Returns the cache object. + */ + set(key: string, value: any): _.Dictionary; + } + interface MapCacheConstructor { + new (): MapCache; + } + + interface LoDashWrapperBase { } + + interface LoDashImplicitWrapperBase extends LoDashWrapperBase { } + + interface LoDashExplicitWrapperBase extends LoDashWrapperBase { } + + interface LoDashImplicitWrapper extends LoDashImplicitWrapperBase> { } + + interface LoDashExplicitWrapper extends LoDashExplicitWrapperBase> { } + + interface LoDashImplicitStringWrapper extends LoDashImplicitWrapper { } + + interface LoDashExplicitStringWrapper extends LoDashExplicitWrapper { } + + interface LoDashImplicitObjectWrapper extends LoDashImplicitWrapperBase> { } + + interface LoDashExplicitObjectWrapper extends LoDashExplicitWrapperBase> { } + + interface LoDashImplicitArrayWrapper extends LoDashImplicitWrapperBase> { + pop(): T; + push(...items: T[]): LoDashImplicitArrayWrapper; + shift(): T; + sort(compareFn?: (a: T, b: T) => number): LoDashImplicitArrayWrapper; + splice(start: number): LoDashImplicitArrayWrapper; + splice(start: number, deleteCount: number, ...items: any[]): LoDashImplicitArrayWrapper; + unshift(...items: T[]): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper extends LoDashExplicitWrapperBase> { + pop(): LoDashExplicitObjectWrapper; + push(...items: T[]): LoDashExplicitArrayWrapper; + shift(): LoDashExplicitObjectWrapper; + sort(compareFn?: (a: T, b: T) => number): LoDashExplicitArrayWrapper; + splice(start: number): LoDashExplicitArrayWrapper; + splice(start: number, deleteCount: number, ...items: any[]): LoDashExplicitArrayWrapper; + unshift(...items: T[]): LoDashExplicitArrayWrapper; + } + + interface LoDashImplicitNumberArrayWrapper extends LoDashImplicitArrayWrapper { } + + interface LoDashExplicitNumberArrayWrapper extends LoDashExplicitArrayWrapper { } + + /********* + * Array * + *********/ + + //_.chunk + interface LoDashStatic { + /** + * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the + * final chunk will be the remaining elements. + * + * @param array The array to process. + * @param size The length of each chunk. + * @return Returns the new array containing chunks. + */ + chunk( + array: List, + size?: number + ): T[][]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.chunk + */ + chunk(size?: number): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.chunk + */ + chunk(size?: number): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.chunk + */ + chunk(size?: number): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.chunk + */ + chunk(size?: number): LoDashExplicitArrayWrapper; + } + + //_.compact + interface LoDashStatic { + /** + * Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are + * falsey. + * + * @param array The array to compact. + * @return (Array) Returns the new array of filtered values. + */ + compact(array?: List): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.compact + */ + compact(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.compact + */ + compact(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.compact + */ + compact(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.compact + */ + compact(): LoDashExplicitArrayWrapper; + } + + //_.concat DUMMY + interface LoDashStatic { + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + concat(array: T[]|List, ...values: (T|T[]|List)[]) : T[]; + } + + //_.difference + interface LoDashStatic { + /** + * Creates an array of unique array values not included in the other provided arrays using SameValueZero for + * equality comparisons. + * + * @param array The array to inspect. + * @param values The arrays of values to exclude. + * @return Returns the new array of filtered values. + */ + difference( + array: T[]|List, + ...values: Array> + ): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.difference + */ + difference(...values: (T[]|List)[]): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.difference + */ + difference(...values: (TValue[]|List)[]): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.difference + */ + difference(...values: (T[]|List)[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.difference + */ + difference(...values: (TValue[]|List)[]): LoDashExplicitArrayWrapper; + } + + //_.differenceBy + interface LoDashStatic { + /** + * This method is like _.difference except that it accepts iteratee which is invoked for each element of array + * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one + * argument: (value). + * + * @param array The array to inspect. + * @param values The values to exclude. + * @param iteratee The iteratee invoked per element. + * @returns Returns the new array of filtered values. + */ + differenceBy( + array: T[]|List, + values?: T[]|List, + iteratee?: ((value: T) => any)|string + ): T[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: T[]|List, + values?: T[]|List, + iteratee?: W + ): T[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: T[]|List, + values1?: T[]|List, + values2?: T[]|List, + iteratee?: ((value: T) => any)|string + ): T[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: T[]|List, + values1?: T[]|List, + values2?: T[]|List, + iteratee?: W + ): T[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: T[]|List, + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + iteratee?: ((value: T) => any)|string + ): T[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: T[]|List, + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + iteratee?: W + ): T[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: T[]|List, + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + iteratee?: W + ): T[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: T[]|List, + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + iteratee?: ((value: T) => any)|string + ): T[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: T[]|List, + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + values5?: T[]|List, + iteratee?: ((value: T) => any)|string + ): T[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: T[]|List, + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + values5?: T[]|List, + iteratee?: W + ): T[]; + + /** + * @see _.differenceBy + */ + differenceBy( + array: T[]|List, + ...values: any[] + ): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.differenceBy + */ + differenceBy( + values?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values?: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + values5?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + values5?: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + ...values: any[] + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.differenceBy + */ + differenceBy( + values?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values?: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + values5?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + values5?: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + ...values: any[] + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.differenceBy + */ + differenceBy( + values?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values?: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + values5?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + values5?: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + ...values: any[] + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.differenceBy + */ + differenceBy( + values?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values?: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + values5?: T[]|List, + iteratee?: ((value: T) => any)|string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + values1?: T[]|List, + values2?: T[]|List, + values3?: T[]|List, + values4?: T[]|List, + values5?: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.differenceBy + */ + differenceBy( + ...values: any[] + ): LoDashExplicitArrayWrapper; + } + + //_.differenceWith DUMMY + interface LoDashStatic { + /** + * Creates an array of unique `array` values not included in the other + * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.difference([3, 2, 1], [4, 2]); + * // => [3, 1] + */ + differenceWith( + array: any[]|List, + ...values: any[] + ): any[]; + } + + //_.drop + interface LoDashStatic { + /** + * Creates a slice of array with n elements dropped from the beginning. + * + * @param array The array to query. + * @param n The number of elements to drop. + * @return Returns the slice of array. + */ + drop(array: T[]|List, n?: number): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.drop + */ + drop(n?: number): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.drop + */ + drop(n?: number): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.drop + */ + drop(n?: number): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.drop + */ + drop(n?: number): LoDashExplicitArrayWrapper; + } + + //_.dropRight + interface LoDashStatic { + /** + * Creates a slice of array with n elements dropped from the end. + * + * @param array The array to query. + * @param n The number of elements to drop. + * @return Returns the slice of array. + */ + dropRight( + array: List, + n?: number + ): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.dropRight + */ + dropRight(n?: number): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.dropRight + */ + dropRight(n?: number): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.dropRight + */ + dropRight(n?: number): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.dropRight + */ + dropRight(n?: number): LoDashExplicitArrayWrapper; + } + + //_.dropRightWhile + interface LoDashStatic { + /** + * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate + * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * match the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + dropRightWhile( + array: List, + predicate?: ListIterator + ): TValue[]; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + array: List, + predicate?: string + ): TValue[]; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + array: List, + predicate?: TWhere + ): TValue[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: TWhere + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: TWhere + ): LoDashExplicitArrayWrapper; + } + + //_.dropWhile + interface LoDashStatic { + /** + * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate + * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + dropWhile( + array: List, + predicate?: ListIterator + ): TValue[]; + + /** + * @see _.dropWhile + */ + dropWhile( + array: List, + predicate?: string + ): TValue[]; + + /** + * @see _.dropWhile + */ + dropWhile( + array: List, + predicate?: TWhere + ): TValue[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: TWhere + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: TWhere + ): LoDashExplicitArrayWrapper; + } + + //_.fill + interface LoDashStatic { + /** + * Fills elements of array with value from start up to, but not including, end. + * + * Note: This method mutates array. + * + * @param array The array to fill. + * @param value The value to fill array with. + * @param start The start position. + * @param end The end position. + * @return Returns array. + */ + fill( + array: any[], + value: T, + start?: number, + end?: number + ): T[]; + + /** + * @see _.fill + */ + fill( + array: List, + value: T, + start?: number, + end?: number + ): List; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.fill + */ + fill( + value: T, + start?: number, + end?: number + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.fill + */ + fill( + value: T, + start?: number, + end?: number + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.fill + */ + fill( + value: T, + start?: number, + end?: number + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.fill + */ + fill( + value: T, + start?: number, + end?: number + ): LoDashExplicitObjectWrapper>; + } + + //_.findIndex + interface LoDashStatic { + /** + * This method is like _.find except that it returns the index of the first element predicate returns truthy + * for instead of the element itself. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to search. + * @param predicate The function invoked per iteration. + * @param fromIndex The index to search from. + * @return Returns the index of the found element, else -1. + */ + findIndex( + array: List, + predicate?: ListIterator, + fromIndex?: number + ): number; + + /** + * @see _.findIndex + */ + findIndex( + array: List, + predicate?: string, + fromIndex?: number + ): number; + + /** + * @see _.findIndex + */ + findIndex( + array: List, + predicate?: W, + fromIndex?: number + ): number; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.findIndex + */ + findIndex( + predicate?: ListIterator, + fromIndex?: number + ): number; + + /** + * @see _.findIndex + */ + findIndex( + predicate?: string, + fromIndex?: number + ): number; + + /** + * @see _.findIndex + */ + findIndex( + predicate?: W, + fromIndex?: number + ): number; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.findIndex + */ + findIndex( + predicate?: ListIterator, + fromIndex?: number + ): number; + + /** + * @see _.findIndex + */ + findIndex( + predicate?: string, + fromIndex?: number + ): number; + + /** + * @see _.findIndex + */ + findIndex( + predicate?: W, + fromIndex?: number + ): number; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.findIndex + */ + findIndex( + predicate?: ListIterator, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.findIndex + */ + findIndex( + predicate?: string, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.findIndex + */ + findIndex( + predicate?: W, + fromIndex?: number + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.findIndex + */ + findIndex( + predicate?: ListIterator, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.findIndex + */ + findIndex( + predicate?: string, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.findIndex + */ + findIndex( + predicate?: W, + fromIndex?: number + ): LoDashExplicitWrapper; + } + + //_.findLastIndex + interface LoDashStatic { + /** + * This method is like _.findIndex except that it iterates over elements of collection from right to left. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to search. + * @param predicate The function invoked per iteration. + * @param fromIndex The index to search from. + * @return Returns the index of the found element, else -1. + */ + findLastIndex( + array: List, + predicate?: ListIterator, + fromIndex?: number + ): number; + + /** + * @see _.findLastIndex + */ + findLastIndex( + array: List, + predicate?: string, + fromIndex?: number + ): number; + + /** + * @see _.findLastIndex + */ + findLastIndex( + array: List, + predicate?: W, + fromIndex?: number + ): number; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: ListIterator, + fromIndex?: number + ): number; + + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: string, + fromIndex?: number + ): number; + + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: W, + fromIndex?: number + ): number; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: ListIterator, + fromIndex?: number + ): number; + + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: string, + fromIndex?: number + ): number; + + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: W, + fromIndex?: number + ): number; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: ListIterator, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: string, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: W, + fromIndex?: number + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: ListIterator, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: string, + fromIndex?: number + ): LoDashExplicitWrapper; + + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: W, + fromIndex?: number + ): LoDashExplicitWrapper; + } + + //_.first + interface LoDashStatic { + /** + * @see _.head + */ + first(array: List): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.head + */ + first(): string; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.head + */ + first(): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.head + */ + first(): T; + } + + interface LoDashExplicitWrapper { + /** + * @see _.head + */ + first(): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.head + */ + first(): T; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.head + */ + first(): T; + } + + interface RecursiveArray extends Array> {} + interface ListOfRecursiveArraysOrValues extends List> {} + + //_.flatten + interface LoDashStatic { + /** + * Flattens a nested array. If isDeep is true the array is recursively flattened, otherwise it’s only + * flattened a single level. + * + * @param array The array to flatten. + * @param isDeep Specify a deep flatten. + * @return Returns the new flattened array. + */ + flatten(array: ListOfRecursiveArraysOrValues, isDeep: boolean): T[]; + + /** + * @see _.flatten + */ + flatten(array: List): T[]; + + /** + * @see _.flatten + */ + flatten(array: ListOfRecursiveArraysOrValues): RecursiveArray; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flatten + */ + flatten(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.flatten + */ + flatten(isDeep?: boolean): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.flatten + */ + flatten(isDeep?: boolean): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flatten + */ + flatten(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.flatten + */ + flatten(isDeep?: boolean): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.flatten + */ + flatten(isDeep?: boolean): LoDashExplicitArrayWrapper; + } + + //_.flattenDeep + interface LoDashStatic { + /** + * Recursively flattens a nested array. + * + * @param array The array to recursively flatten. + * @return Returns the new flattened array. + */ + flattenDeep(array: ListOfRecursiveArraysOrValues): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flattenDeep + */ + flattenDeep(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.flattenDeep + */ + flattenDeep(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.flattenDeep + */ + flattenDeep(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flattenDeep + */ + flattenDeep(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.flattenDeep + */ + flattenDeep(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.flattenDeep + */ + flattenDeep(): LoDashExplicitArrayWrapper; + } + + // _.flattenDepth + interface LoDashStatic { + /** + * Recursively flatten array up to depth times. + * + * @param array The array to recursively flatten. + * @param number The maximum recursion depth. + * @return Returns the new flattened array. + */ + flattenDepth(array: ListOfRecursiveArraysOrValues, depth?: number): T[]; + } + + //_.fromPairs + interface LoDashStatic { + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['fred', 30], ['barney', 40]]); + * // => { 'fred': 30, 'barney': 40 } + */ + fromPairs( + array: List<[_.StringRepresentable, T]> + ): Dictionary; + + /** + @see _.fromPairs + */ + fromPairs( + array: List + ): Dictionary; + } + + //_.fromPairs DUMMY + interface LoDashImplicitArrayWrapper { + /** + * @see _.fromPairs + */ + fromPairs(): LoDashImplicitObjectWrapper; + } + + //_.fromPairs DUMMY + interface LoDashExplicitArrayWrapper { + /** + * @see _.fromPairs + */ + fromPairs(): LoDashExplicitObjectWrapper; + } + + //_.head + interface LoDashStatic { + /** + * Gets the first element of array. + * + * @alias _.first + * + * @param array The array to query. + * @return Returns the first element of array. + */ + head(array: List): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.head + */ + head(): string; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.head + */ + head(): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.head + */ + head(): T; + } + + interface LoDashExplicitWrapper { + /** + * @see _.head + */ + head(): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.head + */ + head(): T; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.head + */ + head(): T; + } + + //_.indexOf + interface LoDashStatic { + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the offset + * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` + * performs a faster binary search. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // using `fromIndex` + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + indexOf( + array: List, + value: T, + fromIndex?: boolean|number + ): number; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.indexOf + */ + indexOf( + value: T, + fromIndex?: boolean|number + ): number; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.indexOf + */ + indexOf( + value: TValue, + fromIndex?: boolean|number + ): number; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.indexOf + */ + indexOf( + value: T, + fromIndex?: boolean|number + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.indexOf + */ + indexOf( + value: TValue, + fromIndex?: boolean|number + ): LoDashExplicitWrapper; + } + + //_.intersectionBy DUMMY + interface LoDashStatic { + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of shared values. + * @example + * + * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [2.1] + * + * // using the `_.property` iteratee shorthand + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + intersectionBy( + array: any[]|List, + ...values: any[] + ): any[]; + } + + //_.intersectionWith DUMMY + interface LoDashStatic { + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + intersectionWith( + array: any[]|List, + ...values: any[] + ): any[]; + } + + //_.join + interface LoDashStatic { + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @param array The array to convert. + * @param separator The element separator. + * @returns Returns the joined string. + */ + join( + array: List, + separator?: string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.join + */ + join(separator?: string): string; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.join + */ + join(separator?: string): string; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.join + */ + join(separator?: string): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.join + */ + join(separator?: string): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.join + */ + join(separator?: string): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.join + */ + join(separator?: string): LoDashExplicitWrapper; + } + + //_.pullAll DUMMY + interface LoDashStatic { + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3, 1, 2, 3]; + * + * _.pull(array, [2, 3]); + * console.log(array); + * // => [1, 1] + */ + pullAll( + array: any[]|List, + ...values: any[] + ): any[]; + } + + //_.pullAllBy DUMMY + interface LoDashStatic { + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to to generate the criterion + * by which uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + pullAllBy( + array: any[]|List, + ...values: any[] + ): any[]; + } + + //_.reverse DUMMY + interface LoDashStatic { + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @memberOf _ + * @category Array + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + reverse( + array: any[]|List, + ...values: any[] + ): any[]; + } + + //_.sortedIndexOf + interface LoDashStatic { + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([1, 1, 2, 2], 2); + * // => 2 + */ + sortedIndexOf( + array: List, + value: T + ): number; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.sortedIndexOf + */ + sortedIndexOf( + value: T + ): number; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.sortedIndexOf + */ + sortedIndexOf( + value: TValue + ): number; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sortedIndexOf + */ + sortedIndexOf( + value: T + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sortedIndexOf + */ + sortedIndexOf( + value: TValue + ): LoDashExplicitWrapper; + } + + //_.initial + interface LoDashStatic { + /** + * Gets all but the last element of array. + * + * @param array The array to query. + * @return Returns the slice of array. + */ + initial(array: List): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.initial + */ + initial(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.initial + */ + initial(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.initial + */ + initial(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.initial + */ + initial(): LoDashExplicitArrayWrapper; + } + + //_.intersection + interface LoDashStatic { + /** + * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for + * equality comparisons. + * + * @param arrays The arrays to inspect. + * @return Returns the new array of shared values. + */ + intersection(...arrays: (T[]|List)[]): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.intersection + */ + intersection(...arrays: (TResult[]|List)[]): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.intersection + */ + intersection(...arrays: (TResult[]|List)[]): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.intersection + */ + intersection(...arrays: (TResult[]|List)[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.intersection + */ + intersection(...arrays: (TResult[]|List)[]): LoDashExplicitArrayWrapper; + } + + //_.last + interface LoDashStatic { + /** + * Gets the last element of array. + * + * @param array The array to query. + * @return Returns the last element of array. + */ + last(array: List): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.last + */ + last(): string; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.last + */ + last(): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.last + */ + last(): T; + } + + interface LoDashExplicitWrapper { + /** + * @see _.last + */ + last(): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.last + */ + last(): T; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.last + */ + last(): T; + } + + //_.lastIndexOf + interface LoDashStatic { + /** + * This method is like _.indexOf except that it iterates over elements of array from right to left. + * + * @param array The array to search. + * @param value The value to search for. + * @param fromIndex The index to search from or true to perform a binary search on a sorted array. + * @return Returns the index of the matched value, else -1. + */ + lastIndexOf( + array: List, + value: T, + fromIndex?: boolean|number + ): number; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.lastIndexOf + */ + lastIndexOf( + value: T, + fromIndex?: boolean|number + ): number; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.lastIndexOf + */ + lastIndexOf( + value: TResult, + fromIndex?: boolean|number + ): number; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.lastIndexOf + */ + lastIndexOf( + value: T, + fromIndex?: boolean|number + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.lastIndexOf + */ + lastIndexOf( + value: TResult, + fromIndex?: boolean|number + ): LoDashExplicitWrapper; + } + + //_.pull + interface LoDashStatic { + /** + * Removes all provided values from array using SameValueZero for equality comparisons. + * + * Note: Unlike _.without, this method mutates array. + * + * @param array The array to modify. + * @param values The values to remove. + * @return Returns array. + */ + pull( + array: T[], + ...values: T[] + ): T[]; + + /** + * @see _.pull + */ + pull( + array: List, + ...values: T[] + ): List; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.pull + */ + pull(...values: T[]): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.pull + */ + pull(...values: TValue[]): LoDashImplicitObjectWrapper>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.pull + */ + pull(...values: T[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.pull + */ + pull(...values: TValue[]): LoDashExplicitObjectWrapper>; + } + + //_.pullAt + interface LoDashStatic { + /** + * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. + * Indexes may be specified as an array of indexes or as individual arguments. + * + * Note: Unlike _.at, this method mutates array. + * + * @param array The array to modify. + * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. + * @return Returns the new array of removed elements. + */ + pullAt( + array: List, + ...indexes: (number|number[])[] + ): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.pullAt + */ + pullAt(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.pullAt + */ + pullAt(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.pullAt + */ + pullAt(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.pullAt + */ + pullAt(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper; + } + + //_.remove + interface LoDashStatic { + /** + * Removes all elements from array that predicate returns truthy for and returns an array of the removed + * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * Note: Unlike _.filter, this method mutates array. + * + * @param array The array to modify. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the new array of removed elements. + */ + remove( + array: List, + predicate?: ListIterator + ): T[]; + + /** + * @see _.remove + */ + remove( + array: List, + predicate?: string + ): T[]; + + /** + * @see _.remove + */ + remove( + array: List, + predicate?: W + ): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.remove + */ + remove( + predicate?: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.remove + */ + remove( + predicate?: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.remove + */ + remove( + predicate?: W + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.remove + */ + remove( + predicate?: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.remove + */ + remove( + predicate?: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.remove + */ + remove( + predicate?: W + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.remove + */ + remove( + predicate?: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.remove + */ + remove( + predicate?: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.remove + */ + remove( + predicate?: W + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.remove + */ + remove( + predicate?: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.remove + */ + remove( + predicate?: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.remove + */ + remove( + predicate?: W + ): LoDashExplicitArrayWrapper; + } + + //_.tail + interface LoDashStatic { + /** + * Gets all but the first element of array. + * + * @alias _.tail + * + * @param array The array to query. + * @return Returns the slice of array. + */ + tail(array: List): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.tail + */ + tail(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.tail + */ + tail(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.tail + */ + tail(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.tail + */ + tail(): LoDashExplicitArrayWrapper; + } + + //_.slice + interface LoDashStatic { + /** + * Creates a slice of array from start up to, but not including, end. + * + * @param array The array to slice. + * @param start The start position. + * @param end The end position. + * @return Returns the slice of array. + */ + slice( + array: T[], + start?: number, + end?: number + ): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.slice + */ + slice( + start?: number, + end?: number + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.slice + */ + slice( + start?: number, + end?: number + ): LoDashExplicitArrayWrapper; + } + + //_.sortedIndex + interface LoDashStatic { + /** + * Uses a binary search to determine the lowest index at which `value` should + * be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + * + * _.sortedIndex([4, 5], 4); + * // => 0 + */ + sortedIndex( + array: List, + value: T + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex( + array: List, + value: T + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex( + array: List, + value: T + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex( + array: List, + value: T + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex( + array: List, + value: T + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + value: string + ): number; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T + ): number; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + value: string + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T + ): LoDashExplicitWrapper; + + + } + + //_.sortedIndexBy + interface LoDashStatic { + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @example + * + * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; + * + * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); + * // => 1 + * + * // using the `_.property` iteratee shorthand + * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); + * // => 0 + */ + sortedIndexBy( + array: List, + value: T, + iteratee: (x: T) => TSort + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + array: List, + value: T, + iteratee: (x: T) => any + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + array: List, + value: T, + iteratee: string + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + array: List, + value: T, + iteratee: W + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + array: List, + value: T, + iteratee: Object + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: string, + iteratee: (x: string) => TSort + ): number; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: (x: T) => TSort + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: string + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: W + ): number; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: (x: T) => TSort + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: (x: T) => any + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: string + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: W + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: Object + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: string, + iteratee: (x: string) => TSort + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: (x: T) => TSort + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: string + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: W + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: (x: T) => TSort + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: (x: T) => any + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: string + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: W + ): LoDashExplicitWrapper; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: Object + ): LoDashExplicitWrapper; + } + + //_.sortedLastIndex + interface LoDashStatic { + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @example + * + * _.sortedLastIndex([4, 5], 4); + * // => 1 + */ + sortedLastIndex( + array: List, + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + array: List, + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + array: List, + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + array: List, + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + array: List, + value: T + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + value: string + ): number; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + value: T + ): number; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + value: T + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + value: string + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + value: T + ): LoDashExplicitWrapper; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + value: T + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + value: T + ): LoDashExplicitWrapper; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + value: T + ): LoDashExplicitWrapper; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + value: T + ): LoDashExplicitWrapper; + } + + //_.sortedLastIndexBy + interface LoDashStatic { + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @example + * + * // using the `_.property` iteratee shorthand + * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); + * // => 1 + */ + sortedLastIndexBy( + array: List, + value: T, + iteratee: (x: T) => TSort + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + array: List, + value: T, + iteratee: (x: T) => any + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + array: List, + value: T, + iteratee: string + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + array: List, + value: T, + iteratee: W + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + array: List, + value: T, + iteratee: Object + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: string, + iteratee: (x: string) => TSort + ): number; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: (x: T) => TSort + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: string + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: W + ): number; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: (x: T) => TSort + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: (x: T) => any + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: string + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: W + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: Object + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: string, + iteratee: (x: string) => TSort + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: (x: T) => TSort + ): LoDashExplicitWrapper; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: string + ): LoDashExplicitWrapper; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: W + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: (x: T) => TSort + ): LoDashExplicitWrapper; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: (x: T) => any + ): LoDashExplicitWrapper; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: string + ): LoDashExplicitWrapper; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: W + ): LoDashExplicitWrapper; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: Object + ): LoDashExplicitWrapper; + } + + //_.sortedLastIndexOf DUMMY + interface LoDashStatic { + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([1, 1, 2, 2], 2); + * // => 3 + */ + sortedLastIndexOf( + array: any[]|List, + ...values: any[] + ): any[]; + } + + //_.tail + interface LoDashStatic { + /** + * @see _.rest + */ + tail(array: List): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.rest + */ + tail(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.rest + */ + tail(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.rest + */ + tail(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.rest + */ + tail(): LoDashExplicitArrayWrapper; + } + + //_.take + interface LoDashStatic { + /** + * Creates a slice of array with n elements taken from the beginning. + * + * @param array The array to query. + * @param n The number of elements to take. + * @return Returns the slice of array. + */ + take( + array: List, + n?: number + ): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.take + */ + take(n?: number): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.take + */ + take(n?: number): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.take + */ + take(n?: number): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.take + */ + take(n?: number): LoDashExplicitArrayWrapper; + } + + //_.takeRight + interface LoDashStatic { + /** + * Creates a slice of array with n elements taken from the end. + * + * @param array The array to query. + * @param n The number of elements to take. + * @return Returns the slice of array. + */ + takeRight( + array: List, + n?: number + ): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.takeRight + */ + takeRight(n?: number): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.takeRight + */ + takeRight(n?: number): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.takeRight + */ + takeRight(n?: number): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.takeRight + */ + takeRight(n?: number): LoDashExplicitArrayWrapper; + } + + //_.takeRightWhile + interface LoDashStatic { + /** + * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns + * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + takeRightWhile( + array: List, + predicate?: ListIterator + ): TValue[]; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + array: List, + predicate?: string + ): TValue[]; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + array: List, + predicate?: TWhere + ): TValue[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: TWhere + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: TWhere + ): LoDashExplicitArrayWrapper; + } + + //_.takeWhile + interface LoDashStatic { + /** + * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns + * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + takeWhile( + array: List, + predicate?: ListIterator + ): TValue[]; + + /** + * @see _.takeWhile + */ + takeWhile( + array: List, + predicate?: string + ): TValue[]; + + /** + * @see _.takeWhile + */ + takeWhile( + array: List, + predicate?: TWhere + ): TValue[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: TWhere + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: TWhere + ): LoDashExplicitArrayWrapper; + } + + //_.union + interface LoDashStatic { + /** + * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for + * equality comparisons. + * + * @param arrays The arrays to inspect. + * @return Returns the new array of combined values. + */ + union(...arrays: List[]): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.union + */ + union(...arrays: List[]): LoDashImplicitArrayWrapper; + + /** + * @see _.union + */ + union(...arrays: List[]): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.union + */ + union(...arrays: List[]): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.union + */ + union(...arrays: List[]): LoDashExplicitArrayWrapper; + + /** + * @see _.union + */ + union(...arrays: List[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.union + */ + union(...arrays: List[]): LoDashExplicitArrayWrapper; + } + + //_.unionBy + interface LoDashStatic { + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @param arrays The arrays to inspect. + * @param iteratee The iteratee invoked per element. + * @return Returns the new array of combined values. + */ + unionBy( + arrays: T[]|List, + iteratee?: (value: T) => any + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays: T[]|List, + iteratee?: W + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + iteratee?: (value: T) => any + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + iteratee?: W + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: (value: T) => any + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: W + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: (value: T) => any + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: W + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: (value: T) => any + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays1: T[]|List, + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: W + ): T[]; + + /** + * @see _.unionBy + */ + unionBy( + arrays: T[]|List, + ...iteratee: any[] + ): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.unionBy + */ + unionBy( + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + ...iteratee: any[] + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.unionBy + */ + unionBy( + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: (value: T) => any + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: W + ): LoDashImplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + ...iteratee: any[] + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.unionBy + */ + unionBy( + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + ...iteratee: any[] + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.unionBy + */ + unionBy( + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: (value: T) => any + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + arrays2: T[]|List, + arrays3: T[]|List, + arrays4: T[]|List, + arrays5: T[]|List, + iteratee?: W + ): LoDashExplicitArrayWrapper; + + /** + * @see _.unionBy + */ + unionBy( + ...iteratee: any[] + ): LoDashExplicitArrayWrapper; + } + + //_.uniq + interface LoDashStatic { + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + uniq( + array: List + ): T[]; + + /** + * @see _.uniq + */ + uniq( + array: List + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.uniq + */ + uniq(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.uniq + */ + uniq(): LoDashImplicitArrayWrapper; + + /** + * @see _.uniq + */ + uniq(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + uniq(): LoDashImplicitArrayWrapper; + + /** + * @see _.uniq + */ + uniq(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.uniq + */ + uniq(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.uniq + */ + uniq(): LoDashExplicitArrayWrapper; + + /** + * @see _.uniq + */ + uniq(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.uniq + */ + uniq(): LoDashExplicitArrayWrapper; + + /** + * @see _.uniq + */ + uniq(): LoDashExplicitArrayWrapper; + } + + //_.uniqBy + interface LoDashStatic { + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // using the `_.property` iteratee shorthand + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + uniqBy( + array: List, + iteratee: ListIterator + ): T[]; + + /** + * @see _.uniqBy + */ + uniqBy( + array: List, + iteratee: ListIterator + ): T[]; + + /** + * @see _.uniqBy + */ + uniqBy( + array: List, + iteratee: string + ): T[]; + + /** + * @see _.uniqBy + */ + uniqBy( + array: List, + iteratee: Object + ): T[]; + + /** + * @see _.uniqBy + */ + uniqBy( + array: List, + iteratee: TWhere + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: Object + ): LoDashImplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: ListIterator + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: TWhere + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: Object + ): LoDashExplicitArrayWrapper; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: TWhere + ): LoDashExplicitArrayWrapper; + } + + //_.sortedUniq + interface LoDashStatic { + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + sortedUniq( + array: List + ): T[]; + + /** + * @see _.sortedUniq + */ + sortedUniq( + array: List + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + sortedUniq(): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashExplicitArrayWrapper; + + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashExplicitArrayWrapper; + + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashExplicitArrayWrapper; + } + + //_.sortedUniqBy + interface LoDashStatic { + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.2] + */ + sortedUniqBy( + array: List, + iteratee: ListIterator + ): T[]; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + array: List, + iteratee: ListIterator + ): T[]; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + array: List, + iteratee: string + ): T[]; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + array: List, + iteratee: Object + ): T[]; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + array: List, + iteratee: TWhere + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: Object + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: TWhere + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: ListIterator + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: TWhere + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: Object + ): LoDashExplicitArrayWrapper; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: TWhere + ): LoDashExplicitArrayWrapper; + } + + //_.unionWith DUMMY + interface LoDashStatic { + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + unionWith( + array: any[]|List, + ...values: any[] + ): any[]; + } + + //_.uniqWith DUMMY + interface LoDashStatic { + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The comparator is invoked with + * two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + uniqWith( + array: any[]|List, + ...values: any[] + ): any[]; + } + + //_.unzip + interface LoDashStatic { + /** + * This method is like _.zip except that it accepts an array of grouped elements and creates an array + * regrouping the elements to their pre-zip configuration. + * + * @param array The array of grouped elements to process. + * @return Returns the new array of regrouped elements. + */ + unzip(array: List>): T[][]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.unzip + */ + unzip(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.unzip + */ + unzip(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.unzip + */ + unzip(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.unzip + */ + unzip(): LoDashExplicitArrayWrapper; + } + + //_.unzipWith + interface LoDashStatic { + /** + * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be + * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, + * group). + * + * @param array The array of grouped elements to process. + * @param iteratee The function to combine regrouped values. + * @param thisArg The this binding of iteratee. + * @return Returns the new array of regrouped elements. + */ + unzipWith( + array: List>, + iteratee?: MemoIterator + ): TResult[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.unzipWith + */ + unzipWith( + iteratee?: MemoIterator + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.unzipWith + */ + unzipWith( + iteratee?: MemoIterator + ): LoDashImplicitArrayWrapper; + } + + //_.without + interface LoDashStatic { + /** + * Creates an array excluding all provided values using SameValueZero for equality comparisons. + * + * @param array The array to filter. + * @param values The values to exclude. + * @return Returns the new array of filtered values. + */ + without( + array: List, + ...values: T[] + ): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.without + */ + without(...values: T[]): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.without + */ + without(...values: T[]): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.without + */ + without(...values: T[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.without + */ + without(...values: T[]): LoDashExplicitArrayWrapper; + } + + //_.xor + interface LoDashStatic { + /** + * Creates an array of unique values that is the symmetric difference of the provided arrays. + * + * @param arrays The arrays to inspect. + * @return Returns the new array of values. + */ + xor(...arrays: List[]): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.xor + */ + xor(...arrays: List[]): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.xor + */ + xor(...arrays: List[]): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.xor + */ + xor(...arrays: List[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.xor + */ + xor(...arrays: List[]): LoDashExplicitArrayWrapper; + } + + //_.xorBy DUMMY + interface LoDashStatic { + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of values. + * @example + * + * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [1.2, 4.3] + * + * // using the `_.property` iteratee shorthand + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + xorBy( + array: any[]|List, + ...values: any[] + ): any[]; + } + + //_.xorWith DUMMY + interface LoDashStatic { + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The comparator is invoked with + * two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + xorWith( + array: any[]|List, + ...values: any[] + ): any[]; + } + + //_.zip + interface LoDashStatic { + /** + * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, + * the second of which contains the second elements of the given arrays, and so on. + * + * @param arrays The arrays to process. + * @return Returns the new array of grouped elements. + */ + zip(...arrays: List[]): T[][]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.zip + */ + zip(...arrays: List[]): _.LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.zip + */ + zip(...arrays: List[]): _.LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.zip + */ + zip(...arrays: List[]): _.LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.zip + */ + zip(...arrays: List[]): _.LoDashExplicitArrayWrapper; + } + + //_.zipObject + interface LoDashStatic { + /** + * The inverse of _.pairs; this method returns an object composed from arrays of property names and values. + * Provide either a single two dimensional array, e.g. [[key1, value1], [key2, value2]] or two arrays, one of + * property names and one of corresponding values. + * + * @param props The property names. + * @param values The property values. + * @return Returns the new object. + */ + zipObject( + props: List|List>, + values?: List + ): TResult; + + /** + * @see _.zipObject + */ + zipObject( + props: List|List>, + values?: List + ): TResult; + + /** + * @see _.zipObject + */ + zipObject( + props: List|List>, + values?: List + ): _.Dictionary; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashImplicitObjectWrapper; + + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashImplicitObjectWrapper; + + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashImplicitObjectWrapper<_.Dictionary>; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashImplicitObjectWrapper; + + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashImplicitObjectWrapper; + + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashImplicitObjectWrapper<_.Dictionary>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashExplicitObjectWrapper; + + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashExplicitObjectWrapper; + + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashExplicitObjectWrapper<_.Dictionary>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashExplicitObjectWrapper; + + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashExplicitObjectWrapper; + + /** + * @see _.zipObject + */ + zipObject( + values?: List + ): _.LoDashExplicitObjectWrapper<_.Dictionary>; + } + + //_.zipWith + interface LoDashStatic { + /** + * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be + * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, + * group). + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee] The function to combine grouped values. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @return Returns the new array of grouped elements. + */ + zipWith(...args: any[]): TResult[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.zipWith + */ + zipWith(...args: any[]): LoDashImplicitArrayWrapper; + } + + /********* + * Chain * + *********/ + + //_.chain + interface LoDashStatic { + /** + * Creates a lodash object that wraps value with explicit method chaining enabled. + * + * @param value The value to wrap. + * @return Returns the new lodash wrapper instance. + */ + chain(value: number): LoDashExplicitWrapper; + chain(value: string): LoDashExplicitWrapper; + chain(value: boolean): LoDashExplicitWrapper; + chain(value: T[]): LoDashExplicitArrayWrapper; + chain(value: T): LoDashExplicitObjectWrapper; + chain(value: any): LoDashExplicitWrapper; + } + + interface LoDashImplicitWrapper { + /** + * @see _.chain + */ + chain(): LoDashExplicitWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.chain + */ + chain(): LoDashExplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.chain + */ + chain(): LoDashExplicitObjectWrapper; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.chain + */ + chain(): TWrapper; + } + + //_.tap + interface LoDashStatic { + /** + * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one + * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations + * on intermediate results within the chain. + * + * @param value The value to provide to interceptor. + * @param interceptor The function to invoke. + * @parem thisArg The this binding of interceptor. + * @return Returns value. + **/ + tap( + value: T, + interceptor: (value: T) => void + ): T; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.tap + */ + tap( + interceptor: (value: T) => void + ): TWrapper; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.tap + */ + tap( + interceptor: (value: T) => void + ): TWrapper; + } + + //_.thru + interface LoDashStatic { + /** + * This method is like _.tap except that it returns the result of interceptor. + * + * @param value The value to provide to interceptor. + * @param interceptor The function to invoke. + * @param thisArg The this binding of interceptor. + * @return Returns the result of interceptor. + */ + thru( + value: T, + interceptor: (value: T) => TResult + ): TResult; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.thru + */ + thru( + interceptor: (value: T) => TResult): LoDashImplicitWrapper; + + /** + * @see _.thru + */ + thru( + interceptor: (value: T) => TResult): LoDashImplicitWrapper; + + /** + * @see _.thru + */ + thru( + interceptor: (value: T) => TResult): LoDashImplicitWrapper; + + /** + * @see _.thru + */ + thru( + interceptor: (value: T) => TResult): LoDashImplicitObjectWrapper; + + /** + * @see _.thru + */ + thru( + interceptor: (value: T) => TResult[]): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.thru + */ + thru( + interceptor: (value: T) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.thru + */ + thru( + interceptor: (value: T) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.thru + */ + thru( + interceptor: (value: T) => TResult + ): LoDashExplicitWrapper; + + /** + * @see _.thru + */ + thru( + interceptor: (value: T) => TResult + ): LoDashExplicitObjectWrapper; + + /** + * @see _.thru + */ + thru( + interceptor: (value: T) => TResult[] + ): LoDashExplicitArrayWrapper; + } + + //_.prototype.commit + interface LoDashImplicitWrapperBase { + /** + * Executes the chained sequence and returns the wrapped result. + * + * @return Returns the new lodash wrapper instance. + */ + commit(): TWrapper; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.commit + */ + commit(): TWrapper; + } + + //_.prototype.concat + interface LoDashImplicitWrapperBase { + /** + * Creates a new array joining a wrapped array with any additional arrays and/or values. + * + * @param items + * @return Returns the new concatenated array. + */ + concat(...items: Array>): LoDashImplicitArrayWrapper; + + /** + * @see _.concat + */ + concat(...items: Array>): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.concat + */ + concat(...items: Array>): LoDashExplicitArrayWrapper; + + /** + * @see _.concat + */ + concat(...items: Array>): LoDashExplicitArrayWrapper; + } + + //_.prototype.plant + interface LoDashImplicitWrapperBase { + /** + * Creates a clone of the chained sequence planting value as the wrapped value. + * @param value The value to plant as the wrapped value. + * @return Returns the new lodash wrapper instance. + */ + plant(value: number): LoDashImplicitWrapper; + + /** + * @see _.plant + */ + plant(value: string): LoDashImplicitStringWrapper; + + /** + * @see _.plant + */ + plant(value: boolean): LoDashImplicitWrapper; + + /** + * @see _.plant + */ + plant(value: number[]): LoDashImplicitNumberArrayWrapper; + + /** + * @see _.plant + */ + plant(value: T[]): LoDashImplicitArrayWrapper; + + /** + * @see _.plant + */ + plant(value: T): LoDashImplicitObjectWrapper; + + /** + * @see _.plant + */ + plant(value: any): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.plant + */ + plant(value: number): LoDashExplicitWrapper; + + /** + * @see _.plant + */ + plant(value: string): LoDashExplicitStringWrapper; + + /** + * @see _.plant + */ + plant(value: boolean): LoDashExplicitWrapper; + + /** + * @see _.plant + */ + plant(value: number[]): LoDashExplicitNumberArrayWrapper; + + /** + * @see _.plant + */ + plant(value: T[]): LoDashExplicitArrayWrapper; + + /** + * @see _.plant + */ + plant(value: T): LoDashExplicitObjectWrapper; + + /** + * @see _.plant + */ + plant(value: any): LoDashExplicitWrapper; + } + + //_.prototype.reverse + interface LoDashImplicitArrayWrapper { + /** + * Reverses the wrapped array so the first element becomes the last, the second element becomes the second to + * last, and so on. + * + * Note: This method mutates the wrapped array. + * + * @return Returns the new reversed lodash wrapper instance. + */ + reverse(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.reverse + */ + reverse(): LoDashExplicitArrayWrapper; + } + + //_.prototype.toJSON + interface LoDashWrapperBase { + /** + * @see _.value + */ + toJSON(): T; + } + + //_.prototype.toString + interface LoDashWrapperBase { + /** + * Produces the result of coercing the unwrapped value to a string. + * + * @return Returns the coerced string value. + */ + toString(): string; + } + + //_.prototype.value + interface LoDashWrapperBase { + /** + * Executes the chained sequence to extract the unwrapped value. + * + * @alias _.toJSON, _.valueOf + * + * @return Returns the resolved unwrapped value. + */ + value(): T; + } + + //_.valueOf + interface LoDashWrapperBase { + /** + * @see _.value + */ + valueOf(): T; + } + + /************** + * Collection * + **************/ + + //_.at + interface LoDashStatic { + /** + * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be + * specified as individual arguments or as arrays of keys. + * + * @param collection The collection to iterate over. + * @param props The property names or indexes of elements to pick, specified individually or in arrays. + * @return Returns the new array of picked elements. + */ + at( + collection: List|Dictionary, + ...props: (number|string|(number|string)[])[] + ): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.at + */ + at(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.at + */ + at(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.at + */ + at(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.at + */ + at(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper; + } + + //_.countBy + interface LoDashStatic { + /** + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The + * iteratee is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the composed aggregate object. + */ + countBy( + collection: List, + iteratee?: ListIterator + ): Dictionary; + + /** + * @see _.countBy + */ + countBy( + collection: Dictionary, + iteratee?: DictionaryIterator + ): Dictionary; + + /** + * @see _.countBy + */ + countBy( + collection: NumericDictionary, + iteratee?: NumericDictionaryIterator + ): Dictionary; + + /** + * @see _.countBy + */ + countBy( + collection: List|Dictionary|NumericDictionary, + iteratee?: string + ): Dictionary; + + /** + * @see _.countBy + */ + countBy( + collection: List|Dictionary|NumericDictionary, + iteratee?: W + ): Dictionary; + + /** + * @see _.countBy + */ + countBy( + collection: List|Dictionary|NumericDictionary, + iteratee?: Object + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.countBy + */ + countBy( + iteratee?: ListIterator + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.countBy + */ + countBy( + iteratee?: ListIterator + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: string + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: W + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.countBy + */ + countBy( + iteratee?: ListIterator|DictionaryIterator|NumericDictionaryIterator + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: string + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: W + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.countBy + */ + countBy( + iteratee?: ListIterator + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.countBy + */ + countBy( + iteratee?: ListIterator + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: string + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: W + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.countBy + */ + countBy( + iteratee?: ListIterator|DictionaryIterator|NumericDictionaryIterator + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: string + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: W + ): LoDashExplicitObjectWrapper>; + } + + //_.each + interface LoDashStatic { + /** + * @see _.forEach + */ + each( + collection: T[], + iteratee?: ListIterator + ): T[]; + + /** + * @see _.forEach + */ + each( + collection: List, + iteratee?: ListIterator + ): List; + + /** + * @see _.forEach + */ + each( + collection: Dictionary, + iteratee?: DictionaryIterator + ): Dictionary; + + /** + * @see _.forEach + */ + each( + collection: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forEach + */ + each( + collection: T, + iteratee?: ObjectIterator + ): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.forEach + */ + each( + iteratee: ListIterator + ): LoDashImplicitWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.forEach + */ + each( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.forEach + */ + each( + iteratee?: ListIterator|DictionaryIterator + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.forEach + */ + each( + iteratee: ListIterator + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.forEach + */ + each( + iteratee: ListIterator + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.forEach + */ + each( + iteratee?: ListIterator|DictionaryIterator + ): LoDashExplicitObjectWrapper; + } + + //_.eachRight + interface LoDashStatic { + /** + * @see _.forEachRight + */ + eachRight( + collection: T[], + iteratee?: ListIterator + ): T[]; + + /** + * @see _.forEachRight + */ + eachRight( + collection: List, + iteratee?: ListIterator + ): List; + + /** + * @see _.forEachRight + */ + eachRight( + collection: Dictionary, + iteratee?: DictionaryIterator + ): Dictionary; + + /** + * @see _.forEachRight + */ + eachRight( + collection: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forEachRight + */ + eachRight( + collection: T, + iteratee?: ObjectIterator + ): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.forEachRight + */ + eachRight( + iteratee: ListIterator + ): LoDashImplicitWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.forEachRight + */ + eachRight( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.forEachRight + */ + eachRight( + iteratee?: ListIterator|DictionaryIterator + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.forEachRight + */ + eachRight( + iteratee: ListIterator + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.forEachRight + */ + eachRight( + iteratee: ListIterator + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.forEachRight + */ + eachRight( + iteratee?: ListIterator|DictionaryIterator + ): LoDashExplicitObjectWrapper; + } + + //_.every + interface LoDashStatic { + /** + * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate + * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @return Returns true if all elements pass the predicate check, else false. + */ + every( + collection: List, + predicate?: ListIterator + ): boolean; + + /** + * @see _.every + */ + every( + collection: Dictionary, + predicate?: DictionaryIterator + ): boolean; + + /** + * @see _.every + */ + every( + collection: NumericDictionary, + predicate?: NumericDictionaryIterator + ): boolean; + + /** + * @see _.every + */ + every( + collection: List|Dictionary|NumericDictionary, + predicate?: string|any[] + ): boolean; + + /** + * @see _.every + */ + every( + collection: List|Dictionary|NumericDictionary, + predicate?: TObject + ): boolean; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.every + */ + every( + predicate?: ListIterator|NumericDictionaryIterator + ): boolean; + + /** + * @see _.every + */ + every( + predicate?: string|any[] + ): boolean; + + /** + * @see _.every + */ + every( + predicate?: TObject + ): boolean; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.every + */ + every( + predicate?: ListIterator|DictionaryIterator|NumericDictionaryIterator + ): boolean; + + /** + * @see _.every + */ + every( + predicate?: string|any[] + ): boolean; + + /** + * @see _.every + */ + every( + predicate?: TObject + ): boolean; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.every + */ + every( + predicate?: ListIterator|NumericDictionaryIterator + ): LoDashExplicitWrapper; + + /** + * @see _.every + */ + every( + predicate?: string|any[] + ): LoDashExplicitWrapper; + + /** + * @see _.every + */ + every( + predicate?: TObject + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.every + */ + every( + predicate?: ListIterator|DictionaryIterator|NumericDictionaryIterator + ): LoDashExplicitWrapper; + + /** + * @see _.every + */ + every( + predicate?: string|any[] + ): LoDashExplicitWrapper; + + /** + * @see _.every + */ + every( + predicate?: TObject + ): LoDashExplicitWrapper; + } + + //_.filter + interface LoDashStatic { + /** + * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The + * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the new filtered array. + */ + filter( + collection: List, + predicate?: ListIterator + ): T[]; + + /** + * @see _.filter + */ + filter( + collection: Dictionary, + predicate?: DictionaryIterator + ): T[]; + + /** + * @see _.filter + */ + filter( + collection: string, + predicate?: StringIterator + ): string[]; + + /** + * @see _.filter + */ + filter( + collection: List|Dictionary, + predicate: string + ): T[]; + + /** + * @see _.filter + */ + filter( + collection: List|Dictionary, + predicate: W + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.filter + */ + filter( + predicate?: StringIterator + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.filter + */ + filter( + predicate: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.filter + */ + filter( + predicate: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.filter + */ + filter(predicate: W): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.filter + */ + filter( + predicate: ListIterator|DictionaryIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.filter + */ + filter( + predicate: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.filter + */ + filter(predicate: W): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.filter + */ + filter( + predicate?: StringIterator + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.filter + */ + filter( + predicate: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.filter + */ + filter( + predicate: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.filter + */ + filter(predicate: W): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.filter + */ + filter( + predicate: ListIterator|DictionaryIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.filter + */ + filter( + predicate: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.filter + */ + filter(predicate: W): LoDashExplicitArrayWrapper; + } + + //_.find + interface LoDashStatic { + /** + * Iterates over elements of collection, returning the first element predicate returns truthy for. + * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to search. + * @param predicate The function invoked per iteration. + * @param fromIndex The index to search from. + * @return Returns the matched element, else undefined. + */ + find( + collection: List, + predicate?: ListIterator, + fromIndex?: number + ): T; + + /** + * @see _.find + */ + find( + collection: Dictionary, + predicate?: DictionaryIterator, + fromIndex?: number + ): T; + + /** + * @see _.find + */ + find( + collection: List|Dictionary, + predicate?: string, + fromIndex?: number + ): T; + + /** + * @see _.find + */ + find( + collection: List|Dictionary, + predicate?: TObject, + fromIndex?: number + ): T; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.find + */ + find( + predicate?: ListIterator, + fromIndex?: number + ): T; + + /** + * @see _.find + */ + find( + predicate?: string, + fromIndex?: number + ): T; + + /** + * @see _.find + */ + find( + predicate?: TObject, + fromIndex?: number + ): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.find + */ + find( + predicate?: ListIterator|DictionaryIterator, + fromIndex?: number + ): TResult; + + /** + * @see _.find + */ + find( + predicate?: string, + fromIndex?: number + ): TResult; + + /** + * @see _.find + */ + find( + predicate?: TObject, + fromIndex?: number + ): TResult; + } + + //_.findLast + interface LoDashStatic { + /** + * This method is like _.find except that it iterates over elements of a collection from + * right to left. + * @param collection Searches for a value in this list. + * @param callback The function called per iteration. + * @param fromIndex The index to search from. + * @return The found element, else undefined. + **/ + findLast( + collection: Array, + callback: ListIterator, + fromIndex?: number + ): T; + + /** + * @see _.find + **/ + findLast( + collection: List, + callback: ListIterator, + fromIndex?: number + ): T; + + /** + * @see _.find + **/ + findLast( + collection: Dictionary, + callback: DictionaryIterator, + fromIndex?: number + ): T; + + /** + * @see _.find + * @param _.pluck style callback + **/ + findLast( + collection: Array, + whereValue: W, + fromIndex?: number + ): T; + + /** + * @see _.find + * @param _.pluck style callback + **/ + findLast( + collection: List, + whereValue: W, + fromIndex?: number + ): T; + + /** + * @see _.find + * @param _.pluck style callback + **/ + findLast( + collection: Dictionary, + whereValue: W, + fromIndex?: number + ): T; + + /** + * @see _.find + * @param _.where style callback + **/ + findLast( + collection: Array, + pluckValue: string, + fromIndex?: number + ): T; + + /** + * @see _.find + * @param _.where style callback + **/ + findLast( + collection: List, + pluckValue: string, + fromIndex?: number + ): T; + + /** + * @see _.find + * @param _.where style callback + **/ + findLast( + collection: Dictionary, + pluckValue: string, + fromIndex?: number + ): T; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.findLast + */ + findLast( + callback: ListIterator, + fromIndex?: number + ): T; + /** + * @see _.findLast + * @param _.where style callback + */ + findLast( + whereValue: W, + fromIndex?: number + ): T; + + /** + * @see _.findLast + * @param _.where style callback + */ + findLast( + pluckValue: string, + fromIndex?: number + ): T; + } + + //_.flatMap + interface LoDashStatic { + /** + * Creates an array of flattened values by running each element in collection through iteratee + * and concating its result to the other mapped values. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @return Returns the new flattened array. + */ + flatMap( + collection: List, + iteratee?: ListIterator + ): TResult[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: List, + iteratee?: ListIterator + ): TResult[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: Dictionary, + iteratee?: DictionaryIterator + ): TResult[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: Dictionary, + iteratee?: DictionaryIterator + ): TResult[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: NumericDictionary, + iteratee?: NumericDictionaryIterator + ): TResult[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: NumericDictionary, + iteratee?: NumericDictionaryIterator + ): TResult[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: TObject, + iteratee?: ObjectIterator + ): TResult[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: Object, + iteratee?: ObjectIterator + ): TResult[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: TObject, + iteratee: TWhere + ): boolean[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: TObject, + iteratee: Object|string + ): TResult[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: TObject, + iteratee: [string, any] + ): boolean[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: string + ): string[]; + + /** + * @see _.flatMap + */ + flatMap( + collection: Object, + iteratee?: Object|string + ): TResult[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.flatMap + */ + flatMap( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.flatMap + */ + flatMap( + iteratee: ListIterator|string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: TWhere + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: [string, any] + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.flatMap + */ + flatMap( + iteratee: ListIterator|DictionaryIterator|NumericDictionaryIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: ObjectIterator|string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: TWhere + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: [string, any] + ): LoDashImplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.flatMap + */ + flatMap( + iteratee: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.flatMap + */ + flatMap( + iteratee: ListIterator|string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: TWhere + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: [string, any] + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.flatMap + */ + flatMap( + iteratee: ListIterator|DictionaryIterator|NumericDictionaryIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: ObjectIterator|string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: TWhere + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap( + iteratee: [string, any] + ): LoDashExplicitArrayWrapper; + + /** + * @see _.flatMap + */ + flatMap(): LoDashExplicitArrayWrapper; + } + + //_.forEach + interface LoDashStatic { + /** + * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg + * and invoked with three arguments: + * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. + * + * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To + * avoid this behavior _.forIn or _.forOwn may be used for object iteration. + * + * @alias _.each + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + */ + forEach( + collection: T[], + iteratee?: ListIterator + ): T[]; + + /** + * @see _.forEach + */ + forEach( + collection: List, + iteratee?: ListIterator + ): List; + + /** + * @see _.forEach + */ + forEach( + collection: Dictionary, + iteratee?: DictionaryIterator + ): Dictionary; + + /** + * @see _.forEach + */ + forEach( + collection: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forEach + */ + forEach( + collection: T, + iteratee?: ObjectIterator + ): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.forEach + */ + forEach( + iteratee: ListIterator + ): LoDashImplicitWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.forEach + */ + forEach( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.forEach + */ + forEach( + iteratee?: ListIterator|DictionaryIterator + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.forEach + */ + forEach( + iteratee: ListIterator + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.forEach + */ + forEach( + iteratee: ListIterator + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.forEach + */ + forEach( + iteratee?: ListIterator|DictionaryIterator + ): LoDashExplicitObjectWrapper; + } + + //_.forEachRight + interface LoDashStatic { + /** + * This method is like _.forEach except that it iterates over elements of collection from right to left. + * + * @alias _.eachRight + * + * @param collection The collection to iterate over. + * @param iteratee The function called per iteration. + * @param thisArg The this binding of callback. + */ + forEachRight( + collection: T[], + iteratee?: ListIterator + ): T[]; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: List, + iteratee?: ListIterator + ): List; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: Dictionary, + iteratee?: DictionaryIterator + ): Dictionary; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: T, + iteratee?: ObjectIterator + ): T; + + /** + * @see _.forEachRight + */ + forEachRight( + collection: T, + iteratee?: ObjectIterator + ): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.forEachRight + */ + forEachRight( + iteratee: ListIterator + ): LoDashImplicitWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.forEachRight + */ + forEachRight( + iteratee: ListIterator + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.forEachRight + */ + forEachRight( + iteratee?: ListIterator|DictionaryIterator + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.forEachRight + */ + forEachRight( + iteratee: ListIterator + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.forEachRight + */ + forEachRight( + iteratee: ListIterator + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.forEachRight + */ + forEachRight( + iteratee?: ListIterator|DictionaryIterator + ): LoDashExplicitObjectWrapper; + } + + //_.groupBy + interface LoDashStatic { + /** + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is an array of the elements responsible for generating the + * key. The iteratee is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the composed aggregate object. + */ + groupBy( + collection: List, + iteratee?: ListIterator + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: List, + iteratee?: ListIterator + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: Dictionary, + iteratee?: DictionaryIterator + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: Dictionary, + iteratee?: DictionaryIterator + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: List|Dictionary, + iteratee?: string + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: List|Dictionary, + iteratee?: string + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: List|Dictionary, + iteratee?: TWhere + ): Dictionary; + + /** + * @see _.groupBy + */ + groupBy( + collection: List|Dictionary, + iteratee?: Object + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: string + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: TWhere + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator|DictionaryIterator + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator|DictionaryIterator + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: string + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: string + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: TWhere + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: Object + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: string + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: TWhere + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator|DictionaryIterator + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: ListIterator|DictionaryIterator + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: string + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: string + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: TWhere + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.groupBy + */ + groupBy( + iteratee?: Object + ): LoDashExplicitObjectWrapper>; + } + + //_.includes + interface LoDashStatic { + /** + * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, + * it’s used as the offset from the end of collection. + * + * @param collection The collection to search. + * @param target The value to search for. + * @param fromIndex The index to search from. + * @return True if the target element is found, else false. + */ + includes( + collection: List|Dictionary, + target: T, + fromIndex?: number + ): boolean; + + /** + * @see _.includes + */ + includes( + collection: string, + target: string, + fromIndex?: number + ): boolean; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.includes + */ + includes( + target: T, + fromIndex?: number + ): boolean; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.includes + */ + includes( + target: TValue, + fromIndex?: number + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.includes + */ + includes( + target: string, + fromIndex?: number + ): boolean; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.includes + */ + includes( + target: T, + fromIndex?: number + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.includes + */ + includes( + target: TValue, + fromIndex?: number + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.includes + */ + includes( + target: string, + fromIndex?: number + ): LoDashExplicitWrapper; + } + + //_.keyBy + interface LoDashStatic { + /** + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is the last element responsible for generating the key. The + * iteratee function is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the composed aggregate object. + */ + keyBy( + collection: List, + iteratee?: ListIterator + ): Dictionary; + + /** + * @see _.keyBy + */ + keyBy( + collection: NumericDictionary, + iteratee?: NumericDictionaryIterator + ): Dictionary; + + /** + * @see _.keyBy + */ + keyBy( + collection: Dictionary, + iteratee?: DictionaryIterator + ): Dictionary; + + /** + * @see _.keyBy + */ + keyBy( + collection: List|NumericDictionary|Dictionary, + iteratee?: string + ): Dictionary; + + /** + * @see _.keyBy + */ + keyBy( + collection: List|NumericDictionary|Dictionary, + iteratee?: W + ): Dictionary; + + /** + * @see _.keyBy + */ + keyBy( + collection: List|NumericDictionary|Dictionary, + iteratee?: Object + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.keyBy + */ + keyBy( + iteratee?: ListIterator + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.keyBy + */ + keyBy( + iteratee?: ListIterator + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + iteratee?: string + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + iteratee?: W + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.keyBy + */ + keyBy( + iteratee?: ListIterator|NumericDictionaryIterator|DictionaryIterator + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + iteratee?: string + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + iteratee?: W + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + iteratee?: Object + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.keyBy + */ + keyBy( + iteratee?: ListIterator + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.keyBy + */ + keyBy( + iteratee?: ListIterator + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + iteratee?: string + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + iteratee?: W + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.keyBy + */ + keyBy( + iteratee?: ListIterator|NumericDictionaryIterator|DictionaryIterator + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + iteratee?: string + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + iteratee?: W + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.keyBy + */ + keyBy( + iteratee?: Object + ): LoDashExplicitObjectWrapper>; + } + + //_.invoke + interface LoDashStatic { + /** + * Invokes the method at path of object. + * @param object The object to query. + * @param path The path of the method to invoke. + * @param args The arguments to invoke the method with. + **/ + invoke( + object: TObject, + path: StringRepresentable|StringRepresentable[], + ...args: any[]): TResult; + + /** + * @see _.invoke + **/ + invoke( + object: Dictionary|TValue[], + path: StringRepresentable|StringRepresentable[], + ...args: any[]): TResult; + + /** + * @see _.invoke + **/ + invoke( + object: any, + path: StringRepresentable|StringRepresentable[], + ...args: any[]): TResult; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.invoke + **/ + invoke( + path: StringRepresentable|StringRepresentable[], + ...args: any[]): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.invoke + **/ + invoke( + path: StringRepresentable|StringRepresentable[], + ...args: any[]): TResult; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.invoke + **/ + invoke( + path: StringRepresentable|StringRepresentable[], + ...args: any[]): TResult; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.invoke + **/ + invoke( + path: StringRepresentable|StringRepresentable[], + ...args: any[]): TResult; + } + + //_.invokeMap + interface LoDashStatic { + /** + * Invokes the method named by methodName on each element in the collection returning + * an array of the results of each invoked method. Additional arguments will be provided + * to each invoked method. If methodName is a function it will be invoked for, and this + * bound to, each element in the collection. + * @param collection The collection to iterate over. + * @param methodName The name of the method to invoke. + * @param args Arguments to invoke the method with. + **/ + invokeMap( + collection: TValue[], + methodName: string, + ...args: any[]): TResult[]; + + /** + * @see _.invokeMap + **/ + invokeMap( + collection: Dictionary, + methodName: string, + ...args: any[]): TResult[]; + + /** + * @see _.invokeMap + **/ + invokeMap( + collection: {}[], + methodName: string, + ...args: any[]): TResult[]; + + /** + * @see _.invokeMap + **/ + invokeMap( + collection: Dictionary<{}>, + methodName: string, + ...args: any[]): TResult[]; + + /** + * @see _.invokeMap + **/ + invokeMap( + collection: TValue[], + method: (...args: any[]) => TResult, + ...args: any[]): TResult[]; + + /** + * @see _.invokeMap + **/ + invokeMap( + collection: Dictionary, + method: (...args: any[]) => TResult, + ...args: any[]): TResult[]; + + /** + * @see _.invokeMap + **/ + invokeMap( + collection: {}[], + method: (...args: any[]) => TResult, + ...args: any[]): TResult[]; + + /** + * @see _.invokeMap + **/ + invokeMap( + collection: Dictionary<{}>, + method: (...args: any[]) => TResult, + ...args: any[]): TResult[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.invokeMap + **/ + invokeMap( + methodName: string, + ...args: any[]): LoDashImplicitArrayWrapper; + + /** + * @see _.invokeMap + **/ + invokeMap( + method: (...args: any[]) => TResult, + ...args: any[]): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.invokeMap + **/ + invokeMap( + methodName: string, + ...args: any[]): LoDashImplicitArrayWrapper; + + /** + * @see _.invokeMap + **/ + invokeMap( + method: (...args: any[]) => TResult, + ...args: any[]): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.invokeMap + **/ + invokeMap( + methodName: string, + ...args: any[]): LoDashExplicitArrayWrapper; + + /** + * @see _.invokeMap + **/ + invokeMap( + method: (...args: any[]) => TResult, + ...args: any[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.invokeMap + **/ + invokeMap( + methodName: string, + ...args: any[]): LoDashExplicitArrayWrapper; + + /** + * @see _.invokeMap + **/ + invokeMap( + method: (...args: any[]) => TResult, + ...args: any[]): LoDashExplicitArrayWrapper; + } + + //_.map + interface LoDashStatic { + /** + * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to + * thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property value + * of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, + * _.reject, and _.some. + * + * The guarded methods are: + * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, + * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, + * sample, some, sum, uniq, and words + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the new mapped array. + */ + map( + collection: List, + iteratee?: ListIterator + ): TResult[]; + + /** + * @see _.map + */ + map( + collection: Dictionary, + iteratee?: DictionaryIterator + ): TResult[]; + + map( + collection: NumericDictionary, + iteratee?: NumericDictionaryIterator + ): TResult[]; + + /** + * @see _.map + */ + map( + collection: List|Dictionary|NumericDictionary, + iteratee?: string + ): TResult[]; + + /** + * @see _.map + */ + map( + collection: List|Dictionary|NumericDictionary, + iteratee?: TObject + ): boolean[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.map + */ + map( + iteratee?: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.map + */ + map( + iteratee?: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.map + */ + map( + iteratee?: TObject + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.map + */ + map( + iteratee?: ListIterator|DictionaryIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.map + */ + map( + iteratee?: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.map + */ + map( + iteratee?: TObject + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.map + */ + map( + iteratee?: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.map + */ + map( + iteratee?: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.map + */ + map( + iteratee?: TObject + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.map + */ + map( + iteratee?: ListIterator|DictionaryIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.map + */ + map( + iteratee?: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.map + */ + map( + iteratee?: TObject + ): LoDashExplicitArrayWrapper; + } + + //_.partition + interface LoDashStatic { + /** + * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, + * while the second of which contains elements predicate returns falsey for. + * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for predicate the created _.property style callback + * returns the property value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback + * returns true for elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns + * true for elements that have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param callback The function called per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the array of grouped elements. + **/ + partition( + collection: List, + callback: ListIterator): T[][]; + + /** + * @see _.partition + **/ + partition( + collection: Dictionary, + callback: DictionaryIterator): T[][]; + + /** + * @see _.partition + **/ + partition( + collection: List, + whereValue: W): T[][]; + + /** + * @see _.partition + **/ + partition( + collection: Dictionary, + whereValue: W): T[][]; + + /** + * @see _.partition + **/ + partition( + collection: List, + path: string, + srcValue: any): T[][]; + + /** + * @see _.partition + **/ + partition( + collection: Dictionary, + path: string, + srcValue: any): T[][]; + + /** + * @see _.partition + **/ + partition( + collection: List, + pluckValue: string): T[][]; + + /** + * @see _.partition + **/ + partition( + collection: Dictionary, + pluckValue: string): T[][]; + } + + interface LoDashImplicitStringWrapper { + /** + * @see _.partition + */ + partition( + callback: ListIterator): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.partition + */ + partition( + callback: ListIterator): LoDashImplicitArrayWrapper; + /** + * @see _.partition + */ + partition( + whereValue: W): LoDashImplicitArrayWrapper; + /** + * @see _.partition + */ + partition( + path: string, + srcValue: any): LoDashImplicitArrayWrapper; + /** + * @see _.partition + */ + partition( + pluckValue: string): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.partition + */ + partition( + callback: ListIterator): LoDashImplicitArrayWrapper; + + /** + * @see _.partition + */ + partition( + callback: DictionaryIterator): LoDashImplicitArrayWrapper; + + /** + * @see _.partition + */ + partition( + whereValue: W): LoDashImplicitArrayWrapper; + + /** + * @see _.partition + */ + partition( + path: string, + srcValue: any): LoDashImplicitArrayWrapper; + + /** + * @see _.partition + */ + partition( + pluckValue: string): LoDashImplicitArrayWrapper; + } + + //_.reduce + interface LoDashStatic { + /** + * Reduces a collection to a value which is the accumulated result of running each + * element in the collection through the callback, where each successive callback execution + * consumes the return value of the previous execution. If accumulator is not provided the + * first element of the collection will be used as the initial accumulator value. The callback + * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). + * @param collection The collection to iterate over. + * @param callback The function called per iteration. + * @param accumulator Initial value of the accumulator. + * @param thisArg The this binding of callback. + * @return Returns the accumulated value. + **/ + reduce( + collection: Array, + callback: MemoIterator, + accumulator: TResult): TResult; + + /** + * @see _.reduce + **/ + reduce( + collection: List, + callback: MemoIterator, + accumulator: TResult): TResult; + + /** + * @see _.reduce + **/ + reduce( + collection: Dictionary, + callback: MemoIterator, + accumulator: TResult): TResult; + + /** + * @see _.reduce + **/ + reduce( + collection: NumericDictionary, + callback: MemoIterator, + accumulator: TResult): TResult; + + /** + * @see _.reduce + **/ + reduce( + collection: Array, + callback: MemoIterator): TResult; + + /** + * @see _.reduce + **/ + reduce( + collection: List, + callback: MemoIterator): TResult; + + /** + * @see _.reduce + **/ + reduce( + collection: Dictionary, + callback: MemoIterator): TResult; + + /** + * @see _.reduce + **/ + reduce( + collection: NumericDictionary, + callback: MemoIterator): TResult; + + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.reduce + **/ + reduce( + callback: MemoIterator, + accumulator: TResult): TResult; + + /** + * @see _.reduce + **/ + reduce( + callback: MemoIterator): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.reduce + **/ + reduce( + callback: MemoIterator, + accumulator: TResult): TResult; + + /** + * @see _.reduce + **/ + reduce( + callback: MemoIterator): TResult; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.reduce + **/ + reduce( + callback: MemoIterator, + accumulator: TResult): LoDashExplicitObjectWrapper; + + /** + * @see _.reduce + **/ + reduce( + callback: MemoIterator): LoDashExplicitObjectWrapper; + } + + interface LoDashExplicitArrayWrapper { + /**LoDashExplicitWrapper + * @see _.reduce + */ + reduce( + callback: MemoIterator, + accumulator: TResult): LoDashExplicitWrapper; + + /** + * @see _.reduce + */ + reduce( + callback: MemoIterator): LoDashExplicitWrapper; + } + + //_.reduceRight + interface LoDashStatic { + /** + * This method is like _.reduce except that it iterates over elements of a collection from + * right to left. + * @param collection The collection to iterate over. + * @param callback The function called per iteration. + * @param accumulator Initial value of the accumulator. + * @param thisArg The this binding of callback. + * @return The accumulated value. + **/ + reduceRight( + collection: Array, + callback: MemoIterator, + accumulator: TResult): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: List, + callback: MemoIterator, + accumulator: TResult): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: Dictionary, + callback: MemoIterator, + accumulator: TResult): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: Array, + callback: MemoIterator): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: List, + callback: MemoIterator): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight( + collection: Dictionary, + callback: MemoIterator): TResult; + } + + //_.reject + interface LoDashStatic { + /** + * The opposite of _.filter; this method returns the elements of collection that predicate does not return + * truthy for. + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the new filtered array. + */ + reject( + collection: List, + predicate?: ListIterator + ): T[]; + + /** + * @see _.reject + */ + reject( + collection: Dictionary, + predicate?: DictionaryIterator + ): T[]; + + /** + * @see _.reject + */ + reject( + collection: string, + predicate?: StringIterator + ): string[]; + + /** + * @see _.reject + */ + reject( + collection: List|Dictionary, + predicate: string + ): T[]; + + /** + * @see _.reject + */ + reject( + collection: List|Dictionary, + predicate: W + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.reject + */ + reject( + predicate?: StringIterator + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.reject + */ + reject( + predicate: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.reject + */ + reject( + predicate: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.reject + */ + reject(predicate: W): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.reject + */ + reject( + predicate: ListIterator|DictionaryIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.reject + */ + reject( + predicate: string + ): LoDashImplicitArrayWrapper; + + /** + * @see _.reject + */ + reject(predicate: W): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.reject + */ + reject( + predicate?: StringIterator + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.reject + */ + reject( + predicate: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.reject + */ + reject( + predicate: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.reject + */ + reject(predicate: W): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.reject + */ + reject( + predicate: ListIterator|DictionaryIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.reject + */ + reject( + predicate: string + ): LoDashExplicitArrayWrapper; + + /** + * @see _.reject + */ + reject(predicate: W): LoDashExplicitArrayWrapper; + } + + //_.sample + interface LoDashStatic { + /** + * Gets a random element from collection. + * + * @param collection The collection to sample. + * @return Returns the random element. + */ + sample( + collection: List|Dictionary|NumericDictionary + ): T; + + /** + * @see _.sample + */ + sample( + collection: O + ): T; + + /** + * @see _.sample + */ + sample( + collection: Object + ): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sample + */ + sample(): string; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.sample + */ + sample(): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.sample + */ + sample(): T; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sample + */ + sample(): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sample + */ + sample(): TWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sample + */ + sample(): TWrapper; + } + + //_.sampleSize + interface LoDashStatic { + /** + * Gets n random elements at unique keys from collection up to the size of collection. + * + * @param collection The collection to sample. + * @param n The number of elements to sample. + * @return Returns the random elements. + */ + sampleSize( + collection: List|Dictionary|NumericDictionary, + n?: number + ): T[]; + + /** + * @see _.sampleSize + */ + sampleSize( + collection: O, + n?: number + ): T[]; + + /** + * @see _.sampleSize + */ + sampleSize( + collection: Object, + n?: number + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.sampleSize + */ + sampleSize( + n?: number + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.sampleSize + */ + sampleSize( + n?: number + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.sampleSize + */ + sampleSize( + n?: number + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.sampleSize + */ + sampleSize( + n?: number + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sampleSize + */ + sampleSize( + n?: number + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sampleSize + */ + sampleSize( + n?: number + ): LoDashExplicitArrayWrapper; + } + + //_.shuffle + interface LoDashStatic { + /** + * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. + * + * @param collection The collection to shuffle. + * @return Returns the new shuffled array. + */ + shuffle(collection: List|Dictionary): T[]; + + /** + * @see _.shuffle + */ + shuffle(collection: string): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.shuffle + */ + shuffle(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.shuffle + */ + shuffle(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.shuffle + */ + shuffle(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.shuffle + */ + shuffle(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.shuffle + */ + shuffle(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.shuffle + */ + shuffle(): LoDashExplicitArrayWrapper; + } + + //_.size + interface LoDashStatic { + /** + * Gets the size of collection by returning its length for array-like values or the number of own enumerable + * properties for objects. + * + * @param collection The collection to inspect. + * @return Returns the size of collection. + */ + size(collection: List|Dictionary): number; + + /** + * @see _.size + */ + size(collection: string): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.size + */ + size(): number; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.size + */ + size(): number; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.size + */ + size(): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.size + */ + size(): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.size + */ + size(): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.size + */ + size(): LoDashExplicitWrapper; + } + + //_.some + interface LoDashStatic { + /** + * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate + * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @return Returns true if any element passes the predicate check, else false. + */ + some( + collection: List, + predicate?: ListIterator + ): boolean; + + /** + * @see _.some + */ + some( + collection: Dictionary, + predicate?: DictionaryIterator + ): boolean; + + /** + * @see _.some + */ + some( + collection: NumericDictionary, + predicate?: NumericDictionaryIterator + ): boolean; + + /** + * @see _.some + */ + some( + collection: Object, + predicate?: ObjectIterator + ): boolean; + + /** + * @see _.some + */ + some( + collection: List|Dictionary|NumericDictionary, + predicate?: string|[string, any] + ): boolean; + + + /** + * @see _.some + */ + some( + collection: Object, + predicate?: string|[string, any] + ): boolean; + + /** + * @see _.some + */ + some( + collection: List|Dictionary|NumericDictionary, + predicate?: TObject + ): boolean; + + /** + * @see _.some + */ + some( + collection: List|Dictionary|NumericDictionary, + predicate?: Object + ): boolean; + + /** + * @see _.some + */ + some( + collection: Object, + predicate?: TObject + ): boolean; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.some + */ + some( + predicate?: ListIterator|NumericDictionaryIterator + ): boolean; + + /** + * @see _.some + */ + some( + predicate?: string|[string, any] + ): boolean; + + /** + * @see _.some + */ + some( + predicate?: TObject + ): boolean; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.some + */ + some( + predicate?: ListIterator|DictionaryIterator|NumericDictionaryIterator|ObjectIterator + ): boolean; + + /** + * @see _.some + */ + some( + predicate?: string|[string, any] + ): boolean; + + /** + * @see _.some + */ + some( + predicate?: TObject + ): boolean; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.some + */ + some( + predicate?: ListIterator|NumericDictionaryIterator + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + some( + predicate?: string|[string, any] + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + some( + predicate?: TObject + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.some + */ + some( + predicate?: ListIterator|DictionaryIterator|NumericDictionaryIterator|ObjectIterator + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + some( + predicate?: string|[string, any] + ): LoDashExplicitWrapper; + + /** + * @see _.some + */ + some( + predicate?: TObject + ): LoDashExplicitWrapper; + } + + //_.sortBy + interface LoDashStatic { + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection through each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[]|Object|Object[]|string|string[])} [iteratees=[_.identity]] + * The iteratees to sort by, specified individually or in arrays. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 42 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, function(o) { return o.user; }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] + * + * _.sortBy(users, 'user', function(o) { + * return Math.floor(o.age / 10); + * }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + */ + sortBy( + collection: List, + iteratee?: ListIterator + ): T[]; + + /** + * @see _.sortBy + */ + sortBy( + collection: Dictionary, + iteratee?: DictionaryIterator + ): T[]; + + /** + * @see _.sortBy + */ + sortBy( + collection: List|Dictionary, + iteratee: string + ): T[]; + + /** + * @see _.sortBy + */ + sortBy( + collection: List|Dictionary, + whereValue: W + ): T[]; + + /** + * @see _.sortBy + */ + sortBy( + collection: List|Dictionary + ): T[]; + + /** + * @see _.sortBy + */ + sortBy( + collection: (Array|List), + iteratees: (ListIterator|string|Object)[]): T[]; + + /** + * @see _.sortBy + */ + sortBy( + collection: (Array|List), + ...iteratees: (ListIterator|Object|string)[]): T[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.sortBy + */ + sortBy( + iteratee?: ListIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortBy + */ + sortBy(iteratee: string): LoDashImplicitArrayWrapper; + + /** + * @see _.sortBy + */ + sortBy(whereValue: W): LoDashImplicitArrayWrapper; + + /** + * @see _.sortBy + */ + sortBy(): LoDashImplicitArrayWrapper; + + /** + * @see _.sortBy + */ + sortBy(...iteratees: (ListIterator|Object|string)[]): LoDashImplicitArrayWrapper; + + /** + * @see _.sortBy + **/ + sortBy(iteratees: (ListIterator|string|Object)[]): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.sortBy + */ + sortBy( + iteratee?: ListIterator|DictionaryIterator + ): LoDashImplicitArrayWrapper; + + /** + * @see _.sortBy + */ + sortBy(iteratee: string): LoDashImplicitArrayWrapper; + + /** + * @see _.sortBy + */ + sortBy(whereValue: W): LoDashImplicitArrayWrapper; + + /** + * @see _.sortBy + */ + sortBy(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sortBy + */ + sortBy( + iteratee?: ListIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.sortBy + */ + sortBy(iteratee: string): LoDashExplicitArrayWrapper; + + /** + * @see _.sortBy + */ + sortBy(whereValue: W): LoDashExplicitArrayWrapper; + + /** + * @see _.sortBy + */ + sortBy(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sortBy + */ + sortBy( + iteratee?: ListIterator|DictionaryIterator + ): LoDashExplicitArrayWrapper; + + /** + * @see _.sortBy + */ + sortBy(iteratee: string): LoDashExplicitArrayWrapper; + + /** + * @see _.sortBy + */ + sortBy(whereValue: W): LoDashExplicitArrayWrapper; + + /** + * @see _.sortBy + */ + sortBy(): LoDashExplicitArrayWrapper; + } + + //_.orderBy + interface LoDashStatic { + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} [iteratees=[_.identity]] The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 42 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // sort by `user` in ascending order and by `age` in descending order + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + */ + orderBy( + collection: List, + iteratees: ListIterator|string|W|(ListIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; + + /** + * @see _.orderBy + */ + orderBy( + collection: List, + iteratees: ListIterator|string|Object|(ListIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; + + /** + * @see _.orderBy + */ + orderBy( + collection: NumericDictionary, + iteratees: NumericDictionaryIterator|string|W|(NumericDictionaryIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; + + /** + * @see _.orderBy + */ + orderBy( + collection: NumericDictionary, + iteratees: NumericDictionaryIterator|string|Object|(NumericDictionaryIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; + + /** + * @see _.orderBy + */ + orderBy( + collection: Dictionary, + iteratees: DictionaryIterator|string|W|(DictionaryIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; + + /** + * @see _.orderBy + */ + orderBy( + collection: Dictionary, + iteratees: DictionaryIterator|string|Object|(DictionaryIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.orderBy + */ + orderBy( + iteratees: ListIterator|string|(ListIterator|string)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.orderBy + */ + orderBy( + iteratees: ListIterator|string|W|(ListIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.orderBy + */ + orderBy( + iteratees: ListIterator|string|W|(ListIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; + + /** + * @see _.orderBy + */ + orderBy( + iteratees: ListIterator|string|Object|(ListIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; + + /** + * @see _.orderBy + */ + orderBy( + iteratees: NumericDictionaryIterator|string|W|(NumericDictionaryIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; + + /** + * @see _.orderBy + */ + orderBy( + iteratees: NumericDictionaryIterator|string|Object|(NumericDictionaryIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; + + /** + * @see _.orderBy + */ + orderBy( + iteratees: DictionaryIterator|string|W|(DictionaryIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; + + /** + * @see _.orderBy + */ + orderBy( + iteratees: DictionaryIterator|string|Object|(DictionaryIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.orderBy + */ + orderBy( + iteratees: ListIterator|string|(ListIterator|string)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.orderBy + */ + orderBy( + iteratees: ListIterator|string|W|(ListIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.orderBy + */ + orderBy( + iteratees: ListIterator|string|W|(ListIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; + + /** + * @see _.orderBy + */ + orderBy( + iteratees: ListIterator|string|Object|(ListIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; + + /** + * @see _.orderBy + */ + orderBy( + iteratees: NumericDictionaryIterator|string|W|(NumericDictionaryIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; + + /** + * @see _.orderBy + */ + orderBy( + iteratees: NumericDictionaryIterator|string|Object|(NumericDictionaryIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; + + /** + * @see _.orderBy + */ + orderBy( + iteratees: DictionaryIterator|string|W|(DictionaryIterator|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; + + /** + * @see _.orderBy + */ + orderBy( + iteratees: DictionaryIterator|string|Object|(DictionaryIterator|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper; + } + + /******** + * Date * + ********/ + + //_.now + interface LoDashStatic { + /** + * Gets the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @return The number of milliseconds. + */ + now(): number; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.now + */ + now(): number; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.now + */ + now(): LoDashExplicitWrapper; + } + + /************* + * Functions * + *************/ + + //_.after + interface LoDashStatic { + /** + * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. + * + * @param n The number of calls before func is invoked. + * @param func The function to restrict. + * @return Returns the new restricted function. + */ + after( + n: number, + func: TFunc + ): TFunc; + } + + interface LoDashImplicitWrapper { + /** + * @see _.after + **/ + after(func: TFunc): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.after + **/ + after(func: TFunc): LoDashExplicitObjectWrapper; + } + + //_.ary + interface LoDashStatic { + /** + * Creates a function that accepts up to n arguments ignoring any additional arguments. + * + * @param func The function to cap arguments for. + * @param n The arity cap. + * @returns Returns the new function. + */ + ary( + func: Function, + n?: number + ): TResult; + + ary( + func: T, + n?: number + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.ary + */ + ary(n?: number): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.ary + */ + ary(n?: number): LoDashExplicitObjectWrapper; + } + + //_.before + interface LoDashStatic { + /** + * Creates a function that invokes func, with the this binding and arguments of the created function, while + * it’s called less than n times. Subsequent calls to the created function return the result of the last func + * invocation. + * + * @param n The number of calls at which func is no longer invoked. + * @param func The function to restrict. + * @return Returns the new restricted function. + */ + before( + n: number, + func: TFunc + ): TFunc; + } + + interface LoDashImplicitWrapper { + /** + * @see _.before + **/ + before(func: TFunc): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.before + **/ + before(func: TFunc): LoDashExplicitObjectWrapper; + } + + //_.bind + interface FunctionBind { + placeholder: any; + + ( + func: T, + thisArg: any, + ...partials: any[] + ): TResult; + + ( + func: Function, + thisArg: any, + ...partials: any[] + ): TResult; + } + + interface LoDashStatic { + /** + * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind + * arguments to those provided to the bound function. + * + * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for + * partially applied arguments. + * + * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. + * + * @param func The function to bind. + * @param thisArg The this binding of func. + * @param partials The arguments to be partially applied. + * @return Returns the new bound function. + */ + bind: FunctionBind; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.bind + */ + bind( + thisArg: any, + ...partials: any[] + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.bind + */ + bind( + thisArg: any, + ...partials: any[] + ): LoDashExplicitObjectWrapper; + } + + //_.bindAll + interface LoDashStatic { + /** + * Binds methods of an object to the object itself, overwriting the existing method. Method names may be + * specified as individual arguments or as arrays of method names. If no method names are provided all + * enumerable function properties, own and inherited, of object are bound. + * + * Note: This method does not set the "length" property of bound functions. + * + * @param object The object to bind and assign the bound methods to. + * @param methodNames The object method names to bind, specified as individual method names or arrays of + * method names. + * @return Returns object. + */ + bindAll( + object: T, + ...methodNames: (string|string[])[] + ): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.bindAll + */ + bindAll(...methodNames: (string|string[])[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.bindAll + */ + bindAll(...methodNames: (string|string[])[]): LoDashExplicitObjectWrapper; + } + + //_.bindKey + interface FunctionBindKey { + placeholder: any; + + ( + object: T, + key: any, + ...partials: any[] + ): TResult; + + ( + object: Object, + key: any, + ...partials: any[] + ): TResult; + } + + interface LoDashStatic { + /** + * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments + * to those provided to the bound function. + * + * This method differs from _.bind by allowing bound functions to reference methods that may be redefined + * or don’t yet exist. See Peter Michaux’s article for more details. + * + * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder + * for partially applied arguments. + * + * @param object The object the method belongs to. + * @param key The key of the method. + * @param partials The arguments to be partially applied. + * @return Returns the new bound function. + */ + bindKey: FunctionBindKey; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.bindKey + */ + bindKey( + key: any, + ...partials: any[] + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.bindKey + */ + bindKey( + key: any, + ...partials: any[] + ): LoDashExplicitObjectWrapper; + } + + //_.createCallback + interface LoDashStatic { + /** + * Produces a callback bound to an optional thisArg. If func is a property name the created + * callback will return the property value for a given element. If func is an object the created + * callback will return true for elements that contain the equivalent object properties, + * otherwise it will return false. + * @param func The value to convert to a callback. + * @param thisArg The this binding of the created callback. + * @param argCount The number of arguments the callback accepts. + * @return A callback function. + **/ + createCallback( + func: string, + argCount?: number): () => any; + + /** + * @see _.createCallback + **/ + createCallback( + func: Dictionary, + argCount?: number): () => boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.createCallback + **/ + createCallback( + argCount?: number): LoDashImplicitObjectWrapper<() => any>; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.createCallback + **/ + createCallback( + argCount?: number): LoDashImplicitObjectWrapper<() => any>; + } + + //_.curry + interface LoDashStatic { + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curry(func: (t1: T1) => R): + CurriedFunction1; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curry(func: (t1: T1, t2: T2) => R): + CurriedFunction2; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curry(func: (t1: T1, t2: T2, t3: T3) => R): + CurriedFunction3; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curry(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): + CurriedFunction4; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curry(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): + CurriedFunction5; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curry( + func: Function, + arity?: number): TResult; + } + + interface CurriedFunction1 { + (): CurriedFunction1; + (t1: T1): R; + } + + interface CurriedFunction2 { + (): CurriedFunction2; + (t1: T1): CurriedFunction1; + (t1: T1, t2: T2): R; + } + + interface CurriedFunction3 { + (): CurriedFunction3; + (t1: T1): CurriedFunction2; + (t1: T1, t2: T2): CurriedFunction1; + (t1: T1, t2: T2, t3: T3): R; + } + + interface CurriedFunction4 { + (): CurriedFunction4; + (t1: T1): CurriedFunction3; + (t1: T1, t2: T2): CurriedFunction2; + (t1: T1, t2: T2, t3: T3): CurriedFunction1; + (t1: T1, t2: T2, t3: T3, t4: T4): R; + } + + interface CurriedFunction5 { + (): CurriedFunction5; + (t1: T1): CurriedFunction4; + (t1: T1, t2: T2): CurriedFunction3; + (t1: T1, t2: T2, t3: T3): CurriedFunction2; + (t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1; + (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.curry + **/ + curry(arity?: number): LoDashImplicitObjectWrapper; + } + + //_.curryRight + interface LoDashStatic { + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curryRight(func: (t1: T1) => R): + CurriedFunction1; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curryRight(func: (t1: T1, t2: T2) => R): + CurriedFunction2; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curryRight(func: (t1: T1, t2: T2, t3: T3) => R): + CurriedFunction3; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): + CurriedFunction4; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): + CurriedFunction5; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curryRight( + func: Function, + arity?: number): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.curryRight + **/ + curryRight(arity?: number): LoDashImplicitObjectWrapper; + } + + //_.debounce + interface DebounceSettings { + /** + * Specify invoking on the leading edge of the timeout. + */ + leading?: boolean; + + /** + * The maximum time func is allowed to be delayed before it’s invoked. + */ + maxWait?: number; + + /** + * Specify invoking on the trailing edge of the timeout. + */ + trailing?: boolean; + } + + interface LoDashStatic { + /** + * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since + * the last time the debounced function was invoked. The debounced function comes with a cancel method to + * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to + * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent + * calls to the debounced function return the result of the last func invocation. + * + * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only + * if the the debounced function is invoked more than once during the wait timeout. + * + * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. + * + * @param func The function to debounce. + * @param wait The number of milliseconds to delay. + * @param options The options object. + * @param options.leading Specify invoking on the leading edge of the timeout. + * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. + * @param options.trailing Specify invoking on the trailing edge of the timeout. + * @return Returns the new debounced function. + */ + debounce( + func: T, + wait?: number, + options?: DebounceSettings + ): T & Cancelable; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.debounce + */ + debounce( + wait?: number, + options?: DebounceSettings + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.debounce + */ + debounce( + wait?: number, + options?: DebounceSettings + ): LoDashExplicitObjectWrapper; + } + + //_.defer + interface LoDashStatic { + /** + * Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to + * func when it’s invoked. + * + * @param func The function to defer. + * @param args The arguments to invoke the function with. + * @return Returns the timer id. + */ + defer( + func: T, + ...args: any[] + ): number; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.defer + */ + defer(...args: any[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.defer + */ + defer(...args: any[]): LoDashExplicitWrapper; + } + + //_.delay + interface LoDashStatic { + /** + * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. + * + * @param func The function to delay. + * @param wait The number of milliseconds to delay invocation. + * @param args The arguments to invoke the function with. + * @return Returns the timer id. + */ + delay( + func: T, + wait: number, + ...args: any[] + ): number; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.delay + */ + delay( + wait: number, + ...args: any[] + ): LoDashImplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.delay + */ + delay( + wait: number, + ...args: any[] + ): LoDashExplicitWrapper; + } + + interface LoDashStatic { + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + flip(func: T): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.flip + */ + flip(): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.flip + */ + flip(): LoDashExplicitObjectWrapper; + } + + //_.flow + interface LoDashStatic { + /** + * Creates a function that returns the result of invoking the provided functions with the this binding of the + * created function, where each successive invocation is supplied the return value of the previous. + * + * @param funcs Functions to invoke. + * @return Returns the new function. + */ + // 1-argument first function + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2): (a1: A1) => R2; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1) => R3; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1) => R4; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1) => R5; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1) => R6; + flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1) => R7; + // 2-argument first function + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2) => R2; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2) => R3; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2) => R4; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2) => R5; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2) => R6; + flow(f1: (a1: A1, a2: A2) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2) => R7; + // 3-argument first function + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3) => R2; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3) => R3; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3) => R4; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3) => R5; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3) => R6; + flow(f1: (a1: A1, a2: A2, a3: A3) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3) => R7; + // 4-argument first function + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2): (a1: A1, a2: A2, a3: A3, a4: A4) => R2; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1, a2: A2, a3: A3, a4: A4) => R3; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (a1: A1, a2: A2, a3: A3, a4: A4) => R4; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (a1: A1, a2: A2, a3: A3, a4: A4) => R5; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (a1: A1, a2: A2, a3: A3, a4: A4) => R6; + flow(f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (a1: A1, a2: A2, a3: A3, a4: A4) => R7; + // generic function + flow(...funcs: Function[]): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.flow + */ + flow(...funcs: Function[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.flow + */ + flow(...funcs: Function[]): LoDashExplicitObjectWrapper; + } + + //_.flowRight + interface LoDashStatic { + /** + * This method is like _.flow except that it creates a function that invokes the provided functions from right + * to left. + * + * @param funcs Functions to invoke. + * @return Returns the new function. + */ + flowRight(...funcs: Function[]): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.flowRight + */ + flowRight(...funcs: Function[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.flowRight + */ + flowRight(...funcs: Function[]): LoDashExplicitObjectWrapper; + } + + + //_.memoize + interface MemoizedFunction extends Function { + cache: MapCache; + } + + interface LoDashStatic { + /** + * Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for + * storing the result based on the arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with + * the this binding of the memoized function. + * + * @param func The function to have its output memoized. + * @param resolver The function to resolve the cache key. + * @return Returns the new memoizing function. + */ + memoize: { + (func: T, resolver?: Function): T & MemoizedFunction; + Cache: MapCacheConstructor; + } + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.memoize + */ + memoize(resolver?: Function): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.memoize + */ + memoize(resolver?: Function): LoDashExplicitObjectWrapper; + } + + //_.overArgs (was _.modArgs) + interface LoDashStatic { + /** + * Creates a function that runs each argument through a corresponding transform function. + * + * @param func The function to wrap. + * @param transforms The functions to transform arguments, specified as individual functions or arrays + * of functions. + * @return Returns the new function. + */ + overArgs( + func: T, + ...transforms: Function[] + ): TResult; + + /** + * @see _.overArgs + */ + overArgs( + func: T, + transforms: Function[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.overArgs + */ + overArgs(...transforms: Function[]): LoDashImplicitObjectWrapper; + + /** + * @see _.overArgs + */ + overArgs(transforms: Function[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.overArgs + */ + overArgs(...transforms: Function[]): LoDashExplicitObjectWrapper; + + /** + * @see _.overArgs + */ + overArgs(transforms: Function[]): LoDashExplicitObjectWrapper; + } + + //_.negate + interface LoDashStatic { + /** + * Creates a function that negates the result of the predicate func. The func predicate is invoked with + * the this binding and arguments of the created function. + * + * @param predicate The predicate to negate. + * @return Returns the new function. + */ + negate(predicate: T): (...args: any[]) => boolean; + + /** + * @see _.negate + */ + negate(predicate: T): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.negate + */ + negate(): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; + + /** + * @see _.negate + */ + negate(): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.negate + */ + negate(): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + + /** + * @see _.negate + */ + negate(): LoDashExplicitObjectWrapper; + } + + //_.once + interface LoDashStatic { + /** + * Creates a function that is restricted to invoking func once. Repeat calls to the function return the value + * of the first call. The func is invoked with the this binding and arguments of the created function. + * + * @param func The function to restrict. + * @return Returns the new restricted function. + */ + once(func: T): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.once + */ + once(): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.once + */ + once(): LoDashExplicitObjectWrapper; + } + + //_.partial + interface LoDashStatic { + /** + * Creates a function that, when called, invokes func with any additional partial arguments + * prepended to those provided to the new function. This method is similar to _.bind except + * it does not alter the this binding. + * @param func The function to partially apply arguments to. + * @param args Arguments to be partially applied. + * @return The new partially applied function. + **/ + partial: Partial; + } + + type PH = LoDashStatic; + + interface Function0 { + (): R; + } + interface Function1 { + (t1: T1): R; + } + interface Function2 { + (t1: T1, t2: T2): R; + } + interface Function3 { + (t1: T1, t2: T2, t3: T3): R; + } + interface Function4 { + (t1: T1, t2: T2, t3: T3, t4: T4): R; + } + + interface Partial { + // arity 0 + (func: Function0): Function0; + // arity 1 + (func: Function1): Function1; + (func: Function1, arg1: T1): Function0; + // arity 2 + (func: Function2): Function2; + (func: Function2, arg1: T1): Function1< T2, R>; + (func: Function2, plc1: PH, arg2: T2): Function1; + (func: Function2, arg1: T1, arg2: T2): Function0< R>; + // arity 3 + (func: Function3): Function3; + (func: Function3, arg1: T1): Function2< T2, T3, R>; + (func: Function3, plc1: PH, arg2: T2): Function2; + (func: Function3, arg1: T1, arg2: T2): Function1< T3, R>; + (func: Function3, plc1: PH, plc2: PH, arg3: T3): Function2; + (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; + (func: Function3, plc1: PH, arg2: T2, arg3: T3): Function1; + (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; + // arity 4 + (func: Function4): Function4; + (func: Function4, arg1: T1): Function3< T2, T3, T4, R>; + (func: Function4, plc1: PH, arg2: T2): Function3; + (func: Function4, arg1: T1, arg2: T2): Function2< T3, T4, R>; + (func: Function4, plc1: PH, plc2: PH, arg3: T3): Function3; + (func: Function4, arg1: T1, plc2: PH, arg3: T3): Function2< T2, T4, R>; + (func: Function4, plc1: PH, arg2: T2, arg3: T3): Function2; + (func: Function4, arg1: T1, arg2: T2, arg3: T3): Function1< T4, R>; + (func: Function4, plc1: PH, plc2: PH, plc3: PH, arg4: T4): Function3; + (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; + (func: Function4, plc1: PH, arg2: T2, plc3: PH, arg4: T4): Function2; + (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; + (func: Function4, plc1: PH, plc2: PH, arg3: T3, arg4: T4): Function2; + (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; + (func: Function4, plc1: PH, arg2: T2, arg3: T3, arg4: T4): Function1; + (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; + // catch-all + (func: Function, ...args: any[]): Function; + } + + //_.partialRight + interface LoDashStatic { + /** + * This method is like _.partial except that partial arguments are appended to those provided + * to the new function. + * @param func The function to partially apply arguments to. + * @param args Arguments to be partially applied. + * @return The new partially applied function. + **/ + partialRight: PartialRight + } + + interface PartialRight { + // arity 0 + (func: Function0): Function0; + // arity 1 + (func: Function1): Function1; + (func: Function1, arg1: T1): Function0; + // arity 2 + (func: Function2): Function2; + (func: Function2, arg1: T1, plc2: PH): Function1< T2, R>; + (func: Function2, arg2: T2): Function1; + (func: Function2, arg1: T1, arg2: T2): Function0< R>; + // arity 3 + (func: Function3): Function3; + (func: Function3, arg1: T1, plc2: PH, plc3: PH): Function2< T2, T3, R>; + (func: Function3, arg2: T2, plc3: PH): Function2; + (func: Function3, arg1: T1, arg2: T2, plc3: PH): Function1< T3, R>; + (func: Function3, arg3: T3): Function2; + (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; + (func: Function3, arg2: T2, arg3: T3): Function1; + (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; + // arity 4 + (func: Function4): Function4; + (func: Function4, arg1: T1, plc2: PH, plc3: PH, plc4: PH): Function3< T2, T3, T4, R>; + (func: Function4, arg2: T2, plc3: PH, plc4: PH): Function3; + (func: Function4, arg1: T1, arg2: T2, plc3: PH, plc4: PH): Function2< T3, T4, R>; + (func: Function4, arg3: T3, plc4: PH): Function3; + (func: Function4, arg1: T1, plc2: PH, arg3: T3, plc4: PH): Function2< T2, T4, R>; + (func: Function4, arg2: T2, arg3: T3, plc4: PH): Function2; + (func: Function4, arg1: T1, arg2: T2, arg3: T3, plc4: PH): Function1< T4, R>; + (func: Function4, arg4: T4): Function3; + (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; + (func: Function4, arg2: T2, plc3: PH, arg4: T4): Function2; + (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; + (func: Function4, arg3: T3, arg4: T4): Function2; + (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; + (func: Function4, arg2: T2, arg3: T3, arg4: T4): Function1; + (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; + // catch-all + (func: Function, ...args: any[]): Function; + } + + //_.rearg + interface LoDashStatic { + /** + * Creates a function that invokes func with arguments arranged according to the specified indexes where the + * argument value at the first index is provided as the first argument, the argument value at the second index + * is provided as the second argument, and so on. + * @param func The function to rearrange arguments for. + * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. + * @return Returns the new function. + */ + rearg(func: Function, indexes: number[]): TResult; + + /** + * @see _.rearg + */ + rearg(func: Function, ...indexes: number[]): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.rearg + */ + rearg(indexes: number[]): LoDashImplicitObjectWrapper; + + /** + * @see _.rearg + */ + rearg(...indexes: number[]): LoDashImplicitObjectWrapper; + } + + //_.rest + interface LoDashStatic { + /** + * Creates a function that invokes func with the this binding of the created function and arguments from start + * and beyond provided as an array. + * + * Note: This method is based on the rest parameter. + * + * @param func The function to apply a rest parameter to. + * @param start The start position of the rest parameter. + * @return Returns the new function. + */ + rest( + func: Function, + start?: number + ): TResult; + + /** + * @see _.rest + */ + rest( + func: TFunc, + start?: number + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.rest + */ + rest(start?: number): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.rest + */ + rest(start?: number): LoDashExplicitObjectWrapper; + } + + //_.spread + interface LoDashStatic { + /** + * Creates a function that invokes func with the this binding of the created function and an array of arguments + * much like Function#apply. + * + * Note: This method is based on the spread operator. + * + * @param func The function to spread arguments over. + * @return Returns the new function. + */ + spread(func: F): T; + + /** + * @see _.spread + */ + spread(func: Function): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.spread + */ + spread(): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.spread + */ + spread(): LoDashExplicitObjectWrapper; + } + + //_.throttle + interface ThrottleSettings { + /** + * If you'd like to disable the leading-edge call, pass this as false. + */ + leading?: boolean; + + /** + * If you'd like to disable the execution on the trailing-edge, pass false. + */ + trailing?: boolean; + } + + interface LoDashStatic { + /** + * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled + * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke + * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge + * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. + * + * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if + * the the throttled function is invoked more than once during the wait timeout. + * + * @param func The function to throttle. + * @param wait The number of milliseconds to throttle invocations to. + * @param options The options object. + * @param options.leading Specify invoking on the leading edge of the timeout. + * @param options.trailing Specify invoking on the trailing edge of the timeout. + * @return Returns the new throttled function. + */ + throttle( + func: T, + wait?: number, + options?: ThrottleSettings + ): T & Cancelable; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.throttle + */ + throttle( + wait?: number, + options?: ThrottleSettings + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.throttle + */ + throttle( + wait?: number, + options?: ThrottleSettings + ): LoDashExplicitObjectWrapper; + } + + //_.unary + interface LoDashStatic { + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + unary(func: T): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.unary + */ + unary(): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.unary + */ + unary(): LoDashExplicitObjectWrapper; + } + + //_.wrap + interface LoDashStatic { + /** + * Creates a function that provides value to the wrapper function as its first argument. Any additional + * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is + * invoked with the this binding of the created function. + * + * @param value The value to wrap. + * @param wrapper The wrapper function. + * @return Returns the new function. + */ + wrap( + value: V, + wrapper: W + ): R; + + /** + * @see _.wrap + */ + wrap( + value: V, + wrapper: Function + ): R; + + /** + * @see _.wrap + */ + wrap( + value: any, + wrapper: Function + ): R; + } + + interface LoDashImplicitWrapper { + /** + * @see _.wrap + */ + wrap(wrapper: W): LoDashImplicitObjectWrapper; + + /** + * @see _.wrap + */ + wrap(wrapper: Function): LoDashImplicitObjectWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.wrap + */ + wrap(wrapper: W): LoDashImplicitObjectWrapper; + + /** + * @see _.wrap + */ + wrap(wrapper: Function): LoDashImplicitObjectWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.wrap + */ + wrap(wrapper: W): LoDashImplicitObjectWrapper; + + /** + * @see _.wrap + */ + wrap(wrapper: Function): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.wrap + */ + wrap(wrapper: W): LoDashExplicitObjectWrapper; + + /** + * @see _.wrap + */ + wrap(wrapper: Function): LoDashExplicitObjectWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.wrap + */ + wrap(wrapper: W): LoDashExplicitObjectWrapper; + + /** + * @see _.wrap + */ + wrap(wrapper: Function): LoDashExplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.wrap + */ + wrap(wrapper: W): LoDashExplicitObjectWrapper; + + /** + * @see _.wrap + */ + wrap(wrapper: Function): LoDashExplicitObjectWrapper; + } + + /******** + * Lang * + ********/ + + //_.castArray + interface LoDashStatic { + /** + * Casts value as an array if it’s not one. + * + * @param value The value to inspect. + * @return Returns the cast array. + */ + castArray(value: T): T[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.castArray + */ + castArray(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.castArray + */ + castArray(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.castArray + */ + castArray(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.castArray + */ + castArray(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.castArray + */ + castArray(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.castArray + */ + castArray(): LoDashExplicitArrayWrapper; + } + + //_.clone + interface LoDashStatic { + /** + * Creates a shallow clone of value. + * + * Note: This method is loosely based on the structured clone algorithm and supports cloning arrays, + * array buffers, booleans, date objects, maps, numbers, Object objects, regexes, sets, strings, symbols, + * and typed arrays. The own enumerable properties of arguments objects are cloned as plain objects. An empty + * object is returned for uncloneable values such as error objects, functions, DOM nodes, and WeakMaps. + * + * @param value The value to clone. + * @return Returns the cloned value. + */ + clone(value: T): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.clone + */ + clone(): T; + } + + interface LoDashImplicitArrayWrapper { + + /** + * @see _.clone + */ + clone(): T[]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.clone + */ + clone(): T; + } + + interface LoDashExplicitWrapper { + /** + * @see _.clone + */ + clone(): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + + /** + * @see _.clone + */ + clone(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.clone + */ + clone(): LoDashExplicitObjectWrapper; + } + + //_.cloneDeep + interface LoDashStatic { + /** + * This method is like _.clone except that it recursively clones value. + * + * @param value The value to recursively clone. + * @return Returns the deep cloned value. + */ + cloneDeep(value: T): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.cloneDeep + */ + cloneDeep(): T; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.cloneDeep + */ + cloneDeep(): T[]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.cloneDeep + */ + cloneDeep(): T; + } + + interface LoDashExplicitWrapper { + /** + * @see _.cloneDeep + */ + cloneDeep(): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.cloneDeep + */ + cloneDeep(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.cloneDeep + */ + cloneDeep(): LoDashExplicitObjectWrapper; + } + + //_.cloneDeepWith + interface CloneDeepWithCustomizer { + (value: TValue): TResult; + } + + interface LoDashStatic { + /** + * This method is like _.cloneWith except that it recursively clones value. + * + * @param value The value to recursively clone. + * @param customizer The function to customize cloning. + * @return Returns the deep cloned value. + */ + cloneDeepWith( + value: any, + customizer?: CloneDeepWithCustomizer + ): TResult; + + /** + * @see _.clonDeepeWith + */ + cloneDeepWith( + value: T, + customizer?: CloneDeepWithCustomizer + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer?: CloneDeepWithCustomizer + ): TResult; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer?: CloneDeepWithCustomizer + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer?: CloneDeepWithCustomizer + ): TResult; + } + + interface LoDashExplicitWrapper { + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer?: CloneDeepWithCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer?: CloneDeepWithCustomizer + ): LoDashExplicitArrayWrapper; + + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer?: CloneDeepWithCustomizer + ): LoDashExplicitObjectWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer?: CloneDeepWithCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer?: CloneDeepWithCustomizer + ): LoDashExplicitArrayWrapper; + + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer?: CloneDeepWithCustomizer + ): LoDashExplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer?: CloneDeepWithCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer?: CloneDeepWithCustomizer + ): LoDashExplicitArrayWrapper; + + /** + * @see _.cloneDeepWith + */ + cloneDeepWith( + customizer?: CloneDeepWithCustomizer + ): LoDashExplicitObjectWrapper; + } + + //_.cloneWith + interface CloneWithCustomizer { + (value: TValue): TResult; + } + + interface LoDashStatic { + /** + * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. + * If customizer returns undefined cloning is handled by the method instead. + * + * @param value The value to clone. + * @param customizer The function to customize cloning. + * @return Returns the cloned value. + */ + cloneWith( + value: any, + customizer?: CloneWithCustomizer + ): TResult; + + /** + * @see _.cloneWith + */ + cloneWith( + value: T, + customizer?: CloneWithCustomizer + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.cloneWith + */ + cloneWith( + customizer?: CloneWithCustomizer + ): TResult; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.cloneWith + */ + cloneWith( + customizer?: CloneWithCustomizer + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.cloneWith + */ + cloneWith( + customizer?: CloneWithCustomizer + ): TResult; + } + + interface LoDashExplicitWrapper { + /** + * @see _.cloneWith + */ + cloneWith( + customizer?: CloneWithCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.cloneWith + */ + cloneWith( + customizer?: CloneWithCustomizer + ): LoDashExplicitArrayWrapper; + + /** + * @see _.cloneWith + */ + cloneWith( + customizer?: CloneWithCustomizer + ): LoDashExplicitObjectWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.cloneWith + */ + cloneWith( + customizer?: CloneWithCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.cloneWith + */ + cloneWith( + customizer?: CloneWithCustomizer + ): LoDashExplicitArrayWrapper; + + /** + * @see _.cloneWith + */ + cloneWith( + customizer?: CloneWithCustomizer + ): LoDashExplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.cloneWith + */ + cloneWith( + customizer?: CloneWithCustomizer + ): LoDashExplicitWrapper; + + /** + * @see _.cloneWith + */ + cloneWith( + customizer?: CloneWithCustomizer + ): LoDashExplicitArrayWrapper; + + /** + * @see _.cloneWith + */ + cloneWith( + customizer?: CloneWithCustomizer + ): LoDashExplicitObjectWrapper; + } + + //_.eq + interface LoDashStatic { + /** + * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + eq( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isEqual + */ + eq( + other: any + ): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isEqual + */ + eq( + other: any + ): LoDashExplicitWrapper; + } + + //_.gt + interface LoDashStatic { + /** + * Checks if value is greater than other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is greater than other, else false. + */ + gt( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.gt + */ + gt(other: any): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.gt + */ + gt(other: any): LoDashExplicitWrapper; + } + + //_.gte + interface LoDashStatic { + /** + * Checks if value is greater than or equal to other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is greater than or equal to other, else false. + */ + gte( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.gte + */ + gte(other: any): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.gte + */ + gte(other: any): LoDashExplicitWrapper; + } + + //_.isArguments + interface LoDashStatic { + /** + * Checks if value is classified as an arguments object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isArguments(value?: any): value is IArguments; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isArguments + */ + isArguments(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isArguments + */ + isArguments(): LoDashExplicitWrapper; + } + + //_.isArray + interface LoDashStatic { + /** + * Checks if value is classified as an Array object. + * @param value The value to check. + * + * @return Returns true if value is correctly classified, else false. + */ + isArray(value?: any): value is T[]; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isArray + */ + isArray(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isArray + */ + isArray(): LoDashExplicitWrapper; + } + + //_.isArrayBuffer + interface LoDashStatic { + /** + * Checks if value is classified as an ArrayBuffer object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isArrayBuffer(value?: any): value is ArrayBuffer; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isArrayBuffer + */ + isArrayBuffer(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isArrayBuffer + */ + isArrayBuffer(): LoDashExplicitWrapper; + } + + //_.isArrayLike + interface LoDashStatic { + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @type Function + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + isArrayLike(value?: any): value is T[]; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isArrayLike + */ + isArrayLike(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isArrayLike + */ + isArrayLike(): LoDashExplicitWrapper; + } + + //_.isArrayLikeObject + interface LoDashStatic { + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @type Function + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + isArrayLikeObject(value?: any): value is T[]; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isArrayLikeObject + */ + isArrayLikeObject(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isArrayLikeObject + */ + isArrayLikeObject(): LoDashExplicitWrapper; + } + + //_.isBoolean + interface LoDashStatic { + /** + * Checks if value is classified as a boolean primitive or object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isBoolean(value?: any): value is boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isBoolean + */ + isBoolean(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isBoolean + */ + isBoolean(): LoDashExplicitWrapper; + } + + //_.isBuffer + interface LoDashStatic { + /** + * Checks if value is a buffer. + * + * @param value The value to check. + * @return Returns true if value is a buffer, else false. + */ + isBuffer(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isBuffer + */ + isBuffer(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isBuffer + */ + isBuffer(): LoDashExplicitWrapper; + } + + //_.isDate + interface LoDashStatic { + /** + * Checks if value is classified as a Date object. + * @param value The value to check. + * + * @return Returns true if value is correctly classified, else false. + */ + isDate(value?: any): value is Date; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isDate + */ + isDate(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isDate + */ + isDate(): LoDashExplicitWrapper; + } + + //_.isElement + interface LoDashStatic { + /** + * Checks if value is a DOM element. + * + * @param value The value to check. + * @return Returns true if value is a DOM element, else false. + */ + isElement(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isElement + */ + isElement(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isElement + */ + isElement(): LoDashExplicitWrapper; + } + + //_.isEmpty + interface LoDashStatic { + /** + * Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or + * jQuery-like collection with a length greater than 0 or an object with own enumerable properties. + * + * @param value The value to inspect. + * @return Returns true if value is empty, else false. + */ + isEmpty(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isEmpty + */ + isEmpty(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isEmpty + */ + isEmpty(): LoDashExplicitWrapper; + } + + //_.isEqual + interface LoDashStatic { + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are **not** supported. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + isEqual( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isEqual + */ + isEqual( + other: any + ): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isEqual + */ + isEqual( + other: any + ): LoDashExplicitWrapper; + } + + // _.isEqualWith + interface IsEqualCustomizer { + (value: any, other: any, indexOrKey?: number|string): boolean; + } + + interface LoDashStatic { + /** + * This method is like `_.isEqual` except that it accepts `customizer` which is + * invoked to compare values. If `customizer` returns `undefined` comparisons are + * handled by the method instead. The `customizer` is invoked with up to seven arguments: + * (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + isEqualWith( + value: any, + other: any, + customizer: IsEqualCustomizer + ): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isEqualWith + */ + isEqualWith( + other: any, + customizer: IsEqualCustomizer + ): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isEqualWith + */ + isEqualWith( + other: any, + customizer: IsEqualCustomizer + ): LoDashExplicitWrapper; + } + + //_.isError + interface LoDashStatic { + /** + * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError + * object. + * + * @param value The value to check. + * @return Returns true if value is an error object, else false. + */ + isError(value: any): value is Error; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isError + */ + isError(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isError + */ + isError(): LoDashExplicitWrapper; + } + + //_.isFinite + interface LoDashStatic { + /** + * Checks if value is a finite primitive number. + * + * Note: This method is based on Number.isFinite. + * + * @param value The value to check. + * @return Returns true if value is a finite number, else false. + */ + isFinite(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isFinite + */ + isFinite(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isFinite + */ + isFinite(): LoDashExplicitWrapper; + } + + //_.isFunction + interface LoDashStatic { + /** + * Checks if value is classified as a Function object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isFunction(value?: any): value is Function; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isFunction + */ + isFunction(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isFunction + */ + isFunction(): LoDashExplicitWrapper; + } + + //_.isInteger + interface LoDashStatic { + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + isInteger(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isInteger + */ + isInteger(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isInteger + */ + isInteger(): LoDashExplicitWrapper; + } + + //_.isLength + interface LoDashStatic { + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + isLength(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isLength + */ + isLength(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isLength + */ + isLength(): LoDashExplicitWrapper; + } + + //_.isMap + interface LoDashStatic { + /** + * Checks if value is classified as a Map object. + * + * @param value The value to check. + * @returns Returns true if value is correctly classified, else false. + */ + isMap(value?: any): value is Map; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isMap + */ + isMap(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isMap + */ + isMap(): LoDashExplicitWrapper; + } + + //_.isMatch + interface isMatchCustomizer { + (value: any, other: any, indexOrKey?: number|string): boolean; + } + + interface LoDashStatic { + /** + * Performs a deep comparison between `object` and `source` to determine if + * `object` contains equivalent property values. + * + * **Note:** This method supports comparing the same values as `_.isEqual`. + * + * @static + * @memberOf _ + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'user': 'fred', 'age': 40 }; + * + * _.isMatch(object, { 'age': 40 }); + * // => true + * + * _.isMatch(object, { 'age': 36 }); + * // => false + */ + isMatch(object: Object, source: Object): boolean; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.isMatch + */ + isMatch(source: Object): boolean; + } + + //_.isMatchWith + interface isMatchWithCustomizer { + (value: any, other: any, indexOrKey?: number|string): boolean; + } + + interface LoDashStatic { + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined` comparisons + * are handled by the method instead. The `customizer` is invoked with three + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + isMatchWith(object: Object, source: Object, customizer: isMatchWithCustomizer): boolean; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.isMatchWith + */ + isMatchWith(source: Object, customizer: isMatchWithCustomizer): boolean; + } + + //_.isNaN + interface LoDashStatic { + /** + * Checks if value is NaN. + * + * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values. + * + * @param value The value to check. + * @return Returns true if value is NaN, else false. + */ + isNaN(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isNaN + */ + isNaN(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isNaN + */ + isNaN(): LoDashExplicitWrapper; + } + + //_.isNative + interface LoDashStatic { + /** + * Checks if value is a native function. + * @param value The value to check. + * + * @retrun Returns true if value is a native function, else false. + */ + isNative(value: any): value is Function; + } + + interface LoDashImplicitWrapperBase { + /** + * see _.isNative + */ + isNative(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * see _.isNative + */ + isNative(): LoDashExplicitWrapper; + } + + //_.isNil + interface LoDashStatic { + /** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + isNil(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * see _.isNil + */ + isNil(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * see _.isNil + */ + isNil(): LoDashExplicitWrapper; + } + + //_.isNull + interface LoDashStatic { + /** + * Checks if value is null. + * + * @param value The value to check. + * @return Returns true if value is null, else false. + */ + isNull(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * see _.isNull + */ + isNull(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * see _.isNull + */ + isNull(): LoDashExplicitWrapper; + } + + //_.isNumber + interface LoDashStatic { + /** + * Checks if value is classified as a Number primitive or object. + * + * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isNumber(value?: any): value is number; + } + + interface LoDashImplicitWrapperBase { + /** + * see _.isNumber + */ + isNumber(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * see _.isNumber + */ + isNumber(): LoDashExplicitWrapper; + } + + //_.isObject + interface LoDashStatic { + /** + * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0), + * and new String('')) + * + * @param value The value to check. + * @return Returns true if value is an object, else false. + */ + isObject(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * see _.isObject + */ + isObject(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * see _.isObject + */ + isObject(): LoDashExplicitWrapper; + } + + //_.isObjectLike + interface LoDashStatic { + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + isObjectLike(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * see _.isObjectLike + */ + isObjectLike(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * see _.isObjectLike + */ + isObjectLike(): LoDashExplicitWrapper; + } + + //_.isPlainObject + interface LoDashStatic { + /** + * Checks if value is a plain object, that is, an object created by the Object constructor or one with a + * [[Prototype]] of null. + * + * Note: This method assumes objects created by the Object constructor have no inherited enumerable properties. + * + * @param value The value to check. + * @return Returns true if value is a plain object, else false. + */ + isPlainObject(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * see _.isPlainObject + */ + isPlainObject(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * see _.isPlainObject + */ + isPlainObject(): LoDashExplicitWrapper; + } + + //_.isRegExp + interface LoDashStatic { + /** + * Checks if value is classified as a RegExp object. + * @param value The value to check. + * + * @return Returns true if value is correctly classified, else false. + */ + isRegExp(value?: any): value is RegExp; + } + + interface LoDashImplicitWrapperBase { + /** + * see _.isRegExp + */ + isRegExp(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * see _.isRegExp + */ + isRegExp(): LoDashExplicitWrapper; + } + + //_.isSafeInteger + interface LoDashStatic { + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + isSafeInteger(value: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * see _.isSafeInteger + */ + isSafeInteger(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * see _.isSafeInteger + */ + isSafeInteger(): LoDashExplicitWrapper; + } + + //_.isSet + interface LoDashStatic { + /** + * Checks if value is classified as a Set object. + * + * @param value The value to check. + * @returns Returns true if value is correctly classified, else false. + */ + isSet(value?: any): value is Set; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isSet + */ + isSet(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isSet + */ + isSet(): LoDashExplicitWrapper; + } + + //_.isString + interface LoDashStatic { + /** + * Checks if value is classified as a String primitive or object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isString(value?: any): value is string; + } + + interface LoDashImplicitWrapperBase { + /** + * see _.isString + */ + isString(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * see _.isString + */ + isString(): LoDashExplicitWrapper; + } + + //_.isSymbol + interface LoDashStatic { + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + isSymbol(value: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * see _.isSymbol + */ + isSymbol(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * see _.isSymbol + */ + isSymbol(): LoDashExplicitWrapper; + } + + //_.isTypedArray + interface LoDashStatic { + /** + * Checks if value is classified as a typed array. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isTypedArray(value: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * see _.isTypedArray + */ + isTypedArray(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * see _.isTypedArray + */ + isTypedArray(): LoDashExplicitWrapper; + } + + //_.isUndefined + interface LoDashStatic { + /** + * Checks if value is undefined. + * + * @param value The value to check. + * @return Returns true if value is undefined, else false. + */ + isUndefined(value: any): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * see _.isUndefined + */ + isUndefined(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * see _.isUndefined + */ + isUndefined(): LoDashExplicitWrapper; + } + + //_.isWeakMap + interface LoDashStatic { + /** + * Checks if value is classified as a WeakMap object. + * + * @param value The value to check. + * @returns Returns true if value is correctly classified, else false. + */ + isWeakMap(value?: any): value is WeakMap; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isSet + */ + isWeakMap(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isSet + */ + isWeakMap(): LoDashExplicitWrapper; + } + + //_.isWeakSet + interface LoDashStatic { + /** + * Checks if value is classified as a WeakSet object. + * + * @param value The value to check. + * @returns Returns true if value is correctly classified, else false. + */ + isWeakSet(value?: any): value is WeakSet; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.isWeakSet + */ + isWeakSet(): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.isWeakSet + */ + isWeakSet(): LoDashExplicitWrapper; + } + + //_.lt + interface LoDashStatic { + /** + * Checks if value is less than other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is less than other, else false. + */ + lt( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.lt + */ + lt(other: any): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.lt + */ + lt(other: any): LoDashExplicitWrapper; + } + + //_.lte + interface LoDashStatic { + /** + * Checks if value is less than or equal to other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is less than or equal to other, else false. + */ + lte( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.lte + */ + lte(other: any): boolean; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.lte + */ + lte(other: any): LoDashExplicitWrapper; + } + + //_.toArray + interface LoDashStatic { + /** + * Converts value to an array. + * + * @param value The value to convert. + * @return Returns the converted array. + */ + toArray(value: List|Dictionary|NumericDictionary): T[]; + + /** + * @see _.toArray + */ + toArray(value: TValue): TResult[]; + + /** + * @see _.toArray + */ + toArray(value?: any): TResult[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toArray + */ + toArray(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.toArray + */ + toArray(): LoDashImplicitArrayWrapper; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.toArray + */ + toArray(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toArray + */ + toArray(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.toArray + */ + toArray(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.toArray + */ + toArray(): LoDashExplicitArrayWrapper; + } + + //_.toPlainObject + interface LoDashStatic { + /** + * Converts value to a plain object flattening inherited enumerable properties of value to own properties + * of the plain object. + * + * @param value The value to convert. + * @return Returns the converted plain object. + */ + toPlainObject(value?: any): TResult; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.toPlainObject + */ + toPlainObject(): LoDashImplicitObjectWrapper; + } + + //_.toInteger + interface LoDashStatic { + /** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ + toInteger(value: any): number; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.toInteger + */ + toInteger(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.toInteger + */ + toInteger(): LoDashExplicitWrapper; + } + + //_.toLength + interface LoDashStatic { + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @return {number} Returns the converted integer. + * @example + * + * _.toLength(3); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3'); + * // => 3 + */ + toLength(value: any): number; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.toLength + */ + toLength(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.toLength + */ + toLength(): LoDashExplicitWrapper; + } + + //_.toNumber + interface LoDashStatic { + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ + toNumber(value: any): number; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.toNumber + */ + toNumber(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.toNumber + */ + toNumber(): LoDashExplicitWrapper; + } + + //_.toSafeInteger + interface LoDashStatic { + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toSafeInteger(3); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3'); + * // => 3 + */ + toSafeInteger(value: any): number; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.toSafeInteger + */ + toSafeInteger(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.toSafeInteger + */ + toSafeInteger(): LoDashExplicitWrapper; + } + + //_.toString DUMMY + interface LoDashStatic { + /** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + toString(value: any): string; + } + + /******** + * Math * + ********/ + + //_.add + interface LoDashStatic { + /** + * Adds two numbers. + * + * @param augend The first number to add. + * @param addend The second number to add. + * @return Returns the sum. + */ + add( + augend: number, + addend: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.add + */ + add(addend: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.add + */ + add(addend: number): LoDashExplicitWrapper; + } + + //_.ceil + interface LoDashStatic { + /** + * Calculates n rounded up to precision. + * + * @param n The number to round up. + * @param precision The precision to round up to. + * @return Returns the rounded up number. + */ + ceil( + n: number, + precision?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.ceil + */ + ceil(precision?: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.ceil + */ + ceil(precision?: number): LoDashExplicitWrapper; + } + + //_.floor + interface LoDashStatic { + /** + * Calculates n rounded down to precision. + * + * @param n The number to round down. + * @param precision The precision to round down to. + * @return Returns the rounded down number. + */ + floor( + n: number, + precision?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.floor + */ + floor(precision?: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.floor + */ + floor(precision?: number): LoDashExplicitWrapper; + } + + //_.max + interface LoDashStatic { + /** + * Computes the maximum value of `array`. If `array` is empty or falsey + * `undefined` is returned. + * + * @static + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + */ + max( + collection: List + ): T; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.max + */ + max(): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.max + */ + max(): T; + } + + //_.maxBy + interface LoDashStatic { + /** + * This method is like `_.max` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * the value is ranked. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {*} Returns the maximum value. + * @example + * + * var objects = [{ 'n': 1 }, { 'n': 2 }]; + * + * _.maxBy(objects, function(o) { return o.a; }); + * // => { 'n': 2 } + * + * // using the `_.property` iteratee shorthand + * _.maxBy(objects, 'n'); + * // => { 'n': 2 } + */ + maxBy( + collection: List, + iteratee?: ListIterator + ): T; + + /** + * @see _.maxBy + */ + maxBy( + collection: Dictionary, + iteratee?: DictionaryIterator + ): T; + + /** + * @see _.maxBy + */ + maxBy( + collection: List|Dictionary, + iteratee?: string + ): T; + + /** + * @see _.maxBy + */ + maxBy( + collection: List|Dictionary, + whereValue?: TObject + ): T; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.maxBy + */ + maxBy( + iteratee?: ListIterator + ): T; + + /** + * @see _.maxBy + */ + maxBy( + iteratee?: string + ): T; + + /** + * @see _.maxBy + */ + maxBy( + whereValue?: TObject + ): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.maxBy + */ + maxBy( + iteratee?: ListIterator|DictionaryIterator + ): T; + + /** + * @see _.maxBy + */ + maxBy( + iteratee?: string + ): T; + + /** + * @see _.maxBy + */ + maxBy( + whereValue?: TObject + ): T; + } + + //_.mean + interface LoDashStatic { + /** + * Computes the mean of the values in `array`. + * + * @static + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {number} Returns the mean. + * @example + * + * _.mean([4, 2, 8, 6]); + * // => 5 + */ + mean( + collection: List + ): number; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.mean + */ + mean(): number; + + /** + * @see _.mean + */ + mean(): number; + } + + //_.min + interface LoDashStatic { + /** + * Computes the minimum value of `array`. If `array` is empty or falsey + * `undefined` is returned. + * + * @static + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the minimum value. + */ + min( + collection: List + ): T; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.min + */ + min(): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.min + */ + min(): T; + } + + //_.minBy + interface LoDashStatic { + /** + * This method is like `_.min` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * the value is ranked. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {*} Returns the minimum value. + * @example + * + * var objects = [{ 'n': 1 }, { 'n': 2 }]; + * + * _.minBy(objects, function(o) { return o.a; }); + * // => { 'n': 1 } + * + * // using the `_.property` iteratee shorthand + * _.minBy(objects, 'n'); + * // => { 'n': 1 } + */ + minBy( + collection: List, + iteratee?: ListIterator + ): T; + + /** + * @see _.minBy + */ + minBy( + collection: Dictionary, + iteratee?: DictionaryIterator + ): T; + + /** + * @see _.minBy + */ + minBy( + collection: List|Dictionary, + iteratee?: string + ): T; + + /** + * @see _.minBy + */ + minBy( + collection: List|Dictionary, + whereValue?: TObject + ): T; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.minBy + */ + minBy( + iteratee?: ListIterator + ): T; + + /** + * @see _.minBy + */ + minBy( + iteratee?: string + ): T; + + /** + * @see _.minBy + */ + minBy( + whereValue?: TObject + ): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.minBy + */ + minBy( + iteratee?: ListIterator|DictionaryIterator + ): T; + + /** + * @see _.minBy + */ + minBy( + iteratee?: string + ): T; + + /** + * @see _.minBy + */ + minBy( + whereValue?: TObject + ): T; + } + + //_.round + interface LoDashStatic { + /** + * Calculates n rounded to precision. + * + * @param n The number to round. + * @param precision The precision to round to. + * @return Returns the rounded number. + */ + round( + n: number, + precision?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.round + */ + round(precision?: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.round + */ + round(precision?: number): LoDashExplicitWrapper; + } + + //_.sum + interface LoDashStatic { + /** + * Computes the sum of the values in `array`. + * + * @static + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {number} Returns the sum. + * @example + * + * _.sum([4, 2, 8, 6]); + * // => 20 + */ + sum(collection: List): number; + + /** + * @see _.sum + */ + sum(collection: List|Dictionary): number; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.sum + */ + sum(): number; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.sum + **/ + sum(): number; + + /** + * @see _.sum + */ + sum(): number; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sum + */ + sum(): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sum + */ + sum(): LoDashExplicitWrapper; + + /** + * @see _.sum + */ + sum(): LoDashExplicitWrapper; + } + + //_.sumBy + interface LoDashStatic { + /** + * This method is like `_.sum` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the value to be summed. + * The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the sum. + * @example + * + * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; + * + * _.sumBy(objects, function(o) { return o.n; }); + * // => 20 + * + * // using the `_.property` iteratee shorthand + * _.sumBy(objects, 'n'); + * // => 20 + */ + sumBy( + collection: List, + iteratee: ListIterator + ): number; + + /** + * @see _.sumBy + */ + sumBy( + collection: List<{}>, + iteratee: string + ): number; + + /** + * @see _.sumBy + */ + sumBy( + collection: List + ): number; + + /** + * @see _.sumBy + */ + sumBy( + collection: List<{}>, + iteratee: Dictionary<{}> + ): number; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.sumBy + */ + sumBy( + iteratee: ListIterator + ): number; + + /** + * @see _.sumBy + */ + sumBy(iteratee: string): number; + + /** + * @see _.sumBy + */ + sumBy(iteratee: Dictionary<{}>): number; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.sumBy + */ + sumBy( + iteratee: ListIterator<{}, number> + ): number; + + /** + * @see _.sumBy + */ + sumBy(iteratee: string): number; + + /** + * @see _.sumBy + */ + sumBy(iteratee: Dictionary<{}>): number; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.sumBy + */ + sumBy( + iteratee: ListIterator + ): LoDashExplicitWrapper; + + /** + * @see _.sumBy + */ + sumBy(iteratee: string): LoDashExplicitWrapper; + + /** + * @see _.sumBy + */ + sumBy(): LoDashExplicitWrapper; + + /** + * @see _.sumBy + */ + sumBy(iteratee: Dictionary<{}>): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.sumBy + */ + sumBy( + iteratee: ListIterator<{}, number> + ): LoDashExplicitWrapper; + + /** + * @see _.sumBy + */ + sumBy(iteratee: string): LoDashExplicitWrapper; + + /** + * @see _.sumBy + */ + sumBy(iteratee: Dictionary<{}>): LoDashExplicitWrapper; + } + + /********** + * Number * + **********/ + + //_.subtract + interface LoDashStatic { + /** + * Subtract two numbers. + * + * @static + * @memberOf _ + * @category Math + * @param {number} minuend The first number in a subtraction. + * @param {number} subtrahend The second number in a subtraction. + * @returns {number} Returns the difference. + * @example + * + * _.subtract(6, 4); + * // => 2 + */ + subtract( + minuend: number, + subtrahend: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.subtract + */ + subtract( + subtrahend: number + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.subtract + */ + subtract( + subtrahend: number + ): LoDashExplicitWrapper; + } + + //_.clamp + interface LoDashStatic { + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + clamp( + number: number, + lower: number, + upper: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.clamp + */ + clamp( + lower: number, + upper: number + ): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.clamp + */ + clamp( + lower: number, + upper: number + ): LoDashExplicitWrapper; + } + + //_.inRange + interface LoDashStatic { + /** + * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start + * with start then set to 0. + * + * @param n The number to check. + * @param start The start of the range. + * @param end The end of the range. + * @return Returns true if n is in the range, else false. + */ + inRange( + n: number, + start: number, + end: number + ): boolean; + + + /** + * @see _.inRange + */ + inRange( + n: number, + end: number + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.inRange + */ + inRange( + start: number, + end: number + ): boolean; + + /** + * @see _.inRange + */ + inRange(end: number): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.inRange + */ + inRange( + start: number, + end: number + ): LoDashExplicitWrapper; + + /** + * @see _.inRange + */ + inRange(end: number): LoDashExplicitWrapper; + } + + //_.random + interface LoDashStatic { + /** + * Produces a random number between min and max (inclusive). If only one argument is provided a number between + * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point + * number is returned instead of an integer. + * + * @param min The minimum possible value. + * @param max The maximum possible value. + * @param floating Specify returning a floating-point number. + * @return Returns the random number. + */ + random( + min?: number, + max?: number, + floating?: boolean + ): number; + + /** + * @see _.random + */ + random( + min?: number, + floating?: boolean + ): number; + + /** + * @see _.random + */ + random(floating?: boolean): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.random + */ + random( + max?: number, + floating?: boolean + ): number; + + /** + * @see _.random + */ + random(floating?: boolean): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.random + */ + random( + max?: number, + floating?: boolean + ): LoDashExplicitWrapper; + + /** + * @see _.random + */ + random(floating?: boolean): LoDashExplicitWrapper; + } + + /********** + * Object * + **********/ + + //_.assign + interface LoDashStatic { + /** + * Assigns own enumerable properties of source objects to the destination + * object. Source objects are applied from left to right. Subsequent sources + * overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.c = 3; + * } + * + * function Bar() { + * this.e = 5; + * } + * + * Foo.prototype.d = 4; + * Bar.prototype.f = 6; + * + * _.assign({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3, 'e': 5 } + */ + assign( + object: TObject, + source: TSource + ): TObject & TSource; + + /** + * @see assign + */ + assign( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TObject & TSource1 & TSource2; + + /** + * @see assign + */ + assign( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see assign + */ + assign( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assign + */ + assign(object: TObject): TObject; + + /** + * @see _.assign + */ + assign( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.assign + */ + assign( + source: TSource + ): LoDashImplicitObjectWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitObjectWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitObjectWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assign + */ + assign(): LoDashImplicitObjectWrapper; + + /** + * @see _.assign + */ + assign(...otherArgs: any[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.assign + */ + assign( + source: TSource + ): LoDashExplicitObjectWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitObjectWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitObjectWrapper; + + /** + * @see assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assign + */ + assign(): LoDashExplicitObjectWrapper; + + /** + * @see _.assign + */ + assign(...otherArgs: any[]): LoDashExplicitObjectWrapper; + } + + //_.assignWith + interface AssignCustomizer { + (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}): any; + } + + interface LoDashStatic { + /** + * This method is like `_.assign` except that it accepts `customizer` which + * is invoked to produce the assigned values. If `customizer` returns `undefined` + * assignment is handled by the method instead. The `customizer` is invoked + * with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + assignWith( + object: TObject, + source: TSource, + customizer: AssignCustomizer + ): TObject & TSource; + + /** + * @see assignWith + */ + assignWith( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2; + + /** + * @see assignWith + */ + assignWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see assignWith + */ + assignWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assignWith + */ + assignWith(object: TObject): TObject; + + /** + * @see _.assignWith + */ + assignWith( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.assignWith + */ + assignWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignWith + */ + assignWith(): LoDashImplicitObjectWrapper; + + /** + * @see _.assignWith + */ + assignWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.assignWith + */ + assignWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see assignWith + */ + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignWith + */ + assignWith(): LoDashExplicitObjectWrapper; + + /** + * @see _.assignWith + */ + assignWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; + } + + //_.assignIn + interface LoDashStatic { + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * function Bar() { + * this.d = 4; + * } + * + * Foo.prototype.c = 3; + * Bar.prototype.e = 5; + * + * _.assignIn({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } + */ + assignIn( + object: TObject, + source: TSource + ): TObject & TSource; + + /** + * @see assignIn + */ + assignIn( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TObject & TSource1 & TSource2; + + /** + * @see assignIn + */ + assignIn( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see assignIn + */ + assignIn( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assignIn + */ + assignIn(object: TObject): TObject; + + /** + * @see _.assignIn + */ + assignIn( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.assignIn + */ + assignIn( + source: TSource + ): LoDashImplicitObjectWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitObjectWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitObjectWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignIn + */ + assignIn(): LoDashImplicitObjectWrapper; + + /** + * @see _.assignIn + */ + assignIn(...otherArgs: any[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.assignIn + */ + assignIn( + source: TSource + ): LoDashExplicitObjectWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitObjectWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitObjectWrapper; + + /** + * @see assignIn + */ + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignIn + */ + assignIn(): LoDashExplicitObjectWrapper; + + /** + * @see _.assignIn + */ + assignIn(...otherArgs: any[]): LoDashExplicitObjectWrapper; + } + + //_.assignInWith + interface AssignCustomizer { + (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}): any; + } + + interface LoDashStatic { + /** + * This method is like `_.assignIn` except that it accepts `customizer` which + * is invoked to produce the assigned values. If `customizer` returns `undefined` + * assignment is handled by the method instead. The `customizer` is invoked + * with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + assignInWith( + object: TObject, + source: TSource, + customizer: AssignCustomizer + ): TObject & TSource; + + /** + * @see assignInWith + */ + assignInWith( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2; + + /** + * @see assignInWith + */ + assignInWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see assignInWith + */ + assignInWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assignInWith + */ + assignInWith(object: TObject): TObject; + + /** + * @see _.assignInWith + */ + assignInWith( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.assignInWith + */ + assignInWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + assignInWith(): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + assignInWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.assignInWith + */ + assignInWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see assignInWith + */ + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + assignInWith(): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + assignInWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; + } + + //_.create + interface LoDashStatic { + /** + * Creates an object that inherits from the given prototype object. If a properties object is provided its own + * enumerable properties are assigned to the created object. + * + * @param prototype The object to inherit from. + * @param properties The properties to assign to the object. + * @return Returns the new object. + */ + create( + prototype: T, + properties?: U + ): T & U; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.create + */ + create(properties?: U): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.create + */ + create(properties?: U): LoDashExplicitObjectWrapper; + } + + + //_.defaults + interface LoDashStatic { + /** + * Assigns own enumerable properties of source object(s) to the destination object for all destination + * properties that resolve to undefined. Once a property is set, additional values of the same property are + * ignored. + * + * Note: This method mutates object. + * + * @param object The destination object. + * @param sources The source objects. + * @return The destination object. + */ + defaults( + object: TObject, + source: TSource + ): TSource & TObject; + + /** + * @see _.defaults + */ + defaults( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TSource2 & TSource1 & TObject; + + /** + * @see _.defaults + */ + defaults( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TSource3 & TSource2 & TSource1 & TObject; + + /** + * @see _.defaults + */ + defaults( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TSource4 & TSource3 & TSource2 & TSource1 & TObject; + + /** + * @see _.defaults + */ + defaults(object: TObject): TObject; + + /** + * @see _.defaults + */ + defaults( + object: any, + ...sources: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.defaults + */ + defaults( + source: TSource + ): LoDashImplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults(): LoDashImplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults(...sources: any[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.defaults + */ + defaults( + source: TSource + ): LoDashExplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults(): LoDashExplicitObjectWrapper; + + /** + * @see _.defaults + */ + defaults(...sources: any[]): LoDashExplicitObjectWrapper; + } + + //_.defaultsDeep + interface LoDashStatic { + /** + * This method is like _.defaults except that it recursively assigns default properties. + * @param object The destination object. + * @param sources The source objects. + * @return Returns object. + **/ + defaultsDeep( + object: T, + ...sources: any[]): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.defaultsDeep + **/ + defaultsDeep(...sources: any[]): LoDashImplicitObjectWrapper + } + + // _.extend + interface LoDashStatic { + /** + * @see _.assignIn + */ + extend( + object: TObject, + source: TSource + ): TObject & TSource; + + /** + * @see _.assignIn + */ + extend( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TObject & TSource1 & TSource2; + + /** + * @see _.assignIn + */ + extend( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.assignIn + */ + extend( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assignIn + */ + extend(object: TObject): TObject; + + /** + * @see _.assignIn + */ + extend( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.assignIn + */ + extend( + source: TSource + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignIn + */ + extend( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignIn + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignIn + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignIn + */ + extend(): LoDashImplicitObjectWrapper; + + /** + * @see _.assignIn + */ + extend(...otherArgs: any[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.assignIn + */ + extend( + source: TSource + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignIn + */ + extend( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignIn + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignIn + */ + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignIn + */ + extend(): LoDashExplicitObjectWrapper; + + /** + * @see _.assignIn + */ + extend(...otherArgs: any[]): LoDashExplicitObjectWrapper; + } + + interface LoDashStatic { + /** + * @see _.assignInWith + */ + extendWith( + object: TObject, + source: TSource, + customizer: AssignCustomizer + ): TObject & TSource; + + /** + * @see _.assignInWith + */ + extendWith( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2; + + /** + * @see _.assignInWith + */ + extendWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.assignInWith + */ + extendWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.assignInWith + */ + extendWith(object: TObject): TObject; + + /** + * @see _.assignInWith + */ + extendWith( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.assignInWith + */ + extendWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith(): LoDashImplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.assignInWith + */ + extendWith( + source: TSource, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith(): LoDashExplicitObjectWrapper; + + /** + * @see _.assignInWith + */ + extendWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; + } + + //_.findKey + interface LoDashStatic { + /** + * This method is like _.find except that it returns the key of the first element predicate returns truthy for + * instead of the element itself. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param object The object to search. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the key of the matched element, else undefined. + */ + findKey( + object: TObject, + predicate?: DictionaryIterator + ): string; + + /** + * @see _.findKey + */ + findKey( + object: TObject, + predicate?: ObjectIterator + ): string; + + /** + * @see _.findKey + */ + findKey( + object: TObject, + predicate?: string + ): string; + + /** + * @see _.findKey + */ + findKey, TObject>( + object: TObject, + predicate?: TWhere + ): string; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.findKey + */ + findKey( + predicate?: DictionaryIterator + ): string; + + /** + * @see _.findKey + */ + findKey( + predicate?: ObjectIterator + ): string; + + /** + * @see _.findKey + */ + findKey( + predicate?: string + ): string; + + /** + * @see _.findKey + */ + findKey>( + predicate?: TWhere + ): string; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.findKey + */ + findKey( + predicate?: DictionaryIterator + ): LoDashExplicitWrapper; + + /** + * @see _.findKey + */ + findKey( + predicate?: ObjectIterator + ): LoDashExplicitWrapper; + + /** + * @see _.findKey + */ + findKey( + predicate?: string + ): LoDashExplicitWrapper; + + /** + * @see _.findKey + */ + findKey>( + predicate?: TWhere + ): LoDashExplicitWrapper; + } + + //_.findLastKey + interface LoDashStatic { + /** + * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param object The object to search. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the key of the matched element, else undefined. + */ + findLastKey( + object: TObject, + predicate?: DictionaryIterator + ): string; + + /** + * @see _.findLastKey + */ + findLastKey( + object: TObject, + predicate?: ObjectIterator + ): string; + + /** + * @see _.findLastKey + */ + findLastKey( + object: TObject, + predicate?: string + ): string; + + /** + * @see _.findLastKey + */ + findLastKey, TObject>( + object: TObject, + predicate?: TWhere + ): string; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.findLastKey + */ + findLastKey( + predicate?: DictionaryIterator + ): string; + + /** + * @see _.findLastKey + */ + findLastKey( + predicate?: ObjectIterator + ): string; + + /** + * @see _.findLastKey + */ + findLastKey( + predicate?: string + ): string; + + /** + * @see _.findLastKey + */ + findLastKey>( + predicate?: TWhere + ): string; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.findLastKey + */ + findLastKey( + predicate?: DictionaryIterator + ): LoDashExplicitWrapper; + + /** + * @see _.findLastKey + */ + findLastKey( + predicate?: ObjectIterator + ): LoDashExplicitWrapper; + + /** + * @see _.findLastKey + */ + findLastKey( + predicate?: string + ): LoDashExplicitWrapper; + + /** + * @see _.findLastKey + */ + findLastKey>( + predicate?: TWhere + ): LoDashExplicitWrapper; + } + + //_.forIn + interface LoDashStatic { + /** + * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The + * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may + * exit iteration early by explicitly returning false. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forIn( + object: Dictionary, + iteratee?: DictionaryIterator + ): Dictionary; + + /** + * @see _.forIn + */ + forIn( + object: T, + iteratee?: ObjectIterator + ): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.forIn + */ + forIn( + iteratee?: DictionaryIterator + ): _.LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.forIn + */ + forIn( + iteratee?: DictionaryIterator + ): _.LoDashExplicitObjectWrapper; + } + + //_.forInRight + interface LoDashStatic { + /** + * This method is like _.forIn except that it iterates over properties of object in the opposite order. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forInRight( + object: Dictionary, + iteratee?: DictionaryIterator + ): Dictionary; + + /** + * @see _.forInRight + */ + forInRight( + object: T, + iteratee?: ObjectIterator + ): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.forInRight + */ + forInRight( + iteratee?: DictionaryIterator + ): _.LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.forInRight + */ + forInRight( + iteratee?: DictionaryIterator + ): _.LoDashExplicitObjectWrapper; + } + + //_.forOwn + interface LoDashStatic { + /** + * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is + * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning false. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forOwn( + object: Dictionary, + iteratee?: DictionaryIterator + ): Dictionary; + + /** + * @see _.forOwn + */ + forOwn( + object: T, + iteratee?: ObjectIterator + ): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.forOwn + */ + forOwn( + iteratee?: DictionaryIterator + ): _.LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.forOwn + */ + forOwn( + iteratee?: DictionaryIterator + ): _.LoDashExplicitObjectWrapper; + } + + //_.forOwnRight + interface LoDashStatic { + /** + * This method is like _.forOwn except that it iterates over properties of object in the opposite order. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forOwnRight( + object: Dictionary, + iteratee?: DictionaryIterator + ): Dictionary; + + /** + * @see _.forOwnRight + */ + forOwnRight( + object: T, + iteratee?: ObjectIterator + ): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.forOwnRight + */ + forOwnRight( + iteratee?: DictionaryIterator + ): _.LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.forOwnRight + */ + forOwnRight( + iteratee?: DictionaryIterator + ): _.LoDashExplicitObjectWrapper; + } + + //_.functions + interface LoDashStatic { + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + functions(object: any): string[]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.functions + */ + functions(): _.LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.functions + */ + functions(): _.LoDashExplicitArrayWrapper; + } + + //_.functionsIn + interface LoDashStatic { + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + functionsIn(object: any): string[]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.functionsIn + */ + functionsIn(): _.LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.functionsIn + */ + functionsIn(): _.LoDashExplicitArrayWrapper; + } + + //_.get + interface LoDashStatic { + /** + * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used + * in its place. + * + * @param object The object to query. + * @param path The path of the property to get. + * @param defaultValue The value returned if the resolved value is undefined. + * @return Returns the resolved value. + */ + get( + object: TObject, + path: StringRepresentable|StringRepresentable[], + defaultValue?: TResult + ): TResult; + + /** + * @see _.get + */ + get( + object: any, + path: StringRepresentable|StringRepresentable[], + defaultValue?: TResult + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.get + */ + get( + path: StringRepresentable|StringRepresentable[], + defaultValue?: TResult + ): TResult; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.get + */ + get( + path: StringRepresentable|StringRepresentable[], + defaultValue?: TResult + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.get + */ + get( + path: StringRepresentable|StringRepresentable[], + defaultValue?: TResult + ): TResult; + } + + interface LoDashExplicitWrapper { + /** + * @see _.get + */ + get( + path: StringRepresentable|StringRepresentable[], + defaultValue?: any + ): TResultWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.get + */ + get( + path: StringRepresentable|StringRepresentable[], + defaultValue?: any + ): TResultWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.get + */ + get( + path: StringRepresentable|StringRepresentable[], + defaultValue?: any + ): TResultWrapper; + } + + //_.has + interface LoDashStatic { + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': { 'c': 3 } } }; + * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b.c'); + * // => true + * + * _.has(object, ['a', 'b', 'c']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + has( + object: T, + path: StringRepresentable|StringRepresentable[] + ): boolean; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.has + */ + has(path: StringRepresentable|StringRepresentable[]): boolean; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.has + */ + has(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper; + } + + //_.hasIn + interface LoDashStatic { + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b.c'); + * // => true + * + * _.hasIn(object, ['a', 'b', 'c']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + hasIn( + object: T, + path: StringRepresentable|StringRepresentable[] + ): boolean; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.hasIn + */ + hasIn(path: StringRepresentable|StringRepresentable[]): boolean; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.hasIn + */ + hasIn(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper; + } + + //_.invert + interface LoDashStatic { + /** + * Creates an object composed of the inverted keys and values of object. If object contains duplicate values, + * subsequent values overwrite property assignments of previous values unless multiValue is true. + * + * @param object The object to invert. + * @param multiValue Allow multiple values per key. + * @return Returns the new inverted object. + */ + invert( + object: T, + multiValue?: boolean + ): TResult; + + /** + * @see _.invert + */ + invert( + object: Object, + multiValue?: boolean + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.invert + */ + invert(multiValue?: boolean): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.invert + */ + invert(multiValue?: boolean): LoDashExplicitObjectWrapper; + } + + //_.inverBy + interface InvertByIterator { + (value: T): any; + } + + interface LoDashStatic { + /** + * This method is like _.invert except that the inverted object is generated from the results of running each + * element of object through iteratee. The corresponding inverted value of each inverted key is an array of + * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). + * + * @param object The object to invert. + * @param interatee The iteratee invoked per element. + * @return Returns the new inverted object. + */ + invertBy( + object: Object, + interatee?: InvertByIterator|string + ): Dictionary; + + /** + * @see _.invertBy + */ + invertBy( + object: _.Dictionary|_.NumericDictionary, + interatee?: InvertByIterator|string + ): Dictionary; + + /** + * @see _.invertBy + */ + invertBy( + object: Object, + interatee?: W + ): Dictionary; + + /** + * @see _.invertBy + */ + invertBy( + object: _.Dictionary, + interatee?: W + ): Dictionary; + } + + interface LoDashImplicitWrapper { + /** + * @see _.invertBy + */ + invertBy( + interatee?: InvertByIterator + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.invertBy + */ + invertBy( + interatee?: InvertByIterator|string + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.invertBy + */ + invertBy( + interatee?: W + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.invertBy + */ + invertBy( + interatee?: InvertByIterator|string + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.invertBy + */ + invertBy( + interatee?: W + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.invertBy + */ + invertBy( + interatee?: InvertByIterator + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.invertBy + */ + invertBy( + interatee?: InvertByIterator|string + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.invertBy + */ + invertBy( + interatee?: W + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.invertBy + */ + invertBy( + interatee?: InvertByIterator|string + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.invertBy + */ + invertBy( + interatee?: W + ): LoDashExplicitObjectWrapper>; + } + + //_.keys + interface LoDashStatic { + /** + * Creates an array of the own enumerable property names of object. + * + * Note: Non-object values are coerced to objects. See the ES spec for more details. + * + * @param object The object to query. + * @return Returns the array of property names. + */ + keys(object?: any): string[]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.keys + */ + keys(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.keys + */ + keys(): LoDashExplicitArrayWrapper; + } + + //_.keysIn + interface LoDashStatic { + /** + * Creates an array of the own and inherited enumerable property names of object. + * + * Note: Non-object values are coerced to objects. + * + * @param object The object to query. + * @return An array of property names. + */ + keysIn(object?: any): string[]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.keysIn + */ + keysIn(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.keysIn + */ + keysIn(): LoDashExplicitArrayWrapper; + } + + //_.mapKeys + interface LoDashStatic { + /** + * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated + * by running each own enumerable property of object through iteratee. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the new mapped object. + */ + mapKeys( + object: List, + iteratee?: ListIterator + ): Dictionary; + + /** + * @see _.mapKeys + */ + mapKeys( + object: Dictionary, + iteratee?: DictionaryIterator + ): Dictionary; + + /** + * @see _.mapKeys + */ + mapKeys( + object: List|Dictionary, + iteratee?: TObject + ): Dictionary; + + /** + * @see _.mapKeys + */ + mapKeys( + object: List|Dictionary, + iteratee?: string + ): Dictionary; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: ListIterator + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: TObject + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: string + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: ListIterator|DictionaryIterator + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: TObject + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: string + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: ListIterator + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: TObject + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: string + ): LoDashExplicitObjectWrapper>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: ListIterator|DictionaryIterator + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: TObject + ): LoDashExplicitObjectWrapper>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: string + ): LoDashExplicitObjectWrapper>; + } + + //_.mapValues + interface LoDashStatic { + /** + * Creates an object with the same keys as object and values generated by running each own + * enumerable property of object through iteratee. The iteratee function is bound to thisArg + * and invoked with three arguments: (value, key, object). + * + * If a property name is provided iteratee the created "_.property" style callback returns + * the property value of the given element. + * + * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns + * true for elements that have a matching property value, else false;. + * + * If an object is provided for iteratee the created "_.matches" style callback returns true + * for elements that have the properties of the given object, else false. + * + * @param {Object} object The object to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. + * @param {Object} [thisArg] The `this` binding of `iteratee`. + * @return {Object} Returns the new mapped object. + */ + mapValues(obj: Dictionary, callback: ObjectIterator): Dictionary; + mapValues(obj: Dictionary, where: Dictionary): Dictionary; + mapValues(obj: T, pluck: string): TMapped; + mapValues(obj: T, callback: ObjectIterator): T; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.mapValues + * TValue is the type of the property values of T. + * TResult is the type output by the ObjectIterator function + */ + mapValues(callback: ObjectIterator): LoDashImplicitObjectWrapper>; + + /** + * @see _.mapValues + * TResult is the type of the property specified by pluck. + * T should be a Dictionary> + */ + mapValues(pluck: string): LoDashImplicitObjectWrapper>; + + /** + * @see _.mapValues + * TResult is the type of the properties of each object in the values of T + * T should be a Dictionary> + */ + mapValues(where: Dictionary): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.mapValues + * TValue is the type of the property values of T. + * TResult is the type output by the ObjectIterator function + */ + mapValues(callback: ObjectIterator): LoDashExplicitObjectWrapper>; + + /** + * @see _.mapValues + * TResult is the type of the property specified by pluck. + * T should be a Dictionary> + */ + mapValues(pluck: string): LoDashExplicitObjectWrapper>; + + /** + * @see _.mapValues + * TResult is the type of the properties of each object in the values of T + * T should be a Dictionary> + */ + mapValues(where: Dictionary): LoDashExplicitObjectWrapper; + } + + //_.merge + interface LoDashStatic { + /** + * Recursively merges own and inherited enumerable properties of source + * objects into the destination object, skipping source properties that resolve + * to `undefined`. Array and plain object properties are merged recursively. + * Other objects and value types are overridden by assignment. Source objects + * are applied from left to right. Subsequent sources overwrite property + * assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var users = { + * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] + * }; + * + * var ages = { + * 'data': [{ 'age': 36 }, { 'age': 40 }] + * }; + * + * _.merge(users, ages); + * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } + */ + merge( + object: TObject, + source: TSource + ): TObject & TSource; + + /** + * @see _.merge + */ + merge( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TObject & TSource1 & TSource2; + + /** + * @see _.merge + */ + merge( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.merge + */ + merge( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.merge + */ + merge( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.merge + */ + merge( + source: TSource + ): LoDashImplicitObjectWrapper; + + /** + * @see _.merge + */ + merge( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitObjectWrapper; + + /** + * @see _.merge + */ + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitObjectWrapper; + + /** + * @see _.merge + */ + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitObjectWrapper; + + /** + * @see _.merge + */ + merge( + ...otherArgs: any[] + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.merge + */ + merge( + source: TSource + ): LoDashExplicitObjectWrapper; + + /** + * @see _.merge + */ + merge( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitObjectWrapper; + + /** + * @see _.merge + */ + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitObjectWrapper; + + /** + * @see _.merge + */ + merge( + ): LoDashExplicitObjectWrapper; + + /** + * @see _.merge + */ + merge( + ...otherArgs: any[] + ): LoDashExplicitObjectWrapper; + } + + //_.mergeWith + interface MergeWithCustomizer { + (value: any, srcValue: any, key?: string, object?: Object, source?: Object): any; + } + + interface LoDashStatic { + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined` merging is handled by the + * method instead. The `customizer` is invoked with seven arguments: + * (objValue, srcValue, key, object, source, stack). + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { + * 'fruits': ['apple'], + * 'vegetables': ['beet'] + * }; + * + * var other = { + * 'fruits': ['banana'], + * 'vegetables': ['carrot'] + * }; + * + * _.merge(object, other, customizer); + * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } + */ + mergeWith( + object: TObject, + source: TSource, + customizer: MergeWithCustomizer + ): TObject & TSource; + + /** + * @see _.mergeWith + */ + mergeWith( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: MergeWithCustomizer + ): TObject & TSource1 & TSource2; + + /** + * @see _.mergeWith + */ + mergeWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: MergeWithCustomizer + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.mergeWith + */ + mergeWith( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: MergeWithCustomizer + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.mergeWith + */ + mergeWith( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.mergeWith + */ + mergeWith( + source: TSource, + customizer: MergeWithCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.mergeWith + */ + mergeWith( + source1: TSource1, + source2: TSource2, + customizer: MergeWithCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.mergeWith + */ + mergeWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: MergeWithCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.mergeWith + */ + mergeWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: MergeWithCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.mergeWith + */ + mergeWith( + ...otherArgs: any[] + ): LoDashImplicitObjectWrapper; + } + + //_.omit + interface LoDashStatic { + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable properties of `object` that are not omitted. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [props] The property names to omit, specified + * individually or in arrays.. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + + omit( + object: T, + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + + /** + * @see _.omit + */ + omit( + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + + /** + * @see _.omit + */ + omit( + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): LoDashExplicitObjectWrapper; + } + + //_.omitBy + interface LoDashStatic { + /** + * The opposite of `_.pickBy`; this method creates an object composed of the + * own and inherited enumerable properties of `object` that `predicate` + * doesn't return truthy for. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {Function|Object|string} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + omitBy( + object: T, + predicate: ObjectIterator + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.omitBy + */ + omitBy( + predicate: ObjectIterator + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.omitBy + */ + omitBy( + predicate: ObjectIterator + ): LoDashExplicitObjectWrapper; + } + + //_.pick + interface LoDashStatic { + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [props] The property names to pick, specified + * individually or in arrays. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + pick( + object: T, + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.pick + */ + pick( + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.pick + */ + pick( + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): LoDashExplicitObjectWrapper; + } + + //_.pickBy + interface LoDashStatic { + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {Function|Object|string} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + pickBy( + object: T, + predicate?: ObjectIterator + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.pickBy + */ + pickBy( + predicate?: ObjectIterator + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.pickBy + */ + pickBy( + predicate?: ObjectIterator + ): LoDashExplicitObjectWrapper; + } + + //_.result + interface LoDashStatic { + /** + * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding + * of its parent object and its result is returned. + * + * @param object The object to query. + * @param path The path of the property to resolve. + * @param defaultValue The value returned if the resolved value is undefined. + * @return Returns the resolved value. + */ + result( + object: TObject, + path: StringRepresentable|StringRepresentable[], + defaultValue?: TResult|((...args: any[]) => TResult) + ): TResult; + + /** + * @see _.result + */ + result( + object: any, + path: StringRepresentable|StringRepresentable[], + defaultValue?: TResult|((...args: any[]) => TResult) + ): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.result + */ + result( + path: StringRepresentable|StringRepresentable[], + defaultValue?: TResult|((...args: any[]) => TResult) + ): TResult; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.result + */ + result( + path: StringRepresentable|StringRepresentable[], + defaultValue?: TResult|((...args: any[]) => TResult) + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.result + */ + result( + path: StringRepresentable|StringRepresentable[], + defaultValue?: TResult|((...args: any[]) => TResult) + ): TResult; + } + + interface LoDashExplicitWrapper { + /** + * @see _.result + */ + result( + path: StringRepresentable|StringRepresentable[], + defaultValue?: any + ): TResultWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.result + */ + result( + path: StringRepresentable|StringRepresentable[], + defaultValue?: any + ): TResultWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.result + */ + result( + path: StringRepresentable|StringRepresentable[], + defaultValue?: any + ): TResultWrapper; + } + + //_.set + interface LoDashStatic { + /** + * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for + * missing index properties while objects are created for all other missing properties. Use _.setWith to + * customize path creation. + * + * @param object The object to modify. + * @param path The path of the property to set. + * @param value The value to set. + * @return Returns object. + */ + set( + object: Object, + path: StringRepresentable|StringRepresentable[], + value: any + ): TResult; + + /** + * @see _.set + */ + set( + object: Object, + path: StringRepresentable|StringRepresentable[], + value: V + ): TResult; + + /** + * @see _.set + */ + set( + object: O, + path: StringRepresentable|StringRepresentable[], + value: V + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.set + */ + set( + path: StringRepresentable|StringRepresentable[], + value: any + ): LoDashImplicitObjectWrapper; + + /** + * @see _.set + */ + set( + path: StringRepresentable|StringRepresentable[], + value: V + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.set + */ + set( + path: StringRepresentable|StringRepresentable[], + value: any + ): LoDashExplicitObjectWrapper; + + /** + * @see _.set + */ + set( + path: StringRepresentable|StringRepresentable[], + value: V + ): LoDashExplicitObjectWrapper; + } + + //_.setWith + interface SetWithCustomizer { + (nsValue: any, key: string, nsObject: T): any; + } + + interface LoDashStatic { + /** + * This method is like _.set except that it accepts customizer which is invoked to produce the objects of + * path. If customizer returns undefined path creation is handled by the method instead. The customizer is + * invoked with three arguments: (nsValue, key, nsObject). + * + * @param object The object to modify. + * @param path The path of the property to set. + * @param value The value to set. + * @parem customizer The function to customize assigned values. + * @return Returns object. + */ + setWith( + object: Object, + path: StringRepresentable|StringRepresentable[], + value: any, + customizer?: SetWithCustomizer + ): TResult; + + /** + * @see _.setWith + */ + setWith( + object: Object, + path: StringRepresentable|StringRepresentable[], + value: V, + customizer?: SetWithCustomizer + ): TResult; + + /** + * @see _.setWith + */ + setWith( + object: O, + path: StringRepresentable|StringRepresentable[], + value: V, + customizer?: SetWithCustomizer + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.setWith + */ + setWith( + path: StringRepresentable|StringRepresentable[], + value: any, + customizer?: SetWithCustomizer + ): LoDashImplicitObjectWrapper; + + /** + * @see _.setWith + */ + setWith( + path: StringRepresentable|StringRepresentable[], + value: V, + customizer?: SetWithCustomizer + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.setWith + */ + setWith( + path: StringRepresentable|StringRepresentable[], + value: any, + customizer?: SetWithCustomizer + ): LoDashExplicitObjectWrapper; + + /** + * @see _.setWith + */ + setWith( + path: StringRepresentable|StringRepresentable[], + value: V, + customizer?: SetWithCustomizer + ): LoDashExplicitObjectWrapper; + } + + //_.toPairs + interface LoDashStatic { + /** + * Creates an array of own enumerable key-value pairs for object. + * + * @param object The object to query. + * @return Returns the new array of key-value pairs. + */ + toPairs(object?: T): any[][]; + + toPairs(object?: T): TResult[][]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.toPairs + */ + toPairs(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.toPairs + */ + toPairs(): LoDashExplicitArrayWrapper; + } + + //_.toPairsIn + interface LoDashStatic { + /** + * Creates an array of own and inherited enumerable key-value pairs for object. + * + * @param object The object to query. + * @return Returns the new array of key-value pairs. + */ + toPairsIn(object?: T): any[][]; + + toPairsIn(object?: T): TResult[][]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.toPairsIn + */ + toPairsIn(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.toPairsIn + */ + toPairsIn(): LoDashExplicitArrayWrapper; + } + + //_.transform + interface LoDashStatic { + /** + * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of + * running each of its own enumerable properties through iteratee, with each invocation potentially mutating + * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, + * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param accumulator The custom accumulator value. + * @param thisArg The this binding of iteratee. + * @return Returns the accumulated value. + */ + transform( + object: T[], + iteratee?: MemoVoidArrayIterator, + accumulator?: TResult[] + ): TResult[]; + + /** + * @see _.transform + */ + transform( + object: T[], + iteratee?: MemoVoidArrayIterator>, + accumulator?: Dictionary + ): Dictionary; + + /** + * @see _.transform + */ + transform( + object: Dictionary, + iteratee?: MemoVoidDictionaryIterator>, + accumulator?: Dictionary + ): Dictionary; + + /** + * @see _.transform + */ + transform( + object: Dictionary, + iteratee?: MemoVoidDictionaryIterator, + accumulator?: TResult[] + ): TResult[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.transform + */ + transform( + iteratee?: MemoVoidArrayIterator, + accumulator?: TResult[] + ): LoDashImplicitArrayWrapper; + + /** + * @see _.transform + */ + transform( + iteratee?: MemoVoidArrayIterator>, + accumulator?: Dictionary + ): LoDashImplicitObjectWrapper>; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.transform + */ + transform( + iteratee?: MemoVoidDictionaryIterator>, + accumulator?: Dictionary + ): LoDashImplicitObjectWrapper>; + + /** + * @see _.transform + */ + transform( + iteratee?: MemoVoidDictionaryIterator, + accumulator?: TResult[] + ): LoDashImplicitArrayWrapper; + } + + //_.unset + interface LoDashStatic { + /** + * Removes the property at path of object. + * + * Note: This method mutates object. + * + * @param object The object to modify. + * @param path The path of the property to unset. + * @return Returns true if the property is deleted, else false. + */ + unset( + object: T, + path: StringRepresentable|StringRepresentable[] + ): boolean; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.unset + */ + unset(path: StringRepresentable|StringRepresentable[]): LoDashImplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.unset + */ + unset(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper; + } + + //_.update + interface LoDashStatic { + /** + * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to + * customize path creation. The updater is invoked with one argument: (value). + * + * @param object The object to modify. + * @param path The path of the property to set. + * @param updater The function to produce the updated value. + * @return Returns object. + */ + update( + object: Object, + path: StringRepresentable|StringRepresentable[], + updater: Function + ): TResult; + + /** + * @see _.update + */ + update( + object: Object, + path: StringRepresentable|StringRepresentable[], + updater: U + ): TResult; + + /** + * @see _.update + */ + update( + object: O, + path: StringRepresentable|StringRepresentable[], + updater: Function + ): TResult; + + /** + * @see _.update + */ + update( + object: O, + path: StringRepresentable|StringRepresentable[], + updater: U + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.update + */ + update( + path: StringRepresentable|StringRepresentable[], + updater: any + ): LoDashImplicitObjectWrapper; + + /** + * @see _.update + */ + update( + path: StringRepresentable|StringRepresentable[], + updater: U + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.update + */ + update( + path: StringRepresentable|StringRepresentable[], + updater: any + ): LoDashExplicitObjectWrapper; + + /** + * @see _.update + */ + update( + path: StringRepresentable|StringRepresentable[], + updater: U + ): LoDashExplicitObjectWrapper; + } + + //_.values + interface LoDashStatic { + /** + * Creates an array of the own enumerable property values of object. + * + * @param object The object to query. + * @return Returns an array of property values. + */ + values(object?: Dictionary): T[]; + + /** + * @see _.values + */ + values(object?: any): T[]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.values + */ + values(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.values + */ + values(): LoDashExplicitArrayWrapper; + } + + //_.valuesIn + interface LoDashStatic { + /** + * Creates an array of the own and inherited enumerable property values of object. + * + * @param object The object to query. + * @return Returns the array of property values. + */ + valuesIn(object?: Dictionary): T[]; + + /** + * @see _.valuesIn + */ + valuesIn(object?: any): T[]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.valuesIn + */ + valuesIn(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.valuesIn + */ + valuesIn(): LoDashExplicitArrayWrapper; + } + + /********** + * String * + **********/ + + //_.camelCase + interface LoDashStatic { + /** + * Converts string to camel case. + * + * @param string The string to convert. + * @return Returns the camel cased string. + */ + camelCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.camelCase + */ + camelCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.camelCase + */ + camelCase(): LoDashExplicitWrapper; + } + + //_.capitalize + interface LoDashStatic { + /** + * Converts the first character of string to upper case and the remaining to lower case. + * + * @param string The string to capitalize. + * @return Returns the capitalized string. + */ + capitalize(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.capitalize + */ + capitalize(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.capitalize + */ + capitalize(): LoDashExplicitWrapper; + } + + //_.deburr + interface LoDashStatic { + /** + * Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining + * diacritical marks. + * + * @param string The string to deburr. + * @return Returns the deburred string. + */ + deburr(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.deburr + */ + deburr(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.deburr + */ + deburr(): LoDashExplicitWrapper; + } + + //_.endsWith + interface LoDashStatic { + /** + * Checks if string ends with the given target string. + * + * @param string The string to search. + * @param target The string to search for. + * @param position The position to search from. + * @return Returns true if string ends with target, else false. + */ + endsWith( + string?: string, + target?: string, + position?: number + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.endsWith + */ + endsWith( + target?: string, + position?: number + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.endsWith + */ + endsWith( + target?: string, + position?: number + ): LoDashExplicitWrapper; + } + + // _.escape + interface LoDashStatic { + /** + * Converts the characters "&", "<", ">", '"', "'", and "`" in string to their corresponding HTML entities. + * + * Note: No other characters are escaped. To escape additional characters use a third-party library like he. + * + * hough the ">" character is escaped for symmetry, characters like ">" and "/" don’t need escaping in HTML + * and have no special meaning unless they're part of a tag or unquoted attribute value. See Mathias Bynens’s + * article (under "semi-related fun fact") for more details. + * + * Backticks are escaped because in IE < 9, they can break out of attribute values or HTML comments. See #59, + * #102, #108, and #133 of the HTML5 Security Cheatsheet for more details. + * + * When working with HTML you should always quote attribute values to reduce XSS vectors. + * + * @param string The string to escape. + * @return Returns the escaped string. + */ + escape(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.escape + */ + escape(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.escape + */ + escape(): LoDashExplicitWrapper; + } + + // _.escapeRegExp + interface LoDashStatic { + /** + * Escapes the RegExp special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", + * "{", "}", and "|" in string. + * + * @param string The string to escape. + * @return Returns the escaped string. + */ + escapeRegExp(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.escapeRegExp + */ + escapeRegExp(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.escapeRegExp + */ + escapeRegExp(): LoDashExplicitWrapper; + } + + //_.kebabCase + interface LoDashStatic { + /** + * Converts string to kebab case. + * + * @param string The string to convert. + * @return Returns the kebab cased string. + */ + kebabCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.kebabCase + */ + kebabCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.kebabCase + */ + kebabCase(): LoDashExplicitWrapper; + } + + //_.lowerCase + interface LoDashStatic { + /** + * Converts `string`, as space separated words, to lower case. + * + * @param string The string to convert. + * @return Returns the lower cased string. + */ + lowerCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.lowerCase + */ + lowerCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.lowerCase + */ + lowerCase(): LoDashExplicitWrapper; + } + + //_.lowerFirst + interface LoDashStatic { + /** + * Converts the first character of `string` to lower case. + * + * @param string The string to convert. + * @return Returns the converted string. + */ + lowerFirst(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.lowerFirst + */ + lowerFirst(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.lowerFirst + */ + lowerFirst(): LoDashExplicitWrapper; + } + + //_.pad + interface LoDashStatic { + /** + * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if + * they can’t be evenly divided by length. + * + * @param string The string to pad. + * @param length The padding length. + * @param chars The string used as padding. + * @return Returns the padded string. + */ + pad( + string?: string, + length?: number, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.pad + */ + pad( + length?: number, + chars?: string + ): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.pad + */ + pad( + length?: number, + chars?: string + ): LoDashExplicitWrapper; + } + + //_.padEnd + interface LoDashStatic { + /** + * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed + * length. + * + * @param string The string to pad. + * @param length The padding length. + * @param chars The string used as padding. + * @return Returns the padded string. + */ + padEnd( + string?: string, + length?: number, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.padEnd + */ + padEnd( + length?: number, + chars?: string + ): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.padEnd + */ + padEnd( + length?: number, + chars?: string + ): LoDashExplicitWrapper; + } + + //_.padStart + interface LoDashStatic { + /** + * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed + * length. + * + * @param string The string to pad. + * @param length The padding length. + * @param chars The string used as padding. + * @return Returns the padded string. + */ + padStart( + string?: string, + length?: number, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.padStart + */ + padStart( + length?: number, + chars?: string + ): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.padStart + */ + padStart( + length?: number, + chars?: string + ): LoDashExplicitWrapper; + } + + //_.parseInt + interface LoDashStatic { + /** + * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used + * unless value is a hexadecimal, in which case a radix of 16 is used. + * + * Note: This method aligns with the ES5 implementation of parseInt. + * + * @param string The string to convert. + * @param radix The radix to interpret value by. + * @return Returns the converted integer. + */ + parseInt( + string: string, + radix?: number + ): number; + } + + interface LoDashImplicitWrapper { + /** + * @see _.parseInt + */ + parseInt(radix?: number): number; + } + + interface LoDashExplicitWrapper { + /** + * @see _.parseInt + */ + parseInt(radix?: number): LoDashExplicitWrapper; + } + + //_.repeat + interface LoDashStatic { + /** + * Repeats the given string n times. + * + * @param string The string to repeat. + * @param n The number of times to repeat the string. + * @return Returns the repeated string. + */ + repeat( + string?: string, + n?: number + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.repeat + */ + repeat(n?: number): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.repeat + */ + repeat(n?: number): LoDashExplicitWrapper; + } + + //_.replace + interface LoDashStatic { + /** + * Replaces matches for pattern in string with replacement. + * + * Note: This method is based on String#replace. + * + * @param string + * @param pattern + * @param replacement + * @return Returns the modified string. + */ + replace( + string: string, + pattern: RegExp|string, + replacement: Function|string + ): string; + + /** + * @see _.replace + */ + replace( + pattern?: RegExp|string, + replacement?: Function|string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.replace + */ + replace( + pattern?: RegExp|string, + replacement?: Function|string + ): string; + + /** + * @see _.replace + */ + replace( + replacement?: Function|string + ): string; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.replace + */ + replace( + pattern?: RegExp|string, + replacement?: Function|string + ): string; + + /** + * @see _.replace + */ + replace( + replacement?: Function|string + ): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.replace + */ + replace( + pattern?: RegExp|string, + replacement?: Function|string + ): LoDashExplicitWrapper; + + /** + * @see _.replace + */ + replace( + replacement?: Function|string + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.replace + */ + replace( + pattern?: RegExp|string, + replacement?: Function|string + ): LoDashExplicitWrapper; + + /** + * @see _.replace + */ + replace( + replacement?: Function|string + ): LoDashExplicitWrapper; + } + + //_.snakeCase + interface LoDashStatic { + /** + * Converts string to snake case. + * + * @param string The string to convert. + * @return Returns the snake cased string. + */ + snakeCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.snakeCase + */ + snakeCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.snakeCase + */ + snakeCase(): LoDashExplicitWrapper; + } + + //_.split + interface LoDashStatic { + /** + * Splits string by separator. + * + * Note: This method is based on String#split. + * + * @param string + * @param separator + * @param limit + * @return Returns the new array of string segments. + */ + split( + string: string, + separator?: RegExp|string, + limit?: number + ): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.split + */ + split( + separator?: RegExp|string, + limit?: number + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.split + */ + split( + separator?: RegExp|string, + limit?: number + ): LoDashExplicitArrayWrapper; + } + + //_.startCase + interface LoDashStatic { + /** + * Converts string to start case. + * + * @param string The string to convert. + * @return Returns the start cased string. + */ + startCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.startCase + */ + startCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.startCase + */ + startCase(): LoDashExplicitWrapper; + } + + //_.startsWith + interface LoDashStatic { + /** + * Checks if string starts with the given target string. + * + * @param string The string to search. + * @param target The string to search for. + * @param position The position to search from. + * @return Returns true if string starts with target, else false. + */ + startsWith( + string?: string, + target?: string, + position?: number + ): boolean; + } + + interface LoDashImplicitWrapper { + /** + * @see _.startsWith + */ + startsWith( + target?: string, + position?: number + ): boolean; + } + + interface LoDashExplicitWrapper { + /** + * @see _.startsWith + */ + startsWith( + target?: string, + position?: number + ): LoDashExplicitWrapper; + } + + //_.template + interface TemplateOptions extends TemplateSettings { + /** + * The sourceURL of the template's compiled source. + */ + sourceURL?: string; + } + + interface TemplateExecutor { + (data?: Object): string; + source: string; + } + + interface LoDashStatic { + /** + * Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, + * HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" + * delimiters. Data properties may be accessed as free variables in the template. If a setting object is + * provided it takes precedence over _.templateSettings values. + * + * Note: In the development build _.template utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier + * debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @param string The template string. + * @param options The options object. + * @param options.escape The HTML "escape" delimiter. + * @param options.evaluate The "evaluate" delimiter. + * @param options.imports An object to import into the template as free variables. + * @param options.interpolate The "interpolate" delimiter. + * @param options.sourceURL The sourceURL of the template's compiled source. + * @param options.variable The data object variable name. + * @return Returns the compiled template function. + */ + template( + string: string, + options?: TemplateOptions + ): TemplateExecutor; + } + + interface LoDashImplicitWrapper { + /** + * @see _.template + */ + template(options?: TemplateOptions): TemplateExecutor; + } + + interface LoDashExplicitWrapper { + /** + * @see _.template + */ + template(options?: TemplateOptions): LoDashExplicitObjectWrapper; + } + + //_.toLower + interface LoDashStatic { + /** + * Converts `string`, as a whole, to lower case. + * + * @param string The string to convert. + * @return Returns the lower cased string. + */ + toLower(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toLower + */ + toLower(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toLower + */ + toLower(): LoDashExplicitWrapper; + } + + //_.toUpper + interface LoDashStatic { + /** + * Converts `string`, as a whole, to upper case. + * + * @param string The string to convert. + * @return Returns the upper cased string. + */ + toUpper(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.toUpper + */ + toUpper(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.toUpper + */ + toUpper(): LoDashExplicitWrapper; + } + + //_.trim + interface LoDashStatic { + /** + * Removes leading and trailing whitespace or specified characters from string. + * + * @param string The string to trim. + * @param chars The characters to trim. + * @return Returns the trimmed string. + */ + trim( + string?: string, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.trim + */ + trim(chars?: string): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.trim + */ + trim(chars?: string): LoDashExplicitWrapper; + } + + //_.trimEnd + interface LoDashStatic { + /** + * Removes trailing whitespace or specified characters from string. + * + * @param string The string to trim. + * @param chars The characters to trim. + * @return Returns the trimmed string. + */ + trimEnd( + string?: string, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.trimEnd + */ + trimEnd(chars?: string): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.trimEnd + */ + trimEnd(chars?: string): LoDashExplicitWrapper; + } + + //_.trimStart + interface LoDashStatic { + /** + * Removes leading whitespace or specified characters from string. + * + * @param string The string to trim. + * @param chars The characters to trim. + * @return Returns the trimmed string. + */ + trimStart( + string?: string, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.trimStart + */ + trimStart(chars?: string): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.trimStart + */ + trimStart(chars?: string): LoDashExplicitWrapper; + } + + //_.truncate + interface TruncateOptions { + /** The maximum string length. */ + length?: number; + /** The string to indicate text is omitted. */ + omission?: string; + /** The separator pattern to truncate to. */ + separator?: string|RegExp; + } + + interface LoDashStatic { + /** + * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated + * string are replaced with the omission string which defaults to "…". + * + * @param string The string to truncate. + * @param options The options object or maximum string length. + * @return Returns the truncated string. + */ + truncate( + string?: string, + options?: TruncateOptions + ): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.truncate + */ + truncate(options?: TruncateOptions): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.truncate + */ + truncate(options?: TruncateOptions): LoDashExplicitWrapper; + } + + //_.unescape + interface LoDashStatic { + /** + * The inverse of _.escape; this method converts the HTML entities &, <, >, ", ', and ` + * in string to their corresponding characters. + * + * Note: No other HTML entities are unescaped. To unescape additional HTML entities use a third-party library + * like he. + * + * @param string The string to unescape. + * @return Returns the unescaped string. + */ + unescape(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.unescape + */ + unescape(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.unescape + */ + unescape(): LoDashExplicitWrapper; + } + + //_.upperCase + interface LoDashStatic { + /** + * Converts `string`, as space separated words, to upper case. + * + * @param string The string to convert. + * @return Returns the upper cased string. + */ + upperCase(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.upperCase + */ + upperCase(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.upperCase + */ + upperCase(): LoDashExplicitWrapper; + } + + //_.upperFirst + interface LoDashStatic { + /** + * Converts the first character of `string` to upper case. + * + * @param string The string to convert. + * @return Returns the converted string. + */ + upperFirst(string?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.upperFirst + */ + upperFirst(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.upperFirst + */ + upperFirst(): LoDashExplicitWrapper; + } + + //_.words + interface LoDashStatic { + /** + * Splits `string` into an array of its words. + * + * @param string The string to inspect. + * @param pattern The pattern to match words. + * @return Returns the words of `string`. + */ + words( + string?: string, + pattern?: string|RegExp + ): string[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.words + */ + words(pattern?: string|RegExp): string[]; + } + + interface LoDashExplicitWrapper { + /** + * @see _.words + */ + words(pattern?: string|RegExp): LoDashExplicitArrayWrapper; + } + + /*********** + * Utility * + ***********/ + + //_.attempt + interface LoDashStatic { + /** + * Attempts to invoke func, returning either the result or the caught error object. Any additional arguments + * are provided to func when it’s invoked. + * + * @param func The function to attempt. + * @return Returns the func result or error object. + */ + attempt(func: (...args: any[]) => TResult, ...args: any[]): TResult|Error; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.attempt + */ + attempt(...args: any[]): TResult|Error; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.attempt + */ + attempt(...args: any[]): LoDashExplicitObjectWrapper; + } + + //_.constant + interface LoDashStatic { + /** + * Creates a function that returns value. + * + * @param value The value to return from the new function. + * @return Returns the new function. + */ + constant(value: T): () => T; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.constant + */ + constant(): LoDashImplicitObjectWrapper<() => TResult>; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.constant + */ + constant(): LoDashExplicitObjectWrapper<() => TResult>; + } + + //_.defaultTo + interface LoDashStatic { + /** + * Checks `value` to determine whether a default value should be returned in + * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, + * or `undefined`. + * + * @param value The value to check. + * @param defaultValue The default value. + * @returns Returns the resolved value. + */ + defaultTo(value: T, defaultValue: T): T; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.defaultTo + */ + defaultTo(value: TResult): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.defaultTo + */ + defaultTo(value: TResult): LoDashExplicitObjectWrapper; + } + + //_.identity + interface LoDashStatic { + /** + * This method returns the first argument provided to it. + * + * @param value Any value. + * @return Returns value. + */ + identity(value?: T): T; + } + + interface LoDashImplicitWrapper { + /** + * @see _.identity + */ + identity(): T; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.identity + */ + identity(): T[]; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.identity + */ + identity(): T; + } + + interface LoDashExplicitWrapper { + /** + * @see _.identity + */ + identity(): LoDashExplicitWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.identity + */ + identity(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.identity + */ + identity(): LoDashExplicitObjectWrapper; + } + + //_.iteratee + interface LoDashStatic { + /** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name the created callback returns the + * property value for a given element. If `func` is an object the created + * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. + * + * @static + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // create custom iteratee shorthands + * _.iteratee = _.wrap(_.iteratee, function(callback, func) { + * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); + * return !p ? callback(func) : function(object) { + * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); + * }; + * }); + * + * _.filter(users, 'age > 36'); + * // => [{ 'user': 'fred', 'age': 40 }] + */ + iteratee( + func: Function + ): (...args: any[]) => TResult; + + /** + * @see _.iteratee + */ + iteratee( + func: string + ): (object: any) => TResult; + + /** + * @see _.iteratee + */ + iteratee( + func: Object + ): (object: any) => boolean; + + /** + * @see _.iteratee + */ + iteratee(): (value: TResult) => TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.iteratee + */ + iteratee(): LoDashImplicitObjectWrapper<(object: any) => TResult>; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.iteratee + */ + iteratee(): LoDashImplicitObjectWrapper<(object: any) => boolean>; + + /** + * @see _.iteratee + */ + iteratee(): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.iteratee + */ + iteratee(): LoDashExplicitObjectWrapper<(object: any) => TResult>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.iteratee + */ + iteratee(): LoDashExplicitObjectWrapper<(object: any) => boolean>; + + /** + * @see _.iteratee + */ + iteratee(): LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; + } + + //_.matches + interface LoDashStatic { + /** + * Creates a function that performs a deep comparison between a given object and source, returning true if the + * given object has equivalent property values, else false. + * + * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and + * strings. Objects are compared by their own, not inherited, enumerable properties. For comparing a single own + * or inherited property value see _.matchesProperty. + * + * @param source The object of property values to match. + * @return Returns the new function. + */ + matches(source: T): (value: any) => boolean; + + /** + * @see _.matches + */ + matches(source: T): (value: V) => boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.matches + */ + matches(): LoDashImplicitObjectWrapper<(value: V) => boolean>; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.matches + */ + matches(): LoDashExplicitObjectWrapper<(value: V) => boolean>; + } + + //_.matchesProperty + interface LoDashStatic { + /** + * Creates a function that compares the property value of path on a given object to value. + * + * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and + * strings. Objects are compared by their own, not inherited, enumerable properties. + * + * @param path The path of the property to get. + * @param srcValue The value to match. + * @return Returns the new function. + */ + matchesProperty( + path: StringRepresentable|StringRepresentable[], + srcValue: T + ): (value: any) => boolean; + + /** + * @see _.matchesProperty + */ + matchesProperty( + path: StringRepresentable|StringRepresentable[], + srcValue: T + ): (value: V) => boolean; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.matchesProperty + */ + matchesProperty( + srcValue: SrcValue + ): LoDashImplicitObjectWrapper<(value: any) => boolean>; + + /** + * @see _.matchesProperty + */ + matchesProperty( + srcValue: SrcValue + ): LoDashImplicitObjectWrapper<(value: Value) => boolean>; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.matchesProperty + */ + matchesProperty( + srcValue: SrcValue + ): LoDashExplicitObjectWrapper<(value: any) => boolean>; + + /** + * @see _.matchesProperty + */ + matchesProperty( + srcValue: SrcValue + ): LoDashExplicitObjectWrapper<(value: Value) => boolean>; + } + + //_.method + interface LoDashStatic { + /** + * Creates a function that invokes the method at path on a given object. Any additional arguments are provided + * to the invoked method. + * + * @param path The path of the method to invoke. + * @param args The arguments to invoke the method with. + * @return Returns the new function. + */ + method( + path: string|StringRepresentable[], + ...args: any[] + ): (object: TObject) => TResult; + + /** + * @see _.method + */ + method( + path: string|StringRepresentable[], + ...args: any[] + ): (object: any) => TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.method + */ + method(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>; + + /** + * @see _.method + */ + method(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.method + */ + method(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>; + + /** + * @see _.method + */ + method(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.method + */ + method(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>; + + /** + * @see _.method + */ + method(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.method + */ + method(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>; + + /** + * @see _.method + */ + method(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>; + } + + //_.methodOf + interface LoDashStatic { + /** + * The opposite of _.method; this method creates a function that invokes the method at a given path on object. + * Any additional arguments are provided to the invoked method. + * + * @param object The object to query. + * @param args The arguments to invoke the method with. + * @return Returns the new function. + */ + methodOf( + object: TObject, + ...args: any[] + ): (path: StringRepresentable|StringRepresentable[]) => TResult; + + /** + * @see _.methodOf + */ + methodOf( + object: {}, + ...args: any[] + ): (path: StringRepresentable|StringRepresentable[]) => TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.methodOf + */ + methodOf( + ...args: any[] + ): LoDashImplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.methodOf + */ + methodOf( + ...args: any[] + ): LoDashExplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>; + } + + //_.mixin + interface MixinOptions { + chain?: boolean; + } + + interface LoDashStatic { + /** + * Adds all own enumerable function properties of a source object to the destination object. If object is a + * function then methods are added to its prototype as well. + * + * Note: Use _.runInContext to create a pristine lodash function to avoid conflicts caused by modifying + * the original. + * + * @param object The destination object. + * @param source The object of functions to add. + * @param options The options object. + * @param options.chain Specify whether the functions added are chainable. + * @return Returns object. + */ + mixin( + object: TObject, + source: Dictionary, + options?: MixinOptions + ): TResult; + + /** + * @see _.mixin + */ + mixin( + source: Dictionary, + options?: MixinOptions + ): TResult; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.mixin + */ + mixin( + source: Dictionary, + options?: MixinOptions + ): LoDashImplicitObjectWrapper; + + /** + * @see _.mixin + */ + mixin( + options?: MixinOptions + ): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.mixin + */ + mixin( + source: Dictionary, + options?: MixinOptions + ): LoDashExplicitObjectWrapper; + + /** + * @see _.mixin + */ + mixin( + options?: MixinOptions + ): LoDashExplicitObjectWrapper; + } + + //_.noConflict + interface LoDashStatic { + /** + * Reverts the _ variable to its previous value and returns a reference to the lodash function. + * + * @return Returns the lodash function. + */ + noConflict(): typeof _; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.noConflict + */ + noConflict(): typeof _; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.noConflict + */ + noConflict(): LoDashExplicitObjectWrapper; + } + + //_.noop + interface LoDashStatic { + /** + * A no-operation function that returns undefined regardless of the arguments it receives. + * + * @return undefined + */ + noop(...args: any[]): void; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.noop + */ + noop(...args: any[]): void; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.noop + */ + noop(...args: any[]): _.LoDashExplicitWrapper; + } + + //_.nthArg + interface LoDashStatic { + /** + * Creates a function that returns its nth argument. + * + * @param n The index of the argument to return. + * @return Returns the new function. + */ + nthArg(n?: number): TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.nthArg + */ + nthArg(): LoDashImplicitObjectWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.nthArg + */ + nthArg(): LoDashExplicitObjectWrapper; + } + + //_.over + interface LoDashStatic { + /** + * Creates a function that invokes iteratees with the arguments provided to the created function and returns + * their results. + * + * @param iteratees The iteratees to invoke. + * @return Returns the new function. + */ + over(...iteratees: (Function|Function[])[]): (...args: any[]) => TResult[]; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.over + */ + over(...iteratees: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.over + */ + over(...iteratees: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.over + */ + over(...iteratees: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.over + */ + over(...iteratees: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>; + } + + //_.overEvery + interface LoDashStatic { + /** + * Creates a function that checks if all of the predicates return truthy when invoked with the arguments + * provided to the created function. + * + * @param predicates The predicates to check. + * @return Returns the new function. + */ + overEvery(...predicates: (Function|Function[])[]): (...args: any[]) => boolean; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.overEvery + */ + overEvery(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.overEvery + */ + overEvery(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.overEvery + */ + overEvery(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.overEvery + */ + overEvery(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + } + + //_.overSome + interface LoDashStatic { + /** + * Creates a function that checks if any of the predicates return truthy when invoked with the arguments + * provided to the created function. + * + * @param predicates The predicates to check. + * @return Returns the new function. + */ + overSome(...predicates: (Function|Function[])[]): (...args: any[]) => boolean; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.overSome + */ + overSome(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.overSome + */ + overSome(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.overSome + */ + overSome(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.overSome + */ + overSome(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + } + + //_.property + interface LoDashStatic { + /** + * Creates a function that returns the property value at path on a given object. + * + * @param path The path of the property to get. + * @return Returns the new function. + */ + property(path: StringRepresentable|StringRepresentable[]): (obj: TObj) => TResult; + } + + interface LoDashImplicitWrapper { + /** + * @see _.property + */ + property(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>; + } + + interface LoDashImplicitArrayWrapper { + /** + * @see _.property + */ + property(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>; + } + + interface LoDashExplicitWrapper { + /** + * @see _.property + */ + property(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.property + */ + property(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>; + } + + //_.propertyOf + interface LoDashStatic { + /** + * The opposite of _.property; this method creates a function that returns the property value at a given path + * on object. + * + * @param object The object to query. + * @return Returns the new function. + */ + propertyOf(object: T): (path: string|string[]) => any; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.propertyOf + */ + propertyOf(): LoDashImplicitObjectWrapper<(path: string|string[]) => any>; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.propertyOf + */ + propertyOf(): LoDashExplicitObjectWrapper<(path: string|string[]) => any>; + } + + //_.range + interface LoDashStatic { + /** + * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. + * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length + * range is created unless a negative step is specified. + * + * @param start The start of the range. + * @param end The end of the range. + * @param step The value to increment or decrement by. + * @return Returns a new range array. + */ + range( + start: number, + end: number, + step?: number + ): number[]; + + /** + * @see _.range + */ + range( + end: number, + step?: number + ): number[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.range + */ + range( + end?: number, + step?: number + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.range + */ + range( + end?: number, + step?: number + ): LoDashExplicitArrayWrapper; + } + + //_.rangeRight + interface LoDashStatic { + /** + * This method is like `_.range` except that it populates values in + * descending order. + * + * @static + * @memberOf _ + * @category Util + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @param {number} [step=1] The value to increment or decrement by. + * @returns {Array} Returns the new array of numbers. + * @example + * + * _.rangeRight(4); + * // => [3, 2, 1, 0] + * + * _.rangeRight(-4); + * // => [-3, -2, -1, 0] + * + * _.rangeRight(1, 5); + * // => [4, 3, 2, 1] + * + * _.rangeRight(0, 20, 5); + * // => [15, 10, 5, 0] + * + * _.rangeRight(0, -4, -1); + * // => [-3, -2, -1, 0] + * + * _.rangeRight(1, 4, 0); + * // => [1, 1, 1] + * + * _.rangeRight(0); + * // => [] + */ + rangeRight( + start: number, + end: number, + step?: number + ): number[]; + + /** + * @see _.rangeRight + */ + rangeRight( + end: number, + step?: number + ): number[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.rangeRight + */ + rangeRight( + end?: number, + step?: number + ): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitWrapper { + /** + * @see _.rangeRight + */ + rangeRight( + end?: number, + step?: number + ): LoDashExplicitArrayWrapper; + } + + //_.runInContext + interface LoDashStatic { + /** + * Create a new pristine lodash function using the given context object. + * + * @param context The context object. + * @return Returns a new lodash function. + */ + runInContext(context?: Object): typeof _; + } + + interface LoDashImplicitObjectWrapper { + /** + * @see _.runInContext + */ + runInContext(): typeof _; + } + + //_.times + interface LoDashStatic { + /** + * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee + * is invoked with one argument; (index). + * + * @param n The number of times to invoke iteratee. + * @param iteratee The function invoked per iteration. + * @return Returns the array of results. + */ + times( + n: number, + iteratee: (num: number) => TResult + ): TResult[]; + + /** + * @see _.times + */ + times(n: number): number[]; + } + + interface LoDashImplicitWrapper { + /** + * @see _.times + */ + times( + iteratee: (num: number) => TResult + ): TResult[]; + + /** + * @see _.times + */ + times(): number[]; + } + + interface LoDashExplicitWrapper { + /** + * @see _.times + */ + times( + iteratee: (num: number) => TResult + ): LoDashExplicitArrayWrapper; + + /** + * @see _.times + */ + times(): LoDashExplicitArrayWrapper; + } + + //_.toPath + interface LoDashStatic { + /** + * Converts `value` to a property path array. + * + * @static + * @memberOf _ + * @category Util + * @param {*} value The value to convert. + * @returns {Array} Returns the new property path array. + * @example + * + * _.toPath('a.b.c'); + * // => ['a', 'b', 'c'] + * + * _.toPath('a[0].b.c'); + * // => ['a', '0', 'b', 'c'] + * + * var path = ['a', 'b', 'c'], + * newPath = _.toPath(path); + * + * console.log(newPath); + * // => ['a', 'b', 'c'] + * + * console.log(path === newPath); + * // => false + */ + toPath(value: any): string[]; + } + + interface LoDashImplicitWrapperBase { + /** + * @see _.toPath + */ + toPath(): LoDashImplicitWrapper; + } + + interface LoDashExplicitWrapperBase { + /** + * @see _.toPath + */ + toPath(): LoDashExplicitWrapper; + } + + //_.uniqueId + interface LoDashStatic { + /** + * Generates a unique ID. If prefix is provided the ID is appended to it. + * + * @param prefix The value to prefix the ID with. + * @return Returns the unique ID. + */ + uniqueId(prefix?: string): string; + } + + interface LoDashImplicitWrapper { + /** + * @see _.uniqueId + */ + uniqueId(): string; + } + + interface LoDashExplicitWrapper { + /** + * @see _.uniqueId + */ + uniqueId(): LoDashExplicitWrapper; + } + + interface ListIterator { + (value: T, index: number, collection: List): TResult; + } + + interface DictionaryIterator { + (value: T, key?: string, collection?: Dictionary): TResult; + } + + interface NumericDictionaryIterator { + (value: T, key?: number, collection?: Dictionary): TResult; + } + + interface ObjectIterator { + (element: T, key?: string, collection?: any): TResult; + } + + interface StringIterator { + (char: string, index?: number, string?: string): TResult; + } + + interface MemoVoidIterator { + (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): void; + } + interface MemoIterator { + (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): TResult; + } + + interface MemoVoidArrayIterator { + (acc: TResult, curr: T, index?: number, arr?: T[]): void; + } + interface MemoVoidDictionaryIterator { + (acc: TResult, curr: T, key?: string, dict?: Dictionary): void; + } + + //interface Collection {} + + // Common interface between Arrays and jQuery objects + interface List { + [index: number]: T; + length: number; + } + + interface Dictionary { + [index: string]: T; + } + + interface NumericDictionary { + [index: number]: T; + } + + interface StringRepresentable { + toString(): string; + } + + interface Cancelable { + cancel(): void; + flush(): void; + } +} + +// Named exports + +declare module "lodash/after" { + const after: typeof _.after; + export = after; +} + + +declare module "lodash/ary" { + const ary: typeof _.ary; + export = ary; +} + + +declare module "lodash/assign" { + const assign: typeof _.assign; + export = assign; +} + + +declare module "lodash/assignIn" { + const assignIn: typeof _.assignIn; + export = assignIn; +} + + +declare module "lodash/assignInWith" { + const assignInWith: typeof _.assignInWith; + export = assignInWith; +} + + +declare module "lodash/assignWith" { + const assignWith: typeof _.assignWith; + export = assignWith; +} + + +declare module "lodash/at" { + const at: typeof _.at; + export = at; +} + + +declare module "lodash/before" { + const before: typeof _.before; + export = before; +} + + +declare module "lodash/bind" { + const bind: typeof _.bind; + export = bind; +} + + +declare module "lodash/bindAll" { + const bindAll: typeof _.bindAll; + export = bindAll; +} + + +declare module "lodash/bindKey" { + const bindKey: typeof _.bindKey; + export = bindKey; +} + + +declare module "lodash/castArray" { + const castArray: typeof _.castArray; + export = castArray; +} + + +declare module "lodash/chain" { + const chain: typeof _.chain; + export = chain; +} + + +declare module "lodash/chunk" { + const chunk: typeof _.chunk; + export = chunk; +} + + +declare module "lodash/compact" { + const compact: typeof _.compact; + export = compact; +} + + +declare module "lodash/concat" { + const concat: typeof _.concat; + export = concat; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash/cond" { + const cond: typeof _.cond; + export = cond; + } + */ + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash/conforms" { + const conforms: typeof _.conforms; + export = conforms; + } + */ + +declare module "lodash/constant" { + const constant: typeof _.constant; + export = constant; +} + + +declare module "lodash/countBy" { + const countBy: typeof _.countBy; + export = countBy; +} + + +declare module "lodash/create" { + const create: typeof _.create; + export = create; +} + + +declare module "lodash/curry" { + const curry: typeof _.curry; + export = curry; +} + + +declare module "lodash/curryRight" { + const curryRight: typeof _.curryRight; + export = curryRight; +} + + +declare module "lodash/debounce" { + const debounce: typeof _.debounce; + export = debounce; +} + + +declare module "lodash/defaults" { + const defaults: typeof _.defaults; + export = defaults; +} + + +declare module "lodash/defaultsDeep" { + const defaultsDeep: typeof _.defaultsDeep; + export = defaultsDeep; +} + + +declare module "lodash/defer" { + const defer: typeof _.defer; + export = defer; +} + + +declare module "lodash/delay" { + const delay: typeof _.delay; + export = delay; +} + + +declare module "lodash/difference" { + const difference: typeof _.difference; + export = difference; +} + + +declare module "lodash/differenceBy" { + const differenceBy: typeof _.differenceBy; + export = differenceBy; +} + + +declare module "lodash/differenceWith" { + const differenceWith: typeof _.differenceWith; + export = differenceWith; +} + + +declare module "lodash/drop" { + const drop: typeof _.drop; + export = drop; +} + + +declare module "lodash/dropRight" { + const dropRight: typeof _.dropRight; + export = dropRight; +} + + +declare module "lodash/dropRightWhile" { + const dropRightWhile: typeof _.dropRightWhile; + export = dropRightWhile; +} + + +declare module "lodash/dropWhile" { + const dropWhile: typeof _.dropWhile; + export = dropWhile; +} + + +declare module "lodash/fill" { + const fill: typeof _.fill; + export = fill; +} + + +declare module "lodash/filter" { + const filter: typeof _.filter; + export = filter; +} + + +declare module "lodash/flatMap" { + const flatMap: typeof _.flatMap; + export = flatMap; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash/flatMapDeep" { + const flatMapDeep: typeof _.flatMapDeep; + export = flatMapDeep; + } + */ +/** + * uncoment it if definition exists + */ +/* + declare module "lodash/flatMapDepth" { + const flatMapDepth: typeof _.flatMapDepth; + export = flatMapDepth; + } + */ + +declare module "lodash/flatten" { + const flatten: typeof _.flatten; + export = flatten; +} + + +declare module "lodash/flattenDeep" { + const flattenDeep: typeof _.flattenDeep; + export = flattenDeep; +} + +declare module "lodash/flattenDepth" { + const flattenDepth: typeof _.flattenDepth; + export = flattenDepth; +} + +declare module "lodash/flip" { + const flip: typeof _.flip; + export = flip; +} + + +declare module "lodash/flow" { + const flow: typeof _.flow; + export = flow; +} + + +declare module "lodash/flowRight" { + const flowRight: typeof _.flowRight; + export = flowRight; +} + + +declare module "lodash/fromPairs" { + const fromPairs: typeof _.fromPairs; + export = fromPairs; +} + + +declare module "lodash/functions" { + const functions: typeof _.functions; + export = functions; +} + + +declare module "lodash/functionsIn" { + const functionsIn: typeof _.functionsIn; + export = functionsIn; +} + + +declare module "lodash/groupBy" { + const groupBy: typeof _.groupBy; + export = groupBy; +} + + +declare module "lodash/initial" { + const initial: typeof _.initial; + export = initial; +} + + +declare module "lodash/intersection" { + const intersection: typeof _.intersection; + export = intersection; +} + + +declare module "lodash/intersectionBy" { + const intersectionBy: typeof _.intersectionBy; + export = intersectionBy; +} + + +declare module "lodash/intersectionWith" { + const intersectionWith: typeof _.intersectionWith; + export = intersectionWith; +} + + +declare module "lodash/invert" { + const invert: typeof _.invert; + export = invert; +} + + +declare module "lodash/invertBy" { + const invertBy: typeof _.invertBy; + export = invertBy; +} + + +declare module "lodash/invokeMap" { + const invokeMap: typeof _.invokeMap; + export = invokeMap; +} + + +declare module "lodash/iteratee" { + const iteratee: typeof _.iteratee; + export = iteratee; +} + + +declare module "lodash/keyBy" { + const keyBy: typeof _.keyBy; + export = keyBy; +} + + +declare module "lodash/keys" { + const keys: typeof _.keys; + export = keys; +} + + +declare module "lodash/keysIn" { + const keysIn: typeof _.keysIn; + export = keysIn; +} + + +declare module "lodash/map" { + const map: typeof _.map; + export = map; +} + + +declare module "lodash/mapKeys" { + const mapKeys: typeof _.mapKeys; + export = mapKeys; +} + + +declare module "lodash/mapValues" { + const mapValues: typeof _.mapValues; + export = mapValues; +} + + +declare module "lodash/matches" { + const matches: typeof _.matches; + export = matches; +} + + +declare module "lodash/matchesProperty" { + const matchesProperty: typeof _.matchesProperty; + export = matchesProperty; +} + + +declare module "lodash/memoize" { + const memoize: typeof _.memoize; + export = memoize; +} + + +declare module "lodash/merge" { + const merge: typeof _.merge; + export = merge; +} + + +declare module "lodash/mergeWith" { + const mergeWith: typeof _.mergeWith; + export = mergeWith; +} + + +declare module "lodash/method" { + const method: typeof _.method; + export = method; +} + + +declare module "lodash/methodOf" { + const methodOf: typeof _.methodOf; + export = methodOf; +} + + +declare module "lodash/mixin" { + const mixin: typeof _.mixin; + export = mixin; +} + + +declare module "lodash/negate" { + const negate: typeof _.negate; + export = negate; +} + + +declare module "lodash/nthArg" { + const nthArg: typeof _.nthArg; + export = nthArg; +} + + +declare module "lodash/omit" { + const omit: typeof _.omit; + export = omit; +} + + +declare module "lodash/omitBy" { + const omitBy: typeof _.omitBy; + export = omitBy; +} + + +declare module "lodash/once" { + const once: typeof _.once; + export = once; +} + + +declare module "lodash/orderBy" { + const orderBy: typeof _.orderBy; + export = orderBy; +} + + +declare module "lodash/over" { + const over: typeof _.over; + export = over; +} + + +declare module "lodash/overArgs" { + const overArgs: typeof _.overArgs; + export = overArgs; +} + + +declare module "lodash/overEvery" { + const overEvery: typeof _.overEvery; + export = overEvery; +} + + +declare module "lodash/overSome" { + const overSome: typeof _.overSome; + export = overSome; +} + + +declare module "lodash/partial" { + const partial: typeof _.partial; + export = partial; +} + + +declare module "lodash/partialRight" { + const partialRight: typeof _.partialRight; + export = partialRight; +} + + +declare module "lodash/partition" { + const partition: typeof _.partition; + export = partition; +} + + +declare module "lodash/pick" { + const pick: typeof _.pick; + export = pick; +} + + +declare module "lodash/pickBy" { + const pickBy: typeof _.pickBy; + export = pickBy; +} + + +declare module "lodash/property" { + const property: typeof _.property; + export = property; +} + + +declare module "lodash/propertyOf" { + const propertyOf: typeof _.propertyOf; + export = propertyOf; +} + + +declare module "lodash/pull" { + const pull: typeof _.pull; + export = pull; +} + + +declare module "lodash/pullAll" { + const pullAll: typeof _.pullAll; + export = pullAll; +} + + +declare module "lodash/pullAllBy" { + const pullAllBy: typeof _.pullAllBy; + export = pullAllBy; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash/pullAllWith" { + const pullAllWith: typeof _.pullAllWith; + export = pullAllWith; + } + */ + +declare module "lodash/pullAt" { + const pullAt: typeof _.pullAt; + export = pullAt; +} + + +declare module "lodash/range" { + const range: typeof _.range; + export = range; +} + + +declare module "lodash/rangeRight" { + const rangeRight: typeof _.rangeRight; + export = rangeRight; +} + + +declare module "lodash/rearg" { + const rearg: typeof _.rearg; + export = rearg; +} + + +declare module "lodash/reject" { + const reject: typeof _.reject; + export = reject; +} + + +declare module "lodash/remove" { + const remove: typeof _.remove; + export = remove; +} + + +declare module "lodash/rest" { + const rest: typeof _.rest; + export = rest; +} + + +declare module "lodash/reverse" { + const reverse: typeof _.reverse; + export = reverse; +} + + +declare module "lodash/sampleSize" { + const sampleSize: typeof _.sampleSize; + export = sampleSize; +} + + +declare module "lodash/set" { + const set: typeof _.set; + export = set; +} + + +declare module "lodash/setWith" { + const setWith: typeof _.setWith; + export = setWith; +} + + +declare module "lodash/shuffle" { + const shuffle: typeof _.shuffle; + export = shuffle; +} + + +declare module "lodash/slice" { + const slice: typeof _.slice; + export = slice; +} + + +declare module "lodash/sortBy" { + const sortBy: typeof _.sortBy; + export = sortBy; +} + + +declare module "lodash/sortedUniq" { + const sortedUniq: typeof _.sortedUniq; + export = sortedUniq; +} + + +declare module "lodash/sortedUniqBy" { + const sortedUniqBy: typeof _.sortedUniqBy; + export = sortedUniqBy; +} + + +declare module "lodash/split" { + const split: typeof _.split; + export = split; +} + + +declare module "lodash/spread" { + const spread: typeof _.spread; + export = spread; +} + + +declare module "lodash/tail" { + const tail: typeof _.tail; + export = tail; +} + + +declare module "lodash/take" { + const take: typeof _.take; + export = take; +} + + +declare module "lodash/takeRight" { + const takeRight: typeof _.takeRight; + export = takeRight; +} + + +declare module "lodash/takeRightWhile" { + const takeRightWhile: typeof _.takeRightWhile; + export = takeRightWhile; +} + + +declare module "lodash/takeWhile" { + const takeWhile: typeof _.takeWhile; + export = takeWhile; +} + + +declare module "lodash/tap" { + const tap: typeof _.tap; + export = tap; +} + + +declare module "lodash/throttle" { + const throttle: typeof _.throttle; + export = throttle; +} + + +declare module "lodash/thru" { + const thru: typeof _.thru; + export = thru; +} + + +declare module "lodash/toArray" { + const toArray: typeof _.toArray; + export = toArray; +} + + +declare module "lodash/toPairs" { + const toPairs: typeof _.toPairs; + export = toPairs; +} + + +declare module "lodash/toPairsIn" { + const toPairsIn: typeof _.toPairsIn; + export = toPairsIn; +} + + +declare module "lodash/toPath" { + const toPath: typeof _.toPath; + export = toPath; +} + + +declare module "lodash/toPlainObject" { + const toPlainObject: typeof _.toPlainObject; + export = toPlainObject; +} + + +declare module "lodash/transform" { + const transform: typeof _.transform; + export = transform; +} + + +declare module "lodash/unary" { + const unary: typeof _.unary; + export = unary; +} + + +declare module "lodash/union" { + const union: typeof _.union; + export = union; +} + + +declare module "lodash/unionBy" { + const unionBy: typeof _.unionBy; + export = unionBy; +} + + +declare module "lodash/unionWith" { + const unionWith: typeof _.unionWith; + export = unionWith; +} + + +declare module "lodash/uniq" { + const uniq: typeof _.uniq; + export = uniq; +} + + +declare module "lodash/uniqBy" { + const uniqBy: typeof _.uniqBy; + export = uniqBy; +} + + +declare module "lodash/uniqWith" { + const uniqWith: typeof _.uniqWith; + export = uniqWith; +} + + +declare module "lodash/unset" { + const unset: typeof _.unset; + export = unset; +} + + +declare module "lodash/unzip" { + const unzip: typeof _.unzip; + export = unzip; +} + + +declare module "lodash/unzipWith" { + const unzipWith: typeof _.unzipWith; + export = unzipWith; +} + + +declare module "lodash/update" { + const update: typeof _.update; + export = update; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash/updateWith" { + const updateWith: typeof _.updateWith; + export = updateWith; + } + */ + +declare module "lodash/values" { + const values: typeof _.values; + export = values; +} + + +declare module "lodash/valuesIn" { + const valuesIn: typeof _.valuesIn; + export = valuesIn; +} + + +declare module "lodash/without" { + const without: typeof _.without; + export = without; +} + + +declare module "lodash/words" { + const words: typeof _.words; + export = words; +} + + +declare module "lodash/wrap" { + const wrap: typeof _.wrap; + export = wrap; +} + + +declare module "lodash/xor" { + const xor: typeof _.xor; + export = xor; +} + + +declare module "lodash/xorBy" { + const xorBy: typeof _.xorBy; + export = xorBy; +} + + +declare module "lodash/xorWith" { + const xorWith: typeof _.xorWith; + export = xorWith; +} + + +declare module "lodash/zip" { + const zip: typeof _.zip; + export = zip; +} + + +declare module "lodash/zipObject" { + const zipObject: typeof _.zipObject; + export = zipObject; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash/zipObjectDeep" { + const zipObjectDeep: typeof _.zipObjectDeep; + export = zipObjectDeep; + } + */ + + +declare module "lodash/zipWith" { + const zipWith: typeof _.zipWith; + export = zipWith; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash/entries" { + const entries: typeof _.entries; + export = entries; + } + */ +/** + * uncoment it if definition exists + */ +/* + declare module "lodash/entriesIn" { + const entriesIn: typeof _.entriesIn; + export = entriesIn; + } + */ + + +declare module "lodash/extend" { + const extend: typeof _.extend; + export = extend; +} + + +declare module "lodash/extendWith" { + const extendWith: typeof _.extendWith; + export = extendWith; +} + + +declare module "lodash/add" { + const add: typeof _.add; + export = add; +} + + +declare module "lodash/attempt" { + const attempt: typeof _.attempt; + export = attempt; +} + + +declare module "lodash/camelCase" { + const camelCase: typeof _.camelCase; + export = camelCase; +} + + +declare module "lodash/capitalize" { + const capitalize: typeof _.capitalize; + export = capitalize; +} + + +declare module "lodash/ceil" { + const ceil: typeof _.ceil; + export = ceil; +} + + +declare module "lodash/clamp" { + const clamp: typeof _.clamp; + export = clamp; +} + + +declare module "lodash/clone" { + const clone: typeof _.clone; + export = clone; +} + + +declare module "lodash/cloneDeep" { + const cloneDeep: typeof _.cloneDeep; + export = cloneDeep; +} + + +declare module "lodash/cloneDeepWith" { + const cloneDeepWith: typeof _.cloneDeepWith; + export = cloneDeepWith; +} + + +declare module "lodash/cloneWith" { + const cloneWith: typeof _.cloneWith; + export = cloneWith; +} + + +declare module "lodash/deburr" { + const deburr: typeof _.deburr; + export = deburr; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash/divide" { + const divide: typeof _.divide; + export = divide; + } + */ + +declare module "lodash/endsWith" { + const endsWith: typeof _.endsWith; + export = endsWith; +} + + +declare module "lodash/eq" { + const eq: typeof _.eq; + export = eq; +} + + +declare module "lodash/escape" { + const escape: typeof _.escape; + export = escape; +} + + +declare module "lodash/escapeRegExp" { + const escapeRegExp: typeof _.escapeRegExp; + export = escapeRegExp; +} + + +declare module "lodash/every" { + const every: typeof _.every; + export = every; +} + + +declare module "lodash/find" { + const find: typeof _.find; + export = find; +} + + +declare module "lodash/findIndex" { + const findIndex: typeof _.findIndex; + export = findIndex; +} + + +declare module "lodash/findKey" { + const findKey: typeof _.findKey; + export = findKey; +} + + +declare module "lodash/findLast" { + const findLast: typeof _.findLast; + export = findLast; +} + + +declare module "lodash/findLastIndex" { + const findLastIndex: typeof _.findLastIndex; + export = findLastIndex; +} + + +declare module "lodash/findLastKey" { + const findLastKey: typeof _.findLastKey; + export = findLastKey; +} + + +declare module "lodash/floor" { + const floor: typeof _.floor; + export = floor; +} + + +declare module "lodash/forEach" { + const forEach: typeof _.forEach; + export = forEach; +} + + +declare module "lodash/forEachRight" { + const forEachRight: typeof _.forEachRight; + export = forEachRight; +} + + +declare module "lodash/forIn" { + const forIn: typeof _.forIn; + export = forIn; +} + + +declare module "lodash/forInRight" { + const forInRight: typeof _.forInRight; + export = forInRight; +} + + +declare module "lodash/forOwn" { + const forOwn: typeof _.forOwn; + export = forOwn; +} + + +declare module "lodash/forOwnRight" { + const forOwnRight: typeof _.forOwnRight; + export = forOwnRight; +} + + +declare module "lodash/get" { + const get: typeof _.get; + export = get; +} + + +declare module "lodash/gt" { + const gt: typeof _.gt; + export = gt; +} + + +declare module "lodash/gte" { + const gte: typeof _.gte; + export = gte; +} + + +declare module "lodash/has" { + const has: typeof _.has; + export = has; +} + + +declare module "lodash/hasIn" { + const hasIn: typeof _.hasIn; + export = hasIn; +} + + +declare module "lodash/head" { + const head: typeof _.head; + export = head; +} + + +declare module "lodash/identity" { + const identity: typeof _.identity; + export = identity; +} + + +declare module "lodash/includes" { + const includes: typeof _.includes; + export = includes; +} + + +declare module "lodash/indexOf" { + const indexOf: typeof _.indexOf; + export = indexOf; +} + + +declare module "lodash/inRange" { + const inRange: typeof _.inRange; + export = inRange; +} + + +declare module "lodash/invoke" { + const invoke: typeof _.invoke; + export = invoke; +} + + +declare module "lodash/isArguments" { + const isArguments: typeof _.isArguments; + export = isArguments; +} + + +declare module "lodash/isArray" { + const isArray: typeof _.isArray; + export = isArray; +} + + +declare module "lodash/isArrayBuffer" { + const isArrayBuffer: typeof _.isArrayBuffer; + export = isArrayBuffer; +} + + +declare module "lodash/isArrayLike" { + const isArrayLike: typeof _.isArrayLike; + export = isArrayLike; +} + + +declare module "lodash/isArrayLikeObject" { + const isArrayLikeObject: typeof _.isArrayLikeObject; + export = isArrayLikeObject; +} + + +declare module "lodash/isBoolean" { + const isBoolean: typeof _.isBoolean; + export = isBoolean; +} + + +declare module "lodash/isBuffer" { + const isBuffer: typeof _.isBuffer; + export = isBuffer; +} + + +declare module "lodash/isDate" { + const isDate: typeof _.isDate; + export = isDate; +} + + +declare module "lodash/isElement" { + const isElement: typeof _.isElement; + export = isElement; +} + + +declare module "lodash/isEmpty" { + const isEmpty: typeof _.isEmpty; + export = isEmpty; +} + + +declare module "lodash/isEqual" { + const isEqual: typeof _.isEqual; + export = isEqual; +} + + +declare module "lodash/isEqualWith" { + const isEqualWith: typeof _.isEqualWith; + export = isEqualWith; +} + + +declare module "lodash/isError" { + const isError: typeof _.isError; + export = isError; +} + + +declare module "lodash/isFinite" { + const isFinite: typeof _.isFinite; + export = isFinite; +} + + +declare module "lodash/isFunction" { + const isFunction: typeof _.isFunction; + export = isFunction; +} + + +declare module "lodash/isInteger" { + const isInteger: typeof _.isInteger; + export = isInteger; +} + + +declare module "lodash/isLength" { + const isLength: typeof _.isLength; + export = isLength; +} + + +declare module "lodash/isMap" { + const isMap: typeof _.isMap; + export = isMap; +} + + +declare module "lodash/isMatch" { + const isMatch: typeof _.isMatch; + export = isMatch; +} + + +declare module "lodash/isMatchWith" { + const isMatchWith: typeof _.isMatchWith; + export = isMatchWith; +} + + +declare module "lodash/isNaN" { + const isNaN: typeof _.isNaN; + export = isNaN; +} + + +declare module "lodash/isNative" { + const isNative: typeof _.isNative; + export = isNative; +} + + +declare module "lodash/isNil" { + const isNil: typeof _.isNil; + export = isNil; +} + + +declare module "lodash/isNull" { + const isNull: typeof _.isNull; + export = isNull; +} + + +declare module "lodash/isNumber" { + const isNumber: typeof _.isNumber; + export = isNumber; +} + + +declare module "lodash/isObject" { + const isObject: typeof _.isObject; + export = isObject; +} + + +declare module "lodash/isObjectLike" { + const isObjectLike: typeof _.isObjectLike; + export = isObjectLike; +} + + +declare module "lodash/isPlainObject" { + const isPlainObject: typeof _.isPlainObject; + export = isPlainObject; +} + + +declare module "lodash/isRegExp" { + const isRegExp: typeof _.isRegExp; + export = isRegExp; +} + + +declare module "lodash/isSafeInteger" { + const isSafeInteger: typeof _.isSafeInteger; + export = isSafeInteger; +} + + +declare module "lodash/isSet" { + const isSet: typeof _.isSet; + export = isSet; +} + + +declare module "lodash/isString" { + const isString: typeof _.isString; + export = isString; +} + + +declare module "lodash/isSymbol" { + const isSymbol: typeof _.isSymbol; + export = isSymbol; +} + + +declare module "lodash/isTypedArray" { + const isTypedArray: typeof _.isTypedArray; + export = isTypedArray; +} + + +declare module "lodash/isUndefined" { + const isUndefined: typeof _.isUndefined; + export = isUndefined; +} + + +declare module "lodash/isWeakMap" { + const isWeakMap: typeof _.isWeakMap; + export = isWeakMap; +} + + +declare module "lodash/isWeakSet" { + const isWeakSet: typeof _.isWeakSet; + export = isWeakSet; +} + + +declare module "lodash/join" { + const join: typeof _.join; + export = join; +} + + +declare module "lodash/kebabCase" { + const kebabCase: typeof _.kebabCase; + export = kebabCase; +} + + +declare module "lodash/last" { + const last: typeof _.last; + export = last; +} + + +declare module "lodash/lastIndexOf" { + const lastIndexOf: typeof _.lastIndexOf; + export = lastIndexOf; +} + + +declare module "lodash/lowerCase" { + const lowerCase: typeof _.lowerCase; + export = lowerCase; +} + + +declare module "lodash/lowerFirst" { + const lowerFirst: typeof _.lowerFirst; + export = lowerFirst; +} + + +declare module "lodash/lt" { + const lt: typeof _.lt; + export = lt; +} + + +declare module "lodash/lte" { + const lte: typeof _.lte; + export = lte; +} + + +declare module "lodash/max" { + const max: typeof _.max; + export = max; +} + + +declare module "lodash/maxBy" { + const maxBy: typeof _.maxBy; + export = maxBy; +} + + +declare module "lodash/mean" { + const mean: typeof _.mean; + export = mean; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash/meanBy" { + const meanBy: typeof _.meanBy; + export = meanBy; + } + */ + +declare module "lodash/min" { + const min: typeof _.min; + export = min; +} + + +declare module "lodash/minBy" { + const minBy: typeof _.minBy; + export = minBy; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash/multiply" { + const multiply: typeof _.multiply; + export = multiply; + } + */ + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash/nth" { + const nth: typeof _.nth; + export = nth; + } + */ + +declare module "lodash/noConflict" { + const noConflict: typeof _.noConflict; + export = noConflict; +} + + +declare module "lodash/noop" { + const noop: typeof _.noop; + export = noop; +} + + +declare module "lodash/now" { + const now: typeof _.now; + export = now; +} + + +declare module "lodash/pad" { + const pad: typeof _.pad; + export = pad; +} + + +declare module "lodash/padEnd" { + const padEnd: typeof _.padEnd; + export = padEnd; +} + + +declare module "lodash/padStart" { + const padStart: typeof _.padStart; + export = padStart; +} + + +declare module "lodash/parseInt" { + const parseInt: typeof _.parseInt; + export = parseInt; +} + + +declare module "lodash/random" { + const random: typeof _.random; + export = random; +} + + +declare module "lodash/reduce" { + const reduce: typeof _.reduce; + export = reduce; +} + + +declare module "lodash/reduceRight" { + const reduceRight: typeof _.reduceRight; + export = reduceRight; +} + + +declare module "lodash/repeat" { + const repeat: typeof _.repeat; + export = repeat; +} + + +declare module "lodash/replace" { + const replace: typeof _.replace; + export = replace; +} + + +declare module "lodash/result" { + const result: typeof _.result; + export = result; +} + + +declare module "lodash/round" { + const round: typeof _.round; + export = round; +} + + +declare module "lodash/runInContext" { + const runInContext: typeof _.runInContext; + export = runInContext; +} + + +declare module "lodash/sample" { + const sample: typeof _.sample; + export = sample; +} + + +declare module "lodash/size" { + const size: typeof _.size; + export = size; +} + + +declare module "lodash/snakeCase" { + const snakeCase: typeof _.snakeCase; + export = snakeCase; +} + + +declare module "lodash/some" { + const some: typeof _.some; + export = some; +} + + +declare module "lodash/sortedIndex" { + const sortedIndex: typeof _.sortedIndex; + export = sortedIndex; +} + + +declare module "lodash/sortedIndexBy" { + const sortedIndexBy: typeof _.sortedIndexBy; + export = sortedIndexBy; +} + + +declare module "lodash/sortedIndexOf" { + const sortedIndexOf: typeof _.sortedIndexOf; + export = sortedIndexOf; +} + + +declare module "lodash/sortedLastIndex" { + const sortedLastIndex: typeof _.sortedLastIndex; + export = sortedLastIndex; +} + + +declare module "lodash/sortedLastIndexBy" { + const sortedLastIndexBy: typeof _.sortedLastIndexBy; + export = sortedLastIndexBy; +} + + +declare module "lodash/sortedLastIndexOf" { + const sortedLastIndexOf: typeof _.sortedLastIndexOf; + export = sortedLastIndexOf; +} + + +declare module "lodash/startCase" { + const startCase: typeof _.startCase; + export = startCase; +} + + +declare module "lodash/startsWith" { + const startsWith: typeof _.startsWith; + export = startsWith; +} + + +declare module "lodash/subtract" { + const subtract: typeof _.subtract; + export = subtract; +} + + +declare module "lodash/sum" { + const sum: typeof _.sum; + export = sum; +} + + +declare module "lodash/sumBy" { + const sumBy: typeof _.sumBy; + export = sumBy; +} + + +declare module "lodash/template" { + const template: typeof _.template; + export = template; +} + + +declare module "lodash/times" { + const times: typeof _.times; + export = times; +} + + +declare module "lodash/toInteger" { + const toInteger: typeof _.toInteger; + export = toInteger; +} + + +declare module "lodash/toLength" { + const toLength: typeof _.toLength; + export = toLength; +} + + +declare module "lodash/toLower" { + const toLower: typeof _.toLower; + export = toLower; +} + + +declare module "lodash/toNumber" { + const toNumber: typeof _.toNumber; + export = toNumber; +} + + +declare module "lodash/toSafeInteger" { + const toSafeInteger: typeof _.toSafeInteger; + export = toSafeInteger; +} + + +declare module "lodash/toString" { + const toString: typeof _.toString; + export = toString; +} + + +declare module "lodash/toUpper" { + const toUpper: typeof _.toUpper; + export = toUpper; +} + + +declare module "lodash/trim" { + const trim: typeof _.trim; + export = trim; +} + + +declare module "lodash/trimEnd" { + const trimEnd: typeof _.trimEnd; + export = trimEnd; +} + + +declare module "lodash/trimStart" { + const trimStart: typeof _.trimStart; + export = trimStart; +} + + +declare module "lodash/truncate" { + const truncate: typeof _.truncate; + export = truncate; +} + + +declare module "lodash/unescape" { + const unescape: typeof _.unescape; + export = unescape; +} + + +declare module "lodash/uniqueId" { + const uniqueId: typeof _.uniqueId; + export = uniqueId; +} + + +declare module "lodash/upperCase" { + const upperCase: typeof _.upperCase; + export = upperCase; +} + + +declare module "lodash/upperFirst" { + const upperFirst: typeof _.upperFirst; + export = upperFirst; +} + + +declare module "lodash/each" { + const each: typeof _.each; + export = each; +} + + +declare module "lodash/eachRight" { + const eachRight: typeof _.eachRight; + export = eachRight; +} + + +declare module "lodash/first" { + const first: typeof _.first; + export = first; +} + +declare module "lodash/fp" { + export = _; +} + +declare module "lodash" { + export = _; +} + +/************************************************* + * * + * The lodash method _.XXX exported as a module. * + * * + *************************************************/ + + +declare module "lodash.after" { + const after: typeof _.after; + export = after; +} + + +declare module "lodash.ary" { + const ary: typeof _.ary; + export = ary; +} + + +declare module "lodash.assign" { + const assign: typeof _.assign; + export = assign; +} + + +declare module "lodash.assignIn" { + const assignIn: typeof _.assignIn; + export = assignIn; +} + + +declare module "lodash.assignInWith" { + const assignInWith: typeof _.assignInWith; + export = assignInWith; +} + + +declare module "lodash.assignWith" { + const assignWith: typeof _.assignWith; + export = assignWith; +} + + +declare module "lodash.at" { + const at: typeof _.at; + export = at; +} + + +declare module "lodash.before" { + const before: typeof _.before; + export = before; +} + + +declare module "lodash.bind" { + const bind: typeof _.bind; + export = bind; +} + + +declare module "lodash.bindAll" { + const bindAll: typeof _.bindAll; + export = bindAll; +} + + +declare module "lodash.bindKey" { + const bindKey: typeof _.bindKey; + export = bindKey; +} + + +declare module "lodash.castArray" { + const castArray: typeof _.castArray; + export = castArray; +} + + +declare module "lodash.chain" { + const chain: typeof _.chain; + export = chain; +} + + +declare module "lodash.chunk" { + const chunk: typeof _.chunk; + export = chunk; +} + + +declare module "lodash.compact" { + const compact: typeof _.compact; + export = compact; +} + + +declare module "lodash.concat" { + const concat: typeof _.concat; + export = concat; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash.cond" { + const cond: typeof _.cond; + export = cond; + } + */ + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash.conforms" { + const conforms: typeof _.conforms; + export = conforms; + } + */ + +declare module "lodash.constant" { + const constant: typeof _.constant; + export = constant; +} + + +declare module "lodash.countBy" { + const countBy: typeof _.countBy; + export = countBy; +} + + +declare module "lodash.create" { + const create: typeof _.create; + export = create; +} + + +declare module "lodash.curry" { + const curry: typeof _.curry; + export = curry; +} + + +declare module "lodash.curryRight" { + const curryRight: typeof _.curryRight; + export = curryRight; +} + + +declare module "lodash.debounce" { + const debounce: typeof _.debounce; + export = debounce; +} + + +declare module "lodash.defaults" { + const defaults: typeof _.defaults; + export = defaults; +} + + +declare module "lodash.defaultsDeep" { + const defaultsDeep: typeof _.defaultsDeep; + export = defaultsDeep; +} + + +declare module "lodash.defer" { + const defer: typeof _.defer; + export = defer; +} + + +declare module "lodash.delay" { + const delay: typeof _.delay; + export = delay; +} + + +declare module "lodash.difference" { + const difference: typeof _.difference; + export = difference; +} + + +declare module "lodash.differenceBy" { + const differenceBy: typeof _.differenceBy; + export = differenceBy; +} + + +declare module "lodash.differenceWith" { + const differenceWith: typeof _.differenceWith; + export = differenceWith; +} + + +declare module "lodash.drop" { + const drop: typeof _.drop; + export = drop; +} + + +declare module "lodash.dropRight" { + const dropRight: typeof _.dropRight; + export = dropRight; +} + + +declare module "lodash.dropRightWhile" { + const dropRightWhile: typeof _.dropRightWhile; + export = dropRightWhile; +} + + +declare module "lodash.dropWhile" { + const dropWhile: typeof _.dropWhile; + export = dropWhile; +} + + +declare module "lodash.fill" { + const fill: typeof _.fill; + export = fill; +} + + +declare module "lodash.filter" { + const filter: typeof _.filter; + export = filter; +} + + +declare module "lodash.flatMap" { + const flatMap: typeof _.flatMap; + export = flatMap; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash.flatMapDeep" { + const flatMapDeep: typeof _.flatMapDeep; + export = flatMapDeep; + } + */ +/** + * uncoment it if definition exists + */ +/* + declare module "lodash.flatMapDepth" { + const flatMapDepth: typeof _.flatMapDepth; + export = flatMapDepth; + } + */ + +declare module "lodash.flatten" { + const flatten: typeof _.flatten; + export = flatten; +} + + +declare module "lodash.flattenDeep" { + const flattenDeep: typeof _.flattenDeep; + export = flattenDeep; +} + +declare module "lodash.flattenDepth" { + const flattenDepth: typeof _.flattenDepth; + export = flattenDepth; +} + +declare module "lodash.flip" { + const flip: typeof _.flip; + export = flip; +} + + +declare module "lodash.flow" { + const flow: typeof _.flow; + export = flow; +} + + +declare module "lodash.flowRight" { + const flowRight: typeof _.flowRight; + export = flowRight; +} + + +declare module "lodash.fromPairs" { + const fromPairs: typeof _.fromPairs; + export = fromPairs; +} + + +declare module "lodash.functions" { + const functions: typeof _.functions; + export = functions; +} + + +declare module "lodash.functionsIn" { + const functionsIn: typeof _.functionsIn; + export = functionsIn; +} + + +declare module "lodash.groupBy" { + const groupBy: typeof _.groupBy; + export = groupBy; +} + + +declare module "lodash.initial" { + const initial: typeof _.initial; + export = initial; +} + + +declare module "lodash.intersection" { + const intersection: typeof _.intersection; + export = intersection; +} + + +declare module "lodash.intersectionBy" { + const intersectionBy: typeof _.intersectionBy; + export = intersectionBy; +} + + +declare module "lodash.intersectionWith" { + const intersectionWith: typeof _.intersectionWith; + export = intersectionWith; +} + + +declare module "lodash.invert" { + const invert: typeof _.invert; + export = invert; +} + + +declare module "lodash.invertBy" { + const invertBy: typeof _.invertBy; + export = invertBy; +} + + +declare module "lodash.invokeMap" { + const invokeMap: typeof _.invokeMap; + export = invokeMap; +} + + +declare module "lodash.iteratee" { + const iteratee: typeof _.iteratee; + export = iteratee; +} + + +declare module "lodash.keyBy" { + const keyBy: typeof _.keyBy; + export = keyBy; +} + + +declare module "lodash.keys" { + const keys: typeof _.keys; + export = keys; +} + + +declare module "lodash.keysIn" { + const keysIn: typeof _.keysIn; + export = keysIn; +} + + +declare module "lodash.map" { + const map: typeof _.map; + export = map; +} + + +declare module "lodash.mapKeys" { + const mapKeys: typeof _.mapKeys; + export = mapKeys; +} + + +declare module "lodash.mapValues" { + const mapValues: typeof _.mapValues; + export = mapValues; +} + + +declare module "lodash.matches" { + const matches: typeof _.matches; + export = matches; +} + + +declare module "lodash.matchesProperty" { + const matchesProperty: typeof _.matchesProperty; + export = matchesProperty; +} + + +declare module "lodash.memoize" { + const memoize: typeof _.memoize; + export = memoize; +} + + +declare module "lodash.merge" { + const merge: typeof _.merge; + export = merge; +} + + +declare module "lodash.mergeWith" { + const mergeWith: typeof _.mergeWith; + export = mergeWith; +} + + +declare module "lodash.method" { + const method: typeof _.method; + export = method; +} + + +declare module "lodash.methodOf" { + const methodOf: typeof _.methodOf; + export = methodOf; +} + + +declare module "lodash.mixin" { + const mixin: typeof _.mixin; + export = mixin; +} + + +declare module "lodash.negate" { + const negate: typeof _.negate; + export = negate; +} + + +declare module "lodash.nthArg" { + const nthArg: typeof _.nthArg; + export = nthArg; +} + + +declare module "lodash.omit" { + const omit: typeof _.omit; + export = omit; +} + + +declare module "lodash.omitBy" { + const omitBy: typeof _.omitBy; + export = omitBy; +} + + +declare module "lodash.once" { + const once: typeof _.once; + export = once; +} + + +declare module "lodash.orderBy" { + const orderBy: typeof _.orderBy; + export = orderBy; +} + + +declare module "lodash.over" { + const over: typeof _.over; + export = over; +} + + +declare module "lodash.overArgs" { + const overArgs: typeof _.overArgs; + export = overArgs; +} + + +declare module "lodash.overEvery" { + const overEvery: typeof _.overEvery; + export = overEvery; +} + + +declare module "lodash.overSome" { + const overSome: typeof _.overSome; + export = overSome; +} + + +declare module "lodash.partial" { + const partial: typeof _.partial; + export = partial; +} + + +declare module "lodash.partialRight" { + const partialRight: typeof _.partialRight; + export = partialRight; +} + + +declare module "lodash.partition" { + const partition: typeof _.partition; + export = partition; +} + + +declare module "lodash.pick" { + const pick: typeof _.pick; + export = pick; +} + + +declare module "lodash.pickBy" { + const pickBy: typeof _.pickBy; + export = pickBy; +} + + +declare module "lodash.property" { + const property: typeof _.property; + export = property; +} + + +declare module "lodash.propertyOf" { + const propertyOf: typeof _.propertyOf; + export = propertyOf; +} + + +declare module "lodash.pull" { + const pull: typeof _.pull; + export = pull; +} + + +declare module "lodash.pullAll" { + const pullAll: typeof _.pullAll; + export = pullAll; +} + + +declare module "lodash.pullAllBy" { + const pullAllBy: typeof _.pullAllBy; + export = pullAllBy; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash.pullAllWith" { + const pullAllWith: typeof _.pullAllWith; + export = pullAllWith; + } + */ + +declare module "lodash.pullAt" { + const pullAt: typeof _.pullAt; + export = pullAt; +} + + +declare module "lodash.range" { + const range: typeof _.range; + export = range; +} + + +declare module "lodash.rangeRight" { + const rangeRight: typeof _.rangeRight; + export = rangeRight; +} + + +declare module "lodash.rearg" { + const rearg: typeof _.rearg; + export = rearg; +} + + +declare module "lodash.reject" { + const reject: typeof _.reject; + export = reject; +} + + +declare module "lodash.remove" { + const remove: typeof _.remove; + export = remove; +} + + +declare module "lodash.rest" { + const rest: typeof _.rest; + export = rest; +} + + +declare module "lodash.reverse" { + const reverse: typeof _.reverse; + export = reverse; +} + + +declare module "lodash.sampleSize" { + const sampleSize: typeof _.sampleSize; + export = sampleSize; +} + + +declare module "lodash.set" { + const set: typeof _.set; + export = set; +} + + +declare module "lodash.setWith" { + const setWith: typeof _.setWith; + export = setWith; +} + + +declare module "lodash.shuffle" { + const shuffle: typeof _.shuffle; + export = shuffle; +} + + +declare module "lodash.slice" { + const slice: typeof _.slice; + export = slice; +} + + +declare module "lodash.sortBy" { + const sortBy: typeof _.sortBy; + export = sortBy; +} + + +declare module "lodash.sortedUniq" { + const sortedUniq: typeof _.sortedUniq; + export = sortedUniq; +} + + +declare module "lodash.sortedUniqBy" { + const sortedUniqBy: typeof _.sortedUniqBy; + export = sortedUniqBy; +} + + +declare module "lodash.split" { + const split: typeof _.split; + export = split; +} + + +declare module "lodash.spread" { + const spread: typeof _.spread; + export = spread; +} + + +declare module "lodash.tail" { + const tail: typeof _.tail; + export = tail; +} + + +declare module "lodash.take" { + const take: typeof _.take; + export = take; +} + + +declare module "lodash.takeRight" { + const takeRight: typeof _.takeRight; + export = takeRight; +} + + +declare module "lodash.takeRightWhile" { + const takeRightWhile: typeof _.takeRightWhile; + export = takeRightWhile; +} + + +declare module "lodash.takeWhile" { + const takeWhile: typeof _.takeWhile; + export = takeWhile; +} + + +declare module "lodash.tap" { + const tap: typeof _.tap; + export = tap; +} + + +declare module "lodash.throttle" { + const throttle: typeof _.throttle; + export = throttle; +} + + +declare module "lodash.thru" { + const thru: typeof _.thru; + export = thru; +} + + +declare module "lodash.toArray" { + const toArray: typeof _.toArray; + export = toArray; +} + + +declare module "lodash.toPairs" { + const toPairs: typeof _.toPairs; + export = toPairs; +} + + +declare module "lodash.toPairsIn" { + const toPairsIn: typeof _.toPairsIn; + export = toPairsIn; +} + + +declare module "lodash.toPath" { + const toPath: typeof _.toPath; + export = toPath; +} + + +declare module "lodash.toPlainObject" { + const toPlainObject: typeof _.toPlainObject; + export = toPlainObject; +} + + +declare module "lodash.transform" { + const transform: typeof _.transform; + export = transform; +} + + +declare module "lodash.unary" { + const unary: typeof _.unary; + export = unary; +} + + +declare module "lodash.union" { + const union: typeof _.union; + export = union; +} + + +declare module "lodash.unionBy" { + const unionBy: typeof _.unionBy; + export = unionBy; +} + + +declare module "lodash.unionWith" { + const unionWith: typeof _.unionWith; + export = unionWith; +} + + +declare module "lodash.uniq" { + const uniq: typeof _.uniq; + export = uniq; +} + + +declare module "lodash.uniqBy" { + const uniqBy: typeof _.uniqBy; + export = uniqBy; +} + + +declare module "lodash.uniqWith" { + const uniqWith: typeof _.uniqWith; + export = uniqWith; +} + + +declare module "lodash.unset" { + const unset: typeof _.unset; + export = unset; +} + + +declare module "lodash.unzip" { + const unzip: typeof _.unzip; + export = unzip; +} + + +declare module "lodash.unzipWith" { + const unzipWith: typeof _.unzipWith; + export = unzipWith; +} + + +declare module "lodash.update" { + const update: typeof _.update; + export = update; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash.updateWith" { + const updateWith: typeof _.updateWith; + export = updateWith; + } + */ + +declare module "lodash.values" { + const values: typeof _.values; + export = values; +} + + +declare module "lodash.valuesIn" { + const valuesIn: typeof _.valuesIn; + export = valuesIn; +} + + +declare module "lodash.without" { + const without: typeof _.without; + export = without; +} + + +declare module "lodash.words" { + const words: typeof _.words; + export = words; +} + + +declare module "lodash.wrap" { + const wrap: typeof _.wrap; + export = wrap; +} + + +declare module "lodash.xor" { + const xor: typeof _.xor; + export = xor; +} + + +declare module "lodash.xorBy" { + const xorBy: typeof _.xorBy; + export = xorBy; +} + + +declare module "lodash.xorWith" { + const xorWith: typeof _.xorWith; + export = xorWith; +} + + +declare module "lodash.zip" { + const zip: typeof _.zip; + export = zip; +} + + +declare module "lodash.zipObject" { + const zipObject: typeof _.zipObject; + export = zipObject; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash.zipObjectDeep" { + const zipObjectDeep: typeof _.zipObjectDeep; + export = zipObjectDeep; + } + */ + + +declare module "lodash.zipWith" { + const zipWith: typeof _.zipWith; + export = zipWith; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash.entries" { + const entries: typeof _.entries; + export = entries; + } + */ +/** + * uncoment it if definition exists + */ +/* + declare module "lodash.entriesIn" { + const entriesIn: typeof _.entriesIn; + export = entriesIn; + } + */ + + +declare module "lodash.extend" { + const extend: typeof _.extend; + export = extend; +} + + +declare module "lodash.extendWith" { + const extendWith: typeof _.extendWith; + export = extendWith; +} + + +declare module "lodash.add" { + const add: typeof _.add; + export = add; +} + + +declare module "lodash.attempt" { + const attempt: typeof _.attempt; + export = attempt; +} + + +declare module "lodash.camelCase" { + const camelCase: typeof _.camelCase; + export = camelCase; +} + + +declare module "lodash.capitalize" { + const capitalize: typeof _.capitalize; + export = capitalize; +} + + +declare module "lodash.ceil" { + const ceil: typeof _.ceil; + export = ceil; +} + + +declare module "lodash.clamp" { + const clamp: typeof _.clamp; + export = clamp; +} + + +declare module "lodash.clone" { + const clone: typeof _.clone; + export = clone; +} + + +declare module "lodash.cloneDeep" { + const cloneDeep: typeof _.cloneDeep; + export = cloneDeep; +} + + +declare module "lodash.cloneDeepWith" { + const cloneDeepWith: typeof _.cloneDeepWith; + export = cloneDeepWith; +} + + +declare module "lodash.cloneWith" { + const cloneWith: typeof _.cloneWith; + export = cloneWith; +} + + +declare module "lodash.deburr" { + const deburr: typeof _.deburr; + export = deburr; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash.divide" { + const divide: typeof _.divide; + export = divide; + } + */ + +declare module "lodash.endsWith" { + const endsWith: typeof _.endsWith; + export = endsWith; +} + + +declare module "lodash.eq" { + const eq: typeof _.eq; + export = eq; +} + + +declare module "lodash.escape" { + const escape: typeof _.escape; + export = escape; +} + + +declare module "lodash.escapeRegExp" { + const escapeRegExp: typeof _.escapeRegExp; + export = escapeRegExp; +} + + +declare module "lodash.every" { + const every: typeof _.every; + export = every; +} + + +declare module "lodash.find" { + const find: typeof _.find; + export = find; +} + + +declare module "lodash.findIndex" { + const findIndex: typeof _.findIndex; + export = findIndex; +} + + +declare module "lodash.findKey" { + const findKey: typeof _.findKey; + export = findKey; +} + + +declare module "lodash.findLast" { + const findLast: typeof _.findLast; + export = findLast; +} + + +declare module "lodash.findLastIndex" { + const findLastIndex: typeof _.findLastIndex; + export = findLastIndex; +} + + +declare module "lodash.findLastKey" { + const findLastKey: typeof _.findLastKey; + export = findLastKey; +} + + +declare module "lodash.floor" { + const floor: typeof _.floor; + export = floor; +} + + +declare module "lodash.forEach" { + const forEach: typeof _.forEach; + export = forEach; +} + + +declare module "lodash.forEachRight" { + const forEachRight: typeof _.forEachRight; + export = forEachRight; +} + + +declare module "lodash.forIn" { + const forIn: typeof _.forIn; + export = forIn; +} + + +declare module "lodash.forInRight" { + const forInRight: typeof _.forInRight; + export = forInRight; +} + + +declare module "lodash.forOwn" { + const forOwn: typeof _.forOwn; + export = forOwn; +} + + +declare module "lodash.forOwnRight" { + const forOwnRight: typeof _.forOwnRight; + export = forOwnRight; +} + + +declare module "lodash.get" { + const get: typeof _.get; + export = get; +} + + +declare module "lodash.gt" { + const gt: typeof _.gt; + export = gt; +} + + +declare module "lodash.gte" { + const gte: typeof _.gte; + export = gte; +} + + +declare module "lodash.has" { + const has: typeof _.has; + export = has; +} + + +declare module "lodash.hasIn" { + const hasIn: typeof _.hasIn; + export = hasIn; +} + + +declare module "lodash.head" { + const head: typeof _.head; + export = head; +} + + +declare module "lodash.identity" { + const identity: typeof _.identity; + export = identity; +} + + +declare module "lodash.includes" { + const includes: typeof _.includes; + export = includes; +} + + +declare module "lodash.indexOf" { + const indexOf: typeof _.indexOf; + export = indexOf; +} + + +declare module "lodash.inRange" { + const inRange: typeof _.inRange; + export = inRange; +} + + +declare module "lodash.invoke" { + const invoke: typeof _.invoke; + export = invoke; +} + + +declare module "lodash.isArguments" { + const isArguments: typeof _.isArguments; + export = isArguments; +} + + +declare module "lodash.isArray" { + const isArray: typeof _.isArray; + export = isArray; +} + + +declare module "lodash.isArrayBuffer" { + const isArrayBuffer: typeof _.isArrayBuffer; + export = isArrayBuffer; +} + + +declare module "lodash.isArrayLike" { + const isArrayLike: typeof _.isArrayLike; + export = isArrayLike; +} + + +declare module "lodash.isArrayLikeObject" { + const isArrayLikeObject: typeof _.isArrayLikeObject; + export = isArrayLikeObject; +} + + +declare module "lodash.isBoolean" { + const isBoolean: typeof _.isBoolean; + export = isBoolean; +} + + +declare module "lodash.isBuffer" { + const isBuffer: typeof _.isBuffer; + export = isBuffer; +} + + +declare module "lodash.isDate" { + const isDate: typeof _.isDate; + export = isDate; +} + + +declare module "lodash.isElement" { + const isElement: typeof _.isElement; + export = isElement; +} + + +declare module "lodash.isEmpty" { + const isEmpty: typeof _.isEmpty; + export = isEmpty; +} + + +declare module "lodash.isEqual" { + const isEqual: typeof _.isEqual; + export = isEqual; +} + + +declare module "lodash.isEqualWith" { + const isEqualWith: typeof _.isEqualWith; + export = isEqualWith; +} + + +declare module "lodash.isError" { + const isError: typeof _.isError; + export = isError; +} + + +declare module "lodash.isFinite" { + const isFinite: typeof _.isFinite; + export = isFinite; +} + + +declare module "lodash.isFunction" { + const isFunction: typeof _.isFunction; + export = isFunction; +} + + +declare module "lodash.isInteger" { + const isInteger: typeof _.isInteger; + export = isInteger; +} + + +declare module "lodash.isLength" { + const isLength: typeof _.isLength; + export = isLength; +} + + +declare module "lodash.isMap" { + const isMap: typeof _.isMap; + export = isMap; +} + + +declare module "lodash.isMatch" { + const isMatch: typeof _.isMatch; + export = isMatch; +} + + +declare module "lodash.isMatchWith" { + const isMatchWith: typeof _.isMatchWith; + export = isMatchWith; +} + + +declare module "lodash.isNaN" { + const isNaN: typeof _.isNaN; + export = isNaN; +} + + +declare module "lodash.isNative" { + const isNative: typeof _.isNative; + export = isNative; +} + + +declare module "lodash.isNil" { + const isNil: typeof _.isNil; + export = isNil; +} + + +declare module "lodash.isNull" { + const isNull: typeof _.isNull; + export = isNull; +} + + +declare module "lodash.isNumber" { + const isNumber: typeof _.isNumber; + export = isNumber; +} + + +declare module "lodash.isObject" { + const isObject: typeof _.isObject; + export = isObject; +} + + +declare module "lodash.isObjectLike" { + const isObjectLike: typeof _.isObjectLike; + export = isObjectLike; +} + + +declare module "lodash.isPlainObject" { + const isPlainObject: typeof _.isPlainObject; + export = isPlainObject; +} + + +declare module "lodash.isRegExp" { + const isRegExp: typeof _.isRegExp; + export = isRegExp; +} + + +declare module "lodash.isSafeInteger" { + const isSafeInteger: typeof _.isSafeInteger; + export = isSafeInteger; +} + + +declare module "lodash.isSet" { + const isSet: typeof _.isSet; + export = isSet; +} + + +declare module "lodash.isString" { + const isString: typeof _.isString; + export = isString; +} + + +declare module "lodash.isSymbol" { + const isSymbol: typeof _.isSymbol; + export = isSymbol; +} + + +declare module "lodash.isTypedArray" { + const isTypedArray: typeof _.isTypedArray; + export = isTypedArray; +} + + +declare module "lodash.isUndefined" { + const isUndefined: typeof _.isUndefined; + export = isUndefined; +} + + +declare module "lodash.isWeakMap" { + const isWeakMap: typeof _.isWeakMap; + export = isWeakMap; +} + + +declare module "lodash.isWeakSet" { + const isWeakSet: typeof _.isWeakSet; + export = isWeakSet; +} + + +declare module "lodash.join" { + const join: typeof _.join; + export = join; +} + + +declare module "lodash.kebabCase" { + const kebabCase: typeof _.kebabCase; + export = kebabCase; +} + + +declare module "lodash.last" { + const last: typeof _.last; + export = last; +} + + +declare module "lodash.lastIndexOf" { + const lastIndexOf: typeof _.lastIndexOf; + export = lastIndexOf; +} + + +declare module "lodash.lowerCase" { + const lowerCase: typeof _.lowerCase; + export = lowerCase; +} + + +declare module "lodash.lowerFirst" { + const lowerFirst: typeof _.lowerFirst; + export = lowerFirst; +} + + +declare module "lodash.lt" { + const lt: typeof _.lt; + export = lt; +} + + +declare module "lodash.lte" { + const lte: typeof _.lte; + export = lte; +} + + +declare module "lodash.max" { + const max: typeof _.max; + export = max; +} + + +declare module "lodash.maxBy" { + const maxBy: typeof _.maxBy; + export = maxBy; +} + + +declare module "lodash.mean" { + const mean: typeof _.mean; + export = mean; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash.meanBy" { + const meanBy: typeof _.meanBy; + export = meanBy; + } + */ + +declare module "lodash.min" { + const min: typeof _.min; + export = min; +} + + +declare module "lodash.minBy" { + const minBy: typeof _.minBy; + export = minBy; +} + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash.multiply" { + const multiply: typeof _.multiply; + export = multiply; + } + */ + +/** + * uncoment it if definition exists + */ +/* + declare module "lodash.nth" { + const nth: typeof _.nth; + export = nth; + } + */ + +declare module "lodash.noConflict" { + const noConflict: typeof _.noConflict; + export = noConflict; +} + + +declare module "lodash.noop" { + const noop: typeof _.noop; + export = noop; +} + + +declare module "lodash.now" { + const now: typeof _.now; + export = now; +} + + +declare module "lodash.pad" { + const pad: typeof _.pad; + export = pad; +} + + +declare module "lodash.padEnd" { + const padEnd: typeof _.padEnd; + export = padEnd; +} + + +declare module "lodash.padStart" { + const padStart: typeof _.padStart; + export = padStart; +} + + +declare module "lodash.parseInt" { + const parseInt: typeof _.parseInt; + export = parseInt; +} + + +declare module "lodash.random" { + const random: typeof _.random; + export = random; +} + + +declare module "lodash.reduce" { + const reduce: typeof _.reduce; + export = reduce; +} + + +declare module "lodash.reduceRight" { + const reduceRight: typeof _.reduceRight; + export = reduceRight; +} + + +declare module "lodash.repeat" { + const repeat: typeof _.repeat; + export = repeat; +} + + +declare module "lodash.replace" { + const replace: typeof _.replace; + export = replace; +} + + +declare module "lodash.result" { + const result: typeof _.result; + export = result; +} + + +declare module "lodash.round" { + const round: typeof _.round; + export = round; +} + + +declare module "lodash.runInContext" { + const runInContext: typeof _.runInContext; + export = runInContext; +} + + +declare module "lodash.sample" { + const sample: typeof _.sample; + export = sample; +} + + +declare module "lodash.size" { + const size: typeof _.size; + export = size; +} + + +declare module "lodash.snakeCase" { + const snakeCase: typeof _.snakeCase; + export = snakeCase; +} + + +declare module "lodash.some" { + const some: typeof _.some; + export = some; +} + + +declare module "lodash.sortedIndex" { + const sortedIndex: typeof _.sortedIndex; + export = sortedIndex; +} + + +declare module "lodash.sortedIndexBy" { + const sortedIndexBy: typeof _.sortedIndexBy; + export = sortedIndexBy; +} + + +declare module "lodash.sortedIndexOf" { + const sortedIndexOf: typeof _.sortedIndexOf; + export = sortedIndexOf; +} + + +declare module "lodash.sortedLastIndex" { + const sortedLastIndex: typeof _.sortedLastIndex; + export = sortedLastIndex; +} + + +declare module "lodash.sortedLastIndexBy" { + const sortedLastIndexBy: typeof _.sortedLastIndexBy; + export = sortedLastIndexBy; +} + + +declare module "lodash.sortedLastIndexOf" { + const sortedLastIndexOf: typeof _.sortedLastIndexOf; + export = sortedLastIndexOf; +} + + +declare module "lodash.startCase" { + const startCase: typeof _.startCase; + export = startCase; +} + + +declare module "lodash.startsWith" { + const startsWith: typeof _.startsWith; + export = startsWith; +} + + +declare module "lodash.subtract" { + const subtract: typeof _.subtract; + export = subtract; +} + + +declare module "lodash.sum" { + const sum: typeof _.sum; + export = sum; +} + + +declare module "lodash.sumBy" { + const sumBy: typeof _.sumBy; + export = sumBy; +} + + +declare module "lodash.template" { + const template: typeof _.template; + export = template; +} + + +declare module "lodash.times" { + const times: typeof _.times; + export = times; +} + + +declare module "lodash.toInteger" { + const toInteger: typeof _.toInteger; + export = toInteger; +} + + +declare module "lodash.toLength" { + const toLength: typeof _.toLength; + export = toLength; +} + + +declare module "lodash.toLower" { + const toLower: typeof _.toLower; + export = toLower; +} + + +declare module "lodash.toNumber" { + const toNumber: typeof _.toNumber; + export = toNumber; +} + + +declare module "lodash.toSafeInteger" { + const toSafeInteger: typeof _.toSafeInteger; + export = toSafeInteger; +} + + +declare module "lodash.toString" { + const toString: typeof _.toString; + export = toString; +} + + +declare module "lodash.toUpper" { + const toUpper: typeof _.toUpper; + export = toUpper; +} + + +declare module "lodash.trim" { + const trim: typeof _.trim; + export = trim; +} + + +declare module "lodash.trimEnd" { + const trimEnd: typeof _.trimEnd; + export = trimEnd; +} + + +declare module "lodash.trimStart" { + const trimStart: typeof _.trimStart; + export = trimStart; +} + + +declare module "lodash.truncate" { + const truncate: typeof _.truncate; + export = truncate; +} + + +declare module "lodash.unescape" { + const unescape: typeof _.unescape; + export = unescape; +} + + +declare module "lodash.uniqueId" { + const uniqueId: typeof _.uniqueId; + export = uniqueId; +} + + +declare module "lodash.upperCase" { + const upperCase: typeof _.upperCase; + export = upperCase; +} + + +declare module "lodash.upperFirst" { + const upperFirst: typeof _.upperFirst; + export = upperFirst; +} + + +declare module "lodash.each" { + const each: typeof _.each; + export = each; +} + + +declare module "lodash.eachRight" { + const eachRight: typeof _.eachRight; + export = eachRight; +} + + +declare module "lodash.first" { + const first: typeof _.first; + export = first; +} + +// Backward compatibility with --target es5 +interface Set {} +interface Map {} +interface WeakSet {} +interface WeakMap {} \ No newline at end of file diff --git a/catalog-ui/typings/notifyjs/notifyjs.d.ts b/catalog-ui/typings/notifyjs/notifyjs.d.ts new file mode 100644 index 0000000000..f72828fc06 --- /dev/null +++ b/catalog-ui/typings/notifyjs/notifyjs.d.ts @@ -0,0 +1,125 @@ +/*- + * ============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========================================================= + */ +// Type definitions for notify.js 1.2.0 +// Project: https://github.com/alexgibson/notify.js +// Definitions by: soundTricker +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare var Notify: { + new (title : string , options? : notifyjs.INotifyOption): notifyjs.INotify; + + /** + * Check is permission is needed for the user to receive notifications. + * @return true : needs permission, false : does not need + */ + needsPermission() : boolean; + + /** + * Asks the user for permission to display notifications + * @param onPermissionGrantedCallback A callback for permmision is granted. + * @param onPermissionDeniedCallback A callback for permmision is denied. + */ + requestPermission(onPermissionGrantedCallback?: ()=> any, onPermissionDeniedCallback? : ()=> any) : void; + + /** + * return true if the browser supports HTML5 Notification + * @param true : the browser supports HTML5 Notification, false ; the browswer does not supports HTML5 Notification. + */ + isSupported() : boolean; +} + +declare module notifyjs { + + /** + * Interface for Web Notifications API Wrapper. + */ + interface INotify { + /** + * Show the notification. + */ + show() : void; + + /** + * Remove all event listener. + */ + destroy() : void; + + /** + * Close the notification. + */ + close() : void; + onShowNotification(e : Event) : void; + onCloseNotification() : void; + onClickNotification() : void; + onErrorNotification() : void; + handleEvent(e : Event) : void; + } + + /** + * Interface for the Notify's optional parameter. + */ + interface INotifyOption { + + /** + * notification message body + */ + body? : string; + + /** + * path for icon to display in notification + */ + icon? : string; + + /** + * unique identifier to stop duplicate notifications + */ + tag? : string; + + /** + * number of seconds to close the notification automatically + */ + timeout? : number; + + /** + * callback when notification is shown + */ + notifyShow? (e : Event): any; + /** + * callback when notification is closed + */ + notifyClose? : Function; + /** + * callback when notification is clicked + */ + notifyClick? : Function; + /** + * callback when notification throws an error + */ + notifyError? : Function; + /** + * callback when user has granted permission + */ + permissionGranted? : Function; + /** + * callback when user has denied permission + */ + permissionDenied? : Function; + } +} diff --git a/catalog-ui/typings/tsd.d.ts b/catalog-ui/typings/tsd.d.ts new file mode 100644 index 0000000000..4fe638ef72 --- /dev/null +++ b/catalog-ui/typings/tsd.d.ts @@ -0,0 +1,21 @@ +/*- + * ============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========================================================= + */ +/// +/// -- cgit 1.2.3-korg