-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#30] split note view in own views (one for edit one for creating new…
… one)
- Loading branch information
Showing
11 changed files
with
194 additions
and
112 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -98,7 +98,7 @@ | |
clearAfterSubmit: { | ||
type: Boolean, | ||
required: false, | ||
default: true | ||
default: false | ||
} | ||
}, | ||
data() { | ||
|
This file contains 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 |
---|---|---|
|
@@ -67,7 +67,7 @@ | |
clearAfterSubmit: { | ||
type: Boolean, | ||
required: false, | ||
default: true | ||
default: false | ||
} | ||
}, | ||
data() { | ||
|
This file contains 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 |
---|---|---|
|
@@ -38,7 +38,7 @@ | |
clearAfterSubmit: { | ||
type: Boolean, | ||
required: false, | ||
default: true | ||
default: false | ||
} | ||
}, | ||
data() { | ||
|
This file contains 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 |
---|---|---|
|
@@ -108,7 +108,7 @@ | |
clearAfterSubmit: { | ||
type: Boolean, | ||
required: false, | ||
default: true | ||
default: false | ||
} | ||
}, | ||
data() { | ||
|
This file contains 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 |
---|---|---|
|
@@ -218,7 +218,7 @@ | |
clearAfterSubmit: { | ||
type: Boolean, | ||
required: false, | ||
default: true | ||
default: false | ||
} | ||
}, | ||
data() { | ||
|
This file contains 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 |
---|---|---|
|
@@ -37,7 +37,7 @@ | |
clearAfterSubmit: { | ||
type: Boolean, | ||
required: false, | ||
default: true | ||
default: false | ||
} | ||
}, | ||
data() { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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,88 @@ | ||
<template> | ||
<v-container fluid> | ||
<v-card> | ||
<v-card-title> | ||
<span class="headline">{{$t('note.edit.title')}}</span> | ||
</v-card-title> | ||
<v-card-text> | ||
<NoteFormText form-id="note-edit-form" v-if="note.type === 'text'" :data="note" @onSubmit="onSaveNote" ></NoteFormText> | ||
<NoteFormReminder form-id="note-edit-form" v-if="note.type === 'reminder'" :data="note" @onSubmit="onSaveNote" ></NoteFormReminder> | ||
<NoteFormPicture form-id="note-edit-form" v-if="note.type === 'picture'" :data="note" @onSubmit="onSaveNote" ></NoteFormPicture> | ||
<NoteFormTemplate form-id="note-edit-form" v-if="note.type === 'template'" :data="note" @onSubmit="onSaveNote" ></NoteFormTemplate> | ||
<NoteFormCredentials form-id="note-edit-form" v-if="note.type === 'credentials'" :data="note" @onSubmit="onSaveNote" ></NoteFormCredentials> | ||
<NoteFormCamera form-id="note-edit-form" v-if="note.type === 'camera'" :data="note" @onSubmit="onSaveNote" ></NoteFormCamera> | ||
</v-card-text> | ||
<v-card-actions> | ||
<div class="flex-grow-1"></div> | ||
<v-btn color="error" @click="onAbort">{{$t('note.actions.abort')}}</v-btn> | ||
<v-btn color="primary" type="submit" form="note-edit-form">{{$t('note.actions.save')}}</v-btn> | ||
</v-card-actions> | ||
</v-card> | ||
</v-container> | ||
</template> | ||
|
||
<script> | ||
import { mapMutations } from 'vuex'; | ||
import NoteCardText from "../../../components/note/card/Text"; | ||
import NoteCardPicture from "../../../components/note/card/Picture"; | ||
import NoteFormText from "../../../components/note/form/Text"; | ||
import NoteFormPicture from "../../../components/note/form/Picture"; | ||
import NoteFormTemplate from "../../../components/note/form/Template"; | ||
import NoteCardTemplate from "../../../components/note/card/Template"; | ||
import HelpFirstSteps from "../../../components/help/FirstSteps"; | ||
import NoteOrderConfig from "../../../components/note/OrderConfig"; | ||
import NoteFormCredentials from "../../../components/note/form/Credentials"; | ||
import NoteCardCredentials from "../../../components/note/card/Credentials"; | ||
import NoteFormCamera from "../../../components/note/form/Camera"; | ||
import NoteCardCamera from "../../../components/note/card/Camera"; | ||
import NoteFormReminder from "../../../components/note/form/Reminder"; | ||
import NoteCardReminder from "../../../components/note/card/Reminder"; | ||
export default { | ||
components: { | ||
NoteCardReminder, | ||
NoteFormReminder, | ||
NoteOrderConfig, | ||
HelpFirstSteps, | ||
NoteCardTemplate, | ||
NoteFormTemplate, | ||
NoteCardText, | ||
NoteFormText, | ||
NoteCardPicture, | ||
NoteFormPicture, | ||
NoteCardCredentials, | ||
NoteFormCredentials, | ||
NoteCardCamera, | ||
NoteFormCamera | ||
}, | ||
data(){ | ||
return { | ||
snackbar: { | ||
saved: false, | ||
}, | ||
} | ||
}, | ||
computed: { | ||
note(){ | ||
return this.$store.getters['note/getNoteById'](this.$route.params.id) | ||
}, | ||
}, | ||
methods: { | ||
...mapMutations({ | ||
editNote: 'note/editNote', | ||
}), | ||
onAbort(){ | ||
this.$router.back() | ||
}, | ||
onSaveNote(note) { | ||
this.editNote({ | ||
id: this.note.id, | ||
type: this.note.type, | ||
...note, | ||
}) | ||
this.$router.back() | ||
} | ||
} | ||
} | ||
</script> |
Oops, something went wrong.