Skip to content
Open
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
2 changes: 2 additions & 0 deletions server/mergin/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class Configuration(object):
MERGIN_BASE_URL = config("MERGIN_BASE_URL", default="")
# for link to logo in emails
MERGIN_LOGO_URL = config("MERGIN_LOGO_URL", default="")
# for link to logos in EE branding ../web-app/packages/lib/src/assets/mm-logo.png
DASHBOARD_LOGO_URL = config("DASHBOARD_LOGO_URL", default="")

MERGIN_SUBSCRIPTIONS = config("MERGIN_SUBSCRIPTIONS", default=False, cast=bool)
MERGIN_TESTING = config("MERGIN_TESTING", default=False, cast=bool)
Expand Down
34 changes: 32 additions & 2 deletions web-app/packages/lib/src/common/components/AppOnboardingPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@
{ 'onborading-page-logo': $slots.aside }
]"
>
<slot name="logo">
<img src="@/assets/mm-logo.svg" />
<template v-if="brandingLogoUrl && !customLogoLoadFailed">
<img
class="logo-image"
:src="brandingLogoUrl"
@error="onCustomLogoError"
alt="Not Found"
/>
</template>
<slot v-else name="logo">
<img class="logo-image" :src="defaultLogoUrl" alt="Not Found" />
</slot>
</aside>

Expand Down Expand Up @@ -45,12 +53,34 @@
</template>

<script setup lang="ts">
import { ref, computed } from 'vue'

Check warning on line 56 in web-app/packages/lib/src/common/components/AppOnboardingPage.vue

View workflow job for this annotation

GitHub Actions / JavaScript code convention check

There should be at least one empty line between import groups
import { useInstanceStore } from '@/modules/instance/store'
import defaultLogoUrl from '@/assets/mm-logo.svg'

Check warning on line 58 in web-app/packages/lib/src/common/components/AppOnboardingPage.vue

View workflow job for this annotation

GitHub Actions / JavaScript code convention check

`@/assets/mm-logo.svg` import should occur before import of `@/modules/instance/store`

const customLogoLoadFailed = ref(false)
function onCustomLogoError(): void {
customLogoLoadFailed.value = true
}
const instanceStore = useInstanceStore()
const brandingLogoUrl = computed(
() => instanceStore.configData?.['dashboard_logo_url'] as string
)

withDefaults(defineProps<{ contentMaxWidth?: string }>(), {
contentMaxWidth: '480px'
})
</script>

<style scoped lang="scss">
.logo-image {
display: block;
width: auto;
height: 24px;
max-width: 129px;
max-height: 24px;
object-fit: contain;
}

@media screen and (min-width: $md) {
.onborading-page-logo {
// reset background on tablet > screens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@
/>
</div>

<div class="flex justify-content-center">
<img src="@/assets/mm-logo.svg" />
<div class="logo flex justify-content-center">
<img

Check warning on line 39 in web-app/packages/lib/src/modules/layout/components/SideBarTemplate.vue

View workflow job for this annotation

GitHub Actions / JavaScript code convention check

Delete `·`
class="logo-image"
:src="logoUrl"

Check warning on line 41 in web-app/packages/lib/src/modules/layout/components/SideBarTemplate.vue

View workflow job for this annotation

GitHub Actions / JavaScript code convention check

Delete `·`
@error="onCustomLogoError"

Check warning on line 42 in web-app/packages/lib/src/modules/layout/components/SideBarTemplate.vue

View workflow job for this annotation

GitHub Actions / JavaScript code convention check

Delete `·`
alt="Not Found"

Check warning on line 43 in web-app/packages/lib/src/modules/layout/components/SideBarTemplate.vue

View workflow job for this annotation

GitHub Actions / JavaScript code convention check

Delete `·`
/>

Check warning on line 44 in web-app/packages/lib/src/modules/layout/components/SideBarTemplate.vue

View workflow job for this annotation

GitHub Actions / JavaScript code convention check

Delete `⏎············`

</div>

<div
Expand Down Expand Up @@ -79,16 +85,33 @@
</template>

<script setup lang="ts">
import { computed } from 'vue'
import { ref, computed } from 'vue'
import { useRoute } from 'vue-router'

Check warning on line 89 in web-app/packages/lib/src/modules/layout/components/SideBarTemplate.vue

View workflow job for this annotation

GitHub Actions / JavaScript code convention check

There should be at least one empty line between import groups
import defaultLogoUrl from '@/assets/mm-logo.svg'

import { SideBarItemModel } from '../types'

import { DashboardRouteName, useUserStore } from '@/main'
import SideBarItem from '@/modules/layout/components/SideBarItem.vue'
import { useLayoutStore } from '@/modules/layout/store'
import { useInstanceStore } from '@/modules/instance/store'
import { ProjectRouteName } from '@/modules/project'


const customLogoLoadFailed = ref(false)
function onCustomLogoError(): void {
customLogoLoadFailed.value = true
}
const instanceStore = useInstanceStore()
const brandingLogoUrl = computed(
() => instanceStore.configData?.['dashboard_logo_url'] as string
)
const logoUrl = computed(() =>
brandingLogoUrl.value && !customLogoLoadFailed.value
? brandingLogoUrl.value
: defaultLogoUrl
)

const route = useRoute()
const layoutStore = useLayoutStore()
const userStore = useUserStore()
Expand Down Expand Up @@ -142,6 +165,18 @@
);
}
}
.logo {
max-width: 100%;

&-image {
display: block;
width: auto;
height: 24px;
max-width: 129px;
max-height: 24px;
object-fit: contain;
}
}

@media screen and (max-width: $xl) {
.sidebar {
Expand Down
Loading