Skip to content
This repository was archived by the owner on Nov 23, 2026. It is now read-only.

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

Merged
JammingBen merged 2 commits into
masterfrom
remove-share-prop-on-share-resources
Feb 6, 2024
Merged

JammingBen merged 2 commits into
masterfrom
remove-share-prop-on-share-resources

Conversation

@JammingBen

@JammingBen JammingBen commented Jan 31, 2024 •

Copy link
Copy Markdown
Contributor

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
@update-docs

update-docs Bot commented Jan 31, 2024

Copy link
Copy Markdown

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
Copy Markdown
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
30 of 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
@sonarqubecloud

sonarqubecloud Bot commented Feb 5, 2024

Copy link
Copy Markdown

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

@dschmidt dschmidt left a comment

Copy link
Copy Markdown
Member

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
@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants