aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/uui
AgeCommit message (Collapse)AuthorFilesLines
2018-07-24Fix uui server liveness and readyness timeoutNetajisu1-2/+2
Increased liveness and readiness timeout. Issue-ID: OOM-1296 Signed-off-by: Netajisu <Netaji.Surve@amdocs.com> Change-Id: I1f653bf89b2703aa0cc7a71e9566c407d788e6d0
2018-06-06Sync docker image versions from manifestGary Wu2-2/+2
Sync docker image versions from docker manifest commit 8caa3e82d2e42735135e44b08b690d01182c6b76 Change-Id: Ib12a7bda30409d8372ce48f670e64266fb6db37b Issue-ID: OOM-1053 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
2018-05-10Merge "change service-info for uui-ui and uui-server"Mandeep Khinda2-9/+8
2018-05-10Improve docker registry secret managementBorislavG2-2/+0
Change-Id: I2d1ff878c215becc9856af184eb0b11defd75e1d Issue-ID: OOM-1064 Signed-off-by: BorislavG <Borislav.Glozman@amdocs.com>
2018-05-10change service-info for uui-ui and uui-serverzhangab2-9/+8
Change-Id: I1c6fb244e015c055d45e5497b14b8f43ef172a14 Issue-ID: USECASEUI-112 Signed-off-by: zhangab <zhanganbing@chinamobile.com>
2018-05-08Sync docker image images with docker-manifest.csvGary Wu2-2/+2
Update the docker image versions in the OOM helm charts with the versions specified in the docker-manifest.csv in the integration repo. This is as of integration repo commit ed53a301dbeaad568b21b9545cb9ce6c5c040b29 Change-Id: Ib844402ff9f3bdecfbd8e9f474eaac1561aff5b0 Issue-ID: OOM-1053 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
2018-05-08Sync docker image images with docker-manifest.csvGary Wu1-1/+1
Update the docker image versions in the OOM helm charts with the versions specified in the docker-manifest.csv in the integration repo. Change-Id: I38bd9e98ae1b15ed4bbc68051b8516f311aa8db0 Issue-ID: OOM-1053 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
2018-05-06Fix inconsistent repository referencesBorislavG2-2/+2
Issue-ID: OOM-874 Changes to be committed: modified: aai/charts/aai-babel/templates/deployment.yaml modified: aai/charts/aai-champ/templates/deployment.yaml modified: aai/charts/aai-data-router/templates/deployment.yaml modified: aai/charts/aai-gizmo/templates/deployment.yaml modified: aai/charts/aai-modelloader/templates/deployment.yaml modified: aai/charts/aai-resources/templates/deployment.yaml modified: aai/charts/aai-search-data/templates/deployment.yaml modified: aai/charts/aai-sparky-be/templates/deployment.yaml modified: aai/charts/aai-traversal/templates/deployment.yaml modified: aai/charts/aai-traversal/templates/job.yaml modified: appc/charts/appc-cdt/templates/deployment.yaml modified: appc/templates/statefulset.yaml modified: clamp/charts/mariadb/templates/deployment.yaml modified: clamp/templates/deployment.yaml modified: cli/templates/deployment.yaml modified: common/dgbuilder/templates/deployment.yaml modified: common/mariadb-galera/templates/statefulset.yaml modified: dcaegen2/charts/dcae-bootstrap/templates/job.yaml modified: dcaegen2/charts/dcae-cloudify-manager/templates/deployment.yaml modified: dcaegen2/charts/dcae-healthcheck/templates/deployment.yaml modified: dcaegen2/charts/dcae-redis/templates/statefulset.yaml modified: dmaap/charts/dmaap-bus-controller/templates/deployment.yaml modified: dmaap/charts/dmaap-bus-controller/values.yaml modified: esr/charts/esr-gui/templates/deployment.yaml modified: esr/templates/deployment.yaml modified: msb/charts/kube2msb/templates/deployment.yaml modified: msb/charts/msb-discovery/templates/deployment.yaml modified: msb/charts/msb-eag/templates/deployment.yaml modified: msb/charts/msb-iag/templates/deployment.yaml modified: multicloud/charts/multicloud-ocata/templates/deployment.yaml modified: multicloud/charts/multicloud-vio/templates/deployment.yaml modified: multicloud/charts/multicloud-windriver/templates/deployment.yaml modified: multicloud/templates/deployment.yaml modified: policy/charts/brmsgw/templates/deployment.yaml modified: policy/charts/drools/charts/nexus/templates/deployment.yaml modified: policy/charts/drools/templates/statefulset.yaml modified: policy/charts/mariadb/templates/deployment.yaml modified: policy/charts/pdp/templates/statefulset.yaml modified: policy/templates/deployment.yaml modified: portal/charts/portal-app/templates/deployment.yaml modified: portal/charts/portal-cassandra/templates/deployment.yaml modified: portal/charts/portal-mariadb/templates/deployment.yaml modified: portal/charts/portal-sdk/templates/deployment.yaml modified: portal/charts/portal-widget/templates/deployment.yaml modified: portal/charts/portal-zookeeper/templates/deployment.yaml modified: sdnc/charts/dmaap-listener/templates/deployment.yaml modified: sdnc/charts/sdnc-portal/templates/deployment.yaml modified: sdnc/charts/ueb-listener/templates/deployment.yaml modified: sdnc/templates/statefulset.yaml modified: uui/charts/uui-server/templates/deployment.yaml modified: uui/templates/deployment.yaml modified: vid/charts/mariadb/templates/deployment.yaml modified: vid/templates/deployment.yaml Change-Id: I00aaa1eff3b870db3b475365eeda3f2e10aef6b9 Signed-off-by: BorislavG <Borislav.Glozman@amdocs.com>
2018-04-24Make all services independent of helm Release.NameBorislavG4-7/+9
Issue-ID: OOM-906 Change-Id: Ic65127d3981cb0a696c784392cab59fbf06b1e66 Signed-off-by: BorislavG <Borislav.Glozman@amdocs.com>
2018-04-19Fix message router config for UUIMike Elliott2-2/+2
This is only a first step towards uui healthcheck passing in OOM. Fixing dmaap config revealed an error on startup of the uui server. The log is captured in the defect in Jira. Change-Id: I796e9a404e05b64368382cbdae74375a525fc849 Issue-ID: USECASEUI-106 Signed-off-by: Mike Elliott <mike.elliott@amdocs.com>
2018-04-06Use service values in msb annotationvaibhav1-1/+1
Issue-ID: OOM-840 Change-Id: Ia1f3443b419abc8cce9d6ddbebfc494a294ffeae Signed-off-by: vaibhav <vaibhav.chopra@amdocs.com>
2018-03-28Helm Chart Standardization of uuivaibhav_16dec15-159/+471
Issue-ID: OOM-749 Change-Id: Ie71686869da88a8bb7f6d09d38a5fa4a92b02aeb Signed-off-by: vaibhav_16dec <vaibhav.chopra@amdocs.com>
2018-03-22License addition in all yamlsvaibhav_16dec5-0/+70
Issue-ID: OOM-821 Change-Id: I627ac962afe8cd6bf2859a30a0e88f6c9ac89d34 Signed-off-by: vaibhav_16dec <vaibhav.chopra@amdocs.com>
2018-03-07Merge "Replica Scaling of MultiCloud and UUI container"Mandeep Khinda3-0/+4
2018-03-07Replica Scaling of MultiCloud and UUI containervaibhav_16dec3-0/+4
Issue-ID: OOM-696 Change-Id: Id2aa33af6e13e08883aad8b78ef7b797cb03d11d Signed-off-by: vaibhav_16dec <vaibhav.chopra@amdocs.com>
2018-03-05Fix UUI health checkAlexis de Talhouët1-1/+2
Change-Id: I3af1502b06302bde97b6656eed41d0ab75e8da99 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com> Issue-ID: OOM-783
2018-03-01Run all components in one namespaceBorislavG4-11/+11
Change-Id: I5fcd4d577c1fda4de27842807c7cf7a5d372756e Issue-ID: OOM-722 Signed-off-by: BorislavG <Borislav.Glozman@amdocs.com>
2017-11-28Adjust UUI to latestAlexis de Talhouët4-2/+76
Fixes: add uui-server fix uui health check add MSB registration endpoint to uui Change-Id: I0f1b10a67e980fd134f28c559ab1396b2e9febb3 Issue-ID: OOM-474 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
2017-10-29Add option to disable specific deploymentsyuryn2-0/+4
Add option to disable any deployment by using conditions in helm templates. Each deployment will get helm parameter - boolean flag allowing to disable it. The flags can be listed in the custom values.yaml file that can be passed to the createAll script with '-v' command line option. Change-Id: I32b795de46c72915c2201c94c23f4e061971bb56 Issue-ID: OOM-380 Signed-off-by: yuryn <Yury.Novitsky@Amdocs.com>
2017-10-19Add service annotation for UUIHuabingZhao1-0/+11
Issue-Id: OOM-235 Change-Id: I5af94f8960996ddd5d9cc8c80d950c49fcfbad24 Signed-off-by: HuabingZhao <zhao.huabing@zte.com.cn>
2017-10-16Added initial deployment yamls for UUIDusan Rozman4-0/+59
Issue-ID: OOM-356 Change-Id: Iea69fb693064fed1b4aec9a4712ae4e36889a6c3 Signed-off-by: Dusan Rozman <dusan.rozman@amdocs.com>
97' href='#n697'>697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837
'use strict';

//import 'restangular';
//import 'angular-ui-router';
import "reflect-metadata";
import 'ng-infinite-scroll';
import './modules/filters.ts';
import './modules/utils.ts';
import './modules/directive-module.ts';
import './modules/service-module';
import './modules/view-model-module.ts';

import {
    IUserResourceClass,
    DataTypesService,
    LeftPaletteLoaderService,
    EcompHeaderService,
    CookieService,
    ConfigurationUiService,
    CacheService,
    IUserResource,
    SdcVersionService,
    ICategoryResourceClass,
    EntityService
} from "./services";
import {forwardRef} from '@angular/core';
import {UpgradeAdapter} from '@angular/upgrade';
import {CHANGE_COMPONENT_CSAR_VERSION_FLAG, States} from "./utils";
import {IAppConfigurtaion, IAppMenu, IMainCategory, Resource, IHostedApplication} from "./models";
import {ComponentFactory} from "./utils/component-factory";
import {ModalsHandler} from "./utils/modals-handler";
import {downgradeComponent} from "@angular/upgrade/static";

import {AppModule} from './ng2/app.module';
import {PropertiesAssignmentComponent} from "./ng2/pages/properties-assignment/properties-assignment.page.component";
import {Component} from "./models/components/component";
import {ComponentServiceNg2} from "./ng2/services/component-services/component.service";
import {ComponentMetadata} from "./models/component-metadata";
import {Categories} from "./models/categories";


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';

// Load configuration according to environment.
declare var __ENV__:string;
let sdcConfig:IAppConfigurtaion;
let sdcMenu:IAppMenu;
let pathPrefix:string = '';
if (__ENV__ === 'dev') {
    sdcConfig = require('./../../configurations/dev.js');
} else if (__ENV__ === 'prod') {
    sdcConfig = require('./../../configurations/prod.js');
    pathPrefix = 'sdc1/';
} else {
    console.log("ERROR: Environment configuration not found!");
}
sdcMenu = require('./../../configurations/menu.js');

let dependentModules:Array<string> = [
    'ui.router',
    'ui.bootstrap',
    'ui.bootstrap.tpls',
    'ngDragDrop',
    'ui-notification',
    'ngResource',
    'ngSanitize',
    'naif.base64',
    'base64',
    'uuid4',
    'checklist-model',
    'angular.filter',
    'pascalprecht.translate',
    '720kb.tooltips',
    'restangular',
    'angular-clipboard',
    'angularResizable',
    'infinite-scroll',
    viewModelsModuleName,
    directivesModuleName,
    servicesModuleName,
    filtersModuleName,
    utilsModuleName
];

// ===================== Hosted applications section ====================
// Define here new hosted apps
let hostedApplications:Array<IHostedApplication> = [
    {
        "moduleName": "dcaeApp",
        "navTitle": "DCAE",
        "defaultState": 'dcae.app.home',
        "state": {
            "name": "dcae",
            "url": "/dcae",
            "relativeHtmlPath": 'dcae-app/dcae-app-view.html',
            "controllerName": '.DcaeAppViewModel'
        }
    }
];

// Check if module exists (in case the javascript was not loaded).
let isModuleExists = (moduleName:string):boolean => {
    try {
        angular.module(moduleName);
        dependentModules.push(moduleName);
        return true;
    } catch (e) {
        console.log('Module ' + moduleName + ' does not exists');
        return false;
    }
};

// Check which hosted applications exists
_.each(hostedApplications, (hostedApp)=> {
    if (isModuleExists(hostedApp.moduleName)) {
        hostedApp['exists'] = true;
    }
});
// ===================== Hosted applications section ====================

export const ng1appModule:ng.IModule = angular.module(moduleName, dependentModules);
angular.module('sdcApp').directive('propertiesAssignment', downgradeComponent({component: PropertiesAssignmentComponent}) as angular.IDirectiveFactory);

ng1appModule.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'
        });

        $translateProvider.useStaticFilesLoader({
            prefix: pathPrefix + 'assets/languages/',
            langKey: '',
            suffix: '.json?d=' + (new Date()).getTime()
        });
        $translateProvider.useSanitizeValueStrategy('escaped');
        $translateProvider.preferredLanguage('en_US');

        $httpProvider.interceptors.push('Sdc.Services.HeaderInterceptor');
        $httpProvider.interceptors.push('Sdc.Services.HttpErrorInterceptor');
        $urlRouterProvider.otherwise('welcome');

        $stateProvider.state(
            'dashboard', {
                url: '/dashboard?show&folder',
                templateUrl: "./view-models/dashboard/dashboard-view.html",
                controller: viewModelsModuleName + '.DashboardViewModel',
            }
        );

        $stateProvider.state(
            'welcome', {
                url: '/welcome',
                templateUrl: "./view-models/welcome/welcome-view.html",
                controller: viewModelsModuleName + '.WelcomeViewModel'
            }
        );

        let componentsParam:Array<any> = ['$stateParams', 'Sdc.Services.EntityService', 'Sdc.Services.CacheService', ($stateParams:any, EntityService:EntityService, cacheService:CacheService) => {
            if (cacheService.get('breadcrumbsComponents')) {
                return cacheService.get('breadcrumbsComponents');
            } else {
                return EntityService.getCatalog();
            }
        }];

        $stateProvider.state(
            'workspace', {
                url: '/workspace/:id/:type/',
                params: {'importedFile': null, 'componentCsar': null, 'resourceType': null, 'disableButtons': null},
                templateUrl: './view-models/workspace/workspace-view.html',
                controller: viewModelsModuleName + '.WorkspaceViewModel',
                resolve: {
                    injectComponent: ['$stateParams', 'ComponentFactory', 'ComponentServiceNg2', function ($stateParams, ComponentFactory:ComponentFactory, ComponentServiceNg2:ComponentServiceNg2) {
                        if ($stateParams.id) {
                            return ComponentFactory.getComponentWithMetadataFromServer($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
                                (<Resource>emptyComponent).resourceType = $stateParams.resourceType;
                            }
                            if ($stateParams.importedFile) {
                                (<Resource>emptyComponent).importedFile = $stateParams.importedFile;
                            }
                            return emptyComponent;
                        }
                    }],
                    components: componentsParam
                }
            }
        );

        $stateProvider.state(
            States.WORKSPACE_GENERAL, {
                url: 'general',
                parent: 'workspace',
                controller: viewModelsModuleName + '.GeneralViewModel',
                templateUrl: './view-models/workspace/tabs/general/general-view.html',
                data: {unsavedChanges: false, bodyClass: 'general'}
            }
        );
        //
        $stateProvider.state(
            States.WORKSPACE_ICONS, {
                url: 'icons',
                parent: 'workspace',
                controller: viewModelsModuleName + '.IconsViewModel',
                templateUrl: './view-models/workspace/tabs/icons/icons-view.html',
                data: {unsavedChanges: false, bodyClass: 'icons'}

            }
        );

        $stateProvider.state(
            States.WORKSPACE_ACTIVITY_LOG, {
                url: 'activity_log',
                parent: 'workspace',
                controller: viewModelsModuleName + '.ActivityLogViewModel',
                templateUrl: './view-models/workspace/tabs/activity-log/activity-log.html',
                data: {unsavedChanges: false}
            }
        );

        $stateProvider.state(
            States.WORKSPACE_DEPLOYMENT_ARTIFACTS, {
                url: 'deployment_artifacts',
                parent: 'workspace',
                controller: viewModelsModuleName + '.DeploymentArtifactsViewModel',
                templateUrl: './view-models/workspace/tabs/deployment-artifacts/deployment-artifacts-view.html',
                data: {
                    bodyClass: 'deployment_artifacts'
                }
            }
        );

        $stateProvider.state(
            States.WORKSPACE_HIERARCHY, {
                url: 'hierarchy',
                parent: 'workspace',
                controller: viewModelsModuleName + '.ProductHierarchyViewModel',
                templateUrl: './view-models/workspace/tabs/product-hierarchy/product-hierarchy-view.html',
                data: {unsavedChanges: false}

            }
        );

        $stateProvider.state(
            States.WORKSPACE_INFORMATION_ARTIFACTS, {
                url: 'information_artifacts',
                parent: 'workspace',
                controller: viewModelsModuleName + '.InformationArtifactsViewModel',
                templateUrl: './view-models/workspace/tabs/information-artifacts/information-artifacts-view.html',
                data: {
                    bodyClass: 'information_artifacts'
                }
            }
        );

        $stateProvider.state(
            States.WORKSPACE_TOSCA_ARTIFACTS, {
                url: 'tosca_artifacts',
                parent: 'workspace',
                controller: viewModelsModuleName + '.ToscaArtifactsViewModel',
                templateUrl: './view-models/workspace/tabs/tosca-artifacts/tosca-artifacts-view.html',
                data: {
                    bodyClass: 'tosca_artifacts'
                }
            }
        );

        $stateProvider.state(
            States.WORKSPACE_PROPERTIES, {
                url: 'properties',
                parent: 'workspace',
                controller: viewModelsModuleName + '.PropertiesViewModel',
                templateUrl: './view-models/workspace/tabs/properties/properties-view.html',
                data: {
                    bodyClass: 'properties'
                }
            }
        );

        $stateProvider.state(
            States.WORKSPACE_SERVICE_INPUTS, {
                url: 'service_inputs',
                parent: 'workspace',
                controller: viewModelsModuleName + '.ServiceInputsViewModel',
                templateUrl: './view-models/workspace/tabs/inputs/service-input/service-inputs-view.html',
                data: {
                    bodyClass: 'workspace-inputs'
                }
            }
        );

        $stateProvider.state(
            States.WORKSPACE_PROPERTIES_ASSIGNMENT, {
                url: 'properties_assignment',
                params: {'component': null},
                template: '<properties-assignment></properties-assignment>',
                parent: 'workspace',
                resolve: {
                    componentData: ['injectComponent', '$stateParams', function (injectComponent:Component, $stateParams) {
                        //injectComponent.componentService = null; // this is for not passing the service so no one will use old api and start using new api
                        $stateParams.component = injectComponent;
                        return injectComponent;
                    }],
                },
                data: {
                    bodyClass: 'properties-assignment'
                }
            }
        );

        $stateProvider.state(
            States.WORKSPACE_RESOURCE_INPUTS, {
                url: 'resource_inputs',
                parent: 'workspace',
                controller: viewModelsModuleName + '.ResourceInputsViewModel',
                templateUrl: './view-models/workspace/tabs/inputs/resource-input/resource-inputs-view.html',
                data: {
                    bodyClass: 'workspace-inputs'
                }
            }
        );

        $stateProvider.state(
            States.WORKSPACE_ATTRIBUTES, {
                url: 'attributes',
                parent: 'workspace',
                controller: viewModelsModuleName + '.AttributesViewModel',
                templateUrl: './view-models/workspace/tabs/attributes/attributes-view.html',
                data: {
                    bodyClass: 'attributes'
                }
            }
        );

        $stateProvider.state(
            States.WORKSPACE_REQUIREMENTS_AND_CAPABILITIES, {
                url: 'req_and_capabilities',
                parent: 'workspace',
                controller: viewModelsModuleName + '.ReqAndCapabilitiesViewModel',
                templateUrl: './view-models/workspace/tabs/req-and-capabilities/req-and-capabilities-view.html',
                data: {
                    bodyClass: 'attributes'
                }
            }
        );


        $stateProvider.state(
            States.WORKSPACE_MANAGEMENT_WORKFLOW, {
                parent: 'workspace',
                url: 'management_workflow',
                templateUrl: './view-models/workspace/tabs/management-workflow/management-workflow-view.html',
                controller: viewModelsModuleName + '.ManagementWorkflowViewModel'
            }
        );

        $stateProvider.state(
            States.WORKSPACE_NETWORK_CALL_FLOW, {
                parent: 'workspace',
                url: 'network_call_flow',
                templateUrl: './view-models/workspace/tabs/network-call-flow/network-call-flow-view.html',
                controller: viewModelsModuleName + '.NetworkCallFlowViewModel'
            }
        );

        $stateProvider.state(
            States.WORKSPACE_DISTRIBUTION, {
                parent: 'workspace',
                url: 'distribution',
                templateUrl: './view-models/workspace/tabs/distribution/distribution-view.html',
                controller: viewModelsModuleName + '.DistributionViewModel'
            }
        );

        $stateProvider.state(
            States.WORKSPACE_COMPOSITION, {
                url: 'composition/',
                parent: 'workspace',
                controller: viewModelsModuleName + '.CompositionViewModel',
                templateUrl: './view-models/workspace/tabs/composition/composition-view.html',
                data: {
                    bodyClass: 'composition'
                }
            }
        );

        // $stateProvider.state(
        //     States.WORKSPACE_NG2, {
        //         url: 'ng2/',
        //        component: downgradeComponent({component: NG2Example2Component}), //viewModelsModuleName + '.NG2Example',
        //        templateUrl: './ng2/view-ng2/ng2.example2/ng2.example2.component.html'
        //     }
        // );

        $stateProvider.state(
            States.WORKSPACE_DEPLOYMENT, {
                url: 'deployment/',
                parent: 'workspace',
                templateUrl: './view-models/workspace/tabs/deployment/deployment-view.html',
                controller: viewModelsModuleName + '.DeploymentViewModel',
                data: {
                    bodyClass: 'composition'
                }
            }
        );

        $stateProvider.state(
            'workspace.composition.details', {
                url: 'details',
                parent: 'workspace.composition',
                templateUrl: './view-models/workspace/tabs/composition/tabs/details/details-view.html',
                controller: viewModelsModuleName + '.DetailsViewModel'
            }
        );

        $stateProvider.state(
            'workspace.composition.properties', {
                url: 'properties',
                parent: 'workspace.composition',
                templateUrl: './view-models/workspace/tabs/composition/tabs/properties-and-attributes/properties-view.html',
                controller: viewModelsModuleName + '.ResourcePropertiesViewModel'
            }
        );

        $stateProvider.state(
            'workspace.composition.artifacts', {
                url: 'artifacts',
                parent: 'workspace.composition',
                templateUrl: './view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view.html',
                controller: viewModelsModuleName + '.ResourceArtifactsViewModel'
            }
        );

        $stateProvider.state(
            'workspace.composition.relations', {
                url: 'relations',
                parent: 'workspace.composition',
                templateUrl: './view-models/workspace/tabs/composition/tabs/relations/relations-view.html',
                controller: viewModelsModuleName + '.RelationsViewModel'
            }
        );

        $stateProvider.state(
            'workspace.composition.structure', {
                url: 'structure',
                parent: 'workspace.composition',
                templateUrl: './view-models/workspace/tabs/composition/tabs/structure/structure-view.html',
                controller: viewModelsModuleName + '.StructureViewModel'
            }
        );
        $stateProvider.state(
            'workspace.composition.lifecycle', {
                url: 'lifecycle',
                parent: 'workspace.composition',
                templateUrl: './view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view.html',
                controller: viewModelsModuleName + '.ResourceArtifactsViewModel'
            }
        );

        $stateProvider.state(
            'workspace.composition.api', {
                url: 'api',
                parent: 'workspace.composition',
                templateUrl: './view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view.html',
                controller: viewModelsModuleName + '.ResourceArtifactsViewModel'
            }
        );
        $stateProvider.state(
            'workspace.composition.deployment', {
                url: 'deployment',
                parent: 'workspace.composition',
                templateUrl: './view-models/workspace/tabs/composition/tabs/artifacts/artifacts-view.html',
                controller: viewModelsModuleName + '.ResourceArtifactsViewModel'
            }
        );

        $stateProvider.state(
            'adminDashboard', {
                url: '/adminDashboard',
                templateUrl: './view-models/admin-dashboard/admin-dashboard-view.html',
                controller: viewModelsModuleName + '.AdminDashboardViewModel',
                permissions: ['ADMIN']
            }
        );

        $stateProvider.state(
            'onboardVendor', {
                url: '/onboardVendor',
                templateUrl: './view-models/onboard-vendor/onboard-vendor-view.html',
                controller: viewModelsModuleName + '.OnboardVendorViewModel'//,
            }
        );

        // Build the states for all hosted apps dynamically
        _.each(hostedApplications, (hostedApp)=> {
            if (hostedApp.exists) {
                $stateProvider.state(
                    hostedApp.state.name, {
                        url: hostedApp.state.url,
                        templateUrl: './view-models/dcae-app/dcae-app-view.html',
                        controller: viewModelsModuleName + hostedApp.state.controllerName
                    }
                );
            }
        });

        $stateProvider.state(
            'catalog', {
                url: '/catalog',
                templateUrl: './view-models/catalog/catalog-view.html',
                controller: viewModelsModuleName + '.CatalogViewModel',
                resolve: {
                    auth: ["$q", "Sdc.Services.UserResourceService", ($q:any, userResourceService:IUserResourceClass) => {
                        let userInfo:IUserResource = userResourceService.getLoggedinUser();
                        if (userInfo) {
                            return $q.when(userInfo);
                        } else {
                            return $q.reject({authenticated: false});
                        }
                    }]
                }
            }
        );

        $stateProvider.state(
            'support', {
                url: '/support',
                templateUrl: './view-models/support/support-view.html',
                controller: viewModelsModuleName + '.SupportViewModel'
            }
        );

        $stateProvider.state(
            'error-403', {
                url: '/error-403',
                templateUrl: "./view-models/modals/error-modal/error-403-view.html",
                controller: viewModelsModuleName + '.ErrorViewModel'
            }
        );

        tooltipsConfigProvider.options({
            side: 'bottom',
            delay: '600',
            class: 'tooltip-custom',
            lazy: 0,
            try: 0
        });

    }
]);

ng1appModule.value('ValidationPattern', /^[\s\w\&_.:-]{1,1024}$/);
ng1appModule.value('ComponentNameValidationPattern', /^(?=.*[^. ])[\s\w\&_.:-]{1,1024}$/); //DE250513 - same as ValidationPattern above, plus requirement that name not consist of dots and/or spaces alone.
ng1appModule.value('PropertyNameValidationPattern', /^[a-zA-Z0-9_:-]{1,50}$/);// DE210977
ng1appModule.value('TagValidationPattern', /^[\s\w_.-]{1,50}$/);
ng1appModule.value('VendorValidationPattern', /^[\x20-\x21\x23-\x29\x2B-\x2E\x30-\x39\x3B\x3D\x40-\x5B\x5D-\x7B\x7D-\xFF]{1,25}$/);
ng1appModule.value('ContactIdValidationPattern', /^[\s\w-]{1,50}$/);
ng1appModule.value('UserIdValidationPattern', /^[\s\w-]{1,50}$/);
ng1appModule.value('ProjectCodeValidationPattern', /^[\s\w-]{5,50}$/);
ng1appModule.value('LabelValidationPattern', /^[\sa-zA-Z0-9+-]{1,25}$/);
ng1appModule.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})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/);
ng1appModule.value('IntegerValidationPattern', /^(([-+]?\d+)|([-+]?0x[0-9a-fA-F]+))$/);
ng1appModule.value('IntegerNoLeadingZeroValidationPattern', /^(0|[-+]?[1-9][0-9]*|[-+]?0x[0-9a-fA-F]+|[-+]?0o[0-7]+)$/);
ng1appModule.value('FloatValidationPattern', /^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?f?$/);
ng1appModule.value('NumberValidationPattern', /^((([-+]?\d+)|([-+]?0x[0-9a-fA-F]+))|([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?))$/);
ng1appModule.value('KeyValidationPattern', /^[\s\w-]{1,50}$/);
ng1appModule.value('CommentValidationPattern', /^[\u0000-\u00BF]*$/);
ng1appModule.value('BooleanValidationPattern', /^([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])$/);
ng1appModule.value('MapKeyValidationPattern', /^[\w]{1,50}$/);

ng1appModule.constant('sdcConfig', sdcConfig);
ng1appModule.constant('sdcMenu', sdcMenu);

ng1appModule.run([
    '$http',
    'Sdc.Services.CacheService',
    'Sdc.Services.CookieService',
    'Sdc.Services.ConfigurationUiService',
    'Sdc.Services.UserResourceService',
    'Sdc.Services.CategoryResourceService',
    'Sdc.Services.SdcVersionService',
    '$state',
    '$rootScope',
    '$location',
    'sdcMenu',
    'ModalsHandler',
    'Sdc.Services.EcompHeaderService',
    'LeftPaletteLoaderService',
    'Sdc.Services.DataTypesService',
    'AngularJSBridge',
    ($http:ng.IHttpService,
     cacheService:CacheService,
     cookieService:CookieService,
     ConfigurationUi:ConfigurationUiService,
     UserResourceClass:IUserResourceClass,
     categoryResourceService:ICategoryResourceClass,
     sdcVersionService:SdcVersionService,
     $state:ng.ui.IStateService,
     $rootScope:ng.IRootScopeService,
     $location:ng.ILocationService,
     sdcMenu:IAppMenu,
     ModalsHandler:ModalsHandler,
     ecompHeaderService:EcompHeaderService,
     LeftPaletteLoaderService:LeftPaletteLoaderService,
     DataTypesService:DataTypesService,
     AngularJSBridge):void => {

        //handle cache data - version
        let initAsdcVersion:Function = ():void => {

            let onFailed = (response) => {
                console.info('onFailed initAsdcVersion', response);
                cacheService.set('version', 'N/A');
            };

            let onSuccess = (version:any) => {
                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((categories: Categories):void => {
                cacheService.set('serviceCategories', categories.serviceCategories);
                cacheService.set('resourceCategories', categories.resourceCategories);
                cacheService.set('productCategories', categories.productCategories);
            }, onError);
        };

        // Add hosted applications to sdcConfig
        sdcConfig.hostedApplications = hostedApplications;

        //handle http config
        $http.defaults.withCredentials = true;
        $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w';
        $http.defaults.headers.common[cookieService.getUserIdSuffix()] = cookieService.getUserId();

        initAsdcVersion();
        initConfigurationUi();
       // initLeftPalette();
        DataTypesService.initDataTypes();

        //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(CHANGE_COMPONENT_CSAR_VERSION_FLAG)) {
                    cacheService.remove(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: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.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();
    }]);