From 2ff2c12af03946dec7ba91dd43354329791847bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maren=20S=C3=BCwer?= Date: Tue, 2 Oct 2018 10:59:44 +0200 Subject: [PATCH] add help for configuration and repositories --- .../src/forms/AddEntryToTableField.js | 9 ++++---- scm-ui/public/locales/en/config.json | 22 +++++++++++++++++++ scm-ui/public/locales/en/repos.json | 6 +++++ .../config/components/form/AdminSettings.js | 2 ++ .../config/components/form/BaseUrlSettings.js | 2 ++ .../config/components/form/GeneralSettings.js | 10 +++++++-- .../config/components/form/LoginAttempt.js | 2 ++ .../config/components/form/ProxySettings.js | 6 +++++ scm-ui/src/groups/components/GroupForm.js | 1 + .../repos/components/form/RepositoryForm.js | 4 ++++ 10 files changed, 57 insertions(+), 7 deletions(-) diff --git a/scm-ui-components/packages/ui-components/src/forms/AddEntryToTableField.js b/scm-ui-components/packages/ui-components/src/forms/AddEntryToTableField.js index b783f6efae..34197fc717 100644 --- a/scm-ui-components/packages/ui-components/src/forms/AddEntryToTableField.js +++ b/scm-ui-components/packages/ui-components/src/forms/AddEntryToTableField.js @@ -3,7 +3,6 @@ import React from "react"; import { AddButton } from "../buttons"; import InputField from "./InputField"; -import { translate } from "react-i18next"; type Props = { addEntry: string => void, @@ -11,7 +10,7 @@ type Props = { buttonLabel: string, fieldLabel: string, errorMessage: string, - t: string => string, + helpText?: string }; type State = { @@ -27,7 +26,7 @@ class AddEntryToTableField extends React.Component { } render() { - const { disabled, buttonLabel, fieldLabel, errorMessage, t } = this.props; + const { disabled, buttonLabel, fieldLabel, errorMessage, helpText} = this.props; return (
{ value={this.state.entryToAdd} onReturnPressed={this.appendEntry} disabled={disabled} - helpText={t("group-form.help.membersHelpText")} + helpText={helpText} /> { }; } -export default translate("groups")(AddEntryToTableField); +export default AddEntryToTableField; diff --git a/scm-ui/public/locales/en/config.json b/scm-ui/public/locales/en/config.json index 143755a318..9939c077aa 100644 --- a/scm-ui/public/locales/en/config.json +++ b/scm-ui/public/locales/en/config.json @@ -64,5 +64,27 @@ "login-attempt-limit-timeout-invalid": "This is not a number", "login-attempt-limit-invalid": "This is not a number", "plugin-url-invalid": "This is not a valid url" + }, + "help": { + "realmDescriptionHelpText": "Enter authentication realm description", + "dateFormatHelpText": "Moments date format. Please have a look at \n http://momentjs.com/docs/#/displaying/format/.
\nNote:
\n {0} - is replaced by a `time ago` string (e.g. 2 hours ago).", + "pluginRepositoryHelpText": "The url of the plugin repository.
Explanation of the {placeholders}:\n
version = SCM-Manager Version
os = Operation System
arch = Architecture", + "enableForwardingHelpText": "Enbale mod_proxy port forwarding.", + "enableRepositoryArchiveHelpText": "Enable repository archives. A complete page reload is required after a change of this value.", + "disableGroupingGridHelpText": "Disable repository Groups. A complete page reload is required after a change of this value.", + "allowAnonymousAccessHelpText": "Anonymous users have read access on public repositories.", + "skipFailedAuthenticatorsHelpText": "Do not stop the authentication chain, \n if an authenticator finds the user but fails to authenticate the user.", + "adminGroupsHelpText": "Names of groups with admin permissions.", + "adminUsersHelpText": "Names of users with admin permissions.", + "forceBaseUrlHelpText": "Redirects to the base url if the request comes from a other url", + "baseUrlHelpText": "The url of the application (with context path) i.e. http://localhost:8080/scm", + "loginAttemptLimitHelpText": "Maximum allowed login attempts. Use -1 to disable the login attempt limit.", + "loginAttemptLimitTimeoutHelpText": "Timeout in seconds for users which are temporary disabled,\n because of too many failed login attempts.", + "enableProxyHelpText": "Enable Proxy", + "proxyPortHelpText": "The proxy port", + "proxyPasswordHelpText": "The password for the proxy server authentication.", + "proxyServerHelpText": "The proxy server", + "proxyUserHelpText": "The username for the proxy server authentication.", + "proxyExcludesHelpText": "A comma separated list of glob patterns for hostnames which should be excluded from proxy settings." } } diff --git a/scm-ui/public/locales/en/repos.json b/scm-ui/public/locales/en/repos.json index 7db2623247..465f479768 100644 --- a/scm-ui/public/locales/en/repos.json +++ b/scm-ui/public/locales/en/repos.json @@ -42,5 +42,11 @@ "submit": "Yes", "cancel": "No" } + }, + "help": { + "nameHelpText": "The name of the repository. This name will be part of the repository url.", + "typeHelpText": "The type of the repository (e.g. Mercurial, Git or Subversion).", + "contactHelpText": "Email address of the person who is responsible for this repository.", + "descriptionHelpText": "A short description of the repository." } } diff --git a/scm-ui/src/config/components/form/AdminSettings.js b/scm-ui/src/config/components/form/AdminSettings.js index 0395ff294f..c10ab30120 100644 --- a/scm-ui/src/config/components/form/AdminSettings.js +++ b/scm-ui/src/config/components/form/AdminSettings.js @@ -33,6 +33,7 @@ class AdminSettings extends React.Component { buttonLabel={t("admin-settings.add-group-button")} fieldLabel={t("admin-settings.add-group-textfield")} errorMessage={t("admin-settings.add-group-error")} + helpText={t("help.adminGroupsHelpText")} /> { buttonLabel={t("admin-settings.add-user-button")} fieldLabel={t("admin-settings.add-user-textfield")} errorMessage={t("admin-settings.add-user-error")} + helpText={t("help.adminUsersHelpText")} />
); diff --git a/scm-ui/src/config/components/form/BaseUrlSettings.js b/scm-ui/src/config/components/form/BaseUrlSettings.js index 161dcf9d43..c53e2724a0 100644 --- a/scm-ui/src/config/components/form/BaseUrlSettings.js +++ b/scm-ui/src/config/components/form/BaseUrlSettings.js @@ -23,12 +23,14 @@ class BaseUrlSettings extends React.Component { label={t("base-url-settings.force-base-url")} onChange={this.handleForceBaseUrlChange} disabled={!hasUpdatePermission} + helpText={t("help.forceBaseUrlHelpText")} /> ); diff --git a/scm-ui/src/config/components/form/GeneralSettings.js b/scm-ui/src/config/components/form/GeneralSettings.js index ffc3e7452a..dc5a35214e 100644 --- a/scm-ui/src/config/components/form/GeneralSettings.js +++ b/scm-ui/src/config/components/form/GeneralSettings.js @@ -41,19 +41,21 @@ class GeneralSettings extends React.Component { onChange={this.handleRealmDescriptionChange} value={realmDescription} disabled={!hasUpdatePermission} - helpText={"hallo"} + helpText={t("help.realmDescriptionHelpText")} /> { label={t("general-settings.enabled-xsrf-protection")} onChange={this.handleEnabledXsrfProtectionChange} disabled={!hasUpdatePermission} - helpText={"hey"} + helpText={t("help.enableXsrfProtectionHelpText")} /> ); diff --git a/scm-ui/src/config/components/form/LoginAttempt.js b/scm-ui/src/config/components/form/LoginAttempt.js index 0ae7c5aa3c..ca16761ba7 100644 --- a/scm-ui/src/config/components/form/LoginAttempt.js +++ b/scm-ui/src/config/components/form/LoginAttempt.js @@ -47,6 +47,7 @@ class LoginAttempt extends React.Component { disabled={!hasUpdatePermission} validationError={this.state.loginAttemptLimitError} errorMessage={t("validation.login-attempt-limit-invalid")} + helpText={t("help.loginAttemptLimitHelpText")} /> { disabled={!hasUpdatePermission} validationError={this.state.loginAttemptLimitTimeoutError} errorMessage={t("validation.login-attempt-limit-timeout-invalid")} + helpText={t("help.loginAttemptLimitTimeoutHelpText")} /> ); diff --git a/scm-ui/src/config/components/form/ProxySettings.js b/scm-ui/src/config/components/form/ProxySettings.js index 0745312344..8498d0f617 100644 --- a/scm-ui/src/config/components/form/ProxySettings.js +++ b/scm-ui/src/config/components/form/ProxySettings.js @@ -42,6 +42,7 @@ class ProxySettings extends React.Component { label={t("proxy-settings.enable-proxy")} onChange={this.handleEnableProxyChange} disabled={!hasUpdatePermission} + helpText={t("help.enableProxyHelpText")} /> { value={proxyPassword} type="password" disabled={!enableProxy || !hasUpdatePermission} + helpText={t("help.proxyPasswordHelpText")} /> { buttonLabel={t("proxy-settings.add-proxy-exclude-button")} fieldLabel={t("proxy-settings.add-proxy-exclude-textfield")} errorMessage={t("proxy-settings.add-proxy-exclude-error")} + helpText={t("help.proxyExcludesHelpText")} /> ); diff --git a/scm-ui/src/groups/components/GroupForm.js b/scm-ui/src/groups/components/GroupForm.js index 4958fbf0fa..6638bbd419 100644 --- a/scm-ui/src/groups/components/GroupForm.js +++ b/scm-ui/src/groups/components/GroupForm.js @@ -106,6 +106,7 @@ class GroupForm extends React.Component { buttonLabel={t("add-member-button.label")} fieldLabel={t("add-member-textfield.label")} errorMessage={t("add-member-textfield.error")} + helpText={t("group-form.help.membersHelpText")} /> { value={repository ? repository.contact : ""} validationError={this.state.contactValidationError} errorMessage={t("validation.contact-invalid")} + helpText={t("help.contactHelpText")} />