Skip to content
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

NestedFolders: Support Shared with me folder for showing items you've been granted access to #80141

Merged
merged 11 commits into from
Jan 15, 2024

Conversation

joshhunt
Copy link
Contributor

@joshhunt joshhunt commented Jan 8, 2024

Updates the Browse Dashboards UI with special presentation for the Shared with me pseudo-folder.

  • Use users-alt icon
  • Don't link to folder page
  • Render a divider after all sharedwithme children
    • Adds a new 'divider' UI tree item
    • Switch to VariableSizeList from react-window so the divider UI tree item can be rendered with a height of 0
Screenshot 2024-01-08 at 12 35 46 pm

Part of #78752

@joshhunt joshhunt requested a review from a team as a code owner January 8, 2024 12:36
@joshhunt joshhunt requested review from ashharrison90 and eledobleefe and removed request for a team January 8, 2024 12:36
@joshhunt

This comment was marked as outdated.

@joshhunt joshhunt marked this pull request as draft January 8, 2024 12:36
@grafana-delivery-bot grafana-delivery-bot bot added this to the 10.3.x milestone Jan 8, 2024
@ephemeral-instances-bot

This comment was marked as outdated.

Copy link
Contributor

@ashharrison90 ashharrison90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple of questions:

  • what happens when there's nothing in shared with me? does the section just not display at all?
  • looks like you're able to move/delete items in the shared with me section. what happens if you move an item in shared with me to one of your normal folders, does it disappear from shared with me and just appear in the normal part of the dashboard list?

@ephemeral-instances-bot

This comment was marked as outdated.

@joshhunt
Copy link
Contributor Author

joshhunt commented Jan 8, 2024

@ashharrison90

what happens when there's nothing in shared with me? does the section just not display at all?

From my observation, Shared with me does not display for admins (as they always will have access to everything?). For other users, it will always display even if it's empty.

Screenshot 2024-01-08 at 1 01 46 pm

looks like you're able to move/delete items in the shared with me section.

I think this is valid, at least as valid as it is everywhere else. The user may have permission to move or delete items in Shared with me, so we must display the options. The overall problem (not specific to shared with me) is that we don't get ACLs on children when listing, so we can't accurately show checkboxes in the list.

what happens if you move an item in shared with me to one of your normal folders, does it disappear from shared with me and just appear in the normal part of the dashboard list?

Yes - Shared with me only lists items that you don't have permission on it's immediate parent. If you move an item out of Shared with Me and into another folder that you have permission on, it'll no longer appear in Shared with Me.

@joshhunt

This comment was marked as outdated.

@ephemeral-instances-bot

This comment was marked as outdated.

@grafana-pr-automation grafana-pr-automation bot requested review from a team and oshirohugo and removed request for a team January 9, 2024 16:43
@ephemeral-instances-bot
Copy link

@grafana-pr-automation grafana-pr-automation bot requested review from a team and removed request for a team January 9, 2024 16:53
@joshhunt

This comment was marked as outdated.

@joshhunt joshhunt marked this pull request as ready for review January 9, 2024 16:54
@joshhunt joshhunt requested a review from a team as a code owner January 9, 2024 16:54
@ephemeral-instances-bot

This comment was marked as outdated.

@joshhunt joshhunt changed the title NestedFolders: Shared with me frontend UI NestedFolders: 'Shared with me' psuedo-folder Jan 9, 2024
@ephemeral-instances-bot

This comment was marked as outdated.

@joshhunt joshhunt changed the title NestedFolders: 'Shared with me' psuedo-folder NestedFolders: Add Shared with me folder for showing items you've been granted access to Jan 11, 2024
@joshhunt joshhunt force-pushed the joshhunt/shared-with-me-frontend branch from 6d6db50 to 316fc75 Compare January 11, 2024 12:16
@grafana-pr-automation grafana-pr-automation bot requested review from a team and removed request for a team January 12, 2024 17:21
Copy link
Contributor

@ashharrison90 ashharrison90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm, nice job 🥳

gonna tentatively approve, but there's some commented out code to remove and i just wanna redeploy the ephemeral instance and make sure nothing's borked itself in the refactors 😂

}
}

// export function getIconForItem(itemOrKind: string | DashboardViewItemWithUIItems, isOpen?: boolean): IconName {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented out code can go 💀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UGH 😭

@joshhunt
Copy link
Contributor Author

/deploy-to-hg

@ephemeral-instances-bot
Copy link

  • Preparing your instance. A comment containing your instance's url will be added to this PR when the instance is ready.
  • Your instance will be ready in ~10 minutes.
  • Check the GitHub actions tab to follow the workflow progress
  • Slack channel: #proj-ephemeral-hg-instances
  • Building instance with joshhunt/shared-with-me-frontend oss branch and main enterprise branch. How to choose a branch

@ephemeral-instances-bot
Copy link

@joshhunt joshhunt force-pushed the joshhunt/shared-with-me-frontend branch from 4838385 to c263ceb Compare January 15, 2024 10:39
@grafana-pr-automation grafana-pr-automation bot requested review from a team and removed request for a team January 15, 2024 10:44
@joshhunt joshhunt merged commit 94ec647 into main Jan 15, 2024
18 checks passed
@joshhunt joshhunt deleted the joshhunt/shared-with-me-frontend branch January 15, 2024 10:56
@grafana-delivery-bot grafana-delivery-bot bot modified the milestones: 10.3.x, 10.4.x Jan 15, 2024
s0lesurviv0r pushed a commit to s0lesurviv0r/grafana that referenced this pull request Feb 3, 2024
… been granted access to (grafana#80141)

* start shared with me frontend tweaks

* prevent linking to sharedwithme folder

* tests

* make divider take up 0 height

* Prevent sharedwithme from being selected

* test
git push

* pr feedback

* prevent setting url for sharedwithme

* split iconForItem/kind functions

* Hide sharedwithme in nested folder picker

* fix test fixture
@aangelisc aangelisc modified the milestones: 10.4.x, 10.4.0 Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants