Skip to content

Commit

Permalink
Fix compilation, integration and linting errors
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
  • Loading branch information
raimund-schluessler committed Jun 15, 2021
1 parent bbefe4c commit adde730
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 64 deletions.
4 changes: 4 additions & 0 deletions img/tasks-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace OCA\Tasks\AppInfo;

use OCA\Taks\Dashboard\TasksWidget;
use OCA\Tasks\Dashboard\TasksWidget;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
Expand All @@ -46,5 +46,4 @@ public function register(IRegistrationContext $context): void {

public function boot(IBootContext $context): void {
}

}
8 changes: 4 additions & 4 deletions lib/Dashboard/TasksWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ public function getUrl(): ?string {
* @inheritDoc
*/
public function load(): void {
\OCP\Util::addScript('tasks', 'tasks');
\OCP\Util::addScript('tasks', 'tasks-dashboard');

$this->initialStateService->provideLazyInitialState(Application::APP_ID, 'dashboard', function () {
return $this->dataService;
});
// $this->initialStateService->provideLazyInitialState(Application::APP_ID, 'dashboard', function () {
// return $this->dataService;
// });
}
}
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
"bugs": "https://github.com/nextcloud/tasks/issues",
"contributors": [],
"dependencies": {
"@nextcloud/auth": "^1.3.0",
"@nextcloud/axios": "^1.6.0",
"@nextcloud/dialogs": "^3.1.2",
"@nextcloud/event-bus": "^2.0.0",
"@nextcloud/initial-state": "1.2.0",
"@nextcloud/l10n": "^1.4.1",
"@nextcloud/moment": "^1.1.1",
"@nextcloud/router": "^2.0.0",
"@nextcloud/vue": "^4.0.0",
Expand Down
7 changes: 7 additions & 0 deletions src/css/dashboard.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.icon-tasks {
background-image: url(./../../img/tasks-dark.svg);
}

body.dark .icon-tasks {
background-image: url(./../../img/tasks.svg);
}
20 changes: 14 additions & 6 deletions src/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@
*
*/

import Vue from 'vue'
import Dashboard from './views/Dashboard'
import store from './store/store.js'

import './css/dashboard.scss'

import { generateFilePath } from '@nextcloud/router'
import { getRequestToken } from '@nextcloud/auth'
import { translate, translatePlural } from '@nextcloud/l10n'
import Dashboard from './views/Dashboard'
import store from './store/store.js'

import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

// eslint-disable-next-line
__webpack_nonce__ = btoa(getRequestToken())
Expand All @@ -38,12 +45,13 @@ Vue.prototype.n = translatePlural
Vue.prototype.OC = OC
Vue.prototype.OCA = OCA

document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('DOMContentLoaded', () => {
OCA.Dashboard.register('tasks', (el) => {
const View = Vue.extend(Dashboard)
new View({
store,
const vm = new View({
propsData: {},
store,
}).$mount(el)
return vm
})
})
80 changes: 28 additions & 52 deletions src/views/Dashboard.vue
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
<!--
- @copyright Copyright (c) 2021 Jakob Röhrl <jakob.roehrl@web.de>
-
- @author Jakob Röhrl <jakob.roehrl@web.de>
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-->
Nextcloud - Tasks
@author Jakob Röhrl
@copyright 2021 Jakob Röhrl <jakob.roehrl@web.de>
@author Raimund Schlüßler
@copyright 2021 Raimund Schlüßler <raimund.schluessler@mailbox.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
License as published by the Free Software Foundation; either
version 3 of the License, or any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU AFFERO GENERAL PUBLIC LICENSE for more details.
You should have received a copy of the GNU Affero General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
-->
<template>
<DashboardWidget :items="cards"
<DashboardWidget :items="tasks"
empty-content-icon="icon-tasks"
:empty-content-message="t('tasks', 'No upcoming tasks')"
:show-more-text="t('tasks', 'upcoming cards')"
:show-more-text="t('tasks', 'upcoming tasks')"
:show-more-url="showMoreUrl"
:loading="loading"
@hide="() => {}"
@markDone="() => {}">
<template #default="{ item }">
<a :key="item.id"
:href="cardLink(item)"
:href="taskLink(item)"
target="_blank"
class="card">
<div class="card--header">
Expand All @@ -50,53 +52,27 @@

<script>
import { DashboardWidget } from '@nextcloud/vue-dashboard'
import { mapGetters } from 'vuex'
// import { mapGetters } from 'vuex'
// import labelStyle from './../mixins/labelStyle'
// import DueDate from '../components/cards/badges/DueDate'
import { generateUrl } from '@nextcloud/router'
export default {
name: 'Dashboard',
components: {
// DueDate,
DashboardWidget,
},
// mixins: [labelStyle],
data() {
return {
loading: false,
tasks: [],
}
},
computed: {
// ...mapGetters([
// 'assignedCardsDashboard',
// ]),
// cards() {
// const list = [
// ...this.assignedCardsDashboard,
// ].filter((card) => {
// return card.duedate !== null
// })
// list.sort((a, b) => {
// return (new Date(a.duedate)).getTime() - (new Date(b.duedate)).getTime()
// })
// return list
// },
// cardLink() {
// return (card) => {
// return generateUrl('/apps/deck') + `#/board/${card.boardId}/card/${card.id}`
// }
// },
showMoreUrl() {
return this.cards.length > 7 ? generateUrl('/apps/tasks') : null
},
},
// beforeMount() {
// this.loading = true
// this.$store.dispatch('loadUpcoming').then(() => {
// this.loading = false
// })
// },
}
</script>

Expand Down Expand Up @@ -143,4 +119,4 @@ export default {
.right {
float: right;
}
</style>
</style>

0 comments on commit adde730

Please sign in to comment.