-
Notifications
You must be signed in to change notification settings - Fork 75
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
fix(FR-242): show vfolder list based on delegated user #3070
base: main
Are you sure you want to change the base?
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🔴 | Statements | 4.9% (-0% 🔻) |
398/8120 |
🔴 | Branches | 4.24% (-0.01% 🔻) |
239/5641 |
🔴 | Functions | 2.95% (-0% 🔻) |
78/2643 |
🔴 | Lines | 4.82% (-0% 🔻) |
383/7945 |
Test suite run success
124 tests passing in 14 suites.
Report generated by 🧪jest coverage report action from 315d315
const formInstance = Form.useFormInstance(); | ||
const ownerInfo = formInstance.getFieldValue(['owner']); | ||
// valid when owner is enabled and all fields are not undefined | ||
const isValidOwner = | ||
ownerInfo?.enabled && | ||
(!_.isEmpty(ownerInfo) | ||
? _.every(_.omit(ownerInfo, 'enabled'), (key, value) => { | ||
return key !== undefined; | ||
}) | ||
: false); | ||
const ownerEmail = isValidOwner ? ownerInfo.email : undefined; | ||
|
||
useEffect(() => { | ||
formInstance.setFieldsValue({ mounts: undefined, vfolderAliasMap: {} }); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [isValidOwner]); | ||
|
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.
VFolderTable is not a Form.Item component. Therefore, it can be used outside of a Form. If you want to impose a condition based on a specific user's email, VFolderTable should receive the email as a prop. The email condition is an input of this Component.
resolves #3017 (FR-242)
In the
VFolderTable
used by the session launcher, we are fetching the vfolder list via the REST API. Since the API provides the ability to filter the data based on owner email, use it to show the vfolder list based on the delegated owner email assigned by the session launcher.feature:
Checklist: (if applicable)