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

refactor: remove aggregateResourceShares and share prop on share resources #10426

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

JammingBen
Copy link
Contributor

@JammingBen JammingBen commented Jan 31, 2024

Description

  • Removes aggregateResourceShares because we don't need it anymore. The proper way to build share resources is via buildIncomingShareResource and buildOutgoingShareResource.
  • Removes the share property on ShareResource because a) there is no need to expose the full share on a resource and b) a ShareResource can "hold" multiple shares, rendering that property basically useless.

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests
  • Documentation
  • Maintenance (e.g. dependency updates or tooling)

@JammingBen JammingBen self-assigned this Jan 31, 2024
Copy link

update-docs bot commented Jan 31, 2024

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

Comment on lines -123 to -126
const res = unref(resource)
if (isShareResource(res) && res.share?.role) {
return res.share.role.hasPermission(SharePermissions.update)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

File versions currently can't be loaded for shares (including files inside a shared folder), so this check is not needed at the moment. If needed later it should check the graph permissions instead.

@JammingBen JammingBen force-pushed the remove-share-prop-on-share-resources branch 2 times, most recently from c5c86f8 to 428af50 Compare January 31, 2024 11:07
@JammingBen JammingBen mentioned this pull request Jan 31, 2024
40 tasks
@delete-merged-branch delete-merged-branch bot deleted the branch master January 31, 2024 14:29
@JammingBen JammingBen changed the base branch from remove-share-status to master January 31, 2024 14:29
@JammingBen JammingBen marked this pull request as ready for review January 31, 2024 14:29
Removes the `share` property on `ShareResource` because a) there is no need to expose the full share on a resource and b) a `ShareResource` can "hold" multiple shares, rendering that property useless.
@JammingBen JammingBen force-pushed the remove-share-prop-on-share-resources branch from 428af50 to 28f4542 Compare February 5, 2024 08:25
Copy link

sonarcloud bot commented Feb 5, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

16 New issues
0 Security Hotspots
25.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Member

@dschmidt dschmidt left a comment

Choose a reason for hiding this comment

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

crazy 😍

@JammingBen JammingBen merged commit 19c9fe7 into master Feb 6, 2024
3 checks passed
@delete-merged-branch delete-merged-branch bot deleted the remove-share-prop-on-share-resources branch February 6, 2024 11:13
saw-jan added a commit that referenced this pull request Mar 4, 2024
saw-jan added a commit that referenced this pull request Mar 4, 2024
phil-davis added a commit that referenced this pull request Mar 5, 2024
[tests-only][full-ci][backport ] backport test codes from #10437 and #10426
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants