Compare commits

...

7 Commits

Author SHA1 Message Date
Sytone
52b0a4c6ac Add validation for list ID and disable if not valid.
Add component to Home with undefined list id.
2021-06-02 12:23:48 -07:00
Sytone
9f9c942c73 Revert welcome message 2021-06-02 11:47:33 -07:00
Sytone
d363cfc972 Cleanup comments 2021-06-02 11:43:48 -07:00
Sytone
c3c22bf202 Enforce trailing commas 2021-06-02 11:40:31 -07:00
Sytone
5d36d9399d Update to use single quotes uniformaly 2021-06-02 11:35:59 -07:00
Sytone
f70932dd39 Move html to double quote as single used inside 2021-06-02 11:33:57 -07:00
Sytone
4642ce2b0f Update rules to use single quote
Update editor config to be consistent for YAML,JSON
2021-06-02 11:32:25 -07:00
35 changed files with 251 additions and 256 deletions

View File

@ -5,10 +5,18 @@ root = true
[*] [*]
indent_style = tab indent_style = tab
end_of_line = crlf end_of_line = lf
charset = utf-8 charset = utf-8
trim_trailing_whitespace = false trim_trailing_whitespace = false
insert_final_newline = false insert_final_newline = false
[*.vue] [*.vue]
indent_style = tab indent_style = tab
[*.{yaml,yml}]
indent_style = space
indent_size = 2
[*.json]
indent_style = space
indent_size = 4

View File

@ -1,5 +1,5 @@
module.exports = { module.exports = {
presets: [ presets: [
'@vue/app' '@vue/app',
] ],
} }

View File

@ -1,96 +1,109 @@
{ {
"name": "vikunja-frontend", "name": "vikunja-frontend",
"version": "0.10.0", "version": "0.10.0",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"serve:dist": "node scripts/serve-dist.js", "serve:dist": "node scripts/serve-dist.js",
"build": "vue-cli-service build --modern", "build": "vue-cli-service build --modern",
"build:report": "vue-cli-service build --report", "build:report": "vue-cli-service build --report",
"lint": "vue-cli-service lint --ignore-pattern '*.test.*'", "lint": "vue-cli-service lint --ignore-pattern '*.test.*'",
"cypress:open": "cypress open", "cypress:open": "cypress open",
"test:unit": "jest", "test:unit": "jest",
"test:frontend": "cypress run" "test:frontend": "cypress run"
},
"dependencies": {
"browserslist": "4.16.6",
"bulma": "0.9.2",
"camel-case": "4.1.2",
"copy-to-clipboard": "3.3.1",
"date-fns": "2.22.1",
"dompurify": "2.2.9",
"highlight.js": "11.0.0",
"lodash": "4.17.21",
"marked": "2.0.7",
"register-service-worker": "1.7.2",
"sass": "1.34.0",
"snake-case": "3.0.4",
"verte": "0.0.12",
"vue": "2.6.13",
"vue-advanced-cropper": "1.6.0",
"vue-drag-resize": "1.5.4",
"vue-easymde": "1.4.0",
"vue-shortkey": "3.1.7",
"vue-smooth-dnd": "0.8.1",
"vuex": "3.6.2"
},
"devDependencies": {
"@fortawesome/fontawesome-svg-core": "1.2.35",
"@fortawesome/free-regular-svg-icons": "5.15.3",
"@fortawesome/free-solid-svg-icons": "5.15.3",
"@fortawesome/vue-fontawesome": "2.0.2",
"@vue/cli": "4.5.13",
"@vue/cli-plugin-babel": "4.5.13",
"@vue/cli-plugin-eslint": "4.5.13",
"@vue/cli-plugin-pwa": "4.5.13",
"@vue/cli-service": "4.5.13",
"axios": "0.21.1",
"babel-eslint": "10.1.0",
"cypress": "7.4.0",
"cypress-file-upload": "5.0.7",
"eslint": "7.27.0",
"eslint-plugin-vue": "7.10.0",
"faker": "5.5.3",
"jest": "27.0.3",
"sass-loader": "10.2.0",
"vue-flatpickr-component": "8.1.6",
"vue-notification": "1.3.20",
"vue-router": "3.5.1",
"vue-template-compiler": "2.6.13",
"wait-on": "5.3.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
}, },
"extends": [ "dependencies": {
"plugin:vue/essential", "browserslist": "4.16.6",
"eslint:recommended" "bulma": "0.9.2",
"camel-case": "4.1.2",
"copy-to-clipboard": "3.3.1",
"date-fns": "2.22.1",
"dompurify": "2.2.9",
"highlight.js": "11.0.0",
"lodash": "4.17.21",
"marked": "2.0.7",
"register-service-worker": "1.7.2",
"sass": "1.34.0",
"snake-case": "3.0.4",
"verte": "0.0.12",
"vue": "2.6.13",
"vue-advanced-cropper": "1.6.0",
"vue-drag-resize": "1.5.4",
"vue-easymde": "1.4.0",
"vue-shortkey": "3.1.7",
"vue-smooth-dnd": "0.8.1",
"vuex": "3.6.2"
},
"devDependencies": {
"@fortawesome/fontawesome-svg-core": "1.2.35",
"@fortawesome/free-regular-svg-icons": "5.15.3",
"@fortawesome/free-solid-svg-icons": "5.15.3",
"@fortawesome/vue-fontawesome": "2.0.2",
"@vue/cli": "4.5.13",
"@vue/cli-plugin-babel": "4.5.13",
"@vue/cli-plugin-eslint": "4.5.13",
"@vue/cli-plugin-pwa": "4.5.13",
"@vue/cli-service": "4.5.13",
"axios": "0.21.1",
"babel-eslint": "10.1.0",
"cypress": "7.4.0",
"cypress-file-upload": "5.0.7",
"eslint": "7.27.0",
"eslint-plugin-vue": "7.10.0",
"faker": "5.5.3",
"jest": "27.0.3",
"sass-loader": "10.2.0",
"vue-flatpickr-component": "8.1.6",
"vue-notification": "1.3.20",
"vue-router": "3.5.1",
"vue-template-compiler": "2.6.13",
"wait-on": "5.3.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {
"vue/html-quotes": [
"error",
"double"
],
"quotes": [
"error",
"single"
],
"comma-dangle": [
"error",
"always-multiline"
]
},
"parserOptions": {
"parser": "babel-eslint"
},
"ignorePatterns": [
"*.test.js",
"cypress/*"
]
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie < 11"
], ],
"rules": {}, "license": "AGPL-3.0-or-later",
"parserOptions": { "jest": {
"parser": "babel-eslint" "testPathIgnorePatterns": [
}, "cypress"
"ignorePatterns": [ ]
"*.test.js",
"cypress/*"
]
},
"postcss": {
"plugins": {
"autoprefixer": {}
} }
}, }
"browserslist": [
"> 1%",
"last 2 versions",
"not ie < 11"
],
"license": "AGPL-3.0-or-later",
"jest": {
"testPathIgnorePatterns": [
"cypress"
]
}
}

View File

@ -55,7 +55,7 @@ export default {
computed: { computed: {
showIconOnly() { showIconOnly() {
return this.icon !== '' && typeof this.$slots.default === 'undefined' return this.icon !== '' && typeof this.$slots.default === 'undefined'
} },
}, },
methods: { methods: {
click(e) { click(e) {

View File

@ -145,16 +145,16 @@ export default {
}, },
props: { props: {
value: { value: {
validator: prop => prop instanceof Date || prop === null || typeof prop === 'string' validator: prop => prop instanceof Date || prop === null || typeof prop === 'string',
}, },
chooseDateLabel: { chooseDateLabel: {
type: String, type: String,
default: 'Choose a date' default: 'Choose a date',
}, },
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false, default: false,
} },
}, },
mounted() { mounted() {
this.setDateValue(this.value) this.setDateValue(this.value)

View File

@ -363,7 +363,7 @@ export default {
link: (href, title, text) => { link: (href, title, text) => {
const isLocal = href.startsWith(`${location.protocol}//${location.hostname}`) const isLocal = href.startsWith(`${location.protocol}//${location.hostname}`)
const html = linkRenderer.call(renderer, href, title, text) const html = linkRenderer.call(renderer, href, title, text)
return isLocal ? html : html.replace(/^<a /, `<a target="_blank" rel="noreferrer noopener nofollow" `) return isLocal ? html : html.replace(/^<a /, '<a target="_blank" rel="noreferrer noopener nofollow" ')
}, },
}, },
highlight: function (code, language) { highlight: function (code, language) {

View File

@ -108,21 +108,21 @@ export default {
type: Boolean, type: Boolean,
default() { default() {
return false return false
} },
}, },
// The placeholder of the search input // The placeholder of the search input
placeholder: { placeholder: {
type: String, type: String,
default() { default() {
return '' return ''
} },
}, },
// The search results where the @search listener needs to put the results into // The search results where the @search listener needs to put the results into
searchResults: { searchResults: {
type: Array, type: Array,
default() { default() {
return [] return []
} },
}, },
// The name of the property of the searched object to show the user. // The name of the property of the searched object to show the user.
// If empty the component will show all raw data of an entry. // If empty the component will show all raw data of an entry.
@ -130,13 +130,13 @@ export default {
type: String, type: String,
default() { default() {
return '' return ''
} },
}, },
// The object with the value, updated every time an entry is selected. // The object with the value, updated every time an entry is selected.
value: { value: {
default() { default() {
return null return null
} },
}, },
// If true, will provide an "add this as a new value" entry which fires an @create event when clicking on it. // If true, will provide an "add this as a new value" entry which fires an @create event when clicking on it.
creatable: { creatable: {

View File

@ -22,7 +22,7 @@ export default {
type: String, type: String,
required: false, required: false,
default: '', default: '',
} },
}, },
} }
</script> </script>

View File

@ -6,6 +6,6 @@
<script> <script>
export default { export default {
name: 'nothing' name: 'nothing',
} }
</script> </script>

View File

@ -14,7 +14,7 @@ export default {
keys: { keys: {
type: Array, type: Array,
required: true, required: true,
} },
}, },
} }
</script> </script>

View File

@ -115,7 +115,7 @@ export default {
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)
}) })
} },
}, },
} }
</script> </script>

View File

@ -382,7 +382,7 @@ export default {
reset() { reset() {
this.query = '' this.query = ''
this.selectedCmd = null this.selectedCmd = null
} },
}, },
} }
</script> </script>

View File

@ -250,7 +250,7 @@ export default {
this.showNewForm = false this.showNewForm = false
this.success( this.success(
{message: 'The link share was successfully created'}, {message: 'The link share was successfully created'},
this this,
) )
this.load() this.load()
}) })
@ -268,7 +268,7 @@ export default {
.then(() => { .then(() => {
this.success( this.success(
{message: 'The link share was successfully deleted'}, {message: 'The link share was successfully deleted'},
this this,
) )
this.load() this.load()
}) })

View File

@ -202,11 +202,11 @@ export default {
this.searchLabel = 'username' this.searchLabel = 'username'
if (this.type === 'list') { if (this.type === 'list') {
this.typeString = `list` this.typeString = 'list'
this.stuffService = new UserListService() this.stuffService = new UserListService()
this.stuffModel = new UserListModel({listId: this.id}) this.stuffModel = new UserListModel({listId: this.id})
} else if (this.type === 'namespace') { } else if (this.type === 'namespace') {
this.typeString = `namespace` this.typeString = 'namespace'
this.stuffService = new UserNamespaceService() this.stuffService = new UserNamespaceService()
this.stuffModel = new UserNamespaceModel({ this.stuffModel = new UserNamespaceModel({
namespaceId: this.id, namespaceId: this.id,
@ -220,11 +220,11 @@ export default {
this.searchLabel = 'name' this.searchLabel = 'name'
if (this.type === 'list') { if (this.type === 'list') {
this.typeString = `list` this.typeString = 'list'
this.stuffService = new TeamListService() this.stuffService = new TeamListService()
this.stuffModel = new TeamListModel({listId: this.id}) this.stuffModel = new TeamListModel({listId: this.id})
} else if (this.type === 'namespace') { } else if (this.type === 'namespace') {
this.typeString = `namespace` this.typeString = 'namespace'
this.stuffService = new TeamNamespaceService() this.stuffService = new TeamNamespaceService()
this.stuffModel = new TeamNamespaceModel({ this.stuffModel = new TeamNamespaceModel({
namespaceId: this.id, namespaceId: this.id,
@ -245,7 +245,7 @@ export default {
.then((r) => { .then((r) => {
this.$set(this, 'sharables', r) this.$set(this, 'sharables', r)
r.forEach((s) => r.forEach((s) =>
this.$set(this.selectedRight, s.id, s.right) this.$set(this.selectedRight, s.id, s.right),
) )
}) })
.catch((e) => { .catch((e) => {
@ -302,7 +302,7 @@ export default {
this.shareType + this.shareType +
' was successfully added.', ' was successfully added.',
}, },
this this,
) )
this.load() this.load()
}) })
@ -347,7 +347,7 @@ export default {
this.shareType + this.shareType +
' right was successfully updated.', ' right was successfully updated.',
}, },
this this,
) )
}) })
.catch((e) => { .catch((e) => {

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="field is-grouped"> <div class="field is-grouped" v-if="validListIdAvailable">
<p <p
:class="{ 'is-loading': taskService.loading }" :class="{ 'is-loading': taskService.loading }"
class="control has-icons-left is-expanded" class="control has-icons-left is-expanded"
@ -31,35 +31,37 @@
</template> </template>
<script> <script>
import LabelTask from "../../models/labelTask"; import LabelTask from '../../models/labelTask';
import LabelModel from "../../models/label"; import LabelModel from '../../models/label';
import { HAS_TASKS } from "@/store/mutation-types"; import { HAS_TASKS } from '@/store/mutation-types';
// import Nothing from "@/components/misc/nothing"; // import Nothing from "@/components/misc/nothing";
import ListService from "../../services/list"; import ListService from '../../services/list';
import TaskService from "../../services/task"; import TaskService from '../../services/task';
import TaskModel from "../../models/task"; import TaskModel from '../../models/task';
import LabelService from "../../services/label"; import LabelService from '../../services/label';
import LabelTaskService from "../../services/labelTask"; import LabelTaskService from '../../services/labelTask';
export default { export default {
name: "add-task", name: 'add-task',
data() { data() {
return { return {
newTaskText: "", newTaskText: '',
listService: ListService, listService: ListService,
taskService: TaskService, taskService: TaskService,
labelService: LabelService, labelService: LabelService,
labelTaskService: LabelTaskService labelTaskService: LabelTaskService,
listIdForNewTask: undefined,
validListIdAvailable: false,
}; };
}, },
components: {}, components: {},
props: { props: {
listId: { listId: {
type: Number, type: Number,
required: false required: false,
} },
}, },
created() { created() {
this.listService = new ListService(); this.listService = new ListService();
@ -67,32 +69,33 @@ export default {
this.labelService = new LabelService(); this.labelService = new LabelService();
this.labelTaskService = new LabelTaskService(); this.labelTaskService = new LabelTaskService();
}, },
beforeMount() {
console.log(this.listId);
if (this.listId !== undefined) {
this.listIdForNewTask = this.listId;
this.validListIdAvailable = true;
}
},
methods: { methods: {
addTask() { addTask() {
if (this.newTaskText === "") { if (this.newTaskText === '') {
this.showError = true; this.showError = true;
return; return;
} }
this.showError = false; this.showError = false;
let task = new TaskModel({ const task = new TaskModel({
title: this.newTaskText, title: this.newTaskText,
listId: this.listId listId: this.listIdForNewTask,
}); });
if (this.listId === undefined) {
// TODO: Have a default list in settings.
task.listId = 1;
}
this.taskService this.taskService
.create(task) .create(task)
.then(task => { .then(task => {
// this.tasks.push(task); this.newTaskText = '';
// this.sortTasks();
this.newTaskText = "";
// Check if the task has words starting with ~ in the title and make them to labels // Check if the task has words starting with ~ in the title and make them to labels
const parts = task.title.split(" ~"); const parts = task.title.split(' ~');
// The first element will always contain the title, even if there is no occurrence of ~ // The first element will always contain the title, even if there is no occurrence of ~
if (parts.length > 1) { if (parts.length > 1) {
// First, create an unresolved promise for each entry in the array to wait // First, create an unresolved promise for each entry in the array to wait
@ -107,7 +110,7 @@ export default {
labelAddsToWaitFor.push( labelAddsToWaitFor.push(
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
labelAddings.push({ resolve: resolve, reject: reject }); labelAddings.push({ resolve: resolve, reject: reject });
}) }),
); );
}); });
@ -118,10 +121,10 @@ export default {
} }
// The part up until the next space // The part up until the next space
const labelTitle = p.split(" ")[0]; const labelTitle = p.split(' ')[0];
// Don't create an empty label // Don't create an empty label
if (labelTitle === "") { if (labelTitle === '') {
return; return;
} }
@ -133,7 +136,7 @@ export default {
if (res.length > 0 && res[0].title === labelTitle) { if (res.length > 0 && res[0].title === labelTitle) {
const labelTask = new LabelTask({ const labelTask = new LabelTask({
taskId: task.id, taskId: task.id,
labelId: res[0].id labelId: res[0].id,
}); });
this.labelTaskService this.labelTaskService
.create(labelTask) .create(labelTask)
@ -141,7 +144,7 @@ export default {
task.labels.push(res[0]); task.labels.push(res[0]);
// Remove the label text from the task title // Remove the label text from the task title
task.title = task.title.replace(` ~${labelTitle}`, ""); task.title = task.title.replace(` ~${labelTitle}`, '');
// Make the promise done (the one with the index 0 does not exist) // Make the promise done (the one with the index 0 does not exist)
labelAddings[index - 1].resolve(result); labelAddings[index - 1].resolve(result);
@ -157,7 +160,7 @@ export default {
.then(res => { .then(res => {
const labelTask = new LabelTask({ const labelTask = new LabelTask({
taskId: task.id, taskId: task.id,
labelId: res.id labelId: res.id,
}); });
this.labelTaskService this.labelTaskService
.create(labelTask) .create(labelTask)
@ -167,7 +170,7 @@ export default {
// Remove the label text from the task title // Remove the label text from the task title
task.title = task.title.replace( task.title = task.title.replace(
` ~${labelTitle}`, ` ~${labelTitle}`,
"" '',
); );
// Make the promise done (the one with the index 0 does not exist) // Make the promise done (the one with the index 0 does not exist)
@ -192,10 +195,6 @@ export default {
Promise.all(labelAddsToWaitFor).then(() => { Promise.all(labelAddsToWaitFor).then(() => {
this.taskService this.taskService
.update(task) .update(task)
// .then(updatedTask => {
// this.updateTasks(updatedTask);
// this.$store.commit(HAS_TASKS, true);
// })
.then(() => { .then(() => {
this.$store.commit(HAS_TASKS, true); this.$store.commit(HAS_TASKS, true);
}) })
@ -204,12 +203,12 @@ export default {
}); });
}); });
} }
this.$emit("taskAdded", task); this.$emit('taskAdded', task);
}) })
.catch(e => { .catch(e => {
this.error(e, this); this.error(e, this);
}); });
} },
} },
}; };
</script> </script>

View File

@ -387,7 +387,7 @@ export default {
let startDate = new Date(this.startDate) let startDate = new Date(this.startDate)
startDate.setDate( startDate.setDate(
startDate.getDate() + newRect.left / this.dayWidth startDate.getDate() + newRect.left / this.dayWidth,
) )
startDate.setUTCHours(0) startDate.setUTCHours(0)
startDate.setUTCMinutes(0) startDate.setUTCMinutes(0)
@ -396,7 +396,7 @@ export default {
this.taskDragged.startDate = startDate this.taskDragged.startDate = startDate
let endDate = new Date(startDate) let endDate = new Date(startDate)
endDate.setDate( endDate.setDate(
startDate.getDate() + newRect.width / this.dayWidth startDate.getDate() + newRect.width / this.dayWidth,
) )
this.taskDragged.startDate = startDate this.taskDragged.startDate = startDate
this.taskDragged.endDate = endDate this.taskDragged.endDate = endDate
@ -439,7 +439,7 @@ export default {
this.$set( this.$set(
this.theTasks, this.theTasks,
tt, tt,
this.addGantAttributes(r) this.addGantAttributes(r),
) )
break break
} }

View File

@ -224,7 +224,7 @@ export default {
.then((r) => { .then((r) => {
this.$store.commit( this.$store.commit(
'attachments/removeById', 'attachments/removeById',
this.attachmentToDelete.id this.attachmentToDelete.id,
) )
this.success(r, this) this.success(r, this)
}) })

View File

@ -260,7 +260,7 @@ export default {
this.newComment.comment = '' this.newComment.comment = ''
this.success( this.success(
{message: 'The comment was added successfully.'}, {message: 'The comment was added successfully.'},
this this,
) )
}) })
.catch((e) => { .catch((e) => {

View File

@ -91,7 +91,7 @@ export default {
.finally(() => { .finally(() => {
this.saving = false this.saving = false
}) })
} },
}, },
} }
</script> </script>

View File

@ -95,7 +95,7 @@ export default {
.finally(() => { .finally(() => {
this.saving = false this.saving = false
}) })
} },
}, },
} }
</script> </script>

View File

@ -135,7 +135,7 @@ export default {
showListColor: { showListColor: {
type: Boolean, type: Boolean,
default: true, default: true,
} },
}, },
watch: { watch: {
theTask(newVal) { theTask(newVal) {
@ -183,7 +183,7 @@ export default {
callback: () => { callback: () => {
this.task.done = !this.task.done this.task.done = !this.task.done
this.markAsDone(!checked) this.markAsDone(!checked)
} },
}], }],
) )
}) })

View File

@ -12,7 +12,7 @@ export const createDateFromString = dateString => {
} }
if (dateString.includes('-')) { if (dateString.includes('-')) {
dateString = dateString.replace(/-/g, "/") dateString = dateString.replace(/-/g, '/')
} }
return new Date(dateString) return new Date(dateString)

View File

@ -170,7 +170,7 @@ export default new Router({
name: 'list.create', name: 'list.create',
components: { components: {
popup: NewListComponent, popup: NewListComponent,
} },
}, },
{ {
path: '/namespaces/:id/settings/edit', path: '/namespaces/:id/settings/edit',

View File

@ -69,6 +69,6 @@ export default {
ctx.commit('setList', list) ctx.commit('setList', list)
return Promise.reject(e) return Promise.reject(e)
}) })
} },
}, },
} }

View File

@ -1,11 +1,11 @@
<template> <template>
<div class="content has-text-centered"> <div class="content has-text-centered">
<h2> <h2>
{{ welcomePrefix }} Hi {{ userInfo.name !== '' ? userInfo.name : userInfo.username }}!
{{ userInfo.name !== "" ? userInfo.name : userInfo.username }}!
</h2> </h2>
<div>{{ defaultListId }}</div>
<add-task <add-task
:list="defaultList" :listId="defaultListId"
@taskAdded="updateTaskList" @taskAdded="updateTaskList"
class="is-max-width-desktop" class="is-max-width-desktop"
/> />
@ -35,38 +35,27 @@
</template> </template>
<script> <script>
import { mapState } from "vuex"; import { mapState } from 'vuex';
import ShowTasks from "./tasks/ShowTasks"; import ShowTasks from './tasks/ShowTasks';
import AddTask from "../components/tasks/add-task"; import AddTask from '../components/tasks/add-task';
import ListModel from "../models/list";
export default { export default {
name: "Home", name: 'Home',
components: { components: {
ShowTasks, ShowTasks,
AddTask AddTask,
}, },
data() { data() {
return { return {
loading: false, loading: false,
currentDate: new Date(), currentDate: new Date(),
tasks: [], tasks: [],
defaultList: ListModel, defaultListId: undefined,
updateWelcomeInterval: 1000, showTasksKey: 0,
welcomePrefix: "Hi",
showTasksKey: 0
}; };
}, },
created() { created() {
this.defaultList = new ListModel(); //TODO: Load the value from user settings. Until then it will not render the add task component.
this.defaultList.id = 1;
},
mounted() {
const timer = window.setTimeout(
this.updateWelcome,
this.updateWelcomeInterval
);
this.$on("hook:destroyed", () => window.clearTimeout(timer));
}, },
computed: mapState({ computed: mapState({
migratorsEnabled: state => migratorsEnabled: state =>
@ -88,26 +77,12 @@ export default {
} }
return state.namespaces.namespaces[0].lists.length > 0; return state.namespaces.namespaces[0].lists.length > 0;
} },
}), }),
methods: { methods: {
updateTaskList() { updateTaskList() {
this.showTasksKey += 1; this.showTasksKey += 1;
}, },
updateWelcome() { },
this.currentDate = new Date();
if (this.currentDate.getHours() < 12) {
this.welcomePrefix = "Good Morning";
} else if (this.currentDate.getHours() < 17) {
this.welcomePrefix = "Good Afternoon";
} else {
this.welcomePrefix = "Good Evening";
}
this.$options.timer = window.setTimeout(
this.updateDateTime,
this.updateWelcomeInterval
);
}
}
}; };
</script> </script>

View File

@ -79,7 +79,7 @@ export default {
}) })
this.success( this.success(
{ message: 'The label was successfully created.' }, { message: 'The label was successfully created.' },
this this,
) )
}) })
.catch((e) => { .catch((e) => {

View File

@ -71,7 +71,7 @@ export default {
.then((r) => { .then((r) => {
this.success( this.success(
{ message: 'The list was successfully created.' }, { message: 'The list was successfully created.' },
this this,
) )
this.$router.push({ this.$router.push({
name: 'list.index', name: 'list.index',

View File

@ -165,36 +165,36 @@
</template> </template>
<script> <script>
import TaskService from "../../../services/task"; import TaskService from '../../../services/task';
import TaskModel from "../../../models/task"; import TaskModel from '../../../models/task';
import LabelTaskService from "../../../services/labelTask"; import LabelTaskService from '../../../services/labelTask';
import LabelService from "../../../services/label"; import LabelService from '../../../services/label';
import EditTask from "../../../components/tasks/edit-task"; import EditTask from '../../../components/tasks/edit-task';
import AddTask from "../../../components/tasks/add-task"; import AddTask from '../../../components/tasks/add-task';
import SingleTaskInList from "../../../components/tasks/partials/singleTaskInList"; import SingleTaskInList from '../../../components/tasks/partials/singleTaskInList';
import taskList from "../../../components/tasks/mixins/taskList"; import taskList from '../../../components/tasks/mixins/taskList';
import { saveListView } from "@/helpers/saveListView"; import { saveListView } from '@/helpers/saveListView';
import Rights from "../../../models/rights.json"; import Rights from '../../../models/rights.json';
import { mapState } from "vuex"; import { mapState } from 'vuex';
import FilterPopup from "@/components/list/partials/filter-popup"; import FilterPopup from '@/components/list/partials/filter-popup';
import { HAS_TASKS } from "@/store/mutation-types"; import { HAS_TASKS } from '@/store/mutation-types';
import Nothing from "@/components/misc/nothing"; import Nothing from '@/components/misc/nothing';
export default { export default {
name: "List", name: 'List',
data() { data() {
return { return {
taskService: TaskService, taskService: TaskService,
isTaskEdit: false, isTaskEdit: false,
taskEditTask: TaskModel, taskEditTask: TaskModel,
newTaskText: "", newTaskText: '',
showError: false, showError: false,
labelTaskService: LabelTaskService, labelTaskService: LabelTaskService,
labelService: LabelService, labelService: LabelService,
ctaVisible: false ctaVisible: false,
}; };
}, },
mixins: [taskList], mixins: [taskList],
@ -203,7 +203,7 @@ export default {
FilterPopup, FilterPopup,
SingleTaskInList, SingleTaskInList,
EditTask, EditTask,
AddTask AddTask,
}, },
created() { created() {
this.taskService = new TaskService(); this.taskService = new TaskService();
@ -216,14 +216,14 @@ export default {
}, },
computed: mapState({ computed: mapState({
canWrite: state => state.currentList.maxRight > Rights.READ, canWrite: state => state.currentList.maxRight > Rights.READ,
list: state => state.currentList list: state => state.currentList,
}), }),
mounted() { mounted() {
this.$nextTick(() => (this.ctaVisible = true)); this.$nextTick(() => (this.ctaVisible = true));
}, },
methods: { methods: {
// This function initializes the tasks page and loads the first page of tasks // This function initializes the tasks page and loads the first page of tasks
initTasks(page, search = "") { initTasks(page, search = '') {
this.taskEditTask = null; this.taskEditTask = null;
this.isTaskEdit = false; this.isTaskEdit = false;
this.loadTasks(page, search); this.loadTasks(page, search);
@ -255,7 +255,7 @@ export default {
} }
} }
this.sortTasks(); this.sortTasks();
} },
} },
}; };
</script> </script>

View File

@ -82,7 +82,7 @@ export default {
this.$store.commit('namespaces/addNamespace', r) this.$store.commit('namespaces/addNamespace', r)
this.success( this.success(
{ message: 'The namespace was successfully created.' }, { message: 'The namespace was successfully created.' },
this this,
) )
this.$router.back() this.$router.back()
}) })

View File

@ -637,7 +637,7 @@ export default {
this.$refs[fieldName].$el.scrollIntoView({ this.$refs[fieldName].$el.scrollIntoView({
behavior: 'smooth', behavior: 'smooth',
block: 'center', block: 'center',
inline: 'nearest' inline: 'nearest',
}) })
} }
}) })

View File

@ -265,7 +265,7 @@ export default {
this.team = response this.team = response
this.success( this.success(
{message: 'The team was successfully updated.'}, {message: 'The team was successfully updated.'},
this this,
) )
}) })
.catch((e) => { .catch((e) => {
@ -278,7 +278,7 @@ export default {
.then(() => { .then(() => {
this.success( this.success(
{message: 'The team was successfully deleted.'}, {message: 'The team was successfully deleted.'},
this this,
) )
router.push({name: 'teams.index'}) router.push({name: 'teams.index'})
}) })
@ -295,7 +295,7 @@ export default {
message: message:
'The user was successfully deleted from the team.', 'The user was successfully deleted from the team.',
}, },
this this,
) )
this.loadTeam() this.loadTeam()
}) })
@ -317,7 +317,7 @@ export default {
this.loadTeam() this.loadTeam()
this.success( this.success(
{message: 'The team member was successfully added.'}, {message: 'The team member was successfully added.'},
this this,
) )
}) })
.catch((e) => { .catch((e) => {
@ -343,7 +343,7 @@ export default {
(member.admin ? 'admin' : 'member') + (member.admin ? 'admin' : 'member') +
'.', '.',
}, },
this this,
) )
}) })
.catch((e) => { .catch((e) => {

View File

@ -69,7 +69,7 @@ export default {
}) })
this.success( this.success(
{ message: 'The team was successfully created.' }, { message: 'The team was successfully created.' },
this this,
) )
}) })
.catch((e) => { .catch((e) => {

View File

@ -127,7 +127,7 @@ export default {
let emailVerifyToken = localStorage.getItem('emailConfirmToken') let emailVerifyToken = localStorage.getItem('emailConfirmToken')
if (emailVerifyToken) { if (emailVerifyToken) {
const cancel = message.setLoading(this) const cancel = message.setLoading(this)
HTTP.post(`user/confirm`, {token: emailVerifyToken}) HTTP.post('user/confirm', {token: emailVerifyToken})
.then(() => { .then(() => {
localStorage.removeItem('emailConfirmToken') localStorage.removeItem('emailConfirmToken')
this.confirmedEmailSuccess = true this.confirmedEmailSuccess = true

View File

@ -320,7 +320,7 @@ export default {
migratorsEnabled: state => state.config.availableMigrators !== null && state.config.availableMigrators.length > 0, migratorsEnabled: state => state.config.availableMigrators !== null && state.config.availableMigrators.length > 0,
caldavEnabled: state => state.config.caldavEnabled, caldavEnabled: state => state.config.caldavEnabled,
userInfo: state => state.auth.info, userInfo: state => state.auth.info,
}) }),
}, },
methods: { methods: {
updatePassword() { updatePassword() {

View File

@ -20,22 +20,22 @@ module.exports = {
msTileImage: 'images/icons/msapplication-icon-144x144.png', msTileImage: 'images/icons/msapplication-icon-144x144.png',
}, },
manifestOptions: { manifestOptions: {
"icons": [ 'icons': [
{ {
"src": "./images/icons/android-chrome-192x192.png", 'src': './images/icons/android-chrome-192x192.png',
"sizes": "192x192", 'sizes': '192x192',
"type": "image/png" 'type': 'image/png',
}, },
{ {
"src": "./images/icons/android-chrome-512x512.png", 'src': './images/icons/android-chrome-512x512.png',
"sizes": "512x512", 'sizes': '512x512',
"type": "image/png" 'type': 'image/png',
}, },
{ {
"src": "./images/icons/icon-maskable.png", 'src': './images/icons/icon-maskable.png',
"sizes": "1024x1024", 'sizes': '1024x1024',
"type": "image/png", 'type': 'image/png',
"purpose": "maskable" 'purpose': 'maskable',
}, },
], ],
shortcuts: [ shortcuts: [
@ -62,8 +62,8 @@ module.exports = {
name: 'Teams Overview', name: 'Teams Overview',
short_name: 'Teams', short_name: 'Teams',
url: '/teams', url: '/teams',
} },
] ],
}, },
} },
} }