Skip to content

Commit 484149a

Browse files
authored
Merge pull request #596 from MerginMaps/head-project-request
Upgrade app banner to have rounded boundaries in footer
2 parents bae002a + 6f3004c commit 484149a

2 files changed

Lines changed: 30 additions & 14 deletions

File tree

server/mergin/sync/public_api_v2_controller.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ def get_project(id, files_at_version=None):
204204
"""Get project info. Include list of files at specific version if requested."""
205205
project = require_project_by_uuid(id, ProjectPermissions.Read, expose=False)
206206
data = ProjectSchemaV2().dump(project)
207+
207208
if files_at_version:
208209
pv = ProjectVersion.query.filter_by(
209210
project_id=project.id, name=ProjectVersion.from_v_name(files_at_version)

web-app/packages/lib/src/common/components/AppPanelToggleable.vue

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,40 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
3535

3636
<script lang="ts" setup>
3737
import { PanelProps } from 'primevue/panel'
38-
import { ref, computed } from 'vue'
38+
import { ref, computed, useSlots } from 'vue'
3939
4040
const props = defineProps<PanelProps>()
4141
const collapsed = ref(props.collapsed)
42+
const slots = useSlots()
4243
43-
const pt = computed(() => ({
44-
header: {
45-
class: [
46-
'surface-section border-none cursor-pointer',
47-
// Toggle border radius by open / closed panel
48-
collapsed.value ? 'border-round-2xl' : 'border-round-top-2xl',
49-
props.pt?.header?.class ?? 'p-4'
50-
],
51-
onclick: headerClick
52-
},
53-
content: {
54-
class: 'border-none border-round-bottom-2xl p-4 pt-0'
44+
const pt = computed(() => {
45+
const hasFooterSlot = Boolean(slots.footer)
46+
47+
return {
48+
header: {
49+
class: [
50+
'surface-section border-none cursor-pointer',
51+
// Toggle border radius by open / closed panel
52+
collapsed.value ? 'border-round-2xl' : 'border-round-top-2xl',
53+
props.pt?.header?.class ?? 'p-4'
54+
],
55+
onclick: headerClick
56+
},
57+
content: {
58+
class: [
59+
'border-none p-4 pt-0',
60+
hasFooterSlot ? '' : 'border-round-bottom-2xl'
61+
]
62+
},
63+
...(hasFooterSlot
64+
? {
65+
footer: {
66+
class: 'border-none border-round-bottom-2xl p-4 pt-0'
67+
}
68+
}
69+
: {})
5570
}
56-
}))
71+
})
5772
5873
function headerClick() {
5974
collapsed.value = !collapsed.value

0 commit comments

Comments
 (0)