Skip to content

Commit

Permalink
Permit custom dashboard path to be set in FF
Browse files Browse the repository at this point in the history
part 2 or 2 @flowforge/flowforge/#744
  • Loading branch information
Steve-Mcl committed Aug 30, 2022
1 parent 13a1a31 commit 0f47543
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/runtimeSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ function getSettingsFile (settings) {
const projectSettings = {
credentialSecret: '',
httpAdminRoot: '',
dashboardUI: '',
disableEditor: '',
codeEditor: 'monaco',
theme: 'forge-light',
Expand Down Expand Up @@ -31,6 +32,9 @@ function getSettingsFile (settings) {
if (settings.settings.httpAdminRoot !== undefined) {
projectSettings.httpAdminRoot = `httpAdminRoot: '${settings.settings.httpAdminRoot}',`
}
if (settings.settings.dashboardUI !== undefined) {
projectSettings.dashboardUI = `ui: { path: '${settings.settings.dashboardUI}' },`
}
if (settings.settings.disableEditor !== undefined) {
projectSettings.disableEditor = `disableEditor: ${settings.settings.disableEditor},`
}
Expand Down Expand Up @@ -109,6 +113,7 @@ module.exports = {
}),
${projectSettings.credentialSecret}
${projectSettings.httpAdminRoot}
${projectSettings.dashboardUI}
${projectSettings.disableEditor}
httpServerOptions: {
"trust proxy": true
Expand Down
3 changes: 3 additions & 0 deletions test/unit/lib/runtimeSettings_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('Runtime Settings', function () {
const settings = await loadSettings(result)
settings.should.not.have.property('credentialSecret')
settings.should.not.have.property('httpAdminRoot')
settings.should.not.have.property('ui') // dashboardUI
settings.should.not.have.property('disableEditor')
settings.should.not.have.property('nodesDir')
settings.should.have.property('editorTheme')
Expand Down Expand Up @@ -85,6 +86,7 @@ describe('Runtime Settings', function () {
},
settings: {
httpAdminRoot: '/red',
dashboardUI: '/dash',
disableEditor: true,
codeEditor: 'ace',
theme: 'forge-dark',
Expand Down Expand Up @@ -113,6 +115,7 @@ describe('Runtime Settings', function () {
const settings = await loadSettings(result)
settings.should.have.property('credentialSecret', 'foo')
settings.should.have.property('httpAdminRoot', '/red')
settings.should.have.property('ui', { path: '/dash' })
settings.should.have.property('disableEditor', true)

settings.should.have.property('httpStorage', {
Expand Down

0 comments on commit 0f47543

Please sign in to comment.