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

Fix 'Shared via'-indicator for links #7479

Merged
merged 2 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/bugfix-shared-via-indicator-for-links
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: "Shared via"-indicator for links

We've fixed a bug where the "Shared via"-indicator would be empty or not be displayed at all for public links.

https://github.com/owncloud/web/issues/7478
https://github.com/owncloud/web/pull/7479
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,6 @@ export default defineComponent({
detailsTableLabel() {
return this.$gettext('Overview of the information about the selected file')
},
shareDateLabel() {
return this.$gettext('Shared')
},
sharedViaLabel() {
return this.$gettext('Shared via')
},
Expand All @@ -258,7 +255,7 @@ export default defineComponent({
this.showShares &&
!this.sharesTreeLoading &&
this.file.path !== this.sharedParentDir &&
this.sharedParentDir !== null
this.sharedParentDir
)
},
showShares() {
Expand Down Expand Up @@ -363,14 +360,17 @@ export default defineComponent({
if (sharePathParentOrCurrent === null) {
return
}
const userShares = this.sharesTree[sharePathParentOrCurrent]?.filter((s) =>
ShareTypes.containsAnyValue(ShareTypes.individuals, [s.shareType])
const shares = this.sharesTree[sharePathParentOrCurrent]?.filter((s) =>
ShareTypes.containsAnyValue(
[...ShareTypes.individuals, ...ShareTypes.unauthenticated],
JammingBen marked this conversation as resolved.
Show resolved Hide resolved
[s.shareType]
)
)
if (userShares.length === 0) {
if (shares.length === 0) {
return
}

this.sharedItem = userShares[0]
this.sharedItem = shares[0]
this.sharedByName = this.sharedItem.owner?.name
this.sharedByDisplayName = this.sharedItem.owner?.displayName
if (this.sharedItem.owner?.additionalInfo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ exports[`Details SideBar Panel displays a resource of type file on a private pag
<th scope="col" class="oc-pr-s">Last modified</th>
<td><span>ABSOLUTE_TIME</span></td>
</tr>
<tr data-testid="shared-via">
<th scope="col" class="oc-pr-s">Shared via</th>
<td>
<router-link-stub><span></span></router-link-stub>
</td>
</tr>
<!---->
<!---->
<tr data-testid="ownerDisplayName">
<th scope="col" class="oc-pr-s">Owner</th>
Expand Down Expand Up @@ -59,12 +54,7 @@ exports[`Details SideBar Panel displays a resource of type file on a private pag
<th scope="col" class="oc-pr-s">Last modified</th>
<td><span>ABSOLUTE_TIME</span></td>
</tr>
<tr data-testid="shared-via">
<th scope="col" class="oc-pr-s">Shared via</th>
<td>
<router-link-stub><span>/Shares/123.png</span></router-link-stub>
</td>
</tr>
<!---->
<tr data-testid="shared-by">
<th scope="col" class="oc-pr-s">Shared by</th>
<td><span>Marie Curie</span></td>
Expand Down Expand Up @@ -139,12 +129,7 @@ exports[`Details SideBar Panel displays a resource of type file on a private pag
<th scope="col" class="oc-pr-s">Last modified</th>
<td><span>ABSOLUTE_TIME</span></td>
</tr>
<tr data-testid="shared-via">
<th scope="col" class="oc-pr-s">Shared via</th>
<td>
<router-link-stub><span></span></router-link-stub>
</td>
</tr>
<!---->
<!---->
<tr data-testid="ownerDisplayName">
<th scope="col" class="oc-pr-s">Owner</th>
Expand Down Expand Up @@ -180,12 +165,7 @@ exports[`Details SideBar Panel displays a resource of type file on a private pag
<th scope="col" class="oc-pr-s">Last modified</th>
<td><span>ABSOLUTE_TIME</span></td>
</tr>
<tr data-testid="shared-via">
<th scope="col" class="oc-pr-s">Shared via</th>
<td>
<router-link-stub><span></span></router-link-stub>
</td>
</tr>
<!---->
<!---->
<tr data-testid="ownerDisplayName">
<th scope="col" class="oc-pr-s">Owner</th>
Expand Down