Skip to content

Commit

Permalink
Fix styling and rename to actual dashboard api
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliushaertl committed Aug 20, 2020
1 parent 85c3f69 commit 640ba67
Show file tree
Hide file tree
Showing 14 changed files with 133 additions and 97 deletions.
8 changes: 4 additions & 4 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
use OCA\Deck\Capabilities;
use OCA\Deck\Collaboration\Resources\ResourceProvider;
use OCA\Deck\Collaboration\Resources\ResourceProviderCard;
use OCA\Deck\Dashboard\DeckPanel;
use OCA\Deck\Dashboard\DeckWidget;
use OCA\Deck\Db\Acl;
use OCA\Deck\Db\AclMapper;
use OCA\Deck\Db\AssignedUsersMapper;
Expand All @@ -44,7 +44,7 @@
use OCP\Collaboration\Resources\IManager;
use OCP\Collaboration\Resources\IProviderManager;
use OCP\Comments\CommentsEntityEvent;
use OCP\Dashboard\RegisterPanelEvent;
use OCP\Dashboard\RegisterWidgetEvent;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\FullTextSearch\IFullTextSearchManager;
Expand Down Expand Up @@ -92,9 +92,9 @@ public function __construct(array $urlParams = []) {
if ($version >= 20) {
/** @var IEventDispatcher $dispatcher */
$dispatcher = $container->getServer()->query(IEventDispatcher::class);
$dispatcher->addListener(RegisterPanelEvent::class, function (RegisterPanelEvent $event) use ($container) {
$dispatcher->addListener(RegisterWidgetEvent::class, function (RegisterWidgetEvent $event) use ($container) {
\OCP\Util::addScript('myapp', 'dashboard');
$event->registerPanel(DeckPanel::class);
$event->registerWidget(DeckWidget::class);
});
}
}
Expand Down
16 changes: 13 additions & 3 deletions lib/Dashboard/DeckPanel.php → lib/Dashboard/DeckWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,19 @@
namespace OCA\Deck\Dashboard;


use OCP\Dashboard\IPanel;
use OCP\Dashboard\IWidget;
use OCP\IL10N;

class DeckPanel implements IPanel {
class DeckWidget implements IWidget {

/**
* @var IL10N
*/
private $l10n;

public function __construct(IL10N $l10n) {
$this->l10n = $l10n;
}

/**
* @inheritDoc
Expand All @@ -42,7 +52,7 @@ public function getId(): string {
* @inheritDoc
*/
public function getTitle(): string {
return 'Deck';
return $this->l10n->t('Upcoming cards');
}

/**
Expand Down
93 changes: 57 additions & 36 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"@nextcloud/l10n": "^1.3.0",
"@nextcloud/moment": "^1.1.1",
"@nextcloud/router": "^1.1.0",
"@nextcloud/vue": "^2.3.0",
"@nextcloud/vue": "^2.5.0",
"@nextcloud/vue-dashboard": "^0.1.6",
"blueimp-md5": "^2.17.0",
"dompurify": "^2.0.12",
"lodash": "^4.17.20",
Expand Down
8 changes: 5 additions & 3 deletions src/components/AttachmentDragAndDrop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ import { Modal } from '@nextcloud/vue'
import attachmentUpload from '../mixins/attachmentUpload'
import { loadState } from '@nextcloud/initial-state'
let maxUploadSizeState = -1
let maxUploadSizeState
try {
loadState('deck', 'maxUploadSize')
} catch (e) {}
maxUploadSizeState = loadState('deck', 'maxUploadSize')
} catch (e) {
maxUploadSizeState = -1
}
export default {
name: 'AttachmentDragAndDrop',
Expand Down
8 changes: 0 additions & 8 deletions src/components/cards/CardBadges.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
-->

<template>
<<<<<<< HEAD
<div v-if="card" class="badges">
=======
<div class="badges" v-if="card">
>>>>>>> 37196bbf... Move duedate to separate component
<div v-if="card.commentsUnread > 0" class="icon icon-comment" />

<div v-if="card.description && checkListCount > 0" class="card-tasks icon icon-checkmark">
Expand Down Expand Up @@ -59,11 +55,7 @@ export default {
return (this.card.description.match(/^\s*([*+-]|(\d\.))\s+\[\s*(\s|x)\s*\](.*)$/gim) || []).length
},
checkListCheckedCount() {
<<<<<<< HEAD
return (this.card.description.match(/^\s*([*+-]|(\d\.))\s+\[\s*x\s*\](.*)$/gim) || []).length
=======
return (this.card.description.match(/^\s*(\*|-|(\d\.))\s+\[\s*x\s*\](.*)$/gim) || []).length
>>>>>>> 37196bbf... Move duedate to separate component
},
},
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/cards/badges/DueDate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
-->

<template>
<div class="duedate" v-if="card">
<div v-if="card" class="duedate">
<transition name="zoom">
<div v-if="card.duedate" :class="dueIcon">
<span>{{ relativeDate }}</span>
Expand Down Expand Up @@ -65,7 +65,7 @@ export default {
dueDateTooltip() {
return moment(this.card.duedate).format('LLLL')
},
}
},
}
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/components/navigation/AppNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<AppNavigationVue :class="{'icon-loading': loading}">
<template #list>
<AppNavigationItem
:title="t('deck', 'My assigned cards')"
:title="t('deck', 'Assigned cards')"
icon="icon-group"
to="/overview/assigned" />
<AppNavigationBoardCategory
Expand Down
40 changes: 21 additions & 19 deletions src/components/overview/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<template>
<div>
<Controls :dashboard-name="filterDisplayName" />
<Controls :overview-name="filterDisplayName" />

<div v-if="loading" key="loading" class="emptycontent">
<div class="icon icon-loading" />
Expand All @@ -33,46 +33,46 @@
<div v-else>
<div v-if="isValidFilter" class="dashboard">
<div class="dashboard-column">
<h2>{{ t('deck', 'No due') }}</h2>
<div v-for="card in cardsByDueDate.nodue" :key="card.id">
<CardItem :id="card.id" />
</div>
</div>

<div class="dashboard-column">
<h2>{{ t('deck', 'Overdue') }}</h2>
<h3>{{ t('deck', 'Overdue') }}</h3>
<div v-for="card in cardsByDueDate.overdue" :key="card.id">
<CardItem :id="card.id" />
</div>
</div>

<div class="dashboard-column">
<h2>{{ t('deck', 'Today') }}</h2>
<h3>{{ t('deck', 'Today') }}</h3>
<div v-for="card in cardsByDueDate.today" :key="card.id">
<CardItem :id="card.id" />
</div>
</div>

<div class="dashboard-column">
<h2>{{ t('deck', 'Tomorrow') }}</h2>
<h3>{{ t('deck', 'Tomorrow') }}</h3>
<div v-for="card in cardsByDueDate.tomorrow" :key="card.id">
<CardItem :id="card.id" />
</div>
</div>

<div class="dashboard-column">
<h2>{{ t('deck', 'This week') }}</h2>
<h3>{{ t('deck', 'This week') }}</h3>
<div v-for="card in cardsByDueDate.thisWeek" :key="card.id">
<CardItem :id="card.id" />
</div>
</div>

<div class="dashboard-column">
<h2>{{ t('deck', 'Later') }}</h2>
<h3>{{ t('deck', 'Later') }}</h3>
<div v-for="card in cardsByDueDate.later" :key="card.id">
<CardItem :id="card.id" />
</div>
</div>

<div class="dashboard-column">
<h3>{{ t('deck', 'No due') }}</h3>
<div v-for="card in cardsByDueDate.nodue" :key="card.id">
<CardItem :id="card.id" />
</div>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -102,7 +102,7 @@ export default {
props: {
filter: {
type: String,
default: '',
default: FILTER_ASSIGNED,
},
},
data() {
Expand All @@ -116,8 +116,8 @@ export default {
},
filterDisplayName() {
switch (this.filter) {
case 'assigned':
return t('deck', 'My assigned cards')
case FILTER_ASSIGNED:
return t('deck', 'Assigned cards')
default:
return ''
}
Expand Down Expand Up @@ -211,13 +211,15 @@ export default {
.dashboard {
display: flex;
align-items: stretch;
margin: $board-spacing;
margin-left: $board-spacing;
margin-right: $board-spacing;
.dashboard-column {
display: flex;
flex-direction: column;
width: $stack-width;
margin: $stack-spacing;
min-width: $stack-width;
margin-left: $stack-spacing;
margin-right: $stack-spacing;
}
}
Expand Down
Loading

0 comments on commit 640ba67

Please sign in to comment.