Make the report fields read-only for invited members with chat only permission - #74612
Conversation
|
@Krishna2323 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@Eskalifer1 could you please update the title to something like "Make the report fields read-only for invited members with |
| .map((field): EnrichedPolicyReportField => { | ||
| const fieldValue = field.value ?? field.defaultValue; | ||
| const isFieldDisabled = isReportFieldDisabled(report, field, policy); | ||
| const isFieldDisabled = isReportFieldDisabled(report, field, policy) || !isAdminOwnerApproverOrReportOwner(report, policy); |
There was a problem hiding this comment.
@Eskalifer1 the same condition is being used in three places in the app — it would be better to create a utility function for it.
There was a problem hiding this comment.
Hi @Krishna2323, sure, Just let me know what you think this function should be called, and I'll update the PR!
There was a problem hiding this comment.
@Eskalifer1 I think we can name it isReportFieldDisabledForUser
There was a problem hiding this comment.
Updated PR! TS and Test failing is not related to my changes, i will merge main when it will be fixed
trjExpensify
left a comment
There was a problem hiding this comment.
Makes sense a rando can't edit. 👍
|
@Eskalifer1 could you please resolve the failing checks? |
|
Hi @Krishna2323 will try to merge main now! |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid_native.mp4Android: mWeb Chromeandroid_chrome.mp4iOS: HybridAppios_natiev.mp4iOS: mWeb Safariios_safari.mp4MacOS: Chrome / Safariweb_chrome.mp4MacOS: Desktopdesktop_app.mp4 |
|
🚀 Deployed to staging by https://github.com/AndrewGable in version: 9.2.58-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.2.58-3 🚀
|
Explanation of Change
Fixed Issues
$#73998
PROPOSAL:#73998 (comment)
Tests
Precondition:
Workspace has at least one Report field (create it on workspace settings > Reports).
Offline tests
Precondition:
be invited to the report as a chat member(steps 1-6 from Tests section)
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
73998-android-native.mp4
Android: mWeb Chrome
73988-android-web.mp4
iOS: Native
73998-ios-native.mp4
iOS: mWeb Safari
73988-ios-web.mp4
MacOS: Chrome / Safari
73998-web.mp4
MacOS: Desktop
73988-desktop.mp4