Skip to content

Commit 4d3054d

Browse files
authored
fix: some logos won't be shown in top bar (#2627)
1 parent da490fd commit 4d3054d

9 files changed

Lines changed: 12 additions & 29 deletions

File tree

packages/design-system/src/components/OcCard/OcCard.vue

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
<component :is="tag" class="oc-card">
33
<div v-if="hasSlotHeader" class="oc-card-header" :class="headerClass">
44
<slot name="header">
5-
<img
6-
v-if="logoUrl"
7-
:src="logoUrl"
8-
alt=""
9-
:aria-hidden="true"
10-
class="max-w-48 max-h-48 absolute -translate-y-16"
11-
/>
125
<component :is="titleTag" v-if="title" class="mt-0">
136
{{ title }}
147
</component>
@@ -41,11 +34,6 @@ export interface Props {
4134
* @default 'h2'
4235
*/
4336
titleTag?: string
44-
/**
45-
* @docs The url of the logo to be rendered in the header of this card.
46-
* @default ''
47-
*/
48-
logoUrl?: string
4937
/**
5038
* @docs The classes to be applied on the card header
5139
* @default ''
@@ -82,7 +70,6 @@ const {
8270
tag = 'div',
8371
title,
8472
titleTag = 'h2',
85-
logoUrl = '',
8673
headerClass = '',
8774
bodyClass = '',
8875
footerClass = ''
@@ -91,7 +78,7 @@ const {
9178
const slots = defineSlots<Slots>()
9279
9380
const hasSlotHeader = computed(() => {
94-
return Object.hasOwn(slots, 'header') || !!unref(title) || !!unref(logoUrl)
81+
return Object.hasOwn(slots, 'header') || !!unref(title)
9582
})
9683
const hasSlotFooter = computed(() => {
9784
return Object.hasOwn(slots, 'footer')

packages/web-pkg/tests/unit/components/FilesList/__snapshots__/ResourceTile.spec.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`OcTile component > renders default space correctly 1`] = `
4-
"<oc-card-stub tag="div" titletag="h2" logourl="" headerclass="" bodyclass="p-0" footerclass="" class="oc-tile-card flex flex-col h-full shadow-none [&amp;.item-accentuated]:bg-role-secondary-container bg-role-surface-container hover:bg-role-surface-container-highest outline outline-role-surface-container-highest" data-item-id="1">
4+
"<oc-card-stub tag="div" titletag="h2" headerclass="" bodyclass="p-0" footerclass="" class="oc-tile-card flex flex-col h-full shadow-none [&amp;.item-accentuated]:bg-role-secondary-container bg-role-surface-container hover:bg-role-surface-container-highest outline outline-role-surface-container-highest" data-item-id="1">
55
<resource-link-stub resource="[object Object]" isresourceclickable="true" class="oc-card-media-top flex justify-center items-center m-0 w-full relative aspect-[16/9]" tabindex="-1">
66
<div class="z-10 absolute top-0 left-0 [&amp;_input]:not-[.oc-checkbox-checked]:bg-role-surface-container"></div>
77
<!--v-if-->
@@ -26,7 +26,7 @@ exports[`OcTile component > renders default space correctly 1`] = `
2626
`;
2727

2828
exports[`OcTile component > renders disabled space correctly 1`] = `
29-
"<oc-card-stub tag="div" titletag="h2" logourl="" headerclass="" bodyclass="p-0" footerclass="" class="oc-tile-card flex flex-col h-full shadow-none [&amp;.item-accentuated]:bg-role-secondary-container bg-role-surface-container hover:bg-role-surface-container-highest outline outline-role-surface-container-highest oc-tile-card-disabled opacity-70 grayscale-60 pointer-events-none" data-item-id="1">
29+
"<oc-card-stub tag="div" titletag="h2" headerclass="" bodyclass="p-0" footerclass="" class="oc-tile-card flex flex-col h-full shadow-none [&amp;.item-accentuated]:bg-role-secondary-container bg-role-surface-container hover:bg-role-surface-container-highest outline outline-role-surface-container-highest oc-tile-card-disabled opacity-70 grayscale-60 pointer-events-none" data-item-id="1">
3030
<resource-link-stub resource="[object Object]" isresourceclickable="true" class="oc-card-media-top flex justify-center items-center m-0 w-full relative aspect-[16/9]" tabindex="-1">
3131
<div class="z-10 absolute top-0 left-0 [&amp;_input]:not-[.oc-checkbox-checked]:bg-role-surface-container"></div>
3232
<!--v-if-->

packages/web-runtime/src/components/Topbar/TopBar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<oc-image
1616
:src="currentTheme.logo"
1717
:alt="sidebarLogoAlt"
18-
class="oc-logo-image align-middle ml-1 max-h-[28px] select-none"
18+
class="oc-logo-image align-middle ml-1 h-[28px] w-auto select-none"
1919
/>
2020
</picture>
2121
</router-link>

packages/web-runtime/src/pages/accessDenied.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="h-screen flex flex-col justify-center items-center p-4">
3+
<img v-if="logoImg" :src="logoImg" alt="" :aria-hidden="true" class="max-w-48 max-h-48 mb-4" />
34
<oc-card
4-
:logo-url="logoImg"
55
:title="cardTitle"
66
body-class="text-center"
77
header-class="text-center"

packages/web-runtime/src/pages/logout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="h-screen flex flex-col justify-center items-center p-4">
3+
<img v-if="logoImg" :src="logoImg" alt="" :aria-hidden="true" class="max-w-48 max-h-48 mb-4" />
34
<oc-card
4-
:logo-url="logoImg"
55
:title="cardTitle"
66
body-class="text-center"
77
header-class="text-center"

packages/web-runtime/src/pages/missingOrInvalidConfig.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
class="bg-role-chrome h-dvh max-h-dvh overflow-y-hidden flex flex-col justify-center items-center p-4"
44
>
55
<h1 class="sr-only" v-text="$gettext('Error')" />
6+
<img v-if="logoImg" :src="logoImg" alt="" :aria-hidden="true" class="max-w-48 max-h-48 mb-4" />
67
<oc-card
7-
:logo-url="logoImg"
88
:title="$gettext('Missing or invalid config')"
99
body-class="text-center"
1010
header-class="text-center"

packages/web-runtime/src/pages/oidcCallback.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
<template>
22
<div class="h-screen flex flex-col justify-center items-center">
3-
<oc-card
4-
:logo-url="logoImg"
5-
:title="cardTitle"
6-
body-class="w-sm text-center"
7-
class="rounded-lg"
8-
>
3+
<img v-if="logoImg" :src="logoImg" alt="" :aria-hidden="true" class="max-w-48 max-h-48 mb-4" />
4+
<oc-card :title="cardTitle" body-class="w-sm text-center" class="rounded-lg">
95
<p v-text="cardHint" />
106
<template #footer>
117
<p v-text="footerSlogan" />

packages/web-runtime/src/pages/resolvePublicLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="oc-link-resolve h-screen flex flex-col justify-center items-center p-4">
3+
<img v-if="logoImg" :src="logoImg" alt="" :aria-hidden="true" class="max-w-48 max-h-48 mb-4" />
34
<oc-card
4-
:logo-url="logoImg"
55
:title="headerTitle"
66
body-class="text-center"
77
header-class="text-center"

packages/web-runtime/tests/unit/pages/__snapshots__/accessDenied.spec.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`access denied page > renders component 1`] = `
4-
"<div class="h-screen flex flex-col justify-center items-center p-4">
4+
"<div class="h-screen flex flex-col justify-center items-center p-4"><img src="themes/opencloud/assets/logo.svg" alt="" aria-hidden="true" class="max-w-48 max-h-48 mb-4">
55
<div class="oc-card w-full sm:w-sm rounded-lg">
6-
<div class="oc-card-header text-center"><img src="themes/opencloud/assets/logo.svg" alt="" aria-hidden="true" class="max-w-48 max-h-48 absolute -translate-y-16">
6+
<div class="oc-card-header text-center">
77
<h2 class="mt-0">Not logged in</h2>
88
</div>
99
<div class="oc-card-body text-center">

0 commit comments

Comments
 (0)