Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Jun 18, 2020
1 parent 3058d8a commit a728c34
Show file tree
Hide file tree
Showing 72 changed files with 897 additions and 733 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HttpParams, HttpRequest } from '@angular/common/http';

import { endpointSchemaKey } from '../../../store/src/helpers/entity-factory';
import { endpointSchemaKey } from '../../../store/src/helpers/stratos-entity-factory';
import { PaginatedAction } from '../../../store/src/types/pagination.types';
import { cfEntityFactory } from '../cf-entity-factory';
import { cfEventEntityType } from '../cf-entity-types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { endpointSchemaKey } from '../../../store/src/helpers/entity-factory';
import { HttpRequest } from '@angular/common/http';

import { endpointSchemaKey } from '../../../store/src/helpers/stratos-entity-factory';
import { PaginatedAction } from '../../../store/src/types/pagination.types';
import { ICFAction } from '../../../store/src/types/request.types';
import { cfEntityFactory } from '../cf-entity-factory';
import { domainEntityType } from '../cf-entity-types';
import { createEntityRelationPaginationKey } from '../entity-relations/entity-relations.types';
import { CFStartAction } from './cf-action.types';
import { HttpRequest } from '@angular/common/http';

export const GET_DOMAIN = '[domain] Get domain ';
export const GET_DOMAIN_SUCCESS = '[domain] Get domain success';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HttpRequest } from '@angular/common/http';

import { getActions } from '../../../store/src/actions/action.helper';
import { endpointSchemaKey } from '../../../store/src/helpers/entity-factory';
import { endpointSchemaKey } from '../../../store/src/helpers/stratos-entity-factory';
import { PaginatedAction } from '../../../store/src/types/pagination.types';
import { RequestEntityLocation } from '../../../store/src/types/request.types';
import { cfEntityFactory } from '../cf-entity-factory';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { HttpRequest } from '@angular/common/http';

import { getActions } from '../../../store/src/actions/action.helper';
import { entityCatalog } from '../../../store/src/entity-catalog/entity-catalog';
import { endpointSchemaKey } from '../../../store/src/helpers/entity-factory';
import { endpointSchemaKey } from '../../../store/src/helpers/stratos-entity-factory';
import { PaginatedAction } from '../../../store/src/types/pagination.types';
import { ICFAction } from '../../../store/src/types/request.types';
import { stackEntityType } from '../cf-entity-types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { HttpRequest } from '@angular/common/http';

import { getActions } from '../../../store/src/actions/action.helper';
import { EntityCatalogEntityConfig } from '../../../store/src/entity-catalog/entity-catalog.types';
import { endpointSchemaKey } from '../../../store/src/helpers/entity-factory';
import { endpointSchemaKey } from '../../../store/src/helpers/stratos-entity-factory';
import { PaginatedAction } from '../../../store/src/types/pagination.types';
import { ICFAction } from '../../../store/src/types/request.types';
import { cfEntityFactory } from '../cf-entity-factory';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { HttpRequest } from '@angular/common/http';

import { getActions } from '../../../store/src/actions/action.helper';
import { endpointSchemaKey } from '../../../store/src/helpers/entity-factory';
import { EntitySchema } from '../../../store/src/helpers/entity-schema';
import { endpointSchemaKey } from '../../../store/src/helpers/stratos-entity-factory';
import { PaginatedAction } from '../../../store/src/types/pagination.types';
import { EntityRequestAction } from '../../../store/src/types/request.types';
import { cfEntityFactory } from '../cf-entity-factory';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { NgModule } from '@angular/core';
import { EffectsModule } from '@ngrx/effects';

import { generateASEntities } from '../../cf-autoscaler/src/store/autoscaler-entity-generator';
import { generateStratosEntities } from '../../core/src/base-entity-types';
import { getGitHubAPIURL, GITHUB_API_URL } from '../../core/src/core/github.helpers';
import { LoggerService } from '../../core/src/core/logger.service';
import { generateStratosEntities } from '../../core/src/stratos-entity-generator';
import { CATALOGUE_ENTITIES, EntityCatalogFeatureModule } from '../../store/src/entity-catalog.module';
import { entityCatalog, TestEntityCatalog } from '../../store/src/entity-catalog/entity-catalog';
import { testSCFEndpointGuid } from '../../store/testing/public-api';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { CurrentUserPermissionsService } from '../../../../../../core/src/core/permissions/current-user-permissions.service';
import { RowState } from '../../../../../../core/src/shared/components/list/data-sources-controllers/list-data-source-types';
import { ListViewTypes } from '../../../../../../core/src/shared/components/list/list.component.types';
import { endpointSchemaKey } from '../../../../../../store/src/helpers/entity-factory';
import { endpointSchemaKey } from '../../../../../../store/src/helpers/stratos-entity-factory';
import { PaginationMonitorFactory } from '../../../../../../store/src/monitors/pagination-monitor.factory';
import { APIResource } from '../../../../../../store/src/types/api.types';
import { IServiceBinding } from '../../../../cf-api-svc.types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import { Component, OnInit } from '@angular/core';
import { BehaviorSubject, combineLatest, Observable } from 'rxjs';
import { filter, first, map } from 'rxjs/operators';

import { EntityService } from '../../../../../store/src/entity-service';
import { EntityServiceFactory } from '../../../../../store/src/entity-service-factory.service';
import { getFullEndpointApiUrl } from '../../../../../core/src/features/endpoints/endpoint-helpers';
import { IHeaderBreadcrumb } from '../../../../../core/src/shared/components/page-header/page-header.types';
import { GetAllEndpoints } from '../../../../../store/src/actions/endpoint.actions';
import { EntityService } from '../../../../../store/src/entity-service';
import { stratosEntityCatalog } from '../../../../../store/src/stratos-entity-catalog';
import { EndpointModel } from '../../../../../store/src/types/endpoint.types';
import { CFAppCLIInfoContext } from '../../../shared/components/cli-info/cli-info.component';
import { ApplicationService } from '../application.service';
Expand All @@ -29,7 +28,7 @@ export class CliInfoApplicationComponent implements OnInit {

constructor(
private applicationService: ApplicationService,
private entityServiceFactory: EntityServiceFactory
// private entityServiceFactory: EntityServiceFactory // TODO: RC Search fo
) {
this.breadcrumbs$ = new BehaviorSubject<IHeaderBreadcrumb[]>([]);
}
Expand All @@ -41,10 +40,13 @@ export class CliInfoApplicationComponent implements OnInit {
}

private setupObservables(cfGuid: string) {
this.cfEndpointEntityService = this.entityServiceFactory.create<EndpointModel>(
cfGuid,
new GetAllEndpoints()
);
this.cfEndpointEntityService = stratosEntityCatalog.endpoint.store.getEntityService(cfGuid);

// TODO: RC EXAMPLE
// this.cfEndpointEntityService = this.entityServiceFactory.create<EndpointModel>(
// cfGuid,
// new GetAllEndpoints() // TODO: RC single/multi actions?
// );

this.context$ = combineLatest(
this.applicationService.application$,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { selectCfRequestInfo } from '../../../../../../cloud-foundry/src/store/selectors/api.selectors';
import { StepOnNextFunction } from '../../../../../../core/src/shared/components/stepper/step/step.component';
import { entityCatalog } from '../../../../../../store/src/entity-catalog/entity-catalog';
import { endpointSchemaKey } from '../../../../../../store/src/helpers/entity-factory';
import { endpointSchemaKey } from '../../../../../../store/src/helpers/stratos-entity-factory';
import { PaginationMonitorFactory } from '../../../../../../store/src/monitors/pagination-monitor.factory';
import { getPaginationObservables } from '../../../../../../store/src/reducers/pagination-reducer/pagination-reducer.helper';
import { APIResource } from '../../../../../../store/src/types/api.types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '../../../../../../cloud-foundry/src/entity-relations/entity-relations.types';
import { safeUnsubscribe } from '../../../../../../core/src/core/utils.service';
import { StepOnNextFunction } from '../../../../../../core/src/shared/components/stepper/step/step.component';
import { endpointSchemaKey } from '../../../../../../store/src/helpers/entity-factory';
import { endpointSchemaKey } from '../../../../../../store/src/helpers/stratos-entity-factory';
import { PaginationMonitorFactory } from '../../../../../../store/src/monitors/pagination-monitor.factory';
import { ActionState } from '../../../../../../store/src/reducers/api-request-reducer/types';
import { getPaginationObservables } from '../../../../../../store/src/reducers/pagination-reducer/pagination-reducer.helper';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { createEntityRelationPaginationKey } from '../../../../../cloud-foundry/
import { ActiveRouteCfOrgSpace } from '../../../../../cloud-foundry/src/features/cloud-foundry/cf-page.types';
import { getActiveRouteCfOrgSpaceProvider } from '../../../../../cloud-foundry/src/features/cloud-foundry/cf.helpers';
import { safeUnsubscribe } from '../../../../../core/src/core/utils.service';
import { endpointSchemaKey } from '../../../../../store/src/helpers/entity-factory';
import { endpointSchemaKey } from '../../../../../store/src/helpers/stratos-entity-factory';
import { IQuotaDefinition } from '../../../cf-api.types';

export interface QuotaFormValues {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ import {
createEntityRelationPaginationKey,
} from '../../../../../cloud-foundry/src/entity-relations/entity-relations.types';
import { CfApplicationState } from '../../../../../cloud-foundry/src/store/types/application.types';
import { GetAllEndpoints } from '../../../../../store/src/actions/endpoint.actions';
import { EntityService } from '../../../../../store/src/entity-service';
import { EntityServiceFactory } from '../../../../../store/src/entity-service-factory.service';
import { endpointSchemaKey } from '../../../../../store/src/helpers/entity-factory';
import { endpointSchemaKey } from '../../../../../store/src/helpers/stratos-entity-factory';
import { PaginationMonitorFactory } from '../../../../../store/src/monitors/pagination-monitor.factory';
import { getPaginationObservables } from '../../../../../store/src/reducers/pagination-reducer/pagination-reducer.helper';
import { PaginationObservables } from '../../../../../store/src/reducers/pagination-reducer/pagination-reducer.types';
import { stratosEntityCatalog } from '../../../../../store/src/stratos-entity-catalog';
import { APIResource, EntityInfo } from '../../../../../store/src/types/api.types';
import { EndpointModel, EndpointUser } from '../../../../../store/src/types/endpoint.types';
import { PaginatedAction } from '../../../../../store/src/types/pagination.types';
Expand Down Expand Up @@ -138,16 +137,12 @@ export class CloudFoundryEndpointService {
constructor(
public activeRouteCfOrgSpace: ActiveRouteCfOrgSpace,
private store: Store<CFAppState>,
private entityServiceFactory: EntityServiceFactory,
private cfUserService: CfUserService,
private pmf: PaginationMonitorFactory,
) {
this.cfGuid = activeRouteCfOrgSpace.cfGuid;

this.cfEndpointEntityService = this.entityServiceFactory.create(
this.cfGuid,
new GetAllEndpoints()
);
this.cfEndpointEntityService = stratosEntityCatalog.endpoint.store.getEntityService(this.cfGuid);

this.cfInfoEntityService = cfEntityCatalog.cfInfo.store.getEntityService(this.cfGuid)
this.constructCoreObservables();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { createEntityRelationPaginationKey } from '../../../../../cloud-foundry/
import { ActiveRouteCfOrgSpace } from '../../../../../cloud-foundry/src/features/cloud-foundry/cf-page.types';
import { getActiveRouteCfOrgSpaceProvider } from '../../../../../cloud-foundry/src/features/cloud-foundry/cf.helpers';
import { safeUnsubscribe } from '../../../../../core/src/core/utils.service';
import { endpointSchemaKey } from '../../../../../store/src/helpers/entity-factory';
import { endpointSchemaKey } from '../../../../../store/src/helpers/stratos-entity-factory';
import { IQuotaDefinition } from '../../../cf-api.types';


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CurrentUserPermissionsService } from '../../../../../core/src/core/perm
import { environment } from '../../../../../core/src/environments/environment.prod';
import { ConfirmationDialogConfig } from '../../../../../core/src/shared/components/confirmation-dialog.config';
import { ConfirmationDialogService } from '../../../../../core/src/shared/components/confirmation-dialog.service';
import { GetSystemInfo } from '../../../../../store/src/actions/system.actions';
import { stratosEntityCatalog } from '../../../../../store/src/stratos-entity-catalog';
import { CfCurrentUserPermissions } from '../../../user-permissions/cf-user-permissions-checkers';
import { ActiveRouteCfOrgSpace } from '../cf-page.types';
import { waitForCFPermissions } from '../cf.helpers';
Expand Down Expand Up @@ -57,7 +57,6 @@ interface UserInviteSend {
export class UserInviteConfigureService {

constructor(
private store: Store<CFAppState>,
private http: HttpClient,
private snackBar: MatSnackBar,
private confirmDialog: ConfirmationDialogService,
Expand All @@ -70,7 +69,7 @@ export class UserInviteConfigureService {
const url = `/pp/${proxyAPIVersion}/invite/${cfGUID}`;
const obs$ = this.http.post(url, formData).pipe(
map(v => {
this.store.dispatch(new GetSystemInfo());
stratosEntityCatalog.systemInfo.api.getSystemInfo()
return {
error: false
};
Expand Down Expand Up @@ -99,7 +98,7 @@ export class UserInviteConfigureService {
const url = `/pp/${proxyAPIVersion}/invite/${cfGUID}`;
this.http.delete(url).pipe(
map(v => {
this.store.dispatch(new GetSystemInfo());
stratosEntityCatalog.systemInfo.api.getSystemInfo()
return {
error: false,
errorMessage: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
createEntityRelationPaginationKey,
} from '../../../../../../cloud-foundry/src/entity-relations/entity-relations.types';
import { CurrentUserPermissionsService } from '../../../../../../core/src/core/permissions/current-user-permissions.service';
import { endpointSchemaKey } from '../../../../../../store/src/helpers/entity-factory';
import { endpointSchemaKey } from '../../../../../../store/src/helpers/stratos-entity-factory';
import { APIResource, EntityInfo } from '../../../../../../store/src/types/api.types';
import { UsersRolesSetChanges } from '../../../../actions/users-roles.actions';
import { IOrganization, ISpace } from '../../../../cf-api.types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Observable } from 'rxjs';
import { filter, map, publishReplay, refCount } from 'rxjs/operators';

import { serviceEntityType } from '../../../../../cloud-foundry/src/cf-entity-types';
import { endpointSchemaKey } from '../../../../../store/src/helpers/entity-factory';
import { endpointSchemaKey } from '../../../../../store/src/helpers/stratos-entity-factory';
import { APIResource } from '../../../../../store/src/types/api.types';
import { IService } from '../../../cf-api-svc.types';
import { cfEntityCatalog } from '../../../cf-entity-catalog';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Component, Input, OnDestroy } from '@angular/core';
import { Observable, Subscription } from 'rxjs';
import { filter, map, tap } from 'rxjs/operators';

import { EntityService } from '../../../../../../../../store/src/entity-service';
import { TableCellCustom } from '../../../../../../../../core/src/shared/components/list/list.types';
import { EntityService } from '../../../../../../../../store/src/entity-service';
import { IMetricMatrixResult, IMetrics } from '../../../../../../../../store/src/types/base-metric.types';
import { IMetricCell } from '../../../../../../../../store/src/types/metric.types';
import { ListAppInstance } from '../app-instance-types';
Expand All @@ -21,7 +21,7 @@ export class TableCellCfCellComponent extends TableCellCustom<ListAppInstance> i

@Input('config')
set config(config: {
metricEntityService: EntityService<IMetrics<IMetricMatrixResult<IMetricCell>>>
metricEntityService: EntityService<IMetrics<IMetricMatrixResult<IMetricCell>>> // TODO: RC search for metricEntityService
cfGuid: string
}) {
if (!config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
ListDataSource,
} from '../../../../../../../core/src/shared/components/list/data-sources-controllers/list-data-source';
import { IListConfig } from '../../../../../../../core/src/shared/components/list/list.component.types';
import { endpointSchemaKey } from '../../../../../../../store/src/helpers/entity-factory';
import { endpointSchemaKey } from '../../../../../../../store/src/helpers/stratos-entity-factory';
import { getRowMetadata } from '../../../../../../../store/src/public-api';
import { APIResource } from '../../../../../../../store/src/types/api.types';
import { cfEntityCatalog } from '../../../../../cf-entity-catalog';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { IListConfig } from '../../../../../../../core/src/shared/components/lis
import { EntityMonitorFactory } from '../../../../../../../store/src/monitors/entity-monitor.factory.service';
import { InternalEventMonitorFactory } from '../../../../../../../store/src/monitors/internal-event-monitor.factory';
import { PaginationMonitorFactory } from '../../../../../../../store/src/monitors/pagination-monitor.factory';
import { GetAllEndpoints } from '../../../../../../../store/src/actions/endpoint.actions';
import { stratosEntityCatalog } from '../../../../../../../store/src/stratos-entity-catalog';
import { EndpointModel } from '../../../../../../../store/src/types/endpoint.types';

export class CFEndpointsDataSource extends BaseEndpointsDataSource {
Expand All @@ -22,7 +22,7 @@ export class CFEndpointsDataSource extends BaseEndpointsDataSource {
entityMonitorFactory: EntityMonitorFactory,
internalEventMonitorFactory: InternalEventMonitorFactory
) {
const action = new GetAllEndpoints();
const action = stratosEntityCatalog.endpoint.actions.getAll();
const paginationKey = 'cf-endpoints';
// We do this here to ensure we sync up with main endpoint table data.
syncPaginationSection(store, action, paginationKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import {
getDefaultRowState,
} from '../../../../../../../core/src/shared/components/list/data-sources-controllers/list-data-source-types';
import { IListConfig } from '../../../../../../../core/src/shared/components/list/list.component.types';
import { endpointSchemaKey } from '../../../../../../../store/src/helpers/entity-factory';
import { EntityMonitor } from '../../../../../../../store/src/monitors/entity-monitor';
import { endpointSchemaKey } from '../../../../../../../store/src/helpers/stratos-entity-factory';
import { APIResource } from '../../../../../../../store/src/types/api.types';
import { CFAppState } from '../../../../../cf-app-state';
import { cfEntityCatalog } from '../../../../../cf-entity-catalog';
import { cfEntityFactory } from '../../../../../cf-entity-factory';
import { quotaDefinitionEntityType } from '../../../../../cf-entity-types';
import { createEntityRelationPaginationKey } from '../../../../../entity-relations/entity-relations.types';
Expand Down Expand Up @@ -44,8 +44,8 @@ export class CfQuotasDataSourceService extends ListDataSource<APIResource> {
if (!this.sourceScheme || !row) {
return of(getDefaultRowState());
}
const entityMonitor = new EntityMonitor(this.store, this.getRowUniqueId(row), this.entityKey, this.sourceScheme);
return entityMonitor.entityRequest$.pipe(
// TODO: RC test
return cfEntityCatalog.quotaDefinition.store.getEntityMonitor(this.getRowUniqueId(row)).entityRequest$.pipe(
distinctUntilChanged(),
map(requestInfo => ({
deleting: requestInfo.deleting.busy,
Expand Down
Loading

0 comments on commit a728c34

Please sign in to comment.