diff --git a/src/frontend/packages/cf-autoscaler/src/store/autoscaler-entity-factory.ts b/src/frontend/packages/cf-autoscaler/src/store/autoscaler-entity-factory.ts index ecdddc9b8c..21df01c5dd 100644 --- a/src/frontend/packages/cf-autoscaler/src/store/autoscaler-entity-factory.ts +++ b/src/frontend/packages/cf-autoscaler/src/store/autoscaler-entity-factory.ts @@ -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'; @@ -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'; diff --git a/src/frontend/packages/cf-autoscaler/src/store/autoscaler-entity-generator.ts b/src/frontend/packages/cf-autoscaler/src/store/autoscaler-entity-generator.ts index 9e946fca20..ec1414cb64 100644 --- a/src/frontend/packages/cf-autoscaler/src/store/autoscaler-entity-generator.ts +++ b/src/frontend/packages/cf-autoscaler/src/store/autoscaler-entity-generator.ts @@ -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, diff --git a/src/frontend/packages/cloud-foundry/src/cf-entity-factory.ts b/src/frontend/packages/cloud-foundry/src/cf-entity-factory.ts index 1112888031..40a49404ee 100644 --- a/src/frontend/packages/cloud-foundry/src/cf-entity-factory.ts +++ b/src/frontend/packages/cloud-foundry/src/cf-entity-factory.ts @@ -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 { diff --git a/src/frontend/packages/cloud-foundry/src/cf-entity-generator.ts b/src/frontend/packages/cloud-foundry/src/cf-entity-generator.ts index beba13c732..6819e1297f 100644 --- a/src/frontend/packages/cloud-foundry/src/cf-entity-generator.ts +++ b/src/frontend/packages/cloud-foundry/src/cf-entity-generator.ts @@ -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, diff --git a/src/frontend/packages/cloud-foundry/src/cloud-foundry-test.module.ts b/src/frontend/packages/cloud-foundry/src/cloud-foundry-test.module.ts index c39f9fd41d..128aed0b52 100644 --- a/src/frontend/packages/cloud-foundry/src/cloud-foundry-test.module.ts +++ b/src/frontend/packages/cloud-foundry/src/cloud-foundry-test.module.ts @@ -5,7 +5,7 @@ import { EffectsModule } from '@ngrx/effects'; import { generateASEntities } from '../../cf-autoscaler/src/store/autoscaler-entity-generator'; 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 { 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'; diff --git a/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.spec.ts b/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.spec.ts index 6ef73eb96f..f4cf1f0ad5 100644 --- a/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.spec.ts +++ b/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.spec.ts @@ -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'; diff --git a/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/tabs/cloud-foundry-cells/cloud-foundry-cell/cloud-foundry-cell-base/cloud-foundry-cell-base.component.ts b/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/tabs/cloud-foundry-cells/cloud-foundry-cell/cloud-foundry-cell-base/cloud-foundry-cell-base.component.ts index 07a77cddd6..848157a8e1 100644 --- a/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/tabs/cloud-foundry-cells/cloud-foundry-cell/cloud-foundry-cell-base/cloud-foundry-cell-base.component.ts +++ b/src/frontend/packages/cloud-foundry/src/features/cloud-foundry/tabs/cloud-foundry-cells/cloud-foundry-cell/cloud-foundry-cell-base/cloud-foundry-cell-base.component.ts @@ -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'; diff --git a/src/frontend/packages/cloud-foundry/src/shared/components/cards/card-cf-space-details/card-cf-space-details.component.ts b/src/frontend/packages/cloud-foundry/src/shared/components/cards/card-cf-space-details/card-cf-space-details.component.ts index 1e20e5ab65..555865d96e 100644 --- a/src/frontend/packages/cloud-foundry/src/shared/components/cards/card-cf-space-details/card-cf-space-details.component.ts +++ b/src/frontend/packages/cloud-foundry/src/shared/components/cards/card-cf-space-details/card-cf-space-details.component.ts @@ -8,8 +8,8 @@ import { CloudFoundrySpaceService, } from '../../../../../../cloud-foundry/src/features/cloud-foundry/services/cloud-foundry-space.service'; import { safeUnsubscribe } from '../../../../../../core/src/core/utils.service'; +import { SnackBarService } from '../../../../../../core/src/shared/services/snackbar.service'; import { RouterNav } from '../../../../../../store/src/actions/router.actions'; -import { ShowReturnSnackBar } from '../../../../../../store/src/actions/snackBar.actions'; import { AppState } from '../../../../../../store/src/app-state'; @Component({ @@ -24,7 +24,8 @@ export class CardCfSpaceDetailsComponent implements OnDestroy { constructor( public cfSpaceService: CloudFoundrySpaceService, private store: Store, - private router: Router + private router: Router, + private snackBarService: SnackBarService ) { this.allowSshStatus$ = cfSpaceService.allowSsh$.pipe( map(status => status === 'false' ? 'Disabled' : 'Enabled') @@ -34,7 +35,7 @@ export class CardCfSpaceDetailsComponent implements OnDestroy { goToOrgQuota() { this.quotaLinkSub = this.cfSpaceService.quotaLink$.subscribe(quotaLink => { this.store.dispatch(new RouterNav({ path: quotaLink })); - this.store.dispatch(new ShowReturnSnackBar('You were switched to an organization', this.router.url, 'Return to space')); + this.snackBarService.showReturn('You were switched to an organization', this.router.url, 'Return to space'); }); } diff --git a/src/frontend/packages/cloud-foundry/src/shared/data-services/cloud-foundry.service.ts b/src/frontend/packages/cloud-foundry/src/shared/data-services/cloud-foundry.service.ts index fe0acd6e1b..45ba64f2e0 100644 --- a/src/frontend/packages/cloud-foundry/src/shared/data-services/cloud-foundry.service.ts +++ b/src/frontend/packages/cloud-foundry/src/shared/data-services/cloud-foundry.service.ts @@ -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'; diff --git a/src/frontend/packages/cloud-foundry/src/shared/data-services/long-running-cf-op.service.ts b/src/frontend/packages/cloud-foundry/src/shared/data-services/long-running-cf-op.service.ts index 8060984845..296b87b0d4 100644 --- a/src/frontend/packages/cloud-foundry/src/shared/data-services/long-running-cf-op.service.ts +++ b/src/frontend/packages/cloud-foundry/src/shared/data-services/long-running-cf-op.service.ts @@ -2,14 +2,17 @@ import { Injectable } from '@angular/core'; import { Store } from '@ngrx/store'; import { LongRunningOperationsService } from '../../../../core/src/shared/services/long-running-op.service'; -import { ShowSnackBar } from '../../../../store/src/actions/snackBar.actions'; +import { SnackBarService } from '../../../../core/src/shared/services/snackbar.service'; import { AppState } from '../../../../store/src/app-state'; import { GetServiceInstance } from '../../actions/service-instances.actions'; @Injectable() export class LongRunningCfOperationsService extends LongRunningOperationsService { - constructor(store: Store) { + constructor( + store: Store, + private snackBarService: SnackBarService + ) { super(store); } @@ -17,14 +20,14 @@ export class LongRunningCfOperationsService extends LongRunningOperationsService const message = `The operation to create the service instance is taking a long time and will continue in the background. Please refresh the service instance list to check it's status ${bindApp ? ` and then bind the application via the Application page.` : '.'}`; - this.store.dispatch(new ShowSnackBar(message, 'Dismiss')); + this.snackBarService.show(message, 'Dismiss'); } handleLongRunningUpdateService(serviceInstanceGuid: string, cfGuid: string) { const message = `The operation to update the service instance is taking a long time and will continue in the background. Please refresh the service instance list to check it's status`; - this.store.dispatch(new ShowSnackBar(message, 'Dismiss')); // Also attempt to fetch the service instance, this will update the `last operation` value to `update` and `in progress` + this.snackBarService.show(message, 'Dismiss'); // TODO: RC FIX this.store.dispatch(new GetServiceInstance(serviceInstanceGuid, cfGuid)); } @@ -32,7 +35,7 @@ export class LongRunningCfOperationsService extends LongRunningOperationsService handleLongRunningDeleteService(serviceInstanceGuid: string, cfGuid: string) { const message = `The operation to delete the service instance is taking a long time and will continue in the background. Please refresh the service instance list to check it's status`; - this.store.dispatch(new ShowSnackBar(message, 'Dismiss')); + this.snackBarService.show(message, 'Dismiss'); // Also attempt to fetch the service instance, this will update the `last operation` value to `delete` and `in progress` // TODO: RC FIX this.store.dispatch(new GetServiceInstance(serviceInstanceGuid, cfGuid)); diff --git a/src/frontend/packages/cloud-foundry/src/shared/services/cf-org-space-label.service.ts b/src/frontend/packages/cloud-foundry/src/shared/services/cf-org-space-label.service.ts index 5be5a76e5c..ff76d39b0c 100644 --- a/src/frontend/packages/cloud-foundry/src/shared/services/cf-org-space-label.service.ts +++ b/src/frontend/packages/cloud-foundry/src/shared/services/cf-org-space-label.service.ts @@ -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/stratos-entity-factory'; import { selectEntity } from '../../../../store/src/selectors/api.selectors'; diff --git a/src/frontend/packages/cloud-foundry/src/shared/services/current-user-permissions.service.spec.ts b/src/frontend/packages/cloud-foundry/src/shared/services/current-user-permissions.service.spec.ts index 5b2a2debb8..d24a0c4bef 100644 --- a/src/frontend/packages/cloud-foundry/src/shared/services/current-user-permissions.service.spec.ts +++ b/src/frontend/packages/cloud-foundry/src/shared/services/current-user-permissions.service.spec.ts @@ -12,15 +12,15 @@ import { CfPermissionTypes, CfScopeStrings, } from '../../../../cloud-foundry/src/user-permissions/cf-user-permissions-checkers'; -import { endpointEntitySchema } from '../../../../core/src/base-entity-schemas'; 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 { generateStratosEntities } from '../../../../core/src/stratos-entity-generator'; import { AppTestModule } from '../../../../core/test-framework/core-test.helper'; import { AppState } from '../../../../store/src/app-state'; +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 { endpointSchemaKey, stratosEntityFactory } from '../../../../store/src/helpers/stratos-entity-factory'; import { APIResource } from '../../../../store/src/types/api.types'; import { EndpointModel } from '../../../../store/src/types/endpoint.types'; import { BaseEntityValues } from '../../../../store/src/types/entity.types'; @@ -588,7 +588,7 @@ describe('CurrentUserPermissionsService with CF checker', () => { // Create request and requestData sections const entityMap = new Map>([ [ - endpointEntitySchema, + stratosEntityFactory(endpointSchemaKey), endpoints.map(endpoint => ({ guid: endpoint.guid, data: endpoint diff --git a/src/frontend/packages/cloud-foundry/test-framework/cf-test-helper.ts b/src/frontend/packages/cloud-foundry/test-framework/cf-test-helper.ts index 64dff3cf63..b8421deaf8 100644 --- a/src/frontend/packages/cloud-foundry/test-framework/cf-test-helper.ts +++ b/src/frontend/packages/cloud-foundry/test-framework/cf-test-helper.ts @@ -1,5 +1,6 @@ import { generateStratosEntities } from '../../core/src/stratos-entity-generator'; 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'; diff --git a/src/frontend/packages/core/src/app.module.ts b/src/frontend/packages/core/src/app.module.ts index 4e734c8e0c..d79244939f 100644 --- a/src/frontend/packages/core/src/app.module.ts +++ b/src/frontend/packages/core/src/app.module.ts @@ -13,11 +13,12 @@ import { UpdateUserFavoriteMetadataAction, } from '../../store/src/actions/user-favourites-actions/update-user-favorite-metadata-action'; import { GeneralEntityAppState, GeneralRequestDataState } from '../../store/src/app-state'; +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'; import { EntityCatalogHelpers } from '../../store/src/entity-catalog/entity-catalog.helper'; -import { endpointSchemaKey } from '../../store/src/helpers/stratos-entity-factory'; +import { endpointSchemaKey, STRATOS_ENDPOINT_TYPE } from '../../store/src/helpers/stratos-entity-factory'; import { getAPIRequestDataState, selectEntity } from '../../store/src/selectors/api.selectors'; import { internalEventStateSelector } from '../../store/src/selectors/internal-events.selectors'; import { recentlyVisitedSelector } from '../../store/src/selectors/recently-visitied.selectors'; @@ -28,7 +29,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 { CoreModule } from './core/core.module'; import { CustomizationService } from './core/customizations.types'; import { DynamicExtensionRoutes } from './core/extension/dynamic-extension-routes'; @@ -49,7 +49,6 @@ import { FavoritesConfigMapper } from './shared/components/favorites-meta-card/f import { endpointEventKey, GlobalEventData, GlobalEventService } from './shared/global-events.service'; import { SidePanelService } from './shared/services/side-panel.service'; import { SharedModule } from './shared/shared.module'; -import { generateStratosEntities } from './stratos-entity-generator'; // Create action for router navigation. See // - https://github.com/ngrx/platform/issues/68 diff --git a/src/frontend/packages/core/src/core/permissions/current-user-permissions.service.spec.ts b/src/frontend/packages/core/src/core/permissions/current-user-permissions.service.spec.ts index 29daf4d426..a968f4309e 100644 --- a/src/frontend/packages/core/src/core/permissions/current-user-permissions.service.spec.ts +++ b/src/frontend/packages/core/src/core/permissions/current-user-permissions.service.spec.ts @@ -3,14 +3,14 @@ import { createBasicStoreModule, createEntityStoreState, TestStoreEntity } from import { first, tap } from 'rxjs/operators'; import { AppState } from '../../../../store/src/app-state'; +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 { endpointSchemaKey, stratosEntityFactory } from '../../../../store/src/helpers/stratos-entity-factory'; 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 '../../stratos-entity-generator'; import { PermissionConfig } from './current-user-permissions.config'; import { CurrentUserPermissionsService } from './current-user-permissions.service'; import { StratosPermissionStrings, StratosPermissionTypes, StratosScopeStrings } from './stratos-user-permissions.checker'; @@ -138,7 +138,7 @@ describe('CurrentUserPermissionsService', () => { // Create request and requestData sections const entityMap = new Map>([ [ - endpointEntitySchema, + stratosEntityFactory(endpointSchemaKey), endpoints.map(endpoint => ({ guid: endpoint.guid, data: endpoint diff --git a/src/frontend/packages/core/src/core/permissions/current-user-permissions.service.ts b/src/frontend/packages/core/src/core/permissions/current-user-permissions.service.ts index 69628b47e1..9d2b92d263 100644 --- a/src/frontend/packages/core/src/core/permissions/current-user-permissions.service.ts +++ b/src/frontend/packages/core/src/core/permissions/current-user-permissions.service.ts @@ -20,7 +20,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 { @@ -35,7 +35,7 @@ export class CurrentUserPermissionsService { this.allCheckers = [ new StratosUserPermissionsChecker(store), ...nullSafeCustomCheckers - ] + ]; } /** * @param action The action we're going to check the user's access to. @@ -53,13 +53,13 @@ export class CurrentUserPermissionsService { ): Observable { 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$ ? @@ -93,7 +93,7 @@ export class CurrentUserPermissionsService { 'permissions check', actionConfig.type, of(false) - ) + ); } private getComplexPermission(permissionConfig: PermissionConfig[], endpointGuid?: string, ...args: any[]) { @@ -113,7 +113,7 @@ export class CurrentUserPermissionsService { [{ checks: [of(false)] }] - ) + ); } private getConfig(config: PermissionConfigType, tries = 0): PermissionConfig[] | PermissionConfig { @@ -149,7 +149,7 @@ export class CurrentUserPermissionsService { 'fallback permission', 'N/A', of(null) - ) + ); } private getPermissionConfig(key: CurrentUserPermissions): PermissionConfigType { @@ -158,7 +158,7 @@ export class CurrentUserPermissionsService { 'permissions checker', key, null - ) + ); } /** diff --git a/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/auth-forms/credentials-auth-form.component.ts b/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/auth-forms/credentials-auth-form.component.ts index cdf3c405d0..b585c0ab96 100644 --- a/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/auth-forms/credentials-auth-form.component.ts +++ b/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/auth-forms/credentials-auth-form.component.ts @@ -1,6 +1,7 @@ -import { FormGroup } from '@angular/forms'; import { Component, Input } from '@angular/core'; -import { IAuthForm } from '../../../../core/extension/extension-types'; +import { FormGroup } from '@angular/forms'; + +import { IAuthForm } from '../../../../../../store/src/extension-types'; @Component({ selector: 'app-credentials-auth-form', diff --git a/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/auth-forms/none-auth-form.component.ts b/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/auth-forms/none-auth-form.component.ts index c76f5a954c..3b6bb325ee 100644 --- a/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/auth-forms/none-auth-form.component.ts +++ b/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/auth-forms/none-auth-form.component.ts @@ -1,6 +1,7 @@ import { Component, Input } from '@angular/core'; import { FormGroup } from '@angular/forms'; -import { IAuthForm } from '../../../../core/extension/extension-types'; + +import { IAuthForm } from '../../../../../../store/src/extension-types'; @Component({ selector: 'app-none-auth-form', diff --git a/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/auth-forms/sso-auth-form.component.ts b/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/auth-forms/sso-auth-form.component.ts index bdac43f89e..83243a24ec 100644 --- a/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/auth-forms/sso-auth-form.component.ts +++ b/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/auth-forms/sso-auth-form.component.ts @@ -1,6 +1,7 @@ import { Component, Input } from '@angular/core'; import { FormGroup } from '@angular/forms'; -import { IAuthForm } from '../../../../core/extension/extension-types'; + +import { IAuthForm } from '../../../../../../store/src/extension-types'; @Component({ selector: 'app-sso-auth-form', diff --git a/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/connect-endpoint-dialog.component.ts b/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/connect-endpoint-dialog.component.ts index 3d0f72fa4c..75402fd26f 100644 --- a/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/connect-endpoint-dialog.component.ts +++ b/src/frontend/packages/core/src/features/endpoints/connect-endpoint-dialog/connect-endpoint-dialog.component.ts @@ -3,11 +3,11 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { Store } from '@ngrx/store'; import { Subscription } from 'rxjs'; -import { ShowSnackBar } from '../../../../../store/src/actions/snackBar.actions'; import { EndpointOnlyAppState } from '../../../../../store/src/app-state'; import { EndpointsService } from '../../../core/endpoints.service'; import { MarkdownPreviewComponent } from '../../../shared/components/markdown-preview/markdown-preview.component'; import { SidePanelService } from '../../../shared/services/side-panel.service'; +import { SnackBarService } from '../../../shared/services/snackbar.service'; import { ConnectEndpointConfig, ConnectEndpointService } from '../connect.service'; @@ -30,11 +30,12 @@ export class ConnectEndpointDialogComponent implements OnDestroy { private store: Store, endpointsService: EndpointsService, private sidePanelService: SidePanelService, + private snackBarService: SnackBarService, ) { this.connectService = new ConnectEndpointService(store, endpointsService, data); this.hasConnected = this.connectService.hasConnected$.subscribe(() => { - this.store.dispatch(new ShowSnackBar(`Connected endpoint '${this.data.name}'`)); + this.snackBarService.show(`Connected endpoint '${this.data.name}'`); this.dialogRef.close(); }); } diff --git a/src/frontend/packages/core/src/features/endpoints/connect-endpoint/connect-endpoint.component.ts b/src/frontend/packages/core/src/features/endpoints/connect-endpoint/connect-endpoint.component.ts index fc355c4928..4bc13f56bb 100644 --- a/src/frontend/packages/core/src/features/endpoints/connect-endpoint/connect-endpoint.component.ts +++ b/src/frontend/packages/core/src/features/endpoints/connect-endpoint/connect-endpoint.component.ts @@ -13,10 +13,9 @@ import { } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { Subscription } from 'rxjs'; -import { map } from 'rxjs/operators'; import { entityCatalog } from '../../../../../store/src/entity-catalog/entity-catalog'; -import { EndpointAuthTypeConfig, IAuthForm, IEndpointAuthComponent } from '../../../core/extension/extension-types'; +import { EndpointAuthTypeConfig, IAuthForm, IEndpointAuthComponent } from '../../../../../store/src/extension-types'; import { safeUnsubscribe } from '../../../core/utils.service'; import { ConnectEndpointConfig, ConnectEndpointData, ConnectEndpointService } from '../connect.service'; import { BaseEndpointAuth } from '../endpoint-auth'; diff --git a/src/frontend/packages/core/src/features/endpoints/connect.service.ts b/src/frontend/packages/core/src/features/endpoints/connect.service.ts index b5417bc17f..c0f8e0ba07 100644 --- a/src/frontend/packages/core/src/features/endpoints/connect.service.ts +++ b/src/frontend/packages/core/src/features/endpoints/connect.service.ts @@ -13,11 +13,11 @@ import { import { AuthParams, ConnectEndpoint } from '../../../../store/src/actions/endpoint.actions'; import { entityCatalog } from '../../../../store/src/entity-catalog/entity-catalog'; +import { EndpointType } from '../../../../store/src/extension-types'; import { ActionState } from '../../../../store/src/reducers/api-request-reducer/types'; import { stratosEntityCatalog } from '../../../../store/src/stratos-entity-catalog'; import { EndpointModel } from '../../../../store/src/types/endpoint.types'; import { EndpointsService } from '../../core/endpoints.service'; -import { EndpointType } from '../../core/extension/extension-types'; import { safeUnsubscribe } from '../../core/utils.service'; export interface ConnectEndpointConfig { diff --git a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-cf-step-1/create-endpoint-cf-step-1.component.ts b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-cf-step-1/create-endpoint-cf-step-1.component.ts index a1a047e61c..12debb9a11 100644 --- a/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-cf-step-1/create-endpoint-cf-step-1.component.ts +++ b/src/frontend/packages/core/src/features/endpoints/create-endpoint/create-endpoint-cf-step-1/create-endpoint-cf-step-1.component.ts @@ -6,18 +6,18 @@ import { denormalize } from 'normalizr'; import { Observable } from 'rxjs'; import { filter, map, pairwise, withLatestFrom } from 'rxjs/operators'; -import { ShowSnackBar } from '../../../../../../store/src/actions/snackBar.actions'; import { GeneralEntityAppState } from '../../../../../../store/src/app-state'; import { entityCatalog } from '../../../../../../store/src/entity-catalog/entity-catalog'; import { StratosCatalogEndpointEntity, } from '../../../../../../store/src/entity-catalog/entity-catalog-entity/entity-catalog-entity'; +import { endpointSchemaKey, stratosEntityFactory } from '../../../../../../store/src/helpers/stratos-entity-factory'; import { ActionState } from '../../../../../../store/src/reducers/api-request-reducer/types'; import { getAPIRequestDataState } from '../../../../../../store/src/selectors/api.selectors'; import { stratosEntityCatalog } from '../../../../../../store/src/stratos-entity-catalog'; -import { endpointEntitySchema } from '../../../../base-entity-schemas'; import { getIdFromRoute } from '../../../../core/utils.service'; import { IStepperStep, StepOnNextFunction } from '../../../../shared/components/stepper/step/step.component'; +import { SnackBarService } from '../../../../shared/services/snackbar.service'; import { ConnectEndpointConfig } from '../../connect.service'; import { getFullEndpointApiUrl, getSSOClientRedirectURI } from '../../endpoint-helpers'; @@ -56,9 +56,11 @@ export class CreateEndpointCfStep1Component implements IStepperStep, AfterConten endpointTypeSupportsSSO = false; endpoint: StratosCatalogEndpointEntity; - // private endpointEntityKey = entityCatalog.getEntityKey(STRATOS_ENDPOINT_TYPE, endpointSchemaKey); - - constructor(private store: Store, activatedRoute: ActivatedRoute, ) { + constructor( + store: Store, + activatedRoute: ActivatedRoute, + private snackBarService: SnackBarService + ) { const paginationState$ = stratosEntityCatalog.endpoint.store.getAll.getPaginationMonitor().pagination$; // TODO: RC Fix me, this is madness @@ -67,7 +69,7 @@ export class CreateEndpointCfStep1Component implements IStepperStep, AfterConten map(([pagination, entities]) => { const pages = Object.values(pagination.ids); const page = [].concat.apply([], pages); - const endpoints = page.length ? denormalize(page, [endpointEntitySchema], entities) : []; + const endpoints = page.length ? denormalize(page, [stratosEntityFactory(endpointSchemaKey)], entities) : []; return { names: endpoints.map(ep => ep.name), urls: endpoints.map(ep => getFullEndpointApiUrl(ep)), @@ -108,7 +110,7 @@ export class CreateEndpointCfStep1Component implements IStepperStep, AfterConten ssoAllowed: this.ssoAllowedField ? !!this.ssoAllowedField.value : false }; if (!result.error) { - this.store.dispatch(new ShowSnackBar(`Successfully registered '${this.nameField.value}'`)); + this.snackBarService.show(`Successfully registered '${this.nameField.value}'`); } const success = !result.error; return { diff --git a/src/frontend/packages/core/src/features/endpoints/endpoint-auth.ts b/src/frontend/packages/core/src/features/endpoints/endpoint-auth.ts index 757b0677e5..9c771119f0 100644 --- a/src/frontend/packages/core/src/features/endpoints/endpoint-auth.ts +++ b/src/frontend/packages/core/src/features/endpoints/endpoint-auth.ts @@ -1,9 +1,10 @@ -import { EndpointAuthTypeNames } from './endpoint-helpers'; import { Validators } from '@angular/forms'; -import { EndpointType, EndpointAuthTypeConfig } from '../../core/extension/extension-types'; + +import { EndpointAuthTypeConfig, EndpointType } from '../../../../store/src/extension-types'; import { CredentialsAuthFormComponent } from './connect-endpoint-dialog/auth-forms/credentials-auth-form.component'; -import { SSOAuthFormComponent } from './connect-endpoint-dialog/auth-forms/sso-auth-form.component'; import { NoneAuthFormComponent } from './connect-endpoint-dialog/auth-forms/none-auth-form.component'; +import { SSOAuthFormComponent } from './connect-endpoint-dialog/auth-forms/sso-auth-form.component'; +import { EndpointAuthTypeNames } from './endpoint-helpers'; export abstract class BaseEndpointAuth { static readonly UsernamePassword = { diff --git a/src/frontend/packages/core/src/features/endpoints/endpoints-page/endpoints-page.component.ts b/src/frontend/packages/core/src/features/endpoints/endpoints-page/endpoints-page.component.ts index 7992db8c39..9ecf211ded 100644 --- a/src/frontend/packages/core/src/features/endpoints/endpoints-page/endpoints-page.component.ts +++ b/src/frontend/packages/core/src/features/endpoints/endpoints-page/endpoints-page.component.ts @@ -10,7 +10,6 @@ import { ViewChild, ViewContainerRef, } from '@angular/core'; -import { MatSnackBar, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar'; import { Store } from '@ngrx/store'; import { combineLatest, Subscription } from 'rxjs'; import { delay, first, map, tap } from 'rxjs/operators'; @@ -32,6 +31,7 @@ import { EndpointsListConfigService, } from '../../../shared/components/list/list-types/endpoint/endpoints-list-config.service'; import { ListConfig } from '../../../shared/components/list/list.component.types'; +import { SnackBarService } from '../../../shared/services/snackbar.service'; @Component({ selector: 'app-endpoints-page', @@ -49,7 +49,6 @@ export class EndpointsPageComponent implements AfterViewInit, OnDestroy, OnInit @ViewChild('customNoEndpoints', { read: ViewContainerRef, static: true }) customNoEndpointsContainer; customContentComponentRef: ComponentRef; - private snackBarRef: MatSnackBarRef; private snackBarText = { message: `There are no connected endpoints, connect with your personal credentials to get started.`, action: 'Got it' @@ -62,7 +61,7 @@ export class EndpointsPageComponent implements AfterViewInit, OnDestroy, OnInit public store: Store, private ngZone: NgZone, private resolver: ComponentFactoryResolver, - private snackBar: MatSnackBar, + private snackBarService: SnackBarService, cs: CustomizationService ) { this.customizations = cs.get(); @@ -103,10 +102,10 @@ export class EndpointsPageComponent implements AfterViewInit, OnDestroy, OnInit } private showSnackBar(show: boolean) { - if (!this.snackBarRef && show) { - this.snackBarRef = this.snackBar.open(this.snackBarText.message, this.snackBarText.action, { duration: 20000 }); - } else if (this.snackBarRef && !show) { - this.snackBarRef.dismiss(); + if (show) { + this.snackBarService.show(this.snackBarText.message, this.snackBarText.action, 20000); + } else { + this.snackBarService.hide(); } } diff --git a/src/frontend/packages/core/src/features/metrics/services/metrics-service.ts b/src/frontend/packages/core/src/features/metrics/services/metrics-service.ts index 9e9076acea..6fca8aaefc 100644 --- a/src/frontend/packages/core/src/features/metrics/services/metrics-service.ts +++ b/src/frontend/packages/core/src/features/metrics/services/metrics-service.ts @@ -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 { diff --git a/src/frontend/packages/core/src/shared/components/app-action-monitor-icon/app-action-monitor-icon.component.spec.ts b/src/frontend/packages/core/src/shared/components/app-action-monitor-icon/app-action-monitor-icon.component.spec.ts index d5e18bd988..06860cf718 100644 --- a/src/frontend/packages/core/src/shared/components/app-action-monitor-icon/app-action-monitor-icon.component.spec.ts +++ b/src/frontend/packages/core/src/shared/components/app-action-monitor-icon/app-action-monitor-icon.component.spec.ts @@ -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', () => { diff --git a/src/frontend/packages/core/src/shared/components/favorites-meta-card/favorites-meta-card.component.ts b/src/frontend/packages/core/src/shared/components/favorites-meta-card/favorites-meta-card.component.ts index e95dea1c1a..afecb11450 100644 --- a/src/frontend/packages/core/src/shared/components/favorites-meta-card/favorites-meta-card.component.ts +++ b/src/frontend/packages/core/src/shared/components/favorites-meta-card/favorites-meta-card.component.ts @@ -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'; diff --git a/src/frontend/packages/core/src/shared/components/list/list-table/table-cell-request-monitor-icon/table-cell-request-monitor-icon.component.spec.ts b/src/frontend/packages/core/src/shared/components/list/list-table/table-cell-request-monitor-icon/table-cell-request-monitor-icon.component.spec.ts index 04cb6b4ce1..8a69e57ded 100644 --- a/src/frontend/packages/core/src/shared/components/list/list-table/table-cell-request-monitor-icon/table-cell-request-monitor-icon.component.spec.ts +++ b/src/frontend/packages/core/src/shared/components/list/list-table/table-cell-request-monitor-icon/table-cell-request-monitor-icon.component.spec.ts @@ -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'; diff --git a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/base-endpoints-data-source.ts b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/base-endpoints-data-source.ts index ad79f48315..7b4e1d5b24 100644 --- a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/base-endpoints-data-source.ts +++ b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/base-endpoints-data-source.ts @@ -5,13 +5,13 @@ import { map, pairwise, tap, withLatestFrom } from 'rxjs/operators'; import { GetAllEndpoints } from '../../../../../../../store/src/actions/endpoint.actions'; import { CreatePagination } from '../../../../../../../store/src/actions/pagination.actions'; import { AppState } from '../../../../../../../store/src/app-state'; +import { endpointEntitySchema } from '../../../../../../../store/src/base-entity-schemas'; import { endpointSchemaKey } from '../../../../../../../store/src/helpers/stratos-entity-factory'; 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 { endpointEntitiesSelector } from '../../../../../../../store/src/selectors/endpoint.selectors'; import { EndpointModel } from '../../../../../../../store/src/types/endpoint.types'; -import { endpointEntitySchema } from '../../../../../base-entity-schemas'; import { DataFunctionDefinition, ListDataSource } from '../../data-sources-controllers/list-data-source'; import { RowsState } from '../../data-sources-controllers/list-data-source-types'; import { TableRowStateManager } from '../../list-table/table-row/table-row-state-manager'; diff --git a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-list.helpers.ts b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-list.helpers.ts index 3213d959f0..e1ebaabf50 100644 --- a/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-list.helpers.ts +++ b/src/frontend/packages/core/src/shared/components/list/list-types/endpoint/endpoint-list.helpers.ts @@ -5,7 +5,6 @@ import { combineLatest, Observable } from 'rxjs'; import { map, pairwise } from 'rxjs/operators'; import { RouterNav } from '../../../../../../../store/src/actions/router.actions'; -import { ShowSnackBar } from '../../../../../../../store/src/actions/snackBar.actions'; import { AppState } from '../../../../../../../store/src/app-state'; import { entityCatalog } from '../../../../../../../store/src/entity-catalog/entity-catalog'; import { ActionState } from '../../../../../../../store/src/reducers/api-request-reducer/types'; @@ -17,6 +16,7 @@ import { StratosCurrentUserPermissions } from '../../../../../core/permissions/s import { ConnectEndpointDialogComponent, } from '../../../../../features/endpoints/connect-endpoint-dialog/connect-endpoint-dialog.component'; +import { SnackBarService } from '../../../../services/snackbar.service'; import { ConfirmationDialogConfig } from '../../../confirmation-dialog.config'; import { ConfirmationDialogService } from '../../../confirmation-dialog.service'; import { IListAction } from '../../list.component.types'; @@ -45,6 +45,7 @@ export class EndpointListHelper { private currentUserPermissionsService: CurrentUserPermissionsService, private confirmDialog: ConfirmationDialogService, private log: LoggerService, + private snackBarService: SnackBarService, ) { } endpointActions(): IListAction[] { @@ -60,8 +61,8 @@ export class EndpointListHelper { this.confirmDialog.open(confirmation, () => { const obs$ = stratosEntityCatalog.endpoint.api.disconnect(item.guid, item.cnsi_type); this.handleAction(obs$, () => { - this.store.dispatch(new ShowSnackBar(`Disconnected endpoint '${item.name}'`)); - stratosEntityCatalog.endpoint.api.get(item.guid); + this.snackBarService.show(`Disconnected endpoint '${item.name}'`); + stratosEntityCatalog.systemInfo.api.getSystemInfo(); }); }); }, @@ -109,7 +110,7 @@ export class EndpointListHelper { this.confirmDialog.open(confirmation, () => { const obs$ = stratosEntityCatalog.endpoint.api.unregister(item.guid, item.cnsi_type); this.handleAction(obs$, () => { - this.store.dispatch(new ShowSnackBar(`Unregistered ${item.name}`)); + this.snackBarService.show(`Unregistered ${item.name}`); }); }); }, diff --git a/src/frontend/packages/core/src/shared/services/snackbar.service.ts b/src/frontend/packages/core/src/shared/services/snackbar.service.ts new file mode 100644 index 0000000000..13ba4eb2c6 --- /dev/null +++ b/src/frontend/packages/core/src/shared/services/snackbar.service.ts @@ -0,0 +1,33 @@ +import { Injectable } from '@angular/core'; +import { MatSnackBar, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar'; + +import { SnackBarReturnComponent } from '../components/snackbar-return/snackbar-return.component'; + +/** + * Servicve for showing snackbars + */ +@Injectable({ + providedIn: 'root', +}) +export class SnackBarService { + + constructor(public snackBar: MatSnackBar) {} + + private snackBars: MatSnackBarRef[] = []; + + public show(message: string, closeMessage?: string, duration: number = 5000) { + this.snackBars.push(this.snackBar.open(message, closeMessage, { + duration: closeMessage ? null :duration + })); + } + + public showReturn(message: string, returnUrl: string, returnLabel: string) { + this.snackBars.push(this.snackBar.openFromComponent(SnackBarReturnComponent, { + data: { message, returnUrl, returnLabel } + })); + } + + public hide() { + this.snackBars.forEach(snackBar => snackBar.dismiss()); + } +} diff --git a/src/frontend/packages/core/test-framework/core-test.modules.ts b/src/frontend/packages/core/test-framework/core-test.modules.ts index 5242adfc91..f433ecb5e6 100644 --- a/src/frontend/packages/core/test-framework/core-test.modules.ts +++ b/src/frontend/packages/core/test-framework/core-test.modules.ts @@ -1,8 +1,8 @@ import { NgModule } from '@angular/core'; +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 { generateStratosEntities } from '../src/stratos-entity-generator'; @NgModule({ imports: [ diff --git a/src/frontend/packages/store/src/actions/endpoint.actions.ts b/src/frontend/packages/store/src/actions/endpoint.actions.ts index 885fe4fdb9..54fc8cdef5 100644 --- a/src/frontend/packages/store/src/actions/endpoint.actions.ts +++ b/src/frontend/packages/store/src/actions/endpoint.actions.ts @@ -1,8 +1,7 @@ import { Action } from '@ngrx/store'; -import { STRATOS_ENDPOINT_TYPE } from '../../../core/src/base-entity-schemas'; -import { EndpointType } from '../../../core/src/core/extension/extension-types'; -import { endpointSchemaKey } from '../helpers/stratos-entity-factory'; +import { EndpointType } from '../extension-types'; +import { endpointSchemaKey, STRATOS_ENDPOINT_TYPE } from '../helpers/stratos-entity-factory'; import { NormalizedResponse } from '../types/api.types'; import { endpointListKey, EndpointModel } from '../types/endpoint.types'; import { PaginatedAction } from '../types/pagination.types'; diff --git a/src/frontend/packages/store/src/actions/metrics.actions.ts b/src/frontend/packages/store/src/actions/metrics.actions.ts index 43b068a14d..df1138601f 100644 --- a/src/frontend/packages/store/src/actions/metrics.actions.ts +++ b/src/frontend/packages/store/src/actions/metrics.actions.ts @@ -1,6 +1,6 @@ -import { metricEntityType } from '../../../core/src/base-entity-schemas'; import { environment } from '../../../core/src/environments/environment'; import { MetricQueryType } from '../../../core/src/shared/services/metrics-range-selector.types'; +import { metricEntityType } from '../base-entity-schemas'; import { EntityRequestAction } from '../types/request.types'; export const METRICS_START = '[Metrics] Fetch Start'; diff --git a/src/frontend/packages/store/src/actions/snackBar.actions.ts b/src/frontend/packages/store/src/actions/snackBar.actions.ts deleted file mode 100644 index bee18d3e57..0000000000 --- a/src/frontend/packages/store/src/actions/snackBar.actions.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Action } from '@ngrx/store'; - -export const SHOW_SNACK_BAR = '[SnackBar] Show'; -export const SHOW_RETURN_SNACK_BAR = '[SnackBar] Show returns'; -export const HIDE_SNACK_BAR = '[SnackBar] Hide'; - -export class ShowSnackBar implements Action { - constructor( - public message: string, - public closeMessage: string = null - ) { - } - type = SHOW_SNACK_BAR; -} - -export class ShowReturnSnackBar implements Action { - constructor( - public message: string, - public returnRouterUrl: string, - public returnLabel: string - ) { - } - type = SHOW_RETURN_SNACK_BAR; -} - -export class HideSnackBar implements Action { - type = HIDE_SNACK_BAR; -} diff --git a/src/frontend/packages/store/src/actions/user-profile.actions.ts b/src/frontend/packages/store/src/actions/user-profile.actions.ts index bc1a349ab1..6607f2d504 100644 --- a/src/frontend/packages/store/src/actions/user-profile.actions.ts +++ b/src/frontend/packages/store/src/actions/user-profile.actions.ts @@ -1,5 +1,5 @@ -import { userProfileEntitySchema } from '../../../core/src/base-entity-schemas'; import { userProfilePasswordUpdatingKey } from '../effects/user-profile.effects'; +import { STRATOS_ENDPOINT_TYPE, stratosEntityFactory, userProfileSchemaKey } from '../helpers/stratos-entity-factory'; import { rootUpdatingKey } from '../reducers/api-request-reducer/types'; import { EntityRequestAction } from '../types/request.types'; import { UserProfileInfo, UserProfilePasswordUpdate } from '../types/user-profile.types'; @@ -11,8 +11,9 @@ export const UPDATE_USERPASSWORD = '[UserPassword] Update'; abstract class BaseProfileAction implements EntityRequestAction { static guid = 'userProfile'; guid = BaseProfileAction.guid; - entityType = userProfileEntitySchema.entityType; - endpointType = userProfileEntitySchema.endpointType; + entityType = userProfileSchemaKey; + endpointType = STRATOS_ENDPOINT_TYPE; + entity = [stratosEntityFactory(userProfileSchemaKey)] constructor(public type: string) { } } diff --git a/src/frontend/packages/core/src/base-entity-schemas.ts b/src/frontend/packages/store/src/base-entity-schemas.ts similarity index 100% rename from src/frontend/packages/core/src/base-entity-schemas.ts rename to src/frontend/packages/store/src/base-entity-schemas.ts diff --git a/src/frontend/packages/store/src/effects/endpoint.effects.ts b/src/frontend/packages/store/src/effects/endpoint.effects.ts index b0e6a5b74a..9b553fe629 100644 --- a/src/frontend/packages/store/src/effects/endpoint.effects.ts +++ b/src/frontend/packages/store/src/effects/endpoint.effects.ts @@ -4,7 +4,6 @@ import { Actions, Effect, ofType } from '@ngrx/effects'; import { Store } from '@ngrx/store'; import { catchError, mergeMap } from 'rxjs/operators'; -import { EndpointType } from '../../../core/src/core/extension/extension-types'; import { BrowserStandardEncoder } from '../../../core/src/helper'; import { CONNECT_ENDPOINTS, @@ -25,6 +24,7 @@ import { GET_SYSTEM_INFO_SUCCESS, GetSystemSuccess } from '../actions/system.act import { GetUserFavoritesAction } from '../actions/user-favourites-actions/get-user-favorites-action'; import { DispatchOnlyAppState } from '../app-state'; import { entityCatalog } from '../entity-catalog/entity-catalog'; +import { EndpointType } from '../extension-types'; import { ApiRequestTypes } from '../reducers/api-request-reducer/request-helpers'; import { stratosEntityCatalog } from '../stratos-entity-catalog'; import { NormalizedResponse } from '../types/api.types'; diff --git a/src/frontend/packages/store/src/effects/snackBar.effects.spec.ts b/src/frontend/packages/store/src/effects/snackBar.effects.spec.ts deleted file mode 100644 index 69c2b8924c..0000000000 --- a/src/frontend/packages/store/src/effects/snackBar.effects.spec.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { inject, TestBed } from '@angular/core/testing'; -import { MatDialog } from '@angular/material/dialog'; -import { Store } from '@ngrx/store'; - -import { CoreModule } from '../../../core/src/core/core.module'; -import { EndpointsPageComponent } from '../../../core/src/features/endpoints/endpoints-page/endpoints-page.component'; -import { SharedModule } from '../../../core/src/shared/shared.module'; -import { ShowSnackBar } from './../actions/snackBar.actions'; -import { AppStoreModule } from './../store.module'; - -describe('SnackBarEffect', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - declarations: [EndpointsPageComponent], - imports: [ - CommonModule, - CoreModule, - SharedModule, - AppStoreModule - ] - }) - .compileComponents(); - }); - - it('Should open a dialog', () => { - inject([Store, MatDialog], (store: Store, dialog: MatDialog) => { - store.dispatch(new ShowSnackBar('Test')); - expect(dialog.openDialogs[0]).toBeDefined(); - }); - }); -}); diff --git a/src/frontend/packages/store/src/effects/snackBar.effects.ts b/src/frontend/packages/store/src/effects/snackBar.effects.ts deleted file mode 100644 index 5f6a2540e4..0000000000 --- a/src/frontend/packages/store/src/effects/snackBar.effects.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Injectable } from '@angular/core'; -import { MatSnackBar, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar'; -import { Actions, Effect, ofType } from '@ngrx/effects'; -import { map } from 'rxjs/operators'; - -import { SnackBarReturnComponent } from '../../../core/src/shared/components/snackbar-return/snackbar-return.component'; -import { - HIDE_SNACK_BAR, - HideSnackBar, - SHOW_RETURN_SNACK_BAR, - SHOW_SNACK_BAR, - ShowReturnSnackBar, - ShowSnackBar, -} from '../actions/snackBar.actions'; - - -@Injectable() -export class SnackBarEffects { - constructor( - private actions$: Actions, - public snackBar: MatSnackBar - ) { } - - private snackBars: MatSnackBarRef[] = []; - - @Effect({ dispatch: false }) showSnackBar$ = this.actions$.pipe( - ofType(SHOW_SNACK_BAR), - map(action => this.snackBars.push(this.snackBar.open(action.message, action.closeMessage, { - duration: action.closeMessage ? null : 5000 - })))); - - @Effect({ dispatch: false }) showReturnSnackBar$ = this.actions$.pipe( - ofType(SHOW_RETURN_SNACK_BAR), - map(action => this.snackBars.push(this.snackBar.openFromComponent(SnackBarReturnComponent, { - data: { message: action.message, returnUrl: action.returnRouterUrl, returnLabel: action.returnLabel } - })))); - - @Effect({ dispatch: false }) hideSnackBar$ = this.actions$.pipe( - ofType(HIDE_SNACK_BAR), - map(() => this.snackBars.forEach(snackBar => snackBar.dismiss())) - ); -} diff --git a/src/frontend/packages/store/src/effects/system.effects.ts b/src/frontend/packages/store/src/effects/system.effects.ts index dc6880d368..04f272ae0e 100644 --- a/src/frontend/packages/store/src/effects/system.effects.ts +++ b/src/frontend/packages/store/src/effects/system.effects.ts @@ -9,6 +9,7 @@ import { InternalAppState } from '../app-state'; import { StartRequestAction, WrapperRequestActionFailed, WrapperRequestActionSuccess } from '../types/request.types'; import { SystemInfo } from '../types/system.types'; + @Injectable() export class SystemEffects { constructor( diff --git a/src/frontend/packages/store/src/effects/user-favorites-effect.ts b/src/frontend/packages/store/src/effects/user-favorites-effect.ts index deebce83a7..27f9ec400b 100644 --- a/src/frontend/packages/store/src/effects/user-favorites-effect.ts +++ b/src/frontend/packages/store/src/effects/user-favorites-effect.ts @@ -4,8 +4,6 @@ import { Actions, Effect, ofType } from '@ngrx/effects'; import { Store } from '@ngrx/store'; import { catchError, first, map, mergeMap, switchMap } from 'rxjs/operators'; -import { userFavoritesEntitySchema } from '../../../core/src/base-entity-schemas'; -import { entityCatalog } from '../entity-catalog/entity-catalog'; import { UserFavoriteManager } from '../../../core/src/core/user-favorite-manager'; import { environment } from '../../../core/src/environments/environment.prod'; import { ClearPaginationOfEntity } from '../actions/pagination.actions'; @@ -28,6 +26,8 @@ import { UpdateUserFavoriteMetadataSuccessAction, } from '../actions/user-favourites-actions/update-user-favorite-metadata-action'; import { DispatchOnlyAppState } from '../app-state'; +import { userFavoritesEntitySchema } from '../base-entity-schemas'; +import { entityCatalog } from '../entity-catalog/entity-catalog'; import { NormalizedResponse } from '../types/api.types'; import { PaginatedAction } from '../types/pagination.types'; import { WrapperRequestActionSuccess } from '../types/request.types'; diff --git a/src/frontend/packages/store/src/effects/user-profile.effects.ts b/src/frontend/packages/store/src/effects/user-profile.effects.ts index 3dc5da78d3..9d220c0f74 100644 --- a/src/frontend/packages/store/src/effects/user-profile.effects.ts +++ b/src/frontend/packages/store/src/effects/user-profile.effects.ts @@ -4,7 +4,6 @@ import { Actions, Effect, ofType } from '@ngrx/effects'; import { Store } from '@ngrx/store'; import { catchError, mergeMap, switchMap } from 'rxjs/operators'; -import { userProfileEntitySchema } from '../../../core/src/base-entity-schemas'; import { environment } from '../../../core/src/environments/environment'; import { FetchUserProfileAction, @@ -14,6 +13,7 @@ import { UpdateUserPasswordAction, UpdateUserProfileAction, } from '../actions/user-profile.actions'; +import { userProfileEntitySchema } from '../base-entity-schemas'; import { entityCatalog } from '../entity-catalog/entity-catalog'; import { UserProfileInfo } from '../types/user-profile.types'; import { DispatchOnlyAppState } from './../app-state'; diff --git a/src/frontend/packages/store/src/entity-catalog/entity-catalog-entity/entity-catalog-entity.ts b/src/frontend/packages/store/src/entity-catalog/entity-catalog-entity/entity-catalog-entity.ts index 3fa2b47b0a..b754067761 100644 --- a/src/frontend/packages/store/src/entity-catalog/entity-catalog-entity/entity-catalog-entity.ts +++ b/src/frontend/packages/store/src/entity-catalog/entity-catalog-entity/entity-catalog-entity.ts @@ -1,9 +1,9 @@ import { ActionReducer } from '@ngrx/store'; -import { endpointEntitySchema, STRATOS_ENDPOINT_TYPE } from '../../../../core/src/base-entity-schemas'; import { KnownKeys, NonOptionalKeys } from '../../../../core/src/core/utils.service'; import { getFullEndpointApiUrl } from '../../../../core/src/features/endpoints/endpoint-helpers'; import { IRequestEntityTypeState } from '../../app-state'; +import { endpointEntitySchema, STRATOS_ENDPOINT_TYPE } from '../../base-entity-schemas'; import { EntitiesFetchHandler, EntitiesInfoHandler, diff --git a/src/frontend/packages/store/src/entity-catalog/entity-catalog.spec.ts b/src/frontend/packages/store/src/entity-catalog/entity-catalog.spec.ts index 7f7a44f245..ce4979a9fc 100644 --- a/src/frontend/packages/store/src/entity-catalog/entity-catalog.spec.ts +++ b/src/frontend/packages/store/src/entity-catalog/entity-catalog.spec.ts @@ -1,8 +1,8 @@ -import { endpointEntitySchema } from '../../../core/src/base-entity-schemas'; import { BaseEndpointAuth } from '../../../core/src/features/endpoints/endpoint-auth'; import { EndpointListDetailsComponent, } from '../../../core/src/shared/components/list/list-types/endpoint/endpoint-list.helpers'; +import { endpointEntitySchema } from '../base-entity-schemas'; import { EntitySchema } from '../helpers/entity-schema'; import { TestEntityCatalog } from './entity-catalog'; import { StratosCatalogEndpointEntity, StratosCatalogEntity } from './entity-catalog-entity/entity-catalog-entity'; diff --git a/src/frontend/packages/store/src/entity-catalog/entity-catalog.ts b/src/frontend/packages/store/src/entity-catalog/entity-catalog.ts index c6371e3e17..40665ba7af 100644 --- a/src/frontend/packages/store/src/entity-catalog/entity-catalog.ts +++ b/src/frontend/packages/store/src/entity-catalog/entity-catalog.ts @@ -1,7 +1,7 @@ import { Action } from '@ngrx/store'; -import { STRATOS_ENDPOINT_TYPE } from '../../../core/src/base-entity-schemas'; import { IRequestEntityTypeState } from '../app-state'; +import { STRATOS_ENDPOINT_TYPE } from '../base-entity-schemas'; import { ExtraApiReducers } from '../reducers/api-request-reducers.generator.helpers'; import { ICurrentUserRolesState } from '../types/current-user-roles.types'; import { OrchestratedActionBuilders } from './action-orchestrator/action-orchestrator'; @@ -218,10 +218,10 @@ class EntityCatalog { ...state.endpoints, [endpoint.type]: endpointState } - } + }; } } - }) + }); return oneChanged ? { ...state } : state; diff --git a/src/frontend/packages/store/src/entity-catalog/entity-catalog.types.ts b/src/frontend/packages/store/src/entity-catalog/entity-catalog.types.ts index 7205f8ff23..a0bba1cf85 100644 --- a/src/frontend/packages/store/src/entity-catalog/entity-catalog.types.ts +++ b/src/frontend/packages/store/src/entity-catalog/entity-catalog.types.ts @@ -2,7 +2,6 @@ import { Store } from '@ngrx/store'; import { Observable } from 'rxjs'; import { EndpointHealthCheck } from '../../../core/endpoints-health-checks'; -import { EndpointAuthTypeConfig } from '../../../core/src/core/extension/extension-types'; import { FavoritesConfigMapper } from '../../../core/src/shared/components/favorites-meta-card/favorite-config-mapper'; import { StratosStatus } from '../../../core/src/shared/shared.types'; import { GeneralEntityAppState } from '../app-state'; @@ -21,6 +20,7 @@ import { import { PaginationPageIteratorConfig, } from '../entity-request-pipeline/pagination-request-base-handlers/pagination-iterator.pipe'; +import { EndpointAuthTypeConfig } from '../extension-types'; import { EntitySchema } from '../helpers/entity-schema'; import { UserFavorite } from '../types/user-favorites.types'; diff --git a/src/frontend/packages/store/src/entity-service.spec.ts b/src/frontend/packages/store/src/entity-service.spec.ts index e0e752ada8..8a754fbaae 100644 --- a/src/frontend/packages/store/src/entity-service.spec.ts +++ b/src/frontend/packages/store/src/entity-service.spec.ts @@ -4,12 +4,12 @@ import { inject, TestBed } from '@angular/core/testing'; import { Action, Store } from '@ngrx/store'; import { filter, first, map, pairwise, tap } from 'rxjs/operators'; -import { STRATOS_ENDPOINT_TYPE } from '../../core/src/base-entity-schemas'; import { ENTITY_SERVICE } from '../../core/src/shared/entity.tokens'; import { generateTestEntityServiceProvider } from '../../core/test-framework/entity-service.helper'; import { createEntityStore, TestStoreEntity } from '../testing/src/store-test-helper'; import { APIResponse } from './actions/request.actions'; import { GeneralAppState } from './app-state'; +import { STRATOS_ENDPOINT_TYPE } from './base-entity-schemas'; import { EntityCatalogTestModule, TEST_CATALOGUE_ENTITIES } from './entity-catalog-test.module'; import { StratosBaseCatalogEntity } from './entity-catalog/entity-catalog-entity/entity-catalog-entity'; import { EntityCatalogEntityConfig, IStratosEndpointDefinition } from './entity-catalog/entity-catalog.types'; diff --git a/src/frontend/packages/core/src/core/extension/extension-types.ts b/src/frontend/packages/store/src/extension-types.ts similarity index 100% rename from src/frontend/packages/core/src/core/extension/extension-types.ts rename to src/frontend/packages/store/src/extension-types.ts diff --git a/src/frontend/packages/store/src/reducers/api-request-reducer/request-helpers.ts b/src/frontend/packages/store/src/reducers/api-request-reducer/request-helpers.ts index ae52213fd9..900140b12a 100644 --- a/src/frontend/packages/store/src/reducers/api-request-reducer/request-helpers.ts +++ b/src/frontend/packages/store/src/reducers/api-request-reducer/request-helpers.ts @@ -1,6 +1,5 @@ import { Store } from '@ngrx/store'; -import { pathGet } from '../../../../core/src/core/utils.service'; import { APIResponse } from '../../actions/request.actions'; import { BaseRequestState, GeneralAppState } from '../../app-state'; import { BaseEntityRequestAction } from '../../entity-catalog/action-orchestrator/action-orchestrator'; @@ -82,7 +81,7 @@ export function createRequestStateFromResponse( export type ApiRequestTypes = 'fetch' | 'update' | 'create' | 'delete'; export function getRequestTypeFromMethod(action: EntityRequestAction): ApiRequestTypes { - let method = pathGet('options.method', action); + let method = action.options ? action.options.method : undefined; if (typeof method === 'string') { method = method.toString().toLowerCase(); if (method === 'post') { diff --git a/src/frontend/packages/store/src/reducers/current-user-roles-reducer/recently-visited.reducer.ts b/src/frontend/packages/store/src/reducers/current-user-roles-reducer/recently-visited.reducer.ts index d4cbac1c03..57bd991ef2 100644 --- a/src/frontend/packages/store/src/reducers/current-user-roles-reducer/recently-visited.reducer.ts +++ b/src/frontend/packages/store/src/reducers/current-user-roles-reducer/recently-visited.reducer.ts @@ -1,15 +1,15 @@ import { Action } from '@ngrx/store'; -import { STRATOS_ENDPOINT_TYPE } from '../../../../core/src/base-entity-schemas'; import { DISCONNECT_ENDPOINTS_SUCCESS, DisconnectEndpoint, GET_ENDPOINTS_SUCCESS, + GetAllEndpointsSuccess, UNREGISTER_ENDPOINTS_SUCCESS, } from '../../actions/endpoint.actions'; import { AddRecentlyVisitedEntityAction, SetRecentlyVisitedEntityAction } from '../../actions/recently-visited.actions'; import { entityCatalog } from '../../entity-catalog/entity-catalog'; -import { endpointSchemaKey } from '../../helpers/stratos-entity-factory'; +import { endpointSchemaKey, STRATOS_ENDPOINT_TYPE } from '../../helpers/stratos-entity-factory'; import { IRecentlyVisitedState } from '../../types/recently-visited.types'; import { addNewHit, cleanRecentsList, getDefaultRecentState } from './recently-visited.reducer.helpers'; diff --git a/src/frontend/packages/store/src/reducers/pagination-reducer/pagination.reducer.spec.ts b/src/frontend/packages/store/src/reducers/pagination-reducer/pagination.reducer.spec.ts index 4a5caa3539..48788d016c 100644 --- a/src/frontend/packages/store/src/reducers/pagination-reducer/pagination.reducer.spec.ts +++ b/src/frontend/packages/store/src/reducers/pagination-reducer/pagination.reducer.spec.ts @@ -1,6 +1,7 @@ import { HttpRequest } from '@angular/common/http'; import { RequestTypes } from '../../actions/request.actions'; +import { ENDPOINT_TYPE, endpointEntitySchema, STRATOS_ENDPOINT_TYPE } from '../../base-entity-schemas'; import { entityCatalog } from '../../entity-catalog/entity-catalog'; import { EntityCatalogHelpers } from '../../entity-catalog/entity-catalog.helper'; import { EntitySchema } from '../../helpers/entity-schema'; diff --git a/src/frontend/packages/store/src/selectors/endpoint.selectors.ts b/src/frontend/packages/store/src/selectors/endpoint.selectors.ts index 3e512eefca..5d255df88b 100644 --- a/src/frontend/packages/store/src/selectors/endpoint.selectors.ts +++ b/src/frontend/packages/store/src/selectors/endpoint.selectors.ts @@ -1,7 +1,7 @@ import { compose } from '@ngrx/store'; -import { STRATOS_ENDPOINT_TYPE } from '../../../core/src/base-entity-schemas'; import { InternalAppState, IRequestEntityTypeState } from '../app-state'; +import { STRATOS_ENDPOINT_TYPE } from '../base-entity-schemas'; import { EntityCatalogHelpers } from '../entity-catalog/entity-catalog.helper'; import { endpointSchemaKey } from '../helpers/stratos-entity-factory'; import { EndpointModel, EndpointState } from '../types/endpoint.types'; diff --git a/src/frontend/packages/store/src/selectors/favorite-groups.selectors.ts b/src/frontend/packages/store/src/selectors/favorite-groups.selectors.ts index a1b3158b2e..dfb30707a2 100644 --- a/src/frontend/packages/store/src/selectors/favorite-groups.selectors.ts +++ b/src/frontend/packages/store/src/selectors/favorite-groups.selectors.ts @@ -1,8 +1,8 @@ import { compose } from '@ngrx/store'; -import { STRATOS_ENDPOINT_TYPE, userFavoritesEntitySchema } from '../../../core/src/base-entity-schemas'; import { deriveEndpointFavoriteFromFavorite } from '../../../core/src/core/user-favorite-helpers'; import { InternalAppState, IRequestEntityTypeState } from '../app-state'; +import { STRATOS_ENDPOINT_TYPE, userFavoritesEntitySchema } from '../base-entity-schemas'; import { entityCatalog } from '../entity-catalog/entity-catalog'; import { IUserFavoriteGroup, IUserFavoritesGroups, IUserFavoritesGroupsState } from '../types/favorite-groups.types'; import { IFavoriteMetadata, UserFavorite } from '../types/user-favorites.types'; diff --git a/src/frontend/packages/store/src/store.module.ts b/src/frontend/packages/store/src/store.module.ts index d66eb95791..794355dc3a 100644 --- a/src/frontend/packages/store/src/store.module.ts +++ b/src/frontend/packages/store/src/store.module.ts @@ -14,7 +14,6 @@ import { PermissionsEffects } from './effects/permissions.effect'; import { RecursiveDeleteEffect } from './effects/recursive-entity-delete.effect'; import { RouterEffect } from './effects/router.effects'; import { SetClientFilterEffect } from './effects/set-client-filter.effect'; -import { SnackBarEffects } from './effects/snackBar.effects'; import { SystemEffects } from './effects/system.effects'; import { UAASetupEffect } from './effects/uaa-setup.effects'; import { UserFavoritesEffect } from './effects/user-favorites-effect'; @@ -41,7 +40,6 @@ import { AppReducersModule } from './reducers.module'; ActionHistoryEffect, RouterEffect, SystemEffects, - SnackBarEffects, SetClientFilterEffect, MetricsEffect, UserProfileEffect, diff --git a/src/frontend/packages/store/src/types/endpoint.types.ts b/src/frontend/packages/store/src/types/endpoint.types.ts index 2fcc8b8c95..5cf9cd7011 100644 --- a/src/frontend/packages/store/src/types/endpoint.types.ts +++ b/src/frontend/packages/store/src/types/endpoint.types.ts @@ -1,6 +1,6 @@ -import { EndpointType } from '../../../core/src/core/extension/extension-types'; import { StratosScopeStrings } from '../../../core/src/core/permissions/stratos-user-permissions.checker'; import { MetricsAPITargets, MetricsStratosInfo } from '../actions/metrics-api.actions'; +import { EndpointType } from '../extension-types'; import { endpointSchemaKey } from '../helpers/stratos-entity-factory'; import { RequestSectionKeys, TRequestTypeKeys } from '../reducers/api-request-reducer/types'; @@ -13,6 +13,7 @@ export interface INewlyConnectedEndpointInfo { user: EndpointUser; } +// TODO: RC REMOVE export const endpointStoreNames: { section: TRequestTypeKeys, type: string diff --git a/src/frontend/packages/store/testing/src/store-test-helper.ts b/src/frontend/packages/store/testing/src/store-test-helper.ts index 3dac3230b7..44b01d7eb7 100644 --- a/src/frontend/packages/store/testing/src/store-test-helper.ts +++ b/src/frontend/packages/store/testing/src/store-test-helper.ts @@ -2,8 +2,8 @@ import { ModuleWithProviders } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { Store, StoreModule } from '@ngrx/store'; -import { endpointEntitySchema } from '../../../core/src/base-entity-schemas'; import { AppState } from '../../src/app-state'; +import { endpointEntitySchema } from '../../src/base-entity-schemas'; import { entityCatalog } from '../../src/entity-catalog/entity-catalog'; import { EntityCatalogEntityConfig } from '../../src/entity-catalog/entity-catalog.types'; import { appReducers } from '../../src/reducers.module';