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
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ describe('OcBreadcrumb', () => {
describe('mobile current folder', () => {
it.each([
{ items: [], shows: false },
{ items: [items[0]], shows: false },
{ items: [items[0], items[1]], shows: true }
])('shows if more than 1 breadcrumb item is given', ({ items, shows }) => {
const { wrapper } = getWrapper({ items })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,13 @@
</oc-button>
</nav>
<div
v-if="displayItems.length > 1"
class="oc-breadcrumb-mobile-current flex justify-center items-center w-0 flex-1"
v-if="displayItems.length"
class="oc-breadcrumb-mobile-current flex items-center w-0 flex-1"
:class="{
'sm:hidden': mobileBreakpoint === 'sm',
'md:hidden': mobileBreakpoint === 'md',
'lg:hidden': mobileBreakpoint === 'lg'
'lg:hidden': mobileBreakpoint === 'lg',
'justify-center': displayItems.length > 1
}"
>
<span class="truncate" aria-current="page" v-text="currentFolder.text" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports[`OcBreadcrumb > displays all items 1`] = `
</oc-button-stub>
</nav>

<div data-v-5914b352="" class="oc-breadcrumb-mobile-current flex justify-center items-center w-0 flex-1 sm:hidden"><span data-v-5914b352="" class="truncate" aria-current="page">Deeper ellipsize in responsive mode</span></div>"
<div data-v-5914b352="" class="oc-breadcrumb-mobile-current flex items-center w-0 flex-1 sm:hidden justify-center"><span data-v-5914b352="" class="truncate" aria-current="page">Deeper ellipsize in responsive mode</span></div>"
`;

exports[`OcBreadcrumb > sets correct variation 1`] = `
Expand Down Expand Up @@ -67,5 +67,5 @@ exports[`OcBreadcrumb > sets correct variation 1`] = `
</oc-button-stub>
</nav>

<div data-v-5914b352="" class="oc-breadcrumb-mobile-current flex justify-center items-center w-0 flex-1 sm:hidden"><span data-v-5914b352="" class="truncate" aria-current="page">Deeper ellipsize in responsive mode</span></div>"
<div data-v-5914b352="" class="oc-breadcrumb-mobile-current flex items-center w-0 flex-1 sm:hidden justify-center"><span data-v-5914b352="" class="truncate" aria-current="page">Deeper ellipsize in responsive mode</span></div>"
`;
57 changes: 19 additions & 38 deletions packages/web-app-admin-settings/src/views/General.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<div>
<app-template
ref="template"
:breadcrumbs="breadcrumbs"
:breadcrumbs="[
{
text: $gettext('General')
}
]"
:show-app-bar="false"
:is-side-bar-open="isSideBarOpen"
:side-bar-active-panel="sideBarActivePanel"
Expand All @@ -17,49 +21,26 @@
</div>
</template>

<script lang="ts">
import { ComponentPublicInstance, defineComponent, useTemplateRef } from 'vue'
<script setup lang="ts">
import { ComponentPublicInstance, useTemplateRef } from 'vue'
import AppTemplate from '../components/AppTemplate.vue'
import InfoSection from '../components/General/InfoSection.vue'
import DetailsPanel from '../components/General/SideBar/DetailsPanel.vue'
import { useGettext } from 'vue3-gettext'
import { useSideBar } from '@opencloud-eu/web-pkg'
export default defineComponent({
components: {
AppTemplate,
InfoSection
},
setup() {
const template = useTemplateRef<ComponentPublicInstance<typeof AppTemplate>>('template')
const { $gettext } = useGettext()
const sideBarAvailablePanels = [
{
name: 'DetailsPanel',
icon: 'settings-4',
title: () => $gettext('Details'),
component: DetailsPanel,
isRoot: () => true,
isVisible: () => true
}
]
const template = useTemplateRef<ComponentPublicInstance<typeof AppTemplate>>('template')
const { $gettext } = useGettext()
const { isSideBarOpen, sideBarActivePanel } = useSideBar()
return {
template,
sideBarAvailablePanels,
...useSideBar()
}
},
computed: {
breadcrumbs() {
return [
{ text: this.$gettext('Administration Settings'), to: { path: '/admin-settings' } },
{
text: this.$gettext('General')
}
]
}
const sideBarAvailablePanels = [
{
name: 'DetailsPanel',
icon: 'settings-4',
title: () => $gettext('Details'),
component: DetailsPanel,
isRoot: () => true,
isVisible: () => true
}
})
]
</script>
1 change: 0 additions & 1 deletion packages/web-app-admin-settings/src/views/Groups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ export default defineComponent({
computed: {
breadcrumbs() {
return [
{ text: this.$gettext('Administration Settings'), to: { path: '/admin-settings' } },
{
text: this.$gettext('Groups'),
onClick: () => {
Expand Down
1 change: 0 additions & 1 deletion packages/web-app-admin-settings/src/views/Spaces.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ const isLoading = computed(() => {
})

const breadcrumbs = computed(() => [
{ text: $gettext('Administration Settings'), to: { path: '/admin-settings' } },
{
text: $gettext('Spaces'),
onClick: () => {
Expand Down
1 change: 0 additions & 1 deletion packages/web-app-admin-settings/src/views/Users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,6 @@ export default defineComponent({
computed: {
breadcrumbs() {
return [
{ text: this.$gettext('Administration Settings'), to: { path: '/admin-settings' } },
{
text: this.$gettext('Users'),
onClick: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

exports[`General view > renders component 1`] = `
"<div>
<app-template-stub breadcrumbs="[object Object],[object Object]" issidebaropen="false" sidebaravailablepanels="[object Object]" sidebarpanelcontext="[object Object]" loading="false" sidebarloading="false" showviewoptions="false" showbatchactions="false" batchactionitems="" batchactions="" showappbar="false"></app-template-stub>
<app-template-stub breadcrumbs="[object Object]" issidebaropen="false" sidebaravailablepanels="[object Object]" sidebarpanelcontext="[object Object]" loading="false" sidebarloading="false" showviewoptions="false" showbatchactions="false" batchactionitems="" batchactions="" showappbar="false"></app-template-stub>
</div>"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`Spaces view > loading states > should render spaces list after loading
<div id="admin-settings-view-wrapper" class="flex-1 size-full flex-wrap overflow-y-auto">
<div id="admin-settings-app-bar" class="py-2 px-4 bg-role-surface top-0 z-20 sticky">
<div class="flex justify-between items-center h-13">
<oc-breadcrumb-stub items="[object Object],[object Object]" contextmenupadding="medium" id="admin-settings-breadcrumb" maxwidth="-1" mobilebreakpoint="sm" showcontextactions="false" truncationoffset="2" variation="default"></oc-breadcrumb-stub>
<oc-breadcrumb-stub items="[object Object]" contextmenupadding="medium" id="admin-settings-breadcrumb" maxwidth="-1" mobilebreakpoint="sm" showcontextactions="false" truncationoffset="2" variation="default"></oc-breadcrumb-stub>
<portal-target name="app.runtime.mobile.nav"></portal-target>
<div class="flex">
<view-options-stub perpagestorageprefix="admin-settings" hashiddenfiles="false" hasfileextensions="false" haspagination="true" paginationoptions="20,50,100,250" perpagequeryname="items-per-page" perpagedefault="50" viewmodedefault="resource-tiles" viewmodes=""></view-options-stub>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`Users view > list view > renders initially warning if filters are manda
<div id="admin-settings-view-wrapper" class="flex-1 size-full flex-wrap overflow-y-auto">
<div id="admin-settings-app-bar" class="py-2 px-4 bg-role-surface top-0 z-20 sticky">
<div class="flex justify-between items-center h-13">
<oc-breadcrumb-stub items="[object Object],[object Object]" contextmenupadding="medium" id="admin-settings-breadcrumb" maxwidth="-1" mobilebreakpoint="sm" showcontextactions="false" truncationoffset="2" variation="default"></oc-breadcrumb-stub>
<oc-breadcrumb-stub items="[object Object]" contextmenupadding="medium" id="admin-settings-breadcrumb" maxwidth="-1" mobilebreakpoint="sm" showcontextactions="false" truncationoffset="2" variation="default"></oc-breadcrumb-stub>
<portal-target name="app.runtime.mobile.nav"></portal-target>
<div class="flex">
<view-options-stub perpagestorageprefix="admin-settings" hashiddenfiles="false" hasfileextensions="false" haspagination="true" paginationoptions="20,50,100,250" perpagequeryname="items-per-page" perpagedefault="50" viewmodedefault="resource-tiles" viewmodes=""></view-options-stub>
Expand Down Expand Up @@ -67,7 +67,7 @@ exports[`Users view > list view > renders list initially 1`] = `
<div id="admin-settings-view-wrapper" class="flex-1 size-full flex-wrap overflow-y-auto">
<div id="admin-settings-app-bar" class="py-2 px-4 bg-role-surface top-0 z-20 sticky">
<div class="flex justify-between items-center h-13">
<oc-breadcrumb-stub items="[object Object],[object Object]" contextmenupadding="medium" id="admin-settings-breadcrumb" maxwidth="-1" mobilebreakpoint="sm" showcontextactions="false" truncationoffset="2" variation="default"></oc-breadcrumb-stub>
<oc-breadcrumb-stub items="[object Object]" contextmenupadding="medium" id="admin-settings-breadcrumb" maxwidth="-1" mobilebreakpoint="sm" showcontextactions="false" truncationoffset="2" variation="default"></oc-breadcrumb-stub>
<portal-target name="app.runtime.mobile.nav"></portal-target>
<div class="flex">
<view-options-stub perpagestorageprefix="admin-settings" hashiddenfiles="false" hasfileextensions="false" haspagination="true" paginationoptions="20,50,100,250" perpagequeryname="items-per-page" perpagedefault="50" viewmodedefault="resource-tiles" viewmodes=""></view-options-stub>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ vi.mock('@opencloud-eu/web-pkg', async (importOriginal) => ({
useLoadPreview: vi.fn().mockReturnValue({
loadPreview: vi.fn(() => 'blob:image')
}),
TextEditor: {
name: 'TextEditor',
props: ['isReadOnly', 'currentContent'],
template: '<div class="text-editor-stub" />'
}
TextEditor: vi.fn()
}))

vi.mock('@opencloud-eu/web-client', async (importOriginal) => ({
Expand Down Expand Up @@ -136,7 +132,8 @@ function getWrapper({
],
provide: { ...mocks, isMobileWidth: ref(isMobileWidth) },
stubs: {
'space-context-actions': true
'space-context-actions': true,
TextEditor: true
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ exports[`SpaceHeader > space description > should show the description 1`] = `
</div>
<!--v-if-->
<div class="markdown-container flex min-h-0 [&amp;.collapsed]:max-h-[150px] [&amp;.collapsed]:overflow-hidden collapsed">
<div class="text-editor-stub markdown-container-content w-full"></div>
<!---->
</div>
<!--v-if-->
</div>
Expand Down