Skip to content

Commit

Permalink
Indirect links should not be editable
Browse files Browse the repository at this point in the history
  • Loading branch information
lookacat committed May 16, 2022
1 parent ffca1c5 commit f81be30
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
>
<name-and-copy :link="link" />
<details-and-edit
v-if="!isLinkIndirect(link)"
:is-folder-share="highlightedFile.isFolder"
:link="link"
:modifiable="canEdit"
Expand All @@ -66,6 +67,10 @@
@updateLink="updatePublicLink"
@removePublicLink="deleteLinkConfirmation"
/>
<span v-else class="indirect-links-shared-via-folder">
<oc-icon name="folder-2" size="small" fill-type="line" class="oc-px-xs" />
<span>via {{ getIndirectLinkVia(link) }}</span>
</span>
</li>
</oc-list>
<div v-if="links.length > 3" class="oc-flex oc-flex-center">
Expand Down Expand Up @@ -301,7 +306,6 @@ export default defineComponent({
})
}
})
return allShares.sort(this.linksComparator)
},
Expand Down Expand Up @@ -341,6 +345,14 @@ export default defineComponent({
this.linkListCollapsed = !this.linkListCollapsed
},
isLinkIndirect(link) {
return this.indirectLinks.some((i) => i.token === link.token)
},
getIndirectLinkVia(link) {
return this.indirectLinks.find((i) => i.token === link.token).path
},
reloadLinks() {
this.loadCurrentFileOutgoingShares({
client: this.$client,
Expand Down Expand Up @@ -518,4 +530,9 @@ export default defineComponent({
background-color: var(--oc-color-input-bg);
border: 1px solid var(--oc-color-input-border);
}
.indirect-links-shared-via-folder {
display: flex;
align-items: center;
font-size: 14px;
}
</style>

0 comments on commit f81be30

Please sign in to comment.