Skip to content

Commit

Permalink
Merge pull request #4371 from cloudfoundry/move-base-entity
Browse files Browse the repository at this point in the history
Move base-entity-* to store package
  • Loading branch information
richard-cox authored Jun 18, 2020
2 parents 3058d8a + 5da1c51 commit a2fe03c
Show file tree
Hide file tree
Showing 44 changed files with 76 additions and 76 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Schema, schema } from 'normalizr';

import { getAPIResourceGuid } from '../../../cloud-foundry/src/store/selectors/api.selectors';
import { metricEntityType } from '../../../core/src/base-entity-schemas';
import { metricEntityType } from '../../../store/src/base-entity-schemas';
import { EntitySchema } from '../../../store/src/helpers/entity-schema';

export const appAutoscalerInfoEntityType = 'autoscalerInfo';
Expand All @@ -10,7 +10,7 @@ export const appAutoscalerPolicyEntityType = 'autoscalerPolicy';
export const appAutoscalerPolicyTriggerEntityType = 'autoscalerPolicyTrigger';
export const appAutoscalerScalingHistoryEntityType = 'autoscalerScalingHistory';
export const appAutoscalerAppMetricEntityType = 'autoscalerAppMetric';
export const appAutoscalerCredentialEntityType = 'autoscalerCredential'
export const appAutoscalerCredentialEntityType = 'autoscalerCredential';

export const AUTOSCALER_ENDPOINT_TYPE = 'autoscaler';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IOrgFavMetadata } from '../../../cloud-foundry/src/cf-metadata-types';
import { metricEntityType } from '../../../core/src/base-entity-schemas';
import { metricEntityType } from '../../../store/src/base-entity-schemas';
import {
StratosBaseCatalogEntity,
StratosCatalogEntity,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { metricEntityType } from '../../core/src/base-entity-schemas';
import { metricEntityType } from '../../store/src/base-entity-schemas';
import { EntitySchema } from '../../store/src/helpers/entity-schema';
import { APIResource } from '../../store/src/types/api.types';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { combineLatest, Observable, of } from 'rxjs';
import { first, map } from 'rxjs/operators';

import { EndpointHealthCheck } from '../../core/endpoints-health-checks';
import { metricEntityType } from '../../core/src/base-entity-schemas';
import { urlValidationExpression } from '../../core/src/core/utils.service';
import { BaseEndpointAuth } from '../../core/src/features/endpoints/endpoint-auth';
import { AppState, GeneralEntityAppState } from '../../store/src/app-state';
import { metricEntityType } from '../../store/src/base-entity-schemas';
import {
StratosBaseCatalogEntity,
StratosCatalogEndpointEntity,
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 '../../store/src/base-entity-types';
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 @@ -3,8 +3,8 @@ import { ActivatedRoute } from '@angular/router';
import { Store } from '@ngrx/store';
import { testSCFEndpoint, testSCFEndpointGuid } from '@stratosui/store/testing';

import { endpointEntitySchema } from '../../../../../core/src/base-entity-schemas';
import { TabNavService } from '../../../../../core/tab-nav.service';
import { endpointEntitySchema } from '../../../../../store/src/base-entity-schemas';
import { EntityCatalogHelpers } from '../../../../../store/src/entity-catalog/entity-catalog.helper';
import { EntityCatalogEntityConfig } from '../../../../../store/src/entity-catalog/entity-catalog.types';
import { NormalizedResponse } from '../../../../../store/src/types/api.types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Component } from '@angular/core';
import { Observable } from 'rxjs';
import { first, map } from 'rxjs/operators';

import { metricEntityType } from '../../../../../../../../core/src/base-entity-schemas';
import { IPageSideNavTab } from '../../../../../../../../core/src/features/dashboard/page-side-nav/page-side-nav.component';
import { IHeaderBreadcrumb } from '../../../../../../../../core/src/shared/components/page-header/page-header.types';
import { metricEntityType } from '../../../../../../../../store/src/base-entity-schemas';
import { cfEntityFactory } from '../../../../../../cf-entity-factory';
import { getActiveRouteCfCellProvider } from '../../../../cf.helpers';
import { CloudFoundryEndpointService } from '../../../../services/cloud-foundry-endpoint.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';

import { CFAppState } from '../../../../cloud-foundry/src/cf-app-state';
import { endpointEntitySchema } from '../../../../core/src/base-entity-schemas';
import { endpointEntitySchema } from '../../../../store/src/base-entity-schemas';
import { PaginationMonitor } from '../../../../store/src/monitors/pagination-monitor';
import { APIResource, EntityInfo } from '../../../../store/src/types/api.types';
import { endpointListKey, EndpointModel } from '../../../../store/src/types/endpoint.types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Store } from '@ngrx/store';
import { combineLatest, Observable } from 'rxjs';
import { filter, first, map } from 'rxjs/operators';

import { STRATOS_ENDPOINT_TYPE } from '../../../../core/src/base-entity-schemas';
import { STRATOS_ENDPOINT_TYPE } from '../../../../store/src/base-entity-schemas';
import { entityCatalog } from '../../../../store/src/entity-catalog/entity-catalog';
import { endpointSchemaKey } from '../../../../store/src/helpers/entity-factory';
import { selectEntity } from '../../../../store/src/selectors/api.selectors';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import {
CfPermissionTypes,
CfScopeStrings,
} from '../../../../cloud-foundry/src/user-permissions/cf-user-permissions-checkers';
import { endpointEntitySchema } from '../../../../core/src/base-entity-schemas';
import { generateStratosEntities } from '../../../../core/src/base-entity-types';
import { PermissionConfig } from '../../../../core/src/core/permissions/current-user-permissions.config';
import { CurrentUserPermissionsService } from '../../../../core/src/core/permissions/current-user-permissions.service';
import { StratosScopeStrings } from '../../../../core/src/core/permissions/stratos-user-permissions.checker';
import { AppTestModule } from '../../../../core/test-framework/core-test.helper';
import { AppState } from '../../../../store/src/app-state';
import { endpointEntitySchema } from '../../../../store/src/base-entity-schemas';
import { generateStratosEntities } from '../../../../store/src/base-entity-types';
import { EntityCatalogTestModule, TEST_CATALOGUE_ENTITIES } from '../../../../store/src/entity-catalog-test.module';
import { EntityCatalogEntityConfig } from '../../../../store/src/entity-catalog/entity-catalog.types';
import { APIResource } from '../../../../store/src/types/api.types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BaseTestModules } from '../../core/test-framework/core-test.helper';
import { generateStratosEntities } from '../../store/src/base-entity-types';
import { EntityCatalogTestModule, TEST_CATALOGUE_ENTITIES } from '../../store/src/entity-catalog-test.module';
import { generateCFEntities } from '../src/cf-entity-generator';
import { generateStratosEntities } from '../../core/src/base-entity-types';

export const CFBaseTestModules = [
...BaseTestModules,
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/packages/core/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {
UpdateUserFavoriteMetadataAction,
} from '../../store/src/actions/user-favourites-actions/update-user-favorite-metadata-action';
import { GeneralEntityAppState, GeneralRequestDataState } from '../../store/src/app-state';
import { STRATOS_ENDPOINT_TYPE } from '../../store/src/base-entity-schemas';
import { generateStratosEntities } from '../../store/src/base-entity-types';
import { EntityCatalogModule } from '../../store/src/entity-catalog.module';
import { entityCatalog } from '../../store/src/entity-catalog/entity-catalog';
import { EntityCatalogHelper } from '../../store/src/entity-catalog/entity-catalog-entity/entity-catalog.service';
Expand All @@ -28,8 +30,6 @@ import { TabNavService } from '../tab-nav.service';
import { XSRFModule } from '../xsrf.module';
import { AppComponent } from './app.component';
import { RouteModule } from './app.routing';
import { STRATOS_ENDPOINT_TYPE } from './base-entity-schemas';
import { generateStratosEntities } from './base-entity-types';
import { CoreModule } from './core/core.module';
import { CustomizationService } from './core/customizations.types';
import { DynamicExtensionRoutes } from './core/extension/dynamic-extension-routes';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { createBasicStoreModule, createEntityStoreState, TestStoreEntity } from
import { first, tap } from 'rxjs/operators';

import { AppState } from '../../../../store/src/app-state';
import { endpointEntitySchema } from '../../../../store/src/base-entity-schemas';
import { generateStratosEntities } from '../../../../store/src/base-entity-types';
import { EntityCatalogTestModule, TEST_CATALOGUE_ENTITIES } from '../../../../store/src/entity-catalog-test.module';
import { EntityCatalogEntityConfig } from '../../../../store/src/entity-catalog/entity-catalog.types';
import { EndpointModel } from '../../../../store/src/types/endpoint.types';
import { BaseEntityValues } from '../../../../store/src/types/entity.types';
import { PaginationState } from '../../../../store/src/types/pagination.types';
import { AppTestModule } from '../../../test-framework/core-test.helper';
import { endpointEntitySchema } from '../../base-entity-schemas';
import { generateStratosEntities } from '../../base-entity-types';
import { PermissionConfig } from './current-user-permissions.config';
import { CurrentUserPermissionsService } from './current-user-permissions.service';
import { StratosPermissionStrings, StratosPermissionTypes, StratosScopeStrings } from './stratos-user-permissions.checker';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { combineLatest, Observable, of } from 'rxjs';
import { distinctUntilChanged, map, switchMap } from 'rxjs/operators';

import { InternalAppState } from '../../../../store/src/app-state';
import { ENDPOINT_TYPE, STRATOS_ENDPOINT_TYPE } from '../../../../store/src/base-entity-schemas';
import { entityCatalog } from '../../../../store/src/entity-catalog/entity-catalog';
import { selectEntity } from '../../../../store/src/selectors/api.selectors';
import { EndpointModel } from '../../../../store/src/types/endpoint.types';
import { ENDPOINT_TYPE, STRATOS_ENDPOINT_TYPE } from '../../base-entity-schemas';
import { LoggerService } from '../logger.service';
import {
CurrentUserPermissions,
Expand All @@ -23,7 +23,7 @@ import {
import { StratosUserPermissionsChecker } from './stratos-user-permissions.checker';


export const CUSTOM_USER_PERMISSION_CHECKERS = 'custom_user_perm_checkers'
export const CUSTOM_USER_PERMISSION_CHECKERS = 'custom_user_perm_checkers';

@Injectable()
export class CurrentUserPermissionsService {
Expand All @@ -38,7 +38,7 @@ export class CurrentUserPermissionsService {
this.allCheckers = [
new StratosUserPermissionsChecker(store),
...nullSafeCustomCheckers
]
];
}
/**
* @param action The action we're going to check the user's access to.
Expand All @@ -56,13 +56,13 @@ export class CurrentUserPermissionsService {
): Observable<boolean> {
let actionConfig;
if (typeof action === 'string') {
let permConfigType = this.getPermissionConfig(action);
const permConfigType = this.getPermissionConfig(action);
if (!permConfigType) {
return of(false); // Logging handled in getPermissionConfig
}
actionConfig = this.getConfig(permConfigType);
} else {
actionConfig = this.getConfig(action)
actionConfig = this.getConfig(action);
}
const obs$ = this.getCanObservable(actionConfig, endpointGuid, ...args);
return obs$ ?
Expand Down Expand Up @@ -96,7 +96,7 @@ export class CurrentUserPermissionsService {
'permissions check',
actionConfig.type,
of(false)
)
);
}

private getComplexPermission(permissionConfig: PermissionConfig[], endpointGuid?: string, ...args: any[]) {
Expand All @@ -116,7 +116,7 @@ export class CurrentUserPermissionsService {
[{
checks: [of(false)]
}]
)
);
}

private getConfig(config: PermissionConfigType, tries = 0): PermissionConfig[] | PermissionConfig {
Expand Down Expand Up @@ -152,7 +152,7 @@ export class CurrentUserPermissionsService {
'fallback permission',
'N/A',
of(null)
)
);
}

private getPermissionConfig(key: CurrentUserPermissions): PermissionConfigType {
Expand All @@ -161,7 +161,7 @@ export class CurrentUserPermissionsService {
'permissions checker',
key,
null
)
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
UpdateUserProfileAction,
} from '../../../store/src/actions/user-profile.actions';
import { AppState } from '../../../store/src/app-state';
import { userProfileEntitySchema } from '../../../store/src/base-entity-schemas';
import { userProfilePasswordUpdatingKey } from '../../../store/src/effects/user-profile.effects';
import { entityCatalog } from '../../../store/src/entity-catalog/entity-catalog';
import { EntityService } from '../../../store/src/entity-service';
Expand All @@ -18,7 +19,6 @@ import { AuthState } from '../../../store/src/reducers/auth.reducer';
import { selectRequestInfo, selectUpdateInfo } from '../../../store/src/selectors/api.selectors';
import { SessionData } from '../../../store/src/types/auth.types';
import { UserProfileInfo, UserProfileInfoEmail, UserProfileInfoUpdates } from '../../../store/src/types/user-profile.types';
import { userProfileEntitySchema } from '../base-entity-schemas';


@Injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import {
import { AuthParams, ConnectEndpoint } from '../../../../store/src/actions/endpoint.actions';
import { GetSystemInfo } from '../../../../store/src/actions/system.actions';
import { EndpointOnlyAppState } from '../../../../store/src/app-state';
import { STRATOS_ENDPOINT_TYPE } from '../../../../store/src/base-entity-schemas';
import { EndpointsEffect } from '../../../../store/src/effects/endpoint.effects';
import { SystemEffects } from '../../../../store/src/effects/system.effects';
import { entityCatalog } from '../../../../store/src/entity-catalog/entity-catalog';
import { endpointSchemaKey } from '../../../../store/src/helpers/entity-factory';
import { ActionState } from '../../../../store/src/reducers/api-request-reducer/types';
import { selectEntity, selectRequestInfo, selectUpdateInfo } from '../../../../store/src/selectors/api.selectors';
import { EndpointModel } from '../../../../store/src/types/endpoint.types';
import { STRATOS_ENDPOINT_TYPE } from '../../base-entity-schemas';
import { EndpointsService } from '../../core/endpoints.service';
import { EndpointType } from '../../core/extension/extension-types';
import { safeUnsubscribe } from '../../core/utils.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { filter, map, pairwise, withLatestFrom } from 'rxjs/operators';
import { GetAllEndpoints, RegisterEndpoint } from '../../../../../../store/src/actions/endpoint.actions';
import { ShowSnackBar } from '../../../../../../store/src/actions/snackBar.actions';
import { GeneralEntityAppState } from '../../../../../../store/src/app-state';
import { endpointEntitySchema, STRATOS_ENDPOINT_TYPE } from '../../../../../../store/src/base-entity-schemas';
import { EndpointsEffect } from '../../../../../../store/src/effects/endpoint.effects';
import { entityCatalog } from '../../../../../../store/src/entity-catalog/entity-catalog';
import {
Expand All @@ -17,7 +18,6 @@ import {
import { endpointSchemaKey } from '../../../../../../store/src/helpers/entity-factory';
import { getAPIRequestDataState, selectUpdateInfo } from '../../../../../../store/src/selectors/api.selectors';
import { selectPaginationState } from '../../../../../../store/src/selectors/pagination.selectors';
import { endpointEntitySchema, STRATOS_ENDPOINT_TYPE } from '../../../../base-entity-schemas';
import { getIdFromRoute } from '../../../../core/utils.service';
import { IStepperStep, StepOnNextFunction } from '../../../../shared/components/stepper/step/step.component';
import { ConnectEndpointConfig } from '../../connect.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import { first, map, withLatestFrom } from 'rxjs/operators';

import { SendClearEndpointEventsAction } from '../../../../../store/src/actions/internal-events.actions';
import { AppState } from '../../../../../store/src/app-state';
import { endpointEntitySchema } from '../../../../../store/src/base-entity-schemas';
import { endpointSchemaKey } from '../../../../../store/src/helpers/entity-factory';
import { EntityMonitor } from '../../../../../store/src/monitors/entity-monitor';
import { InternalEventMonitorFactory } from '../../../../../store/src/monitors/internal-event-monitor.factory';
import { EndpointModel } from '../../../../../store/src/types/endpoint.types';
import { InternalEventState } from '../../../../../store/src/types/internal-events.types';
import { getPreviousRoutingState } from '../../../../../store/src/types/routing.type';
import { endpointEntitySchema } from '../../../base-entity-schemas';
import { StratosStatus } from '../../../shared/shared.types';
import { eventReturnUrlParam } from '../../event-page/events-page/events-page.component';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { map, publishReplay, refCount } from 'rxjs/operators';

import { endpointEntitySchema } from '../../../../../store/src/base-entity-schemas';
import { PaginationMonitor } from '../../../../../store/src/monitors/pagination-monitor';
import { PaginationMonitorFactory } from '../../../../../store/src/monitors/pagination-monitor.factory';
import { APIResource, EntityInfo } from '../../../../../store/src/types/api.types';
import { endpointListKey, EndpointModel } from '../../../../../store/src/types/endpoint.types';
import { endpointEntitySchema } from '../../../base-entity-schemas';
import { getFullEndpointApiUrl } from '../../endpoints/endpoint-helpers';

export interface MetricsEndpointProvider {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { endpointEntitySchema } from '../../../../../store/src/base-entity-schemas';
import { BaseTestModules } from '../../../../test-framework/core-test.helper';
import { endpointEntitySchema } from '../../../base-entity-schemas';
import { AppActionMonitorIconComponent } from './app-action-monitor-icon.component';

describe('AppActionMonitorIconComponent', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {
RemoveUserFavoriteAction,
} from '../../../../../store/src/actions/user-favourites-actions/remove-user-favorite-action';
import { AppState } from '../../../../../store/src/app-state';
import { userFavoritesEntitySchema } from '../../../../../store/src/base-entity-schemas';
import { entityCatalog } from '../../../../../store/src/entity-catalog/entity-catalog';
import { endpointEntitiesSelector } from '../../../../../store/src/selectors/endpoint.selectors';
import { IFavoriteMetadata, UserFavorite } from '../../../../../store/src/types/user-favorites.types';
import { userFavoritesEntitySchema } from '../../../base-entity-schemas';
import { IFavoriteEntity } from '../../../core/user-favorite-manager';
import { isEndpointConnected } from '../../../features/endpoints/connect.service';
import { ComponentEntityMonitorConfig, StratosStatus } from '../../shared.types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { endpointEntitySchema } from '../../../../../../../store/src/base-entity-schemas';
import { BaseTestModules } from '../../../../../../test-framework/core-test.helper';
import { endpointEntitySchema } from '../../../../../base-entity-schemas';
import { AppMonitorComponentTypes } from '../../../app-action-monitor-icon/app-action-monitor-icon.component';
import { TableCellRequestMonitorIconComponent } from './table-cell-request-monitor-icon.component';

Expand Down
Loading

0 comments on commit a2fe03c

Please sign in to comment.