-
Notifications
You must be signed in to change notification settings - Fork 6
feat: display the note parents structure #275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
73f4b36
feat: display the note parents structure
dependentmadani 6ba36ac
fix: lint and build errors
dependentmadani d9988fb
update: few modification of format function as well the docs
dependentmadani 7baf8f1
update (useNote): small modification in format function, and update i…
931460d
update: fix description of a doc
dependentmadani 441586d
update: few changes on how to display the note structure, still need …
dependentmadani 04e849f
update (note parent strcuture): update the presentation form, logic a…
dependentmadani e78539c
update: changes based on the reviews, make things work as it should
dependentmadani bf9de74
feat(breadcrumbs): component for note parents navigation
TheGeniusOfEternity 34f9439
Merge branch 'main' into feat/note-parents
TheGeniusOfEternity 9fa2f8f
feat(breadcrumbs): replace > with icon & improved displayed parents d…
TheGeniusOfEternity 77cbde7
fix(docs): correct computed var description
TheGeniusOfEternity f4d6f66
fix(note): return last edit info to the right side
TheGeniusOfEternity File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,4 +25,9 @@ export interface NoteDTO { | |
| * Editor tools | ||
| */ | ||
| tools: EditorTool[]; | ||
|
|
||
| /** | ||
| * Note parents | ||
| */ | ||
| parents: Note[]; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| <template> | ||
| <RouterLink | ||
| v-for="(parent, index) in displayedParents" | ||
| :key="index" | ||
| :to="{ path: parent.id ? `/note/${parent.id}` : '' }" | ||
| class="breadcrumb" | ||
| > | ||
| {{ parent.content ? getTitle(parent.content) : '...' }} | ||
| <Icon | ||
| v-if="index < displayedParents.length - 1" | ||
| name="ChevronRight" | ||
| /> | ||
| </RouterLink> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
|
|
||
| import { getTitle } from '@/infrastructure/utils/note.ts'; | ||
| import { RouterLink } from 'vue-router'; | ||
| import { computed } from 'vue'; | ||
| import { Note } from '@/domain/entities/Note.ts'; | ||
| import { Icon } from '@codexteam/ui/vue'; | ||
|
|
||
| const props = defineProps<{ | ||
| noteParents: Note[]; | ||
| }>(); | ||
| /** | ||
| * Note parents hierarchy | ||
| * If there are more than 3, only the closest & the furthest ones are shown | ||
| */ | ||
| const displayedParents = computed(() => { | ||
| if (props.noteParents.length > 3) { | ||
| return [ | ||
| props.noteParents[0], | ||
| { id: '', | ||
| content: null }, | ||
| props.noteParents[props.noteParents.length - 1], | ||
| ]; | ||
| } | ||
|
|
||
| return props.noteParents; | ||
| }); | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .breadcrumb { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| } | ||
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.