Skip to content

Commit

Permalink
Hide empty project & section notes in export.
Browse files Browse the repository at this point in the history
  • Loading branch information
ltouroumov committed Oct 18, 2024
1 parent 086cf91 commit 7eb8b28
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="notes-build">
<div v-if="compact ? hasNotes : true" class="notes-build">
<div class="notes-build-header">
<div class="notes-build-title">Project Notes</div>
<AddNoteButton v-if="editable" @click="createNote(`build`, true)" />
Expand All @@ -16,14 +16,21 @@
</template>

<script setup lang="ts">
import AddNoteButton from '~/components/viewer/modal/notes/AddNoteButton.vue';
import { isNotEmpty } from 'ramda';
import AddNoteButton from '~/components/viewer/notes/AddNoteButton.vue';
import { useBuildNotes } from '~/composables/viewer/useBuildNotes';
const { globalNotes, createNote, removeNote } = useBuildNotes();
defineProps<{
editable: boolean;
compact: boolean;
}>();
const hasNotes = computed(() => {
return isNotEmpty(globalNotes.value);
});
</script>

<style scoped lang="scss">
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,23 @@
:obj="obj"
:editable="editable"
/>
<RowNote :pack-row="packRow" :editable="editable" />
<RowNote
:pack-row="packRow"
:editable="editable"
:compact="compact"
/>
</div>
</template>
<div class="notes-ruler"></div>
<GlobalNotes :editable="editable" />
<GlobalNotes :editable="editable" :compact="compact" />
</div>
</div>
</template>

<script setup lang="ts">
import { assoc, chain, filter, has, isEmpty } from 'ramda';
import RowNote from '~/components/viewer/modal/notes/RowNote.vue';
import RowNote from '~/components/viewer/notes/RowNote.vue';
import { type PackRow, useBackpack } from '~/composables/viewer/useBackpack';
import { useBuildNotes } from '~/composables/viewer/useBuildNotes';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="row-note">
<div v-if="compact ? hasNote : true" class="row-note">
<div class="row-note-header">
<span class="note-label">Section Notes</span>
<AddNoteButton v-if="!hasNote && editable" @click="createNote(noteId)" />
Expand Down Expand Up @@ -31,6 +31,7 @@ const {
const $props = defineProps<{
packRow: ProjectRow;
editable: boolean;
compact: boolean;
}>();
const noteId = computed(() => {
Expand Down

0 comments on commit 7eb8b28

Please sign in to comment.