add eslint working conf

This commit is contained in:
2020-04-29 21:05:38 +02:00
parent ffe8c167cb
commit ebb1c58f90
33 changed files with 866 additions and 846 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div class="p-4">
<div class="flex justify-between flex-center mb-4">
<router-link to="/memos/" class="btn">< Back</router-link>
<router-link to="/memos/" class="btn">Back</router-link>
<button @click="$router.back()" class="btn-alert">Cancel</button>
</div>
<form @submit.prevent="submitForm">
@@ -16,33 +16,34 @@
</template>
<script>
import InputField from "../../components/InputField";
import TextAreaField from "../../components/TextAreaField";
import InputField from '../../components/InputField'
import TextAreaField from '../../components/TextAreaField'
export default {
name: "MemoCreate",
components: {
InputField, TextAreaField
},
data: function () {
return {
form: {
'name': '',
'memo': '',
},
errors: null,
}
},
methods: {
submitForm: function () {
axios.post('/api/memos', this.form)
.then(response => {
this.$router.push(response.data.links.self)
})
.catch(errors => {
this.errors = errors.response.data.errors
})
}
export default {
name: 'MemoCreate',
components: {
InputField, TextAreaField
},
data: function () {
return {
form: {
'name': '',
'memo': '',
},
errors: null,
}
},
methods: {
submitForm: function () {
// eslint-disable-next-line no-undef
axios.post('/api/memos', this.form)
.then(response => {
this.$router.push(response.data.links.self)
})
.catch(errors => {
this.errors = errors.response.data.errors
})
}
}
}
</script>

View File

@@ -15,7 +15,7 @@
</div>
<div class="p-4">
<div class="flex justify-between mb-4">
<router-link :to="'/memos/' + this.$route.params.id" class="btn">< Back</router-link>
<router-link :to="'/memos/' + this.$route.params.id" class="btn">Back</router-link>
</div>
<form @submit.prevent="submitForm">
<InputField name="name" :data="form.name" label="Title" placeholder="Your Title" required @update:field="form.name = $event" :errors="errors" />
@@ -31,49 +31,51 @@
</template>
<script>
import InputField from "../../components/InputField";
import TextAreaField from "../../components/TextAreaField";
import UploadableImage from "../../components/UploadableImage";
import InputField from '../../components/InputField'
import TextAreaField from '../../components/TextAreaField'
import UploadableImage from '../../components/UploadableImage'
export default {
name: "MemoEdit",
components: {
InputField, TextAreaField, UploadableImage
},
data: function () {
return {
form: {
'name': '',
'memo': '',
'attributes': {}
},
errors: null,
loading: true,
}
},
methods: {
submitForm: function () {
axios.patch('/api/memos/' + this.$route.params.id, this.form)
.then(response => {
this.$router.push(response.data.links.self)
})
.catch(errors => {
this.errors = errors.response.data.errors
})
}
},
mounted() {
axios.get('/api/memos/' + this.$route.params.id)
export default {
name: 'MemoEdit',
components: {
InputField, TextAreaField, UploadableImage
},
data: function () {
return {
form: {
'name': '',
'memo': '',
'attributes': {}
},
errors: null,
loading: true,
}
},
methods: {
submitForm: function () {
// eslint-disable-next-line no-undef
axios.patch('/api/memos/' + this.$route.params.id, this.form)
.then(response => {
this.form = response.data.data
this.loading = false
this.$router.push(response.data.links.self)
})
.catch(error => {
this.loading = false
if (error.response.status === 404) {
this.$router.back()
}
.catch(errors => {
this.errors = errors.response.data.errors
})
}
},
mounted() {
// eslint-disable-next-line no-undef
axios.get('/api/memos/' + this.$route.params.id)
.then(response => {
this.form = response.data.data
this.loading = false
})
.catch(error => {
this.loading = false
if (error.response.status === 404) {
this.$router.back()
}
})
}
}
</script>

View File

@@ -1,7 +1,7 @@
<template>
<div class="p-4">
<div class="flex justify-between flex-center mb-4">
<a href="#" class="btn" @click="$router.back()">< Back</a>
<a href="#" class="btn" @click="$router.back()">Back</a>
<router-link :to="'/memos/create'" class="btn-primary">Add New Memo</router-link>
</div>
<Loader v-if="loading" />
@@ -25,29 +25,30 @@
</template>
<script>
import Loader from "../../components/Loader";
import Loader from '../../components/Loader'
export default {
name: "MemoIndex",
components: {
Loader
},
data: function () {
return {
loading: true,
memos: null,
}
},
mounted() {
axios.get('/api/memos')
.then(response => {
this.memos = response.data.data
this.loading = false
})
.catch(error => {
this.loading = false
console.log('Unable to fetch memos.')
})
export default {
name: 'MemoIndex',
components: {
Loader
},
data: function () {
return {
loading: true,
memos: null,
}
},
mounted() {
// eslint-disable-next-line no-undef
axios.get('/api/memos')
.then(response => {
this.memos = response.data.data
this.loading = false
})
.catch(() => {
this.loading = false
console.log('Unable to fetch memos.')
})
}
}
</script>

View File

@@ -18,7 +18,7 @@
/>
<div class="absolute flex flex-col justify-between w-full top-0 bottom-0">
<div class="flex items-center justify-between p-4">
<router-link to="/memos/" class="btn-secondary">< Back</router-link>
<router-link to="/memos/" class="btn-secondary">Back</router-link>
<div class="flex-middle">
<router-link :to="'/memos/' + memo.memo_id + '/edit'" class="btn-secondary mr-1" >Edit</router-link>
<a href="#" class="btn-alert" @click="modal = ! modal">Delete</a>
@@ -38,53 +38,55 @@
</template>
<script>
// import TagBox from "../Tag/TagBox";
import Loader from "../../components/Loader";
let MarkdownIt = require('markdown-it'),
md = new MarkdownIt()
.use(require('markdown-it-checkbox'));
// import TagBox from "../Tag/TagBox";
import Loader from '../../components/Loader'
let MarkdownIt = require('markdown-it'),
md = new MarkdownIt()
.use(require('markdown-it-checkbox'))
export default {
name: 'MemoShow',
components: {
Loader
// TagBox
},
data: function () {
return {
loading: true,
modal: false,
memo: null,
}
},
computed: {
memoMarkdown: function () {
return md.render(this.memo.memo)
}
},
mounted() {
axios.get('/api/memos/' + this.$route.params.id)
.then(response => {
this.memo = response.data.data
this.loading = false
export default {
name: 'MemoShow',
components: {
Loader
// TagBox
},
data: function () {
return {
loading: true,
modal: false,
memo: null,
}
},
computed: {
memoMarkdown: function () {
return md.render(this.memo.memo)
}
},
mounted() {
// eslint-disable-next-line no-undef
axios.get('/api/memos/' + this.$route.params.id)
.then(response => {
this.memo = response.data.data
this.loading = false
})
.catch(errorRes => {
this.loading = false
if (errorRes.response.status === 404) {
this.$router.push('/memos')
}
})
},
methods: {
destroy: function () {
// eslint-disable-next-line no-undef
axios.delete('/api/memos/' + this.$route.params.id)
.then(() => {
this.$router.push('/memos')
})
.catch(errorRes => {
this.loading = false
if (errorRes.response.status === 404) {
this.$router.push('/memos')
}
console.log('Internal Error, Unable to delete contact.' + errorRes)
})
},
methods: {
destroy: function () {
axios.delete('/api/memos/' + this.$route.params.id)
.then(response => {
this.$router.push('/memos')
})
.catch(errorRes => {
console.log('Internal Error, Unable to delete contact.' + errorRes)
})
}
}
}
}
</script>