Explorar o código

Merge branch 'master' into fix/110042-normalize-vrt

Shun Miyazawa %!s(int64=3) %!d(string=hai) anos
pai
achega
4f046b5e37

+ 2 - 2
packages/app/src/components/Admin/UserGroup/UserGroupTable.tsx

@@ -126,7 +126,7 @@ export const UserGroupTable: FC<Props> = (props: Props) => {
   }, [props.userGroupRelations, props.childUserGroups]);
 
   return (
-    <>
+    <div data-testid="grw-user-group-table">
       <h2>{props.headerLabel}</h2>
 
       <table className="table table-bordered table-user-list">
@@ -216,6 +216,6 @@ export const UserGroupTable: FC<Props> = (props: Props) => {
           })}
         </tbody>
       </table>
-    </>
+    </div>
   );
 };

+ 12 - 2
packages/app/src/components/Page.tsx

@@ -77,6 +77,11 @@ export const Page = (props) => {
       return;
     }
 
+    // disable if share link
+    if (shareLinkId != null) {
+      return;
+    }
+
     const currentMarkdown = currentPage.revision.body;
     const optionsToSave: OptionsToSave = {
       isSlackEnabled: false,
@@ -107,10 +112,15 @@ export const Page = (props) => {
       logger.error('failed to save', error);
       toastError(error);
     }
-  }, [currentPage, mutateCurrentPage, mutateEditingMarkdown, saveOrUpdate, t, tagsInfo]);
+  }, [currentPage, mutateCurrentPage, mutateEditingMarkdown, saveOrUpdate, shareLinkId, t, tagsInfo]);
 
   // set handler to open DrawioModal
   useEffect(() => {
+    // disable if share link
+    if (shareLinkId != null) {
+      return;
+    }
+
     const handler = (data: DrawioEditByViewerProps) => {
       openDrawioModal(data.drawioMxFile, drawioMxFile => saveByDrawioModal(drawioMxFile, data.bol, data.eol));
     };
@@ -119,7 +129,7 @@ export const Page = (props) => {
     return function cleanup() {
       globalEmitter.removeListener('launchDrawioModal', handler);
     };
-  }, [openDrawioModal, saveByDrawioModal]);
+  }, [openDrawioModal, saveByDrawioModal, shareLinkId]);
 
   if (currentPage == null || isGuestUser == null || rendererOptions == null) {
     const entries = Object.entries({

+ 1 - 0
packages/app/test/cypress/integration/40-admin/access-to-admin-page.spec.ts

@@ -106,6 +106,7 @@ context('Access to Admin page', () => {
   it('/admin/user-groups is successfully loaded', () => {
     cy.visit('/admin/user-groups');
     cy.getByTestid('admin-user-groups').should('be.visible');
+    cy.getByTestid('grw-user-group-table').should('be.visible');
     cy.screenshot(`${ssPrefix}-admin-user-groups`);
   });