|
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
import { withTranslation } from 'react-i18next';
|
|
import { withTranslation } from 'react-i18next';
|
|
|
|
|
|
|
|
import {
|
|
import {
|
|
|
- Dropdown, DropdownToggle, DropdownMenu, DropdownItem,
|
|
|
|
|
|
|
+ UncontrolledDropdown, DropdownToggle, DropdownMenu, DropdownItem,
|
|
|
Tooltip,
|
|
Tooltip,
|
|
|
} from 'reactstrap';
|
|
} from 'reactstrap';
|
|
|
|
|
|
|
@@ -18,6 +18,7 @@ class CopyDropdown extends React.Component {
|
|
|
this.state = {
|
|
this.state = {
|
|
|
dropdownOpen: false,
|
|
dropdownOpen: false,
|
|
|
tooltipOpen: false,
|
|
tooltipOpen: false,
|
|
|
|
|
+ isParamsAppended: true,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
this.toggle = this.toggle.bind(this);
|
|
this.toggle = this.toggle.bind(this);
|
|
@@ -88,6 +89,7 @@ class CopyDropdown extends React.Component {
|
|
|
|
|
|
|
|
render() {
|
|
render() {
|
|
|
const { t, pageId } = this.props;
|
|
const { t, pageId } = this.props;
|
|
|
|
|
+ const { isParamsAppended } = this.state;
|
|
|
|
|
|
|
|
const pagePathWithParams = this.generatePagePathWithParams();
|
|
const pagePathWithParams = this.generatePagePathWithParams();
|
|
|
const pagePathUrl = this.generatePagePathUrl();
|
|
const pagePathUrl = this.generatePagePathUrl();
|
|
@@ -97,7 +99,7 @@ class CopyDropdown extends React.Component {
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
- <Dropdown id="copyPagePathDropdown" className="grw-copy-dropdown" isOpen={this.state.dropdownOpen} toggle={this.toggle}>
|
|
|
|
|
|
|
+ <UncontrolledDropdown id="copyPagePathDropdown" className="grw-copy-dropdown">
|
|
|
|
|
|
|
|
<DropdownToggle
|
|
<DropdownToggle
|
|
|
caret
|
|
caret
|
|
@@ -108,7 +110,22 @@ class CopyDropdown extends React.Component {
|
|
|
</DropdownToggle>
|
|
</DropdownToggle>
|
|
|
|
|
|
|
|
<DropdownMenu>
|
|
<DropdownMenu>
|
|
|
- <DropdownItem header className="px-3">{ t('copy_to_clipboard.Copy to clipboard') }</DropdownItem>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <div className="d-flex align-items-center justify-content-between">
|
|
|
|
|
+ <DropdownItem header className="px-3">
|
|
|
|
|
+ { t('copy_to_clipboard.Copy to clipboard') }
|
|
|
|
|
+ </DropdownItem>
|
|
|
|
|
+ <div className="px-3 custom-control custom-switch custom-switch-sm">
|
|
|
|
|
+ <input
|
|
|
|
|
+ type="checkbox"
|
|
|
|
|
+ id="customSwitchForParams"
|
|
|
|
|
+ className="custom-control-input"
|
|
|
|
|
+ checked={isParamsAppended}
|
|
|
|
|
+ onChange={e => this.setState({ isParamsAppended: !isParamsAppended })}
|
|
|
|
|
+ />
|
|
|
|
|
+ <label className="custom-control-label" htmlFor="customSwitchForParams">Append params</label>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
<DropdownItem divider className="my-0"></DropdownItem>
|
|
<DropdownItem divider className="my-0"></DropdownItem>
|
|
|
|
|
|
|
@@ -162,7 +179,7 @@ class CopyDropdown extends React.Component {
|
|
|
)}
|
|
)}
|
|
|
</DropdownMenu>
|
|
</DropdownMenu>
|
|
|
|
|
|
|
|
- </Dropdown>
|
|
|
|
|
|
|
+ </UncontrolledDropdown>
|
|
|
|
|
|
|
|
<Tooltip placement="bottom" isOpen={this.state.tooltipOpen} target="copyPagePathDropdown" fade={false}>
|
|
<Tooltip placement="bottom" isOpen={this.state.tooltipOpen} target="copyPagePathDropdown" fade={false}>
|
|
|
copied!
|
|
copied!
|