Skip to content

Commit b8de28e

Browse files
Merge pull request #1773 from ral-facilities/unauthorised-route-config
Actually handle unauthorised route config
2 parents b4dc61f + 8f8b32d commit b8de28e

File tree

7 files changed

+19
-2
lines changed

7 files changed

+19
-2
lines changed

packages/datagateway-common/src/state/actions/actions.types.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {
2-
MicroFrontendId,
32
Datafile,
43
Dataset,
4+
DownloadSettingsAccessMethod,
55
Instrument,
66
Investigation,
7-
DownloadSettingsAccessMethod,
7+
MicroFrontendId,
88
} from '../../app.types';
99
import { DlsDatasetDetailsPanelTab } from '../../detailsPanels/dls/datasetDetailsPanel.component';
1010
import { DlsVisitDetailsPanelTab } from '../../detailsPanels/dls/visitDetailsPanel.component';
@@ -75,6 +75,7 @@ export interface PluginRoute {
7575
displayName: string;
7676
admin?: boolean;
7777
hideFromMenu?: boolean;
78+
unauthorised?: boolean;
7879
order: number;
7980
}
8081

packages/datagateway-dataview/src/main.test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ describe('index - fetchSettings', () => {
6363
displayName: 'displayName',
6464
admin: false,
6565
hideFromMenu: false,
66+
unauthorised: false,
6667
order: 0,
6768
helpSteps: [],
6869
logoLightMode: LogoLight,
@@ -101,6 +102,7 @@ describe('index - fetchSettings', () => {
101102
displayName: 'displayName1',
102103
order: 1,
103104
hideFromMenu: true,
105+
unauthorised: true,
104106
},
105107
],
106108
helpSteps: [{ target: '#id', content: 'content' }],
@@ -125,6 +127,7 @@ describe('index - fetchSettings', () => {
125127
displayName: 'displayName0',
126128
admin: true,
127129
hideFromMenu: false,
130+
unauthorised: false,
128131
order: 0,
129132
helpSteps: [{ target: '#id', content: 'content' }],
130133
logoLightMode: LogoLight,
@@ -143,6 +146,7 @@ describe('index - fetchSettings', () => {
143146
displayName: 'displayName1',
144147
admin: false,
145148
hideFromMenu: true,
149+
unauthorised: true,
146150
order: 1,
147151
helpSteps: [],
148152
logoLightMode: LogoLight,

packages/datagateway-dataview/src/main.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ export const fetchSettings = (): Promise<DataviewSettings | void> => {
124124
order: route['order'] ?? 0,
125125
hideFromMenu: route['hideFromMenu'] ?? false,
126126
admin: route['admin'] ?? false,
127+
unauthorised: route['unauthorised'] ?? false,
127128
helpSteps:
128129
index === 0 && 'helpSteps' in settings
129130
? settings['helpSteps']

packages/datagateway-download/src/main.test.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ describe('index - fetchSettings', () => {
6363
displayName: 'displayName',
6464
admin: false,
6565
hideFromMenu: false,
66+
unauthorised: false,
6667
order: 0,
6768
helpSteps: [],
6869
logoLightMode: LogoLight,
@@ -100,6 +101,7 @@ describe('index - fetchSettings', () => {
100101
link: 'link1',
101102
displayName: 'displayName1',
102103
hideFromMenu: true,
104+
unauthorised: true,
103105
order: 1,
104106
},
105107
{
@@ -132,6 +134,7 @@ describe('index - fetchSettings', () => {
132134
displayName: 'displayName0',
133135
admin: false,
134136
hideFromMenu: false,
137+
unauthorised: false,
135138
order: 0,
136139
helpSteps: [{ target: '#id', content: 'content' }],
137140
logoLightMode: LogoLight,
@@ -150,6 +153,7 @@ describe('index - fetchSettings', () => {
150153
displayName: 'displayName1',
151154
admin: false,
152155
hideFromMenu: true,
156+
unauthorised: true,
153157
order: 1,
154158
helpSteps: [],
155159
logoLightMode: LogoLight,
@@ -168,6 +172,7 @@ describe('index - fetchSettings', () => {
168172
displayName: 'displayNameAdmin0',
169173
admin: true,
170174
hideFromMenu: false,
175+
unauthorised: false,
171176
order: 0,
172177
helpSteps: [],
173178
logoLightMode: LogoLight,

packages/datagateway-download/src/main.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ export const fetchSettings = (): Promise<DownloadSettings | void> => {
139139
displayName: route['displayName'],
140140
hideFromMenu: route['hideFromMenu'] ?? false,
141141
admin: route['admin'] ?? false,
142+
unauthorised: route['unauthorised'] ?? false,
142143
order: route['order'] ?? 0,
143144
helpSteps:
144145
index === 0 && 'helpSteps' in settings

packages/datagateway-search/src/main.test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ describe('index - fetchSettings', () => {
5757
displayName: 'displayName',
5858
admin: false,
5959
hideFromMenu: false,
60+
unauthorised: false,
6061
order: 0,
6162
helpSteps: [],
6263
logoLightMode: LogoLight,
@@ -89,6 +90,7 @@ describe('index - fetchSettings', () => {
8990
displayName: 'displayName1',
9091
order: 1,
9192
hideFromMenu: true,
93+
unauthorised: true,
9294
},
9395
],
9496
helpSteps: [{ target: '#id', content: 'content' }],
@@ -113,6 +115,7 @@ describe('index - fetchSettings', () => {
113115
displayName: 'displayName0',
114116
admin: true,
115117
hideFromMenu: false,
118+
unauthorised: false,
116119
order: 0,
117120
helpSteps: [{ target: '#id', content: 'content' }],
118121
logoLightMode: LogoLight,
@@ -131,6 +134,7 @@ describe('index - fetchSettings', () => {
131134
displayName: 'displayName1',
132135
admin: false,
133136
hideFromMenu: true,
137+
unauthorised: true,
134138
order: 1,
135139
helpSteps: [],
136140
logoLightMode: LogoLight,

packages/datagateway-search/src/main.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export const fetchSettings = (): Promise<SearchSettings | void> => {
9898
order: route['order'] ?? 0,
9999
hideFromMenu: route['hideFromMenu'] ?? false,
100100
admin: route['admin'] ?? false,
101+
unauthorised: route['unauthorised'] ?? false,
101102
helpSteps:
102103
index === 0 && 'helpSteps' in settings
103104
? settings['helpSteps']

0 commit comments

Comments
 (0)