Skip to content

Commit

Permalink
fix: hide section if there is no fields in it
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Sep 17, 2024
1 parent 6208ede commit 82d608b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/SectionFields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
v-for="field in _fields"
:key="field.label"
:class="[field.hidden && 'hidden']"
class="flex items-center gap-2 px-3 leading-5 first:mt-3"
class="section-field flex items-center gap-2 px-3 leading-5 first:mt-3"
>
<Tooltip :text="__(field.label)" :hoverDelay="1">
<div class="sm:w-[106px] w-36 shrink-0 truncate text-sm text-gray-600">
Expand Down
11 changes: 10 additions & 1 deletion frontend/src/pages/Deal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<div
v-for="(section, i) in fieldsLayout.data"
:key="section.label"
class="flex flex-col p-3"
class="section flex flex-col p-3"
:class="{ 'border-b': i !== fieldsLayout.data.length - 1 }"
>
<Section :is-opened="section.opened" :label="section.label">
Expand Down Expand Up @@ -705,3 +705,12 @@ function openEmailBox() {
activities.value.emailBox.show = true
}
</script>
<style scoped>
:deep(.section:has(.section-field.hidden)) {
display: none;
}
:deep(.section:has(.section-field:not(.hidden))) {
display: flex;
}
</style>

0 comments on commit 82d608b

Please sign in to comment.