@@ -45,6 +45,12 @@ const getDefaultState = () => {
45
45
collections : [ ] ,
46
46
processNamespaces : Config . processNamespaces || [ ] ,
47
47
pageLimit : Config . pageLimit ,
48
+ federation : null ,
49
+ federationMissing : {
50
+ collections : [ ] ,
51
+ processes : [ ] ,
52
+ fileFormats : [ ] ,
53
+ } ,
48
54
} ;
49
55
} ;
50
56
@@ -174,6 +180,12 @@ export default new Vuex.Store({
174
180
let errors = [ ] ;
175
181
let capabilities = cx . state . connection . capabilities ( ) ;
176
182
183
+ // Note down federation things from capabilities
184
+ let federation = capabilities . listFederation ( ) ;
185
+ if ( Object . keys ( federation ) . length > 0 ) { // empty object = no federation -> don't commit (leaving default value)
186
+ cx . commit ( 'federation' , federation ) ;
187
+ }
188
+
177
189
// Request collections
178
190
if ( capabilities . hasFeature ( 'listCollections' ) ) {
179
191
promises . push ( cx . state . connection . listCollections ( )
@@ -188,6 +200,7 @@ export default new Vuex.Store({
188
200
// Request processes
189
201
if ( capabilities . hasFeature ( 'listProcesses' ) ) {
190
202
promises . push ( cx . state . connection . listProcesses ( )
203
+ . then ( data => cx . state . federationMissing . processes = data [ 'federation:missing' ] )
191
204
. catch ( error => errors . push ( error ) ) ) ;
192
205
}
193
206
else {
@@ -344,6 +357,7 @@ export default new Vuex.Store({
344
357
} ,
345
358
fileFormats ( state , fileFormats ) {
346
359
state . fileFormats = fileFormats ;
360
+ state . federationMissing . fileFormats = fileFormats [ 'federation:missing' ] ;
347
361
} ,
348
362
serviceTypes ( state , serviceTypes ) {
349
363
// Make keys uppercase for simplicity
@@ -390,6 +404,7 @@ export default new Vuex.Store({
390
404
. map ( c => StacMigrate . collection ( c , false ) )
391
405
. filter ( c => ( typeof c . id === 'string' ) )
392
406
. sort ( Utils . sortById ) ;
407
+ state . federationMissing . collections = data [ 'federation:missing' ] ;
393
408
} ,
394
409
setConnectionError ( state , error ) {
395
410
state . connectionError = error ;
@@ -418,6 +433,12 @@ export default new Vuex.Store({
418
433
else {
419
434
Vue . delete ( state . beforeLogoutListener , key ) ;
420
435
}
436
+ } ,
437
+ federation ( state , federation ) {
438
+ state . federation = federation ;
439
+ } ,
440
+ federationMissing ( state , federationMissing ) {
441
+ state . federationMissing = federationMissing ;
421
442
}
422
443
}
423
444
} ) ;
0 commit comments