-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
优化应用中,文件夹内的新增按钮,根据文件夹权进行显示 #3195
base: main
Are you sure you want to change the base?
Conversation
勤劳上班的卑微小张 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
{userInfo?.team.permission.hasWritePer && | ||
folderDetail?.type !== AppTypeEnum.httpPlugin && ( | ||
{(folderDetail?.permission | ||
? folderDetail?.permission.hasWritePer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
写法有点问题,可以直接简化 folderDetail?.permission?.hasWritePer && xxx 即可
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不可以吧,如果在文件夹外,folderDetail是空的,也就是folderDetail?.permission?.hasWritePer是空的,会导致按钮出不来,用三目主要是判断在不在文件夹内
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
噢噢,get。那直接写成或条件好了😂三目运算看着怪怪的,好像也不对,这个写法是,有写权限就能创建。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
或也不对,现在的用户体验是,团队权限是写权限【userInfo?.team.permission.hasWritePer=true】,但是文件夹是读权限【folderDetail?.permission?.hasWritePer=false】,可以看到新增按钮,点击新增出弹窗,输入应用名称,点击任意模板,提示无权限,如果改成(folderDetail?.permission?.hasWritePer || userInfo?.team.permission.hasWritePer && folderDetail?.type !== AppTypeEnum.httpPlugin),没有文件夹权限,但是团队权限有,还是会出来,应该只有三目运算符了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
按目前设计的话,应该分两种。
- 根目录: 有团队写权限
- 目录内: 团队有写权限(后续应该去掉这个),且有目录写权限,且不是 HTTP plugin 目录
目前文件夹的新增按钮是根据团队的权限,在文件夹内没有权限的话,还是显示新增按钮,要等提交时才会报错没有权限