diff --git a/.editorconfig b/.editorconfig index 48011fd884..89c45b2afa 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,5 +15,5 @@ indent_style = space charset = utf-8 # 4 space indentation -[*.{py}] -indent_size = 4 \ No newline at end of file +[*.py] +indent_size = 4 diff --git a/.gitignore b/.gitignore index 94bb6662f5..e9091b488a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ node_modules .DS_Store .vscode/ +/.idea */.classpath */.project */.settings @@ -12,4 +13,6 @@ node_modules */target/ .nyc_output/ npm-debug.log -*/package-lock.json +/.idea +package-lock.json + diff --git a/.travis.yml b/.travis.yml index ca81593312..fe2cfd77c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,20 +2,20 @@ language: node_js node_js: - "node" env: - - PLATFORM_SERVICE=jazz_codeq - - PLATFORM_SERVICE=jazz_create-serverless-service - - PLATFORM_SERVICE=jazz_delete-serverless-service - - PLATFORM_SERVICE=jazz_deployments - - PLATFORM_SERVICE=jazz_deployments-event-handler - - PLATFORM_SERVICE=jazz_environments - - PLATFORM_SERVICE=jazz_environment-event-handler - - PLATFORM_SERVICE=jazz_events - - PLATFORM_SERVICE=jazz_is-service-available - - PLATFORM_SERVICE=jazz_login - - PLATFORM_SERVICE=jazz_logout - - PLATFORM_SERVICE=jazz_scm-webhook - - PLATFORM_SERVICE=jazz_services - - PLATFORM_SERVICE=jazz_services-handler + - PLATFORM_SERVICE=core/jazz_codeq + - PLATFORM_SERVICE=core/jazz_create-serverless-service + - PLATFORM_SERVICE=core/jazz_delete-serverless-service + - PLATFORM_SERVICE=core/jazz_deployments + - PLATFORM_SERVICE=core/jazz_deployments-event-handler + - PLATFORM_SERVICE=core/jazz_environments + - PLATFORM_SERVICE=core/jazz_environment-event-handler + - PLATFORM_SERVICE=core/jazz_events + - PLATFORM_SERVICE=core/jazz_is-service-available + - PLATFORM_SERVICE=core/jazz_login + - PLATFORM_SERVICE=core/jazz_logout + - PLATFORM_SERVICE=core/jazz_scm-webhook + - PLATFORM_SERVICE=core/jazz_services + - PLATFORM_SERVICE=core/jazz_services-handler before_script: - npm prune diff --git a/README.md b/README.md index fda76f2ee1..ccd53fb9cc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -![Jazz Logo](logo.png) -# Jazz Serverless Platform +# ![Jazz Logo](misc/logo.png) Jazz Serverless Platform + [![Build Status](https://travis-ci.org/tmobile/jazz.svg?branch=master)](https://travis-ci.org/tmobile/jazz) **Seamlessly build, deploy & manage cloud-native applications.** diff --git a/api-template-java/Jenkinsfile b/api-template-java/Jenkinsfile deleted file mode 100644 index dd4290b102..0000000000 --- a/api-template-java/Jenkinsfile +++ /dev/null @@ -1,45 +0,0 @@ -#!groovy -import groovy.json.JsonOutput -import groovy.transform.Field - -// To be replaced as @Field def repo_credential_id = "value" except for config_loader -@Field def repo_credential_id -@Field def repo_base -@Field def repo_core -@Field def scm_type - -@Field def config_loader - -/* -* Load environment variables from build module -*/ -def loadConfigModule(build_module_url){ - dir('config-loader') { - checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: repo_credential_id, url: build_module_url]]]) - def result_json_string = readFile("jazz-installer-vars.json") - config_module = load "config-loader.groovy" - config_loader = config_module.initialize(result_json_string) - } -} - -/* -* Start the Pipeline stages -*/ -node { - stage('Loading Config-Loader') { - loadConfigModule(getBuildModuleUrl()) - } - - stage('Triggering the Jenkins build') { - build job: "${config_loader.JENKINS.BUILD_URI.API}", parameters: [string(name: 'service_name', value: '{service_name}'), string(name: 'domain', value: '{domain}'), string(name: 'scm_branch', value: "${env.BRANCH_NAME}")], wait: false - } -} - -def getBuildModuleUrl() { - if (scm_type && scm_type != "bitbucket") { - // right now only bitbucket has this additional tag scm in its git clone path - return "http://${repo_base}/${repo_core}/jazz-build-module.git" - } else { - return "http://${repo_base}/scm/${repo_core}/jazz-build-module.git" - } -} diff --git a/api-template-nodejs/Jenkinsfile b/api-template-nodejs/Jenkinsfile deleted file mode 100644 index dd4290b102..0000000000 --- a/api-template-nodejs/Jenkinsfile +++ /dev/null @@ -1,45 +0,0 @@ -#!groovy -import groovy.json.JsonOutput -import groovy.transform.Field - -// To be replaced as @Field def repo_credential_id = "value" except for config_loader -@Field def repo_credential_id -@Field def repo_base -@Field def repo_core -@Field def scm_type - -@Field def config_loader - -/* -* Load environment variables from build module -*/ -def loadConfigModule(build_module_url){ - dir('config-loader') { - checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: repo_credential_id, url: build_module_url]]]) - def result_json_string = readFile("jazz-installer-vars.json") - config_module = load "config-loader.groovy" - config_loader = config_module.initialize(result_json_string) - } -} - -/* -* Start the Pipeline stages -*/ -node { - stage('Loading Config-Loader') { - loadConfigModule(getBuildModuleUrl()) - } - - stage('Triggering the Jenkins build') { - build job: "${config_loader.JENKINS.BUILD_URI.API}", parameters: [string(name: 'service_name', value: '{service_name}'), string(name: 'domain', value: '{domain}'), string(name: 'scm_branch', value: "${env.BRANCH_NAME}")], wait: false - } -} - -def getBuildModuleUrl() { - if (scm_type && scm_type != "bitbucket") { - // right now only bitbucket has this additional tag scm in its git clone path - return "http://${repo_base}/${repo_core}/jazz-build-module.git" - } else { - return "http://${repo_base}/scm/${repo_core}/jazz-build-module.git" - } -} diff --git a/api-template-nodejs/components/config.js b/api-template-nodejs/components/config.js deleted file mode 100644 index 62bad8a4f0..0000000000 --- a/api-template-nodejs/components/config.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - Nodejs Template Project - @module: config.js - @description: Defines variables/functions to retrieve environment related data - @author: - @version: 1.0 -**/ - -var getStageConfig = (event) => { - var stage; - - if (event && event.awslogs && event.awslogs.data) { - // cw events default to dev - stage = 'dev'; - } else { - stage = event.stage - } - - var configObj; - - if (stage) { - configObj = require(`../config/${stage}-config.json`); - } - - return configObj; -}; - -module.exports = (event) => { - var config = getStageConfig(event); - return config; -}; diff --git a/api-template-python/Jenkinsfile b/api-template-python/Jenkinsfile deleted file mode 100644 index dd4290b102..0000000000 --- a/api-template-python/Jenkinsfile +++ /dev/null @@ -1,45 +0,0 @@ -#!groovy -import groovy.json.JsonOutput -import groovy.transform.Field - -// To be replaced as @Field def repo_credential_id = "value" except for config_loader -@Field def repo_credential_id -@Field def repo_base -@Field def repo_core -@Field def scm_type - -@Field def config_loader - -/* -* Load environment variables from build module -*/ -def loadConfigModule(build_module_url){ - dir('config-loader') { - checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: repo_credential_id, url: build_module_url]]]) - def result_json_string = readFile("jazz-installer-vars.json") - config_module = load "config-loader.groovy" - config_loader = config_module.initialize(result_json_string) - } -} - -/* -* Start the Pipeline stages -*/ -node { - stage('Loading Config-Loader') { - loadConfigModule(getBuildModuleUrl()) - } - - stage('Triggering the Jenkins build') { - build job: "${config_loader.JENKINS.BUILD_URI.API}", parameters: [string(name: 'service_name', value: '{service_name}'), string(name: 'domain', value: '{domain}'), string(name: 'scm_branch', value: "${env.BRANCH_NAME}")], wait: false - } -} - -def getBuildModuleUrl() { - if (scm_type && scm_type != "bitbucket") { - // right now only bitbucket has this additional tag scm in its git clone path - return "http://${repo_base}/${repo_core}/jazz-build-module.git" - } else { - return "http://${repo_base}/scm/${repo_core}/jazz-build-module.git" - } -} diff --git a/delete-serverless-service-build-pack/Jenkinsfile b/builds/delete-serverless-service-build-pack/Jenkinsfile similarity index 100% rename from delete-serverless-service-build-pack/Jenkinsfile rename to builds/delete-serverless-service-build-pack/Jenkinsfile diff --git a/delete-serverless-service-build-pack/Jenkinsfile_Cleanup_CF_Dist b/builds/delete-serverless-service-build-pack/Jenkinsfile_Cleanup_CF_Dist similarity index 100% rename from delete-serverless-service-build-pack/Jenkinsfile_Cleanup_CF_Dist rename to builds/delete-serverless-service-build-pack/Jenkinsfile_Cleanup_CF_Dist diff --git a/jazz-build-module/README.md b/builds/jazz-build-module/README.md similarity index 100% rename from jazz-build-module/README.md rename to builds/jazz-build-module/README.md diff --git a/jazz-build-module/config-loader.groovy b/builds/jazz-build-module/config-loader.groovy similarity index 100% rename from jazz-build-module/config-loader.groovy rename to builds/jazz-build-module/config-loader.groovy diff --git a/jazz-build-module/environment-deployment-metadata-loader.groovy b/builds/jazz-build-module/environment-deployment-metadata-loader.groovy similarity index 100% rename from jazz-build-module/environment-deployment-metadata-loader.groovy rename to builds/jazz-build-module/environment-deployment-metadata-loader.groovy diff --git a/jazz-build-module/events-module.groovy b/builds/jazz-build-module/events-module.groovy similarity index 100% rename from jazz-build-module/events-module.groovy rename to builds/jazz-build-module/events-module.groovy diff --git a/jazz-build-module/scm-module.groovy b/builds/jazz-build-module/scm-module.groovy similarity index 85% rename from jazz-build-module/scm-module.groovy rename to builds/jazz-build-module/scm-module.groovy index 3baa0643ae..0704748c87 100644 --- a/jazz-build-module/scm-module.groovy +++ b/builds/jazz-build-module/scm-module.groovy @@ -41,7 +41,7 @@ def createProject(repo_owner, repo_name){ try { if (config_loader.SCM.TYPE == "gitlab") { - //gitlabs username is restricted to alphanumeric and . _ - characters, + //gitlabs username is restricted to alphanumeric and . _ - characters, // so using email all email characters (except -, _) replaced with - def gitlab_username = repo_owner.replaceAll("[^a-zA-Z0-9_-]", "-") @@ -62,7 +62,9 @@ def createProject(repo_owner, repo_name){ transferProject(user_services_group_id, repo_id) } else if (config_loader.SCM.TYPE == "bitbucket") { - sh "curl -X POST -k -v -u \"${config_loader.SCM.USERNAME}:${config_loader.SCM.PASSWORD}\" -H \"Content-Type: application/json\" " + scm_user_services_api_endpoint + " -d \'{\"name\":\"" + repo_name + "\", \"scmId\": \"git\", \"forkable\": \"true\"}\'" + withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) { + sh "curl -X POST -k -v -u \"${UNAME}:${PWD}\" -H \"Content-Type: application/json\" " + scm_user_services_api_endpoint + " -d \'{\"name\":\"" + repo_name + "\", \"scmId\": \"git\", \"forkable\": \"true\"}\'" + } } } catch (ex) { echo "createProject failed: " + ex.toString() @@ -125,7 +127,7 @@ def getGitLabsProjectId(repo_name) { if (projectObject == null || projectObject.equals("") || projectObject[0] == null || projectObject[0].equals("") || projectObject[0].id == null || projectObject[0].id.equals("")) { - error "getGitLabsProjectId failed to find project with name $repo_name" + error "getGitLabsProjectId failed to find project with name $repo_name" } return projectObject[0].id @@ -149,7 +151,9 @@ def setBranchPermissions(repo_name) { sh "curl --request POST --header \"PRIVATE-TOKEN: ${config_loader.SCM.PRIVATE_TOKEN}\" \"${scm_protocol}${config_loader.REPOSITORY.BASE_URL}/api/v4/projects/$proj_id/protected_branches?name=master&push_access_level=0\"" } else if (config_loader.SCM.TYPE == "bitbucket") { checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, url: serviceonboarding_repo]]]) - sh "curl -X POST -k -v -u \"${config_loader.SCM.USERNAME}:${config_loader.SCM.PASSWORD}\" -H \"Content-Type: application/vnd.atl.bitbucket.bulk+json\" ${scm_branch_permission_api_endpoint}${repo_name}/restrictions -d \"@branch_permissions_payload.json\" " + withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) { + sh "curl -X POST -k -v -u \"${UNAME}:${PWD}\" -H \"Content-Type: application/vnd.atl.bitbucket.bulk+json\" ${scm_branch_permission_api_endpoint}${repo_name}/restrictions -d \"@branch_permissions_payload.json\" " + } } } @@ -157,12 +161,11 @@ def setRepoPermissions(repo_owner, repo_name, admin_group) { if (config_loader.SCM.TYPE == "gitlab") { } else if (config_loader.SCM.TYPE == "bitbucket") { - sh "curl -X PUT -G -k -v -u \"${config_loader.SCM.USERNAME}:${config_loader.SCM.PASSWORD}\" -d \"name=$admin_group\" \"${scm_user_services_api_endpoint}/${repo_name}/permissions/groups?permission=REPO_ADMIN&\"" - - - def encoded_creator = URLEncoder.encode(repo_owner, "utf-8") - - sh "curl -X PUT -G -k -v -u \"${config_loader.SCM.USERNAME}:${config_loader.SCM.PASSWORD}\" -d \"name=$encoded_creator\" \"${scm_user_services_api_endpoint}/${repo_name}/permissions/users?permission=REPO_ADMIN\"" + withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) { + sh "curl -X PUT -G -k -v -u \"${UNAME}:${PWD}\" -d \"name=$admin_group\" \"${scm_user_services_api_endpoint}/${repo_name}/permissions/groups?permission=REPO_ADMIN&\"" + def encoded_creator = URLEncoder.encode(repo_owner, "utf-8") + sh "curl -X PUT -G -k -v -u \"${UNAME}:${PWD}\" -d \"name=$encoded_creator\" \"${scm_user_services_api_endpoint}/${repo_name}/permissions/users?permission=REPO_ADMIN\"" + } } } @@ -173,7 +176,9 @@ def addWebhook(repo_name, webhookName, scm_webhook_target_url) { sh "curl --header \"Private-Token: ${config_loader.SCM.PRIVATE_TOKEN}\" -X POST \"${scm_webhook_api}$scm_webhook_target_url\"" } else if (config_loader.SCM.TYPE == "bitbucket") { def scm_webhook_api = "${scm_protocol}${config_loader.REPOSITORY.BASE_URL}/rest/webhook/1.0/projects/${config_loader.REPOSITORY.REPO_BASE_SERVICES}/repos/" - sh "curl -X PUT -k -v -u \"${config_loader.SCM.USERNAME}:${config_loader.SCM.PASSWORD}\" -H \"Content-Type: application/json\" ${scm_webhook_api}${repo_name}/configurations -d \'{\"title\": \"${webhookName}\", \"url\": \"${scm_webhook_target_url}\" , \"enabled\": true}\'" + withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) { + sh "curl -X PUT -k -v -u \"${UNAME}:${PWD}\" -H \"Content-Type: application/json\" ${scm_webhook_api}${repo_name}/configurations -d \'{\"title\": \"${webhookName}\", \"url\": \"${scm_webhook_target_url}\" , \"enabled\": true}\'" + } } } @@ -185,10 +190,12 @@ def deleteProject(repo_name) { returnStdout: true ).trim() } else if (config_loader.SCM.TYPE == "bitbucket") { - def outputStr = sh( - script: "curl -X DELETE -k -u \"${config_loader.SCM.USERNAME}:${config_loader.SCM.PASSWORD}\" '" + scm_user_services_api_endpoint + repo_name + "'", - returnStdout: true - ).trim() + withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) { + def outputStr = sh( + script: "curl -X DELETE -k -u \"${UNAME}:${PWD}\" '" + scm_user_services_api_endpoint + repo_name + "'", + returnStdout: true + ).trim() + } } } @@ -307,7 +314,7 @@ def getRepoCommitterInfo(commitHash) { def scm_commit_api = "http://${config_loader.REPOSITORY.BASE_URL}/rest/api/1.0/projects/${repoBase}/repos/${getRepoName()}" def repoUrl = "${scm_commit_api}/commits/${commitHash}" echo "[Metadata] Repository URL: $repoUrl" - def scmCommitResponse + def scmCommitResponse withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) { scmCommitResponse = sh(script: "curl -k -v -u \"$UNAME:$PWD\" -H \"Content-Type: application/json\" $repoUrl", returnStdout: true).trim() } diff --git a/jazz-build-module/service-configuration-data-loader.groovy b/builds/jazz-build-module/service-configuration-data-loader.groovy similarity index 68% rename from jazz-build-module/service-configuration-data-loader.groovy rename to builds/jazz-build-module/service-configuration-data-loader.groovy index 71cb22e2be..e3d4a31233 100644 --- a/jazz-build-module/service-configuration-data-loader.groovy +++ b/builds/jazz-build-module/service-configuration-data-loader.groovy @@ -2,7 +2,6 @@ import groovy.json.JsonSlurperClassic import groovy.json.JsonOutput import groovy.transform.Field -import jenkins.security.* echo "Service configuration module loaded successfully" @@ -25,7 +24,7 @@ echo "Service configuration module loaded successfully" * Initialize the module */ def initialize(config, role_arn, region, role_id, jenkins_url, current_environment, service_name, utilModule) { - + config_loader = config setRoleARN(role_arn) setRegion(region) @@ -51,6 +50,30 @@ def loadServiceConfigurationData() { sh "sed -i -- 's/{conf-accId}/${role_id}/g' ./swagger/swagger.json" } + if ( (service_name.trim() == "jazz_metrics") ) { + sh "sed -i -- 's/{conf-region}/${region}/g' ./config/dev-config.json" + sh "sed -i -- 's/{conf-region}/${region}/g' ./config/stg-config.json" + sh "sed -i -- 's/{conf-region}/${region}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["DEV"])}/g' ./config/dev-config.json" + sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["STG"])}/g' ./config/stg-config.json" + sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["PROD"])}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{conf-apikey-dev}/${utilModule.getAPIIdForCore(config_loader.AWS.API["DEV"])}/g' ./config/global-config.json" + sh "sed -i -- 's/{conf-apikey-stg}/${utilModule.getAPIIdForCore(config_loader.AWS.API["STG"])}/g' ./config/global-config.json" + sh "sed -i -- 's/{conf-apikey-prod}/${utilModule.getAPIIdForCore(config_loader.AWS.API["PROD"])}/g' ./config/global-config.json" + + sh "sed -i -- 's/{conf_stack_prefix}/${config_loader.INSTANCE_PREFIX}/g' ./config/global-config.json" + + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/dev-config.json" + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/stg-config.json" + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/dev-config.json" + sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/stg-config.json" + sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/prod-config.json" + } + if ( (service_name.trim() == "jazz_codeq") ) { sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["DEV"])}/g' ./config/dev-config.json" sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["STG"])}/g' ./config/stg-config.json" @@ -65,15 +88,15 @@ def loadServiceConfigurationData() { sh "sed -i -- 's/{sonar_hostname}/${config_loader.CODE_QUALITY.SONAR.HOST_NAME}/g' ./config/prod-config.json" withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.CODE_QUALITY.SONAR.ADMIN_SONAR_CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]){ - sh "sed -i -- 's/{sonar_user}/${UNAME}/g' ./config/dev-config.json" + sh "sed -i -- 's/{sonar_user}/${UNAME}/g' ./config/dev-config.json" sh "sed -i -- 's/{sonar_user}/${UNAME}/g' ./config/stg-config.json" sh "sed -i -- 's/{sonar_user}/${UNAME}/g' ./config/prod-config.json" - + sh "sed -i -- 's/{sonar_creds}/${PWD}/g' ./config/dev-config.json" sh "sed -i -- 's/{sonar_creds}/${PWD}/g' ./config/stg-config.json" sh "sed -i -- 's/{sonar_creds}/${PWD}/g' ./config/prod-config.json" } - + sh "sed -i -- 's/{key_prefix}/${config_loader.CODE_QUALITY.SONAR.KEY_PREFIX}/g' ./config/dev-config.json" sh "sed -i -- 's/{key_prefix}/${config_loader.CODE_QUALITY.SONAR.KEY_PREFIX}/g' ./config/stg-config.json" sh "sed -i -- 's/{key_prefix}/${config_loader.CODE_QUALITY.SONAR.KEY_PREFIX}/g' ./config/prod-config.json" @@ -87,15 +110,21 @@ def loadServiceConfigurationData() { sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/prod-config.json" } - if ((service_name.trim() == "jazz_delete-serverless-service")) { - sh "sed -i -- 's/{conf-jenkins-host}/${jenkins_url}/g' ./index.js" + if ( (service_name.trim() == "jazz_assets") ) { + sh "sed -i -- 's/{conf_stack_prefix}/${config_loader.INSTANCE_PREFIX}/g' ./config/dev-config.json" + sh "sed -i -- 's/{conf_stack_prefix}/${config_loader.INSTANCE_PREFIX}/g' ./config/stg-config.json" + sh "sed -i -- 's/{conf_stack_prefix}/${config_loader.INSTANCE_PREFIX}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{conf-region}/${region}/g' ./config/dev-config.json" + sh "sed -i -- 's/{conf-region}/${region}/g' ./config/stg-config.json" + sh "sed -i -- 's/{conf-region}/${region}/g' ./config/prod-config.json" } if ( (service_name.trim() == "jazz_deployments") ) { sh "sed -i -- 's/{conf_stack_prefix}/${config_loader.INSTANCE_PREFIX}/g' ./config/dev-config.json" sh "sed -i -- 's/{conf_stack_prefix}/${config_loader.INSTANCE_PREFIX}/g' ./config/stg-config.json" sh "sed -i -- 's/{conf_stack_prefix}/${config_loader.INSTANCE_PREFIX}/g' ./config/prod-config.json" - + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/dev-config.json" sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/stg-config.json" sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/prod-config.json" @@ -129,7 +158,7 @@ def loadServiceConfigurationData() { sh "sed -i -- 's/{inst_stack_prefix}/${config_loader.INSTANCE_PREFIX}/g' ./config/dev-config.json" sh "sed -i -- 's/{inst_stack_prefix}/${config_loader.INSTANCE_PREFIX}/g' ./config/stg-config.json" sh "sed -i -- 's/{inst_stack_prefix}/${config_loader.INSTANCE_PREFIX}/g' ./config/prod-config.json" - + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/dev-config.json" sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/stg-config.json" sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/prod-config.json" @@ -147,7 +176,25 @@ def loadServiceConfigurationData() { sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/dev-config.json" sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/stg-config.json" sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/prod-config.json" - + + sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/dev-config.json" + sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/stg-config.json" + sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/prod-config.json" + } + + if ((service_name.trim() == "jazz_asset-event-handler")) { + sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["DEV"])}/g' ./config/dev-config.json" + sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["STG"])}/g' ./config/stg-config.json" + sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["PROD"])}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{conf-region}/${region}/g' ./config/dev-config.json" + sh "sed -i -- 's/{conf-region}/${region}/g' ./config/stg-config.json" + sh "sed -i -- 's/{conf-region}/${region}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/dev-config.json" + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/stg-config.json" + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/prod-config.json" + sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/dev-config.json" sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/stg-config.json" sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/prod-config.json" @@ -165,12 +212,39 @@ def loadServiceConfigurationData() { sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/dev-config.json" sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/stg-config.json" sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/prod-config.json" - + sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/dev-config.json" sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/stg-config.json" sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/prod-config.json" } + if ((service_name.trim() == "jazz_slack-event-handler")) { + sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["DEV"])}/g' ./config/dev-config.json" + sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["STG"])}/g' ./config/stg-config.json" + sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["PROD"])}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{conf-region}/${region}/g' ./config/dev-config.json" + sh "sed -i -- 's/{conf-region}/${region}/g' ./config/stg-config.json" + sh "sed -i -- 's/{conf-region}/${region}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/dev-config.json" + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/stg-config.json" + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/dev-config.json" + sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/stg-config.json" + sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{slack_notifier_name}/${config_loader.SLACK.SLACK_USER}/g' ./config/dev-config.json" + sh "sed -i -- 's/{slack_notifier_name}/${config_loader.SLACK.SLACK_USER}/g' ./config/stg-config.json" + sh "sed -i -- 's/{slack_notifier_name}/${config_loader.SLACK.SLACK_USER}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{slack_token}/${config_loader.SLACK.SLACK_TOKEN}/g' ./config/dev-config.json" + sh "sed -i -- 's/{slack_token}/${config_loader.SLACK.SLACK_TOKEN}/g' ./config/stg-config.json" + sh "sed -i -- 's/{slack_token}/${config_loader.SLACK.SLACK_TOKEN}/g' ./config/prod-config.json" + + } + if ((service_name.trim() == "jazz_events")) { sh "sed -i -- 's/{conf_stack_prefix}/${config_loader.INSTANCE_PREFIX}/g' ./config/dev-config.json" sh "sed -i -- 's/{conf_stack_prefix}/${config_loader.INSTANCE_PREFIX}/g' ./config/stg-config.json" @@ -192,33 +266,36 @@ def loadServiceConfigurationData() { sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["DEV"])}/g' ./config/dev-config.json" sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["STG"])}/g' ./config/stg-config.json" sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["PROD"])}/g' ./config/prod-config.json" - + sh "sed -i -- 's/{conf-region}/${region}/g' ./config/dev-config.json" sh "sed -i -- 's/{conf-region}/${region}/g' ./config/stg-config.json" sh "sed -i -- 's/{conf-region}/${region}/g' ./config/prod-config.json" - + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/dev-config.json" sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/stg-config.json" sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/prod-config.json" - + sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/dev-config.json" sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/stg-config.json" sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/prod-config.json" - + } if ((service_name.trim() == "jazz_login") || (service_name.trim() == "jazz_logout") || (service_name.trim() == "jazz_cognito-authorizer")) { sh "sed -i -- 's/{conf-user-pool-id}/${config_loader.AWS.COGNITO.USER_POOL_ID}/g' ./config/dev-config.json" sh "sed -i -- 's/{conf-client-id}/${config_loader.AWS.COGNITO.CLIENT_ID}/g' ./config/dev-config.json" sh "sed -i -- 's/{conf-region}/${region}/g' ./config/dev-config.json" - + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/dev-config.json" + sh "sed -i -- 's/{conf-user-pool-id}/${config_loader.AWS.COGNITO.USER_POOL_ID}/g' ./config/stg-config.json" sh "sed -i -- 's/{conf-client-id}/${config_loader.AWS.COGNITO.CLIENT_ID}/g' ./config/stg-config.json" sh "sed -i -- 's/{conf-region}/${region}/g' ./config/stg-config.json" - + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/stg-config.json" + sh "sed -i -- 's/{conf-user-pool-id}/${config_loader.AWS.COGNITO.USER_POOL_ID}/g' ./config/prod-config.json" sh "sed -i -- 's/{conf-client-id}/${config_loader.AWS.COGNITO.CLIENT_ID}/g' ./config/prod-config.json" sh "sed -i -- 's/{conf-region}/${region}/g' ./config/prod-config.json" + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/prod-config.json" } if ((service_name.trim() == "jazz_is-service-available")) { @@ -236,17 +313,18 @@ def loadServiceConfigurationData() { sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["DEV"])}/g' ./config/dev-config.json" sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["STG"])}/g' ./config/stg-config.json" sh "sed -i -- 's/{conf-apikey}/${utilModule.getAPIIdForCore(config_loader.AWS.API["PROD"])}/g' ./config/prod-config.json" - + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/dev-config.json" sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/stg-config.json" sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/prod-config.json" - + sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/dev-config.json" sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/stg-config.json" sh "sed -i -- 's/{jazz_admin_creds}/${config_loader.JAZZ.PASSWD}/g' ./config/prod-config.json" } - if ((service_name.trim() == "jazz_delete-serverless-service") || (service_name.trim() == "jazz_create-serverless-service") || (service_name.trim() == "jazz_deployments")) { + if ((service_name.trim() == "jazz_delete-serverless-service") || (service_name.trim() == "jazz_create-serverless-service") + || (service_name.trim() == "jazz_deployments") || (service_name.trim() == "jazz_environment-event-handler")) { sh "sed -i -- 's/{conf-jenkins-host}/${jenkins_url}/g' ./config/dev-config.json" sh "sed -i -- 's/{conf-jenkins-host}/${jenkins_url}/g' ./config/stg-config.json" sh "sed -i -- 's/{conf-jenkins-host}/${jenkins_url}/g' ./config/prod-config.json" @@ -259,9 +337,9 @@ def loadServiceConfigurationData() { sh "sed -i -- 's/{job_token}/${config_loader.JENKINS.JOB_AUTH_TOKEN}/g' ./config/stg-config.json" sh "sed -i -- 's/{job_token}/${config_loader.JENKINS.JOB_AUTH_TOKEN}/g' ./config/prod-config.json" - sh "sed -i -- 's/{api_token}/${getApiToken()}/g' ./config/dev-config.json" - sh "sed -i -- 's/{api_token}/${getApiToken()}/g' ./config/stg-config.json" - sh "sed -i -- 's/{api_token}/${getApiToken()}/g' ./config/prod-config.json" + sh "sed -i -- 's/{api_token}/${utilModule.getApiToken()}/g' ./config/dev-config.json" + sh "sed -i -- 's/{api_token}/${utilModule.getApiToken()}/g' ./config/stg-config.json" + sh "sed -i -- 's/{api_token}/${utilModule.getApiToken()}/g' ./config/prod-config.json" sh "sed -i -- 's/{conf-region}/${region}/g' ./config/dev-config.json" sh "sed -i -- 's/{conf-region}/${region}/g' ./config/stg-config.json" @@ -275,9 +353,15 @@ def loadServiceConfigurationData() { } if (service_name.trim() == "jazz_services") { - sh "sed -i -- 's/{conf-region}/${region}/g' ./config/dev-config.json" - sh "sed -i -- 's/{conf-region}/${region}/g' ./config/stg-config.json" - sh "sed -i -- 's/{conf-region}/${region}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{inst_stack_prefix}/${config_loader.INSTANCE_PREFIX}/g' ./config/dev-config.json" + sh "sed -i -- 's/{inst_stack_prefix}/${config_loader.INSTANCE_PREFIX}/g' ./config/stg-config.json" + sh "sed -i -- 's/{inst_stack_prefix}/${config_loader.INSTANCE_PREFIX}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/dev-config.json" + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/stg-config.json" + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/prod-config.json" + } if (service_name.trim() == "jazz_logs") { @@ -317,26 +401,65 @@ def loadServiceConfigurationData() { sh "sed -i -- 's,{bb_service_host},http://${config_loader.REPOSITORY.BASE_URL},g' ./config/dev-config.json" sh "sed -i -- 's,{bb_service_host},http://${config_loader.REPOSITORY.BASE_URL},g' ./config/stg-config.json" sh "sed -i -- 's,{bb_service_host},http://${config_loader.REPOSITORY.BASE_URL},g' ./config/prod-config.json" - - sh "sed -i -- 's/{bb_username}/${config_loader.SCM.USERNAME}/g' ./config/dev-config.json" - sh "sed -i -- 's/{bb_username}/${config_loader.SCM.USERNAME}/g' ./config/stg-config.json" - sh "sed -i -- 's/{bb_username}/${config_loader.SCM.USERNAME}/g' ./config/prod-config.json" - - sh "sed -i -- 's/{bb_password}/${config_loader.SCM.PASSWORD}/g' ./config/dev-config.json" - sh "sed -i -- 's/{bb_password}/${config_loader.SCM.PASSWORD}/g' ./config/stg-config.json" - sh "sed -i -- 's/{bb_password}/${config_loader.SCM.PASSWORD}/g' ./config/prod-config.json" + + withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) { + sh "sed -i -- 's/{bb_username}/${UNAME}/g' ./config/dev-config.json" + sh "sed -i -- 's/{bb_username}/${UNAME}/g' ./config/stg-config.json" + sh "sed -i -- 's/{bb_username}/${UNAME}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{bb_password}/${PWD}/g' ./config/dev-config.json" + sh "sed -i -- 's/{bb_password}/${PWD}/g' ./config/stg-config.json" + sh "sed -i -- 's/{bb_password}/${PWD}/g' ./config/prod-config.json" + } } if (config_loader.SCM.TYPE == "gitlab") { sh "sed -i -- 's,{gitlab_service_host},http://${config_loader.REPOSITORY.BASE_URL},g' ./config/dev-config.json" sh "sed -i -- 's,{gitlab_service_host},http://${config_loader.REPOSITORY.BASE_URL},g' ./config/stg-config.json" sh "sed -i -- 's,{gitlab_service_host},http://${config_loader.REPOSITORY.BASE_URL},g' ./config/prod-config.json" - + sh "sed -i -- 's/{gitlab_private_token}/${config_loader.SCM.PRIVATE_TOKEN}/g' ./config/dev-config.json" sh "sed -i -- 's/{gitlab_private_token}/${config_loader.SCM.PRIVATE_TOKEN}/g' ./config/stg-config.json" sh "sed -i -- 's/{gitlab_private_token}/${config_loader.SCM.PRIVATE_TOKEN}/g' ./config/prod-config.json" } } + if (service_name.trim() == "jazz_admin") { + sh "sed -i -- 's/{scm-type}/${config_loader.SCM.TYPE}/g' ./config/dev-config.json" + sh "sed -i -- 's/{scm-type}/${config_loader.SCM.TYPE}/g' ./config/stg-config.json" + sh "sed -i -- 's/{scm-type}/${config_loader.SCM.TYPE}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/dev-config.json" + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/stg-config.json" + sh "sed -i -- 's/{jazz_admin}/${config_loader.JAZZ.ADMIN}/g' ./config/prod-config.json" + + if (config_loader.SCM.TYPE == "bitbucket") { + + sh "sed -i -- 's,{base-url},http://${config_loader.REPOSITORY.BASE_URL},g' ./config/dev-config.json" + sh "sed -i -- 's,{base-url},http://${config_loader.REPOSITORY.BASE_URL},g' ./config/stg-config.json" + sh "sed -i -- 's,{base-url},http://${config_loader.REPOSITORY.BASE_URL},g' ./config/prod-config.json" + + withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) { + sh "sed -i -- 's/{bb_username}/${UNAME}/g' ./config/dev-config.json" + sh "sed -i -- 's/{bb_username}/${UNAME}/g' ./config/stg-config.json" + sh "sed -i -- 's/{bb_username}/${UNAME}/g' ./config/prod-config.json" + + sh "sed -i -- 's/{bb_password}/${PWD}/g' ./config/dev-config.json" + sh "sed -i -- 's/{bb_password}/${PWD}/g' ./config/stg-config.json" + sh "sed -i -- 's/{bb_password}/${PWD}/g' ./config/prod-config.json" + } + } + + if (config_loader.SCM.TYPE == "gitlab") { + + sh "sed -i -- 's,{base-url},http://${config_loader.REPOSITORY.BASE_URL},g' ./config/dev-config.json" + sh "sed -i -- 's,{base-url},http://${config_loader.REPOSITORY.BASE_URL},g' ./config/stg-config.json" + sh "sed -i -- 's,{base-url},http://${config_loader.REPOSITORY.BASE_URL},g' ./config/prod-config.json" + + sh "sed -i -- 's/{private-token}/${config_loader.SCM.PRIVATE_TOKEN}/g' ./config/dev-config.json" + sh "sed -i -- 's/{private-token}/${config_loader.SCM.PRIVATE_TOKEN}/g' ./config/stg-config.json" + sh "sed -i -- 's/{private-token}/${config_loader.SCM.PRIVATE_TOKEN}/g' ./config/prod-config.json" + } + } if (service_name.trim() == "jazz_email") { echo "Updating parameter specific to platform email" @@ -344,9 +467,7 @@ def loadServiceConfigurationData() { sh "sed -i -- 's/{conf-region}/${region}/g' ./config/stg-config.json" sh "sed -i -- 's/{conf-region}/${region}/g' ./config/prod-config.json" } - - } - catch (e) { + } catch (e) { echo "error occured while loading service configuration: " + e.getMessage() error "error occured while loading service configuration: " + e.getMessage() } @@ -374,8 +495,9 @@ def setUtilModule(util){ utilModule = util } def setKinesisStream(config){ - if ((config['service'].trim() == "services-handler") || (config['service'].trim() == "events-handler") || - (config['service'] == "environment-event-handler") || (config['service'] == "deployments-event-handler")) { + if ((config['service'].trim() == "services-handler") || (config['service'].trim() == "events-handler") || + (config['service'] == "environment-event-handler") || (config['service'] == "deployments-event-handler" ) || + (config['service'] == "asset-event-handler") || ((config['service'] == "slack-event-handler") && (config_loader.SLACK.ENABLE_SLACK == "true"))) { def function_name = "${config_loader.INSTANCE_PREFIX}-${config['domain']}-${config['service']}-${current_environment}" def event_source_list = sh( script: "aws lambda list-event-source-mappings --query \"EventSourceMappings[?contains(FunctionArn, '$function_name')]\" --region \"$region\"", @@ -385,6 +507,7 @@ def setKinesisStream(config){ if (event_source_list == "[]") { sh "aws lambda create-event-source-mapping --event-source-arn arn:aws:kinesis:$region:$role_id:stream/${config_loader.INSTANCE_PREFIX}-events-hub-" + current_environment + " --function-name arn:aws:lambda:$region:$role_id:function:$function_name --starting-position LATEST --region " + region } + } } def setLogStreamPermission(config){ @@ -402,15 +525,4 @@ def setLogStreamPermission(config){ } } } - -def getApiToken(){ - withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.JENKINS.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]){ - User u = User.get(UNAME) - ApiTokenProperty t = u.getProperty(ApiTokenProperty.class) - def token = t.getApiToken() - return token - } -} - - return this diff --git a/jazz-build-module/service-metadata-loader.groovy b/builds/jazz-build-module/service-metadata-loader.groovy similarity index 100% rename from jazz-build-module/service-metadata-loader.groovy rename to builds/jazz-build-module/service-metadata-loader.groovy diff --git a/jazz-build-module/sonar-module.groovy b/builds/jazz-build-module/sonar-module.groovy similarity index 100% rename from jazz-build-module/sonar-module.groovy rename to builds/jazz-build-module/sonar-module.groovy diff --git a/jazz-build-module/utility-loader.groovy b/builds/jazz-build-module/utility-loader.groovy similarity index 79% rename from jazz-build-module/utility-loader.groovy rename to builds/jazz-build-module/utility-loader.groovy index 3a34d829ec..2c6188c1dd 100644 --- a/jazz-build-module/utility-loader.groovy +++ b/builds/jazz-build-module/utility-loader.groovy @@ -3,6 +3,7 @@ import groovy.json.JsonSlurperClassic import groovy.json.JsonOutput import groovy.transform.Field import static java.util.UUID.randomUUID +import jenkins.security.* echo "Utility module loaded successfully" @@ -74,8 +75,8 @@ def jazz_quiet_sh(cmd) { } /** -* Get Request Id -* @return +* Get Request Id +* @return */ def generateRequestId() { UUID uuid = UUID.randomUUID() @@ -112,6 +113,19 @@ def getAPIId(apiIdMapping, namespace, service) { } } +@NonCPS +def generateAssetMap(provider, providerId, type, service_config) { + + def serviceCtxMap = [ + service_type: service_config['type'], + provider: provider, + provider_id: providerId, + type: type, + created_by: service_config['created_by'] + ] + return serviceCtxMap; +} + /** getAPIIdForCore is a helper method to get apiId for jazz core services */ @@ -121,11 +135,19 @@ def getAPIIdForCore(apiIdMapping) { /** * Set config_loader - * @return + * @return */ def setConfigLoader(configLoader) { config_loader = configLoader } +def getApiToken(){ + withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: config_loader.JENKINS.CREDENTIAL_ID, passwordVariable: 'PWD', usernameVariable: 'UNAME']]){ + User u = User.get(UNAME) + ApiTokenProperty t = u.getProperty(ApiTokenProperty.class) + def token = t.getApiToken() + return token + } +} return this diff --git a/jenkins-build-pack-api/Jenkinsfile b/builds/jenkins-build-pack-api/Jenkinsfile similarity index 85% rename from jenkins-build-pack-api/Jenkinsfile rename to builds/jenkins-build-pack-api/Jenkinsfile index 66ea9024c7..b27dfd9710 100644 --- a/jenkins-build-pack-api/Jenkinsfile +++ b/builds/jenkins-build-pack-api/Jenkinsfile @@ -33,7 +33,7 @@ node() { def jazz_prod_api_id = utilModule.getAPIIdForCore(configLoader.AWS.API["PROD"]) g_base_url = "https://${jazz_prod_api_id}.execute-api.${configLoader.AWS.REGION}.amazonaws.com/prod" - g_base_url_for_swagger = "http://editor.swagger.io/?url=http://${configLoader.AWS.S3.API_DOC}.s3-website-${configLoader.AWS.REGION}.amazonaws.com/" + g_base_url_for_swagger = "http://${configLoader.AWS.S3.API_DOC}.s3-website-${configLoader.AWS.REGION}.amazonaws.com/" echo "Build triggered via branch: " + params.scm_branch @@ -138,8 +138,6 @@ node() { } } - - def requestId = utilModule.generateRequestId() if (requestId != null) { events.setRequestId(requestId) @@ -225,6 +223,9 @@ node() { def envBucketKey = "${env_key}${configLoader.JAZZ.S3_BUCKET_NAME_SUFFIX}" sh "serverless deploy --stage ${environment_logical_id} -v --bucket ${configLoader.AWS.S3[envBucketKey]}" + def lambdaARN = getLambdaARN(stackName); + events.sendCompletedEvent('CREATE_ASSET', null, utilModule.generateAssetMap("aws", lambdaARN, "lambda", config), environment_logical_id); + if (fileExists('swagger/swagger.json')) { echo "Generating swagger file for environment: ${env_key}" @@ -244,12 +245,24 @@ node() { sh "aws apigateway put-rest-api --rest-api-id ${api_id} --mode merge --parameters basepath=prepend --body 'file://swagger/swagger.json'" + " --profile cloud-api" sh "aws apigateway create-deployment --rest-api-id ${api_id} --stage-name ${current_environment} --profile cloud-api" sh "aws apigateway tag-resource --resource-arn arn:aws:apigateway:${configLoader.AWS.REGION}::/restapis/${api_id}/stages/${current_environment} --tags Application=Jazz,JazzInstance=${configLoader.INSTANCE_PREFIX} --profile cloud-api" - if (current_environment == 'prod' || config['domain'] == 'jazz') { + + if("${configLoader.JAZZ.API_DETAILED_MONITORING}" == "true") { + sh "aws apigateway update-stage --rest-api-id ${api_id} --stage-name ${current_environment} --patch-operations op=replace,path=/*/*/metrics/enabled,value=true --region ${configLoader.AWS.REGION}" + } else { + sh "aws apigateway update-stage --rest-api-id ${api_id} --stage-name ${current_environment} --patch-operations op=replace,path=/*/*/metrics/enabled,value=false --region ${configLoader.AWS.REGION}" + } + if (current_environment == 'prod' || config['domain'] == 'jazz') { endpointUrl = "https://${apiHostName}/${current_environment}/${config['domain']}/${config['service']}" } else { endpointUrl = "https://${apiHostName}/${current_environment}/${environment_logical_id}/${config['domain']}/${config['service']}" } + def apiArns = getAPIGatewayResourceARNs(api_id, environment_logical_id) + if(apiArns) { + for (arn in apiArns) { + events.sendCompletedEvent('CREATE_ASSET', null, utilModule.generateAssetMap("aws", arn, "apigateway", config), environment_logical_id); + } + } if (domain != "jazz") { createSubscriptionFilters(stackName, configLoader.AWS.REGION, roleId); @@ -259,14 +272,12 @@ node() { sh "aws s3 cp swagger/ s3://${configLoader.AWS.S3.API_DOC}/${domain}/${config['service']}/${environment_logical_id} --recursive " echo "completed deployment........." - def svc_status = "Your service endpoint for ${current_environment} environment: ${endpointUrl} \n\nView and test your API here: ${g_base_url_for_swagger}${domain}/${service}/${environment_logical_id}/swagger.json" + def swaggerDocUrl = "${g_base_url_for_swagger}${domain}/${service}/${environment_logical_id}/swagger.json" + events.sendCompletedEvent('CREATE_ASSET', null, utilModule.generateAssetMap("aws", swaggerDocUrl, "swagger_url", config), environment_logical_id); + def svc_status = "Your service endpoint for ${current_environment} environment: ${endpointUrl} \n\nView and test your API here: ${configLoader.JAZZ.SWAGGER.EDITOR_URL}${swaggerDocUrl}" send_status_email(config, 'COMPLETED', svc_status) } - - if (domain && domain == "jazz") { - serviceConfigdata.setLogStreamPermission(config) - } } } catch (ex) { events.sendFailureEvent('UPDATE_ENVIRONMENT', ex.getMessage(), environmentDeploymentMetadata.generateEnvironmentMap("deployment_failed", environment_logical_id), environment_logical_id) @@ -276,6 +287,8 @@ node() { } environmentDeploymentMetadata.setEnvironmentEndpoint(endpointUrl) def serviceContext = [created_by : config['created_by'], deployed_by: gitCommitOwner] + + events.sendCompletedEvent('CREATE_ASSET', null, utilModule.generateAssetMap("aws", endpointUrl, "endpoint_url", config), environment_logical_id); events.sendCompletedEvent('UPDATE_ENVIRONMENT', 'Environment Update event for deployment completion', environmentDeploymentMetadata.generateEnvironmentMap("deployment_completed", environment_logical_id), environment_logical_id) events.sendCompletedEvent('UPDATE_DEPLOYMENT', 'Deployment completion Event for stage deployment', environmentDeploymentMetadata.generateDeploymentMap("successful", environment_logical_id, gitCommitHash), environment_logical_id) events.sendCompletedEvent('DEPLOY_TO_AWS', 'successfully deployed services to AWS', serviceContext, environment_logical_id) @@ -284,6 +297,113 @@ node() { }//dir ends here } +def getLambdaARN(String stackName) { + def ARN = ""; + + try { + def cloudformation_resources = ""; + cloudformation_resources = sh(returnStdout: true, script: "aws cloudformation describe-stacks --output json --stack-name ${stackName} --profile cloud-api") + + def parsedObject = parseJson(cloudformation_resources); + def outputs = parsedObject.Stacks[0].Outputs; + + for (output in outputs) { + if (output.OutputKey == "HandlerLambdaFunctionQualifiedArn") { + ARN = output.OutputValue + } + } + } catch (ex) { + error ex.getMessage(); + } + + return ARN; +} + +/** + * Get API Resource Arns + * + */ +def getAPIGatewayResourceARNs(apiId, deployStg){ + def basePath = getBasePath() + echo "basePath : $basePath" + basePath = basePath.replaceAll("^api/", "/"); + if(!basePath.startsWith("/")) { + basePath = "/"+basePath + } + def resourceArns = [] + def resourcesMap = createPathMethodList() //Returns a list maps of path and methods + if(resourcesMap) { + for (_map in resourcesMap){ + for (path in _map) { + def arn = createApiGatewayResourceArn(apiId, deployStg, path.value, path.key, basePath) + resourceArns.add(arn) + } + } + } + echo "resourceArns : $resourceArns" + return resourceArns; +} + +def getBasePath() { + + def propValue = "/" + + if (fileExists('swagger/swagger.json')) { + def swaggerFile = readFile('swagger/swagger.json').trim() + def slurper = new groovy.json.JsonSlurper() + def result = slurper.parseText(swaggerFile) + + propValue = result.basePath + } + def propVal = propValue.replace( /{domain}/, '' ).trim() + if (propVal.startsWith('/')) { + propVal = propVal.substring(1) + } + echo "getBasePath : $propValue -> $propVal" + return propVal +} + +//Creates a list consisting of all path-method combination from the swagger which is serializable. +def createPathMethodList() { //Creates a list consisting of all path-method combination from the swagger + def swaggerFile = readFile('swagger/swagger.json').trim() + def lazyMap = new groovy.json.JsonSlurper().parseText(swaggerFile) + def jsonMap = [:] + jsonMap.putAll(lazyMap.paths) + def composedList = [] + + for (path in jsonMap){ + def pathKey = path.key + def pathVal = [:] + pathVal.putAll(path.value) + + //loop through all methods in path + for (method in pathVal){ + def methodVal = method.key.toUpperCase() + def pathMap = [:] + pathMap[pathKey] = methodVal + composedList.add(pathMap) + } + } + echo "composedList : $composedList" + return composedList; +} + +/** + * create apigateway arns pattern + */ +def createApiGatewayResourceArn(apiId, deployStg, method, path, basePath) { + def apiResourceArn = "" + def _region = configLoader.AWS.REGION + def _account = configLoader.AWS.ACCOUNTID + def _apiId = apiId + def _stgName = deployStg + def _method = method + def _path = path + def _basePath = basePath + apiResourceArn = "arn:aws:execute-api:"+_region+":"+_account+":"+_apiId+"/"+_stgName+"/"+_method+_basePath+_path + echo "apiResourceArn : $apiResourceArn" + return apiResourceArn; +} /** Update context stage to use the dev properties file. */ @@ -685,7 +805,7 @@ def send_status_email(config, build_status, email_content) { */ def runValidation(String runtime) { if (runtime.indexOf("nodejs") > -1) { - echo "running validations for $runtime" + echo "running validations for $runtime" sh "jshint *.js" } else if (runtime.indexOf("java") > -1) { echo "running validations for $runtime" diff --git a/jenkins-build-pack-api/README.md b/builds/jenkins-build-pack-api/README.md similarity index 100% rename from jenkins-build-pack-api/README.md rename to builds/jenkins-build-pack-api/README.md diff --git a/jenkins-build-pack-api/build.jenkins-build-pack b/builds/jenkins-build-pack-api/build.jenkins-build-pack similarity index 100% rename from jenkins-build-pack-api/build.jenkins-build-pack rename to builds/jenkins-build-pack-api/build.jenkins-build-pack diff --git a/jenkins-build-pack-lambda/Jenkinsfile b/builds/jenkins-build-pack-lambda/Jenkinsfile similarity index 97% rename from jenkins-build-pack-lambda/Jenkinsfile rename to builds/jenkins-build-pack-lambda/Jenkinsfile index 1a03b01e12..c2d566ddcc 100644 --- a/jenkins-build-pack-lambda/Jenkinsfile +++ b/builds/jenkins-build-pack-lambda/Jenkinsfile @@ -229,6 +229,14 @@ node() { // Generate serverless yml file with domain added in function name echo "Generate deployment env with domain" + if(isScheduleEnabled) { + def eventsArns = getEventsArn(config, current_environment) + for (def i = 0; i < eventsArns.size(); i++) { + def arn = eventsArns[i] + events.sendCompletedEvent('CREATE_ASSET', null, utilModule.generateAssetMap("aws", arn, "cloudwatch_event", config), environment_logical_id); + } + } + writeServerlessFile(config, current_environment) echo "setting lambda execution role as ${configLoader.AWS.ROLEID}"; @@ -238,7 +246,8 @@ node() { sh "serverless deploy --stage ${environment_logical_id} -v --bucket ${configLoader.AWS.S3[envBucketKey]}" lambdaARN = getLambdaARN(stackName) - events.sendCompletedEvent('CREATE_ASSET', null, generateAssetMap("aws", lambdaARN, config["type"], config['created_by']), environment_logical_id); + events.sendCompletedEvent('CREATE_ASSET', null, utilModule.generateAssetMap("aws", lambdaARN, "lambda", config), environment_logical_id); + echo "lambdaARN: ${lambdaARN}" // reset Credentials resetCredentials() @@ -246,12 +255,14 @@ node() { createSubscriptionFilters(stackName, configLoader.AWS.REGION, roleId); } - if (domain && domain == "jazz") { + serviceConfigdata.setLogStreamPermission(config) serviceConfigdata.setKinesisStream(config) } + def svc_response = echoServiceInfo(current_environment) send_status_email(config, 'COMPLETED', svc_response) + } catch (ex) { send_status_email(config, 'FAILED', '') events.sendFailureEvent('UPDATE_ENVIRONMENT', ex.getMessage(), environmentDeploymentMetadata.generateEnvironmentMap("deployment_failed", environment_logical_id), environment_logical_id) @@ -372,7 +383,7 @@ def buildLambda(String runtime) { virtualenv venv . venv/bin/activate pip install pytest - """ + """ } } @@ -688,14 +699,11 @@ def send_status_email(config, build_status, email_content) { * Function to get arns of the triggers/events configured for the Lambda. * */ -def getEventsArn(domain, service, env) { - echo "in getEventsArn - if domain, lambdaFnName: ${domain}-${service}-${env}" +def getEventsArn(config, env) { def eventsArn = [] try { - def lambdaFnName = service + "-" + env - if (domain) { - lambdaFnName = domain + "-" + lambdaFnName - } + def lambdaFnName = "${configLoader.INSTANCE_PREFIX}-${config['domain']}-${config['service']}" + def lambdaPolicyTxt = sh(script: "aws lambda get-policy --function-name $lambdaFnName --output json", returnStdout: true) def policyLists = null if (lambdaPolicyTxt) { @@ -755,19 +763,6 @@ def runValidation(String runtime) { } } -@NonCPS -def generateAssetMap(provider, providerId, type, created_by) { - - def serviceCtxMap = [ - provider: provider, - provider_id: providerId, - type: type, - created_by: created_by - ] - - return serviceCtxMap; -} - @NonCPS def parseJson(jsonString) { def lazyMap = new groovy.json.JsonSlurperClassic().parseText(jsonString) diff --git a/jenkins-build-pack-lambda/README.md b/builds/jenkins-build-pack-lambda/README.md similarity index 100% rename from jenkins-build-pack-lambda/README.md rename to builds/jenkins-build-pack-lambda/README.md diff --git a/jenkins-build-pack-lambda/build.jenkins-build-pack b/builds/jenkins-build-pack-lambda/build.jenkins-build-pack similarity index 100% rename from jenkins-build-pack-lambda/build.jenkins-build-pack rename to builds/jenkins-build-pack-lambda/build.jenkins-build-pack diff --git a/jenkins-build-pack-website/Jenkinsfile b/builds/jenkins-build-pack-website/Jenkinsfile similarity index 95% rename from jenkins-build-pack-website/Jenkinsfile rename to builds/jenkins-build-pack-website/Jenkinsfile index 32eebee9b2..77e9a9a2c2 100644 --- a/jenkins-build-pack-website/Jenkinsfile +++ b/builds/jenkins-build-pack-website/Jenkinsfile @@ -172,16 +172,20 @@ node() { asset_event = 'CREATE_ASSET' asset_event_message = 'create' } - events.sendStartedEvent(asset_event, "${asset_event_message} assets starts", context_map) + events.sendStartedEvent(asset_event, "${asset_event_message} assets starts", utilModule.generateAssetMap("aws", "arn:aws:s3:::${asset_info}/*", "s3", service_config)) try { sh "aws s3 sync ./app s3://${asset_info} --exclude \".git/*\" --exclude \".gitignore\" --exclude \"*.svg\"" sh "aws s3 sync ./app s3://${asset_info} --exclude \"*\" --include \"*.svg\" --no-guess-mime-type --content-type image/svg+xml" - + events.sendCompletedEvent(asset_event, null, utilModule.generateAssetMap("aws", "arn:aws:s3:::${asset_info}/*", "s3", service_config), environment); def url if (create_cloudfront_url == true) { updateOrCreateCF() - def cloudFrontDistribution = getCloudFrontDetails() - url = 'https://' + cloudFrontDistribution['Distribution'] + def cloudFrontDistribution = getCloudFrontARN() + cfArn = cloudFrontDistribution.ARN + events.sendCompletedEvent(asset_event, null, utilModule.generateAssetMap("aws", cfArn, "cloudfront", service_config), environment); + + def cloudFrontDistributionDetails = getCloudFrontDetails() + url = 'https://' + cloudFrontDistributionDetails['Distribution'] invalidateCloudFrontCache() generateBucketPolicy(true) @@ -201,7 +205,8 @@ node() { echo svc_status environmentDeploymentMetadata.setEnvironmentEndpoint(url) send_status_email('COMPLETED', svc_status) - events.sendCompletedEvent(asset_event, "${asset_event_message} assets completed", context_map) + + events.sendCompletedEvent(asset_event, "${asset_event_message} assets completed", utilModule.generateAssetMap("aws", url, "endpoint_url", service_config),environment) events.sendCompletedEvent('UPDATE_DEPLOYMENT', 'Deployment completion Event for $environment deployment', environmentDeploymentMetadata.generateDeploymentMap("successful", environment, gitCommitHash), environment) events.sendCompletedEvent('UPDATE_ENVIRONMENT', 'Environment Update event for deployment completion', environmentDeploymentMetadata.generateEnvironmentMap("deployment_completed", environment), environment) events.sendCompletedEvent('DEPLOY_TO_AWS', 'deployment completed', context_map) @@ -355,6 +360,29 @@ def listDistribution(){ } } +/** + * Get CloudFront ARN + */ +def getCloudFrontARN() { + def cfInfo = [:] + try { + def cloudFrontId = ""; + def cloudFrontDetailsArray = getCloudFrontDetails(); + cloudFrontId = cloudFrontDetailsArray.Id; + + def cloudFrontDistributionDetails = sh(returnStdout: true, script: "aws cloudfront get-distribution --output json --id $cloudFrontId") + echo "cloudFrontDistributionDetails... $cloudFrontDistributionDetails" + def _map = jsonParse(cloudFrontDistributionDetails) + if(_map) { + cfInfo << [ARN: _map.Distribution.ARN] + cfInfo << [DomainName: _map.Distribution.DomainName] + } + } catch(error) { + echo "error $error" + } + return cfInfo; +} + /** * Get CloudFront Details */ diff --git a/jenkins-build-pack-website/README.md b/builds/jenkins-build-pack-website/README.md similarity index 100% rename from jenkins-build-pack-website/README.md rename to builds/jenkins-build-pack-website/README.md diff --git a/jenkins-build-pack-website/build.jenkins-build-pack b/builds/jenkins-build-pack-website/build.jenkins-build-pack similarity index 100% rename from jenkins-build-pack-website/build.jenkins-build-pack rename to builds/jenkins-build-pack-website/build.jenkins-build-pack diff --git a/jenkins-build-pack-website/ip_list.json b/builds/jenkins-build-pack-website/ip_list.json similarity index 100% rename from jenkins-build-pack-website/ip_list.json rename to builds/jenkins-build-pack-website/ip_list.json diff --git a/serverless-config-pack/README.md b/builds/serverless-config-pack/README.md similarity index 100% rename from serverless-config-pack/README.md rename to builds/serverless-config-pack/README.md diff --git a/serverless-config-pack/serverless-java.yml b/builds/serverless-config-pack/serverless-java.yml similarity index 100% rename from serverless-config-pack/serverless-java.yml rename to builds/serverless-config-pack/serverless-java.yml diff --git a/serverless-config-pack/serverless-nodejs.yml b/builds/serverless-config-pack/serverless-nodejs.yml similarity index 100% rename from serverless-config-pack/serverless-nodejs.yml rename to builds/serverless-config-pack/serverless-nodejs.yml diff --git a/serverless-config-pack/serverless-python.yml b/builds/serverless-config-pack/serverless-python.yml similarity index 100% rename from serverless-config-pack/serverless-python.yml rename to builds/serverless-config-pack/serverless-python.yml diff --git a/service-onboarding-build-pack/Jenkinsfile b/builds/service-onboarding-build-pack/Jenkinsfile similarity index 93% rename from service-onboarding-build-pack/Jenkinsfile rename to builds/service-onboarding-build-pack/Jenkinsfile index 31ddabc1bd..44471b56e0 100644 --- a/service-onboarding-build-pack/Jenkinsfile +++ b/builds/service-onboarding-build-pack/Jenkinsfile @@ -140,7 +140,7 @@ node { for (item in config) { serviceMetadataJson[item.key] = item.value } - for (item in config.catalog_metadata) { + for (item in service_config.catalog_metadata) { serviceMetadataJson[item.key] = item.value } @@ -163,15 +163,11 @@ node { dir(service_template) { events.sendStartedEvent("MODIFY_TEMPLATE", 'modify template starts', context_map) - //Clearing depoyment-env.yml + + //Clearing depoyment-env.yml sh "echo -n > ./deployment-env.yml" // Add service_id in deployment-env.yml - sh "echo 'service_id: $service_id' >> ./deployment-env.yml" - - sh "sed -i -- 's/{service_name}/${service_config['service']}/g' ./Jenkinsfile" - sh "sed -i -- 's/{domain}/${service_config['domain']}/g' ./Jenkinsfile" - } events.sendCompletedEvent('MODIFY_TEMPLATE', 'modify template completed', context_map) } @@ -221,16 +217,9 @@ node { { sh "ls -lart" - withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: repo_credential_id, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) { + withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: repo_credential_id, passwordVariable: 'PWD', usernameVariable: 'UNAME']]) { try { events.sendStartedEvent("ADD_WEBHOOK", 'service repo creation starts', context_map) - def scm_webhook_target_url - if (configLoader.SCM.TYPE == "gitlab") { - scm_webhook_target_url = "http://${configLoader.JENKINS.USERNAME}:${configLoader.JENKINS.JENKINS_PASSWORD}@${JenkinsLocationConfiguration.get().getUrl().split('/')[2]}/project/Gitlab-Trigger-Job" - } else if (configLoader.SCM.TYPE == "bitbucket") { - scm_webhook_target_url = JenkinsLocationConfiguration.get().getUrl() + "/bitbucket-scmsource-hook/notify" - } - scmModule.addWebhook(repo_name, "notify-jenkins", scm_webhook_target_url) scmModule.addWebhook(repo_name, "notify-events", "${g_base_url}/jazz/scm-webhook") events.sendCompletedEvent('ADD_WEBHOOK', 'modify template completed', context_map) } @@ -434,7 +423,7 @@ def loadBuildModules(buildModuleUrl){ configModule = load "config-loader.groovy" configLoader = configModule.initialize(resultJsonString) echo "config loader loaded successfully." - + scmModule = load "scm-module.groovy" scmModule.initialize(configLoader) echo "SCM module loaded successfully." @@ -445,7 +434,7 @@ def loadBuildModules(buildModuleUrl){ serviceMetadataLoader = load "service-metadata-loader.groovy" serviceMetadataLoader.initialize(configLoader) echo "Service metadata loader module loaded successfully." - + utilModule = load "utility-loader.groovy" } } @@ -462,4 +451,4 @@ def getBuildModuleUrl() { def jsonParse(jsonString) { def nonLazyMap = new groovy.json.JsonSlurperClassic().parseText(jsonString) return nonLazyMap -} \ No newline at end of file +} diff --git a/service-onboarding-build-pack/branch_permissions_payload.json b/builds/service-onboarding-build-pack/branch_permissions_payload.json similarity index 100% rename from service-onboarding-build-pack/branch_permissions_payload.json rename to builds/service-onboarding-build-pack/branch_permissions_payload.json diff --git a/website-distribution-pack/distribution_config.json b/builds/website-distribution-pack/distribution_config.json similarity index 100% rename from website-distribution-pack/distribution_config.json rename to builds/website-distribution-pack/distribution_config.json diff --git a/website-distribution-pack/distribution_config_with_tags.json b/builds/website-distribution-pack/distribution_config_with_tags.json similarity index 100% rename from website-distribution-pack/distribution_config_with_tags.json rename to builds/website-distribution-pack/distribution_config_with_tags.json diff --git a/jazz-ui/.editorconfig b/core/jazz-ui/.editorconfig similarity index 100% rename from jazz-ui/.editorconfig rename to core/jazz-ui/.editorconfig diff --git a/jazz-ui/.gitignore b/core/jazz-ui/.gitignore similarity index 90% rename from jazz-ui/.gitignore rename to core/jazz-ui/.gitignore index ded97c4823..13b25ba5fc 100644 --- a/jazz-ui/.gitignore +++ b/core/jazz-ui/.gitignore @@ -33,7 +33,8 @@ npm-debug.log */package-lock.json testem.log /typings - +src/environments/environment.local.ts +package-lock.json # e2e /e2e/*.js /e2e/*.map diff --git a/jazz-ui/Jenkinsfile_Platform b/core/jazz-ui/Jenkinsfile_Platform similarity index 98% rename from jazz-ui/Jenkinsfile_Platform rename to core/jazz-ui/Jenkinsfile_Platform index cd95c36bc9..0486d16c8e 100644 --- a/jazz-ui/Jenkinsfile_Platform +++ b/core/jazz-ui/Jenkinsfile_Platform @@ -74,7 +74,7 @@ node () { dir('jazz-ui') { checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: config_loader.REPOSITORY.CREDENTIAL_ID, url: scmModule.getCoreRepoCloneUrl("jazz-ui")]]]) def jazz_prod_api_id = utilModule.getAPIIdForCore(config_loader.AWS.API["PROD"]) - + if(config_loader.UI_CONFIG.service_tabs.overview) sh "sed -i 's/{overview}/overview/g' ./src/environments/environment.oss.ts"; if(config_loader.UI_CONFIG.service_tabs.access_control) sh "sed -i 's/{access control}/access control/g' ./src/environments/environment.oss.ts"; if(config_loader.UI_CONFIG.service_tabs.metrics) sh "sed -i 's/{metrics}/metrics/g' ./src/environments/environment.oss.ts"; @@ -90,7 +90,9 @@ node () { sh "sed -i 's/{API_GATEWAY_KEY_PROD}/${jazz_prod_api_id}/g' ./src/environments/environment.oss.ts" sh "sed -i 's/{inst_region}/${config_loader.AWS.REGION}/g' ./src/environments/environment.oss.ts" sh "sed -i 's/{multi_env}/${config_loader.UI_CONFIG.feature.multi_env}/g' ./src/environments/environment.oss.ts" - + + sh "sed -i s!{swagger_editor}!${config_loader.JAZZ.SWAGGER.EDITOR_URL}!g ./src/environments/environment.oss.ts" + def envFile = readFile('./src/environments/environment.oss.ts'); echo "displaying env file :" echo "$envFile"; @@ -143,7 +145,7 @@ def loadBuildModules(buildModuleUrl){ scmModule = load "scm-module.groovy" scmModule.initialize(config_loader) - + utilModule = load "utility-loader.groovy" } }catch(ex) { @@ -158,4 +160,4 @@ def getBuildModuleUrl() { }else { return "http://${repo_base}/scm/${repo_core}/jazz-build-module.git" } -} \ No newline at end of file +} diff --git a/jazz-ui/LICENSE b/core/jazz-ui/LICENSE similarity index 100% rename from jazz-ui/LICENSE rename to core/jazz-ui/LICENSE diff --git a/jazz-ui/README.md b/core/jazz-ui/README.md similarity index 100% rename from jazz-ui/README.md rename to core/jazz-ui/README.md diff --git a/jazz-ui/angular-cli.json b/core/jazz-ui/angular-cli.json similarity index 89% rename from jazz-ui/angular-cli.json rename to core/jazz-ui/angular-cli.json index e007769b18..7eaf3cabb7 100644 --- a/jazz-ui/angular-cli.json +++ b/core/jazz-ui/angular-cli.json @@ -28,13 +28,16 @@ "../node_modules/jquery/dist/jquery.min.js", "../node_modules/bootstrap/dist/js/bootstrap.min.js", - "../node_modules/ion-rangeslider/js/ion.rangeSlider.min.js" + "../node_modules/ion-rangeslider/js/ion.rangeSlider.min.js", + "../node_modules/kotlin/kotlin.js/", + "../node_modules/really-relaxed-json/src/umd.bundle.js" ], "environmentSource": "environments/environment.ts", "environments": { "dev": "environments/environment.ts", "internal": "environments/environment.internal.ts", - "oss": "environments/environment.oss.ts" + "oss": "environments/environment.oss.ts", + "local": "environments/environment.local.ts" } }], diff --git a/jazz-ui/build.website b/core/jazz-ui/build.website similarity index 100% rename from jazz-ui/build.website rename to core/jazz-ui/build.website diff --git a/jazz-ui/e2e/app.e2e-spec.ts b/core/jazz-ui/e2e/app.e2e-spec.ts similarity index 100% rename from jazz-ui/e2e/app.e2e-spec.ts rename to core/jazz-ui/e2e/app.e2e-spec.ts diff --git a/jazz-ui/e2e/app.po.ts b/core/jazz-ui/e2e/app.po.ts similarity index 100% rename from jazz-ui/e2e/app.po.ts rename to core/jazz-ui/e2e/app.po.ts diff --git a/jazz-ui/e2e/tsconfig.json b/core/jazz-ui/e2e/tsconfig.json similarity index 100% rename from jazz-ui/e2e/tsconfig.json rename to core/jazz-ui/e2e/tsconfig.json diff --git a/jazz-ui/karma.conf.js b/core/jazz-ui/karma.conf.js similarity index 100% rename from jazz-ui/karma.conf.js rename to core/jazz-ui/karma.conf.js diff --git a/jazz-ui/ng2-datepicker.textClipping b/core/jazz-ui/ng2-datepicker.textClipping similarity index 100% rename from jazz-ui/ng2-datepicker.textClipping rename to core/jazz-ui/ng2-datepicker.textClipping diff --git a/jazz-ui/package.json b/core/jazz-ui/package.json similarity index 94% rename from jazz-ui/package.json rename to core/jazz-ui/package.json index f572ab4c8f..15ad67bdf8 100644 --- a/jazz-ui/package.json +++ b/core/jazz-ui/package.json @@ -27,6 +27,7 @@ "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.26", "@ng-idle/core": "2.0.0-beta.12", "@ng-idle/keepalive": "2.0.0-beta.12", + "@types/lodash": "^4.14.111", "angular2-moment": "^1.6.0", "angular2-number-picker": "^0.8.8", "angular2-toaster": "^2.0.0", @@ -35,11 +36,14 @@ "core-js": "^2.4.1", "d3": "^4.9.1", "d3-tip": "^0.7.1", + "kotlin": "^1.2.50", + "lodash": "^4.17.10", "ng-idle": "~1.3.2", "ng2-charts": "^1.6.0", "ng2-dropdown": "0.0.21", "ng2-ion-range-slider": "^1.0.3", "ng2-popover": "0.0.14", + "really-relaxed-json": "^0.2.24", "rxjs": "^5.4.1" }, "devDependencies": { diff --git a/jazz-ui/protractor.conf.js b/core/jazz-ui/protractor.conf.js similarity index 100% rename from jazz-ui/protractor.conf.js rename to core/jazz-ui/protractor.conf.js diff --git a/jazz-ui/src/app/IShared.ts b/core/jazz-ui/src/app/IShared.ts similarity index 100% rename from jazz-ui/src/app/IShared.ts rename to core/jazz-ui/src/app/IShared.ts diff --git a/jazz-ui/src/app/SharedService.service.ts b/core/jazz-ui/src/app/SharedService.service.ts similarity index 100% rename from jazz-ui/src/app/SharedService.service.ts rename to core/jazz-ui/src/app/SharedService.service.ts diff --git a/jazz-ui/src/app/adv-filter.directive.ts b/core/jazz-ui/src/app/adv-filter.directive.ts similarity index 100% rename from jazz-ui/src/app/adv-filter.directive.ts rename to core/jazz-ui/src/app/adv-filter.directive.ts diff --git a/jazz-ui/src/app/advanced-filter.service.spec.ts b/core/jazz-ui/src/app/advanced-filter.service.spec.ts similarity index 100% rename from jazz-ui/src/app/advanced-filter.service.spec.ts rename to core/jazz-ui/src/app/advanced-filter.service.spec.ts diff --git a/jazz-ui/src/app/advanced-filter.service.ts b/core/jazz-ui/src/app/advanced-filter.service.ts similarity index 100% rename from jazz-ui/src/app/advanced-filter.service.ts rename to core/jazz-ui/src/app/advanced-filter.service.ts diff --git a/jazz-ui/src/app/app.component.html b/core/jazz-ui/src/app/app.component.html similarity index 100% rename from jazz-ui/src/app/app.component.html rename to core/jazz-ui/src/app/app.component.html diff --git a/jazz-ui/src/app/app.component.scss b/core/jazz-ui/src/app/app.component.scss similarity index 100% rename from jazz-ui/src/app/app.component.scss rename to core/jazz-ui/src/app/app.component.scss diff --git a/jazz-ui/src/app/app.component.spec.ts b/core/jazz-ui/src/app/app.component.spec.ts similarity index 100% rename from jazz-ui/src/app/app.component.spec.ts rename to core/jazz-ui/src/app/app.component.spec.ts diff --git a/jazz-ui/src/app/app.component.ts b/core/jazz-ui/src/app/app.component.ts similarity index 100% rename from jazz-ui/src/app/app.component.ts rename to core/jazz-ui/src/app/app.component.ts diff --git a/jazz-ui/src/app/app.config.ts b/core/jazz-ui/src/app/app.config.ts similarity index 100% rename from jazz-ui/src/app/app.config.ts rename to core/jazz-ui/src/app/app.config.ts diff --git a/jazz-ui/src/app/app.module.ts b/core/jazz-ui/src/app/app.module.ts similarity index 93% rename from jazz-ui/src/app/app.module.ts rename to core/jazz-ui/src/app/app.module.ts index f718b773d8..b9e0b08b75 100644 --- a/jazz-ui/src/app/app.module.ts +++ b/core/jazz-ui/src/app/app.module.ts @@ -14,11 +14,8 @@ import { AuthenticationService, RouteGuard, DataCacheService, RequestService, Me import { SharedService } from './SharedService.service'; import { CronParserService } from './core/helpers'; import { DropdownModule } from 'ng2-dropdown'; -import { PopoverModule } from 'ng2-popover'; import { AppComponent } from './app.component'; import { ConfigService, ConfigLoader } from './app.config'; -import { AdvancedFilterService } from './advanced-filter.service'; -import { IonRangeSliderModule } from 'ng2-ion-range-slider'; import { LandingComponent } from './pages/landing/landing.component'; import { TestApiComponent } from './pages/testapi/test-api.component'; import { Error404Component } from './pages/error404/error404.component'; diff --git a/jazz-ui/src/app/app.route.ts b/core/jazz-ui/src/app/app.route.ts similarity index 100% rename from jazz-ui/src/app/app.route.ts rename to core/jazz-ui/src/app/app.route.ts diff --git a/jazz-ui/src/app/core/helpers/cronparser.service.ts b/core/jazz-ui/src/app/core/helpers/cronparser.service.ts similarity index 100% rename from jazz-ui/src/app/core/helpers/cronparser.service.ts rename to core/jazz-ui/src/app/core/helpers/cronparser.service.ts diff --git a/jazz-ui/src/app/core/helpers/index.ts b/core/jazz-ui/src/app/core/helpers/index.ts similarity index 100% rename from jazz-ui/src/app/core/helpers/index.ts rename to core/jazz-ui/src/app/core/helpers/index.ts diff --git a/core/jazz-ui/src/app/core/helpers/relaxed-json.service.ts b/core/jazz-ui/src/app/core/helpers/relaxed-json.service.ts new file mode 100644 index 0000000000..1c9957cb57 --- /dev/null +++ b/core/jazz-ui/src/app/core/helpers/relaxed-json.service.ts @@ -0,0 +1,14 @@ +import { Injectable } from '@angular/core'; + +declare let output; + +export class RelaxedJsonService { + + public getParser() { + return output.tv.twelvetone.rjson.RJsonParserFactory.Companion.getDefault().createParser(); + } + + public getPrinter() { + return output.tv.twelvetone.rjson.PrettyPrinter; + } +} \ No newline at end of file diff --git a/core/jazz-ui/src/app/core/helpers/session-storage.service.ts b/core/jazz-ui/src/app/core/helpers/session-storage.service.ts new file mode 100644 index 0000000000..f32eec718c --- /dev/null +++ b/core/jazz-ui/src/app/core/helpers/session-storage.service.ts @@ -0,0 +1,22 @@ +import { Injectable } from '@angular/core'; + +declare let window; + +export class SessionStorageService { + + public setItem(key, value) { + return window.sessionStorage.setItem(key, value); + } + + public removeItem(key) { + return window.sessionStorage.removeItem(key); + } + + public clear() { + return window.sessionStorage.clear(); + } + + public getItem(key) { + return window.sessionStorage.getItem(key) + } +} \ No newline at end of file diff --git a/jazz-ui/src/app/core/pipes/safe-html.pipe.ts b/core/jazz-ui/src/app/core/pipes/safe-html.pipe.ts similarity index 100% rename from jazz-ui/src/app/core/pipes/safe-html.pipe.ts rename to core/jazz-ui/src/app/core/pipes/safe-html.pipe.ts diff --git a/jazz-ui/src/app/core/pipes/safe-url.pipe.ts b/core/jazz-ui/src/app/core/pipes/safe-url.pipe.ts similarity index 100% rename from jazz-ui/src/app/core/pipes/safe-url.pipe.ts rename to core/jazz-ui/src/app/core/pipes/safe-url.pipe.ts diff --git a/jazz-ui/src/app/core/services/authentication.service.spec.ts b/core/jazz-ui/src/app/core/services/authentication.service.spec.ts similarity index 100% rename from jazz-ui/src/app/core/services/authentication.service.spec.ts rename to core/jazz-ui/src/app/core/services/authentication.service.spec.ts diff --git a/jazz-ui/src/app/core/services/authentication.service.ts b/core/jazz-ui/src/app/core/services/authentication.service.ts similarity index 100% rename from jazz-ui/src/app/core/services/authentication.service.ts rename to core/jazz-ui/src/app/core/services/authentication.service.ts diff --git a/jazz-ui/src/app/core/services/datacache.service.ts b/core/jazz-ui/src/app/core/services/datacache.service.ts similarity index 100% rename from jazz-ui/src/app/core/services/datacache.service.ts rename to core/jazz-ui/src/app/core/services/datacache.service.ts diff --git a/jazz-ui/src/app/core/services/index.ts b/core/jazz-ui/src/app/core/services/index.ts similarity index 100% rename from jazz-ui/src/app/core/services/index.ts rename to core/jazz-ui/src/app/core/services/index.ts diff --git a/jazz-ui/src/app/core/services/message.service.ts b/core/jazz-ui/src/app/core/services/message.service.ts similarity index 100% rename from jazz-ui/src/app/core/services/message.service.ts rename to core/jazz-ui/src/app/core/services/message.service.ts diff --git a/jazz-ui/src/app/core/services/request.service.ts b/core/jazz-ui/src/app/core/services/request.service.ts similarity index 100% rename from jazz-ui/src/app/core/services/request.service.ts rename to core/jazz-ui/src/app/core/services/request.service.ts diff --git a/jazz-ui/src/app/core/services/route-guard.service.ts b/core/jazz-ui/src/app/core/services/route-guard.service.ts similarity index 100% rename from jazz-ui/src/app/core/services/route-guard.service.ts rename to core/jazz-ui/src/app/core/services/route-guard.service.ts diff --git a/jazz-ui/src/app/core/services/utils.service.ts b/core/jazz-ui/src/app/core/services/utils.service.ts similarity index 60% rename from jazz-ui/src/app/core/services/utils.service.ts rename to core/jazz-ui/src/app/core/services/utils.service.ts index 4ef65a1945..3668adcbc4 100644 --- a/jazz-ui/src/app/core/services/utils.service.ts +++ b/core/jazz-ui/src/app/core/services/utils.service.ts @@ -1,5 +1,6 @@ import {Injectable} from '@angular/core'; - +declare let Promise; +declare let Object; @Injectable() export class UtilsService { @@ -27,10 +28,29 @@ export class UtilsService { }; hyphenToSpace(input) { - return input.replace(/-/g, ' '); + return input ? input.replace(/-/g, ' ') : ''; } queryString(params) { return '?' + Object.keys(params).map(key => key + '=' + params[key]).join('&'); } + + setTimeoutPromise(timeout) { + return new Promise(resolve => setTimeout(resolve, timeout)); + } + + clone(object) { + return JSON.parse(JSON.stringify(object)); + } + + unique(array, callback) { + let object = {}; + array.forEach((element, index, array) => { + object[callback(element, index, array)] = element; + }); + return Object.values(object) + } + + + } diff --git a/jazz-ui/src/app/environment-module/environment.module.ts b/core/jazz-ui/src/app/environment-module/environment.module.ts similarity index 79% rename from jazz-ui/src/app/environment-module/environment.module.ts rename to core/jazz-ui/src/app/environment-module/environment.module.ts index 752a8b6242..5df6f8030c 100644 --- a/jazz-ui/src/app/environment-module/environment.module.ts +++ b/core/jazz-ui/src/app/environment-module/environment.module.ts @@ -6,9 +6,7 @@ import { EnvAssetsSectionComponent } from '../pages/environment-assets/env-asset import { EnvDeploymentsSectionComponent } from '../pages/environment-deployment/env-deployments-section.component'; import { EnvCodequalitySectionComponent } from '../pages/environment-codequality/env-codequality-section.component'; import { EnvOverviewSectionComponent } from '../pages/environment-overview/env-overview-section.component'; -import { BrowserModule } from '@angular/platform-browser'; import { PopoverModule } from 'ng2-popover'; -import { ChartsModule } from 'ng2-charts'; import { FormsModule } from '@angular/forms'; import { DropdownModule } from 'ng2-dropdown'; import { DatePickerModule } from '../primary-components/daterange-picker/ng2-datepicker'; @@ -18,6 +16,11 @@ import { SharedModule } from '../shared-module/shared.module'; import { RouterModule } from '@angular/router'; import { routes } from './environment.route'; import { AdvancedFilterService } from '../advanced-filter.service'; +import {ChartsModule} from "ng2-charts"; +import {EnvTryServiceSidebarComponent} from '../secondary-components/env-try-service-sidebar/env-try-service-sidebar.component'; +import {SessionStorageService} from "../core/helpers/session-storage.service"; +import {RelaxedJsonService} from "../core/helpers/relaxed-json.service"; + @NgModule({ imports: [ CommonModule, @@ -38,8 +41,13 @@ import { AdvancedFilterService } from '../advanced-filter.service'; EnvCodequalitySectionComponent, EnvLogsSectionComponent, EnvOverviewSectionComponent, + EnvTryServiceSidebarComponent ], - providers: [AdvancedFilterService], + providers: [ + AdvancedFilterService, + SessionStorageService, + RelaxedJsonService, + ] }) export class EnvironmentModule { diff --git a/jazz-ui/src/app/environment-module/environment.route.ts b/core/jazz-ui/src/app/environment-module/environment.route.ts similarity index 100% rename from jazz-ui/src/app/environment-module/environment.route.ts rename to core/jazz-ui/src/app/environment-module/environment.route.ts diff --git a/jazz-ui/src/app/oss/oss.module.ts b/core/jazz-ui/src/app/oss/oss.module.ts similarity index 100% rename from jazz-ui/src/app/oss/oss.module.ts rename to core/jazz-ui/src/app/oss/oss.module.ts diff --git a/jazz-ui/src/app/pages/data-service/data.service.ts b/core/jazz-ui/src/app/pages/data-service/data.service.ts similarity index 100% rename from jazz-ui/src/app/pages/data-service/data.service.ts rename to core/jazz-ui/src/app/pages/data-service/data.service.ts diff --git a/jazz-ui/src/app/pages/environment-assets/env-assets-section.component.html b/core/jazz-ui/src/app/pages/environment-assets/env-assets-section.component.html similarity index 96% rename from jazz-ui/src/app/pages/environment-assets/env-assets-section.component.html rename to core/jazz-ui/src/app/pages/environment-assets/env-assets-section.component.html index 06837145ca..ba5acf5c25 100644 --- a/jazz-ui/src/app/pages/environment-assets/env-assets-section.component.html +++ b/core/jazz-ui/src/app/pages/environment-assets/env-assets-section.component.html @@ -68,19 +68,22 @@
-
- +
+ - + - + - + + + + Asset {{slNumber[i]}}{{type[i]}}
diff --git a/jazz-ui/src/app/pages/environment-assets/env-assets-section.component.scss b/core/jazz-ui/src/app/pages/environment-assets/env-assets-section.component.scss similarity index 98% rename from jazz-ui/src/app/pages/environment-assets/env-assets-section.component.scss rename to core/jazz-ui/src/app/pages/environment-assets/env-assets-section.component.scss index 2039eee9f7..fe4a9b16fc 100644 --- a/jazz-ui/src/app/pages/environment-assets/env-assets-section.component.scss +++ b/core/jazz-ui/src/app/pages/environment-assets/env-assets-section.component.scss @@ -297,3 +297,8 @@ a.page-link.icon.right { .filtr-wrap { min-height: 32px; } +.server-icon{ + width: 14px!important; + margin: 4px 0!important; +} + diff --git a/jazz-ui/src/app/pages/environment-assets/env-assets-section.component.ts b/core/jazz-ui/src/app/pages/environment-assets/env-assets-section.component.ts similarity index 97% rename from jazz-ui/src/app/pages/environment-assets/env-assets-section.component.ts rename to core/jazz-ui/src/app/pages/environment-assets/env-assets-section.component.ts index 834c55dbcc..fea64fedbf 100644 --- a/jazz-ui/src/app/pages/environment-assets/env-assets-section.component.ts +++ b/core/jazz-ui/src/app/pages/environment-assets/env-assets-section.component.ts @@ -22,7 +22,7 @@ import { environment as env_internal } from './../../../environments/environment export class EnvAssetsSectionComponent implements OnInit { state: string = 'default'; - showPaginationtable: boolean = true; + showPaginationtable: boolean = false; currentlyActive: number = 1; totalPageNum: number = 12; offset:number = 0; @@ -70,13 +70,13 @@ export class EnvAssetsSectionComponent implements OnInit { } assetsList: any = []; - + accList=env_internal.urls.accounts; regList=env_internal.urls.regions; accSelected:string = this.accList[0]; regSelected:string=this.regList[0]; type: any = []; - + length: any; // image: any = []; slNumber: any = []; @@ -122,7 +122,7 @@ export class EnvAssetsSectionComponent implements OnInit { private cache: DataCacheService, private authenticationservice: AuthenticationService , @Inject(ComponentFactoryResolver) componentFactoryResolver,private advancedFilters: AdvancedFilterService , - + ) { this.http = request; this.componentFactoryResolver = componentFactoryResolver; @@ -141,9 +141,9 @@ export class EnvAssetsSectionComponent implements OnInit { getFilter(filterServ){ - + } - + onaccSelected(event){ this.FilterTags.notify('filter-Account',event); this.accSelected=event; @@ -156,27 +156,27 @@ export class EnvAssetsSectionComponent implements OnInit { onFilterSelect(event){ switch(event.key){ - - + + case 'account':{ this.FilterTags.notify('filter-Account',event.value); this.accSelected=event.value; break; } - case 'region':{ + case 'region':{ this.FilterTags.notify('filter-Region',event.value); this.regSelected=event.value; break; - + } - + } - + } cancelFilter(event){ - + } callServiceEnvAssets() { this.isLoading = true; @@ -186,16 +186,14 @@ export class EnvAssetsSectionComponent implements OnInit { var payload = { service: this.service.name, domain: this.service.domain, - environment: this.env, - limit:10, - + environment: this.env }; if(this.offsetval > 0){ payload["offset"] = this.offsetval; } this.subscription = this.http.post(this.relativeUrl, payload).subscribe( (response) => { - + if((response.data == undefined) || (response.data.length == 0)){ this.envResponseEmpty = true; this.isLoading = false; @@ -204,7 +202,7 @@ export class EnvAssetsSectionComponent implements OnInit { { var pageCount = response.data.length; - + if(pageCount){ this.totalPageNum = Math.ceil(pageCount/this.limitValue); } @@ -213,15 +211,14 @@ export class EnvAssetsSectionComponent implements OnInit { } this.envResponseEmpty = false; this.isLoading = false; - + this.envResponseTrue = true; this.length = response.data.length; this.assetsList = response.data; - + for(var i=0; i < this.length ; i++){ - this.type[i] = response.data[i].type; - + this.type[i] = response.data[i].asset_type; this.slNumber[i] = (i+1); if( response.data[i].provider == undefined ){ this.Provider[i] = "-" @@ -251,7 +248,7 @@ export class EnvAssetsSectionComponent implements OnInit { this.lastCommitted = response.data[i].timestamp; var commit = this.lastCommitted.substring(0,19); - var lastCommit = new Date(commit); + var lastCommit = new Date(commit); var now = new Date(); var todays = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds()); @@ -273,9 +270,9 @@ export class EnvAssetsSectionComponent implements OnInit { } } } - + } - + } }, @@ -290,16 +287,16 @@ export class EnvAssetsSectionComponent implements OnInit { this.errorRequest = payload; this.errorUser = this.authenticationservice.getUserId(); this.errorResponse = JSON.parse(error._body); - - + + }) - }; + }; getTime() { var now = new Date(); this.errorTime = ((now.getMonth() + 1) + '/' + (now.getDate()) + '/' + now.getFullYear() + " " + now.getHours() + ':' + ((now.getMinutes() < 10) ? ("0" + now.getMinutes()) : (now.getMinutes())) + ':' + ((now.getSeconds() < 10) ? ("0" + now.getSeconds()) : (now.getSeconds()))); } - + feedbackRes:boolean=false; openModal:boolean=false; feedbackMsg:string=''; @@ -325,14 +322,14 @@ export class EnvAssetsSectionComponent implements OnInit { "TIME OF ERROR":this.errorTime, "LOGGED IN USER":this.errorUser } - + this.openModal=true; this.errorChecked=true; this.isLoading=false; this.errorInclude = JSON.stringify(this.djson); this.sjson = JSON.stringify(this.json); }} - + openFeedbackForm(){ this.isFeedback=true; this.model.userFeedback=''; @@ -348,9 +345,9 @@ export class EnvAssetsSectionComponent implements OnInit { } errorIncluded(){ } - + submitFeedback(action){ - + this.errorChecked = (document.getElementById("checkbox-slack")).checked; if( this.errorChecked == true ){ this.json = { @@ -366,14 +363,14 @@ export class EnvAssetsSectionComponent implements OnInit { this.json = this.model.userFeedback ; } this.sjson = JSON.stringify(this.json); - + this.isLoading = true; - + if(action == 'DONE'){ this.openModal=false; return; } - + var payload={ "title" : "Jazz: Issue reported by "+ this.authenticationservice.getUserId(), "project_id": env_internal.urls.internal_acronym, @@ -392,7 +389,7 @@ export class EnvAssetsSectionComponent implements OnInit { this.feedbackResSuccess= true; if(respData != undefined && respData != null && respData != ""){ this.feedbackMsg = "Thanks for reporting the issue. We’ll use your input to improve Jazz experience for everyone!"; - } + } }, error => { this.buttonText='DONE'; @@ -407,9 +404,9 @@ export class EnvAssetsSectionComponent implements OnInit { redirect(url){ window.open(url , '_blank'); } - + ngOnInit() { - + } limitValue : number = 10; prevActivePage: number = 0; @@ -418,10 +415,10 @@ export class EnvAssetsSectionComponent implements OnInit { if(this.prevActivePage != currentlyActivePage){ this.prevActivePage = currentlyActivePage; this.assetsList = []; - + this.offsetval = (this.limitValue * (currentlyActivePage-1)); - + this.callServiceEnvAssets(); } @@ -463,7 +460,7 @@ export class EnvAssetsSectionComponent implements OnInit { this.callServiceEnvAssets(); } -refreshCostData(event){ +refreshCostData(event){ this.callServiceEnvAssets(); } public goToAbout(hash){ diff --git a/core/jazz-ui/src/app/pages/environment-codequality/env-codequality-section.component.html b/core/jazz-ui/src/app/pages/environment-codequality/env-codequality-section.component.html new file mode 100644 index 0000000000..a173ba05cb --- /dev/null +++ b/core/jazz-ui/src/app/pages/environment-codequality/env-codequality-section.component.html @@ -0,0 +1,46 @@ +
+
+
+
+
+ +
+
+
+ +
+
Oops, No Data Found
Doesn't look like there is any data available here.
+
+
+
+
+
+
+

{{utils.hyphenToSpace(selectedMetric?.name)}}

+

{{selectedMetricGraphData?.options.headerMessage}}

+
+
+ +
+
+
+ +
+ + +
+ + +
+
diff --git a/core/jazz-ui/src/app/pages/environment-codequality/env-codequality-section.component.scss b/core/jazz-ui/src/app/pages/environment-codequality/env-codequality-section.component.scss new file mode 100644 index 0000000000..d6ec84af7c --- /dev/null +++ b/core/jazz-ui/src/app/pages/environment-codequality/env-codequality-section.component.scss @@ -0,0 +1,24 @@ + +.graphtitle { + font-size: 16px; + font-weight: bold; + text-align: center; + text-transform: uppercase; + color: #ed008c; + margin: 0; +} + +.graphtitlefilter { + font-size: 12px; + font-weight: bold; + text-align: center; + color: #ed008c; +} + +.sonar-link { + font-weight: 800; + color: #ed008c; + cursor: pointer; +} + + diff --git a/jazz-ui/src/app/pages/environment-codequality/env-codequality-section.component.ts b/core/jazz-ui/src/app/pages/environment-codequality/env-codequality-section.component.ts similarity index 64% rename from jazz-ui/src/app/pages/environment-codequality/env-codequality-section.component.ts rename to core/jazz-ui/src/app/pages/environment-codequality/env-codequality-section.component.ts index ae8f911680..fe1c21001a 100644 --- a/jazz-ui/src/app/pages/environment-codequality/env-codequality-section.component.ts +++ b/core/jazz-ui/src/app/pages/environment-codequality/env-codequality-section.component.ts @@ -6,6 +6,10 @@ import {ActivatedRoute} from '@angular/router'; import {DataService} from '../data-service/data.service'; import * as moment from 'moment'; import {UtilsService} from '../../core/services/utils.service'; +import {Observable} from "rxjs/Observable"; +import 'rxjs/add/operator/toPromise'; + +declare let Object; @Component({ @@ -15,26 +19,7 @@ import {UtilsService} from '../../core/services/utils.service'; providers: [RequestService, MessageService, DataService], }) export class EnvCodequalitySectionComponent implements OnInit { - public metricCards; - - @ViewChild('metricCards') set _metricCards(input) { - this.metricCards = input; - } - - public metricCardsScroller; - - @ViewChild('metricCardsScroller') set _metricCardsScoller(input) { - this.metricCardsScroller = input; - if (this.metricCards && this.metricCardsScroller) { - setTimeout(() => { - this.metricCardsOversized = this.metricCardsScroller.nativeElement.scrollWidth > - this.metricCards.nativeElement.getBoundingClientRect().width; - }); - } - }; - @Input() service: any = {}; - public renderGraph = true; public filters: any = ['DAILY', 'WEEKLY', 'MONTHLY']; public filterSelected = [this.filters[0]]; public env; @@ -44,41 +29,38 @@ export class EnvCodequalitySectionComponent implements OnInit { public selectedMetric; public filterData; public metricsIndex = 0; - public resizeDebounced; public errorData; public dayValue = 86400000; public weekValue = 604800000; public monthValue = 2592000000; - public metricCardSize = 135 + 12; - public metricCardsOversized; - public metricCardOffset = 0; + public selectedMetricGraphData; + public graphDataRaw; constructor( private toasterService: ToasterService, private messageservice: MessageService, private route: ActivatedRoute, private http: RequestService, - private cache: DataCacheService, public utils: UtilsService) { - this.resizeDebounced = this.utils.debounce(this.resize, 200, false); } ngOnInit() { this.env = this.route.snapshot.params['env']; - this.filterData = this.selectFilter(this.filterSelected[0]); - this.queryGraphData(this.filterData, this.metricsIndex); + this.filterData = this.getFilterData(this.filters[0]); + return this.queryGraphData(this.filterData); } refresh() { - this.queryGraphData(this.filterData, this.metricsIndex); + this.queryGraphData(this.filterData); } - onFilterSelected(event) { - this.filterData = this.selectFilter(event[0]); - this.queryGraphData(this.filterData, this.metricsIndex); + onFilterSelect(event) { + this.filterData = this.getFilterData(event[0]); + return this.queryGraphData(this.filterData); + } - selectFilter(filterInput) { + getFilterData(filterInput) { let filterData; this.filterSelected = [filterInput]; switch (filterInput) { @@ -115,12 +97,11 @@ export class EnvCodequalitySectionComponent implements OnInit { selectMetric(index) { this.metricsIndex = index; - this.selectedMetric = this.metrics[index]; - this.graph = this.formatGraphData(this.selectedMetric, this.filterData); - this.resize(); + this.selectedMetric = this.graphDataRaw.metrics[index]; + this.selectedMetricGraphData = this.formatGraphData(this.selectedMetric, this.filterData); } - queryGraphData(filterData, metricIndex) { + queryGraphData(filterData) { this.sectionStatus = 'loading'; const request = { url: '/jazz/codeq', @@ -133,16 +114,17 @@ export class EnvCodequalitySectionComponent implements OnInit { } }; this.http.get(request.url, request.params) - .subscribe((response) => { + .toPromise() + .then((response) => { if (response && response.data && response.data.metrics && response.data.metrics.length) { - this.metrics = response.data.metrics; - this.selectedMetric = this.metrics[metricIndex]; this.sectionStatus = 'resolved'; - this.graph = this.formatGraphData(this.selectedMetric, filterData); + this.graphDataRaw = response.data; + this.selectMetric(this.metricsIndex); } else { this.sectionStatus = 'empty'; } - }, (error) => { + }) + .catch((error) => { this.sectionStatus = 'error'; this.errorData = { request: request, @@ -172,15 +154,23 @@ export class EnvCodequalitySectionComponent implements OnInit { }); filterData.yMax = values.length ? 1.1 * (values - .map((point) => {return point.y;}) - .reduce((a, b) => {return Math.max(a, b);})) : 100; + .map((point) => { + return point.y; + }) + .reduce((a, b) => { + return Math.max(a, b); + })) : 100; filterData.yMin = values.length ? (.9 * (values - .map((point) => {return point.y;}) - .reduce((a, b) => {return Math.min(a, b);}, 100))) : 0; + .map((point) => { + return point.y; + }) + .reduce((a, b) => { + return Math.min(a, b); + }, 100))) : 0; return { datasets: [values], - options: filterData, + options: Object.assign({}, filterData) }; } @@ -188,26 +178,5 @@ export class EnvCodequalitySectionComponent implements OnInit { window.open(this.selectedMetric.link, '_blank'); } - resize() { - this.renderGraph = false; - this.sectionStatus = 'loading'; - setTimeout(() => { - this.renderGraph = true; - this.sectionStatus = 'resolved'; - }, 200); - } - - offsetLeft() { - if (this.metricCardsScroller.nativeElement.getBoundingClientRect().right > this.metricCards.nativeElement.getBoundingClientRect().right) { - this.metricCardOffset -= 1; - } - } - - offsetRight() { - if (this.metricCardOffset < 0) { - this.metricCardOffset += 1; - } - } - } diff --git a/jazz-ui/src/app/pages/environment-deployment/env-deployments-section.component.html b/core/jazz-ui/src/app/pages/environment-deployment/env-deployments-section.component.html similarity index 100% rename from jazz-ui/src/app/pages/environment-deployment/env-deployments-section.component.html rename to core/jazz-ui/src/app/pages/environment-deployment/env-deployments-section.component.html diff --git a/jazz-ui/src/app/pages/environment-deployment/env-deployments-section.component.scss b/core/jazz-ui/src/app/pages/environment-deployment/env-deployments-section.component.scss similarity index 100% rename from jazz-ui/src/app/pages/environment-deployment/env-deployments-section.component.scss rename to core/jazz-ui/src/app/pages/environment-deployment/env-deployments-section.component.scss diff --git a/jazz-ui/src/app/pages/environment-deployment/env-deployments-section.component.ts b/core/jazz-ui/src/app/pages/environment-deployment/env-deployments-section.component.ts similarity index 99% rename from jazz-ui/src/app/pages/environment-deployment/env-deployments-section.component.ts rename to core/jazz-ui/src/app/pages/environment-deployment/env-deployments-section.component.ts index 63091014c1..6bb4c8b4ec 100644 --- a/jazz-ui/src/app/pages/environment-deployment/env-deployments-section.component.ts +++ b/core/jazz-ui/src/app/pages/environment-deployment/env-deployments-section.component.ts @@ -630,7 +630,7 @@ rebuild(){ this.toast_pop('success',"",successMessage+this.service.name); }, (error) => { - let errorMessage = this.toastmessage.errorMessage(error, "updateObj"); + let errorMessage = this.toastmessage.errorMessage(error, "retryDeploy"); this.toast_pop('error', 'Oops!', errorMessage) }) this.isLoading = true; diff --git a/jazz-ui/src/app/pages/environment-detail/environment-detail.component.html b/core/jazz-ui/src/app/pages/environment-detail/environment-detail.component.html similarity index 79% rename from jazz-ui/src/app/pages/environment-detail/environment-detail.component.html rename to core/jazz-ui/src/app/pages/environment-detail/environment-detail.component.html index c7f878cd52..635a4056d9 100644 --- a/jazz-ui/src/app/pages/environment-detail/environment-detail.component.html +++ b/core/jazz-ui/src/app/pages/environment-detail/environment-detail.component.html @@ -2,12 +2,9 @@
- +
- -
@@ -25,9 +22,10 @@

{{friendly_name}} {{service.name}}

- - - + + + +
Swagger file not found
Status @@ -35,56 +33,63 @@

{{friendly_name}}

- + - + -
+
Refresh
- - + +
- +
- -
+ +
- +
+ +
+ +
- - + + + + +
- +
diff --git a/jazz-ui/src/app/pages/environment-detail/environment-detail.component.scss b/core/jazz-ui/src/app/pages/environment-detail/environment-detail.component.scss similarity index 92% rename from jazz-ui/src/app/pages/environment-detail/environment-detail.component.scss rename to core/jazz-ui/src/app/pages/environment-detail/environment-detail.component.scss index 04330c34e2..17fd011a43 100644 --- a/jazz-ui/src/app/pages/environment-detail/environment-detail.component.scss +++ b/core/jazz-ui/src/app/pages/environment-detail/environment-detail.component.scss @@ -37,8 +37,8 @@ /deep/ .tabs-wrap { ul li { &:last-child { - pointer-events: none; - opacity: 0.6; + // pointer-events: none; + // opacity: 0.6; } } } @@ -172,3 +172,16 @@ margin-left: 5px; } } + +.swagger-err{ + margin:0.5rem 1rem; + color:red; + font-style: italic; +} + +.overview-sidebar{ + /deep/.sidebar-wrp .sidebar-inr{ + overflow-y:auto !important; + } + +} \ No newline at end of file diff --git a/jazz-ui/src/app/pages/environment-detail/environment-detail.component.spec.ts b/core/jazz-ui/src/app/pages/environment-detail/environment-detail.component.spec.ts similarity index 100% rename from jazz-ui/src/app/pages/environment-detail/environment-detail.component.spec.ts rename to core/jazz-ui/src/app/pages/environment-detail/environment-detail.component.spec.ts diff --git a/core/jazz-ui/src/app/pages/environment-detail/environment-detail.component.ts b/core/jazz-ui/src/app/pages/environment-detail/environment-detail.component.ts new file mode 100644 index 0000000000..5e3c231f9c --- /dev/null +++ b/core/jazz-ui/src/app/pages/environment-detail/environment-detail.component.ts @@ -0,0 +1,277 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {RequestService, DataCacheService, MessageService, AuthenticationService} from '../../core/services/index'; +import {ToasterService} from 'angular2-toaster'; +import {Router, ActivatedRoute} from '@angular/router'; +import {EnvOverviewSectionComponent} from './../environment-overview/env-overview-section.component'; +import {DataService} from "../data-service/data.service"; +import {environment} from './../../../environments/environment'; +import {environment as env_internal} from './../../../environments/environment.internal'; +import {environment as env_oss} from './../../../environments/environment.oss'; + + +import {EnvDeploymentsSectionComponent} from './../environment-deployment/env-deployments-section.component'; + + +@Component({ + selector: 'environment-detail', + templateUrl: './environment-detail.component.html', + providers: [RequestService, MessageService, DataService], + styleUrls: ['./environment-detail.component.scss'] +}) +export class EnvironmentDetailComponent implements OnInit { + @ViewChild('envoverview') envoverview: EnvOverviewSectionComponent; + @ViewChild('envdeployments') envdeployments: EnvDeploymentsSectionComponent; + @ViewChild('selectedTabComponent') selectedTabComponent; + + isFunction: boolean = false; + breadcrumbs = []; + api_doc_name: string = ''; + selectedTab = 0; + service: any = {}; + friendly_name: any; + status_val: number; + serviceId: any; + envStatus: string; + environment_obj: any; + isLoadingService: boolean = true; + status_inactive: boolean = false; + swagger_error: boolean = false; + + tabData = ['overview', 'deployments', 'code quality', 'assets', 'logs']; + envSelected: string = ''; + endpoint_env: string = ''; + environment = { + name: 'Dev' + } + baseUrl: string = ''; + swaggerUrl: string = ''; + disablingWebsiteButton: boolean = true; + disablingFunctionButton: boolean = false; + disablingApiButton: boolean = true; + nonClickable: boolean = false; + message: string; + public sidebar: string = ''; + private sub: any; + private subscription: any; + public assets; + + constructor( + private toasterService: ToasterService, + private messageservice: MessageService, + private route: ActivatedRoute, + private http: RequestService, + private cache: DataCacheService, + private router: Router, + private data: DataService + ) { + } + + refreshTab() { + this.selectedTabComponent.refresh(); + } + + onSelectedDr(selected) { + this.selectedTab = selected; + } + + onTabSelected(i) { + + this.selectedTab = i; + }; + + EnvLoad(event) { + this.environment_obj = event.environment[0]; + this.status_val = parseInt(status[this.environment_obj.status]); + if ((this.status_val < 2) || (this.status_val == 4)) { + this.disablingApiButton = false; + } + + this.status_inactive = true; + } + + env(event) { + this.endpoint_env = event; + if (this.endpoint_env != undefined) { + } + } + + frndload(event) { + if (event != undefined) { + this.friendly_name = event; + } + this.breadcrumbs = [{ + 'name': this.service['name'], + 'link': 'services/' + this.service['id'] + }, + { + 'name': this.friendly_name, + 'link': '' + }]; + } + + processService(service) { + if (service === undefined) { + return {}; + } else { + return { + id: service.id, + name: service.service, + serviceType: service.type, + runtime: service.runtime, + status: service.status, + domain: service.domain, + repository: service.repository + } + } + }; + + onDataFetched(service) { + + if (service !== undefined && service !== "") { + this.service = this.processService(service); + if (this.service.serviceType == "function") this.isFunction = true; + if (this.friendly_name != undefined) { + } + this.breadcrumbs = [{ + 'name': this.service['name'], + 'link': 'services/' + this.service['id'] + }, + { + 'name': this.friendly_name, + 'link': '' + }] + this.isLoadingService = false; + } else { + this.isLoadingService = false; + let errorMessage = this.messageservice.successMessage(service, "serviceDetail"); + this.toast_pop('error', 'Error', errorMessage) + } + } + + tabChanged(i) { + this.selectedTab = i; + }; + + + fetchService(id: string) { + this.isLoadingService = true; + this.subscription = this.http.get('/jazz/services/' + id).subscribe( + response => { + this.service.accounts = env_internal.urls.accounts; + this.service.regions = env_internal.urls.regions; + this.service = response.data.data; + if (environment.envName == 'oss') this.service = response.data; + this.isFunction = this.service.type === "function"; + this.getAssets(); + this.setTabs(); + this.cache.set(id, this.service); + this.onDataFetched(this.service); + this.envoverview.notify(this.service); + }, + err => { + this.isLoadingService = false; + let errorMessage = this.messageservice.errorMessage(err, "serviceDetail"); + this.toast_pop('error', 'Oops!', errorMessage) + + } + ) + }; + + setTabs() { + if (this.service.serviceType === 'api' || this.service.type === 'api') { + this.tabData = ['overview', 'deployments', 'assets', 'metrics', 'code quality', 'logs']; + } else if (this.service.serviceType === 'function' || this.service.type === 'function') { + this.tabData = ['overview', 'deployments', 'assets', 'metrics', 'code quality', 'logs']; + } else if (this.service.serviceType === 'website' || this.service.type === 'website') { + this.tabData = ['overview', 'deployments', 'assets', 'metrics']; + } + } + + getAssets() { + this.http.post('/jazz/assets/search', { + service: this.service.service || this.service.name, + domain: this.service.domain, + environment: this.envSelected, + limit: undefined + }).subscribe((assetsResponse) => { + this.assets = assetsResponse.data; + this.service.assets = this.assets; + }, (err) => { + this.toast_pop('error', 'Oops!', 'Failed to load swagger file.'); + }); + } + + testService(type){ + switch(type){ + case 'api': + let foundAsset = this.assets.find((asset) => { + return asset.asset_type === 'swagger_url'; + }); + if (foundAsset) { + return window.open(environment.urls['swagger_editor'] + foundAsset.provider_id); + } else { + return window.open('/404'); + } + case 'website' : + if(this.endpoint_env){ + window.open(this.endpoint_env); + } + break; + case 'function' : + case 'lambda' : + this.setSidebar('try-service'); + break; + } + } + + setSidebar(sidebar) { + this.sidebar = sidebar; + } + + toast_pop(error, oops, errorMessage) { + var tst = document.getElementById('toast-container'); + tst.classList.add('toaster-anim'); + this.toasterService.pop(error, oops, errorMessage); + setTimeout(() => { + tst.classList.remove('toaster-anim'); + }, 3000); + } + + ngOnInit() { + this.api_doc_name = env_oss.api_doc_name; + this.sub = this.route.params.subscribe(params => { + let id = params['id']; + this.serviceId = id; + this.envSelected = params['env']; + this.fetchService(id); + this.friendly_name = this.envSelected; + + }); + this.breadcrumbs = [ + { + 'name': this.service['name'], + 'link': 'services/' + this.service['id'] + }, + { + 'name': this.friendly_name, + 'link': '' + } + ]; + } + + ngOnChanges(x: any) { + this.fetchService(this.serviceId); + } +} + +export enum status { + "deployment_completed" = 0, + "active", + "deployment_started", + "pending_approval", + "deployment_failed", + "inactive", + "deletion_started", + "deletion_failed", + "archived" +} diff --git a/jazz-ui/src/app/pages/environment-logs/env-logs-section.component.html b/core/jazz-ui/src/app/pages/environment-logs/env-logs-section.component.html similarity index 100% rename from jazz-ui/src/app/pages/environment-logs/env-logs-section.component.html rename to core/jazz-ui/src/app/pages/environment-logs/env-logs-section.component.html diff --git a/jazz-ui/src/app/pages/environment-logs/env-logs-section.component.scss b/core/jazz-ui/src/app/pages/environment-logs/env-logs-section.component.scss similarity index 100% rename from jazz-ui/src/app/pages/environment-logs/env-logs-section.component.scss rename to core/jazz-ui/src/app/pages/environment-logs/env-logs-section.component.scss diff --git a/jazz-ui/src/app/pages/environment-logs/env-logs-section.component.ts b/core/jazz-ui/src/app/pages/environment-logs/env-logs-section.component.ts similarity index 99% rename from jazz-ui/src/app/pages/environment-logs/env-logs-section.component.ts rename to core/jazz-ui/src/app/pages/environment-logs/env-logs-section.component.ts index 98d59d37c6..9a5f380ea0 100644 --- a/jazz-ui/src/app/pages/environment-logs/env-logs-section.component.ts +++ b/core/jazz-ui/src/app/pages/environment-logs/env-logs-section.component.ts @@ -424,8 +424,9 @@ export class EnvLogsSectionComponent implements OnInit { } this.subscription = this.http.post('/jazz/logs', this.payload).subscribe( response => { - this.logs = response.data.logs; - if (this.logs.length != 0) { + this.logs = response.data.logs || response.data.data.logs; + if(this.logs != undefined) + if (this.logs && this.logs.length != 0) { var pageCount = response.data.count; if (pageCount) { this.totalPagesTable = Math.ceil(pageCount / this.limitValue); diff --git a/jazz-ui/src/app/pages/environment-overview/env-overview-section.component.html b/core/jazz-ui/src/app/pages/environment-overview/env-overview-section.component.html similarity index 99% rename from jazz-ui/src/app/pages/environment-overview/env-overview-section.component.html rename to core/jazz-ui/src/app/pages/environment-overview/env-overview-section.component.html index 2bd9b87f53..f71a48b889 100644 --- a/jazz-ui/src/app/pages/environment-overview/env-overview-section.component.html +++ b/core/jazz-ui/src/app/pages/environment-overview/env-overview-section.component.html @@ -137,7 +137,7 @@
Deployment status
{{envstatus}}
-
  • +
  • Description
    {{services.description || 'Give me the details for your services'}}
  • @@ -205,7 +205,7 @@
    Friendly Name
    -
  • +
  • Tags
    {{services.tags || 'Services are cooler with tags'}}
  • diff --git a/jazz-ui/src/app/pages/environment-overview/env-overview-section.component.scss b/core/jazz-ui/src/app/pages/environment-overview/env-overview-section.component.scss similarity index 100% rename from jazz-ui/src/app/pages/environment-overview/env-overview-section.component.scss rename to core/jazz-ui/src/app/pages/environment-overview/env-overview-section.component.scss diff --git a/jazz-ui/src/app/pages/environment-overview/env-overview-section.component.ts b/core/jazz-ui/src/app/pages/environment-overview/env-overview-section.component.ts similarity index 100% rename from jazz-ui/src/app/pages/environment-overview/env-overview-section.component.ts rename to core/jazz-ui/src/app/pages/environment-overview/env-overview-section.component.ts diff --git a/jazz-ui/src/app/pages/error404/error404.component.html b/core/jazz-ui/src/app/pages/error404/error404.component.html similarity index 100% rename from jazz-ui/src/app/pages/error404/error404.component.html rename to core/jazz-ui/src/app/pages/error404/error404.component.html diff --git a/jazz-ui/src/app/pages/error404/error404.component.scss b/core/jazz-ui/src/app/pages/error404/error404.component.scss similarity index 100% rename from jazz-ui/src/app/pages/error404/error404.component.scss rename to core/jazz-ui/src/app/pages/error404/error404.component.scss diff --git a/jazz-ui/src/app/pages/error404/error404.component.ts b/core/jazz-ui/src/app/pages/error404/error404.component.ts similarity index 100% rename from jazz-ui/src/app/pages/error404/error404.component.ts rename to core/jazz-ui/src/app/pages/error404/error404.component.ts diff --git a/jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.html b/core/jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.html similarity index 100% rename from jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.html rename to core/jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.html diff --git a/jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.scss b/core/jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.scss similarity index 100% rename from jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.scss rename to core/jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.scss diff --git a/jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.spec.ts b/core/jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.spec.ts similarity index 100% rename from jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.spec.ts rename to core/jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.spec.ts diff --git a/jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.ts b/core/jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.ts similarity index 100% rename from jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.ts rename to core/jazz-ui/src/app/pages/jenkins-status/jenkins-status.component.ts diff --git a/jazz-ui/src/app/pages/landing/landing.component.html b/core/jazz-ui/src/app/pages/landing/landing.component.html similarity index 100% rename from jazz-ui/src/app/pages/landing/landing.component.html rename to core/jazz-ui/src/app/pages/landing/landing.component.html diff --git a/jazz-ui/src/app/pages/landing/landing.component.scss b/core/jazz-ui/src/app/pages/landing/landing.component.scss similarity index 100% rename from jazz-ui/src/app/pages/landing/landing.component.scss rename to core/jazz-ui/src/app/pages/landing/landing.component.scss diff --git a/jazz-ui/src/app/pages/landing/landing.component.ts b/core/jazz-ui/src/app/pages/landing/landing.component.ts similarity index 100% rename from jazz-ui/src/app/pages/landing/landing.component.ts rename to core/jazz-ui/src/app/pages/landing/landing.component.ts diff --git a/jazz-ui/src/app/pages/login/internal/login.component.html b/core/jazz-ui/src/app/pages/login/internal/login.component.html similarity index 100% rename from jazz-ui/src/app/pages/login/internal/login.component.html rename to core/jazz-ui/src/app/pages/login/internal/login.component.html diff --git a/jazz-ui/src/app/pages/login/internal/login.component.scss b/core/jazz-ui/src/app/pages/login/internal/login.component.scss similarity index 100% rename from jazz-ui/src/app/pages/login/internal/login.component.scss rename to core/jazz-ui/src/app/pages/login/internal/login.component.scss diff --git a/jazz-ui/src/app/pages/login/internal/login.component.spec.ts b/core/jazz-ui/src/app/pages/login/internal/login.component.spec.ts similarity index 100% rename from jazz-ui/src/app/pages/login/internal/login.component.spec.ts rename to core/jazz-ui/src/app/pages/login/internal/login.component.spec.ts diff --git a/jazz-ui/src/app/pages/login/internal/login.component.ts b/core/jazz-ui/src/app/pages/login/internal/login.component.ts similarity index 100% rename from jazz-ui/src/app/pages/login/internal/login.component.ts rename to core/jazz-ui/src/app/pages/login/internal/login.component.ts diff --git a/jazz-ui/src/app/pages/login/oss/login.component.html b/core/jazz-ui/src/app/pages/login/oss/login.component.html similarity index 100% rename from jazz-ui/src/app/pages/login/oss/login.component.html rename to core/jazz-ui/src/app/pages/login/oss/login.component.html diff --git a/jazz-ui/src/app/pages/login/oss/login.component.scss b/core/jazz-ui/src/app/pages/login/oss/login.component.scss similarity index 100% rename from jazz-ui/src/app/pages/login/oss/login.component.scss rename to core/jazz-ui/src/app/pages/login/oss/login.component.scss diff --git a/jazz-ui/src/app/pages/login/oss/login.component.spec.ts b/core/jazz-ui/src/app/pages/login/oss/login.component.spec.ts similarity index 100% rename from jazz-ui/src/app/pages/login/oss/login.component.spec.ts rename to core/jazz-ui/src/app/pages/login/oss/login.component.spec.ts diff --git a/jazz-ui/src/app/pages/login/oss/login.component.ts b/core/jazz-ui/src/app/pages/login/oss/login.component.ts similarity index 100% rename from jazz-ui/src/app/pages/login/oss/login.component.ts rename to core/jazz-ui/src/app/pages/login/oss/login.component.ts diff --git a/jazz-ui/src/app/pages/service-access-control/service-access-control.component.html b/core/jazz-ui/src/app/pages/service-access-control/service-access-control.component.html similarity index 100% rename from jazz-ui/src/app/pages/service-access-control/service-access-control.component.html rename to core/jazz-ui/src/app/pages/service-access-control/service-access-control.component.html diff --git a/jazz-ui/src/app/pages/service-access-control/service-access-control.component.scss b/core/jazz-ui/src/app/pages/service-access-control/service-access-control.component.scss similarity index 100% rename from jazz-ui/src/app/pages/service-access-control/service-access-control.component.scss rename to core/jazz-ui/src/app/pages/service-access-control/service-access-control.component.scss diff --git a/jazz-ui/src/app/pages/service-access-control/service-access-control.component.spec.ts b/core/jazz-ui/src/app/pages/service-access-control/service-access-control.component.spec.ts similarity index 100% rename from jazz-ui/src/app/pages/service-access-control/service-access-control.component.spec.ts rename to core/jazz-ui/src/app/pages/service-access-control/service-access-control.component.spec.ts diff --git a/jazz-ui/src/app/pages/service-access-control/service-access-control.component.ts b/core/jazz-ui/src/app/pages/service-access-control/service-access-control.component.ts similarity index 99% rename from jazz-ui/src/app/pages/service-access-control/service-access-control.component.ts rename to core/jazz-ui/src/app/pages/service-access-control/service-access-control.component.ts index b85f573488..06895013af 100644 --- a/jazz-ui/src/app/pages/service-access-control/service-access-control.component.ts +++ b/core/jazz-ui/src/app/pages/service-access-control/service-access-control.component.ts @@ -106,6 +106,9 @@ export class ServiceAccessControlComponent implements OnInit { } } + refresh(){ + + } //function for selecting group from list of groups// selectApprovers(group, index , category){ if(category == 'api'){ diff --git a/jazz-ui/src/app/pages/service-cost/service-cost.component.html b/core/jazz-ui/src/app/pages/service-cost/service-cost.component.html similarity index 100% rename from jazz-ui/src/app/pages/service-cost/service-cost.component.html rename to core/jazz-ui/src/app/pages/service-cost/service-cost.component.html diff --git a/jazz-ui/src/app/pages/service-cost/service-cost.component.scss b/core/jazz-ui/src/app/pages/service-cost/service-cost.component.scss similarity index 100% rename from jazz-ui/src/app/pages/service-cost/service-cost.component.scss rename to core/jazz-ui/src/app/pages/service-cost/service-cost.component.scss diff --git a/jazz-ui/src/app/pages/service-cost/service-cost.component.spec.ts b/core/jazz-ui/src/app/pages/service-cost/service-cost.component.spec.ts similarity index 100% rename from jazz-ui/src/app/pages/service-cost/service-cost.component.spec.ts rename to core/jazz-ui/src/app/pages/service-cost/service-cost.component.spec.ts diff --git a/jazz-ui/src/app/pages/service-cost/service-cost.component.ts b/core/jazz-ui/src/app/pages/service-cost/service-cost.component.ts similarity index 99% rename from jazz-ui/src/app/pages/service-cost/service-cost.component.ts rename to core/jazz-ui/src/app/pages/service-cost/service-cost.component.ts index fd726f26da..f9d3304d10 100644 --- a/jazz-ui/src/app/pages/service-cost/service-cost.component.ts +++ b/core/jazz-ui/src/app/pages/service-cost/service-cost.component.ts @@ -193,6 +193,9 @@ export class ServiceCostComponent implements OnInit { regSelected:string; // = this.regList[0]; + refresh(){ + // this.refreshCostData(); + } instance_yes; getFilter(filterServ){ diff --git a/jazz-ui/src/app/pages/service-detail/service-detail.component.html b/core/jazz-ui/src/app/pages/service-detail/service-detail.component.html similarity index 82% rename from jazz-ui/src/app/pages/service-detail/service-detail.component.html rename to core/jazz-ui/src/app/pages/service-detail/service-detail.component.html index f2bf4828ea..b06d6245af 100644 --- a/jazz-ui/src/app/pages/service-detail/service-detail.component.html +++ b/core/jazz-ui/src/app/pages/service-detail/service-detail.component.html @@ -11,25 +11,32 @@

    {{service.name}}

    {{service.serviceType}} - {{service.runtime}} - - +
    +
    + + Refresh +
    + + +
    - +
    - +
    - +
    - -
    -
    - +
    + +
    + +
    diff --git a/jazz-ui/src/app/pages/service-detail/service-detail.component.scss b/core/jazz-ui/src/app/pages/service-detail/service-detail.component.scss similarity index 97% rename from jazz-ui/src/app/pages/service-detail/service-detail.component.scss rename to core/jazz-ui/src/app/pages/service-detail/service-detail.component.scss index c9f7e17970..f611ee9bde 100644 --- a/jazz-ui/src/app/pages/service-detail/service-detail.component.scss +++ b/core/jazz-ui/src/app/pages/service-detail/service-detail.component.scss @@ -515,3 +515,19 @@ } } } + +.tab-component{ + justify-content: space-between; + display: flex; + flex-direction: row-reverse; +} + +.refresh-button{ + cursor: pointer; + margin: 10px 0 0 0; + span{ + color:#ed008c; + text-transform: uppercase; + font-size: 12px; + } +} \ No newline at end of file diff --git a/jazz-ui/src/app/pages/service-detail/service-detail.component.spec.ts b/core/jazz-ui/src/app/pages/service-detail/service-detail.component.spec.ts similarity index 100% rename from jazz-ui/src/app/pages/service-detail/service-detail.component.spec.ts rename to core/jazz-ui/src/app/pages/service-detail/service-detail.component.spec.ts diff --git a/core/jazz-ui/src/app/pages/service-detail/service-detail.component.ts b/core/jazz-ui/src/app/pages/service-detail/service-detail.component.ts new file mode 100644 index 0000000000..80042a4984 --- /dev/null +++ b/core/jazz-ui/src/app/pages/service-detail/service-detail.component.ts @@ -0,0 +1,383 @@ +/** + * @type Component + * @desc Service detail page + * @author + */ +import {Http, Headers, Response} from '@angular/http'; +import {Component, OnInit, Output, EventEmitter} from '@angular/core'; +import {Router, ActivatedRoute} from '@angular/router'; +import {SharedService} from "../../SharedService.service"; +import {AfterViewInit, ViewChild} from '@angular/core'; + +import {ToasterService} from 'angular2-toaster'; +import {BarGraphComponent} from '../../secondary-components/bar-graph/bar-graph.component'; +import {RequestService, DataCacheService, MessageService, AuthenticationService} from '../../core/services/index'; +import {ServiceMetricsComponent} from '../service-metrics/service-metrics.component'; +import {environment} from './../../../environments/environment'; + +@Component({ + selector: 'service-detail', + templateUrl: './service-detail.component.html', + styleUrls: ['./service-detail.component.scss'], + providers: [RequestService, MessageService] +}) + +export class ServiceDetailComponent implements OnInit { + + + constructor( + private toasterService: ToasterService, + private route: ActivatedRoute, + private router: Router, + private sharedService: SharedService, + private http: RequestService, + private messageservice: MessageService, + private cache: DataCacheService, + private authenticationservice: AuthenticationService + ) { + this.message = this.sharedService.sharedMessage; + this.toastmessage = messageservice; + } + + message; + + @Output() deleteServiceStatus: EventEmitter = new EventEmitter(); + @ViewChild('selectedTabComponent') selectedTabComponent; + + + disblebtn: boolean = true; + ServiceName: string; + deleteServiceVal: boolean; + id: string; + errMessage: string = ''; + isLoadingService: boolean = false; + isLoading: boolean = false; + selectedTab = 0; + selected: string = 'All'; + service: any = {}; + isGraphLoading: boolean = false; + stageOverview: any = {}; + showPopUp: boolean = false; + success: boolean = false; + thisIndex: number = 0; + err_flag: boolean = false; + serviceDeleted: boolean = false; + serviceDeleteFailed: boolean = false; + serviceRequestFailure: boolean = false; + serviceRequestSuccess: boolean = false; + canDelete: boolean = true; + successMessage: string = ""; + errorMessage: string = ""; + test: any = "delete testing"; + disabled_tab: boolean = false; + refreshTabClicked: boolean = false; + + + private sub: any; + private subscription: any; + private toastmessage: any; + + statusData = ['All', 'Active', 'Pending', 'Stopped']; + tabData = ['overview', 'access control', 'metrics', 'logs', 'cost']; + + breadcrumbs = [] + + + opnSidebar(event) { + this.closeSidebar(true); + } + + public closeSidebar(eve) { + this.closed = true; + this.close = eve; + } + + close: boolean = false; + closed: boolean = false; + + processService(service) { + if (service === undefined) { + return {}; + } else { + return { + id: service.id, + name: service.service, + serviceType: service.type, + runtime: service.runtime, + status: service.status.replace('_', ' '), + description: service.description, + approvers: service.approvers, + domain: service.domain, + email: service.email, + slackChannel: service.slack_channel, + repository: service.repository, + tags: service.tags, + endpoints: service.endpoints + }; + } + }; + + onDataFetched(service) { + + if (service !== undefined && service !== "") { + if (!service.id && service.data) { + service = service.data; + } + + this.service = this.processService(service); + + // Update breadcrumbs + this.breadcrumbs = [ + { + 'name': this.service['name'], + 'link': '' + }] + this.isLoadingService = false; + if (service.status == 'deletion_completed' || service.status == 'deletion_started' || service.status == 'creation_started' || service.status == 'creation_failed') + this.canDelete = false; + } else { + this.isLoadingService = false; + let errorMessage = this.toastmessage.successMessage(service, "serviceDetail"); + this.toast_pop('error', 'Oops!', errorMessage) + } + } + + setTabs() { + let serviceType = this.service.type || this.service.serviceType; + switch (serviceType) { + case 'api': + this.tabData = ['overview', 'access control', 'metrics', 'cost', 'logs']; + break; + case 'website': + this.tabData = ['overview', 'access control', 'metrics', 'cost']; + break; + case 'function': + this.tabData = ['overview', 'access control', 'metrics', 'cost', 'logs']; + break; + } + } + + fetchService(id) { + this.isLoadingService = true; + this.http.get('/jazz/services/' + id).subscribe(response => { + let service = response.data; + this.cache.set(id, service); + this.onDataFetched(service); + this.isGraphLoading = false; + this.selectedTabComponent.refresh_env(); + this.setTabs(); + }, (err) => { + if (err.status == "404") { + this.router.navigateByUrl('404'); + } + this.isLoadingService = false; + let errorMessage = 'OOPS! something went wrong while fetching data'; + this.isGraphLoading = false; + errorMessage = this.toastmessage.errorMessage(err, "serviceDetail"); + this.errMessage = errorMessage; + this.err_flag = true; + } + ) + + + }; + + + onSelectedDr(selected) { + this.selectedTab = selected; + } + + tabChanged(i) { + this.selectedTab = i; + if (i == 4) { + this.disabled_tab = true; + } + }; + + statusFilter(item) { + this.selected = item; + // this.filterByStatus(); + }; + + env(event) { + if ((event != 'creation failed') && (event != 'creation started') && (event != 'deletion started') && (event != 'deletion completed')) { + this.canDelete = true; + } else { + this.canDelete = false; + } + } + + public goToAbout(hash) { + this.router.navigateByUrl('landing'); + this.cache.set('scroll_flag', true); + this.cache.set('scroll_id', hash); + } + + deleteService(x) { + if (!this.service.status || this.service.status == 'deletion_completed' || this.service.status == 'deletion_started') { + return; + } + this.showPopUp = true; + this.success = false; + }; + + refreshServ() { + this.isGraphLoading = true; + this.fetchService(this.id); + } + + hideDeletePopup(x) { + if (this.success) { + this.router.navigateByUrl('services'); + } + this.showPopUp = false; + this.success = false; + if (this.subscription) { + this.subscription.unsubscribe(); + + } + }; + + deleteServiceConfirm() { + this.success = true; + }; + + setMessage(body, type) { + this.message.body = body; + this.message.type = type; + this.sharedService.sharedMessage = this.message; + }; + + refreshCostData(event) { + this.isLoading = true; + this.deleteServiceInit() + } + + refreshTab() { + this.refreshTabClicked = true; + if (this.selectedTab == 0) { + this.refreshServ(); + } + else { + this.selectedTabComponent.refresh(); + } + + } + + deleteServiceInit() { + + this.isLoading = true; + this.disblebtn = true; + var payload = { + "service_name": this.service.name, + "domain": this.service.domain, + "id": this.service.id + }; + this.deleteServiceStatus.emit(this.deleteServiceVal); + this.subscription = this.http.post('/jazz/delete-serverless-service', payload) + .subscribe( + (Response) => { + var update = { + "status": "Deleting" + } + var service = payload.service_name; + var domain = payload.domain; + var reqId = Response.data.request_id; + localStorage.setItem('request_id' + "_" + payload.service_name + "_" + payload.domain, JSON.stringify({ + service: service, + domain: domain, + request_id: reqId + })); + this.serviceRequestSuccess = true; + this.serviceRequestFailure = false; + let successMessage = this.toastmessage.successMessage(Response, "serviceDelete") + this.successMessage = successMessage; + this.success = true; + this.serviceDeleted = true; + // this.toast_pop('success',"", "Service: "+this.service.name +" "+successMessage); + this.isLoading = false; + // this.cache.set('request_id',this.test); + this.cache.set('deletedServiceId', this.service.id) + this.cache.set("updateServiceList", true); + this.serviceDeleteFailed = false; + + }, + (error) => { + this.serviceRequestSuccess = false; + this.serviceRequestFailure = true; + let errorMessage = this.toastmessage.errorMessage(error, "serviceDelete"); + this.errorMessage = errorMessage; + this.success = true; + this.serviceDeleteFailed = true; + // this.toast_pop('error','Oops!', errorMessage); + this.isLoading = false; + this.serviceDeleted = false; + } + ); + + + }; + + backtoservice() { + this.router.navigateByUrl('services'); + } + + backtoserviceid() { + this.showPopUp = false; + if (this.serviceDeleted == true) { + this.serviceDeleted = false; + } else if (this.serviceDeleteFailed == true) { + this.serviceDeleteFailed = false; + } + if (this.subscription) { + this.subscription.unsubscribe(); + } + } + + + onServiceNameChange() { + if (this.ServiceName == this.service['name']) { + this.disblebtn = false; + } + else { + this.disblebtn = true; + } + } + + + changeTabIndex(index) { + this.thisIndex = index; + } + + handleTabs(index) { + this.selectedTab = index; + + } + + toast_pop(error, oops, errorMessage) { + var tst = document.getElementById('toast-container'); + tst.classList.add('toaster-anim'); + this.toasterService.pop(error, oops, errorMessage); + setTimeout(() => { + tst.classList.remove('toaster-anim'); + }, 3000); + } + + ngOnInit() { + + this.breadcrumbs = [ + { + 'name': this.service['name'], + 'link': '' + }] + this.sub = this.route.params.subscribe(params => { + this.id = params['id']; + this.fetchService(this.id); + }); + + } + + ngOnChanges(x: any) { + + } +} diff --git a/jazz-ui/src/app/pages/service-logs/service-logs.component.html b/core/jazz-ui/src/app/pages/service-logs/service-logs.component.html similarity index 100% rename from jazz-ui/src/app/pages/service-logs/service-logs.component.html rename to core/jazz-ui/src/app/pages/service-logs/service-logs.component.html diff --git a/jazz-ui/src/app/pages/service-logs/service-logs.component.scss b/core/jazz-ui/src/app/pages/service-logs/service-logs.component.scss similarity index 100% rename from jazz-ui/src/app/pages/service-logs/service-logs.component.scss rename to core/jazz-ui/src/app/pages/service-logs/service-logs.component.scss diff --git a/jazz-ui/src/app/pages/service-logs/service-logs.component.spec.ts b/core/jazz-ui/src/app/pages/service-logs/service-logs.component.spec.ts similarity index 100% rename from jazz-ui/src/app/pages/service-logs/service-logs.component.spec.ts rename to core/jazz-ui/src/app/pages/service-logs/service-logs.component.spec.ts diff --git a/jazz-ui/src/app/pages/service-logs/service-logs.component.ts b/core/jazz-ui/src/app/pages/service-logs/service-logs.component.ts similarity index 99% rename from jazz-ui/src/app/pages/service-logs/service-logs.component.ts rename to core/jazz-ui/src/app/pages/service-logs/service-logs.component.ts index 47d22c31e8..2bb9f093b4 100644 --- a/jazz-ui/src/app/pages/service-logs/service-logs.component.ts +++ b/core/jazz-ui/src/app/pages/service-logs/service-logs.component.ts @@ -195,6 +195,10 @@ export class ServiceLogsComponent implements OnInit { } + refresh(){ + this.callLogsFunc(); + } + onaccSelected(event){ this.FilterTags.notify('filter-Account',event); this.accSelected=event; diff --git a/jazz-ui/src/app/pages/service-metrics/data.ts b/core/jazz-ui/src/app/pages/service-metrics/data.ts similarity index 100% rename from jazz-ui/src/app/pages/service-metrics/data.ts rename to core/jazz-ui/src/app/pages/service-metrics/data.ts diff --git a/core/jazz-ui/src/app/pages/service-metrics/service-metrics.component.html b/core/jazz-ui/src/app/pages/service-metrics/service-metrics.component.html new file mode 100644 index 0000000000..7a08e3ae33 --- /dev/null +++ b/core/jazz-ui/src/app/pages/service-metrics/service-metrics.component.html @@ -0,0 +1,45 @@ +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    Oops, No Data Found
    Doesn't look like there is any data available here.
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/jazz-ui/src/app/pages/service-metrics/service-metrics.component.scss b/core/jazz-ui/src/app/pages/service-metrics/service-metrics.component.scss similarity index 100% rename from jazz-ui/src/app/pages/service-metrics/service-metrics.component.scss rename to core/jazz-ui/src/app/pages/service-metrics/service-metrics.component.scss diff --git a/jazz-ui/src/app/pages/service-metrics/service-metrics.component.spec.ts b/core/jazz-ui/src/app/pages/service-metrics/service-metrics.component.spec.ts similarity index 100% rename from jazz-ui/src/app/pages/service-metrics/service-metrics.component.spec.ts rename to core/jazz-ui/src/app/pages/service-metrics/service-metrics.component.spec.ts diff --git a/core/jazz-ui/src/app/pages/service-metrics/service-metrics.component.ts b/core/jazz-ui/src/app/pages/service-metrics/service-metrics.component.ts new file mode 100644 index 0000000000..f0f9ac8c08 --- /dev/null +++ b/core/jazz-ui/src/app/pages/service-metrics/service-metrics.component.ts @@ -0,0 +1,293 @@ +import { + Component, OnInit, Input, ViewChild, AfterViewInit +} from '@angular/core'; +import * as moment from 'moment'; +import {UtilsService} from "../../core/services/utils.service"; +import {ActivatedRoute} from "@angular/router"; +import {RequestService} from "../../core/services"; +import {Observable} from "rxjs/Observable"; +import * as _ from "lodash"; + +@Component({ + selector: 'service-metrics', + templateUrl: './service-metrics.component.html', + styleUrls: ['./service-metrics.component.scss'] +}) +export class ServiceMetricsComponent implements OnInit, AfterViewInit { + @Input() service; + @ViewChild('filters') filters; + + public serviceType; + public environmentFilter; + public formFields: any = [ + { + column: 'View By:', + label: 'TIME RANGE', + type: 'select', + options: ['Day', 'Week', 'Month', 'Year'], + values: [ + { + range: moment().subtract(1, 'day').toISOString(), + format: 'h:mm a' + }, + { + range: moment().subtract(1, 'week').toISOString(), + format: 'MMM Do' + }, + { + range: moment().subtract(1, 'month').toISOString(), + format: 'M/D' + }, + { + range: moment().subtract(1, 'year').toISOString(), + format: 'MMMM' + }], + selected: 'Day' + }, + { + column: 'View By:', + label: 'PERIOD', + type: 'select', + options: ['15 Minutes', '1 Hour', '6 Hours', '1 Day', '7 Days', '30 Days'], + values: [moment(0).add(15, 'minute').valueOf() / 1000, + moment(0).add(1, 'hour').valueOf() / 1000, + moment(0).add(6, 'hour').valueOf() / 1000, + moment(0).add(1, 'day').valueOf() / 1000, + moment(0).add(7, 'day').valueOf() / 1000, + moment(0).add(30, 'day').valueOf() / 1000], + selected: '15 Minutes' + }, + { + column: 'View By:', + label: 'AGGREGATION', + type: 'select', + options: ['Sum', 'Average'], + values: ['Sum', 'average'], + selected: 'Sum' + } + ]; + public form; + public selectedAsset; + public selectedMetric; + public queryDataRaw; + public sectionStatus; + public errorData = {}; + public graphData; + private http; + + + constructor(private request: RequestService, + private utils: UtilsService, + private activatedRoute: ActivatedRoute) { + this.http = this.request; + } + + ngAfterViewInit() { + this.sectionStatus = 'loading'; + + if (!this.activatedRoute.snapshot.params['env']) { + return this.getEnvironments() + .then(() => { + return this.applyFilter(); + }); + } else { + return this.applyFilter(); + } + + } + + ngOnInit() { + this.serviceType = this.service.type || this.service.serviceType; + } + + refresh() { + this.ngAfterViewInit(); + } + + getEnvironments() { + return this.http.get('/jazz/environments', { + domain: this.service.domain, + service: this.service.name + }).toPromise() + .then((response: any) => { + if (response && response.data && response.data.environment && response.data.environment.length) { + let serviceEnvironments = _(response.data.environment).map('logical_id').uniq().value(); + this.environmentFilter = { + column: 'Filter By:', + label: 'ENVIRONMENT', + options: serviceEnvironments, + values: serviceEnvironments, + selected: 'prod' + }; + let environmentField = this.filters.getFieldValueOfLabel('ENVIRONMENT'); + if(!environmentField) { + this.formFields.splice(0, 0, this.environmentFilter); + } + } + }) + .catch((error) => { + return Promise.reject(error); + }) + } + + applyFilter(changedFilter?) { + if (changedFilter && (changedFilter.label === 'ASSET' || + changedFilter.label === 'METHOD' || + changedFilter.label === 'PATH')) { + this.setAsset(); + } else { + return this.queryMetricsData(); + } + } + + queryMetricsData() { + this.sectionStatus = 'loading'; + let request = { + url: '/jazz/metrics', + body: { + domain: this.service.domain, + service: this.service.name, + environment: this.filters.getFieldValueOfLabel('ENVIRONMENT') || this.activatedRoute.snapshot.params['env'] || 'prod', + start_time: this.filters.getFieldValueOfLabel('TIME RANGE').range, + end_time: moment().toISOString(), + interval: this.filters.getFieldValueOfLabel('PERIOD'), + statistics: this.filters.getFieldValueOfLabel('AGGREGATION') + } + }; + return this.http.post(request.url, request.body) + .toPromise() + .then((response) => { + this.sectionStatus = 'empty'; + if (response && response.data && response.data.assets && response.data.assets.length) { + this.queryDataRaw = response.data; + this.queryDataRaw.assets = this.filterAssetType(response.data); + this.setAssetsFilter(); + this.setAsset(); + } + }) + .catch((error) => { + this.sectionStatus = 'error'; + console.log(error); + }) + } + + filterAssetType(data) { + return data.assets.filter((asset) => { + if (this.serviceType === 'api') { + return asset.type === 'apigateway'; + } else if (this.serviceType === 'function') { + return asset.type === 'lambda' + } else if (this.serviceType === 'website') { + return (asset.type === 's3') || (asset.type === 'cloudfront'); + } + }) + } + + setAssetsFilter() { + this.filters.reset(); + switch (this.serviceType) { + case 'api': + let methods = _(this.queryDataRaw.assets) + .map('asset_name.Method') + .uniq().value(); + let paths = _(this.queryDataRaw.assets) + .map('asset_name.Resource') + .uniq().value(); + this.filters.addField('Filter By:', 'METHOD', methods, null, 'GET'); + this.filters.addField('Filter By:', 'PATH', paths); + break; + case 'website': + let websiteAssets = _(this.queryDataRaw.assets).map('type').uniq().value(); + this.filters.addField('Filter By:', 'ASSET', websiteAssets, null, 'cloudfront'); + break; + } + } + + setAsset() { + switch (this.serviceType) { + case 'api': + let method = this.filters.getFieldValueOfLabel('METHOD'); + let path = this.filters.getFieldValueOfLabel('PATH'); + this.selectedAsset = _.find(this.queryDataRaw.assets, (asset) => { + return asset.asset_name.Method === method && asset.asset_name.Resource === path; + }); + break; + case 'function': + this.selectedAsset = this.queryDataRaw.assets[0]; + break; + case 'website': + let assetType = this.filters.getFieldValueOfLabel('ASSET'); + this.selectedAsset = _.find(this.queryDataRaw.assets, {type: assetType}); + break; + } + + if (this.selectedAsset) { + this.setMetric(); + this.sectionStatus = 'resolved'; + } else { + this.sectionStatus = 'empty'; + } + } + + setMetric(metric?) { + if (metric) { + this.selectedMetric = metric; + } else if (this.selectedMetric) { + let found = this.selectedAsset.metrics.find((metric) => { + return metric.metric_name === this.selectedMetric.metric_name + }); + this.selectedMetric = found || this.selectedAsset.metrics[0] + } else { + this.selectedMetric = this.selectedAsset.metrics[0] + } + + this.graphData = this.formatGraphData(this.selectedMetric.datapoints); + } + + formatGraphData(metricData) { + let valueProperty = this.selectedAsset.statistics; + + let values = metricData + .sort((pointA, pointB) => { + return moment(pointA.Timestamp).diff(moment(pointB.Timestamp)); + }) + .map((dataPoint) => { + return { + x: moment(dataPoint.Timestamp).valueOf(), + y: parseInt(dataPoint[valueProperty]) + }; + }); + + let timeRange = this.filters.getFieldValueOfLabel('TIME RANGE'); + let options = { + tooltipXFormat: 'MMM DD YYYY, h:mm a', + fromDateISO: timeRange.range, + fromDateValue: moment(timeRange.range).valueOf(), + toDateISO: moment().toISOString(), + toDateValue: moment().valueOf(), + xAxisFormat: timeRange.format, + stepSize: this.filters.getFieldValueOfLabel('PERIOD') * 1000, + yMin: values.length ? + .9 * (values.map((point) => { + return point.y; + }) + .reduce((a, b) => { + return Math.min(a, b); + })) : 0, + yMax: values.length ? + 1.1 * (values.map((point) => { + return point.y; + }) + .reduce((a, b) => { + return Math.max(a, b); + })) : 100 + }; + + return { + datasets: [values], + options: options + } + } + + +} diff --git a/jazz-ui/src/app/pages/service-overview/service-overview.component.html b/core/jazz-ui/src/app/pages/service-overview/service-overview.component.html similarity index 95% rename from jazz-ui/src/app/pages/service-overview/service-overview.component.html rename to core/jazz-ui/src/app/pages/service-overview/service-overview.component.html index f414d8a0dd..c14bfd098b 100644 --- a/jazz-ui/src/app/pages/service-overview/service-overview.component.html +++ b/core/jazz-ui/src/app/pages/service-overview/service-overview.component.html @@ -140,10 +140,7 @@
    Description
    {{service.description || 'Give me the details for your service'}}
    -
  • -
    Approver(s)
    -
    {{service.approvers || 'NA'}}
    -
  • +
  • Namespace
    {{service.domain || 'Link a domain'}}
    @@ -174,10 +171,7 @@
    • -
    • -
      Email
      -
      {{service.email || 'Stay connected with an email'}}
      -
    • +
    • Slack Channel
      {{service.slackChannel || 'Feeling collaborative? Add it to slack'}}
      @@ -213,10 +207,7 @@
      Description
    • -
    • -
      Approver(s)
      -
      {{service.approvers || 'NA'}}
      -
    • +
    • Namespace
      {{service.domain || 'Link a domain'}}
      @@ -269,10 +260,7 @@
      -
    • -
      Email
      - -
    • +
    • Slack Channel
      @@ -332,5 +320,5 @@
      --> - + \ No newline at end of file diff --git a/jazz-ui/src/app/pages/service-overview/service-overview.component.scss b/core/jazz-ui/src/app/pages/service-overview/service-overview.component.scss similarity index 100% rename from jazz-ui/src/app/pages/service-overview/service-overview.component.scss rename to core/jazz-ui/src/app/pages/service-overview/service-overview.component.scss diff --git a/jazz-ui/src/app/pages/service-overview/service-overview.component.spec.ts b/core/jazz-ui/src/app/pages/service-overview/service-overview.component.spec.ts similarity index 100% rename from jazz-ui/src/app/pages/service-overview/service-overview.component.spec.ts rename to core/jazz-ui/src/app/pages/service-overview/service-overview.component.spec.ts diff --git a/jazz-ui/src/app/pages/service-overview/service-overview.component.ts b/core/jazz-ui/src/app/pages/service-overview/service-overview.component.ts similarity index 99% rename from jazz-ui/src/app/pages/service-overview/service-overview.component.ts rename to core/jazz-ui/src/app/pages/service-overview/service-overview.component.ts index e38abd2eff..cad72c1fe6 100644 --- a/jazz-ui/src/app/pages/service-overview/service-overview.component.ts +++ b/core/jazz-ui/src/app/pages/service-overview/service-overview.component.ts @@ -4,7 +4,7 @@ * @author */ -import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import { Component, OnInit, Input, Output, EventEmitter,ViewChild} from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { RequestService, DataCacheService, MessageService, AuthenticationService } from '../../core/services/index'; import { ToasterService } from 'angular2-toaster'; @@ -26,6 +26,7 @@ declare var $: any; }) export class ServiceOverviewComponent implements OnInit { + @ViewChild('env') envComponent; @Output() onload: EventEmitter < any > = new EventEmitter < any > (); @Output() onEnvGet: EventEmitter < any > = new EventEmitter < any > (); @@ -878,6 +879,9 @@ export class ServiceOverviewComponent implements OnInit { // arrEnv[0].status.replace("_"," "); } + refresh_env(){ + this.envComponent.refresh(); + } internal_build: boolean = true; @@ -890,10 +894,7 @@ export class ServiceOverviewComponent implements OnInit { this.prodEnv = {}; this.stgEnv = {}; - if ((this.service.domain != undefined) && (this.internal_build == true)) { - this.getenvData(); - - } + diff --git a/jazz-ui/src/app/pages/services-list/service-list.ts b/core/jazz-ui/src/app/pages/services-list/service-list.ts similarity index 100% rename from jazz-ui/src/app/pages/services-list/service-list.ts rename to core/jazz-ui/src/app/pages/services-list/service-list.ts diff --git a/jazz-ui/src/app/pages/services-list/services-list.component.html b/core/jazz-ui/src/app/pages/services-list/services-list.component.html similarity index 100% rename from jazz-ui/src/app/pages/services-list/services-list.component.html rename to core/jazz-ui/src/app/pages/services-list/services-list.component.html diff --git a/jazz-ui/src/app/pages/services-list/services-list.component.scss b/core/jazz-ui/src/app/pages/services-list/services-list.component.scss similarity index 100% rename from jazz-ui/src/app/pages/services-list/services-list.component.scss rename to core/jazz-ui/src/app/pages/services-list/services-list.component.scss diff --git a/jazz-ui/src/app/pages/services-list/services-list.component.spec.ts b/core/jazz-ui/src/app/pages/services-list/services-list.component.spec.ts similarity index 100% rename from jazz-ui/src/app/pages/services-list/services-list.component.spec.ts rename to core/jazz-ui/src/app/pages/services-list/services-list.component.spec.ts diff --git a/jazz-ui/src/app/pages/services-list/services-list.component.ts b/core/jazz-ui/src/app/pages/services-list/services-list.component.ts similarity index 100% rename from jazz-ui/src/app/pages/services-list/services-list.component.ts rename to core/jazz-ui/src/app/pages/services-list/services-list.component.ts diff --git a/jazz-ui/src/app/pages/services/services.component.html b/core/jazz-ui/src/app/pages/services/services.component.html similarity index 100% rename from jazz-ui/src/app/pages/services/services.component.html rename to core/jazz-ui/src/app/pages/services/services.component.html diff --git a/jazz-ui/src/app/pages/services/services.component.scss b/core/jazz-ui/src/app/pages/services/services.component.scss similarity index 100% rename from jazz-ui/src/app/pages/services/services.component.scss rename to core/jazz-ui/src/app/pages/services/services.component.scss diff --git a/jazz-ui/src/app/pages/services/services.component.spec.ts b/core/jazz-ui/src/app/pages/services/services.component.spec.ts similarity index 100% rename from jazz-ui/src/app/pages/services/services.component.spec.ts rename to core/jazz-ui/src/app/pages/services/services.component.spec.ts diff --git a/jazz-ui/src/app/pages/services/services.component.ts b/core/jazz-ui/src/app/pages/services/services.component.ts similarity index 100% rename from jazz-ui/src/app/pages/services/services.component.ts rename to core/jazz-ui/src/app/pages/services/services.component.ts diff --git a/jazz-ui/src/app/pages/testapi/test-api.component.html b/core/jazz-ui/src/app/pages/testapi/test-api.component.html similarity index 100% rename from jazz-ui/src/app/pages/testapi/test-api.component.html rename to core/jazz-ui/src/app/pages/testapi/test-api.component.html diff --git a/jazz-ui/src/app/pages/testapi/test-api.component.scss b/core/jazz-ui/src/app/pages/testapi/test-api.component.scss similarity index 100% rename from jazz-ui/src/app/pages/testapi/test-api.component.scss rename to core/jazz-ui/src/app/pages/testapi/test-api.component.scss diff --git a/jazz-ui/src/app/pages/testapi/test-api.component.ts b/core/jazz-ui/src/app/pages/testapi/test-api.component.ts similarity index 100% rename from jazz-ui/src/app/pages/testapi/test-api.component.ts rename to core/jazz-ui/src/app/pages/testapi/test-api.component.ts diff --git a/jazz-ui/src/app/pages/user-journey/user-journey.component.html b/core/jazz-ui/src/app/pages/user-journey/user-journey.component.html similarity index 100% rename from jazz-ui/src/app/pages/user-journey/user-journey.component.html rename to core/jazz-ui/src/app/pages/user-journey/user-journey.component.html diff --git a/jazz-ui/src/app/pages/user-journey/user-journey.component.scss b/core/jazz-ui/src/app/pages/user-journey/user-journey.component.scss similarity index 100% rename from jazz-ui/src/app/pages/user-journey/user-journey.component.scss rename to core/jazz-ui/src/app/pages/user-journey/user-journey.component.scss diff --git a/jazz-ui/src/app/pages/user-journey/user-journey.component.spec.ts b/core/jazz-ui/src/app/pages/user-journey/user-journey.component.spec.ts similarity index 100% rename from jazz-ui/src/app/pages/user-journey/user-journey.component.spec.ts rename to core/jazz-ui/src/app/pages/user-journey/user-journey.component.spec.ts diff --git a/jazz-ui/src/app/pages/user-journey/user-journey.component.ts b/core/jazz-ui/src/app/pages/user-journey/user-journey.component.ts similarity index 100% rename from jazz-ui/src/app/pages/user-journey/user-journey.component.ts rename to core/jazz-ui/src/app/pages/user-journey/user-journey.component.ts diff --git a/jazz-ui/src/app/pages/user-journey/user-journey.ts b/core/jazz-ui/src/app/pages/user-journey/user-journey.ts similarity index 100% rename from jazz-ui/src/app/pages/user-journey/user-journey.ts rename to core/jazz-ui/src/app/pages/user-journey/user-journey.ts diff --git a/jazz-ui/src/app/primary-components/amount/amount.component.html b/core/jazz-ui/src/app/primary-components/amount/amount.component.html similarity index 100% rename from jazz-ui/src/app/primary-components/amount/amount.component.html rename to core/jazz-ui/src/app/primary-components/amount/amount.component.html diff --git a/jazz-ui/src/app/primary-components/amount/amount.component.scss b/core/jazz-ui/src/app/primary-components/amount/amount.component.scss similarity index 100% rename from jazz-ui/src/app/primary-components/amount/amount.component.scss rename to core/jazz-ui/src/app/primary-components/amount/amount.component.scss diff --git a/jazz-ui/src/app/primary-components/amount/amount.component.spec.ts b/core/jazz-ui/src/app/primary-components/amount/amount.component.spec.ts similarity index 100% rename from jazz-ui/src/app/primary-components/amount/amount.component.spec.ts rename to core/jazz-ui/src/app/primary-components/amount/amount.component.spec.ts diff --git a/jazz-ui/src/app/primary-components/amount/amount.component.ts b/core/jazz-ui/src/app/primary-components/amount/amount.component.ts similarity index 100% rename from jazz-ui/src/app/primary-components/amount/amount.component.ts rename to core/jazz-ui/src/app/primary-components/amount/amount.component.ts diff --git a/jazz-ui/src/app/primary-components/btn-jazz-primary/btn-jazz-primary.component.html b/core/jazz-ui/src/app/primary-components/btn-jazz-primary/btn-jazz-primary.component.html similarity index 100% rename from jazz-ui/src/app/primary-components/btn-jazz-primary/btn-jazz-primary.component.html rename to core/jazz-ui/src/app/primary-components/btn-jazz-primary/btn-jazz-primary.component.html diff --git a/jazz-ui/src/app/primary-components/btn-jazz-primary/btn-jazz-primary.component.scss b/core/jazz-ui/src/app/primary-components/btn-jazz-primary/btn-jazz-primary.component.scss similarity index 100% rename from jazz-ui/src/app/primary-components/btn-jazz-primary/btn-jazz-primary.component.scss rename to core/jazz-ui/src/app/primary-components/btn-jazz-primary/btn-jazz-primary.component.scss diff --git a/jazz-ui/src/app/primary-components/btn-jazz-primary/btn-jazz-primary.component.ts b/core/jazz-ui/src/app/primary-components/btn-jazz-primary/btn-jazz-primary.component.ts similarity index 100% rename from jazz-ui/src/app/primary-components/btn-jazz-primary/btn-jazz-primary.component.ts rename to core/jazz-ui/src/app/primary-components/btn-jazz-primary/btn-jazz-primary.component.ts diff --git a/jazz-ui/src/app/primary-components/btn-jazz-secondary/btn-jazz-secondary.component.html b/core/jazz-ui/src/app/primary-components/btn-jazz-secondary/btn-jazz-secondary.component.html similarity index 100% rename from jazz-ui/src/app/primary-components/btn-jazz-secondary/btn-jazz-secondary.component.html rename to core/jazz-ui/src/app/primary-components/btn-jazz-secondary/btn-jazz-secondary.component.html diff --git a/jazz-ui/src/app/primary-components/btn-jazz-secondary/btn-jazz-secondary.component.scss b/core/jazz-ui/src/app/primary-components/btn-jazz-secondary/btn-jazz-secondary.component.scss similarity index 100% rename from jazz-ui/src/app/primary-components/btn-jazz-secondary/btn-jazz-secondary.component.scss rename to core/jazz-ui/src/app/primary-components/btn-jazz-secondary/btn-jazz-secondary.component.scss diff --git a/jazz-ui/src/app/primary-components/btn-jazz-secondary/btn-jazz-secondary.component.ts b/core/jazz-ui/src/app/primary-components/btn-jazz-secondary/btn-jazz-secondary.component.ts similarity index 100% rename from jazz-ui/src/app/primary-components/btn-jazz-secondary/btn-jazz-secondary.component.ts rename to core/jazz-ui/src/app/primary-components/btn-jazz-secondary/btn-jazz-secondary.component.ts diff --git a/jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.html b/core/jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.html similarity index 100% rename from jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.html rename to core/jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.html diff --git a/jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.scss b/core/jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.scss similarity index 100% rename from jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.scss rename to core/jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.scss diff --git a/jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.spec.ts b/core/jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.spec.ts similarity index 100% rename from jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.spec.ts rename to core/jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.spec.ts diff --git a/jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.ts b/core/jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.ts similarity index 100% rename from jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.ts rename to core/jazz-ui/src/app/primary-components/btn-primary-with-icon/btn-primary-with-icon.component.ts diff --git a/jazz-ui/src/app/primary-components/custom-filter.ts b/core/jazz-ui/src/app/primary-components/custom-filter.ts similarity index 100% rename from jazz-ui/src/app/primary-components/custom-filter.ts rename to core/jazz-ui/src/app/primary-components/custom-filter.ts diff --git a/jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.html b/core/jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.html similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.html rename to core/jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.html diff --git a/jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.scss b/core/jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.scss similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.scss rename to core/jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.scss diff --git a/jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.spec.ts b/core/jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.spec.ts similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.spec.ts rename to core/jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.spec.ts diff --git a/jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.ts b/core/jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.ts similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.ts rename to core/jazz-ui/src/app/primary-components/daterange-picker/daterange-picker.component.ts diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/.angular-cli.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/.angular-cli.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/.angular-cli.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/.angular-cli.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/.editorconfig b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/.editorconfig similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/.editorconfig rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/.editorconfig diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/.npmignore b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/.npmignore similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/.npmignore rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/.npmignore diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/LICENSE b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/LICENSE similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/LICENSE rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/LICENSE diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/README.md b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/README.md similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/README.md rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/README.md diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/e2e/tsconfig.e2e.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/e2e/tsconfig.e2e.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/e2e/tsconfig.e2e.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/e2e/tsconfig.e2e.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/karma.conf.js b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/karma.conf.js similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/karma.conf.js rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/karma.conf.js diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.d.ts b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.d.ts similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.d.ts rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.d.ts diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.js b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.js similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.js rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.js diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.js.map b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.js.map similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.js.map rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.js.map diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.metadata.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.metadata.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.metadata.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.component.metadata.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.d.ts b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.d.ts similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.d.ts rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.d.ts diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.js b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.js similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.js rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.js diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.js.map b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.js.map similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.js.map rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.js.map diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.metadata.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.metadata.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.metadata.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/ng2-datepicker.module.metadata.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/tsconfig-ngc.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/tsconfig-ngc.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/tsconfig-ngc.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/lib-dist/tsconfig-ngc.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/package.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/package.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/package.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/package.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/protractor.conf.js b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/protractor.conf.js similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/protractor.conf.js rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/protractor.conf.js diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/app/app.component.html b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/app/app.component.html similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/app/app.component.html rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/app/app.component.html diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/assets/.gitkeep b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/assets/.gitkeep similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/assets/.gitkeep rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/assets/.gitkeep diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/favicon.ico b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/favicon.ico similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/favicon.ico rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/favicon.ico diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/index.html b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/index.html similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/index.html rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/index.html diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/ng2-datepicker/ng2-datepicker.component.html b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/ng2-datepicker/ng2-datepicker.component.html similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/ng2-datepicker/ng2-datepicker.component.html rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/ng2-datepicker/ng2-datepicker.component.html diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/ng2-datepicker/ng2-datepicker.component.sass b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/ng2-datepicker/ng2-datepicker.component.sass similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/ng2-datepicker/ng2-datepicker.component.sass rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/ng2-datepicker/ng2-datepicker.component.sass diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/styles.css b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/styles.css similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/styles.css rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/styles.css diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/tsconfig.app.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/tsconfig.app.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/tsconfig.app.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/tsconfig.app.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/tsconfig.spec.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/tsconfig.spec.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/tsconfig.spec.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/src/tsconfig.spec.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/tsconfig.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/tsconfig.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/tsconfig.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/tsconfig.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/tslint.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/tslint.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/tslint.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-datepicker/tslint.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/.npmignore b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/.npmignore similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/.npmignore rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/.npmignore diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/LICENSE b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/LICENSE similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/LICENSE rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/LICENSE diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/README.md b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/README.md similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/README.md rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/README.md diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.d.ts b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.d.ts similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.d.ts rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.d.ts diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.js b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.js similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.js rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.js diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.metadata.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.metadata.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.metadata.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.metadata.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.ngfactory.xts b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.ngfactory.xts similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.ngfactory.xts rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.ngfactory.xts diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.ngsummary.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.ngsummary.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.ngsummary.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.ngsummary.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.ts b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.ts similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.ts rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/index.ts diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/ng2-slimscroll.ts b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/ng2-slimscroll.ts similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/ng2-slimscroll.ts rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/ng2-slimscroll.ts diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/package.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/package.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/package.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/package.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.d.ts b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.d.ts similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.d.ts rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.d.ts diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.js b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.js similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.js rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.js diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.metadata.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.metadata.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.metadata.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.metadata.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.ngsummary.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.ngsummary.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.ngsummary.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.ngsummary.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.ts b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.ts similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.ts rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/classes/slimscroll-options.class.ts diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.d.ts b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.d.ts similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.d.ts rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.d.ts diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.js b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.js similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.js rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.js diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.metadata.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.metadata.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.metadata.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.metadata.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.ngsummary.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.ngsummary.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.ngsummary.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.ngsummary.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.ts b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.ts similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.ts rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/src/directives/slimscroll.directive.ts diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/tsconfig.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/tsconfig.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/tsconfig.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/tsconfig.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/tslint.json b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/tslint.json similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/tslint.json rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/tslint.json diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/webpack/webpack.config.js b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/webpack/webpack.config.js similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/webpack/webpack.config.js rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/webpack/webpack.config.js diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/yarn.lock b/core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/yarn.lock similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/yarn.lock rename to core/jazz-ui/src/app/primary-components/daterange-picker/ng2-slimscroll/yarn.lock diff --git a/jazz-ui/src/app/primary-components/daterange-picker/ngx-slimscroll.zip b/core/jazz-ui/src/app/primary-components/daterange-picker/ngx-slimscroll.zip similarity index 100% rename from jazz-ui/src/app/primary-components/daterange-picker/ngx-slimscroll.zip rename to core/jazz-ui/src/app/primary-components/daterange-picker/ngx-slimscroll.zip diff --git a/jazz-ui/src/app/primary-components/dropdown/dropdown.component.html b/core/jazz-ui/src/app/primary-components/dropdown/dropdown.component.html similarity index 100% rename from jazz-ui/src/app/primary-components/dropdown/dropdown.component.html rename to core/jazz-ui/src/app/primary-components/dropdown/dropdown.component.html diff --git a/jazz-ui/src/app/primary-components/dropdown/dropdown.component.scss b/core/jazz-ui/src/app/primary-components/dropdown/dropdown.component.scss similarity index 100% rename from jazz-ui/src/app/primary-components/dropdown/dropdown.component.scss rename to core/jazz-ui/src/app/primary-components/dropdown/dropdown.component.scss diff --git a/jazz-ui/src/app/primary-components/dropdown/dropdown.component.spec.ts b/core/jazz-ui/src/app/primary-components/dropdown/dropdown.component.spec.ts similarity index 100% rename from jazz-ui/src/app/primary-components/dropdown/dropdown.component.spec.ts rename to core/jazz-ui/src/app/primary-components/dropdown/dropdown.component.spec.ts diff --git a/jazz-ui/src/app/primary-components/dropdown/dropdown.component.ts b/core/jazz-ui/src/app/primary-components/dropdown/dropdown.component.ts similarity index 100% rename from jazz-ui/src/app/primary-components/dropdown/dropdown.component.ts rename to core/jazz-ui/src/app/primary-components/dropdown/dropdown.component.ts diff --git a/jazz-ui/src/app/primary-components/input/input.component.html b/core/jazz-ui/src/app/primary-components/input/input.component.html similarity index 100% rename from jazz-ui/src/app/primary-components/input/input.component.html rename to core/jazz-ui/src/app/primary-components/input/input.component.html diff --git a/jazz-ui/src/app/primary-components/input/input.component.scss b/core/jazz-ui/src/app/primary-components/input/input.component.scss similarity index 100% rename from jazz-ui/src/app/primary-components/input/input.component.scss rename to core/jazz-ui/src/app/primary-components/input/input.component.scss diff --git a/jazz-ui/src/app/primary-components/input/input.component.spec.ts b/core/jazz-ui/src/app/primary-components/input/input.component.spec.ts similarity index 100% rename from jazz-ui/src/app/primary-components/input/input.component.spec.ts rename to core/jazz-ui/src/app/primary-components/input/input.component.spec.ts diff --git a/jazz-ui/src/app/primary-components/input/input.component.ts b/core/jazz-ui/src/app/primary-components/input/input.component.ts similarity index 100% rename from jazz-ui/src/app/primary-components/input/input.component.ts rename to core/jazz-ui/src/app/primary-components/input/input.component.ts diff --git a/jazz-ui/src/app/primary-components/report-issue/report-issue.component.html b/core/jazz-ui/src/app/primary-components/report-issue/report-issue.component.html similarity index 97% rename from jazz-ui/src/app/primary-components/report-issue/report-issue.component.html rename to core/jazz-ui/src/app/primary-components/report-issue/report-issue.component.html index 8bdae96d75..7d15127e52 100644 --- a/jazz-ui/src/app/primary-components/report-issue/report-issue.component.html +++ b/core/jazz-ui/src/app/primary-components/report-issue/report-issue.component.html @@ -3,7 +3,7 @@
      -
      +