diff --git a/scm-ui/public/locales/en/commons.json b/scm-ui/public/locales/en/commons.json index 1feaa80a9b..b1bad56993 100644 --- a/scm-ui/public/locales/en/commons.json +++ b/scm-ui/public/locales/en/commons.json @@ -32,7 +32,8 @@ "repositories": "Repositories", "users": "Users", "logout": "Logout", - "groups": "Groups" + "groups": "Groups", + "config": "Configuration" }, "paginator": { "next": "Next", diff --git a/scm-ui/public/locales/en/config.json b/scm-ui/public/locales/en/config.json new file mode 100644 index 0000000000..143755a318 --- /dev/null +++ b/scm-ui/public/locales/en/config.json @@ -0,0 +1,68 @@ +{ + "config": { + "navigation-title": "Navigation" + }, + "global-config": { + "title": "Configuration", + "navigation-label": "Global Configuration", + "error-title": "Error", + "error-subtitle": "Unknown Config Error" + }, + "config-form": { + "submit": "Submit", + "no-permission-notification": "Please note: You do not have the permission to edit the config!" + }, + "proxy-settings": { + "name": "Proxy Settings", + "proxy-password": "Proxy Password", + "proxy-port": "Proxy Port", + "proxy-server": "Proxy Server", + "proxy-user": "Proxy User", + "enable-proxy": "Enable Proxy", + "proxy-excludes": "Proxy Excludes", + "remove-proxy-exclude-button": "Remove Proxy Exclude", + "add-proxy-exclude-error": "The proxy exclude you want to add is not valid", + "add-proxy-exclude-textfield": "Add proxy exclude you want to add to proxy excludes here", + "add-proxy-exclude-button": "Add Proxy Exclude" + }, + "base-url-settings": { + "name": "Base URL Settings", + "base-url": "Base URL", + "force-base-url": "Force Base URL" + }, + "admin-settings": { + "name": "Administration Settings", + "admin-groups": "Admin Groups", + "admin-users": "Admin Users", + "remove-group-button": "Remove Admin Group", + "remove-user-button": "Remove Admin User", + "add-group-error": "The group name you want to add is not valid", + "add-group-textfield": "Add group you want to add to admin groups here", + "add-group-button": "Add Admin Group", + "add-user-error": "The user name you want to add is not valid", + "add-user-textfield": "Add user you want to add to admin users here", + "add-user-button": "Add Admin User" + }, + "login-attempt": { + "name": "Login Attempt", + "login-attempt-limit": "Login Attempt Limit", + "login-attempt-limit-timeout": "Login Attempt Limit Timeout" + }, + "general-settings": { + "realm-description": "Realm Description", + "enable-repository-archive": "Enable Repository Archive", + "disable-grouping-grid": "Disable Grouping Grid", + "date-format": "Date Format", + "anonymous-access-enabled": "Anonymous Access Enabled", + "skip-failed-authenticators": "Skip Failed Authenticators", + "plugin-url": "Plugin URL", + "enabled-xsrf-protection": "Enabled XSRF Protection", + "default-namespace-strategy": "Default Namespace Strategy" + }, + "validation": { + "date-format-invalid": "The date format is not valid", + "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" + } +} diff --git a/scm-ui/src/components/buttons/RemoveEntryOfTableButton.js b/scm-ui/src/components/buttons/RemoveEntryOfTableButton.js new file mode 100644 index 0000000000..280226b938 --- /dev/null +++ b/scm-ui/src/components/buttons/RemoveEntryOfTableButton.js @@ -0,0 +1,33 @@ +//@flow +import React from "react"; +import { DeleteButton } from "."; +import classNames from "classnames"; + +type Props = { + entryname: string, + removeEntry: string => void, + disabled: boolean, + label: string +}; + +type State = {}; + +class RemoveEntryOfTableButton extends React.Component { + render() { + const { label, entryname, removeEntry, disabled } = this.props; + return ( +
+ { + event.preventDefault(); + removeEntry(entryname); + }} + disabled={disabled} + /> +
+ ); + } +} + +export default RemoveEntryOfTableButton; diff --git a/scm-ui/src/components/buttons/index.js b/scm-ui/src/components/buttons/index.js index 8dfc6e00ef..e0d94d29b9 100644 --- a/scm-ui/src/components/buttons/index.js +++ b/scm-ui/src/components/buttons/index.js @@ -4,3 +4,4 @@ export { default as CreateButton } from "./CreateButton"; export { default as DeleteButton } from "./DeleteButton"; export { default as EditButton } from "./EditButton"; export { default as SubmitButton } from "./SubmitButton"; +export {default as RemoveEntryOfTableButton} from "./RemoveEntryOfTableButton"; diff --git a/scm-ui/src/components/forms/AddEntryToTableField.js b/scm-ui/src/components/forms/AddEntryToTableField.js new file mode 100644 index 0000000000..1770e07807 --- /dev/null +++ b/scm-ui/src/components/forms/AddEntryToTableField.js @@ -0,0 +1,68 @@ +//@flow +import React from "react"; + +import { AddButton } from "../buttons"; +import InputField from "./InputField"; + +type Props = { + addEntry: string => void, + disabled: boolean, + buttonLabel: string, + fieldLabel: string, + errorMessage: string +}; + +type State = { + entryToAdd: string +}; + +class AddEntryToTableField extends React.Component { + constructor(props: Props) { + super(props); + this.state = { + entryToAdd: "" + }; + } + + render() { + const { disabled, buttonLabel, fieldLabel, errorMessage } = this.props; + return ( +
+ + +
+ ); + } + + addButtonClicked = (event: Event) => { + event.preventDefault(); + this.appendEntry(); + }; + + appendEntry = () => { + const { entryToAdd } = this.state; + this.props.addEntry(entryToAdd); + this.setState({ ...this.state, entryToAdd: "" }); + }; + + handleAddEntryChange = (entryname: string) => { + this.setState({ + ...this.state, + entryToAdd: entryname + }); + }; +} + +export default AddEntryToTableField; diff --git a/scm-ui/src/components/forms/Checkbox.js b/scm-ui/src/components/forms/Checkbox.js index b37f951e2b..72dfbf4af8 100644 --- a/scm-ui/src/components/forms/Checkbox.js +++ b/scm-ui/src/components/forms/Checkbox.js @@ -4,7 +4,8 @@ import React from "react"; type Props = { label?: string, checked: boolean, - onChange?: boolean => void + onChange?: boolean => void, + disabled?: boolean }; class Checkbox extends React.Component { onCheckboxChange = (event: SyntheticInputEvent) => { @@ -17,11 +18,12 @@ class Checkbox extends React.Component { return (
-