Cleanup old code

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2020-04-29 11:23:08 +02:00
commit 669d341500
No known key found for this signature in database
GPG key ID: 60C25B8C072916CF
17 changed files with 14 additions and 443 deletions

View file

@ -35,6 +35,7 @@
<script>
import Avatar from '@nextcloud/vue/dist/Components/Avatar'
import { getCurrentUser } from '@nextcloud/auth'
export default {
components: {
@ -81,8 +82,8 @@ export default {
computedDisplayName() {
let value = this.displayName
if (this.userId === OC.getCurrentUser().uid) {
value = OC.getCurrentUser().displayName
if (this.userId === getCurrentUser().uid) {
value = getCurrentUser().displayName
} else {
if (!this.displayName) {
value = this.userId

View file

@ -1,52 +0,0 @@
<!--
- @copyright Copyright (c) 2018 René Gieling <github@dartcafe.de>
-
- @author René Gieling <github@dartcafe.de>
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-->
<template>
<li>
<div>{{ option.timestamp | localFullDate }}</div>
<div>
<a class="icon-delete" @click="$emit('remove')" />
</div>
</li>
</template>
<script>
import moment from '@nextcloud/moment'
export default {
filters: {
localFullDate(timestamp) {
if (!timestamp) return ''
if (!moment(timestamp).isValid()) return 'Invalid Date'
if (timestamp < 999999999999) timestamp = timestamp * 1000
return moment(timestamp).format('llll')
},
},
props: {
option: {
type: Object,
default: undefined,
},
},
}
</script>

View file

@ -1,86 +0,0 @@
<!--
-
-
- @author Nick Gallo
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-->
<template>
<li>
<div>{{ question.text }}</div>
<div>
<input v-show="(question.type != 'text') && (question.type != 'comment')"
v-model="newOption"
style="height:30px;"
:placeholder=" t('forms', 'Add Option')"
@keyup.enter="emitNewOption(question)">
<transitionGroup
id="form-list"
name="list"
tag="ul"
class="form-table">
<TextFormItem
v-for="(opt, index) in options"
:key="opt.id"
:option="opt"
@remove="emitRemoveOption(question, opt, index)" />
</transitionGroup>
</div>
<div>
<a class="icon icon-delete svg delete-form" @click="$emit('deleteQuestion')" />
</div>
</li>
</template>
<script>
import TextFormItem from './textFormItem'
export default {
components: {
TextFormItem,
},
props: {
question: {
type: Object,
default: undefined,
},
},
data() {
return {
nextOptionId: 1,
newOption: '',
type: '',
}
},
computed: {
options() {
return this.question.options || []
},
},
methods: {
emitNewOption(question) {
this.$emit('addOption', this, question)
},
emitRemoveOption(question, option, index) {
this.$emit('deleteOption', question, option, index)
},
},
}
</script>

View file

@ -62,10 +62,12 @@
</template>
<script>
import { generateUrl } from '@nextcloud/router'
import axios from '@nextcloud/axios'
import Multiselect from '@nextcloud/vue/dist/Components/Multiselect'
// TODO: replace with same design as core sharing
import UserDiv from './_base-UserDiv'
import axios from '@nextcloud/axios'
export default {
components: {
@ -129,7 +131,7 @@ export default {
loadUsersAsync(query) {
this.isLoading = false
this.siteUsersListOptions.query = query
axios.post(OC.generateUrl('apps/forms/get/siteusers'), this.siteUsersListOptions)
axios.post(generateUrl('apps/forms/get/siteusers'), this.siteUsersListOptions)
.then((response) => {
this.users = response.data.siteusers
this.isLoading = false

View file

@ -1,43 +0,0 @@
<!--
- @copyright Copyright (c) 2018 René Gieling <github@dartcafe.de>
-
- @author René Gieling <github@dartcafe.de>
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-->
<template>
<li>
<div>{{ option.text }}</div>
<div>
<a class="icon icon-delete svg delete-form" @click="$emit('remove')" />
</div>
</li>
</template>
<script>
export default {
props: {
option: {
type: Object,
default: undefined,
},
},
}
</script>