Skip to content

Commit cd2f5c5

Browse files
authored
Merge branch 'develop' into fix/OptionalVariablesOnQuery
2 parents 17b98c8 + 55ffed8 commit cd2f5c5

File tree

14 files changed

+53
-5
lines changed

14 files changed

+53
-5
lines changed

docs/modules/ROOT/pages/developer-guide/configuration.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ will look like this:
1616
....
1717
{
1818
"ssoEnabled": false,
19+
"ssoProviders": [],
1920
"ssoDiscoveryUrl": "https://example.com",
2021
"standalone": false,
2122
"standaloneProtocol": "neo4j",
@@ -37,6 +38,8 @@ will look like this:
3738
using SSO. This requires the app to be running in standalone mode, and a
3839
valid ssoDiscoveryUrl to be set.
3940

41+
|ssoProviders |List |[] |When using multiple SSO providers on the database, you can configure the list of providers (by id) to be used on Neodash. If empty, all providers will be displayed.
42+
4043
|ssoDiscoveryUrl |string |https://example.com |If ssoEnabled is true &
4144
standalone mode is enabled, the URL to retrieve SSO auth config from.
4245

docs/modules/ROOT/pages/developer-guide/standalone-mode.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ variables to Docker:
3939
....
4040
docker run -it --rm -p 5005:5005 \
4141
-e ssoEnabled=false \
42+
-e ssoProviders=[] \
4243
-e ssoDiscoveryUrl="https://example.com" \
4344
-e standalone=true \
4445
-e standaloneProtocol="neo4j" \

docs/modules/ROOT/pages/developer-guide/state-management.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ standalone mode.
127127
"standalone": false,
128128
"oldDashboard": null,
129129
"ssoEnabled": false,
130+
"ssoProviders": [],
130131
"ssoDiscoveryUrl": "https://example.com",
131132
"standaloneProtocol": "neo4j",
132133
"standaloneHost": "localhost",

public/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"ssoEnabled": false,
3+
"ssoProviders": [],
34
"ssoDiscoveryUrl": "https://example.com",
45
"standalone": false,
56
"standaloneProtocol": "neo4j",

scripts/config-entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -e
55
echo " \
66
{ \
77
\"ssoEnabled\": ${ssoEnabled:=false}, \
8+
\"ssoProviders\": ${ssoProviders:=[]}, \
89
\"ssoDiscoveryUrl\": \"${ssoDiscoveryUrl:='https://example.com'}\", \
910
\"standalone\": "${standalone:=false}", \
1011
\"standaloneProtocol\": \"${standaloneProtocol:='neo4j+s'}\", \

src/application/ApplicationActions.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ export const setSSOEnabled = (enabled: boolean, discoveryUrl: string) => ({
178178
payload: { enabled, discoveryUrl },
179179
});
180180

181+
export const SET_SSO_PROVIDERS = 'APPLICATION/SET_SSO_PROVIDERS';
182+
export const setSSOProviders = (providers: []) => ({
183+
type: SET_SSO_PROVIDERS,
184+
payload: { providers },
185+
});
186+
181187
export const SET_WAIT_FOR_SSO = 'APPLICATION/SET_WAIT_FOR_SSO';
182188
export const setWaitForSSO = (wait: boolean) => ({
183189
type: SET_WAIT_FOR_SSO,

src/application/ApplicationReducer.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
SET_SESSION_PARAMETERS,
2222
SET_SHARE_DETAILS_FROM_URL,
2323
SET_SSO_ENABLED,
24+
SET_SSO_PROVIDERS,
2425
SET_STANDALONE_DASHBOARD_DATEBASE,
2526
SET_STANDALONE_ENABLED,
2627
SET_STANDALONE_MODE,
@@ -112,6 +113,11 @@ export const applicationReducer = (state = initialState, action: { type: any; pa
112113
state = update(state, { ssoEnabled: enabled, ssoDiscoveryUrl: discoveryUrl });
113114
return state;
114115
}
116+
case SET_SSO_PROVIDERS: {
117+
const { providers } = payload;
118+
state = update(state, { ssoProviders: providers });
119+
return state;
120+
}
115121
case SET_WAIT_FOR_SSO: {
116122
const { wait } = payload;
117123
state = update(state, { waitForSSO: wait });

src/application/ApplicationSelectors.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export const applicationHasReportHelpModalOpen = (state: any) => {
6464
export const applicationGetSsoSettings = (state: any) => {
6565
return {
6666
ssoEnabled: state.application.ssoEnabled,
67+
ssoProviders: state.application.ssoProviders,
6768
ssoDiscoveryUrl: state.application.ssoDiscoveryUrl,
6869
cachedSSODiscoveryUrl: state.application.cachedSSODiscoveryUrl,
6970
};

src/application/ApplicationThunks.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
clearDesktopConnectionProperties,
3131
clearNotification,
3232
setSSOEnabled,
33+
setSSOProviders,
3334
setStandaloneEnabled,
3435
setAboutModalOpen,
3536
setStandaloneMode,
@@ -340,6 +341,7 @@ export const onConfirmLoadSharedDashboardThunk = () => (dispatch: any, getState:
340341
export const loadApplicationConfigThunk = () => async (dispatch: any, getState: any) => {
341342
let config = {
342343
ssoEnabled: false,
344+
ssoProviders: [],
343345
ssoDiscoveryUrl: 'http://example.com',
344346
standalone: false,
345347
standaloneProtocol: 'neo4j',
@@ -377,6 +379,7 @@ export const loadApplicationConfigThunk = () => async (dispatch: any, getState:
377379
}
378380
const state = getState();
379381
dispatch(setSSOEnabled(config.ssoEnabled, state.application.cachedSSODiscoveryUrl));
382+
dispatch(setSSOProviders(config.ssoProviders));
380383

381384
const { standalone } = config;
382385
dispatch(

src/chart/ChartUtils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ export function getRecordType(value) {
140140
return 'objectNumber';
141141
}
142142
return 'object';
143+
} else if (typeof value === 'string' || value instanceof String) {
144+
if (value.startsWith('http') || value.startsWith('https')) {
145+
return 'link';
146+
}
147+
return 'string';
143148
}
144149

145150
// Use string as default type

0 commit comments

Comments
 (0)