Merge pull request #71 from nextcloud/fix/environment/packages
Update configs and removed unused dependencies
This commit is contained in:
commit
64d11875d2
|
@ -2,12 +2,7 @@ module.exports = {
|
||||||
plugins: ['@babel/plugin-syntax-dynamic-import'],
|
plugins: ['@babel/plugin-syntax-dynamic-import'],
|
||||||
presets: [
|
presets: [
|
||||||
[
|
[
|
||||||
'@babel/preset-env',
|
'@babel/preset-env'
|
||||||
{
|
|
||||||
targets: {
|
|
||||||
browsers: ['last 2 versions', 'ie >= 11']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -5,6 +5,7 @@
|
||||||
build/
|
build/
|
||||||
css/*.map
|
css/*.map
|
||||||
js/*forms.*
|
js/*forms.*
|
||||||
|
js/chunks/
|
||||||
js/*.svg
|
js/*.svg
|
||||||
nbproject/
|
nbproject/
|
||||||
node_modules/
|
node_modules/
|
||||||
|
@ -19,3 +20,4 @@ yarn-error.log
|
||||||
*.sln
|
*.sln
|
||||||
*.suo
|
*.suo
|
||||||
.svn
|
.svn
|
||||||
|
vendor/
|
||||||
|
|
26
.stylelintrc.js
Normal file
26
.stylelintrc.js
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
module.exports = {
|
||||||
|
extends: 'stylelint-config-recommended-scss',
|
||||||
|
rules: {
|
||||||
|
indentation: 'tab',
|
||||||
|
'selector-type-no-unknown': null,
|
||||||
|
'number-leading-zero': null,
|
||||||
|
'rule-empty-line-before': [
|
||||||
|
'always',
|
||||||
|
{
|
||||||
|
ignore: ['after-comment', 'inside-block']
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'declaration-empty-line-before': [
|
||||||
|
'never',
|
||||||
|
{
|
||||||
|
ignore: ['after-declaration']
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'comment-empty-line-before': null,
|
||||||
|
'selector-type-case': null,
|
||||||
|
'selector-list-comma-newline-after': null,
|
||||||
|
'no-descending-specificity': null,
|
||||||
|
'string-quotes': 'single'
|
||||||
|
},
|
||||||
|
plugins: ['stylelint-scss']
|
||||||
|
}
|
52
Makefile
52
Makefile
|
@ -9,7 +9,6 @@
|
||||||
# * npm
|
# * npm
|
||||||
# * curl: used if phpunit and composer are not installed to fetch them from the web
|
# * curl: used if phpunit and composer are not installed to fetch them from the web
|
||||||
# * tar: for building the archive
|
# * tar: for building the archive
|
||||||
yarn_install=$(shell which yarn)
|
|
||||||
app_name=forms
|
app_name=forms
|
||||||
|
|
||||||
project_dir=$(CURDIR)
|
project_dir=$(CURDIR)
|
||||||
|
@ -21,17 +20,7 @@ appstore_package_name=$(appstore_build_dir)/$(app_name)
|
||||||
nc_cert_dir=$(HOME)/.nextcloud/certificates
|
nc_cert_dir=$(HOME)/.nextcloud/certificates
|
||||||
composer=$(shell which composer 2> /dev/null)
|
composer=$(shell which composer 2> /dev/null)
|
||||||
|
|
||||||
all: dev-setup appstore
|
all: dev-setup lint build-js-production test
|
||||||
|
|
||||||
# Dev environment setup
|
|
||||||
dev-setup: clean-dev npm-init composer
|
|
||||||
|
|
||||||
npm-init:
|
|
||||||
ifeq (,$(yarn_install))
|
|
||||||
npm install
|
|
||||||
else
|
|
||||||
yarn
|
|
||||||
endif
|
|
||||||
|
|
||||||
# a copy is fetched from the web
|
# a copy is fetched from the web
|
||||||
.PHONY: composer
|
.PHONY: composer
|
||||||
|
@ -48,28 +37,51 @@ else
|
||||||
composer update --prefer-dist
|
composer update --prefer-dist
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Lint
|
# Dev env management
|
||||||
|
dev-setup: clean clean-dev composer npm-init
|
||||||
|
|
||||||
|
npm-init:
|
||||||
|
npm install
|
||||||
|
|
||||||
|
npm-update:
|
||||||
|
npm update
|
||||||
|
|
||||||
|
# Building
|
||||||
|
build-js:
|
||||||
|
npm run dev
|
||||||
|
|
||||||
|
build-js-production:
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
watch-js:
|
||||||
|
npm run watch
|
||||||
|
|
||||||
|
# Linting
|
||||||
lint:
|
lint:
|
||||||
npm run lint
|
npm run lint
|
||||||
|
|
||||||
lint-fix:
|
lint-fix:
|
||||||
npm run lint:fix
|
npm run lint:fix
|
||||||
|
|
||||||
# Removes the appstore build and compiled js files
|
# Style linting
|
||||||
|
stylelint:
|
||||||
|
npm run stylelint
|
||||||
|
|
||||||
|
stylelint-fix:
|
||||||
|
npm run stylelint:fix
|
||||||
|
|
||||||
|
# Cleaning
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(build_dir)
|
rm -rf $(build_dir)
|
||||||
|
rm -rf js/chunks
|
||||||
rm -f js/forms.js
|
rm -f js/forms.js
|
||||||
rm -f js/forms.js.map
|
rm -f js/forms.js.map
|
||||||
|
|
||||||
clean-dev: clean
|
clean-dev:
|
||||||
rm -rf node_modules
|
rm -rf node_modules
|
||||||
rm -rf ./vendor
|
rm -rf vendor
|
||||||
|
|
||||||
# Build js
|
|
||||||
# Installs and updates the composer dependencies. If composer is not installed
|
|
||||||
build-js-production:
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
# Builds the source package for the app store, ignores php and js tests
|
# Builds the source package for the app store, ignores php and js tests
|
||||||
.PHONY: appstore
|
.PHONY: appstore
|
||||||
|
|
79
README.md
79
README.md
|
@ -6,59 +6,44 @@ Forms allows the creation of shareable forms, with multiple question types and p
|
||||||
**Note**: This app is tested with Apache2 webserver, MySQL database, and apt-get package manager. To use alternatives, replace the relevant commands with those of your technology. This document assumes that a working
|
**Note**: This app is tested with Apache2 webserver, MySQL database, and apt-get package manager. To use alternatives, replace the relevant commands with those of your technology. This document assumes that a working
|
||||||
NextCloud development environment has been installed. See https://docs.nextcloud.com/server/stable/developer_manual/general/devenv.html for help with this.
|
NextCloud development environment has been installed. See https://docs.nextcloud.com/server/stable/developer_manual/general/devenv.html for help with this.
|
||||||
|
|
||||||
## Installation
|
## Build the app
|
||||||
### Download the Forms Codebase
|
|
||||||
|
|
||||||
```sh
|
``` bash
|
||||||
$ cd /var/www/html/nextcloud/apps
|
# set up and build for production
|
||||||
$ git clone https://github.com/nextcloud/forms.git
|
make
|
||||||
|
|
||||||
|
# install dependencies
|
||||||
|
make dev-setup
|
||||||
|
|
||||||
|
# build for dev and watch changes
|
||||||
|
make watch-js
|
||||||
|
|
||||||
|
# build for dev
|
||||||
|
make build-js
|
||||||
|
|
||||||
|
# build for production with minification
|
||||||
|
make build-js-production
|
||||||
|
|
||||||
|
```
|
||||||
|
## Running tests
|
||||||
|
You can use the provided Makefile to run all tests by using:
|
||||||
|
|
||||||
|
_ps: only works if you're using php locally and have forms installed info your apps default folder_
|
||||||
|
|
||||||
|
```
|
||||||
|
make test
|
||||||
```
|
```
|
||||||
|
|
||||||
### Install Prerequisites and Dependencies
|
## :v: Code of conduct
|
||||||
#### Install NPM
|
|
||||||
```sh
|
|
||||||
$ apt-get npm
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Install Yarn
|
The Nextcloud community has core values that are shared between all members during conferences,
|
||||||
```sh
|
hackweeks and on all interactions in online platforms including [Github](https://github.com/nextcloud) and [Forums](https://help.nextcloud.com).
|
||||||
$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
If you contribute, participate or interact with this community, please respect [our shared values](https://nextcloud.com/code-of-conduct/). :relieved:
|
||||||
$ echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
|
||||||
$ apt update
|
|
||||||
$ apt install yarn
|
|
||||||
```
|
|
||||||
#### Update NodeJS
|
|
||||||
```sh
|
|
||||||
$ npm install -g n
|
|
||||||
$ n stable
|
|
||||||
```
|
|
||||||
### Build the App
|
|
||||||
```sh
|
|
||||||
$ cd /var/www/html/nextcloud/apps/forms
|
|
||||||
$ make all
|
|
||||||
```
|
|
||||||
|
|
||||||
### Start Webserver / Database
|
## :heart: How to create a pull request
|
||||||
```sh
|
|
||||||
$ service apache2 start
|
|
||||||
$ service mysql start
|
|
||||||
```
|
|
||||||
|
|
||||||
### Enable the App
|
This guide will help you get started:
|
||||||
- Open NextCloud in your browser of choice
|
- :dancer: :smile: [Opening a pull request](https://opensource.guide/how-to-contribute/#opening-a-pull-request)
|
||||||
- Click on the user icon in the top right of the screen, and select Apps from the drop down menu
|
|
||||||
- Find the Forms app in the list and click enable
|
|
||||||
- The app will now be fully functional! The forms icon will appear on the top toolbar of NextCloud after it has been enabled
|
|
||||||
|
|
||||||
|
|
||||||
### To Rebuild
|
|
||||||
```
|
|
||||||
$ cd /var/www/html/nextcloud/apps/forms
|
|
||||||
$ npm run build
|
|
||||||
$ service Apache2 restart
|
|
||||||
$ service mysql restart
|
|
||||||
```
|
|
||||||
Refresh the page in your browser to reflect the changes.
|
|
||||||
|
|
||||||
## Code Overview
|
## Code Overview
|
||||||
The following are the most important code files for development of the Forms App.
|
The following are the most important code files for development of the Forms App.
|
||||||
|
|
|
@ -10,22 +10,24 @@ $fg-unvoted: #f0db98;
|
||||||
$fg-yes: #49bc49;
|
$fg-yes: #49bc49;
|
||||||
|
|
||||||
// Icon definitions
|
// Icon definitions
|
||||||
@mixin icon-color($icon, $dir, $color, $version: 1, $core: false)
|
@include icon-black-white('app', 'forms', 2);
|
||||||
.icon-app {
|
|
||||||
@include icon-color('app','forms',$color-text-maxcontrast)
|
|
||||||
}
|
|
||||||
.icon-yes {
|
.icon-yes {
|
||||||
@include icon-color('checkmark','actions',$fg-yes,1,true)
|
@include icon-color('checkmark', 'actions', $fg-yes, 1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-comment-yes {
|
.icon-comment-yes {
|
||||||
@include icon-color('comment','actions',$fg-yes,1,true)
|
@include icon-color('comment', 'actions', $fg-yes, 1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-comment-no {
|
.icon-comment-no {
|
||||||
@include icon-color('comment','actions',$fg-no,1,true)
|
@include icon-color('comment', 'actions', $fg-no, 1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-no {
|
.icon-no {
|
||||||
@include icon-color('close','actions',$fg-no,1,true)
|
@include icon-color('close', 'actions', $fg-no, 1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-maybe {
|
.icon-maybe {
|
||||||
@include icon-color('maybe-vote-variant','forms',$fg-maybe)
|
@include icon-color('maybe-vote-variant', 'forms', $fg-maybe);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,10 +33,9 @@ h1 {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="text"] {
|
input[type='text'] {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#header {
|
#header {
|
||||||
#appmenu,.header-right, nav {
|
#appmenu,
|
||||||
display:none;
|
.header-right,
|
||||||
|
nav {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,29 +12,29 @@ $user-column-width: 265px;
|
||||||
border-left: 1px solid var(--color-border);
|
border-left: 1px solid var(--color-border);
|
||||||
transition: margin-right 300ms;
|
transition: margin-right 300ms;
|
||||||
z-index: 500;
|
z-index: 500;
|
||||||
> div, > ul {
|
> div,
|
||||||
|
> ul {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.authorRow {
|
||||||
.authorRow {
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.author {
|
.author {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
opacity: .5;
|
opacity: 0.5;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
&.external {
|
&.external {
|
||||||
margin-right: 33px;
|
margin-right: 33px;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
> input {
|
> input {
|
||||||
width: 100%
|
width: 100%;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.detailsView {
|
.detailsView {
|
||||||
z-index: 1000 !important;
|
z-index: 1000 !important;
|
||||||
.close.flex-row {
|
.close.flex-row {
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
@ -73,7 +73,6 @@ $user-column-width: 265px;
|
||||||
float: left;
|
float: left;
|
||||||
text-shadow: 1px 1px var(--color-box-shadow);
|
text-shadow: 1px 1px var(--color-box-shadow);
|
||||||
background-color: var(--color-loading-light);
|
background-color: var(--color-loading-light);
|
||||||
|
|
||||||
}
|
}
|
||||||
.open {
|
.open {
|
||||||
background-color: $fg-yes;
|
background-color: $fg-yes;
|
||||||
|
@ -102,17 +101,21 @@ $user-column-width: 265px;
|
||||||
}
|
}
|
||||||
|
|
||||||
> ul > li {
|
> ul > li {
|
||||||
&:focus, &:hover, &.active, a.selected {
|
&:focus,
|
||||||
&, > a {
|
&:hover,
|
||||||
|
&.active,
|
||||||
|
a.selected {
|
||||||
|
&,
|
||||||
|
> a {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
box-shadow: inset 4px 0 var(--color-primary);
|
box-shadow: inset 4px 0 var(--color-primary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> a[class*="icon-"],
|
> a[class*='icon-'],
|
||||||
> ul > li > a[class*="icon-"],
|
> ul > li > a[class*='icon-'],
|
||||||
> a[style*="background-image"],
|
> a[style*='background-image'],
|
||||||
> ul > li > a[style*="background-image"] {
|
> ul > li > a[style*='background-image'] {
|
||||||
padding-left: 44px;
|
padding-left: 44px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +158,7 @@ $user-column-width: 265px;
|
||||||
}
|
}
|
||||||
|
|
||||||
input.hasDatepicker {
|
input.hasDatepicker {
|
||||||
margin-left:17px;
|
margin-left: 17px;
|
||||||
}
|
}
|
||||||
&.oneline {
|
&.oneline {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -163,7 +166,6 @@ $user-column-width: 265px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#commentsTabView {
|
#commentsTabView {
|
||||||
|
|
||||||
.newCommentForm div.message:empty:before {
|
.newCommentForm div.message:empty:before {
|
||||||
content: attr(data-placeholder);
|
content: attr(data-placeholder);
|
||||||
color: grey;
|
color: grey;
|
||||||
|
@ -181,7 +183,7 @@ $user-column-width: 265px;
|
||||||
.date {
|
.date {
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 5px;
|
top: 5px;
|
||||||
opacity: .5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,7 +193,6 @@ $user-column-width: 265px;
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.new-comment {
|
.new-comment {
|
||||||
.submitComment {
|
.submitComment {
|
||||||
align-self: last baseline;
|
align-self: last baseline;
|
||||||
|
@ -200,7 +201,7 @@ $user-column-width: 265px;
|
||||||
padding: 7px 9px;
|
padding: 7px 9px;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
opacity: .3;
|
opacity: 0.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-loading-small {
|
.icon-loading-small {
|
||||||
|
@ -210,4 +211,4 @@ $user-column-width: 265px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sv-q-description{
|
.sv-q-description {
|
||||||
font-size: 420px;
|
font-size: 420px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sv_container{
|
.sv_container {
|
||||||
h3 {
|
h3 {
|
||||||
width: 400px;
|
width: 400px;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
|
@ -37,6 +37,7 @@
|
||||||
.sq-label {
|
.sq-label {
|
||||||
margin-left: 30px;
|
margin-left: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sq-item:nth-child(1) {
|
.sq-item:nth-child(1) {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
3651
package-lock.json
generated
3651
package-lock.json
generated
File diff suppressed because it is too large
Load diff
53
package.json
53
package.json
|
@ -58,11 +58,13 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "src/js/main.js",
|
"main": "src/js/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "webpack --config webpack.dev.js",
|
"build": "NODE_ENV=production webpack --progress --hide-modules --config webpack.prod.js",
|
||||||
"watch": "webpack --progress --watch --config src/webpack.dev.js",
|
"dev": "NODE_ENV=development webpack --progress --watch --config webpack.dev.js",
|
||||||
"build": "webpack --progress --hide-modules --config src/webpack.prod.js",
|
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.dev.js",
|
||||||
"lint": "eslint --ext .js,.vue src",
|
"lint": "eslint --ext .js,.vue src",
|
||||||
"lint:fix": "eslint --ext .js,.vue src --fix",
|
"lint:fix": "eslint --ext .js,.vue src --fix",
|
||||||
|
"stylelint": "stylelint src",
|
||||||
|
"stylelint:fix": "stylelint src --fix",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"test:coverage": "jest --coverage"
|
"test:coverage": "jest --coverage"
|
||||||
},
|
},
|
||||||
|
@ -71,17 +73,12 @@
|
||||||
"moment": "^2.23.0",
|
"moment": "^2.23.0",
|
||||||
"nextcloud-axios": "^0.2.1",
|
"nextcloud-axios": "^0.2.1",
|
||||||
"nextcloud-vue": "^0.12.3",
|
"nextcloud-vue": "^0.12.3",
|
||||||
"v-click-outside": "^2.0.2",
|
"vue": "^2.6.10",
|
||||||
"v-tooltip": "^2.0.0-rc.33",
|
|
||||||
"vue": "^2.6.8",
|
|
||||||
"vue-click-outside": "^1.0.7",
|
|
||||||
"vue-clipboard2": "^0.3.1",
|
"vue-clipboard2": "^0.3.1",
|
||||||
"vue-router": "^3.1.3"
|
"vue-router": "^3.1.3"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"> 1%",
|
"extends browserslist-config-nextcloud"
|
||||||
"last 2 versions",
|
|
||||||
"not ie <= 11"
|
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
|
@ -92,32 +89,30 @@
|
||||||
"@babel/preset-env": "^7.6.0",
|
"@babel/preset-env": "^7.6.0",
|
||||||
"babel-eslint": "^10.0.1",
|
"babel-eslint": "^10.0.1",
|
||||||
"babel-loader": "^8.0.4",
|
"babel-loader": "^8.0.4",
|
||||||
|
"browserslist-config-nextcloud": "0.0.1",
|
||||||
"css-loader": "^3.2.0",
|
"css-loader": "^3.2.0",
|
||||||
"eslint": "^5.14.1",
|
"eslint": "^5.16.0",
|
||||||
"eslint-config-standard": "^12.0.0",
|
"eslint-config-standard": "^12.0.0",
|
||||||
"eslint-friendly-formatter": "^4.0.1",
|
"eslint-import-resolver-webpack": "^0.11.1",
|
||||||
"eslint-loader": "^3.0.0",
|
"eslint-loader": "^3.0.0",
|
||||||
"eslint-plugin-import": "^2.16.0",
|
"eslint-plugin-import": "^2.18.2",
|
||||||
"eslint-plugin-node": "^10.0.0",
|
"eslint-plugin-nextcloud": "^0.3.0",
|
||||||
"eslint-plugin-promise": "^4.0.1",
|
"eslint-plugin-node": "^9.2.0",
|
||||||
"eslint-plugin-standard": "^4.0.0",
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
"eslint-plugin-vue": "^5.2.2",
|
"eslint-plugin-standard": "^4.0.1",
|
||||||
"extract-text-webpack-plugin": "^3.0.2",
|
"eslint-plugin-vue": "^5.2.3",
|
||||||
"file-loader": "^4.2.0",
|
"file-loader": "^4.2.0",
|
||||||
"mini-css-extract-plugin": "^0.8.0",
|
"node-sass": "^4.12.0",
|
||||||
"node-sass": "^4.11.0",
|
"sass-loader": "^7.3.1",
|
||||||
"prettier-eslint": "^9.0.0",
|
"stylelint": "^8.4.0",
|
||||||
"raw-loader": "^3.1.0",
|
"stylelint-config-recommended-scss": "^3.3.0",
|
||||||
"sass-loader": "^7.1.0",
|
|
||||||
"stylelint": "^10.1.0",
|
|
||||||
"stylelint-config-recommended-scss": "^3.2.0",
|
|
||||||
"stylelint-scss": "^3.10.1",
|
"stylelint-scss": "^3.10.1",
|
||||||
"stylelint-webpack-plugin": "^0.10.5",
|
"stylelint-webpack-plugin": "^0.10.5",
|
||||||
"vue-loader": "^15.7.0",
|
"vue-loader": "^15.7.1",
|
||||||
"vue-style-loader": "^4.1.1",
|
"vue-style-loader": "^4.1.1",
|
||||||
"vue-template-compiler": "^2.6.8",
|
"vue-template-compiler": "^2.6.10",
|
||||||
"webpack": "^4.31.0",
|
"webpack": "^4.39.3",
|
||||||
"webpack-cli": "^3.3.8",
|
"webpack-cli": "^3.3.8",
|
||||||
"webpack-merge": "^4.1.5"
|
"webpack-merge": "^4.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Multiselect } from 'nextcloud-vue'
|
import { Multiselect } from 'nextcloud-vue'
|
||||||
|
import axios from 'nextcloud-axios'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
@ -127,7 +128,7 @@ export default {
|
||||||
loadUsersAsync(query) {
|
loadUsersAsync(query) {
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
this.siteUsersListOptions.query = query
|
this.siteUsersListOptions.query = query
|
||||||
this.$http.post(OC.generateUrl('apps/forms/get/siteusers'), this.siteUsersListOptions)
|
axios.post(OC.generateUrl('apps/forms/get/siteusers'), this.siteUsersListOptions)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.users = response.data.siteusers
|
this.users = response.data.siteusers
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
|
|
|
@ -23,9 +23,7 @@
|
||||||
|
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
import axios from 'nextcloud-axios'
|
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import vClickOutside from 'v-click-outside'
|
|
||||||
import VueClipboard from 'vue-clipboard2'
|
import VueClipboard from 'vue-clipboard2'
|
||||||
|
|
||||||
import { DatetimePicker, PopoverMenu, Tooltip } from 'nextcloud-vue'
|
import { DatetimePicker, PopoverMenu, Tooltip } from 'nextcloud-vue'
|
||||||
|
@ -38,8 +36,6 @@ import SideBarClose from './components/sideBarClose'
|
||||||
import ShareDiv from './components/shareDiv'
|
import ShareDiv from './components/shareDiv'
|
||||||
import LoadingOverlay from './components/_base-LoadingOverlay'
|
import LoadingOverlay from './components/_base-LoadingOverlay'
|
||||||
|
|
||||||
Vue.config.debug = true
|
|
||||||
Vue.config.devTools = true
|
|
||||||
Vue.component('Controls', Controls)
|
Vue.component('Controls', Controls)
|
||||||
Vue.component('PopoverMenu', PopoverMenu)
|
Vue.component('PopoverMenu', PopoverMenu)
|
||||||
Vue.component('DatePicker', DatetimePicker)
|
Vue.component('DatePicker', DatetimePicker)
|
||||||
|
@ -51,13 +47,11 @@ Vue.component('LoadingOverlay', LoadingOverlay)
|
||||||
|
|
||||||
Vue.directive('tooltip', Tooltip)
|
Vue.directive('tooltip', Tooltip)
|
||||||
|
|
||||||
Vue.use(vClickOutside)
|
|
||||||
Vue.use(VueClipboard)
|
Vue.use(VueClipboard)
|
||||||
Vue.use(Modal)
|
Vue.use(Modal)
|
||||||
|
|
||||||
Vue.prototype.t = t
|
Vue.prototype.t = t
|
||||||
Vue.prototype.n = n
|
Vue.prototype.n = n
|
||||||
Vue.prototype.$http = axios
|
|
||||||
Vue.prototype.OC = OC
|
Vue.prototype.OC = OC
|
||||||
Vue.prototype.OCA = OCA
|
Vue.prototype.OCA = OCA
|
||||||
|
|
||||||
|
|
|
@ -187,6 +187,7 @@
|
||||||
<script>
|
<script>
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import QuizFormItem from '../components/quizFormItem'
|
import QuizFormItem from '../components/quizFormItem'
|
||||||
|
import axios from 'nextcloud-axios'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Create',
|
name: 'Create',
|
||||||
|
@ -469,7 +470,7 @@ export default {
|
||||||
this.titleEmpty = false
|
this.titleEmpty = false
|
||||||
// this.form.event.expirationDate = moment(this.form.event.expirationDate).utc()
|
// this.form.event.expirationDate = moment(this.form.event.expirationDate).utc()
|
||||||
|
|
||||||
this.$http.post(OC.generateUrl('apps/forms/write/form'), this.form)
|
axios.post(OC.generateUrl('apps/forms/write/form'), this.form)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.form.mode = 'edit'
|
this.form.mode = 'edit'
|
||||||
this.form.event.hash = response.data.hash
|
this.form.event.hash = response.data.hash
|
||||||
|
@ -490,7 +491,7 @@ export default {
|
||||||
|
|
||||||
loadForm(hash) {
|
loadForm(hash) {
|
||||||
this.loadingForm = true
|
this.loadingForm = true
|
||||||
this.$http.get(OC.generateUrl('apps/forms/get/form/' + hash))
|
axios.get(OC.generateUrl('apps/forms/get/form/' + hash))
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.form = response.data
|
this.form = response.data
|
||||||
if (this.form.event.expirationDate !== null) {
|
if (this.form.event.expirationDate !== null) {
|
||||||
|
|
|
@ -90,7 +90,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
loadForms() {
|
loadForms() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.$http.get(OC.generateUrl('apps/forms/get/forms'))
|
axios.get(OC.generateUrl('apps/forms/get/forms'))
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.forms = response.data
|
this.forms = response.data
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
|
|
@ -62,6 +62,7 @@
|
||||||
// import lodash from 'lodash'
|
// import lodash from 'lodash'
|
||||||
import resultItem from '../components/resultItem'
|
import resultItem from '../components/resultItem'
|
||||||
import json2csvParser from 'json2csv'
|
import json2csvParser from 'json2csv'
|
||||||
|
import axios from 'nextcloud-axios'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Results',
|
name: 'Results',
|
||||||
|
@ -119,7 +120,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
loadForms() {
|
loadForms() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.$http.get(OC.generateUrl('apps/forms/get/votes/' + this.$route.params.hash))
|
axios.get(OC.generateUrl('apps/forms/get/votes/' + this.$route.params.hash))
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.data == null) {
|
if (response.data == null) {
|
||||||
this.votes = null
|
this.votes = null
|
||||||
|
@ -145,7 +146,7 @@ export default {
|
||||||
download() {
|
download() {
|
||||||
|
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.$http.get(OC.generateUrl('apps/forms/get/event/' + this.$route.params.hash))
|
axios.get(OC.generateUrl('apps/forms/get/event/' + this.$route.params.hash))
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.json2csvParser = ['userId', 'voteOptionId', 'voteOptionText', 'voteAnswer']
|
this.json2csvParser = ['userId', 'voteOptionId', 'voteOptionText', 'voteAnswer']
|
||||||
var element = document.createElement('a')
|
var element = document.createElement('a')
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
/** jshint esversion: 6 */
|
|
||||||
const path = require('path')
|
|
||||||
const { VueLoaderPlugin } = require('vue-loader')
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
entry: {
|
|
||||||
'forms': path.join(__dirname, 'main.js')
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
path: path.resolve(__dirname, '../js'),
|
|
||||||
publicPath: '/js/',
|
|
||||||
filename: '[name].js'
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.css$/,
|
|
||||||
use: [
|
|
||||||
'vue-style-loader',
|
|
||||||
'css-loader'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.scss$/,
|
|
||||||
use: [
|
|
||||||
'vue-style-loader',
|
|
||||||
'css-loader',
|
|
||||||
'sass-loader'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.vue$/,
|
|
||||||
loader: 'vue-loader'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.js$/,
|
|
||||||
loader: 'babel-loader',
|
|
||||||
exclude: /node_modules/
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.(png|jpg|gif|svg)$/,
|
|
||||||
loader: 'file-loader',
|
|
||||||
options: {
|
|
||||||
name: '[name].[ext]?[hash]'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
plugins: [new VueLoaderPlugin()],
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
vue$: 'vue/dist/vue.esm.js'
|
|
||||||
},
|
|
||||||
extensions: ['*', '.js', '.vue', '.json']
|
|
||||||
}
|
|
||||||
}
|
|
55
webpack.common.js
Normal file
55
webpack.common.js
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
const path = require('path')
|
||||||
|
const { VueLoaderPlugin } = require('vue-loader')
|
||||||
|
const StyleLintPlugin = require('stylelint-webpack-plugin')
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: path.join(__dirname, 'src', 'main.js'),
|
||||||
|
output: {
|
||||||
|
path: path.resolve(__dirname, './js'),
|
||||||
|
publicPath: '/js/',
|
||||||
|
filename: 'forms.js',
|
||||||
|
chunkFilename: 'chunks/[name].js'
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.css$/,
|
||||||
|
use: ['vue-style-loader', 'css-loader']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.scss$/,
|
||||||
|
use: ['vue-style-loader', 'css-loader', 'sass-loader']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.(js|vue)$/,
|
||||||
|
use: 'eslint-loader',
|
||||||
|
exclude: /node_modules/,
|
||||||
|
enforce: 'pre'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.vue$/,
|
||||||
|
loader: 'vue-loader',
|
||||||
|
exclude: /node_modules/
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
loader: 'babel-loader',
|
||||||
|
exclude: /node_modules/
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.(png|jpg|gif|svg)$/,
|
||||||
|
loader: 'file-loader',
|
||||||
|
options: {
|
||||||
|
name: '[name].[ext]?[hash]'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new VueLoaderPlugin(),
|
||||||
|
new StyleLintPlugin()
|
||||||
|
],
|
||||||
|
resolve: {
|
||||||
|
extensions: ['*', '.js', '.vue']
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue