-
Notifications
You must be signed in to change notification settings - Fork 82
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
Feat: improve share views - add filters #885
Conversation
…eat/improve-share-views # Conflicts: # backend/dataall/modules/dataset_sharing/db/share_object_repositories.py # frontend/src/modules/Shares/components/ShareBoxList.js # frontend/src/modules/Shares/components/ShareInboxList.js # frontend/src/modules/Shares/components/ShareOutboxList.js
backend/dataall/modules/datasets_base/db/dataset_repositories.py
Outdated
Show resolved
Hide resolved
backend/dataall/modules/dataset_sharing/db/share_object_repositories.py
Outdated
Show resolved
Hide resolved
backend/dataall/core/environment/services/environment_service.py
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,489 @@ | |||
import { |
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.
(For outbox) We use getShareRequestsFromMe
to - setItems
, setDatasets
and setDatasetGroupOptions
(and call the query 2 separate times for this)
- Could we have it only called once and set all the subsequent states once we get a response
- Either in 1 single outbox function or can set items and then when items change re-set the datasets and dataset group option
(For inbox) Similarly, we use getShareRequestsToMe
to - setItems
and setRequestGroupOptions
- Can we also use this query to
setDatasets
rather thanlistDatasets
- Could we have it only called once and set all the subsequent states once we get a response
The high level flow I am thinking
useEffect
tosetItems
(as is already)- Depending on datasets shares view, inbox tab or outbox tab call the appropriate function to set items (the share objects)
- Have a separate
useEffect
that re-renders on changes to items- Calls
listAllGroups
- Then can use the existing items already set to determine group options and datasets (Do not need to re query that same API)
- Calls
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.
The main issue is the pagination and number of items retrieved. When we are setting the options we do not want to set the options based on the first 10 shares only.
FILTER | request owners | roles | datasets | dataset owners |
---|---|---|---|---|
INBOX (received) | ListRequests parse owners | ListRequests parse roles | ListDatasets | ListGroups |
OUTBOX (sent) | ListGroups | ListGroups+ListConsumptionRoles | ListRequests parse datasets | ListRequests parse datasets owners |
ListRequest (getShareRequestsFromMe, getShareRequestsToMe, listDatasetShareObjects)
- initial execution to set filterOptions in several functions -
pageSize=Defaults.selectListFilter
- initial execution fetchXItems -
pageSize=Defaults.filter
- filter change fetchXItems -
pageSize=Defaults.filter
ListDataset, ListGroups, ListConsumptionRoles
- initial execution to set filterOptions
Replacing the API call with the frontend function:
FILTER | request owners | roles | datasets | dataset owners |
---|---|---|---|---|
INBOX (received) | fetchInboxRequestOptions | fetchInboxRequestOptions | fetchOwnedDatasetsOptions | fetchMyGroupsAndRolesOptions |
OUTBOX (sent) | fetchMyGroupsAndRolesOptions | fetchMyGroupsAndRolesOptions | fetchOutboxRequestOptions | fetchOutboxRequestOptions |
filterOptions useEffect - ListRequest paginated with pageSize=Defaults.selectListFilter
- on tab change
fetchItems useEffect - ListRequest paginated with pageSize=Defaults.filter
- on tab change
- on filter change
Test:
Share Received (Inbox)
Also showing datasets that are shared with the user but not owned by the user in the received share requests (because of listDataset()) query logic
Showing my same group 3 times since I am a part of 3 different environments and thus have 3 different EnvironmentGroup entries when calling
This works but only shows the RequestPrincipals that are for shares with principalType Group. I think this is because we are pulling the principal.SamlGroupName which will all be the group name that owns the consumption role (when of type consumption role). We may want to add some logic to pull Share Sent (Outbox)
Dataset Shares View
|
Overall, I think the design and UI views are super and a great improvement! Left some comments on the issues I ran into, mostly minor fixes but some bigger ideas / thoughts as well Let me know what you think @dlpzx |
# Conflicts: # frontend/src/modules/Shares/index.js
Per customer request I added a filter for the IAM role name (That also solves the problem of duplicates in requester groups). To be able to support consumption roles I had to create a couple of resolvers. The only thing left is reviewing the I would merge this PR and then work on additional items of the issue if needed. I would add only those features that add value, avoiding a too messy to handle UI |
Updated Testing in AWS Deployment:
Share Received (Inbox) - Testing Filters Show Correct Options and Work Filtering Shares
Share Sent (Outbox)
Dataset Shares View
My one comment is that we are returning all request owners and all request IAM role names for all existing shares (not filtering for also the particular dataset we are looking into for the dataset-shares tab). An enhancement could be to enforce filtering for only this dataset when calling
The filters can be set but do not actual filter the outputted Share Objects in the dataset share tab. |
…cts on tab change
Hi @noah-paige, I changed a bit how we fetch share items in the dataset view. Instead of modifying the existing getDataset, I re-used the fetchInbox methods but setting the filter to the dataset_uri and dataset_owner. I also fixed some conflicts with the filters that were not set to the initial state on tab or window changes |
Code changes look good! Think this will fix the remaining issues I was seeing with the Dataset Shares View - to test once more and report back any findings |
Final Testing in AWS Deployment:
Share Received (Inbox) - Testing Filters Show Correct Options and Work Filtering Shares
Share Sent (Outbox)
Dataset Shares View
|
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.
I think this PR is good to go! Looks great @dlpzx - approving now
Feature or Bugfix
Detail
Relates
Security
Please answer the questions below briefly where applicable, or write
N/A
. Based onOWASP 10.
fetching data from storage outside the application (e.g. a database, an S3 bucket)? -- Yes, it introduces a new GraphQL Query: listAllGroups
eval
or similar functions are used?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.