Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove useless paras #6302

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading