From f6d6c2fdde0f783fb1dffab74e3286d11442fc23 Mon Sep 17 00:00:00 2001 From: Eryk Kulikowski Date: Thu, 20 Apr 2023 11:28:56 +0200 Subject: [PATCH] added frontend config for option dropdown initialization --- README.md | 3 ++- conf/frontend_config.json | 29 +---------------------------- image/app/config/frontend_config.go | 1 + 3 files changed, 4 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index e65e73b..2d8c146 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,8 @@ Having multiple instances for plugin types is useful when certain features, e.g. - repoNameFieldPlaceholder: the placeholder for the repository selection field. - repoNameFieldEditable: if set to ``true``, the user can paste or type repository name directly, without the use of the dropdown. - repoNameFieldValues: suggested or possible repository names. When this is filled out, a dropdown will be presented to the user, otherwise a text field will be presented. -- repoNameFieldHasSearch: when the plugin implements ``Search`` function, this field can be set to ``true`` for searchable repository names. +- repoNameFieldHasSearch: when the plugin implements ``Search`` function, this field can be set to ``true`` for searchable repository names. +- repoNameFieldHasInit: when the plugin implements ``Search`` function, this field can be set to ``true`` for initial search without the search term (initializes the dropdown to the default values as implemented by the search function). - parseSourceUrlField: when set to true, the repoName field can be left not configured and the repository name is parsed from the source URL field. - tokenName: when set to a unique value, the credential needed for authentication is stored in the browser. - tokenGetter: OAuth configuration for the repository instance containing the URL where authorizations should be redirected to, and the oauth_client_id from the OAuth application setting (e.g., GitHub application settings as described in this [guide](https://docs.github.com/en/developers/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps)). See also the backend configuration section on how to configure the needed client secrets. diff --git a/conf/frontend_config.json b/conf/frontend_config.json index d063d1f..ee04da4 100644 --- a/conf/frontend_config.json +++ b/conf/frontend_config.json @@ -10,36 +10,9 @@ "storeDvToken": true, "sendMails": true, "plugins": [ - { - "id": "mango", - "name": "ManGO (KU Leuven IRODS)", - "plugin": "irods", - "pluginName": "IRODS", - "optionFieldName": "Folder", - "optionFieldPlaceholder": "Select folder", - "optionFieldInteractive": true, - "tokenFieldName": "Token (IRODS password)", - "tokenFieldPlaceholder": "password", - "sourceUrlFieldValue": "PAM://ghum.irods.icts.kuleuven.be:1247", - "usernameFieldName": "Username", - "usernameFieldPlaceholder": "u-number", - "repoNameFieldName": "Zone", - "repoNameFieldPlaceholder": "zone", - "repoNameFieldEditable": true, - "repoNameFieldValues": [ - "gbiomed", - "gbiomed_eximious", - "gbiomed_fbi", - "ghum", - "set" - ], - "tokenGetter": { - "URL": "https://mango.kuleuven.be/data-platform/connection-info" - } - }, { "id": "irods", - "name": "Other IRODS", + "name": "IRODS", "plugin": "irods", "pluginName": "IRODS", "optionFieldName": "Folder", diff --git a/image/app/config/frontend_config.go b/image/app/config/frontend_config.go index 618a925..e81b1c6 100644 --- a/image/app/config/frontend_config.go +++ b/image/app/config/frontend_config.go @@ -22,6 +22,7 @@ type RepoPlugin struct { RepoNameFieldEditable bool `json:"repoNameFieldEditable,omitempty"` RepoNameFieldValues []string `json:"repoNameFieldValues,omitempty"` RepoNameFieldHasSearch bool `json:"repoNameFieldHasSearch"` + RepoNameFieldHasInit bool `json:"repoNameFieldHasInit"` ParseSourceUrlField bool `json:"parseSourceUrlField"` TokenName string `json:"tokenName,omitempty"` TokenGetter TokenGetter `json:"tokenGetter,omitempty"`