diff --git a/frontend/src/components/wiki-card-view/wiki-card-item.js b/frontend/src/components/wiki-card-view/wiki-card-item.js index 1284a071ab..e58055989e 100644 --- a/frontend/src/components/wiki-card-view/wiki-card-item.js +++ b/frontend/src/components/wiki-card-view/wiki-card-item.js @@ -3,7 +3,7 @@ import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap import PropTypes from 'prop-types'; import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; -import { siteRoot, gettext, username } from '../../utils/constants'; +import { siteRoot, gettext, username, canPublishWiki } from '../../utils/constants'; import ModalPortal from '../modal-portal'; import DeleteWikiDialog from '../dialog/delete-wiki-dialog'; import RenameWikiDialog from '../dialog/rename-wiki-dialog'; @@ -245,7 +245,7 @@ class WikiCardItem extends Component { {showRename && {gettext('Rename')}} - {showPublish && + {showPublish && canPublishWiki && {gettext('Publish')}} {showShare && {gettext('Share')} diff --git a/frontend/src/components/wiki-card-view/wiki-card-view.js b/frontend/src/components/wiki-card-view/wiki-card-view.js index cda4e99466..3691415523 100644 --- a/frontend/src/components/wiki-card-view/wiki-card-view.js +++ b/frontend/src/components/wiki-card-view/wiki-card-view.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { gettext, username, canPublishRepo, isPro } from '../../utils/constants'; +import { gettext, username, canCreateWiki, isPro } from '../../utils/constants'; import WikiCardGroup from './wiki-card-group'; import wikiAPI from '../../utils/wiki-api'; import { Utils } from '../../utils/utils'; @@ -30,7 +30,7 @@ class WikiCardView extends Component { } componentDidMount() { - if (!canPublishRepo || !isPro) return; + if (!canCreateWiki || !isPro) return; let departmentMap = {}; wikiAPI.listWikiDepartments().then(res => { res.data.forEach(item => departmentMap[item.id] = true); @@ -88,7 +88,7 @@ class WikiCardView extends Component { title={gettext('My Wikis')} isDepartment={false} isShowAvatar={false} - toggleAddWikiDialog={canPublishRepo ? toggleAddWikiDialog.bind(this, null) : null} + toggleAddWikiDialog={canCreateWiki ? toggleAddWikiDialog.bind(this, null) : null} /> ); wikiCardGroups.push( @@ -122,7 +122,7 @@ class WikiCardView extends Component { title={groupWiki.group_name} isDepartment={true} isShowAvatar={false} - toggleAddWikiDialog={(canPublishRepo && this.state.departmentMap[groupWiki.group_id]) ? toggleAddWikiDialog.bind(this, groupWiki.group_id) : null} + toggleAddWikiDialog={(canCreateWiki && this.state.departmentMap[groupWiki.group_id]) ? toggleAddWikiDialog.bind(this, groupWiki.group_id) : null} /> ); } diff --git a/frontend/src/pages/wikis/wikis.js b/frontend/src/pages/wikis/wikis.js index 6b8bdc9904..97fbdefc80 100644 --- a/frontend/src/pages/wikis/wikis.js +++ b/frontend/src/pages/wikis/wikis.js @@ -1,7 +1,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap'; -import { gettext, canPublishRepo } from '../../utils/constants'; +import { gettext, canCreateWiki } from '../../utils/constants'; import { Utils } from '../../utils/utils'; import toaster from '../../components/toast'; import ModalPortal from '../../components/modal-portal'; @@ -337,7 +337,7 @@ class Wikis extends Component {

{gettext('Wikis')}

- {canPublishRepo && + {canCreateWiki &&