Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
feat(notes): crud tags + search (#30)
Browse files Browse the repository at this point in the history
Closes #22
  • Loading branch information
lauthieb authored Feb 10, 2018
1 parent 70c61d7 commit e4cc26d
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ <h2 class="text-red" v-if="displayDupError">Oh sorry, you can't have duplicated
</b-input>
</b-field>

<b-field v-if="!gistsSelected" horizontal label="Tags">
<b-taginput
v-model="note.tags"
maxtags="5">
</b-taginput>
</b-field>

<b-field v-if="gistsSelected" horizontal label="Visibility">
<b-select placeholder="Select a visibility" v-model="note.public">
<option :value="false">Secret</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
public: false,
updatedAt: null,
createdAt: null,
tags: []
},
files: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ <h2 class="text-red" v-if="displayDupError">Oh sorry, you can't have duplicated
</b-input>
</b-field>

<b-field v-if="!gistsSelected" horizontal label="Tags">
<b-taginput
v-model="note.tags"
maxtags="5">
</b-taginput>
</b-field>

<div class="note-file" v-for="file in files">
<b-field horizontal label="Name" grouped>
<b-input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
files: {},
updatedAt: null,
createdAt: null,
tags: []
},
files: [],
gistFiles: [],
Expand All @@ -36,7 +37,9 @@
this.$refs.noteDescription.focus();
} else {
this.$refs.noteName.focus();
this.note.tags = this.note.tags ? this.note.tags : [];
}
this.noteUpdated = {...this.note};
this.noteUpdated.files = {};
Object.keys(this.note.files).forEach((key, index) => {
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/notes-list/NotesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default {
el =>
item.name.toLowerCase().indexOf(el.toLowerCase()) > -1 ||
item.description.toLowerCase().indexOf(el.toLowerCase()) > -1 ||
(item.tags ? item.tags.some(tag => tag.toLowerCase().indexOf(el.toLowerCase()) > -1) : false) ||
Object.keys(item.files).some(
key =>
key.toLowerCase().indexOf(el.toLowerCase()) > -1 ||
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/components/notes-list/note-card/NoteCard.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ <h3 v-else>{{ note.name }}</h3>
</div>
<p v-if="!gistsSelected">{{note.description}}</p>

<b-tag type="is-dark" v-for="tag in note.tags" :data="tag"
:key="tag.text">{{tag}}</b-tag>

<div class="note-file" v-for="(value, key, index) in note.files">
<h4>{{value.name}}
<span class="note-file-small">({{value.language}})
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/components/notes-list/note-card/NoteCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,8 @@
.visibility-icon {
font-size: 16px;
}

.tag {
margin-bottom: 12px;
margin-right: 6px;
}

0 comments on commit e4cc26d

Please sign in to comment.