Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Move out CF themeing and routing from core to cf, fix cf code splitting #4410

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { DatePipe } from '@angular/common';
import { NgModule } from '@angular/core';
import { NgxChartsModule } from '@swimlane/ngx-charts';

import { ApplicationService } from '../../../cloud-foundry/src/features/applications/application.service';
import {
ApplicationEnvVarsHelper,
} from '../../../cloud-foundry/src/features/applications/application/application-tabs-base/tabs/build-tab/application-env-vars.service';
import { CloudFoundrySharedModule } from '../../../cloud-foundry/src/shared/cf-shared.module';
import { CoreModule } from '../../../core/src/core/core.module';
import { SharedModule } from '../../../core/src/shared/shared.module';
Expand Down Expand Up @@ -82,7 +86,9 @@ import { AutoscalerRoutingModule } from './autoscaler.routing';
CardAutoscalerDefaultComponent
],
providers: [
ApplicationService
ApplicationService,
ApplicationEnvVarsHelper,
DatePipe
]
})
export class AutoscalerModule { }
12 changes: 11 additions & 1 deletion src/frontend/packages/cloud-foundry/sass/_all-theme.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
// Theming for the copmponents in the Cloud Foundry package

@import '../src/features/applications/application-wall/application-wall.component.theme';
@import '../src/shared/components/list/list-types/cf-security-groups/cf-security-groups-card/cf-security-groups-card.component.theme';
@import '../src/shared/components/schema-form/schema-form.component.theme';
@import '../src/features/cloud-foundry/tabs/cf-admin-add-user-warning/cf-admin-add-user-warning.component.theme';
@import '../src/features/applications/deploy-application/deploy-application.component.theme';
@import '../src/features/applications/deploy-application/deploy-application-step2/deploy-application-fs/deploy-application-fs.component.theme';
@import '../src/features/cloud-foundry/tabs/cloud-foundry-firehose/cloud-foundry-firehose.component.theme';

@mixin apply-theme-stratos-cloud-foundry($stratos-theme) {

$theme: map-get($stratos-theme, theme);
$app-theme: map-get($stratos-theme, app-theme);

@include cf-security-group-theme($theme);
@include app-schema-form-theme($theme, $app-theme);
@include cf-admin-add-user-warning($theme, $app-theme);
@include app-deploy-app-theme($theme, $app-theme);
@include app-deploy-app-fs-component-theme($theme, $app-theme);
@include app-cloud-foundry-firehose-theme($theme, $app-theme);

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import { MDAppModule } from '../../core/src/core/md.module';
import { SharedModule } from '../../core/src/shared/shared.module';
import { EntityCatalogModule } from '../../store/src/entity-catalog.module';
import { generateCFEntities } from './cf-entity-generator';
import { ApplicationsModule } from './features/applications/applications.module';
import { CloudFoundryModule } from './features/cloud-foundry/cloud-foundry.module';
import { ServiceCatalogModule } from './features/service-catalog/service-catalog.module';
import { ServicesModule } from './features/services/services.module';
import { CloudFoundryRoutingModule } from './cloud-foundry-routing.module';
import { CloudFoundrySharedModule } from './shared/cf-shared.module';
import { CfUserService } from './shared/data-services/cf-user.service';
import { CloudFoundryService } from './shared/data-services/cloud-foundry.service';
Expand All @@ -24,18 +21,10 @@ import { cfCurrentUserPermissionsService } from './user-permissions/cf-user-perm
CommonModule,
SharedModule,
MDAppModule,
ApplicationsModule,
CloudFoundryModule,
ServiceCatalogModule,
ServicesModule,
CloudFoundryStoreModule,
// FIXME: Ensure that anything lazy loaded is not included here - #3675
CloudFoundrySharedModule,
// FIXME: Move cf effects into cf module - #3675
// EffectsModule.for Root([
// PermissionsEffects,
// PermissionEffects
// ])
CloudFoundryRoutingModule
],
providers: [
...cfCurrentUserPermissionsService,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

const customRoutes: Routes = [
{
path: 'applications',
loadChildren: () => import('./features/applications/applications.module').then(m => m.ApplicationsModule),
data: {
stratosNavigation: {
label: 'Applications',
matIcon: 'apps',
requiresEndpointType: 'cf',
position: 20
}
},
},
{
path: 'marketplace',
loadChildren: () => import('./features/service-catalog/service-catalog.module')
.then(m => m.ServiceCatalogModule),
data: {
stratosNavigation: {
label: 'Marketplace',
matIcon: 'store',
requiresEndpointType: 'cf',
position: 30
}
},
},
{
path: 'services',
loadChildren: () => import('./features/services/services.module').then(m => m.ServicesModule),
data: {
stratosNavigation: {
label: 'Services',
matIcon: 'service',
matIconFont: 'stratos-icons',
requiresEndpointType: 'cf',
position: 40
}
},
},
{
path: 'cloud-foundry',
loadChildren: () => import('./features/cloud-foundry/cloud-foundry-section.module').then(m => m.CloudFoundrySectionModule),
data: {
stratosNavigation: {
label: 'Cloud Foundry',
matIcon: 'cloud_foundry',
matIconFont: 'stratos-icons',
requiresEndpointType: 'cf',
position: 50
}
},
},
]

@NgModule({
imports: [
RouterModule.forRoot(customRoutes),
],
declarations: []
})
export class CloudFoundryRoutingModule { }

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DatePipe } from '@angular/common';
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { NgxChartsModule } from '@swimlane/ngx-charts';
Expand All @@ -21,8 +22,8 @@ import { CreateSpaceStepComponent } from './add-space/create-space-step/create-s
import { ActiveRouteCfCell, ActiveRouteCfOrgSpace } from './cf-page.types';
import { CliInfoCloudFoundryComponent } from './cli-info-cloud-foundry/cli-info-cloud-foundry.component';
import { CloudFoundryBaseComponent } from './cloud-foundry-base/cloud-foundry-base.component';
import { CloudFoundrySectionRoutingModule } from './cloud-foundry-section.routing';
import { CloudFoundryTabsBaseComponent } from './cloud-foundry-tabs-base/cloud-foundry-tabs-base.component';
import { CloudFoundryRoutingModule } from './cloud-foundry.routing';
import { CloudFoundryComponent } from './cloud-foundry/cloud-foundry.component';
import { EditOrganizationStepComponent } from './edit-organization/edit-organization-step/edit-organization-step.component';
import { EditOrganizationComponent } from './edit-organization/edit-organization.component';
Expand Down Expand Up @@ -137,7 +138,7 @@ import { RemoveUserComponent } from './users/remove-user/remove-user.component';
imports: [
CoreModule,
SharedModule,
CloudFoundryRoutingModule,
CloudFoundrySectionRoutingModule,
RouterModule,
NgxChartsModule,
CloudFoundrySharedModule
Expand Down Expand Up @@ -228,9 +229,10 @@ import { RemoveUserComponent } from './users/remove-user/remove-user.component';
CloudFoundryCellService,
UserInviteService,
UserInviteConfigureService,
DatePipe
],
entryComponents: [
UserInviteConfigurationDialogComponent
]
})
export class CloudFoundryModule { }
export class CloudFoundrySectionModule { }
Original file line number Diff line number Diff line change
Expand Up @@ -427,4 +427,4 @@ const cloudFoundry: Routes = [{
@NgModule({
imports: [RouterModule.forChild(cloudFoundry)]
})
export class CloudFoundryRoutingModule { }
export class CloudFoundrySectionRoutingModule { }
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { HttpClientModule } from '@angular/common/http';
import { inject, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';

import { SharedModule } from '../../../../../../core/src/shared/shared.module';
import { generateCfStoreModules } from '../../../../../test-framework/cloud-foundry-endpoint-service.helper';
import { CfUserService } from '../../../../shared/data-services/cf-user.service';
import { CloudFoundryModule } from '../../cloud-foundry.module';
import { CloudFoundrySectionModule } from '../../cloud-foundry-section.module';
import { CfRolesService } from './cf-roles.service';
import { HttpClientModule } from '@angular/common/http';

describe('CfRolesService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
...generateCfStoreModules(),
SharedModule,
CloudFoundryModule,
CloudFoundrySectionModule,
HttpClientModule,
RouterTestingModule
],
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CommonModule } from '@angular/common';
import { CommonModule, DatePipe } from '@angular/common';
import { NgModule } from '@angular/core';

import { CoreModule } from '../../../../core/src/core/core.module';
Expand Down Expand Up @@ -33,6 +33,9 @@ import { ServiceTabsBaseComponent } from './service-tabs-base/service-tabs-base.
],
exports: [
ServiceTabsBaseComponent,
],
providers: [
DatePipe
]
})
export class ServiceCatalogModule { }

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CommonModule } from '@angular/common';
import { CommonModule, DatePipe } from '@angular/common';
import { NgModule } from '@angular/core';

import {
Expand Down Expand Up @@ -27,6 +27,9 @@ import { ServicesRoutingModule } from './services.routing';
ServicesWallComponent,
DetachServiceInstanceComponent,
DetachAppsComponent
],
providers: [
DatePipe
]
})
export class ServicesModule { }
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,6 @@ import { CfUserPermissionDirective } from './directives/cf-user-permission/cf-us
import { ApplicationStateService } from './services/application-state.service';
import { CloudFoundryUserProvidedServicesService } from './services/cloud-foundry-user-provided-services.service';

// tslint:disable:max-line-length
// tslint:enable:max-line-length

const cfListTableCells: Type<TableCellCustom<any>>[] = [
TableCellServiceInstanceAppsAttachedComponent,
TableCellServiceComponent,
Expand Down Expand Up @@ -267,8 +264,6 @@ const cfListCards: Type<CardCell<any>>[] = [
UserProvidedServiceInstanceCardComponent,
];

// listTableCells.push();

@NgModule({
imports: [
CommonModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { NgModule } from '@angular/core';
import { EffectsModule } from '@ngrx/effects';

import { ActiveRouteCfOrgSpace } from '../features/cloud-foundry/cf-page.types';
import { CloudFoundryReducersModule } from './cloud-foundry.reducers.module';
import { AppVariablesEffect } from './effects/app-variables.effects';
import { AppEffects } from './effects/app.effects';
Expand Down Expand Up @@ -30,6 +31,12 @@ import { UsersRolesEffects } from './effects/users-roles.effects';
CfValidateEffects,
UsersRolesEffects
])
],
providers: [
{
provide: ActiveRouteCfOrgSpace,
useValue: {}
},
]
})
export class CloudFoundryStoreModule { }
15 changes: 1 addition & 14 deletions src/frontend/packages/core/sass/_all-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,7 @@
@import '../src/shared/components/favorites-global-list/favorites-global-list.component.theme';
@import '../src/shared/components/favorites-meta-card/favorites-meta-card.component.theme';

@import '../../cloud-foundry/src/shared/components/schema-form/schema-form.component.theme';
@import '../../cloud-foundry/src/features/services/services-wall/services-wall.component.theme';
@import '../../cloud-foundry/src/features/cloud-foundry/tabs/cf-admin-add-user-warning/cf-admin-add-user-warning.component.theme';
@import '../../cloud-foundry/src/features/applications/application/application-base.component.theme';
@import '../../cloud-foundry/src/features/applications/deploy-application/deploy-application.component.theme';
@import '../../cloud-foundry/src/features/applications/deploy-application/deploy-application-step2/deploy-application-fs/deploy-application-fs.component.theme';
@import '../../cloud-foundry/src/features/cloud-foundry/tabs/cloud-foundry-firehose/cloud-foundry-firehose.component.theme';
@import '../../cloud-foundry/src/features/service-catalog/service-catalog-page/service-catalog-page.component.theme';

@import '../../core/src/features/error-page/error-page/error-page.component.theme';
@import '../../core/src/features/endpoints/backup-restore/restore-endpoints/restore-endpoints.component.theme';
@import '../../core/src/features/metrics/metrics/metrics.component.theme';
Expand All @@ -88,7 +81,6 @@
@include display-value-theme($theme, $app-theme);
@include steppers-theme($theme, $app-theme);
@include list-theme($theme, $app-theme);
@include app-base-page-theme($theme, $app-theme);
@include app-mat-snack-bar-theme($theme, $app-theme);
@include ngx-charts-gauge($theme, $app-theme);
@include app-text-status-theme($theme, $app-theme);
Expand All @@ -101,8 +93,6 @@
@include app-boolean-indicator-theme($theme, $app-theme);
@include loading-page-theme($theme, $app-theme);
@include app-log-viewer-theme($theme, $app-theme);
@include app-deploy-app-theme($theme, $app-theme);
@include app-cloud-foundry-firehose-theme($theme, $app-theme);
@include app-card-number-metric-theme($theme, $app-theme);
@include app-card-boolean-metric-theme($theme, $app-theme);
@include app-dot-content($theme, $app-theme);
Expand All @@ -111,12 +101,10 @@
@include app-page-header-events($theme, $app-theme);
@include app-user-profile-banner-component-theme($theme, $app-theme);
@include action-monitor-icon-theme($theme, $app-theme);
@include app-deploy-app-fs-component-theme($theme, $app-theme);
@include app-upload-progress-indicator-component-theme($theme, $app-theme);
@include page-404($theme, $app-theme);
@include about-page-theme($theme, $app-theme);
@include meta-card-component($theme, $app-theme);
@include app-schema-form-theme($theme, $app-theme);
@include start-end-theme($theme, $app-theme);
@include metrics-chart-theme($theme, $app-theme);
@include metrics-range-selector-theme($theme, $app-theme);
Expand All @@ -130,7 +118,6 @@
@include favorites-global-list-theme($theme, $app-theme);
@include favorites-meta-card-theme($theme, $app-theme);
@include page-side-nav-theme($theme, $app-theme);
@include cf-admin-add-user-warning($theme, $app-theme);
@include entity-summary-title-theme($theme, $app-theme);
@include app-meta-card-item-theme($theme, $app-theme);
@include error-page-theme($theme, $app-theme);
Expand Down
Loading