Skip to content

Add Item user info property reporting whether it is shareable or not#83

Merged
claucambra merged 2 commits into
mainfrom
feature/report-display-shareable
May 30, 2025
Merged

Add Item user info property reporting whether it is shareable or not#83
claucambra merged 2 commits into
mainfrom
feature/report-display-shareable

Conversation

@claucambra
Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
@claucambra claucambra added this to the 3.0 milestone May 30, 2025
@claucambra claucambra requested a review from Copilot May 30, 2025 05:07
@claucambra claucambra self-assigned this May 30, 2025
@claucambra claucambra added the enhancement New feature or request label May 30, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new item user info property ("displayShare") to indicate if an item is shareable based on its permissions. Key changes include:

  • A new test in ItemPropertyTests.swift to confirm that displayShare is not set when an item is not shareable.
  • Updated logic in Item.swift to add the displayShare flag when the metadata permissions include "R" and the item is not a container.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Tests/NextcloudFileProviderKitTests/ItemPropertyTests/ItemPropertyTests.swift Introduces testItemUserInfoDisplayShare to validate non-shareable items do not get a displayShare property
Sources/NextcloudFileProviderKit/Item/Item.swift Updates userInfo property to conditionally add displayShare when the item is shareable
Comments suppressed due to low confidence (2)

Sources/NextcloudFileProviderKit/Item/Item.swift:208

  • [nitpick] Consider whether the key name 'displayShare' clearly expresses its purpose compared to other display keys; a more descriptive name may improve consistency and clarity across the codebase.
if metadata.permissions.uppercased().contains("R"), // Shareable

Tests/NextcloudFileProviderKitTests/ItemPropertyTests/ItemPropertyTests.swift:338

  • [nitpick] Consider adding a complementary test case that verifies displayShare is set to true when metadata.permissions includes 'R', ensuring that both negative and positive scenarios are covered.
XCTAssertNil(item.userInfo?["displayShare"])

@codecov
Copy link
Copy Markdown

codecov Bot commented May 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.58%. Comparing base (af9f484) to head (8cd22c1).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #83      +/-   ##
==========================================
+ Coverage   82.53%   82.58%   +0.04%     
==========================================
  Files          71       71              
  Lines       14603    14630      +27     
==========================================
+ Hits        12053    12082      +29     
+ Misses       2550     2548       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@claucambra claucambra merged commit 39c95f7 into main May 30, 2025
3 checks passed
@claucambra claucambra deleted the feature/report-display-shareable branch May 30, 2025 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants