mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 02:10:24 +00:00
fix toggle tags popover (#5835)
This commit is contained in:
@@ -23,12 +23,12 @@ class SeahubPopover extends React.Component {
|
|||||||
isSelectOpen = false;
|
isSelectOpen = false;
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
document.addEventListener('mousedown', this.onMouseDown, true);
|
document.addEventListener('mousedown', this.onMouseDown);
|
||||||
document.addEventListener('keydown', this.onKeyDown);
|
document.addEventListener('keydown', this.onKeyDown);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
document.removeEventListener('mousedown', this.onMouseDown, true);
|
document.removeEventListener('mousedown', this.onMouseDown);
|
||||||
document.removeEventListener('keydown', this.onKeyDown);
|
document.removeEventListener('keydown', this.onKeyDown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,8 +24,13 @@ class DirTool extends React.Component {
|
|||||||
this.tagsIconID = `tags-icon-${uuidv4()}`;
|
this.tagsIconID = `tags-icon-${uuidv4()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
onShowListRepoTag = (e) => {
|
onMouseDown = (e) => {
|
||||||
this.setState({ isListRepoTagShow: true });
|
e.stopPropagation();
|
||||||
|
};
|
||||||
|
|
||||||
|
toggleRepoTag = (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
this.setState({ isListRepoTagShow: !this.state.isListRepoTagShow });
|
||||||
};
|
};
|
||||||
|
|
||||||
hidePopover = (e) => {
|
hidePopover = (e) => {
|
||||||
@@ -61,7 +66,16 @@ class DirTool extends React.Component {
|
|||||||
toolbarDom = (
|
toolbarDom = (
|
||||||
<ul className="path-toolbar">
|
<ul className="path-toolbar">
|
||||||
<li className="toolbar-item">
|
<li className="toolbar-item">
|
||||||
<a className="op-link sf2-icon-tag" href="#" id={this.tagsIconID} role="button" onClick={this.onShowListRepoTag} title={gettext('Tags')} aria-label={gettext('Tags')}></a>
|
<a
|
||||||
|
className="op-link sf2-icon-tag"
|
||||||
|
href="#"
|
||||||
|
id={this.tagsIconID}
|
||||||
|
role="button"
|
||||||
|
onClick={this.toggleRepoTag}
|
||||||
|
onMouseDown={this.onMouseDown}
|
||||||
|
title={gettext('Tags')}
|
||||||
|
aria-label={gettext('Tags')}
|
||||||
|
></a>
|
||||||
</li>
|
</li>
|
||||||
<li className="toolbar-item">
|
<li className="toolbar-item">
|
||||||
<a className="op-link sf2-icon-recycle" href={trashUrl} title={gettext('Trash')} aria-label={gettext('Trash')}></a>
|
<a className="op-link sf2-icon-recycle" href={trashUrl} title={gettext('Trash')} aria-label={gettext('Trash')}></a>
|
||||||
@@ -74,7 +88,16 @@ class DirTool extends React.Component {
|
|||||||
toolbarDom = (
|
toolbarDom = (
|
||||||
<ul className="path-toolbar">
|
<ul className="path-toolbar">
|
||||||
<li className="toolbar-item">
|
<li className="toolbar-item">
|
||||||
<a className="op-link sf2-icon-tag" href="#" id={this.tagsIconID} role="button" onClick={this.onShowListRepoTag} title={gettext('Tags')} aria-label={gettext('Tags')}></a>
|
<a
|
||||||
|
className="op-link sf2-icon-tag"
|
||||||
|
href="#"
|
||||||
|
id={this.tagsIconID}
|
||||||
|
role="button"
|
||||||
|
onClick={this.toggleRepoTag}
|
||||||
|
onMouseDown={this.onMouseDown}
|
||||||
|
title={gettext('Tags')}
|
||||||
|
aria-label={gettext('Tags')}
|
||||||
|
></a>
|
||||||
</li>
|
</li>
|
||||||
<li className="toolbar-item">
|
<li className="toolbar-item">
|
||||||
<a className="op-link sf2-icon-recycle" href={trashUrl} title={gettext('Trash')} aria-label={gettext('Trash')}></a>
|
<a className="op-link sf2-icon-recycle" href={trashUrl} title={gettext('Trash')} aria-label={gettext('Trash')}></a>
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Button, Modal, Input, ModalHeader, ModalBody, ModalFooter, Label, Form, InputGroup, InputGroupAddon, FormGroup } from 'reactstrap';
|
import { Button, Modal, Input, ModalHeader, ModalBody, ModalFooter, Label, Form, FormGroup } from 'reactstrap';
|
||||||
import { gettext } from '../../utils/constants';
|
import { gettext } from '../../utils/constants';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
@@ -26,7 +26,7 @@ class OrgAdminInviteUserDialog extends React.Component {
|
|||||||
this.setState({isAddingUser: true});
|
this.setState({isAddingUser: true});
|
||||||
this.props.handleSubmit(email.trim());
|
this.props.handleSubmit(email.trim());
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyPress = (e) => {
|
handleKeyPress = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -38,11 +38,11 @@ class OrgAdminInviteUserDialog extends React.Component {
|
|||||||
inputEmail = (e) => {
|
inputEmail = (e) => {
|
||||||
let email = e.target.value.trim();
|
let email = e.target.value.trim();
|
||||||
this.setState({email: email});
|
this.setState({email: email});
|
||||||
}
|
};
|
||||||
|
|
||||||
toggle = () => {
|
toggle = () => {
|
||||||
this.props.toggle();
|
this.props.toggle();
|
||||||
}
|
};
|
||||||
|
|
||||||
validateInputParams() {
|
validateInputParams() {
|
||||||
let errMessage;
|
let errMessage;
|
||||||
|
@@ -20,10 +20,10 @@ class OrgAdminInviteUserViaWeiXinDialog extends React.Component {
|
|||||||
copy(this.props.invitationLink);
|
copy(this.props.invitationLink);
|
||||||
this.props.toggle();
|
this.props.toggle();
|
||||||
const message = gettext('Internal link has been copied to clipboard');
|
const message = gettext('Internal link has been copied to clipboard');
|
||||||
toaster.success(message), {
|
toaster.success(message, {
|
||||||
duration: 2
|
duration: 2
|
||||||
};
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import React, { Fragment } from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Modal, ModalHeader, ModalBody } from 'reactstrap';
|
import { Modal, ModalHeader, ModalBody } from 'reactstrap';
|
||||||
import SeatableAccountSettingList from '../seatable-integration-account-setting-widgets/seatable-account-setting-list.js';
|
import SeatableAccountSettingList from '../seatable-integration-account-setting-widgets/seatable-account-setting-list.js';
|
||||||
|
@@ -286,7 +286,7 @@ export default class AISearch extends Component {
|
|||||||
this.updateSearchPageURL(queryData);
|
this.updateSearchPageURL(queryData);
|
||||||
queryData['per_page'] = PER_PAGE;
|
queryData['per_page'] = PER_PAGE;
|
||||||
queryData['page'] = page;
|
queryData['page'] = page;
|
||||||
this.onAiSearch(queryData, cancelToken, page);
|
this.onAiSearch(queryData, cancelToken, page);
|
||||||
};
|
};
|
||||||
|
|
||||||
onAiSearch = (queryData, cancelToken, page) => {
|
onAiSearch = (queryData, cancelToken, page) => {
|
||||||
@@ -294,12 +294,12 @@ export default class AISearch extends Component {
|
|||||||
seafileAPI.aiSearchFiles(queryData, cancelToken).then(res => {
|
seafileAPI.aiSearchFiles(queryData, cancelToken).then(res => {
|
||||||
results = [...results, ...this.formatResultItems(res.data.results)];
|
results = [...results, ...this.formatResultItems(res.data.results)];
|
||||||
this.setState({
|
this.setState({
|
||||||
resultItems: results,
|
resultItems: results,
|
||||||
isResultGetted: true,
|
isResultGetted: true,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
page: page + 1,
|
page: page + 1,
|
||||||
hasMore: false,
|
hasMore: false,
|
||||||
});
|
});
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
@@ -66,7 +66,6 @@ class AddSeatableAccountSetting extends Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
addSeatableAccountSetting = () => {
|
addSeatableAccountSetting = () => {
|
||||||
const { t } = this.props;
|
|
||||||
let { base_name, seatable_url, seatable_api_token } = this.state;
|
let { base_name, seatable_url, seatable_api_token } = this.state;
|
||||||
base_name = base_name.trim();
|
base_name = base_name.trim();
|
||||||
seatable_url = seatable_url.trim();
|
seatable_url = seatable_url.trim();
|
||||||
|
@@ -16,7 +16,7 @@ import '../../css/markdown-viewer/markdown-editor.css';
|
|||||||
const CryptoJS = require('crypto-js');
|
const CryptoJS = require('crypto-js');
|
||||||
const URL = require('url-parse');
|
const URL = require('url-parse');
|
||||||
|
|
||||||
const { repoID, filePath, fileName, draftID, isDraft, hasDraft, isLocked, lockedByMe } = window.app.pageOptions;
|
const { repoID, filePath, fileName, isDraft, hasDraft, isLocked, lockedByMe } = window.app.pageOptions;
|
||||||
const { siteRoot, serviceUrl, seafileCollabServer } = window.app.config;
|
const { siteRoot, serviceUrl, seafileCollabServer } = window.app.config;
|
||||||
const userInfo = window.app.userInfo;
|
const userInfo = window.app.userInfo;
|
||||||
const IMAGE_SUFFIXES = ['png', 'PNG', 'jpg', 'JPG', 'jpeg', 'JPEG', 'gif', 'GIF'];
|
const IMAGE_SUFFIXES = ['png', 'PNG', 'jpg', 'JPG', 'jpeg', 'JPEG', 'gif', 'GIF'];
|
||||||
|
@@ -134,7 +134,7 @@ class OrgUsers extends Component {
|
|||||||
|
|
||||||
toggleInviteUserViaWeiXinDialog = () => {
|
toggleInviteUserViaWeiXinDialog = () => {
|
||||||
this.setState({isInviteUserViaWeiXinDialogOpen: !this.state.isInviteUserViaWeiXinDialogOpen});
|
this.setState({isInviteUserViaWeiXinDialogOpen: !this.state.isInviteUserViaWeiXinDialogOpen});
|
||||||
}
|
};
|
||||||
|
|
||||||
initOrgUsersData = (page) => {
|
initOrgUsersData = (page) => {
|
||||||
const { sortBy, sortOrder } = this.state;
|
const { sortBy, sortOrder } = this.state;
|
||||||
@@ -218,13 +218,13 @@ class OrgUsers extends Component {
|
|||||||
orgUsers: users.concat(this.state.orgUsers)
|
orgUsers: users.concat(this.state.orgUsers)
|
||||||
});
|
});
|
||||||
|
|
||||||
res.data.success.map(item => {
|
res.data.success.forEach(item => {
|
||||||
let msg = gettext('successfully sent email to %s.');
|
let msg = gettext('successfully sent email to %s.');
|
||||||
msg = msg.replace('%s', item.email);
|
msg = msg.replace('%s', item.email);
|
||||||
toaster.success(msg);
|
toaster.success(msg);
|
||||||
});
|
});
|
||||||
|
|
||||||
res.data.failed.map(item => {
|
res.data.failed.forEach(item => {
|
||||||
const msg = `${item.email}: ${item.error_msg}`;
|
const msg = `${item.email}: ${item.error_msg}`;
|
||||||
toaster.danger(msg);
|
toaster.danger(msg);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user