Просмотр исходного кода

Merge pull request #6487 from weseek/imprv/103282-grant-types

Imprv/103282 use grant type and fix isUsersHomePage err
cao 3 лет назад
Родитель
Сommit
d64b8159e9

+ 2 - 2
packages/app/src/components/PageEditor.tsx

@@ -4,7 +4,7 @@ import React, {
 
 import EventEmitter from 'events';
 
-import { envUtils } from '@growi/core';
+import { envUtils, PageGrant } from '@growi/core';
 import detectIndent from 'detect-indent';
 import { throttle, debounce } from 'throttle-debounce';
 
@@ -348,7 +348,7 @@ const PageEditor = (props: Props): JSX.Element => {
       return;
     }
 
-    const grant = grantData?.grant || 1;
+    const grant = grantData?.grant || PageGrant.GRANT_PUBLIC;
     const grantedGroup = grantData?.grantedGroup;
 
     if (isSlackEnabled == null || currentPathname == null) {

+ 2 - 2
packages/app/src/components/SavePageControls.tsx

@@ -1,6 +1,6 @@
 import React, { useCallback } from 'react';
 
-import { pagePathUtils } from '@growi/core';
+import { pagePathUtils, PageGrant } from '@growi/core';
 import { useTranslation } from 'next-i18next';
 import {
   UncontrolledButtonDropdown, Button,
@@ -81,7 +81,7 @@ export const SavePageControls = (props: Props): JSX.Element | null => {
     return null;
   }
 
-  const grant = grantData?.grant || 1;
+  const grant = grantData?.grant || PageGrant.GRANT_PUBLIC;
   const grantedGroup = grantData?.grantedGroup;
 
   // const {  pageContainer } = props;

+ 1 - 1
packages/app/src/pages/[[...path]].page.tsx

@@ -337,7 +337,7 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
           <Comments pageId={pageId} />
           {/* )} */}
           {/* TODO: Create UsersHomePageFooter conponent */}
-          { isUsersHomePage(pageWithMeta?.data.path) && (
+          { isUsersHomePage(props.currentPathname) && (
             <div className="container-lg user-page-footer py-5">
               <div className="grw-user-page-list-m d-edit-none">
                 <h2 id="bookmarks-list" className="grw-user-page-header border-bottom pb-2 mb-3">