mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 00:43:53 +00:00
add seatable integration for dept repo (#5870)
This commit is contained in:
@@ -4,7 +4,7 @@ import moment from 'moment';
|
||||
import { Dropdown, DropdownMenu, DropdownToggle, DropdownItem } from 'reactstrap';
|
||||
import { Link, navigate } from '@gatsbyjs/reach-router';
|
||||
import { Utils } from '../../utils/utils';
|
||||
import { gettext, siteRoot, isPro, username, folderPermEnabled, isSystemStaff, enableResetEncryptedRepoPassword, isEmailConfigured, enableRepoAutoDel } from '../../utils/constants';
|
||||
import { gettext, siteRoot, isPro, username, folderPermEnabled, isSystemStaff, enableResetEncryptedRepoPassword, isEmailConfigured, enableRepoAutoDel, enableSeaTableIntegration } from '../../utils/constants';
|
||||
import ModalPortal from '../../components/modal-portal';
|
||||
import ShareDialog from '../../components/dialog/share-dialog';
|
||||
import LibSubFolderPermissionDialog from '../../components/dialog/lib-sub-folder-permission-dialog';
|
||||
@@ -12,6 +12,7 @@ import DeleteRepoDialog from '../../components/dialog/delete-repo-dialog';
|
||||
import ChangeRepoPasswordDialog from '../../components/dialog/change-repo-password-dialog';
|
||||
import ResetEncryptedRepoPasswordDialog from '../../components/dialog/reset-encrypted-repo-password-dialog';
|
||||
import LibOldFilesAutoDelDialog from '../../components/dialog/lib-old-files-auto-del-dialog';
|
||||
import RepoSeaTableIntegrationDialog from '../../components/dialog/repo-seatable-integration-dialog';
|
||||
import Rename from '../rename';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
import LibHistorySettingDialog from '../dialog/lib-history-setting-dialog';
|
||||
@@ -55,6 +56,7 @@ class SharedRepoListItem extends React.Component {
|
||||
isChangePasswordDialogShow: false,
|
||||
isResetPasswordDialogShow: false,
|
||||
isOldFilesAutoDelDialogOpen: false,
|
||||
isSeaTableIntegrationShow: false,
|
||||
};
|
||||
this.isDeparementOnwerGroupMember = false;
|
||||
}
|
||||
@@ -196,6 +198,9 @@ class SharedRepoListItem extends React.Component {
|
||||
case 'Old Files Auto Delete':
|
||||
this.toggleOldFilesAutoDelDialog();
|
||||
break;
|
||||
case 'SeaTable integration':
|
||||
this.onSeaTableIntegrationToggle();
|
||||
break;
|
||||
// no default
|
||||
}
|
||||
};
|
||||
@@ -308,6 +313,10 @@ class SharedRepoListItem extends React.Component {
|
||||
this.setState({isOldFilesAutoDelDialogOpen: !this.state.isOldFilesAutoDelDialogOpen});
|
||||
};
|
||||
|
||||
onSeaTableIntegrationToggle = () => {
|
||||
this.setState({isSeaTableIntegrationShow: !this.state.isSeaTableIntegrationShow});
|
||||
};
|
||||
|
||||
onAPITokenToggle = () => {
|
||||
this.setState({isAPITokenDialogShow: !this.state.isAPITokenDialogShow});
|
||||
};
|
||||
@@ -365,6 +374,9 @@ class SharedRepoListItem extends React.Component {
|
||||
case 'Advanced':
|
||||
translateResult = gettext('Advanced');
|
||||
break;
|
||||
case 'SeaTable integration':
|
||||
translateResult = gettext('SeaTable integration');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -377,6 +389,9 @@ class SharedRepoListItem extends React.Component {
|
||||
if (enableRepoAutoDel) {
|
||||
operations.push('Old Files Auto Delete');
|
||||
}
|
||||
if (enableSeaTableIntegration) {
|
||||
operations.push('SeaTable integration');
|
||||
}
|
||||
return operations;
|
||||
};
|
||||
|
||||
@@ -389,6 +404,7 @@ class SharedRepoListItem extends React.Component {
|
||||
let operations = [];
|
||||
if (isPro) {
|
||||
if (repo.owner_email.indexOf('@seafile_group') != -1) {
|
||||
// is group admin
|
||||
if (isStaff) {
|
||||
if (repo.owner_email == currentGroup.id + '@seafile_group') {
|
||||
this.isDeparementOnwerGroupMember = true;
|
||||
@@ -769,6 +785,15 @@ class SharedRepoListItem extends React.Component {
|
||||
/>
|
||||
</ModalPortal>
|
||||
)}
|
||||
{this.state.isSeaTableIntegrationShow && (
|
||||
<ModalPortal>
|
||||
<RepoSeaTableIntegrationDialog
|
||||
repo={repo}
|
||||
onSeaTableIntegrationToggle={this.onSeaTableIntegrationToggle}
|
||||
/>
|
||||
</ModalPortal>
|
||||
)}
|
||||
|
||||
|
||||
</Fragment>
|
||||
);
|
||||
|
Reference in New Issue
Block a user