mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 10:58:33 +00:00
Merge branch '8.0' into master
This commit is contained in:
@@ -61,13 +61,21 @@ class ZipDownloadDialog extends React.Component {
|
||||
const zipToken = this.state.zipToken;
|
||||
seafileAPI.queryZipProgress(zipToken).then((res) => {
|
||||
const data = res.data;
|
||||
this.setState({
|
||||
zipProgress: data.total == 0 ? '100%' : (data.zipped/data.total*100).toFixed(2) + '%'
|
||||
});
|
||||
if (data['total'] == data['zipped']) {
|
||||
if (data.failed == 1) {
|
||||
clearInterval(interval);
|
||||
this.props.toggleDialog();
|
||||
location.href = `${fileServerRoot}zip/${zipToken}`;
|
||||
this.setState({
|
||||
isLoading: false,
|
||||
errorMsg: data.failed_reason
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
zipProgress: data.total == 0 ? '100%' : (data.zipped/data.total*100).toFixed(2) + '%'
|
||||
});
|
||||
if (data['total'] == data['zipped']) {
|
||||
clearInterval(interval);
|
||||
this.props.toggleDialog();
|
||||
location.href = `${fileServerRoot}zip/${zipToken}`;
|
||||
}
|
||||
}
|
||||
}).catch((error) => {
|
||||
clearInterval(interval);
|
||||
|
@@ -107,7 +107,7 @@ class FileToolbar extends React.Component {
|
||||
|
||||
{(canEditFile && !err) &&
|
||||
( this.props.isSaving ?
|
||||
<button type={'button'} className={'btn btn-icon btn-secondary btn-active'}>
|
||||
<button type={'button'} aria-label={gettext('Saving...')} className={'btn btn-icon btn-secondary btn-active'}>
|
||||
<i className={'fa fa-spin fa-spinner'}/></button> :
|
||||
(
|
||||
this.props.needSave ?
|
||||
@@ -149,7 +149,7 @@ class FileToolbar extends React.Component {
|
||||
/>
|
||||
)}
|
||||
<ButtonDropdown isOpen={moreDropdownOpen} toggle={this.toggleMoreOpMenu}>
|
||||
<DropdownToggle>
|
||||
<DropdownToggle aria-label={gettext('More Operations')}>
|
||||
<span className="fas fa-ellipsis-v"></span>
|
||||
</DropdownToggle>
|
||||
<DropdownMenu right={true}>
|
||||
@@ -172,8 +172,8 @@ class FileToolbar extends React.Component {
|
||||
<Dropdown isOpen={this.state.dropdownOpen} toggle={this.toggle} className="d-block d-md-none">
|
||||
<ButtonGroup >
|
||||
{(canEditFile && !err) &&
|
||||
( this.props.isSaving ?
|
||||
<button type={'button'} className={'btn btn-icon btn-secondary btn-active'}>
|
||||
(this.props.isSaving ?
|
||||
<button type={'button'} aria-label={gettext('Saving...')} className={'btn btn-icon btn-secondary btn-active'}>
|
||||
<i className={'fa fa-spin fa-spinner'}/></button> :
|
||||
(
|
||||
this.props.needSave ?
|
||||
@@ -192,7 +192,7 @@ class FileToolbar extends React.Component {
|
||||
)}
|
||||
</ButtonGroup>
|
||||
|
||||
<DropdownToggle className="sf2-icon-more mx-1">
|
||||
<DropdownToggle className="sf2-icon-more mx-1" aria-label={gettext('More Operations')}>
|
||||
</DropdownToggle>
|
||||
<DropdownMenu right={true}>
|
||||
<DropdownItem>
|
||||
|
@@ -47,6 +47,7 @@ class IconButton extends React.Component {
|
||||
className={className}
|
||||
tag="a"
|
||||
href={this.props.href}
|
||||
aria-label={this.props.text}
|
||||
>
|
||||
{btnContent}
|
||||
</Button>
|
||||
@@ -57,6 +58,7 @@ class IconButton extends React.Component {
|
||||
id={this.props.id}
|
||||
className={className}
|
||||
onClick={this.props.onClick}
|
||||
aria-label={this.props.text}
|
||||
>
|
||||
{btnContent}
|
||||
</Button>
|
||||
|
@@ -95,6 +95,7 @@ class SelectEditor extends React.Component {
|
||||
className="permission-editor-select"
|
||||
classNamePrefix="permission-editor"
|
||||
placeholder={this.props.translateOption(currentOption)}
|
||||
value={currentOption}
|
||||
onChange={this.onOptionChanged}
|
||||
captureMenuScroll={false}
|
||||
/>
|
||||
|
@@ -0,0 +1,41 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { gettext } from '../../utils/constants';
|
||||
import SelectEditor from './select-editor';
|
||||
|
||||
const propTypes = {
|
||||
isTextMode: PropTypes.bool.isRequired,
|
||||
isEditIconShow: PropTypes.bool.isRequired,
|
||||
statusOptions: PropTypes.array.isRequired,
|
||||
currentStatus: PropTypes.string.isRequired,
|
||||
onStatusChanged: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
class SysAdminUserMembershipEditor extends React.Component {
|
||||
|
||||
translateStatus = (status) => {
|
||||
switch (status) {
|
||||
case 'is_org_staff':
|
||||
return gettext('Admin');
|
||||
case 'not_is_org_staff':
|
||||
return gettext('Member');
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<SelectEditor
|
||||
isTextMode={this.props.isTextMode}
|
||||
isEditIconShow={this.props.isEditIconShow}
|
||||
options={this.props.statusOptions}
|
||||
currentOption={this.props.currentStatus}
|
||||
onOptionChanged={this.props.onStatusChanged}
|
||||
translateOption={this.translateStatus}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
SysAdminUserMembershipEditor.propTypes = propTypes;
|
||||
|
||||
export default SysAdminUserMembershipEditor;
|
@@ -72,7 +72,7 @@ class MoreMenu extends React.PureComponent {
|
||||
const isSmall = this.props.isSmallScreen;
|
||||
return (
|
||||
<Dropdown isOpen={this.state.dropdownOpen} toggle={this.dropdownToggle} direction="down" className="mx-1">
|
||||
<DropdownToggle id="moreButton">
|
||||
<DropdownToggle id="moreButton" aria-label={gettext('More Operations')}>
|
||||
<i className="fa fa-ellipsis-v"/>
|
||||
<Tooltip toggle={this.tooltipToggle} delay={{show: 0, hide: 0}} target="moreButton" placement='bottom' isOpen={this.state.tooltipOpen}>{gettext('More')}
|
||||
</Tooltip>
|
||||
@@ -179,11 +179,11 @@ class MarkdownViewerToolbar extends React.Component {
|
||||
<IconButton id={'shareBtn'} text={gettext('Share')} icon={'fa fa-share-alt'}
|
||||
onMouseDown={this.props.toggleShareLinkDialog}/>
|
||||
}
|
||||
{ saving ?
|
||||
<button type={'button'} className={'btn btn-icon btn-secondary btn-active'}>
|
||||
{saving ?
|
||||
<button type={'button'} aria-label={gettext('Saving...')} className={'btn btn-icon btn-secondary btn-active'}>
|
||||
<i className={'fa fa-spin fa-spinner'}/></button>
|
||||
:
|
||||
<IconButton text={gettext('Save')} id={'saveButton'} icon={'fa fa-save'} disabled={!contentChanged}
|
||||
<IconButton text={gettext('Save')} id={'saveButton'} icon={'fa fa-save'} disabled={!contentChanged}
|
||||
onMouseDown={window.seafileEditor && window.seafileEditor.onRichEditorSave} isActive={contentChanged}/>
|
||||
}
|
||||
{canDownloadFile && (
|
||||
@@ -224,7 +224,7 @@ class MarkdownViewerToolbar extends React.Component {
|
||||
<div className="topbar-btn-container">
|
||||
<ButtonGroup>
|
||||
{saving ?
|
||||
<button type={'button'} className={'btn btn-icon btn-secondary btn-active'}>
|
||||
<button type={'button'} aria-label={gettext('Saving...')} className={'btn btn-icon btn-secondary btn-active'}>
|
||||
<i className={'fa fa-spin fa-spinner'}/></button>
|
||||
:
|
||||
<IconButton text={gettext('Save')} id={'saveButton'} icon={'fa fa-save'} disabled={!contentChanged}
|
||||
|
Reference in New Issue
Block a user