run eslint to fix errors

This commit is contained in:
2023-10-01 15:45:02 +02:00
parent 3850544ebb
commit 5887913f07
59 changed files with 5472 additions and 3235 deletions

View File

@@ -0,0 +1,73 @@
/*
* libreevent - .eslintrc.js
*
* Created by Janis Hutz 02/26/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
module.exports = {
'env': {
'browser': true,
'commonjs': true,
'es2021': true,
'node': true
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended'
],
'overrides': [
],
'parserOptions': {
'ecmaVersion': 'latest'
},
'rules': {
'indent': [
'error',
4
],
'linebreak-style': [
'error',
'unix'
],
'quotes': [
'error',
'single'
],
'semi': [
'error',
'always'
],
'spaced-comment': [
'error',
'always'
],
'arrow-spacing': [
'error',
{ 'before': true, 'after': true }
],
'func-call-spacing': [
'error',
'never'
],
'keyword-spacing': [
'error',
{ 'before': true, 'after': true }
],
'key-spacing': [
'error',
{ 'mode': 'strict' }
],
'space-before-blocks': [
'error',
'always'
],
'space-in-parens': [
'error',
'always'
],
'no-var': 'error'
}
};

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,8 @@
"scripts": { "scripts": {
"dev": "vite --host", "dev": "vite --host",
"preview": "vite preview --host", "preview": "vite preview --host",
"build": "vite build" "build": "vite build",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
}, },
"dependencies": { "dependencies": {
"@pdfme/generator": "^1.2.3", "@pdfme/generator": "^1.2.3",
@@ -18,6 +19,8 @@
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^1.10.2", "@vitejs/plugin-vue": "^1.10.2",
"vite": "^2.5.4" "vite": "^2.5.4",
"eslint": "^8.39.0",
"eslint-plugin-vue": "^9.17.0"
} }
} }

File diff suppressed because one or more lines are too long

View File

@@ -169,7 +169,7 @@ export default {
data () { data () {
return { return {
theme: '', theme: '',
} };
}, },
methods: { methods: {
changeTheme () { changeTheme () {
@@ -211,5 +211,5 @@ solution. Your help is greatly appreciated by the team as well as all its users!
=> https://libreevent.janishutz.com/ => https://libreevent.janishutz.com/
` ); ` );
} }
} };
</script> </script>

View File

@@ -49,7 +49,7 @@ export default {
cart: {}, cart: {},
selectedTickets: {}, selectedTickets: {},
maxTickets: 10, maxTickets: 10,
} };
}, },
methods: { methods: {
ticketHandling( id, option, operation ) { ticketHandling( id, option, operation ) {
@@ -245,7 +245,7 @@ export default {
this.loadTickets(); this.loadTickets();
this.seatChecks(); this.seatChecks();
} }
} };
</script> </script>
<style scoped> <style scoped>

View File

@@ -40,7 +40,7 @@
currentID: { 'critical': 0, 'medium': 1000, 'low': 100000 }, currentID: { 'critical': 0, 'medium': 1000, 'low': 100000 },
displayTimeCurrentNotification: 0, displayTimeCurrentNotification: 0,
notificationScheduler: null, notificationScheduler: null,
} };
}, },
methods: { methods: {
createNotification( message, showDuration, messageType, priority ) { createNotification( message, showDuration, messageType, priority ) {
@@ -121,7 +121,7 @@
unmounted ( ) { unmounted ( ) {
clearInterval( this.notificationScheduler ); clearInterval( this.notificationScheduler );
} }
} };
</script> </script>
<style scoped> <style scoped>

View File

@@ -110,7 +110,7 @@
contentType: 'dropdown', contentType: 'dropdown',
data: {}, data: {},
info: '', info: '',
} };
}, },
methods: { methods: {
closePopup( message ) { closePopup( message ) {
@@ -167,7 +167,7 @@
$( '#popup-backdrop' ).fadeIn( 300 ); $( '#popup-backdrop' ).fadeIn( 300 );
} }
}, },
} };
</script> </script>
<style scoped> <style scoped>

View File

@@ -200,34 +200,34 @@ export default {
props: { props: {
draggables: { draggables: {
type: Object, type: Object,
"default": {} 'default': {}
}, },
scaleFactor: { scaleFactor: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
generalSettings: { generalSettings: {
type: Object, type: Object,
"default": {}, 'default': {},
}, },
zoomFactor: { zoomFactor: {
type: Number, type: Number,
"default": 1 'default': 1
}, },
active: { active: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
historyPos: { historyPos: {
type: Number, type: Number,
"default": 0, 'default': 0,
} }
}, },
data () { data () {
return { return {
internal: {}, internal: {},
categories: { '1': {} }, categories: { '1': {} },
} };
}, },
methods: { methods: {
loadInternal () { loadInternal () {
@@ -282,7 +282,7 @@ export default {
created () { created () {
this.loadInternal(); this.loadInternal();
} }
} };
</script> </script>
<style scoped> <style scoped>

View File

@@ -84,7 +84,7 @@
generalSettings: { 'namingScheme': 'numeric' }, generalSettings: { 'namingScheme': 'numeric' },
seatCountInfo: { 'details': {}, 'count': 0 }, seatCountInfo: { 'details': {}, 'count': 0 },
autoSave: null, autoSave: null,
} };
}, },
methods: { methods: {
/* /*
@@ -233,7 +233,7 @@
} }
}, },
scaleDown ( valueArray ) { scaleDown ( valueArray ) {
const allowedAttributes = [ 'w', 'h', 'x', 'y' ] const allowedAttributes = [ 'w', 'h', 'x', 'y' ];
let returnArray = {}; let returnArray = {};
for ( let entry in valueArray ) { for ( let entry in valueArray ) {
returnArray[ entry ] = {}; returnArray[ entry ] = {};
@@ -248,7 +248,7 @@
return returnArray; return returnArray;
}, },
scaleUp ( valueArray ) { scaleUp ( valueArray ) {
const allowedAttributes = [ 'w', 'h', 'x', 'y' ] const allowedAttributes = [ 'w', 'h', 'x', 'y' ];
let returnArray = {}; let returnArray = {};
for ( let entry in valueArray ) { for ( let entry in valueArray ) {
returnArray[ entry ] = {}; returnArray[ entry ] = {};
@@ -444,7 +444,7 @@
clearInterval( this.sizePoll ); clearInterval( this.sizePoll );
clearInterval( this.autoSave ); clearInterval( this.autoSave );
}, },
} };
</script> </script>
<style scoped> <style scoped>

View File

@@ -27,33 +27,33 @@ export default {
props: { props: {
h: { h: {
type: Number, type: Number,
"default": 100, 'default': 100,
}, },
w: { w: {
type: Number, type: Number,
"default": 200, 'default': 200,
}, },
scaleFactor: { scaleFactor: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
origin: { origin: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
startingRow: { startingRow: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
id: { id: {
type: Number, type: Number,
"default": 1 'default': 1
} }
}, },
data () { data () {
return { return {
seats: {}, seats: {},
} };
}, },
methods: { methods: {
calculateChairs () { calculateChairs () {
@@ -114,6 +114,6 @@ export default {
created() { created() {
this.calculateChairs(); this.calculateChairs();
} }
} };
</script> </script>

View File

@@ -27,29 +27,29 @@ export default {
props: { props: {
h: { h: {
type: Number, type: Number,
"default": 100, 'default': 100,
}, },
w: { w: {
type: Number, type: Number,
"default": 200, 'default': 200,
}, },
scaleFactor: { scaleFactor: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
origin: { origin: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
id: { id: {
type: Number, type: Number,
"default": 1 'default': 1
} }
}, },
data () { data () {
return { return {
seats: {}, seats: {},
} };
}, },
methods: { methods: {
calculateChairs () { calculateChairs () {
@@ -104,6 +104,6 @@ export default {
created() { created() {
this.calculateChairs(); this.calculateChairs();
} }
} };
</script> </script>

View File

@@ -27,33 +27,33 @@ export default {
props: { props: {
h: { h: {
type: Number, type: Number,
"default": 100, 'default': 100,
}, },
w: { w: {
type: Number, type: Number,
"default": 200, 'default': 200,
}, },
scaleFactor: { scaleFactor: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
origin: { origin: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
startingRow: { startingRow: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
id: { id: {
type: Number, type: Number,
"default": 1 'default': 1
} }
}, },
data () { data () {
return { return {
seats: {}, seats: {},
} };
}, },
methods: { methods: {
calculateChairs () { calculateChairs () {
@@ -63,7 +63,7 @@ export default {
let h = Math.round( this.h / this.scaleFactor ); let h = Math.round( this.h / this.scaleFactor );
const size = 33; const size = 33;
let side = Math.min( w, h ) + 20; let side = Math.min( w, h ) + 20;
let heightTriangle = Math.floor( Math.sqrt( side ** 2 - ( Math.sqrt( side ** 2 * 2 ) / 2 ) ) ) let heightTriangle = Math.floor( Math.sqrt( side ** 2 - ( Math.sqrt( side ** 2 * 2 ) / 2 ) ) );
let sideOffset = size / Math.sqrt( 2 ); let sideOffset = size / Math.sqrt( 2 );
let count = Math.floor( heightTriangle / ( sideOffset * 2 ) ); let count = Math.floor( heightTriangle / ( sideOffset * 2 ) );
const angle = Math.PI / 4; const angle = Math.PI / 4;
@@ -117,6 +117,6 @@ export default {
created() { created() {
this.calculateChairs(); this.calculateChairs();
} }
} };
</script> </script>

View File

@@ -66,11 +66,11 @@ export default {
props: { props: {
origin: { origin: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
shape: { shape: {
type: String, type: String,
"default": "rectangular", 'default': 'rectangular',
}, },
}, },
data() { data() {
@@ -78,7 +78,7 @@ export default {
style: 'border-style: none none solid none', style: 'border-style: none none solid none',
circularStyle: 'top: 0; left 100%;', circularStyle: 'top: 0; left 100%;',
trapezoidStyle: 'rotate: 45deg', trapezoidStyle: 'rotate: 45deg',
} };
}, },
methods: { methods: {
updateOrigin () { updateOrigin () {
@@ -109,6 +109,6 @@ export default {
created() { created() {
this.updateOrigin(); this.updateOrigin();
} }
} };
</script> </script>

View File

@@ -66,11 +66,11 @@ export default {
props: { props: {
origin: { origin: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
shape: { shape: {
type: String, type: String,
"default": "rectangular", 'default': 'rectangular',
}, },
}, },
data() { data() {
@@ -78,7 +78,7 @@ export default {
style: 'border-style: none none solid none', style: 'border-style: none none solid none',
circularStyle: 'top: 0; left 100%;', circularStyle: 'top: 0; left 100%;',
trapezoidStyle: 'rotate: 45deg', trapezoidStyle: 'rotate: 45deg',
} };
}, },
methods: { methods: {
updateOrigin () { updateOrigin () {
@@ -109,6 +109,6 @@ export default {
created() { created() {
this.updateOrigin(); this.updateOrigin();
} }
} };
</script> </script>

View File

@@ -19,29 +19,29 @@ export default {
props: { props: {
origin: { origin: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
text: { text: {
type: String, type: String,
"default": "Untitled", 'default': 'Untitled',
}, },
textSize: { textSize: {
type: Number, type: Number,
"default": 20, 'default': 20,
}, },
scaleFactor: { scaleFactor: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
colour: { colour: {
type: String, type: String,
"default": '#000000', 'default': '#000000',
} }
}, },
data() { data() {
return { return {
style: 'font-size: 20pt; rotate: 0deg; color: #000000', style: 'font-size: 20pt; rotate: 0deg; color: #000000',
} };
}, },
methods: { methods: {
updateStyle () { updateStyle () {
@@ -65,5 +65,5 @@ export default {
created() { created() {
this.updateStyle(); this.updateStyle();
} }
} };
</script> </script>

View File

@@ -34,37 +34,37 @@ export default {
props: { props: {
h: { h: {
type: Number, type: Number,
"default": 100, 'default': 100,
}, },
w: { w: {
type: Number, type: Number,
"default": 200, 'default': 200,
}, },
scaleFactor: { scaleFactor: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
origin: { origin: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
startingRow: { startingRow: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
data: { data: {
type: Object, type: Object,
"default": { 'sector': 'A', 'sectorCount': 1, 'unavailableSeats': { 'secAr0s0': 'nav' }, 'categoryInfo': { 'pricing': { '1': { 'displayName': 'Adults - CHF 20.-', 'value': '1', 'price': 20 }, '2': { 'displayName': 'Child (0 - 15.99y) - CHF 15.-', 'value': '2', 'price': 15 } } } } 'default': { 'sector': 'A', 'sectorCount': 1, 'unavailableSeats': { 'secAr0s0': 'nav' }, 'categoryInfo': { 'pricing': { '1': { 'displayName': 'Adults - CHF 20.-', 'value': '1', 'price': 20 }, '2': { 'displayName': 'Child (0 - 15.99y) - CHF 15.-', 'value': '2', 'price': 15 } } } }
}, },
id: { id: {
type: Number, type: Number,
"default": 1, 'default': 1,
} }
}, },
data () { data () {
return { return {
seats: {}, seats: {},
} };
}, },
methods: { methods: {
calculateChairs () { calculateChairs () {
@@ -175,6 +175,6 @@ export default {
created() { created() {
this.calculateChairs(); this.calculateChairs();
} }
} };
</script> </script>

View File

@@ -34,41 +34,41 @@ export default {
props: { props: {
h: { h: {
type: Number, type: Number,
"default": 100, 'default': 100,
}, },
w: { w: {
type: Number, type: Number,
"default": 200, 'default': 200,
}, },
scaleFactor: { scaleFactor: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
startingRow: { startingRow: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
origin: { origin: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
data: { data: {
type: Object, type: Object,
"default": { 'sector': 'A', 'sectorCount': 1, 'unavailableSeats': { 'secAr0s0': 'nav' }, 'categoryInfo': { 'pricing': { '1': { 'displayName': 'Adults - CHF 20.-', 'value': '1', 'price': 20 }, '2': { 'displayName': 'Child (0 - 15.99y) - CHF 15.-', 'value': '2', 'price': 15 } } } } 'default': { 'sector': 'A', 'sectorCount': 1, 'unavailableSeats': { 'secAr0s0': 'nav' }, 'categoryInfo': { 'pricing': { '1': { 'displayName': 'Adults - CHF 20.-', 'value': '1', 'price': 20 }, '2': { 'displayName': 'Child (0 - 15.99y) - CHF 15.-', 'value': '2', 'price': 15 } } } }
}, },
id: { id: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
unavailable: { unavailable: {
type: Object, type: Object,
"default": {} 'default': {}
} }
}, },
data () { data () {
return { return {
seats: {}, seats: {},
} };
}, },
methods: { methods: {
calculateChairs () { calculateChairs () {
@@ -170,6 +170,6 @@ export default {
created() { created() {
this.calculateChairs(); this.calculateChairs();
} }
} };
</script> </script>

View File

@@ -34,37 +34,37 @@ export default {
props: { props: {
h: { h: {
type: Number, type: Number,
"default": 100, 'default': 100,
}, },
w: { w: {
type: Number, type: Number,
"default": 200, 'default': 200,
}, },
scaleFactor: { scaleFactor: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
origin: { origin: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
startingRow: { startingRow: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
data: { data: {
type: Object, type: Object,
"default": { 'sector': 'A', 'sectorCount': 1, 'unavailableSeats': { 'secAr0s0': 'nav' }, 'categoryInfo': { 'pricing': { '1': { 'displayName': 'Adults - CHF 20.-', 'value': '1', 'price': 20 }, '2': { 'displayName': 'Child (0 - 15.99y) - CHF 15.-', 'value': '2', 'price': 15 } } } } 'default': { 'sector': 'A', 'sectorCount': 1, 'unavailableSeats': { 'secAr0s0': 'nav' }, 'categoryInfo': { 'pricing': { '1': { 'displayName': 'Adults - CHF 20.-', 'value': '1', 'price': 20 }, '2': { 'displayName': 'Child (0 - 15.99y) - CHF 15.-', 'value': '2', 'price': 15 } } } }
}, },
id: { id: {
type: Number, type: Number,
"default": 1, 'default': 1,
} }
}, },
data () { data () {
return { return {
seats: {}, seats: {},
} };
}, },
methods: { methods: {
calculateChairs () { calculateChairs () {
@@ -87,7 +87,7 @@ export default {
let h = Math.round( this.h / this.scaleFactor ); let h = Math.round( this.h / this.scaleFactor );
const size = 33; const size = 33;
let side = Math.min( w, h ) + 20; let side = Math.min( w, h ) + 20;
let heightTriangle = Math.floor( Math.sqrt( side ** 2 - ( Math.sqrt( side ** 2 * 2 ) / 2 ) ) ) let heightTriangle = Math.floor( Math.sqrt( side ** 2 - ( Math.sqrt( side ** 2 * 2 ) / 2 ) ) );
let sideOffset = size / Math.sqrt( 2 ); let sideOffset = size / Math.sqrt( 2 );
let count = Math.floor( heightTriangle / ( sideOffset * 2 ) ); let count = Math.floor( heightTriangle / ( sideOffset * 2 ) );
const angle = Math.PI / 4; const angle = Math.PI / 4;
@@ -178,6 +178,6 @@ export default {
created() { created() {
this.calculateChairs(); this.calculateChairs();
} }
} };
</script> </script>

View File

@@ -66,11 +66,11 @@ export default {
props: { props: {
origin: { origin: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
shape: { shape: {
type: String, type: String,
"default": "rectangular", 'default': 'rectangular',
}, },
}, },
data() { data() {
@@ -78,7 +78,7 @@ export default {
style: 'border-style: none none solid none', style: 'border-style: none none solid none',
circularStyle: 'top: 0; left 100%;', circularStyle: 'top: 0; left 100%;',
trapezoidStyle: 'rotate: 45deg', trapezoidStyle: 'rotate: 45deg',
} };
}, },
methods: { methods: {
updateOrigin () { updateOrigin () {
@@ -109,6 +109,6 @@ export default {
created() { created() {
this.updateOrigin(); this.updateOrigin();
} }
} };
</script> </script>

View File

@@ -65,15 +65,15 @@ export default {
props: { props: {
origin: { origin: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
shape: { shape: {
type: String, type: String,
"default": "rectangular", 'default': 'rectangular',
}, },
color: { color: {
type: Object, type: Object,
"default": { 'fg': '#FFFFFF' } 'default': { 'fg': '#FFFFFF' }
} }
}, },
data() { data() {
@@ -81,7 +81,7 @@ export default {
style: 'border-style: none none solid none;', style: 'border-style: none none solid none;',
circularStyle: 'top: 0; left 100%;', circularStyle: 'top: 0; left 100%;',
trapezoidStyle: 'rotate: 45deg', trapezoidStyle: 'rotate: 45deg',
} };
}, },
methods: { methods: {
updateOrigin () { updateOrigin () {
@@ -115,6 +115,6 @@ export default {
created() { created() {
this.updateOrigin(); this.updateOrigin();
} }
} };
</script> </script>

View File

@@ -19,29 +19,29 @@ export default {
props: { props: {
origin: { origin: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
text: { text: {
type: String, type: String,
"default": "Untitled", 'default': 'Untitled',
}, },
textSize: { textSize: {
type: Number, type: Number,
"default": 20, 'default': 20,
}, },
scaleFactor: { scaleFactor: {
type: Number, type: Number,
"default": 1, 'default': 1,
}, },
colour: { colour: {
type: String, type: String,
"default": '#000000', 'default': '#000000',
} }
}, },
data() { data() {
return { return {
style: 'font-size: 20pt; rotate: 0deg; color: #000000', style: 'font-size: 20pt; rotate: 0deg; color: #000000',
} };
}, },
methods: { methods: {
updateStyle () { updateStyle () {
@@ -65,5 +65,5 @@ export default {
created() { created() {
this.updateStyle(); this.updateStyle();
} }
} };
</script> </script>

View File

@@ -91,7 +91,7 @@
selectedSeat: {}, selectedSeat: {},
cart: {}, cart: {},
unavailableSeats: {}, unavailableSeats: {},
} };
}, },
methods: { methods: {
/* /*
@@ -276,10 +276,10 @@
this.movePos.top = parent.scrollHeight - parent.scrollTop; this.movePos.top = parent.scrollHeight - parent.scrollTop;
this.movePos.isMoving = false; this.movePos.isMoving = false;
} }
}; }
}, },
scaleDown ( valueArray ) { scaleDown ( valueArray ) {
const allowedAttributes = [ 'w', 'h', 'x', 'y' ] const allowedAttributes = [ 'w', 'h', 'x', 'y' ];
let returnArray = {}; let returnArray = {};
for ( let entry in valueArray ) { for ( let entry in valueArray ) {
returnArray[ entry ] = {}; returnArray[ entry ] = {};
@@ -502,7 +502,7 @@
unmounted() { unmounted() {
clearInterval( this.sizePoll ); clearInterval( this.sizePoll );
}, },
} };
</script> </script>
<style scoped> <style scoped>

View File

@@ -24,7 +24,7 @@ export default {
data() { data() {
return { return {
options: {}, options: {},
} };
}, },
methods: { methods: {
openRightClickMenu( event, options ) { openRightClickMenu( event, options ) {
@@ -45,7 +45,7 @@ export default {
this.$emit( 'command', command ); this.$emit( 'command', command );
} }
} }
} };
</script> </script>
<style scoped> <style scoped>

View File

@@ -74,7 +74,7 @@ export default {
data() { data() {
return { return {
total: 0, total: 0,
} };
}, },
methods: { methods: {
calculateTotal () { calculateTotal () {
@@ -89,7 +89,7 @@ export default {
created() { created() {
this.calculateTotal(); this.calculateTotal();
} }
} };
</script> </script>
<style scoped> <style scoped>

View File

@@ -90,4 +90,4 @@ export default {
} }
}, },
] ]
} };

View File

@@ -7,7 +7,7 @@
* *
*/ */
import { createRouter, createWebHistory } from 'vue-router' import { createRouter, createWebHistory } from 'vue-router';
import { useUserStore } from '@/stores/userStore'; import { useUserStore } from '@/stores/userStore';
import { useBackendStore } from '@/stores/backendStore'; import { useBackendStore } from '@/stores/backendStore';
import adminRoutes from '@/router/adminRoutes'; import adminRoutes from '@/router/adminRoutes';

View File

@@ -170,4 +170,4 @@ export default [
transition: 'scale', transition: 'scale',
} }
}, },
] ];

View File

@@ -7,7 +7,7 @@
* *
*/ */
import { defineStore } from "pinia"; import { defineStore } from 'pinia';
export const useBackendStore = defineStore( 'backend', { export const useBackendStore = defineStore( 'backend', {
state: () => ( { 'guestPurchase': false, 'guestPurchaseAllowed': false } ), state: () => ( { 'guestPurchase': false, 'guestPurchaseAllowed': false } ),

View File

@@ -7,7 +7,7 @@
* *
*/ */
import { defineStore } from "pinia"; import { defineStore } from 'pinia';
export const useUserStore = defineStore( 'user', { export const useUserStore = defineStore( 'user', {
state: () => ( { 'isUserAuth': false, 'isAdminAuth': false, 'userData': {}, 'isTwoFACompliantUser': false, 'isTwoFACompliantAdmin': false, 'pageName': 'libreevent' } ), state: () => ( { 'isUserAuth': false, 'isAdminAuth': false, 'userData': {}, 'isTwoFACompliantUser': false, 'isTwoFACompliantAdmin': false, 'pageName': 'libreevent' } ),

View File

@@ -18,7 +18,7 @@
data () { data () {
return { return {
formData: {} formData: {}
} };
}, },
methods: { methods: {
setup () { setup () {

View File

@@ -32,7 +32,7 @@
data () { data () {
return { return {
formData: {} formData: {}
} };
}, },
components: { components: {
notifications, notifications,
@@ -80,7 +80,7 @@
} }
}, },
}, },
} };
</script> </script>
<style scoped> <style scoped>

View File

@@ -217,7 +217,7 @@
data () { data () {
return { return {
formData: {} formData: {}
} };
}, },
computed: { computed: {
...mapStores( useUserStore ) ...mapStores( useUserStore )

View File

@@ -111,7 +111,7 @@
currentDate: new Date().getTime(), currentDate: new Date().getTime(),
eventList: { 'upcoming': { 'name': 'Upcoming', 'content': {} }, 'past': { 'name': 'Past', 'content': {} }, 'drafts': { 'name': 'Drafts', 'content': {} } }, eventList: { 'upcoming': { 'name': 'Upcoming', 'content': {} }, 'past': { 'name': 'Past', 'content': {} }, 'drafts': { 'name': 'Drafts', 'content': {} } },
currentlyOpenMenu: '', currentlyOpenMenu: '',
} };
}, },
created() { created() {
this.loadData(); this.loadData();
@@ -149,7 +149,7 @@
} ); } );
}, },
openRightClickMenu( id, event ) { openRightClickMenu( id, event ) {
this.$refs.rclk.openRightClickMenu( event, { 'edit': { 'command': 'editEvent', 'symbol': 'edit', 'display': 'Edit event' }, 'delete': { 'command': 'deleteEvent', 'symbol': 'delete', 'display': 'Delete event' } } ) this.$refs.rclk.openRightClickMenu( event, { 'edit': { 'command': 'editEvent', 'symbol': 'edit', 'display': 'Edit event' }, 'delete': { 'command': 'deleteEvent', 'symbol': 'delete', 'display': 'Delete event' } } );
this.currentlyOpenMenu = id; this.currentlyOpenMenu = id;
}, },
executeCommand( command ) { executeCommand( command ) {

View File

@@ -46,7 +46,7 @@
currentlyOpenMenu: '', currentlyOpenMenu: '',
currentPopup: '', currentPopup: '',
updatedLocations: {} updatedLocations: {}
} };
}, },
components: { components: {
popups, popups,
@@ -120,9 +120,9 @@
openRightClickMenu( id, event, hasSeatplan ) { openRightClickMenu( id, event, hasSeatplan ) {
this.currentlyOpenMenu = id; this.currentlyOpenMenu = id;
if ( hasSeatplan ) { if ( hasSeatplan ) {
this.$refs.rclk.openRightClickMenu( event, { 'edit': { 'command': 'editLocation', 'symbol': 'edit', 'display': 'Edit location' }, 'editor': { 'command': 'openEditor', 'symbol': 'tune', 'display': 'Edit seatplan' }, 'delete': { 'command': 'deleteLocation', 'symbol': 'delete', 'display': 'Delete location' } } ) this.$refs.rclk.openRightClickMenu( event, { 'edit': { 'command': 'editLocation', 'symbol': 'edit', 'display': 'Edit location' }, 'editor': { 'command': 'openEditor', 'symbol': 'tune', 'display': 'Edit seatplan' }, 'delete': { 'command': 'deleteLocation', 'symbol': 'delete', 'display': 'Delete location' } } );
} else { } else {
this.$refs.rclk.openRightClickMenu( event, { 'edit': { 'command': 'editLocation', 'symbol': 'edit', 'display': 'Edit location' }, 'delete': { 'command': 'deleteLocation', 'symbol': 'delete', 'display': 'Delete location' } } ) this.$refs.rclk.openRightClickMenu( event, { 'edit': { 'command': 'editLocation', 'symbol': 'edit', 'display': 'Edit location' }, 'delete': { 'command': 'deleteLocation', 'symbol': 'delete', 'display': 'Delete location' } } );
} }
}, },
executeCommand( command ) { executeCommand( command ) {

View File

@@ -81,7 +81,7 @@
startPageTemplates: [], startPageTemplates: [],
startPageSettings: {}, startPageSettings: {},
selectedTemplate: '', selectedTemplate: '',
} };
}, },
components: { components: {
PictureInput, PictureInput,
@@ -106,7 +106,7 @@
for ( let setting in this.startPageSettings ) { for ( let setting in this.startPageSettings ) {
if ( this.startPageSettings[ setting ][ 'type' ] === 'image' ) { if ( this.startPageSettings[ setting ][ 'type' ] === 'image' ) {
if ( this.saveImage( this.startPageSettings[ setting ].id ) ) { if ( this.saveImage( this.startPageSettings[ setting ].id ) ) {
this.$refs.notification.createNotification( 'No image selected!', 5, 'error', 'normal' ) this.$refs.notification.createNotification( 'No image selected!', 5, 'error', 'normal' );
} }
} else { } else {
if ( this.startPageSettings[ setting ][ 'value' ] ) { if ( this.startPageSettings[ setting ][ 'value' ] ) {

View File

@@ -29,7 +29,7 @@
data () { data () {
return { return {
allPlugins: {} allPlugins: {}
} };
}, },
methods: { methods: {
loadData () { loadData () {

View File

@@ -151,7 +151,7 @@
// 'type': 'toggle', // 'type': 'toggle',
// }, // },
} }
} };
}, },
methods: { methods: {
showAccountSettings ( account ) { showAccountSettings ( account ) {
@@ -348,7 +348,7 @@
if ( res.status === 200 ) { if ( res.status === 200 ) {
this.$refs.notification.createNotification( 'Payment gateway settings saved!', 5, 'ok', 'normal' ); this.$refs.notification.createNotification( 'Payment gateway settings saved!', 5, 'ok', 'normal' );
} }
} ) } );
} else if ( this.currentPopup === 'createAccount' ) { } else if ( this.currentPopup === 'createAccount' ) {
let fetchOptions = { let fetchOptions = {
method: 'post', method: 'post',
@@ -390,7 +390,7 @@
this.$refs.rclk.openRightClickMenu( event, { this.$refs.rclk.openRightClickMenu( event, {
// 'permissions': { 'command': 'openPermissions', 'symbol': 'edit', 'display': 'Edit permissions' }, // 'permissions': { 'command': 'openPermissions', 'symbol': 'edit', 'display': 'Edit permissions' },
'password': { 'command': 'updatePassword', 'symbol': 'password', 'display': 'Edit account settings' }, 'password': { 'command': 'updatePassword', 'symbol': 'password', 'display': 'Edit account settings' },
'delete': { 'command': 'deleteUser', 'symbol': 'delete', 'display': 'Delete User' } } ) 'delete': { 'command': 'deleteUser', 'symbol': 'delete', 'display': 'Delete User' } } );
this.currentlyOpenMenu = id; this.currentlyOpenMenu = id;
}, },
loadData() { loadData() {

View File

@@ -26,14 +26,14 @@
data () { data () {
return { return {
code: { '1': '', '2': '' } code: { '1': '', '2': '' }
} };
}, },
computed: { computed: {
...mapStores( useUserStore ), ...mapStores( useUserStore ),
}, },
created () { created () {
if ( this.userStore.getAdminTwoFACompliant ) { if ( this.userStore.getAdminTwoFACompliant ) {
if ( !!window.EventSource ) { if ( window.EventSource ) {
setTimeout( () => { setTimeout( () => {
let startNotification = this.$refs.notification.createNotification( 'Connecting to status service', 20, 'progress', 'normal' ); let startNotification = this.$refs.notification.createNotification( 'Connecting to status service', 20, 'progress', 'normal' );
let source = new EventSource( localStorage.getItem( 'url' ) + '/admin/2fa/check', { withCredentials: true } ); let source = new EventSource( localStorage.getItem( 'url' ) + '/admin/2fa/check', { withCredentials: true } );
@@ -46,7 +46,7 @@
self.$router.push( '/admin' ); self.$router.push( '/admin' );
console.log( e.data ); console.log( e.data );
} }
} };
source.onopen = e => { source.onopen = e => {
self.$refs.notification.createNotification( 'Connected to status service', 5, 'ok', 'normal' ); self.$refs.notification.createNotification( 'Connected to status service', 5, 'ok', 'normal' );
@@ -61,7 +61,7 @@
self.$refs.notification.cancelNotification( startNotification ); self.$refs.notification.cancelNotification( startNotification );
self.$refs.notification.createNotification( 'Could not connect to status service', 5, 'error', 'normal' ); self.$refs.notification.createNotification( 'Could not connect to status service', 5, 'error', 'normal' );
} }
}, false) }, false );
}, 300 ); }, 300 );
} else { } else {
setTimeout( () => { setTimeout( () => {
@@ -99,7 +99,7 @@
} }
} }
}, },
} };
</script> </script>
<style scoped> <style scoped>

View File

@@ -265,7 +265,7 @@
hasLiveVersion: false, hasLiveVersion: false,
hasSeatPlan: true, hasSeatPlan: true,
totalSeats: 0, totalSeats: 0,
} };
}, },
created () { created () {
this.loadData(); this.loadData();
@@ -355,7 +355,7 @@
} }
if ( this.event.categories[ category ].price[ price ] < lowestPrice ) { if ( this.event.categories[ category ].price[ price ] < lowestPrice ) {
lowestPrice = this.event.categories[ category ].price[ price ]; lowestPrice = this.event.categories[ category ].price[ price ];
}; }
} }
totalSeats += parseInt( this.event.categories[ category ].ticketCount ?? 0 ); totalSeats += parseInt( this.event.categories[ category ].ticketCount ?? 0 );
} }
@@ -479,7 +479,7 @@
} }
} ); } );
} }
} ) } );
} }
} else if ( this.command === 'deployEvent' ) { } else if ( this.command === 'deployEvent' ) {
this.save( 'deploy' ); this.save( 'deploy' );

File diff suppressed because one or more lines are too long

View File

@@ -18,7 +18,7 @@
data () { data () {
return { return {
formData: {} formData: {}
} };
}, },
methods: { methods: {
setup () { setup () {

View File

@@ -122,7 +122,7 @@
cart: {}, cart: {},
backend: { 'currency': 'CHF' }, backend: { 'currency': 'CHF' },
ticketToDelete: {}, ticketToDelete: {},
} };
}, },
components: { components: {
popups, popups,
@@ -233,7 +233,7 @@
this.seatChecks( event ); this.seatChecks( event );
} }
} }
} };
</script> </script>

View File

@@ -19,10 +19,10 @@
}, },
data() { data() {
return {} return {};
}, },
created() { created() {
} }
} };
</script> </script>

View File

@@ -131,7 +131,7 @@
events: { 'test': { 'name': 'TestEvent', 'description': 'This is a description for the TestEvent to test multiline support and proper positioning of the Fields', 'free': 2, 'maxTickets': 2, 'date': '2023-08-31T09:00:00Z', 'startingPrice': 15, 'location': 'TestLocation', 'eventID': 'test', 'currency': 'CHF', 'logo': new URL( '/src/assets/logo.png', import.meta.url ).href }, 'test2': { 'name': 'TestEvent2', 'description': 'This is a description for the TestEvent to test multiline support and proper positioning of the Fields', 'freeSeats': 2, 'maxSeats': 2, 'date': '2023-08-15T09:00:00Z', 'startingPrice': 15, 'location': 'TestLocation', 'eventID': 'test2', 'currency': 'CHF', 'logo': new URL( '/src/assets/logo.png', import.meta.url ).href } }, events: { 'test': { 'name': 'TestEvent', 'description': 'This is a description for the TestEvent to test multiline support and proper positioning of the Fields', 'free': 2, 'maxTickets': 2, 'date': '2023-08-31T09:00:00Z', 'startingPrice': 15, 'location': 'TestLocation', 'eventID': 'test', 'currency': 'CHF', 'logo': new URL( '/src/assets/logo.png', import.meta.url ).href }, 'test2': { 'name': 'TestEvent2', 'description': 'This is a description for the TestEvent to test multiline support and proper positioning of the Fields', 'freeSeats': 2, 'maxSeats': 2, 'date': '2023-08-15T09:00:00Z', 'startingPrice': 15, 'location': 'TestLocation', 'eventID': 'test2', 'currency': 'CHF', 'logo': new URL( '/src/assets/logo.png', import.meta.url ).href } },
today: new Date().getTime(), today: new Date().getTime(),
locations: {}, locations: {},
} };
}, },
computed: { computed: {
orderedEvents () { orderedEvents () {

View File

@@ -33,10 +33,10 @@
}, },
data() { data() {
return {} return {};
}, },
created() { created() {
if ( !!window.EventSource ) { if ( window.EventSource ) {
setTimeout( () => { setTimeout( () => {
let startNotification = this.$refs.notification.createNotification( 'Connecting to status service...', 20, 'progress', 'normal' ); let startNotification = this.$refs.notification.createNotification( 'Connecting to status service...', 20, 'progress', 'normal' );
let source = new EventSource( localStorage.getItem( 'url' ) + '/payments/status', { withCredentials: true } ); let source = new EventSource( localStorage.getItem( 'url' ) + '/payments/status', { withCredentials: true } );
@@ -59,7 +59,7 @@
} else if ( e.data === 'paymentOk' ) { } else if ( e.data === 'paymentOk' ) {
self.$refs.notification.createNotification( 'Your payment has been marked as completed!', 5, 'ok', 'normal' ); self.$refs.notification.createNotification( 'Your payment has been marked as completed!', 5, 'ok', 'normal' );
} }
} };
source.onopen = e => { source.onopen = e => {
self.$refs.notification.createNotification( 'Connected to status service', 5, 'ok', 'normal' ); self.$refs.notification.createNotification( 'Connected to status service', 5, 'ok', 'normal' );
@@ -103,7 +103,7 @@
}, 5000 ); }, 5000 );
} }
} }
} };
</script> </script>
<style> <style>

View File

@@ -171,7 +171,7 @@ export default {
backend: { 'currency': 'CHF' }, backend: { 'currency': 'CHF' },
cartNotEmpty: false, cartNotEmpty: false,
userData: {}, userData: {},
} };
}, },
components: { components: {
notifications, notifications,
@@ -189,7 +189,7 @@ export default {
for ( let event in cart ) { for ( let event in cart ) {
if ( Object.keys( cart[ event ][ 'tickets' ] ).length ) { if ( Object.keys( cart[ event ][ 'tickets' ] ).length ) {
this.cartNotEmpty = true; this.cartNotEmpty = true;
}; }
} }
if ( this.cartNotEmpty ) { if ( this.cartNotEmpty ) {

View File

@@ -176,7 +176,7 @@
data() { data() {
return { return {
event: {}, event: {},
} };
} }
}; };
</script> </script>

View File

@@ -60,7 +60,7 @@
return { return {
hasSeatplan: false, hasSeatplan: false,
eventID: '', eventID: '',
} };
}, },
created () { created () {
if ( !sessionStorage.getItem( 'selectedTicket' ) ) { if ( !sessionStorage.getItem( 'selectedTicket' ) ) {

View File

@@ -119,7 +119,7 @@
isEditingAccount: false, isEditingAccount: false,
emailStatus: '', emailStatus: '',
twoFASetting: 'allow', twoFASetting: 'allow',
} };
}, },
components: { components: {
notifications, notifications,
@@ -201,7 +201,7 @@
} }
} }
} else if ( !( /[a-z]/.test( mail[ l ] ) || /[A-Z]/.test( mail[ l ] ) || /[1-9]/.test( mail[ l ] ) || mail[ l ] === '-' || mail[ l ] === '_' ) ) { } else if ( !( /[a-z]/.test( mail[ l ] ) || /[A-Z]/.test( mail[ l ] ) || /[1-9]/.test( mail[ l ] ) || mail[ l ] === '-' || mail[ l ] === '_' ) ) {
return false return false;
} }
} else { } else {
if ( mail[ l ] === '@' ) { if ( mail[ l ] === '@' ) {
@@ -265,5 +265,5 @@
created () { created () {
this.loadData(); this.loadData();
} }
} };
</script> </script>

View File

@@ -34,7 +34,7 @@
data () { data () {
return { return {
formData: {} formData: {}
} };
}, },
components: { components: {
notifications, notifications,
@@ -82,7 +82,7 @@
} }
}, },
}, },
} };
</script> </script>
<style scoped> <style scoped>

View File

@@ -34,7 +34,7 @@
data () { data () {
return { return {
email: '', email: '',
} };
}, },
components: { components: {
notifications, notifications,
@@ -64,5 +64,5 @@
} ); } );
} }
} }
} };
</script> </script>

View File

@@ -62,7 +62,7 @@
return { return {
formData: {}, formData: {},
emailStatus: '', emailStatus: '',
} };
}, },
components: { components: {
notifications, notifications,
@@ -102,7 +102,7 @@
} }
} }
} else if ( !( /[a-z]/.test( mail[ l ] ) || /[A-Z]/.test( mail[ l ] ) || /[1-9]/.test( mail[ l ] ) || mail[ l ] === '-' || mail[ l ] === '_' ) ) { } else if ( !( /[a-z]/.test( mail[ l ] ) || /[A-Z]/.test( mail[ l ] ) || /[1-9]/.test( mail[ l ] ) || mail[ l ] === '-' || mail[ l ] === '_' ) ) {
return false return false;
} }
} else { } else {
if ( mail[ l ] === '@' ) { if ( mail[ l ] === '@' ) {
@@ -182,7 +182,7 @@
} ); } );
} }
}, },
} };
</script> </script>
<style scoped> <style scoped>

View File

@@ -27,14 +27,14 @@
return { return {
code: { '1': '', '2': '' }, code: { '1': '', '2': '' },
serverPing: null, serverPing: null,
} };
}, },
computed: { computed: {
...mapStores( useUserStore ), ...mapStores( useUserStore ),
}, },
created () { created () {
if ( this.userStore.getUserTwoFACompliant ) { if ( this.userStore.getUserTwoFACompliant ) {
if ( !!window.EventSource ) { if ( window.EventSource ) {
setTimeout( () => { setTimeout( () => {
let startNotification = this.$refs.notification.createNotification( 'Connecting to status service', 20, 'progress', 'normal' ); let startNotification = this.$refs.notification.createNotification( 'Connecting to status service', 20, 'progress', 'normal' );
let source = new EventSource( localStorage.getItem( 'url' ) + '/user/2fa/check', { withCredentials: true } ); let source = new EventSource( localStorage.getItem( 'url' ) + '/user/2fa/check', { withCredentials: true } );
@@ -46,7 +46,7 @@
self.userStore.setUserAuth( true ); self.userStore.setUserAuth( true );
self.$router.push( sessionStorage.getItem( 'redirect' ) ?? '/account' ); self.$router.push( sessionStorage.getItem( 'redirect' ) ?? '/account' );
} }
} };
source.onopen = e => { source.onopen = e => {
self.$refs.notification.createNotification( 'Connected to status service', 5, 'ok', 'normal' ); self.$refs.notification.createNotification( 'Connected to status service', 5, 'ok', 'normal' );
@@ -60,7 +60,7 @@
self.$refs.notification.cancelNotification( startNotification ); self.$refs.notification.cancelNotification( startNotification );
self.$refs.notification.createNotification( 'Could not connect to status service', 5, 'error', 'normal' ); self.$refs.notification.createNotification( 'Could not connect to status service', 5, 'error', 'normal' );
} }
}, false) }, false );
}, 300 ); }, 300 );
} else { } else {
setTimeout( () => { setTimeout( () => {
@@ -101,7 +101,7 @@
unmounted() { unmounted() {
clearInterval( this.serverPing ); clearInterval( this.serverPing );
} }
} };
</script> </script>
<style scoped> <style scoped>

View File

@@ -1,5 +1,5 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue';
const path = require( 'path' ); const path = require( 'path' );
export default defineConfig( { export default defineConfig( {

View File

@@ -1,11 +0,0 @@
/* eslint-env node */
module.exports = {
root: true,
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended'
],
parserOptions: {
ecmaVersion: 'latest'
}
}

View File

@@ -0,0 +1,73 @@
/*
* libreevent - .eslintrc.js
*
* Created by Janis Hutz 02/26/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
module.exports = {
'env': {
'browser': true,
'commonjs': true,
'es2021': true,
'node': true
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended'
],
'overrides': [
],
'parserOptions': {
'ecmaVersion': 'latest'
},
'rules': {
'indent': [
'error',
4
],
'linebreak-style': [
'error',
'unix'
],
'quotes': [
'error',
'single'
],
'semi': [
'error',
'always'
],
'spaced-comment': [
'error',
'always'
],
'arrow-spacing': [
'error',
{ 'before': true, 'after': true }
],
'func-call-spacing': [
'error',
'never'
],
'keyword-spacing': [
'error',
{ 'before': true, 'after': true }
],
'key-spacing': [
'error',
{ 'mode': 'strict' }
],
'space-before-blocks': [
'error',
'always'
],
'space-in-parens': [
'error',
'always'
],
'no-var': 'error'
}
};