mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-23 12:27:48 +00:00
Add loading icon when dialog is init (#7878)
* 01 system admin share base to user * 02 system admin share base to group * 03 share sub folder set user permission * 04 share sub folder set group permission * 05 share repo to user * 06 share repo to group add loading * 07 share to invite users * 08 share to other server * 09 link emails * 10 link emails * 11 fix code format
This commit is contained in:
@@ -10,6 +10,8 @@ import FileChooser from '../file-chooser';
|
|||||||
import GroupSelect from '../common/group-select';
|
import GroupSelect from '../common/group-select';
|
||||||
import toaster from '../../components/toast';
|
import toaster from '../../components/toast';
|
||||||
import BackIcon from '../../components/back-icon';
|
import BackIcon from '../../components/back-icon';
|
||||||
|
import EmptyTip from '../../components/empty-tip';
|
||||||
|
import Loading from '../../components/loading';
|
||||||
|
|
||||||
class GroupItem extends React.Component {
|
class GroupItem extends React.Component {
|
||||||
|
|
||||||
@@ -118,7 +120,8 @@ class LibSubFolderSetGroupPermissionDialog extends React.Component {
|
|||||||
permission: 'rw',
|
permission: 'rw',
|
||||||
groupPermissionItems: [],
|
groupPermissionItems: [],
|
||||||
folderPath: '',
|
folderPath: '',
|
||||||
showFileChooser: false
|
showFileChooser: false,
|
||||||
|
isLoading: true
|
||||||
};
|
};
|
||||||
this.options = [];
|
this.options = [];
|
||||||
if (!isPro) {
|
if (!isPro) {
|
||||||
@@ -157,10 +160,14 @@ class LibSubFolderSetGroupPermissionDialog extends React.Component {
|
|||||||
request.then((res) => {
|
request.then((res) => {
|
||||||
if (res.data.length !== 0) {
|
if (res.data.length !== 0) {
|
||||||
this.setState({
|
this.setState({
|
||||||
groupPermissionItems: res.data
|
groupPermissionItems: res.data,
|
||||||
|
isLoading: false
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
let errMessage = Utils.getErrorMsg(error);
|
let errMessage = Utils.getErrorMsg(error);
|
||||||
toaster.danger(errMessage);
|
toaster.danger(errMessage);
|
||||||
});
|
});
|
||||||
@@ -378,6 +385,13 @@ class LibSubFolderSetGroupPermissionDialog extends React.Component {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div className="share-list-container">
|
<div className="share-list-container">
|
||||||
|
{this.state.isLoading ? (
|
||||||
|
<Loading />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{this.state.groupPermissionItems.length === 0 ? (
|
||||||
|
<EmptyTip text={gettext('No results')} />
|
||||||
|
) : (
|
||||||
<table className="table-thead-hidden w-xs-250">
|
<table className="table-thead-hidden w-xs-250">
|
||||||
{thead}
|
{thead}
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -396,6 +410,9 @@ class LibSubFolderSetGroupPermissionDialog extends React.Component {
|
|||||||
})}
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
@@ -10,6 +10,8 @@ import SharePermissionEditor from '../select-editor/share-permission-editor';
|
|||||||
import FileChooser from '../file-chooser';
|
import FileChooser from '../file-chooser';
|
||||||
import toaster from '../../components/toast';
|
import toaster from '../../components/toast';
|
||||||
import BackIcon from '../../components/back-icon';
|
import BackIcon from '../../components/back-icon';
|
||||||
|
import EmptyTip from '../../components/empty-tip';
|
||||||
|
import Loading from '../../components/loading';
|
||||||
|
|
||||||
class UserItem extends React.Component {
|
class UserItem extends React.Component {
|
||||||
|
|
||||||
@@ -121,7 +123,8 @@ class LibSubFolderSetUserPermissionDialog extends React.Component {
|
|||||||
permission: 'rw',
|
permission: 'rw',
|
||||||
userFolderPermItems: [],
|
userFolderPermItems: [],
|
||||||
folderPath: '',
|
folderPath: '',
|
||||||
showFileChooser: false
|
showFileChooser: false,
|
||||||
|
isLoading: true
|
||||||
};
|
};
|
||||||
if (!isPro) {
|
if (!isPro) {
|
||||||
this.permissions = ['r', 'rw'];
|
this.permissions = ['r', 'rw'];
|
||||||
@@ -141,9 +144,15 @@ class LibSubFolderSetUserPermissionDialog extends React.Component {
|
|||||||
seafileAPI.listUserFolderPerm(repoID, folderPath);
|
seafileAPI.listUserFolderPerm(repoID, folderPath);
|
||||||
request.then((res) => {
|
request.then((res) => {
|
||||||
if (res.data.length !== 0) {
|
if (res.data.length !== 0) {
|
||||||
this.setState({ userFolderPermItems: res.data });
|
this.setState({
|
||||||
|
userFolderPermItems: res.data,
|
||||||
|
isLoading: false
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
let errMessage = Utils.getErrorMsg(error);
|
let errMessage = Utils.getErrorMsg(error);
|
||||||
toaster.danger(errMessage);
|
toaster.danger(errMessage);
|
||||||
});
|
});
|
||||||
@@ -341,6 +350,13 @@ class LibSubFolderSetUserPermissionDialog extends React.Component {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div className="share-list-container">
|
<div className="share-list-container">
|
||||||
|
{this.state.isLoading ? (
|
||||||
|
<Loading />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{userFolderPermItems.length === 0 ? (
|
||||||
|
<EmptyTip text={gettext('No results')} />
|
||||||
|
) : (
|
||||||
<table className="table-thead-hidden w-xs-250">
|
<table className="table-thead-hidden w-xs-250">
|
||||||
{thead}
|
{thead}
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -359,6 +375,9 @@ class LibSubFolderSetUserPermissionDialog extends React.Component {
|
|||||||
})}
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
@@ -10,6 +10,8 @@ import SharePermissionEditor from '../select-editor/share-permission-editor';
|
|||||||
import EventBus from '../common/event-bus';
|
import EventBus from '../common/event-bus';
|
||||||
import { EVENT_BUS_TYPE } from '../common/event-bus-type';
|
import { EVENT_BUS_TYPE } from '../common/event-bus-type';
|
||||||
import GroupSelect from '../common/group-select';
|
import GroupSelect from '../common/group-select';
|
||||||
|
import EmptyTip from '../../components/empty-tip';
|
||||||
|
import Loading from '../../components/loading';
|
||||||
|
|
||||||
class GroupItem extends React.Component {
|
class GroupItem extends React.Component {
|
||||||
|
|
||||||
@@ -178,7 +180,8 @@ class ShareToGroup extends React.Component {
|
|||||||
errorMsg: [],
|
errorMsg: [],
|
||||||
permission: 'rw',
|
permission: 'rw',
|
||||||
sharedItems: [],
|
sharedItems: [],
|
||||||
isWiki: this.props.repoType === 'wiki'
|
isWiki: this.props.repoType === 'wiki',
|
||||||
|
isLoading: true
|
||||||
};
|
};
|
||||||
this.permissions = [];
|
this.permissions = [];
|
||||||
let { itemType, isRepoOwner } = props;
|
let { itemType, isRepoOwner } = props;
|
||||||
@@ -253,10 +256,14 @@ class ShareToGroup extends React.Component {
|
|||||||
seafileAPI.listSharedItems(repoID, path, 'group').then((res) => {
|
seafileAPI.listSharedItems(repoID, path, 'group').then((res) => {
|
||||||
if (res.data.length !== 0) {
|
if (res.data.length !== 0) {
|
||||||
this.setState({
|
this.setState({
|
||||||
sharedItems: res.data
|
sharedItems: res.data,
|
||||||
|
isLoading: false
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
let errMessage = Utils.getErrorMsg(error);
|
let errMessage = Utils.getErrorMsg(error);
|
||||||
toaster.danger(errMessage);
|
toaster.danger(errMessage);
|
||||||
});
|
});
|
||||||
@@ -466,6 +473,13 @@ class ShareToGroup extends React.Component {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div className="share-list-container">
|
<div className="share-list-container">
|
||||||
|
{this.state.isLoading ? (
|
||||||
|
<Loading />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{this.state.sharedItems.length === 0 ? (
|
||||||
|
<EmptyTip text={gettext('No share link')} />
|
||||||
|
) : (
|
||||||
<table className="table-thead-hidden">
|
<table className="table-thead-hidden">
|
||||||
{thead}
|
{thead}
|
||||||
<GroupList
|
<GroupList
|
||||||
@@ -476,6 +490,9 @@ class ShareToGroup extends React.Component {
|
|||||||
onChangeUserPermission={this.onChangeUserPermission}
|
onChangeUserPermission={this.onChangeUserPermission}
|
||||||
/>
|
/>
|
||||||
</table>
|
</table>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
@@ -9,6 +9,7 @@ import { Utils } from '../../utils/utils';
|
|||||||
import toaster from '../toast';
|
import toaster from '../toast';
|
||||||
import Loading from '../loading';
|
import Loading from '../loading';
|
||||||
import SharePermissionEditor from '../select-editor/share-permission-editor';
|
import SharePermissionEditor from '../select-editor/share-permission-editor';
|
||||||
|
import EmptyTip from '../empty-tip';
|
||||||
import '../../css/invitations.css';
|
import '../../css/invitations.css';
|
||||||
|
|
||||||
class UserItem extends React.Component {
|
class UserItem extends React.Component {
|
||||||
@@ -140,6 +141,7 @@ class ShareToInvitePeople extends React.Component {
|
|||||||
sharedItems: [],
|
sharedItems: [],
|
||||||
emails: '',
|
emails: '',
|
||||||
isSubmitting: false,
|
isSubmitting: false,
|
||||||
|
isLoading: true
|
||||||
};
|
};
|
||||||
this.permissions = ['rw', 'r'];
|
this.permissions = ['rw', 'r'];
|
||||||
}
|
}
|
||||||
@@ -168,9 +170,15 @@ class ShareToInvitePeople extends React.Component {
|
|||||||
const repoID = this.props.repoID;
|
const repoID = this.props.repoID;
|
||||||
seafileAPI.listRepoShareInvitations(repoID, path).then((res) => {
|
seafileAPI.listRepoShareInvitations(repoID, path).then((res) => {
|
||||||
if (res.data.length !== 0) {
|
if (res.data.length !== 0) {
|
||||||
this.setState({ sharedItems: res.data.repo_share_invitation_list });
|
this.setState({
|
||||||
|
sharedItems: res.data.repo_share_invitation_list,
|
||||||
|
isLoading: false
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
const errMessage = Utils.getErrorMsg(error);
|
const errMessage = Utils.getErrorMsg(error);
|
||||||
toaster.danger(errMessage);
|
toaster.danger(errMessage);
|
||||||
});
|
});
|
||||||
@@ -327,6 +335,13 @@ class ShareToInvitePeople extends React.Component {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div className="share-list-container">
|
<div className="share-list-container">
|
||||||
|
{this.state.isLoading ? (
|
||||||
|
<Loading />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{sharedItems.length === 0 ? (
|
||||||
|
<EmptyTip text={gettext('No results')} />
|
||||||
|
) : (
|
||||||
<table className="w-xs-200">
|
<table className="w-xs-200">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -344,6 +359,9 @@ class ShareToInvitePeople extends React.Component {
|
|||||||
onChangeUserPermission={this.onChangeUserPermission}
|
onChangeUserPermission={this.onChangeUserPermission}
|
||||||
/>
|
/>
|
||||||
</table>
|
</table>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
@@ -9,6 +9,8 @@ import toaster from '../toast';
|
|||||||
import OpIcon from '../op-icon';
|
import OpIcon from '../op-icon';
|
||||||
import SharePermissionEditor from '../select-editor/share-permission-editor';
|
import SharePermissionEditor from '../select-editor/share-permission-editor';
|
||||||
import { SeahubSelect } from '../common/select';
|
import { SeahubSelect } from '../common/select';
|
||||||
|
import EmptyTip from '../empty-tip';
|
||||||
|
import Loading from '../loading';
|
||||||
|
|
||||||
class ShareItem extends React.Component {
|
class ShareItem extends React.Component {
|
||||||
|
|
||||||
@@ -60,15 +62,6 @@ class ShareItem extends React.Component {
|
|||||||
<td><a href={item.to_server_url} target="_blank" rel="noreferrer">{item.to_server_name}</a></td>
|
<td><a href={item.to_server_url} target="_blank" rel="noreferrer">{item.to_server_name}</a></td>
|
||||||
<td>{item.to_user}</td>
|
<td>{item.to_user}</td>
|
||||||
<td>{Utils.sharePerms(item.permission)}</td>
|
<td>{Utils.sharePerms(item.permission)}</td>
|
||||||
{/* <td>
|
|
||||||
<SharePermissionEditor
|
|
||||||
isTextMode={true}
|
|
||||||
isEditIconShow={this.state.isOperationShow}
|
|
||||||
currentPermission={currentPermission}
|
|
||||||
permissions={this.props.permissions}
|
|
||||||
onPermissionChanged={this.onChangeUserPermission}
|
|
||||||
/>
|
|
||||||
</td> */}
|
|
||||||
<td>
|
<td>
|
||||||
<OpIcon
|
<OpIcon
|
||||||
className={`sf3-font sf3-font-x-01 op-icon ${isOperationShow && !isOpFrozen ? '' : 'd-none'}`}
|
className={`sf3-font sf3-font-x-01 op-icon ${isOperationShow && !isOpFrozen ? '' : 'd-none'}`}
|
||||||
@@ -140,18 +133,23 @@ class ShareToOtherServer extends React.Component {
|
|||||||
permission: 'rw',
|
permission: 'rw',
|
||||||
btnDisabled: true,
|
btnDisabled: true,
|
||||||
isSubmitting: false,
|
isSubmitting: false,
|
||||||
ocmShares: []
|
ocmShares: [],
|
||||||
|
isLoading: true
|
||||||
};
|
};
|
||||||
this.permissions = ['rw', 'r'];
|
this.permissions = ['rw', 'r'];
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
seafileAPI.listOCMSharesPrepare(this.props.repoID).then((res) => {
|
seafileAPI.listOCMSharesPrepare(this.props.repoID).then((res) => {
|
||||||
this.setState({ ocmShares: res.data.ocm_share_list });
|
this.setState({
|
||||||
|
ocmShares: res.data.ocm_share_list,
|
||||||
|
isLoading: false
|
||||||
|
});
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
let errMessage = Utils.getErrorMsg(error);
|
let errMessage = Utils.getErrorMsg(error);
|
||||||
this.setState({
|
this.setState({
|
||||||
errorMsg: errMessage
|
errorMsg: errMessage,
|
||||||
|
isLoading: false
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -275,13 +273,22 @@ class ShareToOtherServer extends React.Component {
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{errorMsg ?
|
{errorMsg ? (
|
||||||
<p className="error text-center mt-4">{errorMsg}</p> :
|
<p className="error text-center mt-4">{errorMsg}</p>
|
||||||
|
) : this.state.isLoading ? (
|
||||||
|
<Loading />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{ocmShares.length === 0 ? (
|
||||||
|
<EmptyTip text={gettext('No results')} />
|
||||||
|
) : (
|
||||||
<ShareList
|
<ShareList
|
||||||
items={ocmShares}
|
items={ocmShares}
|
||||||
deleteShareItem={this.deleteShareItem}
|
deleteShareItem={this.deleteShareItem}
|
||||||
/>
|
/>
|
||||||
}
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,8 @@ import toaster from '../toast';
|
|||||||
import UserSelect from '../user-select';
|
import UserSelect from '../user-select';
|
||||||
import SharePermissionEditor from '../select-editor/share-permission-editor';
|
import SharePermissionEditor from '../select-editor/share-permission-editor';
|
||||||
import DepartmentDetailDialog from './department-detail-dialog';
|
import DepartmentDetailDialog from './department-detail-dialog';
|
||||||
|
import EmptyTip from '../../components/empty-tip';
|
||||||
|
import Loading from '../../components/loading';
|
||||||
|
|
||||||
import '../../css/invitations.css';
|
import '../../css/invitations.css';
|
||||||
import '../../css/share-to-user.css';
|
import '../../css/share-to-user.css';
|
||||||
@@ -246,7 +248,8 @@ class ShareToUser extends React.Component {
|
|||||||
isWiki: this.props.repoType === 'wiki',
|
isWiki: this.props.repoType === 'wiki',
|
||||||
tmpUserList: [],
|
tmpUserList: [],
|
||||||
enableSelectMembersFromDept: false,
|
enableSelectMembersFromDept: false,
|
||||||
isShowDepartmentDetailDialog: false
|
isShowDepartmentDetailDialog: false,
|
||||||
|
isLoading: true
|
||||||
};
|
};
|
||||||
this.options = [];
|
this.options = [];
|
||||||
this.permissions = [];
|
this.permissions = [];
|
||||||
@@ -287,9 +290,16 @@ class ShareToUser extends React.Component {
|
|||||||
'permission': item.permission
|
'permission': item.permission
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
this.setState({ sharedItems: res.data, tmpUserList: tmpUserList });
|
this.setState({
|
||||||
|
sharedItems: res.data,
|
||||||
|
tmpUserList: tmpUserList,
|
||||||
|
isLoading: false
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
let errMessage = Utils.getErrorMsg(error);
|
let errMessage = Utils.getErrorMsg(error);
|
||||||
toaster.danger(errMessage);
|
toaster.danger(errMessage);
|
||||||
});
|
});
|
||||||
@@ -606,6 +616,13 @@ class ShareToUser extends React.Component {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div className="share-list-container">
|
<div className="share-list-container">
|
||||||
|
{this.state.isLoading ? (
|
||||||
|
<Loading />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{sharedItems.length === 0 ? (
|
||||||
|
<EmptyTip text={gettext('No share link')} />
|
||||||
|
) : (
|
||||||
<table className="table-thead-hidden">
|
<table className="table-thead-hidden">
|
||||||
{thead}
|
{thead}
|
||||||
<UserList
|
<UserList
|
||||||
@@ -616,6 +633,9 @@ class ShareToUser extends React.Component {
|
|||||||
onChangeUserPermission={this.onChangeUserPermission}
|
onChangeUserPermission={this.onChangeUserPermission}
|
||||||
/>
|
/>
|
||||||
</table>
|
</table>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
{this.state.isShowDepartmentDetailDialog &&
|
{this.state.isShowDepartmentDetailDialog &&
|
||||||
<DepartmentDetailDialog
|
<DepartmentDetailDialog
|
||||||
toggleDepartmentDetailDialog={this.toggleDepartmentDetailDialog}
|
toggleDepartmentDetailDialog={this.toggleDepartmentDetailDialog}
|
||||||
|
@@ -6,8 +6,10 @@ import { seafileAPI } from '../../../utils/seafile-api';
|
|||||||
import { systemAdminAPI } from '../../../utils/system-admin-api';
|
import { systemAdminAPI } from '../../../utils/system-admin-api';
|
||||||
import { Utils } from '../../../utils/utils';
|
import { Utils } from '../../../utils/utils';
|
||||||
import toaster from '../../toast';
|
import toaster from '../../toast';
|
||||||
|
import EmptyTip from '../../../components/empty-tip';
|
||||||
import SharePermissionEditor from '../../select-editor/share-permission-editor';
|
import SharePermissionEditor from '../../select-editor/share-permission-editor';
|
||||||
import GroupSelect from '../../common/group-select';
|
import GroupSelect from '../../common/group-select';
|
||||||
|
import Loading from '../../../components/loading';
|
||||||
|
|
||||||
class GroupItem extends React.Component {
|
class GroupItem extends React.Component {
|
||||||
|
|
||||||
@@ -119,7 +121,8 @@ class SysAdminShareToGroup extends React.Component {
|
|||||||
selectedOptions: [],
|
selectedOptions: [],
|
||||||
errorMsg: [],
|
errorMsg: [],
|
||||||
permission: 'rw',
|
permission: 'rw',
|
||||||
sharedItems: []
|
sharedItems: [],
|
||||||
|
isLoading: true
|
||||||
};
|
};
|
||||||
this.options = [];
|
this.options = [];
|
||||||
this.permissions = ['rw', 'r'];
|
this.permissions = ['rw', 'r'];
|
||||||
@@ -175,10 +178,14 @@ class SysAdminShareToGroup extends React.Component {
|
|||||||
systemAdminAPI.sysAdminListRepoSharedItems(repoID, 'group').then((res) => {
|
systemAdminAPI.sysAdminListRepoSharedItems(repoID, 'group').then((res) => {
|
||||||
if (res.data.length !== 0) {
|
if (res.data.length !== 0) {
|
||||||
this.setState({
|
this.setState({
|
||||||
sharedItems: res.data
|
sharedItems: res.data,
|
||||||
|
isLoading: false
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
let errMessage = Utils.getErrorMsg(error);
|
let errMessage = Utils.getErrorMsg(error);
|
||||||
toaster.danger(errMessage);
|
toaster.danger(errMessage);
|
||||||
});
|
});
|
||||||
@@ -301,6 +308,13 @@ class SysAdminShareToGroup extends React.Component {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div className="share-list-container">
|
<div className="share-list-container">
|
||||||
|
{this.state.isLoading ? (
|
||||||
|
<Loading />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{this.state.sharedItems.length === 0 ? (
|
||||||
|
<EmptyTip text={gettext('No share link')} className="mt-8 mb-8" />
|
||||||
|
) : (
|
||||||
<table className="table-thead-hidden">
|
<table className="table-thead-hidden">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -316,6 +330,9 @@ class SysAdminShareToGroup extends React.Component {
|
|||||||
onChangeUserPermission={this.onChangeUserPermission}
|
onChangeUserPermission={this.onChangeUserPermission}
|
||||||
/>
|
/>
|
||||||
</table>
|
</table>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
@@ -4,6 +4,8 @@ import { isPro, gettext } from '../../../utils/constants';
|
|||||||
import { Button } from 'reactstrap';
|
import { Button } from 'reactstrap';
|
||||||
import { systemAdminAPI } from '../../../utils/system-admin-api';
|
import { systemAdminAPI } from '../../../utils/system-admin-api';
|
||||||
import { Utils } from '../../../utils/utils';
|
import { Utils } from '../../../utils/utils';
|
||||||
|
import EmptyTip from '../../../components/empty-tip';
|
||||||
|
import Loading from '../../loading';
|
||||||
import toaster from '../../toast';
|
import toaster from '../../toast';
|
||||||
import UserSelect from '../../user-select';
|
import UserSelect from '../../user-select';
|
||||||
import SharePermissionEditor from '../../select-editor/share-permission-editor';
|
import SharePermissionEditor from '../../select-editor/share-permission-editor';
|
||||||
@@ -117,7 +119,8 @@ class SysAdminShareToUser extends React.Component {
|
|||||||
selectedUsers: [],
|
selectedUsers: [],
|
||||||
errorMsg: [],
|
errorMsg: [],
|
||||||
permission: 'rw',
|
permission: 'rw',
|
||||||
sharedItems: []
|
sharedItems: [],
|
||||||
|
isLoading: true
|
||||||
};
|
};
|
||||||
this.options = [];
|
this.options = [];
|
||||||
this.permissions = ['rw', 'r'];
|
this.permissions = ['rw', 'r'];
|
||||||
@@ -135,9 +138,15 @@ class SysAdminShareToUser extends React.Component {
|
|||||||
let repoID = this.props.repoID;
|
let repoID = this.props.repoID;
|
||||||
systemAdminAPI.sysAdminListRepoSharedItems(repoID, 'user').then((res) => {
|
systemAdminAPI.sysAdminListRepoSharedItems(repoID, 'user').then((res) => {
|
||||||
if (res.data.length !== 0) {
|
if (res.data.length !== 0) {
|
||||||
this.setState({ sharedItems: res.data });
|
this.setState({
|
||||||
|
sharedItems: res.data,
|
||||||
|
isLoading: false
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
let errMessage = Utils.getErrorMsg(error);
|
let errMessage = Utils.getErrorMsg(error);
|
||||||
toaster.danger(errMessage);
|
toaster.danger(errMessage);
|
||||||
});
|
});
|
||||||
@@ -273,6 +282,13 @@ class SysAdminShareToUser extends React.Component {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div className="share-list-container">
|
<div className="share-list-container">
|
||||||
|
{this.state.isLoading ? (
|
||||||
|
<Loading />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{this.state.sharedItems.length === 0 ? (
|
||||||
|
<EmptyTip text={gettext('No share link')} className="mt-8 mb-8" />
|
||||||
|
) : (
|
||||||
<table className="table-thead-hidden">
|
<table className="table-thead-hidden">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -288,6 +304,9 @@ class SysAdminShareToUser extends React.Component {
|
|||||||
onChangeUserPermission={this.onChangeUserPermission}
|
onChangeUserPermission={this.onChangeUserPermission}
|
||||||
/>
|
/>
|
||||||
</table>
|
</table>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
@@ -6,6 +6,8 @@ import { Utils } from '../../utils/utils';
|
|||||||
import toaster from '../toast';
|
import toaster from '../toast';
|
||||||
import { shareLinkAPI } from '../../utils/share-link-api';
|
import { shareLinkAPI } from '../../utils/share-link-api';
|
||||||
import BackIcon from '../back-icon';
|
import BackIcon from '../back-icon';
|
||||||
|
import EmptyTip from '../empty-tip';
|
||||||
|
import Loading from '../loading';
|
||||||
|
|
||||||
class EmailItem extends React.Component {
|
class EmailItem extends React.Component {
|
||||||
|
|
||||||
@@ -84,7 +86,8 @@ class LinkAuthenticatedEmails extends React.Component {
|
|||||||
this.state = {
|
this.state = {
|
||||||
inputEmails: '',
|
inputEmails: '',
|
||||||
authEmails: [],
|
authEmails: [],
|
||||||
isSubmitting: false
|
isSubmitting: false,
|
||||||
|
isLoading: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,8 +98,12 @@ class LinkAuthenticatedEmails extends React.Component {
|
|||||||
getItems = () => {
|
getItems = () => {
|
||||||
const { linkToken, path } = this.props;
|
const { linkToken, path } = this.props;
|
||||||
shareLinkAPI.listShareLinkAuthEmails(linkToken, path).then(res => {
|
shareLinkAPI.listShareLinkAuthEmails(linkToken, path).then(res => {
|
||||||
this.setState({ authEmails: res.data.auth_list });
|
this.setState({
|
||||||
|
authEmails: res.data.auth_list,
|
||||||
|
isLoading: false
|
||||||
|
});
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
let errMessage = Utils.getErrorMsg(error);
|
let errMessage = Utils.getErrorMsg(error);
|
||||||
toaster.danger(errMessage);
|
toaster.danger(errMessage);
|
||||||
});
|
});
|
||||||
@@ -198,6 +205,13 @@ class LinkAuthenticatedEmails extends React.Component {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div className="share-list-container">
|
<div className="share-list-container">
|
||||||
|
{this.state.isLoading ? (
|
||||||
|
<Loading />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{authEmails.length === 0 ? (
|
||||||
|
<EmptyTip text={gettext('No results')} />
|
||||||
|
) : (
|
||||||
<table className="table-thead-hidden w-xs-200">
|
<table className="table-thead-hidden w-xs-200">
|
||||||
{thead}
|
{thead}
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -213,6 +227,9 @@ class LinkAuthenticatedEmails extends React.Component {
|
|||||||
})}
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
@@ -7,6 +7,8 @@ import { Utils } from '../../utils/utils';
|
|||||||
import UserSelect from '../user-select';
|
import UserSelect from '../user-select';
|
||||||
import toaster from '../toast';
|
import toaster from '../toast';
|
||||||
import BackIcon from '../../components/back-icon';
|
import BackIcon from '../../components/back-icon';
|
||||||
|
import EmptyTip from '../empty-tip';
|
||||||
|
import Loading from '../loading';
|
||||||
|
|
||||||
class UserItem extends React.Component {
|
class UserItem extends React.Component {
|
||||||
|
|
||||||
@@ -90,7 +92,8 @@ class LinkAuthenticatedUsers extends React.Component {
|
|||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
selectedUsers: [],
|
selectedUsers: [],
|
||||||
authUsers: []
|
authUsers: [],
|
||||||
|
isLoading: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,8 +104,12 @@ class LinkAuthenticatedUsers extends React.Component {
|
|||||||
listLinkAuthUsers = () => {
|
listLinkAuthUsers = () => {
|
||||||
const { linkToken, path } = this.props;
|
const { linkToken, path } = this.props;
|
||||||
shareLinkAPI.listShareLinkAuthUsers(linkToken, path).then(res => {
|
shareLinkAPI.listShareLinkAuthUsers(linkToken, path).then(res => {
|
||||||
this.setState({ authUsers: res.data.auth_list });
|
this.setState({
|
||||||
|
authUsers: res.data.auth_list,
|
||||||
|
isLoading: false
|
||||||
|
});
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
this.setState({ isLoading: false });
|
||||||
let errMessage = Utils.getErrorMsg(error);
|
let errMessage = Utils.getErrorMsg(error);
|
||||||
toaster.danger(errMessage);
|
toaster.danger(errMessage);
|
||||||
});
|
});
|
||||||
@@ -199,6 +206,13 @@ class LinkAuthenticatedUsers extends React.Component {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div className="share-list-container">
|
<div className="share-list-container">
|
||||||
|
{this.state.isLoading ? (
|
||||||
|
<Loading />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{authUsers.length === 0 ? (
|
||||||
|
<EmptyTip text={gettext('No results')} />
|
||||||
|
) : (
|
||||||
<table className="table-thead-hidden w-xs-200">
|
<table className="table-thead-hidden w-xs-200">
|
||||||
{thead}
|
{thead}
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -214,6 +228,9 @@ class LinkAuthenticatedUsers extends React.Component {
|
|||||||
})}
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user