summaryrefslogtreecommitdiffstats
path: root/cds-ui/designer-client
AgeCommit message (Expand)AuthorFilesLines
2020-05-18Merge "Test Current version and apply changes"Dan Timoney8-42/+177
2020-05-18Test Current version and apply changesSarah Abouzainah8-42/+177
2020-05-14Designer > BreadcrumbRupinder9-20/+87
2020-05-11Merge "Disable Filename in edit"Dan Timoney5-9/+77
2020-05-11Merge "fix pagination and create package feature"Dan Timoney2-5/+4
2020-05-11Disable Filename in editAhmedEldeeb505-9/+77
2020-05-10fix pagination and create package featureShaabanEltanany2-5/+4
2020-05-08Create New Action's ModalSarah Abouzainah16-1080/+1942
2020-05-08Merge "update template&mapping create view."Dan Timoney11-681/+1635
2020-05-07update template&mapping create view.AhmedEldeeb5011-681/+1635
2020-05-06Merge "fix sort at package list"Dan Timoney1-3/+6
2020-05-05fi
import {Injectable} from '@angular/core';
import {HttpClient, HttpHeaders} from '@angular/common/http';
import { Constants } from '../../shared/utils/constants';
import { ServiceType } from "../../shared/models/serviceType";
import {GetSubDetailsResponse} from "./responseInterfaces/getSubDetailsResponseInterface";
import {Observable} from "rxjs/Observable";
import * as _ from 'lodash';
import {CategoryParams} from "../../shared/models/categoryParams";
import {GetCategoryParamsResponseInterface} from "./responseInterfaces/getCategoryParamsResponseInterface";
import {Project} from "../../shared/models/project";
import {OwningEntity} from "../../shared/models/owningEntity";
import {GetServicesResponseInterface} from "./responseInterfaces/getServicesResponseInterface";
import {Subscriber} from "../../shared/models/subscriber";
import {GetSubscribers
37-523/+1464
2020-04-09Remove unneeded backup filesDan Timoney1-95/+0
2020-04-09Merge "Fixnig file import in script, import and template&mapping."Dan Timoney7-17/+27
2020-04-09Merge "Fixing All Accordion panels is only open and not closed"Dan Timoney4-9/+31
2020-04-09Fixnig file import in script, import and template&mapping.AhmedEldeeb507-17/+27
2020-04-08Fixing All Accordion panels is only open and not closedShaabanEltanany4-9/+31
2020-04-07Roll to next Guilin snapshotDan Timoney2-2/+98
2020-03-30Roll to next Frankfurt snapshot and fix sonar buildDan Timoney1-2/+2
2020-03-27Change relative paths in Python Executor testMichal Jagiello2-0/+13321
2020-03-06Fixing some bugs in package creation tabsAhmed6-55/+66
2020-03-04add integrating with designer from viewing packageshaaban Altanany5-7/+25
2020-03-02Merge "Display Mapping result in view table."KAPIL SINGAL12-95/+181
2020-03-02fix issue in designer page when loading workflows from sourceAhmed Abbas1-1/+1
2020-03-02Display Mapping result in view table.Ahmed12-95/+181
2020-03-01fixing some ui issuesshaaban Altanany2-14/+15
2020-02-29enhance loading topologyTemplate from sourceAhmed Abbas5-23/+74
2020-02-28add designer funcionality - declarative workflowAhmed Abbas22-347/+1367
2020-02-28Merge "add basic download for current viewed package"KAPIL SINGAL6-70/+50
2020-02-28adding dependacies to mapping tableAhmed5-47/+113
2020-02-28add basic download for current viewed packageshaaban Altanany6-70/+50
>(owningEntity)); const projectList = res.categoryParameters.project.map(project => new Project(project)); const lineOfBusinessList = res.categoryParameters.lineOfBusiness.map(owningEntity => new SelectOption(owningEntity)); const platformList = res.categoryParameters.platform.map(platform => new SelectOption(platform)); return new CategoryParams(owningEntityList, projectList, lineOfBusinessList, platformList); } else { return new CategoryParams(); } } public getProductFamilies(): Observable<ProductFamily[]> { return this.getServices().map(res => res.service.map(service => new ProductFamily(service))); } public getServices(): Observable<GetServicesResponseInterface> { let pathQuery: string = Constants.Path.AAI_GET_SERVICES + Constants.Path.ASSIGN + Math.random(); return this.http.get<GetServicesResponseInterface>(pathQuery); } public getSubscribers(): Observable<Subscriber[]> { if (this.store.getState().service.subscribers){ return Observable.of(<any> JSON.parse(JSON.stringify(this.store.getState().service.subscribers))); } let pathQuery: string = Constants.Path.AAI_GET_SUBSCRIBERS + Constants.Path.ASSIGN + Math.random(); return this.http.get<GetSubscribersResponse>(pathQuery).map(res => res.customer.map( subscriber => new Subscriber(subscriber))).do((res) => { this.store.dispatch(updateSubscribers(res)); }); } public getAicZones(): Observable<AicZone[]> { if (this.store.getState().service.aicZones){ return Observable.of(<any> JSON.parse(JSON.stringify(this.store.getState().service.aicZones))); } let pathQuery: string = Constants.Path.AAI_GET_AIC_ZONES + Constants.Path.ASSIGN + Math.random(); return this.http.get<GetAicZonesResponse>(pathQuery).map(res => res.zone.map(aicZone => new AicZone(aicZone))).do((res) => { this.store.dispatch(updateAicZones(res)); }); } public getLcpRegionsAndTenants(globalCustomerId, serviceType): Observable<LcpRegionsAndTenants> { if (this.store.getState().service.lcpRegionsAndTenants.lcpRegionList.length !== 0){ return Observable.of(<any> JSON.parse(JSON.stringify(this.store.getState().service.lcpRegionsAndTenants))); } let pathQuery: string = Constants.Path.AAI_GET_TENANTS + globalCustomerId + Constants.Path.FORWARD_SLASH + serviceType + Constants.Path.ASSIGN + Math.random(); console.log("AaiService:getSubscriptionServiceTypeList: globalCustomerId: " + globalCustomerId); if (globalCustomerId != null) { return this.http.get(pathQuery) .map(this.tenantResponseToLcpRegionsAndTenants).do((res) => { this.store.dispatch(updateLcpRegionsAndTenants(res)); }); } } tenantResponseToLcpRegionsAndTenants(cloudRegionTenantList): LcpRegionsAndTenants { const lcpRegionsTenantsMap = {}; const lcpRegionList = _.uniqBy(cloudRegionTenantList, 'cloudRegionID').map((cloudRegionTenant) => { return new LcpRegion(cloudRegionTenant) }); lcpRegionList.forEach(region => { lcpRegionsTenantsMap[region.id] = _.filter(cloudRegionTenantList, {'cloudRegionID' : region.id}) .map((cloudRegionTenant) => { return new Tenant(cloudRegionTenant) }); const reducer = (accumulator, currentValue) => { accumulator.isPermitted = accumulator.isPermitted || currentValue.isPermitted; return accumulator; }; region.isPermitted = lcpRegionsTenantsMap[region.id].reduce(reducer).isPermitted; }); return new LcpRegionsAndTenants(lcpRegionList, lcpRegionsTenantsMap); } public getServiceTypes(subscriberId): Observable<ServiceType[]> { console.log("AaiService:getSubscriptionServiceTypeList: globalCustomerId: " + subscriberId); if (_.has(this.store.getState().service.serviceTypes, subscriberId)){ return Observable.of(<any> JSON.parse(JSON.stringify(this.store.getState().service.serviceTypes[subscriberId]))); } return this.getSubscriberDetails(subscriberId) .map(this.subDetailsResponseToServiceTypes) .do((res) => {this.store.dispatch(updateServiceTypes(res, subscriberId));}); } public getSubscriberDetails(subscriberId): Observable<GetSubDetailsResponse> { let pathQuery: string = Constants.Path.AAI_SUB_DETAILS_PATH + subscriberId + Constants.Path.ASSIGN + Math.random(); if (subscriberId != null) { return this.http.get<GetSubDetailsResponse>(pathQuery); } } subDetailsResponseToServiceTypes(res: GetSubDetailsResponse): ServiceType[] { if (res && res['service-subscriptions']) { const serviceSubscriptions = res['service-subscriptions']['service-subscription']; return serviceSubscriptions.map((subscription, index) => new ServiceType(String(index), subscription)) } else { return []; } } }