Eslint fix
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
b4fb52eb54
commit
2f4543e708
|
@ -28,7 +28,7 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name: 'App'
|
||||
name: 'App',
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -55,17 +55,17 @@ export default {
|
|||
props: {
|
||||
options: {
|
||||
type: Object,
|
||||
default: undefined
|
||||
}
|
||||
default: undefined,
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
computed: {
|
||||
expirationdate() {
|
||||
var date = moment(this.options.expirationDate, moment.localeData().longDateFormat('L')).fromNow()
|
||||
const date = moment(this.options.expirationDate, moment.localeData().longDateFormat('L')).fromNow()
|
||||
return date
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -48,19 +48,19 @@ export default {
|
|||
props: {
|
||||
intitle: {
|
||||
type: String,
|
||||
default: undefined
|
||||
}
|
||||
default: undefined,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imagePath: OC.imagePath('core', 'places/home.svg')
|
||||
imagePath: OC.imagePath('core', 'places/home.svg'),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
helpPage() {
|
||||
window.open('https://github.com/affan98/forms/blob/master/Forms_Support.md')
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -38,39 +38,39 @@ import Avatar from '@nextcloud/vue/dist/Components/Avatar'
|
|||
|
||||
export default {
|
||||
components: {
|
||||
Avatar
|
||||
Avatar,
|
||||
},
|
||||
props: {
|
||||
hideNames: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
default: false,
|
||||
},
|
||||
userId: {
|
||||
type: String,
|
||||
default: undefined
|
||||
default: undefined,
|
||||
},
|
||||
displayName: {
|
||||
type: String,
|
||||
default: ''
|
||||
default: '',
|
||||
},
|
||||
size: {
|
||||
type: Number,
|
||||
default: 32
|
||||
default: 32,
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'user'
|
||||
default: 'user',
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
default: '',
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
nothidden: false
|
||||
nothidden: false,
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -79,7 +79,7 @@ export default {
|
|||
return this.type !== 'user'
|
||||
},
|
||||
computedDisplayName() {
|
||||
var value = this.displayName
|
||||
let value = this.displayName
|
||||
|
||||
if (this.userId === OC.getCurrentUser().uid) {
|
||||
value = OC.getCurrentUser().displayName
|
||||
|
@ -92,9 +92,9 @@ export default {
|
|||
value = value + ' (' + t('forms', 'Group') + ')'
|
||||
}
|
||||
return value
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -39,14 +39,14 @@ export default {
|
|||
if (!moment(timestamp).isValid()) return 'Invalid Date'
|
||||
if (timestamp < 999999999999) timestamp = timestamp * 1000
|
||||
return moment(timestamp).format('llll')
|
||||
}
|
||||
},
|
||||
},
|
||||
props: {
|
||||
option: {
|
||||
type: Object,
|
||||
default: undefined
|
||||
}
|
||||
default: undefined,
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -128,18 +128,18 @@ export default {
|
|||
props: {
|
||||
header: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
default: false,
|
||||
},
|
||||
form: {
|
||||
type: Object,
|
||||
default: undefined
|
||||
}
|
||||
default: undefined,
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
openedMenu: false,
|
||||
hostName: this.$route.query.page
|
||||
hostName: this.$route.query.page,
|
||||
}
|
||||
|
||||
},
|
||||
|
@ -187,7 +187,7 @@ export default {
|
|||
|
||||
voteUrl() {
|
||||
return OC.generateUrl('apps/forms/form/') + this.form.event.hash
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
|
@ -219,8 +219,8 @@ export default {
|
|||
|
||||
viewResults() {
|
||||
this.$emit('viewResults')
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
|
|
@ -23,24 +23,23 @@
|
|||
<li>
|
||||
<div>{{ question.text }}</div>
|
||||
<div>
|
||||
<input v-show="(question.type != 'text') && (question.type != 'comment')" v-model="newQuizAnswer" style="height:30px;"
|
||||
<input v-show="(question.type != 'text') && (question.type != 'comment')"
|
||||
v-model="newQuizAnswer"
|
||||
style="height:30px;"
|
||||
:placeholder=" t('forms', 'Add Answer')"
|
||||
@keyup.enter="emitNewAnswer(question)"
|
||||
>
|
||||
@keyup.enter="emitNewAnswer(question)">
|
||||
<transitionGroup
|
||||
id="form-list"
|
||||
name="list"
|
||||
tag="ul"
|
||||
class="form-table"
|
||||
>
|
||||
class="form-table">
|
||||
<li
|
||||
is="text-form-item"
|
||||
v-for="(ans, index) in formQuizAnswers"
|
||||
:key="ans.id"
|
||||
:option="ans"
|
||||
@remove="emitRemoveAnswer(question, index)"
|
||||
@delete="question.answers.splice(index, 1)"
|
||||
/>
|
||||
@delete="question.answers.splice(index, 1)" />
|
||||
</transitionGroup>
|
||||
</div>
|
||||
<div>
|
||||
|
@ -53,21 +52,21 @@
|
|||
import TextFormItem from './textFormItem.vue'
|
||||
export default {
|
||||
components: {
|
||||
TextFormItem
|
||||
TextFormItem,
|
||||
},
|
||||
props: {
|
||||
question: {
|
||||
type: Object,
|
||||
default: undefined,
|
||||
answers: []
|
||||
}
|
||||
answers: [],
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formQuizAnswers: [],
|
||||
nextQuizAnswerId: 1,
|
||||
newQuizAnswer: '',
|
||||
type: ''
|
||||
type: '',
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -78,8 +77,8 @@ export default {
|
|||
|
||||
emitRemoveAnswer(question, id) {
|
||||
this.$emit('remove-answer', this, question, id)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
@ -78,22 +78,22 @@ export default {
|
|||
props: {
|
||||
header: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
default: false,
|
||||
},
|
||||
form: {
|
||||
type: Object,
|
||||
default: undefined
|
||||
default: undefined,
|
||||
},
|
||||
vote: {
|
||||
type: Object,
|
||||
default: undefined
|
||||
}
|
||||
default: undefined,
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
openedMenu: false,
|
||||
hostName: this.$route.query.page
|
||||
hostName: this.$route.query.page,
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -109,8 +109,8 @@ export default {
|
|||
},
|
||||
questionNum() {
|
||||
return this.vote.voteOptionId
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
|
|
@ -41,8 +41,7 @@
|
|||
label="displayName"
|
||||
track-by="user"
|
||||
@search-change="loadUsersAsync"
|
||||
@close="updateShares"
|
||||
>
|
||||
@close="updateShares">
|
||||
<template slot="selection" slot-scope="{ values, search, isOpen }">
|
||||
<span v-if="values.length && !isOpen" class="multiselect__single">
|
||||
{{ values.length }} users selected
|
||||
|
@ -52,9 +51,10 @@
|
|||
|
||||
<TransitionGroup :css="false" tag="ul" class="shared-list">
|
||||
<li v-for="(item, index) in sortedShares" :key="item.displayName" :data-index="index">
|
||||
<UserDiv :user-id="item.user" :display-name="item.displayName" :type="item.type"
|
||||
:hide-names="hideNames"
|
||||
/>
|
||||
<UserDiv :user-id="item.user"
|
||||
:display-name="item.displayName"
|
||||
:type="item.type"
|
||||
:hide-names="hideNames" />
|
||||
<div class="options">
|
||||
<a class="icon icon-delete svg delete-form" @click="removeShare(index, item)" />
|
||||
</div>
|
||||
|
@ -69,26 +69,26 @@ import axios from '@nextcloud/axios'
|
|||
|
||||
export default {
|
||||
components: {
|
||||
Multiselect
|
||||
Multiselect,
|
||||
},
|
||||
|
||||
props: {
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: ''
|
||||
default: '',
|
||||
},
|
||||
|
||||
activeShares: {
|
||||
type: Array,
|
||||
default: function() {
|
||||
return []
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
hideNames: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
|
@ -99,21 +99,21 @@ export default {
|
|||
siteUsersListOptions: {
|
||||
getUsers: true,
|
||||
getGroups: true,
|
||||
query: ''
|
||||
}
|
||||
query: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
sortedShares() {
|
||||
return this.shares.slice(0).sort(this.sortByDisplayname)
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
activeShares(value) {
|
||||
this.shares = value.slice(0)
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
@ -142,9 +142,9 @@ export default {
|
|||
if (a.displayName.toLowerCase() < b.displayName.toLowerCase()) return -1
|
||||
if (a.displayName.toLowerCase() > b.displayName.toLowerCase()) return 1
|
||||
return 0
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -22,9 +22,12 @@
|
|||
|
||||
<template>
|
||||
<div class="close flex-row">
|
||||
<a id="closeDetails" :title="closeDetailLabel" :alt="closeDetailLabelAlt"
|
||||
class="close icon-close has-tooltip-bottom" href="#" @:click="hideSidebar"
|
||||
/>
|
||||
<a id="closeDetails"
|
||||
:title="closeDetailLabel"
|
||||
:alt="closeDetailLabelAlt"
|
||||
class="close icon-close has-tooltip-bottom"
|
||||
href="#"
|
||||
@:click="hideSidebar" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -33,13 +36,13 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
closeDetailLabel: t('Close details'),
|
||||
closeDetailLabelAlt: t('Close')
|
||||
closeDetailLabelAlt: t('Close'),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hideSidebar() {
|
||||
OC.Apps.hideAppSidebar()
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -34,10 +34,10 @@ export default {
|
|||
props: {
|
||||
option: {
|
||||
type: Object,
|
||||
default: undefined
|
||||
}
|
||||
default: undefined,
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
@ -70,5 +70,5 @@ __webpack_public_path__ = OC.linkTo('forms', 'js/')
|
|||
new Vue({
|
||||
el: '#app-forms',
|
||||
router: router,
|
||||
render: h => h(App)
|
||||
render: h => h(App),
|
||||
})
|
||||
|
|
|
@ -31,7 +31,7 @@ export default {
|
|||
text: '',
|
||||
buttonHideText: 'Close',
|
||||
buttonConfirmText: 'OK',
|
||||
onConfirm: {}
|
||||
onConfirm: {},
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
|
@ -66,8 +66,8 @@ export default {
|
|||
this.buttonConfirmText = params.buttonConfirmText
|
||||
// setting callback function
|
||||
this.onConfirm = params.onConfirm
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
@ -22,9 +22,9 @@ const Modal = {
|
|||
// if we use this.$modal.show(params) inside our original Vue instance
|
||||
// we will emit 'show' event with parameters 'params'
|
||||
Modal.EventBus.$emit('show', params)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export default Modal
|
||||
|
|
|
@ -39,42 +39,42 @@ export default new Router({
|
|||
{
|
||||
path: '/:index(index.php/)?apps/forms/',
|
||||
components: {
|
||||
default: List
|
||||
default: List,
|
||||
},
|
||||
props: false,
|
||||
name: 'list'
|
||||
name: 'list',
|
||||
},
|
||||
{
|
||||
path: '/:index(index.php/)?apps/forms/edit/:hash',
|
||||
components: {
|
||||
default: Create
|
||||
default: Create,
|
||||
},
|
||||
props: true,
|
||||
name: 'edit'
|
||||
name: 'edit',
|
||||
},
|
||||
{
|
||||
path: '/:index(index.php/)?apps/forms/results/:hash',
|
||||
components: {
|
||||
default: Results
|
||||
default: Results,
|
||||
},
|
||||
props: false,
|
||||
name: 'results'
|
||||
name: 'results',
|
||||
},
|
||||
{
|
||||
path: '/:index(index.php/)?apps/forms/clone/:hash',
|
||||
components: {
|
||||
default: Create
|
||||
default: Create,
|
||||
},
|
||||
props: true,
|
||||
name: 'clone'
|
||||
name: 'clone',
|
||||
},
|
||||
{
|
||||
path: '/:index(index.php/)?apps/forms/new',
|
||||
components: {
|
||||
default: Create
|
||||
default: Create,
|
||||
},
|
||||
props: false,
|
||||
name: 'create'
|
||||
}
|
||||
]
|
||||
name: 'create',
|
||||
},
|
||||
],
|
||||
})
|
||||
|
|
|
@ -42,9 +42,10 @@
|
|||
<h2>{{ t('forms', 'Form description') }}</h2>
|
||||
|
||||
<label>{{ t('forms', 'Title') }}</label>
|
||||
<input id="formTitle" v-model="form.event.title" :class="{ error: titleEmpty }"
|
||||
type="text"
|
||||
>
|
||||
<input id="formTitle"
|
||||
v-model="form.event.title"
|
||||
:class="{ error: titleEmpty }"
|
||||
type="text">
|
||||
|
||||
<label>{{ t('forms', 'Description') }}</label>
|
||||
<textarea id="formDesc" v-model="form.event.description" style="resize: vertical; width: 100%;" />
|
||||
|
@ -65,8 +66,7 @@
|
|||
</select>
|
||||
<input v-model="newQuizQuestion" :placeholder=" t('forms', 'Add Question') " @keyup.enter="addQuestion()">
|
||||
<button id="questButton"
|
||||
@click="addQuestion()"
|
||||
>
|
||||
@click="addQuestion()">
|
||||
{{ t('forms', 'Add Question') }}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -76,8 +76,7 @@
|
|||
id="form-list"
|
||||
name="list"
|
||||
tag="ul"
|
||||
class="form-table"
|
||||
>
|
||||
class="form-table">
|
||||
<li
|
||||
is="quiz-form-item"
|
||||
v-for="(question, index) in form.options.formQuizQuestions"
|
||||
|
@ -86,8 +85,7 @@
|
|||
:type="question.type"
|
||||
@add-answer="addAnswer"
|
||||
@remove-answer="removeAnswer"
|
||||
@remove="form.options.formQuizQuestions.splice(index, 1)"
|
||||
/>
|
||||
@remove="form.options.formQuizQuestions.splice(index, 1)" />
|
||||
</transitionGroup>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -118,26 +116,35 @@
|
|||
{{ t('forms', 'Form configurations') }}
|
||||
</label>
|
||||
|
||||
<input id="anonymous" v-model="form.event.isAnonymous" :disabled="protect"
|
||||
type="checkbox" class="checkbox"
|
||||
>
|
||||
<input id="anonymous"
|
||||
v-model="form.event.isAnonymous"
|
||||
:disabled="protect"
|
||||
type="checkbox"
|
||||
class="checkbox">
|
||||
<label for="anonymous" class="title">
|
||||
{{ t('forms', 'Anonymous form') }}
|
||||
</label>
|
||||
|
||||
<input id="unique" v-model="form.event.unique" :disabled="form.event.access !== 'registered' || form.event.isAnonymous"
|
||||
type="checkbox" class="checkbox"
|
||||
>
|
||||
<input id="unique"
|
||||
v-model="form.event.unique"
|
||||
:disabled="form.event.access !== 'registered' || form.event.isAnonymous"
|
||||
type="checkbox"
|
||||
class="checkbox">
|
||||
<label for="unique" class="title">
|
||||
<span>{{ t('forms', 'Only allow one submission per user') }}</span>
|
||||
</label>
|
||||
|
||||
<input v-show="form.event.isAnonymous" id="trueAnonymous" v-model="form.event.fullAnonymous"
|
||||
:disabled="protect" type="checkbox" class="checkbox"
|
||||
>
|
||||
<input id="expiration" v-model="form.event.expiration" :disabled="protect"
|
||||
type="checkbox" class="checkbox"
|
||||
>
|
||||
<input v-show="form.event.isAnonymous"
|
||||
id="trueAnonymous"
|
||||
v-model="form.event.fullAnonymous"
|
||||
:disabled="protect"
|
||||
type="checkbox"
|
||||
class="checkbox">
|
||||
<input id="expiration"
|
||||
v-model="form.event.expiration"
|
||||
:disabled="protect"
|
||||
type="checkbox"
|
||||
class="checkbox">
|
||||
<label class="title" for="expiration">
|
||||
{{ t('forms', 'Expires') }}
|
||||
</label>
|
||||
|
@ -147,31 +154,39 @@
|
|||
v-bind="expirationDatePicker"
|
||||
:disabled="protect"
|
||||
:time-picker-options="{ start: '00:00', step: '00:05', end: '23:55' }"
|
||||
style="width:170px"
|
||||
/>
|
||||
style="width:170px" />
|
||||
</div>
|
||||
|
||||
<div class="configBox">
|
||||
<label class="title icon-user">
|
||||
{{ t('forms', 'Access') }}
|
||||
</label>
|
||||
<input id="private" v-model="form.event.access" :disabled="protect"
|
||||
type="radio" value="registered" class="radio"
|
||||
>
|
||||
<input id="private"
|
||||
v-model="form.event.access"
|
||||
:disabled="protect"
|
||||
type="radio"
|
||||
value="registered"
|
||||
class="radio">
|
||||
<label for="private" class="title">
|
||||
<div class="title icon-group" />
|
||||
<span>{{ t('forms', 'Registered users only') }}</span>
|
||||
</label>
|
||||
<input id="public" v-model="form.event.access" :disabled="protect"
|
||||
type="radio" value="public" class="radio"
|
||||
>
|
||||
<input id="public"
|
||||
v-model="form.event.access"
|
||||
:disabled="protect"
|
||||
type="radio"
|
||||
value="public"
|
||||
class="radio">
|
||||
<label for="public" class="title">
|
||||
<div class="title icon-link" />
|
||||
<span>{{ t('forms', 'Public access') }}</span>
|
||||
</label>
|
||||
<input id="select" v-model="form.event.access" :disabled="protect"
|
||||
type="radio" value="select" class="radio"
|
||||
>
|
||||
<input id="select"
|
||||
v-model="form.event.access"
|
||||
:disabled="protect"
|
||||
type="radio"
|
||||
value="select"
|
||||
class="radio">
|
||||
<label for="select" class="title">
|
||||
<div class="title icon-shared" />
|
||||
<span>{{ t('forms', 'Only shared') }}</span>
|
||||
|
@ -184,8 +199,7 @@
|
|||
:placeholder="t('forms', 'Name of user or group')"
|
||||
:hide-names="true"
|
||||
@update-shares="updateShares"
|
||||
@remove-share="removeShare"
|
||||
/>
|
||||
@remove-share="removeShare" />
|
||||
</side-bar>
|
||||
<loading-overlay v-if="loadingForm" />
|
||||
</div>
|
||||
|
@ -199,7 +213,7 @@ import axios from '@nextcloud/axios'
|
|||
export default {
|
||||
name: 'Create',
|
||||
components: {
|
||||
QuizFormItem
|
||||
QuizFormItem,
|
||||
},
|
||||
|
||||
data() {
|
||||
|
@ -207,7 +221,7 @@ export default {
|
|||
move: {
|
||||
step: 1,
|
||||
unit: 'week',
|
||||
units: ['minute', 'hour', 'day', 'week', 'month', 'year']
|
||||
units: ['minute', 'hour', 'day', 'week', 'month', 'year'],
|
||||
},
|
||||
form: {
|
||||
mode: 'create',
|
||||
|
@ -230,11 +244,11 @@ export default {
|
|||
expired: false,
|
||||
isAnonymous: false,
|
||||
fullAnonymous: false,
|
||||
owner: undefined
|
||||
owner: undefined,
|
||||
},
|
||||
options: {
|
||||
formQuizQuestions: []
|
||||
}
|
||||
formQuizQuestions: [],
|
||||
},
|
||||
},
|
||||
lang: '',
|
||||
locale: '',
|
||||
|
@ -260,8 +274,8 @@ export default {
|
|||
{ text: 'Checkboxes', value: 'checkbox' },
|
||||
{ text: 'Short Response', value: 'text' },
|
||||
{ text: 'Long Response', value: 'comment' },
|
||||
{ text: 'Drop Down', value: 'dropdown' }
|
||||
]
|
||||
{ text: 'Drop Down', value: 'dropdown' },
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -308,8 +322,8 @@ export default {
|
|||
timePickerOptions: {
|
||||
start: '00:00',
|
||||
step: '00:30',
|
||||
end: '23:30'
|
||||
}
|
||||
end: '23:30',
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -324,10 +338,10 @@ export default {
|
|||
timePickerOptions: {
|
||||
start: '00:00',
|
||||
step: '00:30',
|
||||
end: '23:30'
|
||||
}
|
||||
end: '23:30',
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
|
@ -335,7 +349,7 @@ export default {
|
|||
title() {
|
||||
// only used when the title changes after page load
|
||||
document.title = t('forms', 'Forms') + ' - ' + this.title
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
|
@ -409,7 +423,7 @@ export default {
|
|||
id: this.nextQuizQuestionId++,
|
||||
text: this.newQuizQuestion,
|
||||
type: this.selected,
|
||||
answers: []
|
||||
answers: [],
|
||||
})
|
||||
}
|
||||
this.newQuizQuestion = ''
|
||||
|
@ -438,11 +452,11 @@ export default {
|
|||
if (item.newQuizAnswer !== null & item.newQuizAnswer !== '' & (/\S/.test(item.newQuizAnswer))) {
|
||||
item.formQuizAnswers.push({
|
||||
id: item.nextQuizAnswerId,
|
||||
text: item.newQuizAnswer
|
||||
text: item.newQuizAnswer,
|
||||
})
|
||||
question.answers.push({
|
||||
id: item.nextQuizAnswerId,
|
||||
text: item.newQuizAnswer
|
||||
text: item.newQuizAnswer,
|
||||
})
|
||||
item.nextQuizAnswerId++
|
||||
}
|
||||
|
@ -530,8 +544,8 @@ export default {
|
|||
this.form.event.hash = ''
|
||||
this.loadingForm = false
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -42,20 +42,17 @@
|
|||
v-if="!noForms"
|
||||
name="list"
|
||||
tag="div"
|
||||
class="table"
|
||||
>
|
||||
class="table">
|
||||
<form-list-item
|
||||
key="0"
|
||||
:header="true"
|
||||
/>
|
||||
:header="true" />
|
||||
<li
|
||||
is="form-list-item"
|
||||
v-for="(form, index) in forms"
|
||||
:key="form.id"
|
||||
:form="form"
|
||||
@deleteForm="removeForm(index, form.event)"
|
||||
@viewResults="viewFormResults(index, form.event, 'results')"
|
||||
/>
|
||||
@viewResults="viewFormResults(index, form.event, 'results')" />
|
||||
</transition-group>
|
||||
<loading-overlay v-if="loading" />
|
||||
<modal-dialog />
|
||||
|
@ -71,14 +68,14 @@ export default {
|
|||
name: 'List',
|
||||
|
||||
components: {
|
||||
formListItem
|
||||
formListItem,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
noForms: false,
|
||||
loading: true,
|
||||
forms: []
|
||||
forms: [],
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -107,8 +104,8 @@ export default {
|
|||
this.$router.push({
|
||||
name: name,
|
||||
params: {
|
||||
hash: event.id
|
||||
}
|
||||
hash: event.id,
|
||||
},
|
||||
})
|
||||
},
|
||||
removeForm(index, event) {
|
||||
|
@ -129,12 +126,12 @@ export default {
|
|||
console.log(error.response)
|
||||
}
|
||||
)
|
||||
}
|
||||
},
|
||||
}
|
||||
this.$modal.show(params)
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -37,19 +37,16 @@
|
|||
<transition-group
|
||||
name="list"
|
||||
tag="div"
|
||||
class="table"
|
||||
>
|
||||
class="table">
|
||||
<resultItem
|
||||
key="0"
|
||||
:header="true"
|
||||
/>
|
||||
:header="true" />
|
||||
<li
|
||||
is="resultItem"
|
||||
v-for="(vote, index) in votes"
|
||||
:key="vote.id"
|
||||
:vote="vote"
|
||||
@viewResults="viewFormResults(index, form.event, 'results')"
|
||||
/>
|
||||
@viewResults="viewFormResults(index, form.event, 'results')" />
|
||||
</transition-group>
|
||||
<loading-overlay v-if="loading" />
|
||||
<modal-dialog />
|
||||
|
@ -68,13 +65,13 @@ export default {
|
|||
name: 'Results',
|
||||
|
||||
components: {
|
||||
resultItem
|
||||
resultItem,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
votes: []
|
||||
votes: [],
|
||||
|
||||
}
|
||||
},
|
||||
|
@ -83,9 +80,9 @@ export default {
|
|||
stats() {
|
||||
|
||||
if (this.votes != null) {
|
||||
var uniqueAns = []
|
||||
var uniqueQs = []
|
||||
var ansToQ = new Map()
|
||||
const uniqueAns = []
|
||||
const uniqueQs = []
|
||||
const ansToQ = new Map()
|
||||
for (let i = 0; i < this.votes.length; i++) {
|
||||
if (this.votes[i].voteOptionType === 'radiogroup' || this.votes[i].voteOptionType === 'dropdown') {
|
||||
if (uniqueAns.includes(this.votes[i].voteAnswer) === false) {
|
||||
|
@ -109,7 +106,7 @@ export default {
|
|||
}
|
||||
}
|
||||
return sums.sort()
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
|
@ -139,8 +136,8 @@ export default {
|
|||
this.$router.push({
|
||||
name: name,
|
||||
params: {
|
||||
hash: event.id
|
||||
}
|
||||
hash: event.id,
|
||||
},
|
||||
})
|
||||
},
|
||||
download() {
|
||||
|
@ -149,7 +146,7 @@ export default {
|
|||
axios.get(OC.generateUrl('apps/forms/get/event/' + this.$route.params.hash))
|
||||
.then((response) => {
|
||||
this.json2csvParser = ['userId', 'voteOptionId', 'voteOptionText', 'voteAnswer']
|
||||
var element = document.createElement('a')
|
||||
const element = document.createElement('a')
|
||||
element.setAttribute('href', 'data:text/csv;charset=utf-8,' + encodeURIComponent(json2csvParser.parse(this.votes)))
|
||||
element.setAttribute('download', response.data.title + '.csv')
|
||||
|
||||
|
@ -163,8 +160,8 @@ export default {
|
|||
console.log(error.response)
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in a new issue