فهرست منبع

Initial commit

Taichi Masuyama 4 سال پیش
والد
کامیت
f51bf575a0

+ 1 - 1
src/client/js/components/PageAccessoriesModal.jsx

@@ -60,7 +60,7 @@ const PageAccessoriesModal = (props) => {
         Icon: ShareLinkIcon,
         i18n: t('share_links.share_link_management'),
         index: 4,
-        isLinkEnabled: v => !isGuestUser && !isSharedUser && !isNotFoundPage,
+        isLinkEnabled: v => !isGuestUser && !isSharedUser && !isNotFoundPage,  // TAICHI: ここでdisableにする
       },
     };
   }, [t, isGuestUser, isSharedUser, isNotFoundPage]);

+ 1 - 1
src/client/js/components/PageAccessoriesModalControl.jsx

@@ -49,7 +49,7 @@ const PageAccessoriesModalControl = (props) => {
       {
         name: 'shareLink',
         Icon: <ShareLinkIcon />,
-        disabled: isGuestUser || isSharedUser || isNotFoundPage,
+        disabled: isGuestUser || isSharedUser || isNotFoundPage,  // TAICHI: ここでdisableになる isLinkSharingDisabled
         i18n: t('share_links.share_link_management'),
       },
     ];

+ 3 - 0
src/client/js/services/AppContainer.js

@@ -53,6 +53,9 @@ export default class AppContainer extends Container {
     this.isGuestUser = this.currentUser == null;
     this.isSharedUser = isSharedPageElem != null && this.currentUser == null;
 
+    // TAICHI: check if Link Sharing is enabled or not
+    // this.canShareLink = 
+
     const userLocaleId = this.currentUser?.lang;
     this.i18n = i18nFactory(userLocaleId);
 

+ 1 - 1
src/server/models/config.js

@@ -192,7 +192,7 @@ module.exports = function(crowi) {
         image: crowi.fileUploadService.getIsUploadable(),
         file: crowi.fileUploadService.getFileUploadEnabled(),
       },
-      registrationWhiteList: crowi.configManager.getConfig('crowi', 'security:registrationWhiteList'),
+      registrationWhiteList: crowi.configManager.getConfig('crowi', 'security:registrationWhiteList'),  // TAICHI:この下に追加することでbrowser側でconfigが使えるようになる
       themeType: crowi.configManager.getConfig('crowi', 'customize:theme'),
       isEnabledLinebreaks: crowi.configManager.getConfig('markdown', 'markdown:isEnabledLinebreaks'),
       isEnabledLinebreaksInComments: crowi.configManager.getConfig('markdown', 'markdown:isEnabledLinebreaksInComments'),

+ 1 - 1
src/server/routes/apiv3/share-links.js

@@ -115,7 +115,7 @@ module.exports = (crowi) => {
    *            description: Succeeded to create one share link
    */
 
-  router.post('/', loginRequired, csrf, validator.shareLinkStatus, apiV3FormValidator, async(req, res) => {
+  router.post('/', loginRequired, csrf, validator.shareLinkStatus, apiV3FormValidator, async(req, res) => {  // TAICHI: ASK
     const { relatedPage, expiredAt, description } = req.body;
 
     const page = await Page.findByIdAndViewer(relatedPage, req.user);