Skip to content

Commit

Permalink
Remove unused code, rename share path (#9843)
Browse files Browse the repository at this point in the history
* Remove unused code, rename share path
  • Loading branch information
AlexAndBear committed Oct 24, 2023
1 parent 9a5b8dc commit 8bb19c4
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 204 deletions.
7 changes: 7 additions & 0 deletions changelog/unreleased/bugfix-display-path-on-resources
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bugfix: Fix display path on resources

We've fixed a bug, where the display path of a resource was missing parts.
For example the respective space name or the folder name of a share.

https://github.com/owncloud/web/pull/9843

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Enhancement: Add editors to the application menu

We've added 'text-editor' and 'draw.io' to the application menu, so the user can easily
open those apps with a one-click approach.

https://github.com/owncloud/web/pull/9809
https://github.com/owncloud/web/pull/9843
https://github.com/owncloud/web/issues/9807
180 changes: 91 additions & 89 deletions packages/design-system/src/components/OcResource/OcResource.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
:full-path="resource.path"
:is-path-displayed="isPathDisplayed"
:is-extension-displayed="isExtensionDisplayed"
@click="$emit('clickFolder')"
/>
</oc-resource-link>
<div class="oc-resource-indicators">
Expand All @@ -65,7 +66,7 @@
:to="parentFolderLink"
:style="parentFolderStyle"
class="parent-folder"
@click.stop="$emit('parentFolderClicked')"
@click="$emit('clickParentFolder')"
>
<oc-icon v-bind="parentFolderLinkIconAttrs" />
<span class="text" v-text="parentFolderName" />
Expand Down Expand Up @@ -189,7 +190,7 @@ export default defineComponent({
default: true
}
},
emits: ['click', 'parentFolderClicked'],
emits: ['click', 'clickFolder', 'clickParentFolder'],
computed: {
parentFolderComponentType() {
return this.parentFolderLink !== null ? 'router-link' : 'span'
Expand Down Expand Up @@ -301,6 +302,7 @@ export default defineComponent({
a {
text-decoration: none;
}
a:hover,
a:focus {
outline-offset: 0;
Expand Down Expand Up @@ -345,94 +347,94 @@ export default defineComponent({
</style>

<docs>
```js
<template>
<div>
<oc-resource :resource="documents" parent-folder-link="parentFolderLink" class="oc-mb" />
<oc-resource :resource="notes" is-path-displayed="true" class="oc-mb" />
<oc-resource :resource="notes" is-resource-clickable="false" class="oc-mb" />
<oc-resource :resource="notes" :is-extension-displayed="false" class="oc-mb" />
<oc-resource :resource="forest" is-path-displayed="true" />
<oc-resource :resource="something" is-path-displayed="true" parent-folder-name="Example parent folder" />
</div>
</template>
<script>
export default {
computed: {
documents() {
return {
name: "Documents",
path: "/Documents",
indicators: [],
type: "folder",
isFolder: true
}
},
notes() {
return {
name: "notes.txt",
extension: "txt",
path: "Documents/notes.txt",
indicators: this.indicators,
type: "file",
isFolder: false
}
},
forest() {
return {
name: "forest-image-with-filename-with-a-lot-of-characters.jpg",
extension: "jpg",
path: "images/nature/forest-image-with-filename-with-a-lot-of-characters.jpg",
thumbnail: "https://picsum.photos/200/300",
indicators: [],
type: "file",
isFolder: false,
opensInNewWindow: true,
}
},
something() {
return {
name: "another-image.jpg",
extension: "jpg",
path: "another-image.jpg",
thumbnail: "https://picsum.photos/200/300",
indicators: [],
type: "file",
isFolder: false,
opensInNewWindow: true,
```js
<template>
<div>
<oc-resource :resource="documents" parent-folder-link="parentFolderLink" class="oc-mb"/>
<oc-resource :resource="notes" is-path-displayed="true" class="oc-mb"/>
<oc-resource :resource="notes" is-resource-clickable="false" class="oc-mb"/>
<oc-resource :resource="notes" :is-extension-displayed="false" class="oc-mb"/>
<oc-resource :resource="forest" is-path-displayed="true"/>
<oc-resource :resource="something" is-path-displayed="true" parent-folder-name="Example parent folder"/>
</div>
</template>
<script>
export default {
computed: {
documents() {
return {
name: "Documents",
path: "/Documents",
indicators: [],
type: "folder",
isFolder: true
}
},
notes() {
return {
name: "notes.txt",
extension: "txt",
path: "Documents/notes.txt",
indicators: this.indicators,
type: "file",
isFolder: false
}
},
forest() {
return {
name: "forest-image-with-filename-with-a-lot-of-characters.jpg",
extension: "jpg",
path: "images/nature/forest-image-with-filename-with-a-lot-of-characters.jpg",
thumbnail: "https://picsum.photos/200/300",
indicators: [],
type: "file",
isFolder: false,
opensInNewWindow: true,
}
},
something() {
return {
name: "another-image.jpg",
extension: "jpg",
path: "another-image.jpg",
thumbnail: "https://picsum.photos/200/300",
indicators: [],
type: "file",
isFolder: false,
opensInNewWindow: true,
}
},
indicators() {
return [
{
id: 'files-sharing',
label: "Shared with other people",
visible: true,
icon: 'group',
handler: (resource, indicatorId) => alert(`Resource: ${resource.name}, indicator: ${indicatorId}`)
},
{
id: 'file-link',
label: "Shared via link",
visible: true,
icon: 'link',
}
},
indicators() {
return [
{
id: 'files-sharing',
label: "Shared with other people",
visible: true,
icon: 'group',
handler: (resource, indicatorId) => alert(`Resource: ${resource.name}, indicator: ${indicatorId}`)
},
{
id: 'file-link',
label: "Shared via link",
visible: true,
icon: 'link',
}
]
},
parentFolderLink() {
return {
name: "home",
params: {
action: "copy",
item: 'Documents',
},
query: {
resource: "notes"
}
]
},
parentFolderLink() {
return {
name: "home",
params: {
action: "copy",
item: 'Documents',
},
query: {
resource: "notes"
}
}
},
}
</script>
```
}
},
}
</script>
```
</docs>
Loading

0 comments on commit 8bb19c4

Please sign in to comment.