Skip to content
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
31 changes: 1 addition & 30 deletions packages/web-app-files/src/components/Spaces/SpaceHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,10 @@
}"
>
<text-editor
class="markdown-container-content w-full [&_#text-editor-preview-component]:!bg-transparent"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

bg-transparent is not needed here anymore, because I fixed that in den text-editor component styles in another PR.

class="markdown-container-content w-full"
is-read-only
:current-content="markdownContent"
/>
<div v-if="isEditReadmeVisible" class="markdown-container-edit ml-2">
<oc-button
type="router-link"
size="small"
:aria-label="$gettext('Edit description')"
appearance="raw"
class="p-1"
:to="editReadMeContentLink"
>
<oc-icon name="pencil" size="small" fill-type="line" />
</oc-button>
</div>
</div>
<div
v-if="showMarkdownCollapse && markdownContent"
Expand All @@ -123,11 +111,9 @@ import {
SideBarEventTopics,
TextEditor,
useClientService,
useFileActions,
useLoadPreview,
useResourcesStore,
useSharesStore,
useSpaceActionsEditReadmeContent,
useSpacesStore
} from '@opencloud-eu/web-pkg'
import SpaceContextActions from './SpaceContextActions.vue'
Expand All @@ -147,16 +133,10 @@ const { $gettext, $ngettext } = language
const clientService = useClientService()
const { getFileContents, getFileInfo } = clientService.webdav
const resourcesStore = useResourcesStore()
const { getDefaultAction } = useFileActions()
const { loadPreview } = useLoadPreview()
const spacesStore = useSpacesStore()
const sharesStore = useSharesStore()
const { imagesLoading, readmesLoading } = storeToRefs(spacesStore)
const { actions: editReadmeContentActions } = useSpaceActionsEditReadmeContent()

const isEditReadmeVisible = computed(() =>
unref(editReadmeContentActions)[0].isVisible({ resources: [space] })
)

const isMobileWidth = inject<Ref<boolean>>('isMobileWidth')

Expand Down Expand Up @@ -280,15 +260,6 @@ watch(
const imageContent = ref<string>(null)
const imageExpanded = ref(false)

const editReadMeContentLink = computed(() => {
const action = getDefaultAction({ resources: [unref(markdownResource)], space })

if (!action.route) {
return null
}

return action.route({ space, resources: [unref(markdownResource)] })
})
const toggleImageExpanded = () => {
imageExpanded.value = !unref(imageExpanded)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ exports[`SpaceHeader > space description > should show the description 1`] = `
<!--v-if-->
<div class="markdown-container flex min-h-0 [&amp;.collapsed]:max-h-[150px] [&amp;.collapsed]:overflow-hidden collapsed">
<!---->
<div class="markdown-container-edit ml-2"><a attrs="[object Object]" aria-label="Edit description" class="oc-button-secondary oc-button-raw oc-button-secondary-raw gap-2 justify-center text-sm min-h-3 oc-button cursor-pointer disabled:opacity-60 disabled:cursor-default p-1"></a></div>
</div>
<!--v-if-->
</div>
Expand Down