zahmis 5 лет назад
Родитель
Сommit
5f6716969f

+ 5 - 1
src/client/js/app.jsx

@@ -80,7 +80,11 @@ Object.assign(componentMappings, {
 
   'not-found-page': <NotFoundPage />,
 
-  'not-found-alert': <NotFoundAlert onPageCreateClicked={navigationContainer.setEditorMode} isForbidden={pageContainer.state.isForbidden} />,
+  'not-found-alert': <NotFoundAlert
+    onPageCreateClicked={navigationContainer.setEditorMode}
+    isForbidden={pageContainer.state.isForbidden}
+    isCreatable={pageContainer.state.isCreatable}
+  />,
 
   'page-timeline': <PageTimeline />,
 

+ 0 - 2
src/client/js/components/Navbar/GrowiSubNavigation.jsx

@@ -147,8 +147,6 @@ const GrowiSubNavigation = (props) => {
   const isUserPage = pageUser != null;
   const isPageInTrash = isTrashPage(path);
 
-  console.log(isPageForbidden);
-
   function onThreeStrandedButtonClicked(viewType) {
     navigationContainer.setEditorMode(viewType);
   }

+ 3 - 2
src/client/js/components/Page/NotFoundAlert.jsx

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
 import { withTranslation } from 'react-i18next';
 
 const NotFoundAlert = (props) => {
-  const { t, isForbidden } = props;
+  const { t, isForbidden, isCreatable } = props;
   function clickHandler(viewType) {
     if (props.onPageCreateClicked === null) {
       return;
@@ -11,7 +11,7 @@ const NotFoundAlert = (props) => {
     props.onPageCreateClicked(viewType);
   }
 
-  if (isForbidden) {
+  if (isForbidden || isCreatable) {
     return null;
   }
 
@@ -40,6 +40,7 @@ NotFoundAlert.propTypes = {
   t: PropTypes.func.isRequired, // i18next
   onPageCreateClicked: PropTypes.func,
   isForbidden: PropTypes.bool.isRequired,
+  isCreatable: PropTypes.bool.isRequired,
 };
 
 export default withTranslation()(NotFoundAlert);

+ 1 - 0
src/server/views/widget/forbidden_content.html

@@ -11,6 +11,7 @@
   data-path="{{ encodeURI(path) }}"
   data-current-user="{% if user %}{{ user._id.toString() }}{% endif %}"
   data-page-is-forbidden="true"
+  data-page-is-creatable="true"
   >
 
   <div class="row row-alerts d-edit-none">