Allow editing

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2020-03-23 13:25:12 +01:00
parent 1cba7bbb5a
commit fa20cda748
No known key found for this signature in database
GPG key ID: 60C25B8C072916CF
7 changed files with 95 additions and 42 deletions

73
package-lock.json generated
View file

@ -11324,6 +11324,79 @@
} }
} }
}, },
"url-loader": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/url-loader/-/url-loader-4.0.0.tgz",
"integrity": "sha512-sPsoBs8NkSJt9k/2zLUMDAf0rYaG00EtrFQpHRIphKrR6stGsO92LUJf/uUeQNKEoxqoJ4R4qDLqHl+AOEqolA==",
"dev": true,
"requires": {
"loader-utils": "^2.0.0",
"mime-types": "^2.1.26",
"schema-utils": "^2.6.5"
},
"dependencies": {
"ajv": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz",
"integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==",
"dev": true,
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"emojis-list": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
"integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
"dev": true
},
"fast-deep-equal": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
"dev": true
},
"json5": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.1.2.tgz",
"integrity": "sha512-MoUOQ4WdiN3yxhm7NEVJSJrieAo5hNSLQ5sj05OTRHPL9HOBy8u4Bu88jsC1jvqAdN+E1bJmsUcZH+1HQxliqQ==",
"dev": true,
"requires": {
"minimist": "^1.2.5"
}
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true
},
"schema-utils": {
"version": "2.6.5",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.6.5.tgz",
"integrity": "sha512-5KXuwKziQrTVHh8j/Uxz+QUbxkaLW9X/86NBlx/gnKgtsZA2GIVMUn17qWhRFwF8jdYb3Dig5hRO/W5mZqy6SQ==",
"dev": true,
"requires": {
"ajv": "^6.12.0",
"ajv-keywords": "^3.4.1"
}
}
}
},
"use": { "use": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",

View file

@ -163,16 +163,6 @@ export default {
} }
}, },
formType() {
if (this.form.event.type === 'textForm') {
// TRANSLATORS This means that this is the type of the form. Another type is a 'date form'.
return t('forms', 'Text form')
} else {
// TRANSLATORS This means that this is the type of the form. Another type is a 'text form'.
return t('forms', 'Text form')
}
},
timeSpanCreated() { timeSpanCreated() {
return moment(this.form.event.created, 'YYYY-MM-DD HH:mm') return moment(this.form.event.created, 'YYYY-MM-DD HH:mm')
}, },

View file

@ -23,6 +23,8 @@
import { generateFilePath } from '@nextcloud/router' import { generateFilePath } from '@nextcloud/router'
import { getRequestToken } from '@nextcloud/auth' import { getRequestToken } from '@nextcloud/auth'
import { translate, translatePlural } from '@nextcloud/l10n' import { translate, translatePlural } from '@nextcloud/l10n'
import '@nextcloud/dialogs/styles/toast.scss'
import Vue from 'vue' import Vue from 'vue'
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip' import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip'

View file

@ -27,16 +27,6 @@
<template> <template>
<AppContent> <AppContent>
<Controls :intitle="title">
<template slot="after">
<button :disabled="writingForm" class="button btn primary" @click="debounceWriteForm">
<span>{{ saveButtonTitle }}</span>
<span v-if="writingForm" class="icon-loading-small" />
</button>
<button class="button symbol icon-settings" @click="switchSidebar" />
</template>
</Controls>
<div class="workbench"> <div class="workbench">
<div> <div>
<h2>{{ t('forms', 'Form description') }}</h2> <h2>{{ t('forms', 'Form description') }}</h2>
@ -53,7 +43,7 @@
<div> <div>
<h2>{{ t('forms', 'Make a Form') }}</h2> <h2>{{ t('forms', 'Make a Form') }}</h2>
<div v-show="form.event.type === 'quizForm'" id="quiz-form-selector-text"> <div id="quiz-form-selector-text">
<!--shows inputs for question types: drop down box to select the type, text box for question, and button to add--> <!--shows inputs for question types: drop down box to select the type, text box for question, and button to add-->
<label for="ans-type">Answer Type: </label> <label for="ans-type">Answer Type: </label>
<select v-model="selected"> <select v-model="selected">
@ -64,7 +54,7 @@
{{ option.text }} {{ option.text }}
</option> </option>
</select> </select>
<input v-model="newQuizQuestion" :placeholder=" t('forms', 'Add Question') " @keyup.enter="addQuestion()"> <input v-model="newQuizQuestion" :placeholder="t('forms', 'Add Question')" @keyup.enter="addQuestion()">
<button id="questButton" <button id="questButton"
@click="addQuestion()"> @click="addQuestion()">
{{ t('forms', 'Add Question') }} {{ t('forms', 'Add Question') }}
@ -72,7 +62,6 @@
</div> </div>
<!--Transition group to list the already added questions (in the form of quizFormItems)--> <!--Transition group to list the already added questions (in the form of quizFormItems)-->
<transitionGroup <transitionGroup
v-show="form.mode == 'create'"
id="form-list" id="form-list"
name="list" name="list"
tag="ul" tag="ul"
@ -100,7 +89,6 @@ import debounce from 'debounce'
import AppContent from '@nextcloud/vue/dist/Components/AppContent' import AppContent from '@nextcloud/vue/dist/Components/AppContent'
import { showError, showSuccess } from '@nextcloud/dialogs' import { showError, showSuccess } from '@nextcloud/dialogs'
import Controls from '../components/_base-Controls'
import QuizFormItem from '../components/quizFormItem' import QuizFormItem from '../components/quizFormItem'
import ViewsMixin from '../mixins/ViewsMixin' import ViewsMixin from '../mixins/ViewsMixin'
@ -109,7 +97,6 @@ export default {
name: 'Create', name: 'Create',
components: { components: {
AppContent, AppContent,
Controls,
QuizFormItem, QuizFormItem,
}, },

View file

@ -8,48 +8,49 @@ module.exports = {
path: path.resolve(__dirname, './js'), path: path.resolve(__dirname, './js'),
publicPath: '/js/', publicPath: '/js/',
filename: 'forms.js', filename: 'forms.js',
chunkFilename: 'chunks/[name].js' chunkFilename: 'chunks/[name].js',
}, },
module: { module: {
rules: [ rules: [
{ {
test: /\.css$/, test: /\.css$/,
use: ['vue-style-loader', 'css-loader'] use: ['vue-style-loader', 'css-loader'],
}, },
{ {
test: /\.scss$/, test: /\.scss$/,
use: ['vue-style-loader', 'css-loader', 'sass-loader'] use: ['vue-style-loader', 'css-loader', 'sass-loader'],
}, },
{ {
test: /\.(js|vue)$/, test: /\.(js|vue)$/,
use: 'eslint-loader', use: 'eslint-loader',
exclude: /node_modules/, exclude: /node_modules/,
enforce: 'pre' enforce: 'pre',
}, },
{ {
test: /\.vue$/, test: /\.vue$/,
loader: 'vue-loader', loader: 'vue-loader',
exclude: /node_modules/ exclude: /node_modules/,
}, },
{ {
test: /\.js$/, test: /\.js$/,
loader: 'babel-loader', loader: 'babel-loader',
exclude: /node_modules/ exclude: /node_modules/,
}, },
{ {
test: /\.(png|jpg|gif|svg)$/, test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader', loader: 'url-loader',
options: { options: {
name: '[name].[ext]?[hash]' limit: 8192,
} },
} },
] ],
}, },
plugins: [ plugins: [
new VueLoaderPlugin(), new VueLoaderPlugin(),
new StyleLintPlugin() new StyleLintPlugin(),
], ],
resolve: { resolve: {
extensions: ['*', '.js', '.vue'] extensions: ['*', '.js', '.vue'],
} symlinks: false,
},
} }

View file

@ -7,7 +7,7 @@ module.exports = merge(common, {
devServer: { devServer: {
historyApiFallback: true, historyApiFallback: true,
noInfo: true, noInfo: true,
overlay: true overlay: true,
}, },
devtool: 'source-map' devtool: 'source-map',
}) })

View file

@ -3,5 +3,5 @@ const merge = require('webpack-merge')
const common = require('./webpack.common.js') const common = require('./webpack.common.js')
module.exports = merge(common, { module.exports = merge(common, {
mode: 'production' mode: 'production',
}) })