Compare commits

..

2 Commits

Author SHA1 Message Date
Jakob Röhrl
0949886348 now it's working
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
2020-01-31 08:43:59 +01:00
Jakob Röhrl
e4ccf431a4 create several cards if the new title contains a linebreak
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
2020-01-30 12:28:27 +01:00
8 changed files with 29 additions and 152 deletions

View File

@@ -28,32 +28,25 @@ use OCP\IRequest;
use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Controller; use OCP\AppFramework\Controller;
use OCP\IL10N; use OCP\IL10N;
use OCP\IConfig;
use OCP\IInitialStateService;
class PageController extends Controller { class PageController extends Controller {
private $permissionService; private $permissionService;
private $userId; private $userId;
private $l10n; private $l10n;
private $config;
public function __construct( public function __construct(
$AppName, $AppName,
IRequest $request, IRequest $request,
PermissionService $permissionService, PermissionService $permissionService,
IL10N $l10n, IL10N $l10n,
$userId, $userId
IConfig $config,
IInitialStateService $initialStateService
) { ) {
parent::__construct($AppName, $request); parent::__construct($AppName, $request);
$this->userId = $userId; $this->userId = $userId;
$this->permissionService = $permissionService; $this->permissionService = $permissionService;
$this->l10n = $l10n; $this->l10n = $l10n;
$this->config = $config;
$this->initialStateService = $initialStateService;
} }
/** /**
@@ -70,8 +63,6 @@ class PageController extends Controller {
'canCreate' => $this->permissionService->canCreate() 'canCreate' => $this->permissionService->canCreate()
]; ];
$this->initialStateService->provideInitialState($this->appName, 'calendar', $this->config->getAppValue('calendar', 'enabled', 'no') === 'yes');
return new TemplateResponse('deck', 'main', $params); return new TemplateResponse('deck', 'main', $params);
} }

25
package-lock.json generated
View File

@@ -3539,21 +3539,6 @@
} }
} }
}, },
"@nextcloud/initial-state": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-1.1.0.tgz",
"integrity": "sha512-c8VNSv7CbcPdaMNQO3ERJUMhsGyCvAgSBlvBHhugYHxGqlySjE+J+SqkpXmqB+eQ/DujDTahBX1IwoF3zjPtOw==",
"requires": {
"core-js": "3.6.1"
},
"dependencies": {
"core-js": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.1.tgz",
"integrity": "sha512-186WjSik2iTGfDjfdCZAxv2ormxtKgemjC3SI6PL31qOA0j5LhTDVjHChccoc7brwLvpvLPiMyRlcO88C4l1QQ=="
}
}
},
"@nextcloud/l10n": { "@nextcloud/l10n": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/@nextcloud/l10n/-/l10n-1.0.1.tgz", "resolved": "https://registry.npmjs.org/@nextcloud/l10n/-/l10n-1.0.1.tgz",
@@ -13384,7 +13369,7 @@
}, },
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.1",
"resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true, "dev": true,
"requires": { "requires": {
@@ -14064,7 +14049,7 @@
}, },
"os-homedir": { "os-homedir": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
"dev": true "dev": true
}, },
@@ -14081,7 +14066,7 @@
}, },
"os-tmpdir": { "os-tmpdir": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true "dev": true
}, },
@@ -14253,7 +14238,7 @@
}, },
"path-is-absolute": { "path-is-absolute": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
}, },
"path-key": { "path-key": {
@@ -17192,7 +17177,7 @@
}, },
"string_decoder": { "string_decoder": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": { "requires": {
"safe-buffer": "~5.1.0" "safe-buffer": "~5.1.0"

View File

@@ -30,7 +30,6 @@
"@babel/runtime": "^7.8.3", "@babel/runtime": "^7.8.3",
"@nextcloud/auth": "^1.2.1", "@nextcloud/auth": "^1.2.1",
"@nextcloud/axios": "^1.3.1", "@nextcloud/axios": "^1.3.1",
"@nextcloud/initial-state": "^1.1.0",
"@nextcloud/l10n": "^1.0.1", "@nextcloud/l10n": "^1.0.1",
"@nextcloud/router": "^1.0.0", "@nextcloud/router": "^1.0.0",
"@nextcloud/vue": "^1.3.0", "@nextcloud/vue": "^1.3.0",

View File

@@ -53,13 +53,13 @@
<form v-if="showAddCard" class="stack--card-add" @submit.prevent="clickAddCard()"> <form v-if="showAddCard" class="stack--card-add" @submit.prevent="clickAddCard()">
<label for="new-stack-input-main" class="hidden-visually">{{ t('deck', 'Add a new card') }}</label> <label for="new-stack-input-main" class="hidden-visually">{{ t('deck', 'Add a new card') }}</label>
<input id="new-stack-input-main" <textarea id="new-stack-input-main"
v-model="newCardTitle" v-model="newCardTitle"
v-focus v-focus
type="text" type="text"
class="no-close" class="no-close"
placeholder="Add a new card" placeholder="Add a new card"
required> required />
<input class="icon-confirm" <input class="icon-confirm"
type="submit" type="submit"
@@ -161,14 +161,32 @@ export default {
this.editing = false this.editing = false
}, },
clickAddCard() { clickAddCard() {
const match = /\r|\n/.exec(this.newCardTitle)
if (match) {
console.log(match)
const results = this.newCardTitle.split(match[0])
results.forEach((line) => {
this.addCard(line)
})
this.newCardTitle = ''
this.showAddCard = false
} else {
this.addCard(this.newCardTitle)
this.newCardTitle = ''
this.showAddCard = false
}
},
addCard(title) {
const newCard = { const newCard = {
title: this.newCardTitle, title: title,
stackId: this.stack.id, stackId: this.stack.id,
boardId: this.stack.boardId, boardId: this.stack.boardId,
} }
this.$store.dispatch('addCard', newCard) this.$store.dispatch('addCard', newCard)
this.newCardTitle = ''
this.showAddCard = false
}, },
}, },
} }

View File

@@ -40,7 +40,6 @@
:boards="sharedBoards" :boards="sharedBoards"
icon="icon-shared" /> icon="icon-shared" />
<AppNavigationAddBoard /> <AppNavigationAddBoard />
<AppNavigationCalendar />
</ul> </ul>
<div v-if="isAdmin" <div v-if="isAdmin"
id="app-settings" id="app-settings"
@@ -74,7 +73,6 @@ import { Multiselect } from '@nextcloud/vue/dist/Components/Multiselect'
import AppNavigationAddBoard from './AppNavigationAddBoard' import AppNavigationAddBoard from './AppNavigationAddBoard'
import AppNavigationBoardCategory from './AppNavigationBoardCategory' import AppNavigationBoardCategory from './AppNavigationBoardCategory'
import AppNavigationCalendar from './AppNavigationCalendar'
export default { export default {
name: 'AppNavigation', name: 'AppNavigation',
@@ -82,7 +80,6 @@ export default {
AppNavigationAddBoard, AppNavigationAddBoard,
AppNavigationBoardCategory, AppNavigationBoardCategory,
Multiselect, Multiselect,
AppNavigationCalendar,
}, },
directives: { directives: {
ClickOutside, ClickOutside,

View File

@@ -1,72 +0,0 @@
<!--
- @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
-
- @author John Molakvoæ <skjnldsv@protonmail.com>
-
- @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/>.
-
-->
<template>
<li id="deck-navigation-add"
:title="t('deck', 'Calendar')"
:class="[{'icon-loading-small': loading, 'editing': editing}, classes]">
<a class="icon-calendar" href="/calendar" @click.prevent.stop="startCreateBoard">
{{ t('deck', 'Calendar') }}
</a>
</li>
</template>
<script>
export default {
name: 'AppNavigationCalendar',
components: { },
directives: {},
props: {},
data() {
return {
}
},
computed: {},
watch: {},
mounted() {},
methods: {
startCreateBoard(e) {
},
},
}
</script>
<style lang="scss" scoped>
#app-navigation .app-navigation-entry-edit div {
width: auto;
display: block;
}
.app-navigation-entry-bullet-wrapper {
position: absolute;
left: 33px;
width: 44px !important;
margin: 6px;
height: 44px;
.color0 {
width: 30px !important;
height: 30px;
border-radius: 50%;
background-size: 14px;
}
}
</style>

View File

@@ -29,28 +29,13 @@ import Board from './components/board/Board'
import Sidebar from './components/Sidebar' import Sidebar from './components/Sidebar'
import BoardSidebar from './components/board/BoardSidebar' import BoardSidebar from './components/board/BoardSidebar'
import CardSidebar from './components/card/CardSidebar' import CardSidebar from './components/card/CardSidebar'
import IsCalendarInstalled from '../src/services/IsCalendarInstalled'
Vue.use(Router) Vue.use(Router)
let calendarPath = generateUrl('/apps/calendar')
if (!IsCalendarInstalled) {
calendarPath = generateUrl('/settings/apps/integration/calendar')
}
export default new Router({ export default new Router({
base: generateUrl('/apps/deck/'), base: generateUrl('/apps/deck/'),
linkActiveClass: 'active', linkActiveClass: 'active',
routes: [ routes: [
{
path: '/calendar',
name: 'calendar',
beforeEnter() {
location.href = calendarPath
}
},
{ {
path: '/', path: '/',
name: 'main', name: 'main',

View File

@@ -1,26 +0,0 @@
/**
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @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/>.
*
*/
import { loadState } from '@nextcloud/initial-state'
const calendar = loadState('deck', 'calendar')
export default calendar