Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit031ac84

Browse files
minimize /permission requests
1 parent5b45716 commit031ac84

File tree

3 files changed

+70
-63
lines changed

3 files changed

+70
-63
lines changed

‎client/packages/lowcoder/src/components/PermissionDialog/AppPermissionDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { SHARE_TITLE } from "../../constants/apiConstants";
3131
import{messageInstance}from"lowcoder-design/src/components/GlobalInstances";
3232
import{defaultasDivider}from"antd/es/divider";
3333

34-
exportconstAppPermissionDialog=(props:{
34+
exportconstAppPermissionDialog=React.memo((props:{
3535
applicationId:string;
3636
visible:boolean;
3737
onVisibleChange:(visible:boolean)=>void;
@@ -148,7 +148,7 @@ export const AppPermissionDialog = (props: {
148148
}
149149
/>
150150
);
151-
};
151+
});
152152

153153
constInviteInputBtn=styled.div`
154154
display: flex;

‎client/packages/lowcoder/src/pages/common/header.tsx

Lines changed: 66 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
}from"lowcoder-design";
2626
import{trans}from"i18n";
2727
importdayjsfrom"dayjs";
28-
import{useContext,useState}from"react";
28+
import{useContext,useEffect,useMemo,useState}from"react";
2929
import{useDispatch,useSelector}from"react-redux";
3030
import{
3131
publishApplication,
@@ -453,67 +453,74 @@ export default function Header(props: HeaderProps) {
453453
</>
454454
);
455455

456-
constheaderEnd=showAppSnapshot ?(
457-
<HeaderProfileuser={user}/>
458-
) :(
459-
<>
460-
{applicationId&&(
461-
<AppPermissionDialog
462-
applicationId={applicationId}
463-
visible={permissionDialogVisible}
464-
onVisibleChange={(visible)=>
465-
!visible&&setPermissionDialogVisible(false)
466-
}
467-
/>
468-
)}
469-
{canManageApp(user,application)&&(
470-
<GrayBtnonClick={()=>setPermissionDialogVisible(true)}>
471-
{SHARE_TITLE}
472-
</GrayBtn>
473-
)}
474-
<PreviewBtnbuttonType="primary"onClick={()=>preview(applicationId)}>
475-
{trans("header.preview")}
476-
</PreviewBtn>
477-
478-
<Dropdown
479-
className="cypress-header-dropdown"
480-
placement="bottomRight"
481-
trigger={["click"]}
482-
dropdownRender={()=>(
483-
<DropdownMenuStyled
484-
style={{minWidth:"110px",borderRadius:"4px"}}
485-
onClick={(e)=>{
486-
if(e.key==="deploy"){
487-
dispatch(publishApplication({ applicationId}));
488-
}elseif(e.key==="snapshot"){
489-
dispatch(setShowAppSnapshot(true));
490-
}
491-
}}
492-
items={[
493-
{
494-
key:"deploy",
495-
label:(
496-
<CommonTextLabel>{trans("header.deploy")}</CommonTextLabel>
497-
),
498-
},
499-
{
500-
key:"snapshot",
501-
label:(
502-
<CommonTextLabel>{trans("header.snapshot")}</CommonTextLabel>
503-
),
504-
},
505-
]}
456+
constheaderEnd=useMemo(()=>{
457+
returnshowAppSnapshot ?(
458+
<HeaderProfileuser={user}/>
459+
) :(
460+
<>
461+
{applicationId&&(
462+
<AppPermissionDialog
463+
applicationId={applicationId}
464+
visible={permissionDialogVisible}
465+
onVisibleChange={(visible)=>
466+
!visible&&setPermissionDialogVisible(false)
467+
}
506468
/>
507469
)}
508-
>
509-
<PackUpBtnbuttonType="primary">
510-
<PackUpIcon/>
511-
</PackUpBtn>
512-
</Dropdown>
470+
{canManageApp(user,application)&&(
471+
<GrayBtnonClick={()=>setPermissionDialogVisible(true)}>
472+
{SHARE_TITLE}
473+
</GrayBtn>
474+
)}
475+
<PreviewBtnbuttonType="primary"onClick={()=>preview(applicationId)}>
476+
{trans("header.preview")}
477+
</PreviewBtn>
478+
479+
<Dropdown
480+
className="cypress-header-dropdown"
481+
placement="bottomRight"
482+
trigger={["click"]}
483+
dropdownRender={()=>(
484+
<DropdownMenuStyled
485+
style={{minWidth:"110px",borderRadius:"4px"}}
486+
onClick={(e)=>{
487+
if(e.key==="deploy"){
488+
dispatch(publishApplication({ applicationId}));
489+
}elseif(e.key==="snapshot"){
490+
dispatch(setShowAppSnapshot(true));
491+
}
492+
}}
493+
items={[
494+
{
495+
key:"deploy",
496+
label:(
497+
<CommonTextLabel>{trans("header.deploy")}</CommonTextLabel>
498+
),
499+
},
500+
{
501+
key:"snapshot",
502+
label:(
503+
<CommonTextLabel>{trans("header.snapshot")}</CommonTextLabel>
504+
),
505+
},
506+
]}
507+
/>
508+
)}
509+
>
510+
<PackUpBtnbuttonType="primary">
511+
<PackUpIcon/>
512+
</PackUpBtn>
513+
</Dropdown>
513514

514-
<HeaderProfileuser={user}/>
515-
</>
516-
);
515+
<HeaderProfileuser={user}/>
516+
</>
517+
);
518+
},[
519+
user,
520+
showAppSnapshot,
521+
applicationId,
522+
permissionDialogVisible,
523+
]);
517524

518525
return(
519526
<LayoutHeader

‎client/packages/lowcoder/src/pages/editor/editorSkeletonView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ export default function EditorSkeletonView() {
5959
return(
6060
<>
6161
<Height100Div>
62-
<Header
62+
{/*<Header
6363
panelStatus={panelStatus}
6464
togglePanel={_.noop}
6565
editorModeStatus={editorModeStatus}
6666
toggleEditorModeStatus={_.noop}
67-
/>
67+
/> */}
6868
<Body>
6969
<SiderStyled/>
7070
{panelStatus.left&&(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp