Skip to content

Commit

Permalink
remove useless paras (#6302)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael18811380328 authored Jul 5, 2024
1 parent 6e45dfb commit 7e92731
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
7 changes: 2 additions & 5 deletions frontend/src/components/dialog/add-wiki-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { Utils } from '../../utils/utils';
import toaster from '../toast';
import { SeahubSelect } from '../common/select';

const { multiTenancy, cloudMode } = window.app.pageOptions;

const propTypes = {
toggleCancel: PropTypes.func.isRequired,
addWiki: PropTypes.func.isRequired,
Expand All @@ -25,11 +23,10 @@ class AddWikiDialog extends React.Component {
selectedOption: null,
options: [],
};
this.isDepartment = isPro && multiTenancy && cloudMode;
}

componentDidMount() {
if (!this.isDepartment) return;
if (!isPro) return;
wikiAPI.listWikiDepartments().then(res => {
const departments = res.data.sort((a, b) => {
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
Expand Down Expand Up @@ -88,7 +85,7 @@ class AddWikiDialog extends React.Component {
<ModalBody>
<Label>{gettext('Name')}</Label>
<Input onKeyDown={this.handleKeyDown} autoFocus={true} value={this.state.name} onChange={this.inputNewName}/>
{this.isDepartment &&
{isPro &&
<>
<Label className='mt-4'>{gettext('Wiki owner')} ({gettext('Optional')})</Label>
<SeahubSelect
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/components/wiki-card-view/wiki-card-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import toaster from '../toast';

import './wiki-card-view.css';

const { multiTenancy, cloudMode } = window.app.pageOptions;

const propTypes = {
data: PropTypes.object.isRequired,
deleteWiki: PropTypes.func.isRequired,
Expand All @@ -24,11 +22,10 @@ class WikiCardView extends Component {
this.state = {
departmentMap: {},
};
this.isDepartment = isPro && multiTenancy && cloudMode;
}

componentDidMount() {
if (!canPublishRepo || !this.isDepartment) return;
if (!canPublishRepo || !isPro) return;
let departmentMap = {};
wikiAPI.listWikiDepartments().then(res => {
res.data.forEach(item => departmentMap[item.id] = true);
Expand Down
2 changes: 0 additions & 2 deletions seahub/templates/base_for_react.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@
canAddRepo: {% if user.permissions.can_add_repo %} true {% else %} false {% endif %},
canShareRepo: {% if user.permissions.can_share_repo %} true {% else %} false {% endif %},
canAddGroup: {% if user.permissions.can_add_group %} true {% else %} false {% endif %},
multiTenancy: {% if multi_tenancy %} true {% else %} false {% endif %},
cloudMode: {% if cloud_mode %} true {% else %} false {% endif %},
groupImportMembersExtraMsg: "{{group_import_members_extra_msg}}",
canGenerateShareLink: {% if user.permissions.can_generate_share_link %} true {% else %} false {% endif %},
canGenerateUploadLink: {% if user.permissions.can_generate_upload_link %} true {% else %} false {% endif %},
Expand Down

0 comments on commit 7e92731

Please sign in to comment.