Skip to content

Commit

Permalink
Tidy up cusotmizations. Fix logo customization.
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac committed Sep 4, 2018
1 parent 3fc8e33 commit 083784d
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ src/frontend/sass/custom.scss
src/frontend/assets/eula.html
src/frontend/assets/logo.png
src/frontend/assets/login-bg.jpg
src/frontend/app/custom.module.ts
src/frontend/app/custom-import.module.ts
src/frontend/app/custom
src/frontend/assets/custom
src/frontend/sass/custom
Expand Down
18 changes: 18 additions & 0 deletions build/customize-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
const customBaseFolder = path.resolve(__dirname, '../custom-src/frontend');
doCustomizeFiles(forceDefaults, reset, customConfig, baseFolder, customBaseFolder);
doCustomizeFolders(forceDefaults, reset, customConfig, baseFolder, customBaseFolder);
doCustomizeCreateModule(forceDefaults, reset, customConfig, baseFolder, customBaseFolder);

const backendBaseFolder = path.resolve(__dirname, '../src/jetstream/plugins');
const backendCustomBaseFolder = path.resolve(__dirname, '../custom-src/jetstream');
Expand Down Expand Up @@ -118,6 +119,23 @@
});
}

// Copy the correct custom module to either import the supplied custom module or provide an empty module
function doCustomizeCreateModule(forceDefaults, reset, customConfig, baseFolder, customBaseFolder) {
const defaultSrcFolder = path.resolve(__dirname, '../src/frontend/misc/custom');
const destFile = path.join(baseFolder, 'app/custom-import.module.ts');
const customModuleFile = path.join(baseFolder, 'app/custom/custom.module.ts');

// Delete the existing file if it exists
if (fs.existsSync(destFile)) {
fs.unlinkSync(destFile)
}

if (!reset) {
const srcFile = fs.existsSync(customModuleFile) ? 'custom-src.module.ts_' : 'custom.module.ts_';
fs.copySync(path.join(defaultSrcFolder, srcFile), destFile);
}
}

function doCustomizeBackend(reset, baseFolder, customBaseFolder) {
// Symlink custom backend plugin folders if they are present
// Get all of the sub-folders in the custom-src/backend folder and symlink
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { RouterStateSerializer, StoreRouterConnectingModule } from '@ngrx/router
import { AppComponent } from './app.component';
import { RouteModule } from './app.routing';
import { CoreModule } from './core/core.module';
import { CustomModule } from './custom.module';
import { CustomImportModule } from './custom-import.module';
import { AboutModule } from './features/about/about.module';
import { ApplicationsModule } from './features/applications/applications.module';
import { DashboardModule } from './features/dashboard/dashboard.module';
Expand Down Expand Up @@ -75,7 +75,7 @@ export class CustomRouterStateSerializer
ServiceCatalogModule,
StoreRouterConnectingModule, // Create action for router navigation
AboutModule,
CustomModule,
CustomImportModule,
XSRFModule,
],
providers: [
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/app/features/about/about.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NgModule } from '@angular/core';
import { CoreModule } from '../../core/core.module';
import { CustomModule } from '../../custom.module';
import { CustomImportModule } from '../../custom-import.module';
import { SharedModule } from '../../shared/shared.module';
import { AboutPageComponent } from './about-page/about-page.component';
import { AboutRoutingModule } from './about.routing';
Expand All @@ -14,7 +14,7 @@ import { DiagnosticsPageComponent } from './diagnostics-page/diagnostics-page.co
CoreModule,
SharedModule,
AboutRoutingModule,
CustomModule
CustomImportModule
],
declarations: [
AboutPageComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="stratos-title">
<img class="stratos-title__logo" src="/assets/stratos-logo.png" />
<img class="stratos-title__logo" src="/assets/logo.png" />
<h1 class="mat-h1 stratos-title__header">Stratos</h1>
</div>
Binary file removed src/frontend/assets/stratos-logo.png
Binary file not shown.
13 changes: 13 additions & 0 deletions src/frontend/misc/custom/custom-src.module.ts_
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { CustomModule } from './custom/custom.module';

// Default import customization module - DO NOT EDIT

// This file is in the .gitignore - changes will not be flagged

@NgModule({
imports: [
CustomModule,
]
})
export class CustomImportModule { }
4 changes: 1 addition & 3 deletions src/frontend/misc/custom/custom.module.ts_
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { NgModule } from '@angular/core';

// This file is in the .gitignore - changes will not be flagged

// The customization build step will replace this file with the custom one if provided

@NgModule()
export class CustomModule { }
export class CustomImportModule { }

1 change: 0 additions & 1 deletion src/frontend/misc/custom/custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

files:
custom.scss: "sass/custom.scss"
custom.module.ts_: "app/custom.module.ts"
favicon.ico: "favicon.ico"
login-bg.jpg: "assets/login-bg.jpg"
logo.png: "assets/logo.png"
Expand Down
Binary file modified src/frontend/misc/custom/logo.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 083784d

Please sign in to comment.