diff --git a/docs/status_updates.md b/docs/status_updates.md index c09ebcd373..4eb30f5e0a 100644 --- a/docs/status_updates.md +++ b/docs/status_updates.md @@ -2,6 +2,10 @@ Weekly status updates are published here. +## 12th October 2018 + +The team have been preparing for and attending the CF Summit in Basel. + ## 5th October 2018 The team have been preparing for the CF Summit in Basel next week. diff --git a/src/frontend/app/features/applications/application.service.ts b/src/frontend/app/features/applications/application.service.ts index ee52c16b1c..29c7446e93 100644 --- a/src/frontend/app/features/applications/application.service.ts +++ b/src/frontend/app/features/applications/application.service.ts @@ -13,17 +13,11 @@ import { import { APP_GUID, CF_GUID } from '../../shared/entity.tokens'; import { PaginationMonitor } from '../../shared/monitors/pagination-monitor'; import { PaginationMonitorFactory } from '../../shared/monitors/pagination-monitor.factory'; -import { - AppMetadataTypes, - GetAppEnvVarsAction, - GetAppStatsAction, - GetAppSummaryAction, -} from '../../store/actions/app-metadata.actions'; +import { AppMetadataTypes, GetAppStatsAction, GetAppSummaryAction } from '../../store/actions/app-metadata.actions'; import { GetApplication, UpdateApplication, UpdateExistingApplication } from '../../store/actions/application.actions'; import { GetSpace } from '../../store/actions/space.actions'; import { AppState } from '../../store/app-state'; import { - appEnvVarsSchemaKey, applicationSchemaKey, appStatsSchemaKey, appSummarySchemaKey, @@ -173,7 +167,7 @@ export class ApplicationService { }); return appStateService.get(app, appInstances); }) - ).pipe(publishReplay(1), refCount(), ); + ).pipe(publishReplay(1), refCount()); } private constructCoreObservables() { @@ -181,7 +175,7 @@ export class ApplicationService { this.app$ = this.appEntityService.waitForEntity$; const moreWaiting$ = this.app$.pipe( filter(entityInfo => !!(entityInfo.entity && entityInfo.entity.entity && entityInfo.entity.entity.cfGuid)), - map(entityInfo => entityInfo.entity.entity), ); + map(entityInfo => entityInfo.entity.entity)); this.appSpace$ = moreWaiting$.pipe( first(), switchMap(app => { @@ -206,16 +200,15 @@ export class ApplicationService { )) ); - this.isDeletingApp$ = this.appEntityService.isDeletingEntity$.pipe(publishReplay(1), refCount(), ); + this.isDeletingApp$ = this.appEntityService.isDeletingEntity$.pipe(publishReplay(1), refCount()); - this.waitForAppEntity$ = this.appEntityService.waitForEntity$.pipe(publishReplay(1), refCount(), ); + this.waitForAppEntity$ = this.appEntityService.waitForEntity$.pipe(publishReplay(1), refCount()); this.appSummary$ = this.waitForAppEntity$.pipe( switchMap(() => this.appSummaryEntityService.entityObs$), publishReplay(1), refCount() ); - const action = new GetAppEnvVarsAction(this.appGuid, this.cfGuid); this.appEnvVars = this.appEnvVarsService.createEnvVarsObs(this.appGuid, this.cfGuid); } @@ -235,7 +228,7 @@ export class ApplicationService { // willing to do this to speed up the initial fetch for a running application. this.appStats$ = appStats.entities$; - this.appStatsFetching$ = appStats.pagination$.pipe(publishReplay(1), refCount(), ); + this.appStatsFetching$ = appStats.pagination$.pipe(publishReplay(1), refCount()); this.application$ = this.waitForAppEntity$.pipe( combineLatest(this.store.select(endpointEntitiesSelector)), @@ -249,17 +242,17 @@ export class ApplicationService { stack: entity.entity.stack, cf: endpoints[entity.entity.cfGuid], }; - }), publishReplay(1), refCount(), ); + }), publishReplay(1), refCount()); this.applicationState$ = this.waitForAppEntity$.pipe( combineLatest(this.appStats$.pipe(startWith(null))), map(([appInfo, appStatsArray]: [EntityInfo, APIResource[]]) => { return this.appStateService.get(appInfo.entity.entity, appStatsArray ? appStatsArray.map(apiResource => apiResource.entity) : null); - }), publishReplay(1), refCount(), ); + }), publishReplay(1), refCount()); this.applicationStratProject$ = this.appEnvVars.entities$.pipe(map(applicationEnvVars => { return this.appEnvVarsService.FetchStratosProject(applicationEnvVars[0].entity); - }), publishReplay(1), refCount(), ); + }), publishReplay(1), refCount()); this.applicationRunning$ = this.application$.pipe( map(app => app ? app.app.entity.state === 'STARTED' : false) @@ -280,15 +273,15 @@ export class ApplicationService { map(ev => getCurrentPageRequestInfo(ev).busy), startWith(false), publishReplay(1), - refCount(), ); + refCount()); this.isUpdatingEnvVars$ = this.appEnvVars.pagination$.pipe(map( ev => getCurrentPageRequestInfo(ev).busy && ev.ids[ev.currentPage] - ), startWith(false), publishReplay(1), refCount(), ); + ), startWith(false), publishReplay(1), refCount()); this.isFetchingStats$ = this.appStatsFetching$.pipe(map( appStats => appStats ? getCurrentPageRequestInfo(appStats).busy : false - ), startWith(false), publishReplay(1), refCount(), ); + ), startWith(false), publishReplay(1), refCount()); this.applicationUrl$ = this.appSummaryEntityService.entityObs$.pipe( map(({ entity }) => entity), diff --git a/src/frontend/app/features/applications/application/application-tabs-base/tabs/build-tab/build-tab.component.ts b/src/frontend/app/features/applications/application/application-tabs-base/tabs/build-tab/build-tab.component.ts index 4d54efc854..1802513646 100644 --- a/src/frontend/app/features/applications/application/application-tabs-base/tabs/build-tab/build-tab.component.ts +++ b/src/frontend/app/features/applications/application/application-tabs-base/tabs/build-tab/build-tab.component.ts @@ -1,17 +1,14 @@ - -import { distinct, map, combineLatest } from 'rxjs/operators'; -import { Component, HostBinding, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import { Store } from '@ngrx/store'; +import { Component, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; +import { combineLatest, distinct, map } from 'rxjs/operators'; -import { AppState } from '../../../../../../store/app-state'; import { EntityInfo } from '../../../../../../store/types/api.types'; import { AppSummary } from '../../../../../../store/types/app-metadata.types'; import { getFullEndpointApiUrl } from '../../../../../endpoints/endpoint-helpers'; import { ApplicationMonitorService } from '../../../../application-monitor.service'; import { ApplicationData, ApplicationService } from '../../../../application.service'; + @Component({ selector: 'app-build-tab', templateUrl: './build-tab.component.html', @@ -40,7 +37,7 @@ export class BuildTabComponent implements OnInit { ), map(([app, appSummary]: [ApplicationData, EntityInfo]) => { return app.fetching || appSummary.entityRequestInfo.fetching; - }), distinct(), ); + }), distinct()); this.sshStatus$ = this.applicationService.application$.pipe( combineLatest(this.applicationService.appSpace$), diff --git a/src/frontend/app/features/applications/deploy-application/deploy-application-deployer.ts b/src/frontend/app/features/applications/deploy-application/deploy-application-deployer.ts index 679720f890..c46d39ca76 100644 --- a/src/frontend/app/features/applications/deploy-application/deploy-application-deployer.ts +++ b/src/frontend/app/features/applications/deploy-application/deploy-application-deployer.ts @@ -1,4 +1,3 @@ -import { HttpClient } from '@angular/common/http'; import { Store } from '@ngrx/store'; import { BehaviorSubject, Observable, of as observableOf, Subject, Subscription } from 'rxjs'; import websocketConnect from 'rxjs-websockets'; @@ -64,8 +63,6 @@ export class DeployApplicationDeployer { // Are we deploying? deploying = false; - private hasSentSource = false; - private inputStream; private isOpen = false; @@ -79,7 +76,6 @@ export class DeployApplicationDeployer { constructor( private store: Store, public cfOrgSpaceService: CfOrgSpaceDataService, - private http: HttpClient, ) { } updateStatus(error = false, errorMsg?: string) { @@ -152,7 +148,7 @@ export class DeployApplicationDeployer { filter((log) => log.type === SocketEventTypes.DATA), map((log) => log.message), share(), - ); + ); this.msgSub = this.messages.subscribe(); }) ).subscribe(); diff --git a/src/frontend/app/features/applications/deploy-application/deploy-application-step-source-upload/deploy-application-step-source-upload.component.ts b/src/frontend/app/features/applications/deploy-application/deploy-application-step-source-upload/deploy-application-step-source-upload.component.ts index aa09dd6a26..90adacee57 100644 --- a/src/frontend/app/features/applications/deploy-application/deploy-application-step-source-upload/deploy-application-step-source-upload.component.ts +++ b/src/frontend/app/features/applications/deploy-application/deploy-application-step-source-upload/deploy-application-step-source-upload.component.ts @@ -21,11 +21,10 @@ export class DeployApplicationStepSourceUploadComponent implements OnDestroy { public valid$: Observable; - constructor(private store: Store, + constructor(store: Store, public cfOrgSpaceService: CfOrgSpaceDataService, - http: HttpClient, ) { - this.deployer = new DeployApplicationDeployer(store, cfOrgSpaceService, http); + this.deployer = new DeployApplicationDeployer(store, cfOrgSpaceService); this.valid$ = this.deployer.fileTransferStatus$.pipe( filter(status => !!status), map((status: FileTransferStatus) => status.filesSent === status.totalFiles), diff --git a/src/frontend/app/features/applications/deploy-application/deploy-application-step3/deploy-application-step3.component.ts b/src/frontend/app/features/applications/deploy-application/deploy-application-step3/deploy-application-step3.component.ts index ba17165ddd..875f71d44b 100644 --- a/src/frontend/app/features/applications/deploy-application/deploy-application-step3/deploy-application-step3.component.ts +++ b/src/frontend/app/features/applications/deploy-application/deploy-application-step3/deploy-application-step3.component.ts @@ -1,4 +1,3 @@ -import { HttpClient } from '@angular/common/http'; import { Component, Input, OnDestroy } from '@angular/core'; import { MatSnackBar } from '@angular/material'; import { Store } from '@ngrx/store'; @@ -18,14 +17,11 @@ import { import { StepOnNextFunction } from '../../../../shared/components/stepper/step/step.component'; import { CfOrgSpaceDataService } from '../../../../shared/data-services/cf-org-space-service.service'; import { GetAppEnvVarsAction } from '../../../../store/actions/app-metadata.actions'; +import { GetApplication } from '../../../../store/actions/application.actions'; import { DeleteDeployAppSection } from '../../../../store/actions/deploy-applications.actions'; import { RouterNav } from '../../../../store/actions/router.actions'; import { AppState } from '../../../../store/app-state'; import { DeployApplicationDeployer } from '../deploy-application-deployer'; -import { FileScannerInfo } from '../deploy-application-step2/deploy-application-fs/deploy-application-fs-scanner'; - -// Interval to check for new application -const APP_CHECK_INTERVAL = 3000; @Component({ selector: 'app-deploy-application-step3', @@ -53,9 +49,8 @@ export class DeployApplicationStep3Component implements OnDestroy { private store: Store, snackBar: MatSnackBar, public cfOrgSpaceService: CfOrgSpaceDataService, - http: HttpClient, ) { - this.deployer = new DeployApplicationDeployer(store, cfOrgSpaceService, http); + this.deployer = new DeployApplicationDeployer(store, cfOrgSpaceService); // Observables this.errorSub = this.deployer.status$.pipe( filter((status) => status.error) @@ -129,6 +124,8 @@ export class DeployApplicationStep3Component implements OnDestroy { this.store.dispatch(new RouterNav({ path: ['applications', cfGuid, this.appGuid] })); if (this.appGuid) { this.store.dispatch(new GetAppEnvVarsAction(this.appGuid, cfGuid)); + // Ensure the application package_state is correct + this.store.dispatch(new GetApplication(this.appGuid, cfGuid)); } return observableOf({ success: true }); } diff --git a/src/frontend/app/store/actions/service-instances.actions.ts b/src/frontend/app/store/actions/service-instances.actions.ts index 7f660372f2..e9bf1d734d 100644 --- a/src/frontend/app/store/actions/service-instances.actions.ts +++ b/src/frontend/app/store/actions/service-instances.actions.ts @@ -4,19 +4,15 @@ import { applicationSchemaKey, entityFactory, organizationSchemaKey, + serviceBindingNoBindingsSchemaKey, serviceBindingSchemaKey, serviceInstancesSchemaKey, serviceInstancesWithSpaceSchemaKey, servicePlanSchemaKey, serviceSchemaKey, spaceSchemaKey, - serviceBindingNoBindingsSchemaKey, } from '../helpers/entity-factory'; -import { - createEntityRelationKey, - EntityInlineChildAction, - EntityInlineParentAction, -} from '../helpers/entity-relations/entity-relations.types'; +import { createEntityRelationKey, EntityInlineParentAction } from '../helpers/entity-relations/entity-relations.types'; import { PaginationAction } from '../types/pagination.types'; import { CFStartAction, ICFAction } from '../types/request.types'; import { getActions } from './action.helper'; @@ -82,9 +78,10 @@ export class DeleteServiceInstance extends CFStartAction implements ICFAction { constructor(public endpointGuid: string, public guid: string) { super(); this.options = new RequestOptions(); - this.options.url = `service_instances/${guid}?accepts_incomplete=true`; + this.options.url = `service_instances/${guid}`; this.options.method = 'delete'; this.options.params = new URLSearchParams(); + this.options.params.set('accepts_incomplete', 'true'); this.options.params.set('async', 'false'); this.options.params.set('recursive', 'true'); this.options.headers = new Headers(); @@ -107,7 +104,9 @@ export class CreateServiceInstance extends CFStartAction implements ICFAction { ) { super(); this.options = new RequestOptions(); - this.options.url = `service_instances?accepts_incomplete=true`; + this.options.url = `service_instances`; + this.options.params = new URLSearchParams(); + this.options.params.set('accepts_incomplete', 'true'); this.options.method = 'post'; this.options.body = { name: name, @@ -136,7 +135,9 @@ export class UpdateServiceInstance extends CreateServiceInstance { ) { super(endpointGuid, guid, name, servicePlanGuid, spaceGuid, params, tags); this.options.method = 'put'; - this.options.url = `service_instances/${this.guid}?accepts_incomplete=true`; + this.options.url = `${this.options.url}/${this.guid}`; + this.options.params = new URLSearchParams(); + this.options.params.set('accepts_incomplete', 'true'); this.actions = getActions('Service Instances', 'Update Service Instance'); } updatingKey = UpdateServiceInstance.updateServiceInstance;