Răsfoiți Sursa

Merge branch 'master' into dependabot/npm_and_yarn/ws-7.4.6

itizawa 4 ani în urmă
părinte
comite
246e91256f

+ 4 - 0
resource/Contributor.js

@@ -43,6 +43,9 @@ const contributors = [
           { name: 'oshikishintaro' },
           { name: 'oshikishintaro' },
           { name: 'makotoshiraishi' },
           { name: 'makotoshiraishi' },
           { name: 'yamagai' },
           { name: 'yamagai' },
+          { name: 'stevenfukase' },
+          { name: 'miya' },
+          { name: 'kaho819' },
         ],
         ],
       },
       },
     ],
     ],
@@ -109,6 +112,7 @@ const contributors = [
           { position: 'Flatt Security', name: 'Azara/Norihide Saito' },
           { position: 'Flatt Security', name: 'Azara/Norihide Saito' },
           { position: 'CyberAgent, Inc.', name: 'Daisuke Takahashi' },
           { position: 'CyberAgent, Inc.', name: 'Daisuke Takahashi' },
           { position: 'Mitsui Bussan Secure Directions, Inc.', name: 'Yuji Tounai' },
           { position: 'Mitsui Bussan Secure Directions, Inc.', name: 'Yuji Tounai' },
+          { name: 'yy0931' },
         ],
         ],
       },
       },
     ],
     ],

+ 7 - 5
src/client/js/components/PageEditor/LinkEditModal.jsx

@@ -152,8 +152,8 @@ class LinkEditModal extends React.PureComponent {
     const { t } = this.props;
     const { t } = this.props;
     const path = this.state.linkInputValue;
     const path = this.state.linkInputValue;
     let markdown = '';
     let markdown = '';
-    let previewError = '';
     let permalink = '';
     let permalink = '';
+    let previewError = '';
 
 
     if (path.startsWith('/')) {
     if (path.startsWith('/')) {
       const pathWithoutFragment = new URL(path, 'http://dummy').pathname;
       const pathWithoutFragment = new URL(path, 'http://dummy').pathname;
@@ -163,8 +163,7 @@ class LinkEditModal extends React.PureComponent {
       try {
       try {
         const { page } = await this.props.appContainer.apiGet('/pages.get', { path: pathWithoutFragment, page_id: pageId });
         const { page } = await this.props.appContainer.apiGet('/pages.get', { path: pathWithoutFragment, page_id: pageId });
         markdown = page.revision.body;
         markdown = page.revision.body;
-        // create permanent link only if path isn't permanent link because checkbox for isUsePermanentLink is disabled when permalink is ''.
-        permalink = !isPermanentLink ? `${window.location.origin}/${page.id}` : '';
+        permalink = page.id;
       }
       }
       catch (err) {
       catch (err) {
         previewError = err.message;
         previewError = err.message;
@@ -217,7 +216,8 @@ class LinkEditModal extends React.PureComponent {
   handleChangeTypeahead(selected) {
   handleChangeTypeahead(selected) {
     const page = selected[0];
     const page = selected[0];
     if (page != null) {
     if (page != null) {
-      this.setState({ linkInputValue: page.path });
+      const permalink = `${window.location.origin}/${page.id}`;
+      this.setState({ linkInputValue: page.path, permalink });
     }
     }
   }
   }
 
 
@@ -230,7 +230,9 @@ class LinkEditModal extends React.PureComponent {
     if (!this.state.linkInputValue.startsWith('/') || this.state.linkerType === Linker.types.growiLink) {
     if (!this.state.linkInputValue.startsWith('/') || this.state.linkerType === Linker.types.growiLink) {
       isUseRelativePath = false;
       isUseRelativePath = false;
     }
     }
-    this.setState({ linkInputValue: link, isUseRelativePath, isUsePermanentLink: false });
+    this.setState({
+      linkInputValue: link, isUseRelativePath, isUsePermanentLink: false, permalink: '',
+    });
   }
   }
 
 
   handleSelecteLinkerType(linkerType) {
   handleSelecteLinkerType(linkerType) {