Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scalability: Convert space apps list from local to remote #2913

Merged
merged 3 commits into from
Sep 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Component, OnInit } from '@angular/core';
/* tslint:disable:max-line-length */
import { CfSpaceAppsListConfigService } from '../../../../../../../shared/components/list/list-types/cf-space-apps/cf-space-apps-list-config.service';
/* tslint:enable:max-line-length */
import { Component } from '@angular/core';

import {
CfSpaceAppsListConfigService,
} from '../../../../../../../shared/components/list/list-types/cf-space-apps/cf-space-apps-list-config.service';
import { ListConfig } from '../../../../../../../shared/components/list/list.component.types';

@Component({
selector: 'app-cloud-foundry-space-apps',
templateUrl: './cloud-foundry-space-apps.component.html',
Expand All @@ -15,11 +16,4 @@ import { ListConfig } from '../../../../../../../shared/components/list/list.com
}
]
})
export class CloudFoundrySpaceAppsComponent implements OnInit {

constructor() { }

ngOnInit() {
}

}
export class CloudFoundrySpaceAppsComponent { }
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import { IListConfig } from '../../list.component.types';

export class CfSpaceAppsDataSource extends ListDataSource<APIResource> {
constructor(store: Store<AppState>, cfSpaceService: CloudFoundrySpaceService, listConfig?: IListConfig<APIResource>) {
const paginationKey = createEntityRelationPaginationKey(spaceSchemaKey, cfSpaceService.spaceGuid);
const action = new GetAllAppsInSpace(cfSpaceService.cfGuid, cfSpaceService.spaceGuid, paginationKey);
const paginationKey = createEntityRelationPaginationKey(spaceSchemaKey, cfSpaceService.spaceGuid) + '-tab';
const action = new GetAllAppsInSpace(cfSpaceService.cfGuid, cfSpaceService.spaceGuid, paginationKey, [], false, false);
super({
store,
action,
schema: entityFactory(applicationSchemaKey),
getRowUniqueId: getRowMetadata,
paginationKey,
isLocal: true,
isLocal: false,
transformEntities: [],
listConfig
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import { DatePipe } from '@angular/common';
import { Injectable } from '@angular/core';
import { Store } from '@ngrx/store';

import { IApp } from '../../../../../core/cf-api.types';
import { CloudFoundrySpaceService } from '../../../../../features/cloud-foundry/services/cloud-foundry-space.service';
import { ListView } from '../../../../../store/actions/list.actions';
import { AppState } from '../../../../../store/app-state';
import { APIResource } from '../../../../../store/types/api.types';
import { IListConfig, ListViewTypes } from '../../list.component.types';
import { CfSpaceAppsDataSource } from './cf-space-apps-data-source.service';
import { ITableColumn } from '../../list-table/table.types';
import { defaultPaginationPageSizeOptionsTable, IListConfig, ListViewTypes } from '../../list.component.types';
import { TableCellAppNameComponent } from '../app/table-cell-app-name/table-cell-app-name.component';
import { TableCellAppStatusComponent } from '../app/table-cell-app-status/table-cell-app-status.component';
import { DatePipe } from '@angular/common';
import { TableCellAppInstancesComponent } from '../app/table-cell-app-instances/table-cell-app-instances.component';
import { CloudFoundrySpaceService } from '../../../../../features/cloud-foundry/services/cloud-foundry-space.service';
import { IApp } from '../../../../../core/cf-api.types';
import { CfSpaceAppsDataSource } from './cf-space-apps-data-source.service';

@Injectable()
export class CfSpaceAppsListConfigService implements IListConfig<APIResource> {
isLocal?: boolean;
isLocal = false;
viewType = ListViewTypes.TABLE_ONLY;
enableTextFilter = false;
dataSource: CfSpaceAppsDataSource;
Expand All @@ -25,6 +24,7 @@ export class CfSpaceAppsListConfigService implements IListConfig<APIResource> {
title: null,
noEntries: 'There are no applications'
};
pageSizeOptions = defaultPaginationPageSizeOptionsTable;

getColumns = (): ITableColumn<APIResource<IApp>>[] => [
{
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/app/store/actions/space.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ export class GetAllAppsInSpace extends CFStartAction implements PaginatedAction,
public spaceGuid: string,
public paginationKey: string,
public includeRelations = [],
public populateMissing = true
public populateMissing = true,
public flattenPagination = true
) {
super();
this.options = new RequestOptions();
Expand All @@ -145,7 +146,6 @@ export class GetAllAppsInSpace extends CFStartAction implements PaginatedAction,
};
parentGuid: string;
parentEntitySchema = entityFactory(spaceSchemaKey);
flattenPagination = true;
}

export abstract class BaseSpaceAction extends CFStartAction implements ICFAction {
Expand Down