@magda/external-ui-plugin-sdk 2.2.0-alpha.1 → 2.2.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +645 -54
- package/package.json +2 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
1
2
|
import { ComponentType } from 'react';
|
|
2
3
|
import { History as History_2 } from 'history';
|
|
3
4
|
import { Location as Location_2 } from 'history';
|
|
@@ -129,70 +130,603 @@ declare type CompatiblePreviews = {
|
|
|
129
130
|
google?: boolean;
|
|
130
131
|
};
|
|
131
132
|
|
|
132
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Magda frontend application configuration data structure.
|
|
135
|
+
* This config data is only configurable at time of the deployment via [Magda web-server Helm Chart](https://github.com/magda-io/magda/tree/master/deploy/helm/internal-charts/web-server).
|
|
136
|
+
* At the beginning of starting up, the frontend application will retrieve this config data from the web server.
|
|
137
|
+
* For default values, please refer to [Magda web-server Helm Chart Doc](https://github.com/magda-io/magda/tree/master/deploy/helm/internal-charts/web-server).
|
|
138
|
+
*
|
|
139
|
+
* @export
|
|
140
|
+
* @interface ConfigDataType
|
|
141
|
+
*/
|
|
142
|
+
export declare interface ConfigDataType {
|
|
143
|
+
/**
|
|
144
|
+
* This field allow you to config the common settings of all [fetch requests](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) sent by the frontend application.
|
|
145
|
+
* One common use case is to set [credentials field](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#credentials).
|
|
146
|
+
* Its default value is `"credentials": "same-origin"`. When running the web client locally for debugging purpose, you might want to set it to `"credentials": "include"`.
|
|
147
|
+
* This will allow `credentials` (e.g. cookie) to be shared with remote dev testing API server.
|
|
148
|
+
*
|
|
149
|
+
* @type {RequestInit}
|
|
150
|
+
* @memberof ConfigDataType
|
|
151
|
+
*/
|
|
152
|
+
commonFetchRequestOptions: RequestInit;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The docker image information of the web server that serves all frontend resources of the application.
|
|
156
|
+
*
|
|
157
|
+
* @type {{
|
|
158
|
+
* pullPolicy?: string;
|
|
159
|
+
* repository?: string;
|
|
160
|
+
* tag?: string;
|
|
161
|
+
* }}
|
|
162
|
+
* @memberof ConfigDataType
|
|
163
|
+
*/
|
|
133
164
|
image?: {
|
|
134
165
|
pullPolicy?: string;
|
|
135
166
|
repository?: string;
|
|
136
167
|
tag?: string;
|
|
137
168
|
};
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* The authorisation API base URL config value that is supplied by the web server.
|
|
172
|
+
* When this value is not available from the server (e.g. when run web client locally), the default "fallback" API server url will be used to generate this value.
|
|
173
|
+
*
|
|
174
|
+
* @type {string}
|
|
175
|
+
* @memberof ConfigDataType
|
|
176
|
+
*/
|
|
177
|
+
authApiBaseUrl: string;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The base URL path of all APIs (e.g. '/');
|
|
181
|
+
* The value of the field might be either from config data retrieved from the server or (when run web client locally) the hardcoded URL to a default "fallback" dev API server url for testing.
|
|
182
|
+
*
|
|
183
|
+
* @type {string}
|
|
184
|
+
* @memberof ConfigDataType
|
|
185
|
+
*/
|
|
186
|
+
baseUrl: string;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* The default redirection url for all auth plugins once the authentication process is completed.
|
|
190
|
+
*
|
|
191
|
+
* @type {string}
|
|
192
|
+
* @memberof ConfigDataType
|
|
193
|
+
*/
|
|
194
|
+
authPluginRedirectUrl: string;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Similar to `baseUrl`. But this field always includes the external access domain of the application.
|
|
198
|
+
* You might want to use its value in use cases e.g. generating external accessible links for email content.
|
|
199
|
+
*
|
|
200
|
+
* @type {string}
|
|
201
|
+
* @memberof ConfigDataType
|
|
202
|
+
*/
|
|
203
|
+
baseExternalUrl: string;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* The base url path where the web client will be served at.
|
|
207
|
+
* E.g. when `uiBaseUrl`=`/`, the web client will served at `https://example.com/`.
|
|
208
|
+
* When `uiBaseUrl`=`/abc/def`, the web client will served at `https://example.com/abc/def`.
|
|
209
|
+
* Please note: this field only reflect where the wbe client / frontend application is served at.
|
|
210
|
+
* It doesn't reflect where all APIs are served. To find out it, the value `baseUrl` field should be used.
|
|
211
|
+
*
|
|
212
|
+
* @type {string}
|
|
213
|
+
* @memberof ConfigDataType
|
|
214
|
+
*/
|
|
215
|
+
uiBaseUrl: string;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Whether or not the notification banner should be shown.
|
|
219
|
+
*
|
|
220
|
+
* @type {boolean}
|
|
221
|
+
* @memberof ConfigDataType
|
|
222
|
+
*/
|
|
143
223
|
showNotificationBanner?: boolean;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* The content API base URL config value that is supplied by the web server.
|
|
227
|
+
* When this value is not available from the server (e.g. when run web client locally), the default "fallback" API server url will be used to generate this value.
|
|
228
|
+
*
|
|
229
|
+
* @type {string}
|
|
230
|
+
* @memberof ConfigDataType
|
|
231
|
+
*/
|
|
232
|
+
contentApiBaseUrl: string;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* The API endpoint URL to retrieve all default content items (e.g. header & footer items etc.).
|
|
236
|
+
* The value of this field is created from field `contentApiBaseUrl`.
|
|
237
|
+
* It includes all required query parameters in the URL and serves as a pre-configured short cut to retrieve all default content items for a user.
|
|
238
|
+
*
|
|
239
|
+
* @type {string}
|
|
240
|
+
* @memberof ConfigDataType
|
|
241
|
+
*/
|
|
242
|
+
contentUrl: string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* The map preview module base access URL config value that is supplied by the web server.
|
|
246
|
+
* When this value is not available from the server (e.g. when run web client locally), the default "fallback" API server url will be used to generate this value.
|
|
247
|
+
*
|
|
248
|
+
* @type {string}
|
|
249
|
+
* @memberof ConfigDataType
|
|
250
|
+
*/
|
|
251
|
+
previewMapBaseUrl: string;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* The CORS resource proxy url. Mainly used by map preview module to load CORS resources from whitelist domains.
|
|
255
|
+
* Its value is generated from `previewMapBaseUrl`.
|
|
256
|
+
*
|
|
257
|
+
* @type {string}
|
|
258
|
+
* @memberof ConfigDataType
|
|
259
|
+
*/
|
|
260
|
+
proxyUrl: string;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* The indexer API base URL config value that is supplied by the web server.
|
|
264
|
+
* When this value is not available from the server (e.g. when run web client locally), the default "fallback" API server url will be used to generate this value.
|
|
265
|
+
*
|
|
266
|
+
* @type {string}
|
|
267
|
+
* @memberof ConfigDataType
|
|
268
|
+
*/
|
|
269
|
+
indexerApiBaseUrl: string;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* The registry API base URL config value that is supplied by the web server.
|
|
273
|
+
* When this value is not available from the server (e.g. when run web client locally), the default "fallback" API server url will be used to generate this value.
|
|
274
|
+
* Please note: this registry API endpoint can handle both read & write requests.
|
|
275
|
+
* Since v0.0.59, readonly (HTTP GET) requests that are sent to this endpoint externally will be auto-forward to the readonly endpoint `registryApiReadOnlyBaseUrl`.
|
|
276
|
+
* However, for performance consideration (as gateway doesn't need to check HTTP method), `registryApiReadOnlyBaseUrl` should still be the preferred endpoint for readonly requests.
|
|
277
|
+
*
|
|
278
|
+
* @type {string}
|
|
279
|
+
* @memberof ConfigDataType
|
|
280
|
+
*/
|
|
281
|
+
registryApiBaseUrl: string;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* The registry readonly API base URL config value that is supplied by the web server.
|
|
285
|
+
* When this value is not available from the server (e.g. when run web client locally), the default "fallback" API server url will be used to generate this value.
|
|
286
|
+
* Please note: this registry API endpoint can only handle both read requests only.
|
|
287
|
+
* The readonly registry API endpoint can scale horizontally easily. Thus, should be the preferred endpoint for serving readonly requests.
|
|
288
|
+
*
|
|
289
|
+
* @type {string}
|
|
290
|
+
* @memberof ConfigDataType
|
|
291
|
+
*/
|
|
292
|
+
registryApiReadOnlyBaseUrl: string;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* The search API base URL config value that is supplied by the web server.
|
|
296
|
+
* When this value is not available from the server (e.g. when run web client locally), the default "fallback" API server url will be used to generate this value.
|
|
297
|
+
*
|
|
298
|
+
* @type {string}
|
|
299
|
+
* @memberof ConfigDataType
|
|
300
|
+
*/
|
|
301
|
+
searchApiBaseUrl: string;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* The correspondence API base URL config value that is supplied by the web server.
|
|
305
|
+
* When this value is not available from the server (e.g. when run web client locally), the default "fallback" API server url will be used to generate this value.
|
|
306
|
+
*
|
|
307
|
+
* @type {string}
|
|
308
|
+
* @memberof ConfigDataType
|
|
309
|
+
*/
|
|
150
310
|
correspondenceApiBaseUrl?: string;
|
|
151
|
-
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* The storage API base URL config value that is supplied by the web server.
|
|
314
|
+
* When this value is not available from the server (e.g. when run web client locally), the default "fallback" API server url will be used to generate this value.
|
|
315
|
+
*
|
|
316
|
+
* @type {string}
|
|
317
|
+
* @memberof ConfigDataType
|
|
318
|
+
*/
|
|
319
|
+
storageApiBaseUrl: string;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* The admin API base URL config value that is supplied by the web server.
|
|
323
|
+
* When this value is not available from the server (e.g. when run web client locally), the default "fallback" API server url will be used to generate this value.
|
|
324
|
+
*
|
|
325
|
+
* @type {string}
|
|
326
|
+
* @memberof ConfigDataType
|
|
327
|
+
*/
|
|
328
|
+
adminApiBaseUrl: string;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Google Analytics ID
|
|
332
|
+
*
|
|
333
|
+
* @type {Array<string>}
|
|
334
|
+
* @memberof ConfigDataType
|
|
335
|
+
*/
|
|
152
336
|
gapiIds?: Array<string>;
|
|
153
|
-
|
|
154
|
-
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* remote RSS news endpoint.
|
|
340
|
+
* This config field is deprecated & to be removed in future.
|
|
341
|
+
*
|
|
342
|
+
* @type {string}
|
|
343
|
+
* @memberof ConfigDataType
|
|
344
|
+
*/
|
|
345
|
+
rssUrl?: string;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* When set to `true`, the user account related links & buttons will be removed.
|
|
349
|
+
* Default to `false`.
|
|
350
|
+
*
|
|
351
|
+
* @type {boolean}
|
|
352
|
+
* @memberof ConfigDataType
|
|
353
|
+
*/
|
|
354
|
+
disableAuthenticationFeatures: boolean;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* The url of fallback dev API server for testing.
|
|
358
|
+
* It will only be used when the web client is run locally.
|
|
359
|
+
*
|
|
360
|
+
* @type {string}
|
|
361
|
+
* @memberof ConfigDataType
|
|
362
|
+
*/
|
|
155
363
|
fallbackUrl?: string;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* A set of feature flags to turn on/of a list of features.
|
|
367
|
+
*
|
|
368
|
+
* @type {{
|
|
369
|
+
* [id: string]: boolean;
|
|
370
|
+
* }}
|
|
371
|
+
* @memberof ConfigDataType
|
|
372
|
+
*/
|
|
373
|
+
featureFlags: FeatureFlagsConfigType;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Whether or not the "use Magda storage" option should be pre-selected on dataset editor UI.
|
|
377
|
+
*
|
|
378
|
+
* @type {boolean}
|
|
379
|
+
* @memberof ConfigDataType
|
|
380
|
+
*/
|
|
381
|
+
useMagdaStorageByDefault: boolean;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* A list of vocabulary api endpoints that are used to validate the auto-generated keywords in dataset editor UI.
|
|
385
|
+
* By default, it's set to:
|
|
386
|
+
* - "https://vocabs.ands.org.au/repository/api/lda/abares/australian-land-use-and-management-classification/version-8/concept.json",
|
|
387
|
+
* - "https://vocabs.ands.org.au/repository/api/lda/ands-nc/controlled-vocabulary-for-resource-type-genres/version-1-1/concept.json"
|
|
388
|
+
*
|
|
389
|
+
* @type {string[]}
|
|
390
|
+
* @memberof ConfigDataType
|
|
391
|
+
*/
|
|
160
392
|
vocabularyApiEndpoints: string[];
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* A list of keywords that should never be generated by the auto keyword generation module in the dataset editor UI.
|
|
396
|
+
*
|
|
397
|
+
* @type {string[]}
|
|
398
|
+
* @memberof ConfigDataType
|
|
399
|
+
*/
|
|
400
|
+
keywordsBlackList?: string[];
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Default Organization ID for dataset editor UI.
|
|
404
|
+
*
|
|
405
|
+
* @type {string}
|
|
406
|
+
* @memberof ConfigDataType
|
|
407
|
+
*/
|
|
161
408
|
defaultOrganizationId?: string;
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Default email to forward users' inquiry.
|
|
412
|
+
*
|
|
413
|
+
* @type {string}
|
|
414
|
+
* @memberof ConfigDataType
|
|
415
|
+
*/
|
|
162
416
|
defaultContactEmail?: string;
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* deprecated. Not used anymore. To be removed in future.
|
|
420
|
+
*
|
|
421
|
+
* @type {number}
|
|
422
|
+
* @memberof ConfigDataType
|
|
423
|
+
*/
|
|
163
424
|
custodianOrgLevel: number;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* The maximum size that a file can be in order to be automatically previewed by the ui as a map, graph or table.
|
|
428
|
+
*
|
|
429
|
+
* @type {number}
|
|
430
|
+
* @memberof ConfigDataType
|
|
431
|
+
*/
|
|
164
432
|
automaticPreviewMaxFileSize: number;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* List all mandatory fields in dataset editor.
|
|
436
|
+
*
|
|
437
|
+
* @type {ValidationFieldList}
|
|
438
|
+
* @memberof ConfigDataType
|
|
439
|
+
*/
|
|
165
440
|
mandatoryFields: ValidationFieldList;
|
|
166
|
-
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* The date format config used in dataset editor auto date information extraction.
|
|
444
|
+
*
|
|
445
|
+
* @type {DateConfig}
|
|
446
|
+
* @memberof ConfigDataType
|
|
447
|
+
*/
|
|
448
|
+
dateConfig: DateConfig;
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Whether or not allow user to input manual keywords in the dataset editor.
|
|
452
|
+
*
|
|
453
|
+
* @type {boolean}
|
|
454
|
+
* @memberof ConfigDataType
|
|
455
|
+
*/
|
|
167
456
|
noManualKeywords?: boolean;
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Whether or not allow user to input manual themes in the dataset editor.
|
|
460
|
+
*
|
|
461
|
+
* @type {boolean}
|
|
462
|
+
* @memberof ConfigDataType
|
|
463
|
+
*/
|
|
168
464
|
noManualThemes?: boolean;
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Predefined dataset theme list used in the dataset editor.
|
|
468
|
+
*
|
|
469
|
+
* @type {boolean}
|
|
470
|
+
* @memberof ConfigDataType
|
|
471
|
+
*/
|
|
169
472
|
datasetThemes?: string[];
|
|
170
|
-
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* The openfaas API base URL config value that is supplied by the web server.
|
|
476
|
+
* When this value is not available from the server (e.g. when run web client locally), the default "fallback" API server url will be used to generate this value.
|
|
477
|
+
*
|
|
478
|
+
* @type {string}
|
|
479
|
+
* @memberof ConfigDataType
|
|
480
|
+
*/
|
|
171
481
|
openfaasBaseUrl?: string;
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Config for optional dataset auto-sync to ckan feature.
|
|
485
|
+
* Only available when [magda-minion-ckan-exporter](https://github.com/magda-io/magda-minion-ckan-exporter) is deployed and feature flag `publishToDga` is `true`.
|
|
486
|
+
* This feature is still in beta.
|
|
487
|
+
*
|
|
488
|
+
* @type {{
|
|
489
|
+
* [ckanServerUrl: string]: boolean;
|
|
490
|
+
* }}
|
|
491
|
+
* @memberof ConfigDataType
|
|
492
|
+
*/
|
|
172
493
|
ckanExportServers: {
|
|
173
494
|
[ckanServerUrl: string]: boolean;
|
|
174
495
|
};
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* The default CKAN server for the optional dataset auto-sync to ckan feature.
|
|
499
|
+
* see config field `ckanExportServers`.
|
|
500
|
+
*
|
|
501
|
+
* @type {string}
|
|
502
|
+
* @memberof ConfigDataType
|
|
503
|
+
*/
|
|
175
504
|
defaultCkanServer: string;
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* The default timezone used in the application.
|
|
508
|
+
*
|
|
509
|
+
* @type {string}
|
|
510
|
+
* @memberof ConfigDataType
|
|
511
|
+
*/
|
|
176
512
|
defaultTimeZone?: string;
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Indicate whether or not the crawler web view is enabled on [Magda web-server](https://github.com/magda-io/magda/tree/master/deploy/helm/internal-charts/web-server) to provide search engine optimized views.
|
|
516
|
+
*
|
|
517
|
+
* @type {boolean}
|
|
518
|
+
* @memberof ConfigDataType
|
|
519
|
+
*/
|
|
177
520
|
enableCrawlerViews?: boolean;
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* The discourse site url.
|
|
524
|
+
* For the optional discourse site integration feature.
|
|
525
|
+
* When its value is empty, the feature will be disabled.
|
|
526
|
+
*
|
|
527
|
+
* @type {string}
|
|
528
|
+
* @memberof ConfigDataType
|
|
529
|
+
*/
|
|
178
530
|
discourseSiteUrl?: string;
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* For the optional discourse site integration feature.
|
|
534
|
+
* Indicate whether show the discourse comment area on dataset page.
|
|
535
|
+
*
|
|
536
|
+
* @type {boolean}
|
|
537
|
+
* @memberof ConfigDataType
|
|
538
|
+
*/
|
|
179
539
|
discourseIntegrationDatasetPage?: boolean;
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* For the optional discourse site integration feature.
|
|
543
|
+
* Indicate whether show the discourse comment area on distribution page.
|
|
544
|
+
*
|
|
545
|
+
* @type {boolean}
|
|
546
|
+
* @memberof ConfigDataType
|
|
547
|
+
*/
|
|
180
548
|
discourseIntegrationDistributionPage?: boolean;
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* A list of optional external UI component plugins bundle URLs.
|
|
552
|
+
*
|
|
553
|
+
* @type {string[]}
|
|
554
|
+
* @memberof ConfigDataType
|
|
555
|
+
*/
|
|
181
556
|
externalUIComponents?: string[];
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* A list of optional external CSS files to overwrite the looking of the site.
|
|
560
|
+
*
|
|
561
|
+
* @type {string[]}
|
|
562
|
+
* @memberof ConfigDataType
|
|
563
|
+
*/
|
|
182
564
|
externalCssFiles?: string[];
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* The url used when user click `home` link or header logo.
|
|
568
|
+
* Default to "/"
|
|
569
|
+
*
|
|
570
|
+
* @type {string}
|
|
571
|
+
* @memberof ConfigDataType
|
|
572
|
+
*/
|
|
183
573
|
homePageUrl?: string;
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* The responsive UI break points.
|
|
577
|
+
*
|
|
578
|
+
* @type {{
|
|
579
|
+
* small: number;
|
|
580
|
+
* medium: number;
|
|
581
|
+
* large: number;
|
|
582
|
+
* }}
|
|
583
|
+
* @memberof ConfigDataType
|
|
584
|
+
*/
|
|
585
|
+
breakpoints?: {
|
|
586
|
+
small: number;
|
|
587
|
+
medium: number;
|
|
588
|
+
large: number;
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Search panel facet config.
|
|
593
|
+
*
|
|
594
|
+
* @type {FacetConfigItem[]}
|
|
595
|
+
* @memberof ConfigDataType
|
|
596
|
+
*/
|
|
597
|
+
facets?: FacetConfigItem[];
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Header logo URL.
|
|
601
|
+
*
|
|
602
|
+
* @type {string}
|
|
603
|
+
* @memberof ConfigDataType
|
|
604
|
+
*/
|
|
605
|
+
headerLogoUrl?: string;
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Header logo URL for mobile view.
|
|
609
|
+
*
|
|
610
|
+
* @type {string}
|
|
611
|
+
* @memberof ConfigDataType
|
|
612
|
+
*/
|
|
613
|
+
headerMobileLogoUrl?: string;
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* A list of month name to be used in the application
|
|
617
|
+
*
|
|
618
|
+
* @type {string[]}
|
|
619
|
+
* @memberof ConfigDataType
|
|
620
|
+
*/
|
|
621
|
+
months?: string[];
|
|
622
|
+
/**
|
|
623
|
+
* Default boundingBox for map preview module
|
|
624
|
+
*
|
|
625
|
+
* @type {{
|
|
626
|
+
* west: number;
|
|
627
|
+
* south: number;
|
|
628
|
+
* east: number;
|
|
629
|
+
* north: number;
|
|
630
|
+
* }}
|
|
631
|
+
* @memberof ConfigDataType
|
|
632
|
+
*/
|
|
633
|
+
boundingBox: {
|
|
634
|
+
west: number;
|
|
635
|
+
south: number;
|
|
636
|
+
east: number;
|
|
637
|
+
north: number;
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Whether the "Open in XXXX" button over the map preview module should support terria map v7 config format.
|
|
642
|
+
*
|
|
643
|
+
* @type {boolean}
|
|
644
|
+
* @memberof ConfigDataType
|
|
645
|
+
*/
|
|
184
646
|
supportExternalTerriaMapV7?: boolean;
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* The the "Open in XXXX" over the map preview module button text label.
|
|
650
|
+
* By default, it's set to "Open in National Map".
|
|
651
|
+
* But you can set to other value in case you want to send data to your own terria map.
|
|
652
|
+
*
|
|
653
|
+
* @type {string}
|
|
654
|
+
* @memberof ConfigDataType
|
|
655
|
+
*/
|
|
185
656
|
openInExternalTerriaMapButtonText?: string;
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* The target terria map URL that the "Open in XXXX" over the map preview module button should send data to.
|
|
660
|
+
*
|
|
661
|
+
* @type {string}
|
|
662
|
+
* @memberof ConfigDataType
|
|
663
|
+
*/
|
|
186
664
|
openInExternalTerriaMapTargetUrl?: string;
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* extraConfigData is mainly for config data passing to external UI plugins
|
|
668
|
+
*
|
|
669
|
+
* @type {{
|
|
670
|
+
* [key: string]: any;
|
|
671
|
+
* }}
|
|
672
|
+
* @memberof ConfigDataType
|
|
673
|
+
*/
|
|
187
674
|
extraConfigData?: {
|
|
188
|
-
// extraConfigData is mainly for config data passing to external UI plugins
|
|
189
675
|
[key: string]: any;
|
|
190
676
|
};
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* A format preference list for the map preview module.
|
|
680
|
+
* It controls, on dataset page, when more than one formats are available, which format data file / API will be used for best user experience.
|
|
681
|
+
*
|
|
682
|
+
* @type {RawPreviewMapFormatPerferenceItem[]}
|
|
683
|
+
* @memberof ConfigDataType
|
|
684
|
+
*/
|
|
191
685
|
previewMapFormatPerference?: RawPreviewMapFormatPerferenceItem[];
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Whether or not show the contact button when the contact information of the dataset is not available.
|
|
689
|
+
* When set to `true`, the inquiries will be sent to the default contact email.
|
|
690
|
+
*
|
|
691
|
+
* @type {boolean}
|
|
692
|
+
* @memberof ConfigDataType
|
|
693
|
+
*/
|
|
192
694
|
showContactButtonForNoContactPointDataset?: boolean;
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* The default storage bucket that storage API should use.
|
|
698
|
+
*
|
|
699
|
+
* @type {string}
|
|
700
|
+
* @memberof ConfigDataType
|
|
701
|
+
*/
|
|
193
702
|
defaultDatasetBucket?: string;
|
|
194
|
-
|
|
195
|
-
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* The landing page URL for anonymous users.
|
|
706
|
+
* By default, it's "/home". You might want to set to "/account", if your system is not open to public users.
|
|
707
|
+
*
|
|
708
|
+
* @type {string}
|
|
709
|
+
* @memberof ConfigDataType
|
|
710
|
+
*/
|
|
711
|
+
anonymousUserLandingPage: string;
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* The landing page URL for authenticated users.
|
|
715
|
+
* By default, it's "/home".
|
|
716
|
+
*
|
|
717
|
+
* @type {string}
|
|
718
|
+
* @memberof ConfigDataType
|
|
719
|
+
*/
|
|
720
|
+
authenticatedUserLandingPage: string;
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* How long before reload the current user's auth data in the background.
|
|
724
|
+
* Useful to transit UI to correct status when user leave browser open without interaction for long time.
|
|
725
|
+
* Default: 5 mins
|
|
726
|
+
*
|
|
727
|
+
* @type {number}
|
|
728
|
+
* @memberof ConfigDataType
|
|
729
|
+
*/
|
|
196
730
|
authStatusRefreshInterval?: number;
|
|
197
731
|
}
|
|
198
732
|
|
|
@@ -218,9 +752,16 @@ declare type CurrencyData = {
|
|
|
218
752
|
}[];
|
|
219
753
|
};
|
|
220
754
|
|
|
221
|
-
|
|
755
|
+
/**
|
|
756
|
+
* The properties that DatasetEditButton Plugin Component will receive.
|
|
757
|
+
*
|
|
758
|
+
* @export
|
|
759
|
+
* @interface FooterComponentPropsType
|
|
760
|
+
* @extends {CommonPropsType}
|
|
761
|
+
*/
|
|
762
|
+
export declare interface DatasetEditButtonComponentPropsType extends CommonPropsType {
|
|
222
763
|
dataset: ParsedDataset;
|
|
223
|
-
}
|
|
764
|
+
}
|
|
224
765
|
|
|
225
766
|
/**
|
|
226
767
|
* Dataset page `Edit Dataset` button external plugin component type
|
|
@@ -230,9 +771,16 @@ export declare type DatasetEditButtonComponentType = ComponentType<
|
|
|
230
771
|
DatasetEditButtonComponentPropsType
|
|
231
772
|
>;
|
|
232
773
|
|
|
233
|
-
|
|
774
|
+
/**
|
|
775
|
+
* The properties that DatasetLikeButton Plugin Component will receive.
|
|
776
|
+
*
|
|
777
|
+
* @export
|
|
778
|
+
* @interface FooterComponentPropsType
|
|
779
|
+
* @extends {CommonPropsType}
|
|
780
|
+
*/
|
|
781
|
+
export declare interface DatasetLikeButtonComponentPropsType extends CommonPropsType {
|
|
234
782
|
dataset: ParsedDataset;
|
|
235
|
-
}
|
|
783
|
+
}
|
|
236
784
|
|
|
237
785
|
/**
|
|
238
786
|
* Search Result page `Like Button` external plugin component type
|
|
@@ -252,10 +800,18 @@ declare interface DateConfig {
|
|
|
252
800
|
};
|
|
253
801
|
}
|
|
254
802
|
|
|
255
|
-
|
|
803
|
+
/**
|
|
804
|
+
* The properties that ExtraVisualisationSection Plugin Component will receive.
|
|
805
|
+
*
|
|
806
|
+
* @export
|
|
807
|
+
* @interface FooterComponentPropsType
|
|
808
|
+
* @extends {CommonPropsType}
|
|
809
|
+
*/
|
|
810
|
+
export declare interface ExtraVisualisationSectionComponentPropsType
|
|
811
|
+
extends CommonPropsType {
|
|
256
812
|
dataset: ParsedDataset;
|
|
257
813
|
distributionId?: string;
|
|
258
|
-
}
|
|
814
|
+
}
|
|
259
815
|
|
|
260
816
|
/**
|
|
261
817
|
* Visualisation Section external plugin component type.
|
|
@@ -267,17 +823,42 @@ export declare type ExtraVisualisationSectionComponentType = ComponentType<
|
|
|
267
823
|
ExtraVisualisationSectionComponentPropsType
|
|
268
824
|
>;
|
|
269
825
|
|
|
826
|
+
declare interface FacetConfigItem {
|
|
827
|
+
id: string;
|
|
828
|
+
component: Component<any>;
|
|
829
|
+
showExplanation?: boolean;
|
|
830
|
+
name?: string;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
declare type FeatureFlagsConfigType = Partial<Record<FeatureFlagType, boolean>>;
|
|
834
|
+
|
|
835
|
+
declare type FeatureFlagType =
|
|
836
|
+
| "cataloguing"
|
|
837
|
+
| "publishToDga"
|
|
838
|
+
| "previewAddDataset"
|
|
839
|
+
| "datasetApprovalWorkflowOn"
|
|
840
|
+
| "useStorageApi"
|
|
841
|
+
| "datasetLikeButton"
|
|
842
|
+
| "enableAutoMetadataFetchButton";
|
|
843
|
+
|
|
270
844
|
declare type FetchError = {
|
|
271
845
|
title: string;
|
|
272
846
|
detail: string;
|
|
273
847
|
};
|
|
274
848
|
|
|
275
|
-
|
|
849
|
+
/**
|
|
850
|
+
* The properties that Footer Plugin Component will receive.
|
|
851
|
+
*
|
|
852
|
+
* @export
|
|
853
|
+
* @interface FooterComponentPropsType
|
|
854
|
+
* @extends {CommonPropsType}
|
|
855
|
+
*/
|
|
856
|
+
export declare interface FooterComponentPropsType extends CommonPropsType {
|
|
276
857
|
noTopMargin: boolean;
|
|
277
858
|
footerMediumNavs: FooterNavLinkGroup[];
|
|
278
859
|
footerSmallNavs: FooterNavLinkGroup[];
|
|
279
860
|
footerCopyRightItems: CopyRightItem[];
|
|
280
|
-
}
|
|
861
|
+
}
|
|
281
862
|
|
|
282
863
|
/**
|
|
283
864
|
* Footer external plugin component type
|
|
@@ -309,7 +890,14 @@ export declare interface FooterNavLinkGroup {
|
|
|
309
890
|
order: number;
|
|
310
891
|
}
|
|
311
892
|
|
|
312
|
-
|
|
893
|
+
/**
|
|
894
|
+
* The properties that Header Plugin Component will receive.
|
|
895
|
+
*
|
|
896
|
+
* @export
|
|
897
|
+
* @interface FooterComponentPropsType
|
|
898
|
+
* @extends {CommonPropsType}
|
|
899
|
+
*/
|
|
900
|
+
export declare interface HeaderComponentProps extends CommonPropsType {
|
|
313
901
|
headerNavItems: HeaderNavItem[];
|
|
314
902
|
}
|
|
315
903
|
|
|
@@ -336,13 +924,12 @@ export declare interface HeaderNavItem {
|
|
|
336
924
|
order: number;
|
|
337
925
|
}
|
|
338
926
|
|
|
339
|
-
declare
|
|
927
|
+
declare interface Operation {
|
|
340
928
|
id: string;
|
|
341
929
|
uri: string;
|
|
342
930
|
name: string;
|
|
343
|
-
description
|
|
344
|
-
|
|
345
|
-
};
|
|
931
|
+
description?: string;
|
|
932
|
+
}
|
|
346
933
|
|
|
347
934
|
declare type OrgUnit = {
|
|
348
935
|
id: string;
|
|
@@ -433,21 +1020,30 @@ declare type ParsedProvenance = {
|
|
|
433
1020
|
isOpenData?: boolean;
|
|
434
1021
|
};
|
|
435
1022
|
|
|
436
|
-
declare interface
|
|
1023
|
+
declare interface Permission {
|
|
437
1024
|
id: string;
|
|
438
1025
|
name: string;
|
|
439
|
-
description
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
1026
|
+
description?: string;
|
|
1027
|
+
resourceId: string;
|
|
1028
|
+
resourceUri: string;
|
|
1029
|
+
userOwnershipConstraint: boolean;
|
|
1030
|
+
orgUnitOwnershipConstraint: boolean;
|
|
1031
|
+
preAuthorisedConstraint: boolean;
|
|
1032
|
+
operations: Operation[];
|
|
1033
|
+
createBy?: string;
|
|
1034
|
+
createTime?: Date;
|
|
1035
|
+
editBy?: string;
|
|
1036
|
+
editTime?: Date;
|
|
449
1037
|
}
|
|
450
1038
|
|
|
1039
|
+
/**
|
|
1040
|
+
* The constant define the prefix that is used to create the global scope variable name, to which the external UI plugin bundle should export to.
|
|
1041
|
+
* e.g. The Header Component should bundled & export to global scope variable `MagdaPluginComponentHeader`.
|
|
1042
|
+
* > Since Magda v2.2.0, users can load more than one "Extra Visualisation Section" type Magda UI Plugin Components.
|
|
1043
|
+
* To allow this, the component is required to be packaged as a library and exported to global scope `MagdaPluginComponentExtraVisualisationSections.xxxx`.
|
|
1044
|
+
* Here, `MagdaPluginComponentExtraVisualisationSections` should be an object with key `xxxx` set to the plugin component.
|
|
1045
|
+
* e.g. the DAP thumbnail viewer plugin choose to export itself to `MagdaPluginComponentExtraVisualisationSections.DAPThumbnailViewer`.
|
|
1046
|
+
*/
|
|
451
1047
|
export declare const PREFIX = "MagdaPluginComponent";
|
|
452
1048
|
|
|
453
1049
|
declare type Publisher = {
|
|
@@ -487,11 +1083,6 @@ declare type Role = {
|
|
|
487
1083
|
permissionIds: string[];
|
|
488
1084
|
};
|
|
489
1085
|
|
|
490
|
-
declare interface RolePermissionRecord extends PermissionRecord {
|
|
491
|
-
resource_uri: string;
|
|
492
|
-
operations?: OperationRecord[];
|
|
493
|
-
}
|
|
494
|
-
|
|
495
1086
|
declare type TemporalCoverage = {
|
|
496
1087
|
intervals: {
|
|
497
1088
|
start?: string;
|
|
@@ -510,7 +1101,7 @@ declare type User = {
|
|
|
510
1101
|
sourceId?: string;
|
|
511
1102
|
isAdmin: boolean;
|
|
512
1103
|
roles: Role[];
|
|
513
|
-
permissions:
|
|
1104
|
+
permissions: Permission[];
|
|
514
1105
|
orgUnitId?: string;
|
|
515
1106
|
orgUnit?: OrgUnit;
|
|
516
1107
|
managingOrgUnitIds?: string[];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magda/external-ui-plugin-sdk",
|
|
3
3
|
"description": "MAGDA external UI plugin SDK",
|
|
4
|
-
"version": "2.2.0-alpha.
|
|
4
|
+
"version": "2.2.0-alpha.3",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prebuild": "rimraf dist tsconfig.tsbuildinfo",
|
|
7
7
|
"build": "api-extractor run -l",
|
|
@@ -18,12 +18,11 @@
|
|
|
18
18
|
"directory": "packages/external-ui-plugin-sdk"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@magda/web-client": "^2.2.0-alpha.
|
|
21
|
+
"@magda/web-client": "^2.2.0-alpha.3",
|
|
22
22
|
"typescript": "~4.2.4"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@types/react": "^16.8.17",
|
|
26
|
-
"@types/history": "^4.7.11",
|
|
27
26
|
"@types/react-router-dom": "^5.3.3"
|
|
28
27
|
},
|
|
29
28
|
"magda": {
|