@magda/external-ui-plugin-sdk 2.2.0-alpha.1 → 2.2.0
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 +669 -55
- 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';
|
|
@@ -116,6 +117,17 @@ export declare interface CommonPropsType {
|
|
|
116
117
|
* @memberof CommonPropsType
|
|
117
118
|
*/
|
|
118
119
|
fetchContent: (noCache?: boolean) => Promise<void>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* An optional property contains a list of names of plugin components who are mounted to replace a built-in component.
|
|
123
|
+
* Only available for component types that supports more than one plugins to be mounted.
|
|
124
|
+
* e.g. `ExtraVisualisationSection` plugin components.
|
|
125
|
+
* When more than one components are mounted to replace a built-in component, each of the plugin component will receive this property.
|
|
126
|
+
*
|
|
127
|
+
* @type {string[]}
|
|
128
|
+
* @memberof CommonPropsType
|
|
129
|
+
*/
|
|
130
|
+
loadedPluginNames?: string[];
|
|
119
131
|
}
|
|
120
132
|
|
|
121
133
|
declare type CompatiblePreviews = {
|
|
@@ -129,70 +141,603 @@ declare type CompatiblePreviews = {
|
|
|
129
141
|
google?: boolean;
|
|
130
142
|
};
|
|
131
143
|
|
|
132
|
-
|
|
144
|
+
/**
|
|
145
|
+
* Magda frontend application configuration data structure.
|
|
146
|
+
* 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).
|
|
147
|
+
* At the beginning of starting up, the frontend application will retrieve this config data from the web server.
|
|
148
|
+
* 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).
|
|
149
|
+
*
|
|
150
|
+
* @export
|
|
151
|
+
* @interface ConfigDataType
|
|
152
|
+
*/
|
|
153
|
+
export declare interface ConfigDataType {
|
|
154
|
+
/**
|
|
155
|
+
* 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.
|
|
156
|
+
* One common use case is to set [credentials field](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#credentials).
|
|
157
|
+
* 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"`.
|
|
158
|
+
* This will allow `credentials` (e.g. cookie) to be shared with remote dev testing API server.
|
|
159
|
+
*
|
|
160
|
+
* @type {RequestInit}
|
|
161
|
+
* @memberof ConfigDataType
|
|
162
|
+
*/
|
|
163
|
+
commonFetchRequestOptions: RequestInit;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* The docker image information of the web server that serves all frontend resources of the application.
|
|
167
|
+
*
|
|
168
|
+
* @type {{
|
|
169
|
+
* pullPolicy?: string;
|
|
170
|
+
* repository?: string;
|
|
171
|
+
* tag?: string;
|
|
172
|
+
* }}
|
|
173
|
+
* @memberof ConfigDataType
|
|
174
|
+
*/
|
|
133
175
|
image?: {
|
|
134
176
|
pullPolicy?: string;
|
|
135
177
|
repository?: string;
|
|
136
178
|
tag?: string;
|
|
137
179
|
};
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* The authorisation API base URL config value that is supplied by the web server.
|
|
183
|
+
* 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.
|
|
184
|
+
*
|
|
185
|
+
* @type {string}
|
|
186
|
+
* @memberof ConfigDataType
|
|
187
|
+
*/
|
|
188
|
+
authApiBaseUrl: string;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* The base URL path of all APIs (e.g. '/');
|
|
192
|
+
* 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.
|
|
193
|
+
*
|
|
194
|
+
* @type {string}
|
|
195
|
+
* @memberof ConfigDataType
|
|
196
|
+
*/
|
|
197
|
+
baseUrl: string;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* The default redirection url for all auth plugins once the authentication process is completed.
|
|
201
|
+
*
|
|
202
|
+
* @type {string}
|
|
203
|
+
* @memberof ConfigDataType
|
|
204
|
+
*/
|
|
205
|
+
authPluginRedirectUrl: string;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Similar to `baseUrl`. But this field always includes the external access domain of the application.
|
|
209
|
+
* You might want to use its value in use cases e.g. generating external accessible links for email content.
|
|
210
|
+
*
|
|
211
|
+
* @type {string}
|
|
212
|
+
* @memberof ConfigDataType
|
|
213
|
+
*/
|
|
214
|
+
baseExternalUrl: string;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The base url path where the web client will be served at.
|
|
218
|
+
* E.g. when `uiBaseUrl`=`/`, the web client will served at `https://example.com/`.
|
|
219
|
+
* When `uiBaseUrl`=`/abc/def`, the web client will served at `https://example.com/abc/def`.
|
|
220
|
+
* Please note: this field only reflect where the wbe client / frontend application is served at.
|
|
221
|
+
* It doesn't reflect where all APIs are served. To find out it, the value `baseUrl` field should be used.
|
|
222
|
+
*
|
|
223
|
+
* @type {string}
|
|
224
|
+
* @memberof ConfigDataType
|
|
225
|
+
*/
|
|
226
|
+
uiBaseUrl: string;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Whether or not the notification banner should be shown.
|
|
230
|
+
*
|
|
231
|
+
* @type {boolean}
|
|
232
|
+
* @memberof ConfigDataType
|
|
233
|
+
*/
|
|
143
234
|
showNotificationBanner?: boolean;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* The content API base URL config value that is supplied by the web server.
|
|
238
|
+
* 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.
|
|
239
|
+
*
|
|
240
|
+
* @type {string}
|
|
241
|
+
* @memberof ConfigDataType
|
|
242
|
+
*/
|
|
243
|
+
contentApiBaseUrl: string;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* The API endpoint URL to retrieve all default content items (e.g. header & footer items etc.).
|
|
247
|
+
* The value of this field is created from field `contentApiBaseUrl`.
|
|
248
|
+
* 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.
|
|
249
|
+
*
|
|
250
|
+
* @type {string}
|
|
251
|
+
* @memberof ConfigDataType
|
|
252
|
+
*/
|
|
253
|
+
contentUrl: string;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* The map preview module base access URL config value that is supplied by the web server.
|
|
257
|
+
* 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.
|
|
258
|
+
*
|
|
259
|
+
* @type {string}
|
|
260
|
+
* @memberof ConfigDataType
|
|
261
|
+
*/
|
|
262
|
+
previewMapBaseUrl: string;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* The CORS resource proxy url. Mainly used by map preview module to load CORS resources from whitelist domains.
|
|
266
|
+
* Its value is generated from `previewMapBaseUrl`.
|
|
267
|
+
*
|
|
268
|
+
* @type {string}
|
|
269
|
+
* @memberof ConfigDataType
|
|
270
|
+
*/
|
|
271
|
+
proxyUrl: string;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* The indexer API base URL config value that is supplied by the web server.
|
|
275
|
+
* 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.
|
|
276
|
+
*
|
|
277
|
+
* @type {string}
|
|
278
|
+
* @memberof ConfigDataType
|
|
279
|
+
*/
|
|
280
|
+
indexerApiBaseUrl: string;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* The registry API base URL config value that is supplied by the web server.
|
|
284
|
+
* 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.
|
|
285
|
+
* Please note: this registry API endpoint can handle both read & write requests.
|
|
286
|
+
* Since v0.0.59, readonly (HTTP GET) requests that are sent to this endpoint externally will be auto-forward to the readonly endpoint `registryApiReadOnlyBaseUrl`.
|
|
287
|
+
* However, for performance consideration (as gateway doesn't need to check HTTP method), `registryApiReadOnlyBaseUrl` should still be the preferred endpoint for readonly requests.
|
|
288
|
+
*
|
|
289
|
+
* @type {string}
|
|
290
|
+
* @memberof ConfigDataType
|
|
291
|
+
*/
|
|
292
|
+
registryApiBaseUrl: string;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* The registry readonly 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
|
+
* Please note: this registry API endpoint can only handle both read requests only.
|
|
298
|
+
* The readonly registry API endpoint can scale horizontally easily. Thus, should be the preferred endpoint for serving readonly requests.
|
|
299
|
+
*
|
|
300
|
+
* @type {string}
|
|
301
|
+
* @memberof ConfigDataType
|
|
302
|
+
*/
|
|
303
|
+
registryApiReadOnlyBaseUrl: string;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* The search API base URL config value that is supplied by the web server.
|
|
307
|
+
* 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.
|
|
308
|
+
*
|
|
309
|
+
* @type {string}
|
|
310
|
+
* @memberof ConfigDataType
|
|
311
|
+
*/
|
|
312
|
+
searchApiBaseUrl: string;
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* The correspondence API base URL config value that is supplied by the web server.
|
|
316
|
+
* 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.
|
|
317
|
+
*
|
|
318
|
+
* @type {string}
|
|
319
|
+
* @memberof ConfigDataType
|
|
320
|
+
*/
|
|
150
321
|
correspondenceApiBaseUrl?: string;
|
|
151
|
-
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* The storage API base URL config value that is supplied by the web server.
|
|
325
|
+
* 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.
|
|
326
|
+
*
|
|
327
|
+
* @type {string}
|
|
328
|
+
* @memberof ConfigDataType
|
|
329
|
+
*/
|
|
330
|
+
storageApiBaseUrl: string;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* The admin API base URL config value that is supplied by the web server.
|
|
334
|
+
* 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.
|
|
335
|
+
*
|
|
336
|
+
* @type {string}
|
|
337
|
+
* @memberof ConfigDataType
|
|
338
|
+
*/
|
|
339
|
+
adminApiBaseUrl: string;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Google Analytics ID
|
|
343
|
+
*
|
|
344
|
+
* @type {Array<string>}
|
|
345
|
+
* @memberof ConfigDataType
|
|
346
|
+
*/
|
|
152
347
|
gapiIds?: Array<string>;
|
|
153
|
-
|
|
154
|
-
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* remote RSS news endpoint.
|
|
351
|
+
* This config field is deprecated & to be removed in future.
|
|
352
|
+
*
|
|
353
|
+
* @type {string}
|
|
354
|
+
* @memberof ConfigDataType
|
|
355
|
+
*/
|
|
356
|
+
rssUrl?: string;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* When set to `true`, the user account related links & buttons will be removed.
|
|
360
|
+
* Default to `false`.
|
|
361
|
+
*
|
|
362
|
+
* @type {boolean}
|
|
363
|
+
* @memberof ConfigDataType
|
|
364
|
+
*/
|
|
365
|
+
disableAuthenticationFeatures: boolean;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* The url of fallback dev API server for testing.
|
|
369
|
+
* It will only be used when the web client is run locally.
|
|
370
|
+
*
|
|
371
|
+
* @type {string}
|
|
372
|
+
* @memberof ConfigDataType
|
|
373
|
+
*/
|
|
155
374
|
fallbackUrl?: string;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* A set of feature flags to turn on/of a list of features.
|
|
378
|
+
*
|
|
379
|
+
* @type {{
|
|
380
|
+
* [id: string]: boolean;
|
|
381
|
+
* }}
|
|
382
|
+
* @memberof ConfigDataType
|
|
383
|
+
*/
|
|
384
|
+
featureFlags: FeatureFlagsConfigType;
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Whether or not the "use Magda storage" option should be pre-selected on dataset editor UI.
|
|
388
|
+
*
|
|
389
|
+
* @type {boolean}
|
|
390
|
+
* @memberof ConfigDataType
|
|
391
|
+
*/
|
|
392
|
+
useMagdaStorageByDefault: boolean;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* A list of vocabulary api endpoints that are used to validate the auto-generated keywords in dataset editor UI.
|
|
396
|
+
* By default, it's set to:
|
|
397
|
+
* - "https://vocabs.ands.org.au/repository/api/lda/abares/australian-land-use-and-management-classification/version-8/concept.json",
|
|
398
|
+
* - "https://vocabs.ands.org.au/repository/api/lda/ands-nc/controlled-vocabulary-for-resource-type-genres/version-1-1/concept.json"
|
|
399
|
+
*
|
|
400
|
+
* @type {string[]}
|
|
401
|
+
* @memberof ConfigDataType
|
|
402
|
+
*/
|
|
160
403
|
vocabularyApiEndpoints: string[];
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* A list of keywords that should never be generated by the auto keyword generation module in the dataset editor UI.
|
|
407
|
+
*
|
|
408
|
+
* @type {string[]}
|
|
409
|
+
* @memberof ConfigDataType
|
|
410
|
+
*/
|
|
411
|
+
keywordsBlackList?: string[];
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Default Organization ID for dataset editor UI.
|
|
415
|
+
*
|
|
416
|
+
* @type {string}
|
|
417
|
+
* @memberof ConfigDataType
|
|
418
|
+
*/
|
|
161
419
|
defaultOrganizationId?: string;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Default email to forward users' inquiry.
|
|
423
|
+
*
|
|
424
|
+
* @type {string}
|
|
425
|
+
* @memberof ConfigDataType
|
|
426
|
+
*/
|
|
162
427
|
defaultContactEmail?: string;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* deprecated. Not used anymore. To be removed in future.
|
|
431
|
+
*
|
|
432
|
+
* @type {number}
|
|
433
|
+
* @memberof ConfigDataType
|
|
434
|
+
*/
|
|
163
435
|
custodianOrgLevel: number;
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* The maximum size that a file can be in order to be automatically previewed by the ui as a map, graph or table.
|
|
439
|
+
*
|
|
440
|
+
* @type {number}
|
|
441
|
+
* @memberof ConfigDataType
|
|
442
|
+
*/
|
|
164
443
|
automaticPreviewMaxFileSize: number;
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* List all mandatory fields in dataset editor.
|
|
447
|
+
*
|
|
448
|
+
* @type {ValidationFieldList}
|
|
449
|
+
* @memberof ConfigDataType
|
|
450
|
+
*/
|
|
165
451
|
mandatoryFields: ValidationFieldList;
|
|
166
|
-
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* The date format config used in dataset editor auto date information extraction.
|
|
455
|
+
*
|
|
456
|
+
* @type {DateConfig}
|
|
457
|
+
* @memberof ConfigDataType
|
|
458
|
+
*/
|
|
459
|
+
dateConfig: DateConfig;
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Whether or not allow user to input manual keywords in the dataset editor.
|
|
463
|
+
*
|
|
464
|
+
* @type {boolean}
|
|
465
|
+
* @memberof ConfigDataType
|
|
466
|
+
*/
|
|
167
467
|
noManualKeywords?: boolean;
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Whether or not allow user to input manual themes in the dataset editor.
|
|
471
|
+
*
|
|
472
|
+
* @type {boolean}
|
|
473
|
+
* @memberof ConfigDataType
|
|
474
|
+
*/
|
|
168
475
|
noManualThemes?: boolean;
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Predefined dataset theme list used in the dataset editor.
|
|
479
|
+
*
|
|
480
|
+
* @type {boolean}
|
|
481
|
+
* @memberof ConfigDataType
|
|
482
|
+
*/
|
|
169
483
|
datasetThemes?: string[];
|
|
170
|
-
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* The openfaas API base URL config value that is supplied by the web server.
|
|
487
|
+
* 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.
|
|
488
|
+
*
|
|
489
|
+
* @type {string}
|
|
490
|
+
* @memberof ConfigDataType
|
|
491
|
+
*/
|
|
171
492
|
openfaasBaseUrl?: string;
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Config for optional dataset auto-sync to ckan feature.
|
|
496
|
+
* Only available when [magda-minion-ckan-exporter](https://github.com/magda-io/magda-minion-ckan-exporter) is deployed and feature flag `publishToDga` is `true`.
|
|
497
|
+
* This feature is still in beta.
|
|
498
|
+
*
|
|
499
|
+
* @type {{
|
|
500
|
+
* [ckanServerUrl: string]: boolean;
|
|
501
|
+
* }}
|
|
502
|
+
* @memberof ConfigDataType
|
|
503
|
+
*/
|
|
172
504
|
ckanExportServers: {
|
|
173
505
|
[ckanServerUrl: string]: boolean;
|
|
174
506
|
};
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* The default CKAN server for the optional dataset auto-sync to ckan feature.
|
|
510
|
+
* see config field `ckanExportServers`.
|
|
511
|
+
*
|
|
512
|
+
* @type {string}
|
|
513
|
+
* @memberof ConfigDataType
|
|
514
|
+
*/
|
|
175
515
|
defaultCkanServer: string;
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* The default timezone used in the application.
|
|
519
|
+
*
|
|
520
|
+
* @type {string}
|
|
521
|
+
* @memberof ConfigDataType
|
|
522
|
+
*/
|
|
176
523
|
defaultTimeZone?: string;
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* 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.
|
|
527
|
+
*
|
|
528
|
+
* @type {boolean}
|
|
529
|
+
* @memberof ConfigDataType
|
|
530
|
+
*/
|
|
177
531
|
enableCrawlerViews?: boolean;
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* The discourse site url.
|
|
535
|
+
* For the optional discourse site integration feature.
|
|
536
|
+
* When its value is empty, the feature will be disabled.
|
|
537
|
+
*
|
|
538
|
+
* @type {string}
|
|
539
|
+
* @memberof ConfigDataType
|
|
540
|
+
*/
|
|
178
541
|
discourseSiteUrl?: string;
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* For the optional discourse site integration feature.
|
|
545
|
+
* Indicate whether show the discourse comment area on dataset page.
|
|
546
|
+
*
|
|
547
|
+
* @type {boolean}
|
|
548
|
+
* @memberof ConfigDataType
|
|
549
|
+
*/
|
|
179
550
|
discourseIntegrationDatasetPage?: boolean;
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* For the optional discourse site integration feature.
|
|
554
|
+
* Indicate whether show the discourse comment area on distribution page.
|
|
555
|
+
*
|
|
556
|
+
* @type {boolean}
|
|
557
|
+
* @memberof ConfigDataType
|
|
558
|
+
*/
|
|
180
559
|
discourseIntegrationDistributionPage?: boolean;
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* A list of optional external UI component plugins bundle URLs.
|
|
563
|
+
*
|
|
564
|
+
* @type {string[]}
|
|
565
|
+
* @memberof ConfigDataType
|
|
566
|
+
*/
|
|
181
567
|
externalUIComponents?: string[];
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* A list of optional external CSS files to overwrite the looking of the site.
|
|
571
|
+
*
|
|
572
|
+
* @type {string[]}
|
|
573
|
+
* @memberof ConfigDataType
|
|
574
|
+
*/
|
|
182
575
|
externalCssFiles?: string[];
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* The url used when user click `home` link or header logo.
|
|
579
|
+
* Default to "/"
|
|
580
|
+
*
|
|
581
|
+
* @type {string}
|
|
582
|
+
* @memberof ConfigDataType
|
|
583
|
+
*/
|
|
183
584
|
homePageUrl?: string;
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* The responsive UI break points.
|
|
588
|
+
*
|
|
589
|
+
* @type {{
|
|
590
|
+
* small: number;
|
|
591
|
+
* medium: number;
|
|
592
|
+
* large: number;
|
|
593
|
+
* }}
|
|
594
|
+
* @memberof ConfigDataType
|
|
595
|
+
*/
|
|
596
|
+
breakpoints?: {
|
|
597
|
+
small: number;
|
|
598
|
+
medium: number;
|
|
599
|
+
large: number;
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Search panel facet config.
|
|
604
|
+
*
|
|
605
|
+
* @type {FacetConfigItem[]}
|
|
606
|
+
* @memberof ConfigDataType
|
|
607
|
+
*/
|
|
608
|
+
facets?: FacetConfigItem[];
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Header logo URL.
|
|
612
|
+
*
|
|
613
|
+
* @type {string}
|
|
614
|
+
* @memberof ConfigDataType
|
|
615
|
+
*/
|
|
616
|
+
headerLogoUrl?: string;
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Header logo URL for mobile view.
|
|
620
|
+
*
|
|
621
|
+
* @type {string}
|
|
622
|
+
* @memberof ConfigDataType
|
|
623
|
+
*/
|
|
624
|
+
headerMobileLogoUrl?: string;
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* A list of month name to be used in the application
|
|
628
|
+
*
|
|
629
|
+
* @type {string[]}
|
|
630
|
+
* @memberof ConfigDataType
|
|
631
|
+
*/
|
|
632
|
+
months?: string[];
|
|
633
|
+
/**
|
|
634
|
+
* Default boundingBox for map preview module
|
|
635
|
+
*
|
|
636
|
+
* @type {{
|
|
637
|
+
* west: number;
|
|
638
|
+
* south: number;
|
|
639
|
+
* east: number;
|
|
640
|
+
* north: number;
|
|
641
|
+
* }}
|
|
642
|
+
* @memberof ConfigDataType
|
|
643
|
+
*/
|
|
644
|
+
boundingBox: {
|
|
645
|
+
west: number;
|
|
646
|
+
south: number;
|
|
647
|
+
east: number;
|
|
648
|
+
north: number;
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Whether the "Open in XXXX" button over the map preview module should support terria map v7 config format.
|
|
653
|
+
*
|
|
654
|
+
* @type {boolean}
|
|
655
|
+
* @memberof ConfigDataType
|
|
656
|
+
*/
|
|
184
657
|
supportExternalTerriaMapV7?: boolean;
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* The the "Open in XXXX" over the map preview module button text label.
|
|
661
|
+
* By default, it's set to "Open in National Map".
|
|
662
|
+
* But you can set to other value in case you want to send data to your own terria map.
|
|
663
|
+
*
|
|
664
|
+
* @type {string}
|
|
665
|
+
* @memberof ConfigDataType
|
|
666
|
+
*/
|
|
185
667
|
openInExternalTerriaMapButtonText?: string;
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* The target terria map URL that the "Open in XXXX" over the map preview module button should send data to.
|
|
671
|
+
*
|
|
672
|
+
* @type {string}
|
|
673
|
+
* @memberof ConfigDataType
|
|
674
|
+
*/
|
|
186
675
|
openInExternalTerriaMapTargetUrl?: string;
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* extraConfigData is mainly for config data passing to external UI plugins
|
|
679
|
+
*
|
|
680
|
+
* @type {{
|
|
681
|
+
* [key: string]: any;
|
|
682
|
+
* }}
|
|
683
|
+
* @memberof ConfigDataType
|
|
684
|
+
*/
|
|
187
685
|
extraConfigData?: {
|
|
188
|
-
// extraConfigData is mainly for config data passing to external UI plugins
|
|
189
686
|
[key: string]: any;
|
|
190
687
|
};
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* A format preference list for the map preview module.
|
|
691
|
+
* It controls, on dataset page, when more than one formats are available, which format data file / API will be used for best user experience.
|
|
692
|
+
*
|
|
693
|
+
* @type {RawPreviewMapFormatPerferenceItem[]}
|
|
694
|
+
* @memberof ConfigDataType
|
|
695
|
+
*/
|
|
191
696
|
previewMapFormatPerference?: RawPreviewMapFormatPerferenceItem[];
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Whether or not show the contact button when the contact information of the dataset is not available.
|
|
700
|
+
* When set to `true`, the inquiries will be sent to the default contact email.
|
|
701
|
+
*
|
|
702
|
+
* @type {boolean}
|
|
703
|
+
* @memberof ConfigDataType
|
|
704
|
+
*/
|
|
192
705
|
showContactButtonForNoContactPointDataset?: boolean;
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* The default storage bucket that storage API should use.
|
|
709
|
+
*
|
|
710
|
+
* @type {string}
|
|
711
|
+
* @memberof ConfigDataType
|
|
712
|
+
*/
|
|
193
713
|
defaultDatasetBucket?: string;
|
|
194
|
-
|
|
195
|
-
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* The landing page URL for anonymous users.
|
|
717
|
+
* By default, it's "/home". You might want to set to "/account", if your system is not open to public users.
|
|
718
|
+
*
|
|
719
|
+
* @type {string}
|
|
720
|
+
* @memberof ConfigDataType
|
|
721
|
+
*/
|
|
722
|
+
anonymousUserLandingPage: string;
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* The landing page URL for authenticated users.
|
|
726
|
+
* By default, it's "/home".
|
|
727
|
+
*
|
|
728
|
+
* @type {string}
|
|
729
|
+
* @memberof ConfigDataType
|
|
730
|
+
*/
|
|
731
|
+
authenticatedUserLandingPage: string;
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* How long before reload the current user's auth data in the background.
|
|
735
|
+
* Useful to transit UI to correct status when user leave browser open without interaction for long time.
|
|
736
|
+
* Default: 5 mins
|
|
737
|
+
*
|
|
738
|
+
* @type {number}
|
|
739
|
+
* @memberof ConfigDataType
|
|
740
|
+
*/
|
|
196
741
|
authStatusRefreshInterval?: number;
|
|
197
742
|
}
|
|
198
743
|
|
|
@@ -218,9 +763,16 @@ declare type CurrencyData = {
|
|
|
218
763
|
}[];
|
|
219
764
|
};
|
|
220
765
|
|
|
221
|
-
|
|
766
|
+
/**
|
|
767
|
+
* The properties that DatasetEditButton Plugin Component will receive.
|
|
768
|
+
*
|
|
769
|
+
* @export
|
|
770
|
+
* @interface FooterComponentPropsType
|
|
771
|
+
* @extends {CommonPropsType}
|
|
772
|
+
*/
|
|
773
|
+
export declare interface DatasetEditButtonComponentPropsType extends CommonPropsType {
|
|
222
774
|
dataset: ParsedDataset;
|
|
223
|
-
}
|
|
775
|
+
}
|
|
224
776
|
|
|
225
777
|
/**
|
|
226
778
|
* Dataset page `Edit Dataset` button external plugin component type
|
|
@@ -230,9 +782,16 @@ export declare type DatasetEditButtonComponentType = ComponentType<
|
|
|
230
782
|
DatasetEditButtonComponentPropsType
|
|
231
783
|
>;
|
|
232
784
|
|
|
233
|
-
|
|
785
|
+
/**
|
|
786
|
+
* The properties that DatasetLikeButton Plugin Component will receive.
|
|
787
|
+
*
|
|
788
|
+
* @export
|
|
789
|
+
* @interface FooterComponentPropsType
|
|
790
|
+
* @extends {CommonPropsType}
|
|
791
|
+
*/
|
|
792
|
+
export declare interface DatasetLikeButtonComponentPropsType extends CommonPropsType {
|
|
234
793
|
dataset: ParsedDataset;
|
|
235
|
-
}
|
|
794
|
+
}
|
|
236
795
|
|
|
237
796
|
/**
|
|
238
797
|
* Search Result page `Like Button` external plugin component type
|
|
@@ -252,32 +811,65 @@ declare interface DateConfig {
|
|
|
252
811
|
};
|
|
253
812
|
}
|
|
254
813
|
|
|
255
|
-
|
|
814
|
+
/**
|
|
815
|
+
* The properties that ExtraVisualisationSection Plugin Component will receive.
|
|
816
|
+
*
|
|
817
|
+
* @export
|
|
818
|
+
* @interface FooterComponentPropsType
|
|
819
|
+
* @extends {CommonPropsType}
|
|
820
|
+
*/
|
|
821
|
+
export declare interface ExtraVisualisationSectionComponentPropsType
|
|
822
|
+
extends CommonPropsType {
|
|
256
823
|
dataset: ParsedDataset;
|
|
257
824
|
distributionId?: string;
|
|
258
|
-
}
|
|
825
|
+
}
|
|
259
826
|
|
|
260
827
|
/**
|
|
261
828
|
* Visualisation Section external plugin component type.
|
|
262
829
|
* This plugin will be mounted on dataset or distribution page.
|
|
263
|
-
* More info & example please refer to repo: [magda-ui-plugin-component-dap-
|
|
830
|
+
* More info & example please refer to repo: [magda-ui-plugin-component-dap-image-gallery](https://github.com/magda-io/magda-ui-plugin-component-dap-image-gallery)
|
|
264
831
|
* @category External UI Plugin Component Types
|
|
265
832
|
*/
|
|
266
833
|
export declare type ExtraVisualisationSectionComponentType = ComponentType<
|
|
267
834
|
ExtraVisualisationSectionComponentPropsType
|
|
268
835
|
>;
|
|
269
836
|
|
|
837
|
+
declare interface FacetConfigItem {
|
|
838
|
+
id: string;
|
|
839
|
+
component: Component<any>;
|
|
840
|
+
showExplanation?: boolean;
|
|
841
|
+
name?: string;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
declare type FeatureFlagsConfigType = Partial<Record<FeatureFlagType, boolean>>;
|
|
845
|
+
|
|
846
|
+
declare type FeatureFlagType =
|
|
847
|
+
| "cataloguing"
|
|
848
|
+
| "publishToDga"
|
|
849
|
+
| "previewAddDataset"
|
|
850
|
+
| "datasetApprovalWorkflowOn"
|
|
851
|
+
| "useStorageApi"
|
|
852
|
+
| "datasetLikeButton"
|
|
853
|
+
| "enableAutoMetadataFetchButton";
|
|
854
|
+
|
|
270
855
|
declare type FetchError = {
|
|
271
856
|
title: string;
|
|
272
857
|
detail: string;
|
|
273
858
|
};
|
|
274
859
|
|
|
275
|
-
|
|
860
|
+
/**
|
|
861
|
+
* The properties that Footer Plugin Component will receive.
|
|
862
|
+
*
|
|
863
|
+
* @export
|
|
864
|
+
* @interface FooterComponentPropsType
|
|
865
|
+
* @extends {CommonPropsType}
|
|
866
|
+
*/
|
|
867
|
+
export declare interface FooterComponentPropsType extends CommonPropsType {
|
|
276
868
|
noTopMargin: boolean;
|
|
277
869
|
footerMediumNavs: FooterNavLinkGroup[];
|
|
278
870
|
footerSmallNavs: FooterNavLinkGroup[];
|
|
279
871
|
footerCopyRightItems: CopyRightItem[];
|
|
280
|
-
}
|
|
872
|
+
}
|
|
281
873
|
|
|
282
874
|
/**
|
|
283
875
|
* Footer external plugin component type
|
|
@@ -309,7 +901,14 @@ export declare interface FooterNavLinkGroup {
|
|
|
309
901
|
order: number;
|
|
310
902
|
}
|
|
311
903
|
|
|
312
|
-
|
|
904
|
+
/**
|
|
905
|
+
* The properties that Header Plugin Component will receive.
|
|
906
|
+
*
|
|
907
|
+
* @export
|
|
908
|
+
* @interface FooterComponentPropsType
|
|
909
|
+
* @extends {CommonPropsType}
|
|
910
|
+
*/
|
|
911
|
+
export declare interface HeaderComponentProps extends CommonPropsType {
|
|
313
912
|
headerNavItems: HeaderNavItem[];
|
|
314
913
|
}
|
|
315
914
|
|
|
@@ -336,13 +935,12 @@ export declare interface HeaderNavItem {
|
|
|
336
935
|
order: number;
|
|
337
936
|
}
|
|
338
937
|
|
|
339
|
-
declare
|
|
938
|
+
declare interface Operation {
|
|
340
939
|
id: string;
|
|
341
940
|
uri: string;
|
|
342
941
|
name: string;
|
|
343
|
-
description
|
|
344
|
-
|
|
345
|
-
};
|
|
942
|
+
description?: string;
|
|
943
|
+
}
|
|
346
944
|
|
|
347
945
|
declare type OrgUnit = {
|
|
348
946
|
id: string;
|
|
@@ -390,6 +988,7 @@ declare type ParsedDataset = {
|
|
|
390
988
|
};
|
|
391
989
|
ckanExport?: CkanExportAspectType;
|
|
392
990
|
access: Access;
|
|
991
|
+
defaultLicense?: string;
|
|
393
992
|
};
|
|
394
993
|
|
|
395
994
|
declare type ParsedDistribution = {
|
|
@@ -433,21 +1032,41 @@ declare type ParsedProvenance = {
|
|
|
433
1032
|
isOpenData?: boolean;
|
|
434
1033
|
};
|
|
435
1034
|
|
|
436
|
-
declare interface
|
|
1035
|
+
declare interface Permission {
|
|
437
1036
|
id: string;
|
|
438
1037
|
name: string;
|
|
439
|
-
description
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
1038
|
+
description?: string;
|
|
1039
|
+
resourceId: string;
|
|
1040
|
+
resourceUri: string;
|
|
1041
|
+
userOwnershipConstraint: boolean;
|
|
1042
|
+
orgUnitOwnershipConstraint: boolean;
|
|
1043
|
+
preAuthorisedConstraint: boolean;
|
|
1044
|
+
operations: Operation[];
|
|
1045
|
+
createBy?: string;
|
|
1046
|
+
createTime?: Date;
|
|
1047
|
+
editBy?: string;
|
|
1048
|
+
editTime?: Date;
|
|
449
1049
|
}
|
|
450
1050
|
|
|
1051
|
+
/**
|
|
1052
|
+
* The constant define the prefix that is used to create the global scope variable name `MagdaPluginComponentxxxx`, to which the external UI plugin bundle should export to.
|
|
1053
|
+
* Here, `xxxx` is the plugin UI component type name
|
|
1054
|
+
* e.g. The Header Component should bundled & export to global scope variable `MagdaPluginComponentHeader`.
|
|
1055
|
+
*
|
|
1056
|
+
* The currently support all type names are:
|
|
1057
|
+
* - Header
|
|
1058
|
+
* - Footer
|
|
1059
|
+
* - DatasetEditButton
|
|
1060
|
+
* - DatasetLikeButton
|
|
1061
|
+
* - ExtraVisualisationSection
|
|
1062
|
+
*
|
|
1063
|
+
* Please refer to `External UI Plugin Component Types Type Aliases` section for functionality of each plugin UI component type.
|
|
1064
|
+
*
|
|
1065
|
+
* > Since Magda v2.2.0, users can load more than one "Extra Visualisation Section" type Magda UI Plugin Components.
|
|
1066
|
+
* To allow this, the component is required to be packaged as a library and exported to global scope `MagdaPluginComponentExtraVisualisationSection.xxxx`.
|
|
1067
|
+
* Here, `MagdaPluginComponentExtraVisualisationSection` should be an object with key `xxxx` set to the plugin component.
|
|
1068
|
+
* e.g. the [DAP image gallery plugin](https://github.com/magda-io/magda-ui-plugin-component-dap-image-gallery) choose to export itself to `MagdaPluginComponentExtraVisualisationSection.DAPImageGallery`.
|
|
1069
|
+
*/
|
|
451
1070
|
export declare const PREFIX = "MagdaPluginComponent";
|
|
452
1071
|
|
|
453
1072
|
declare type Publisher = {
|
|
@@ -487,11 +1106,6 @@ declare type Role = {
|
|
|
487
1106
|
permissionIds: string[];
|
|
488
1107
|
};
|
|
489
1108
|
|
|
490
|
-
declare interface RolePermissionRecord extends PermissionRecord {
|
|
491
|
-
resource_uri: string;
|
|
492
|
-
operations?: OperationRecord[];
|
|
493
|
-
}
|
|
494
|
-
|
|
495
1109
|
declare type TemporalCoverage = {
|
|
496
1110
|
intervals: {
|
|
497
1111
|
start?: string;
|
|
@@ -510,7 +1124,7 @@ declare type User = {
|
|
|
510
1124
|
sourceId?: string;
|
|
511
1125
|
isAdmin: boolean;
|
|
512
1126
|
roles: Role[];
|
|
513
|
-
permissions:
|
|
1127
|
+
permissions: Permission[];
|
|
514
1128
|
orgUnitId?: string;
|
|
515
1129
|
orgUnit?: OrgUnit;
|
|
516
1130
|
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
|
|
4
|
+
"version": "2.2.0",
|
|
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
|
|
21
|
+
"@magda/web-client": "^2.2.0",
|
|
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": {
|