Merge pull request #639 from nextcloud/bugfix/noid/comment-compatibility
Bugfix/noid/comment compatibility
This commit is contained in:
@@ -18,6 +18,9 @@
|
||||
<licence>agpl</licence>
|
||||
<author>Julius Härtl</author>
|
||||
<namespace>Deck</namespace>
|
||||
<types>
|
||||
<logging/>
|
||||
</types>
|
||||
<category>organization</category>
|
||||
<category>office</category>
|
||||
<website>https://github.com/nextcloud/deck</website>
|
||||
|
||||
@@ -35,4 +35,15 @@ body:not(.snapjs-left) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#commentsTabView .newCommentForm .message {
|
||||
width: 100%;
|
||||
margin-left: 0;
|
||||
padding-right: 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#commentsTabView .comment {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
@@ -967,6 +967,7 @@ input.input-inline {
|
||||
}
|
||||
.activitysubject .app-popover-menu-utils {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
a {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
@@ -46,12 +46,16 @@ class ActivityController {
|
||||
return self.element.id;
|
||||
}, function (params) {
|
||||
if (self.getData(self.element.id).length === 0) {
|
||||
self.activityservice.loadComments(self.element.id);
|
||||
if (self.type === 'deck_card') {
|
||||
self.activityservice.loadComments(self.element.id);
|
||||
}
|
||||
self.loading = true;
|
||||
self.fetchUntilResults();
|
||||
}
|
||||
self.activityservice.fetchNewerActivities(self.type, self.element.id).then(function () {});
|
||||
self.cardservice.getCurrent().commentsUnread = 0;
|
||||
if (self.type === 'deck_card') {
|
||||
self.cardservice.getCurrent().commentsUnread = 0;
|
||||
}
|
||||
}, true);
|
||||
|
||||
let $target = $('.newCommentForm .message');
|
||||
@@ -111,10 +115,10 @@ class ActivityController {
|
||||
$target.on('inserted.atwho', function (je, $el) {
|
||||
$(je.target).find(
|
||||
'span[data-username="' + $el.find('[data-username]').data('username') + '"]'
|
||||
).avatar();
|
||||
).avatar(undefined, 16);
|
||||
});
|
||||
$target.on('shown.atwho', function (je) {
|
||||
$target.find('.avatar').avatar();
|
||||
$target.find('.avatar').avatar(undefined, 16);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
import app from '../app/App.js';
|
||||
/* global oc_defaults OC */
|
||||
/* global oc_defaults OC OCP OCA */
|
||||
app.controller('BoardController', function ($rootScope, $scope, $stateParams, StatusService, BoardService, StackService, CardService, LabelService, $state, $transitions, $filter, FileService) {
|
||||
|
||||
$scope.sidebar = $rootScope.sidebar;
|
||||
@@ -486,4 +486,9 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
|
||||
$scope.unreadCommentCount = function(card) {
|
||||
return card.commentsUnread;
|
||||
};
|
||||
|
||||
$scope.isTimelineEnabled = function() {
|
||||
return OCP.Comments && OCA.Activity;
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* global app moment angular OC */
|
||||
/* global app moment angular OC OCP OCA */
|
||||
import app from '../app/App.js';
|
||||
|
||||
app.controller('CardController', function ($scope, $rootScope, $sce, $location, $stateParams, $state, $interval, $timeout, $filter, BoardService, CardService, StackService, StatusService, markdownItConverter, FileService) {
|
||||
@@ -278,4 +278,8 @@ app.controller('CardController', function ($scope, $rootScope, $sce, $location,
|
||||
};
|
||||
};
|
||||
|
||||
$scope.isTimelineEnabled = function() {
|
||||
return OCP.Comments && OCA.Activity;
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
@@ -124,7 +124,7 @@ class ActivityService {
|
||||
self.running = false;
|
||||
return response;
|
||||
}, function (error) {
|
||||
if (error.status === 304) {
|
||||
if (error.status === 304 || error.status === 404) {
|
||||
self.since[type][id].finished = true;
|
||||
}
|
||||
self.running = false;
|
||||
@@ -140,7 +140,9 @@ class ActivityService {
|
||||
if (!this.since[type][id].finished) {
|
||||
this.runningPromise = this.fetchCardActivities(type, id, this.since[type][id].oldest);
|
||||
this.runningPromise.then(function() {
|
||||
self.commentCollection.fetchNext();
|
||||
if (type === 'deck_card') {
|
||||
self.commentCollection.fetchNext();
|
||||
}
|
||||
});
|
||||
return this.runningPromise;
|
||||
}
|
||||
|
||||
@@ -14,9 +14,8 @@
|
||||
<ul class="tabHeaders">
|
||||
<li class="tabHeader" ng-class="{'selected': (params.tab==0 || !params.tab)}" ui-sref="{tab: 0}"><a><?php p($l->t('Sharing')); ?></a></li>
|
||||
<li class="tabHeader" ng-class="{'selected': (params.tab==1)}" ui-sref="{tab: 1}"><a><?php p($l->t('Tags')); ?></a></li>
|
||||
<li class="tabHeader" ng-class="{'selected': (params.tab==2)}" ui-sref="{tab: 2}"><a><?php p($l->t('Deleted Stacks')); ?></a></li>
|
||||
<li class="tabHeader" ng-class="{'selected': (params.tab==3)}" ui-sref="{tab: 3}"><a><?php p($l->t('Deleted Cards')); ?></a></li>
|
||||
<li class="tabHeader" ng-class="{'selected': (params.tab==4)}" ui-sref="{tab: 4}"><a><?php p($l->t('Activity')); ?></a></li>
|
||||
<li class="tabHeader" ng-class="{'selected': (params.tab==2)}" ui-sref="{tab: 2}"><a><?php p($l->t('Deleted items')); ?></a></li>
|
||||
<li class="tabHeader" ng-class="{'selected': (params.tab==4)}" ui-sref="{tab: 4}" ng-if="isTimelineEnabled()"><a><?php p($l->t('Timeline')); ?></a></li>
|
||||
|
||||
</ul>
|
||||
<div class="tabsContainer">
|
||||
@@ -124,6 +123,7 @@
|
||||
</div>
|
||||
|
||||
<div id="board-detail-deleted-stacks" class="tab deletedStacksTabView" ng-if="params.tab==2">
|
||||
<h3><?php p($l->t('Deleted stacks')); ?></h3>
|
||||
<ul class='board-detail__deleted-list'>
|
||||
<li class='board-detail__deleted-list__item' ng-repeat="deletedStack in stackservice.deleted">
|
||||
<span class="icon icon-deck"></span>
|
||||
@@ -134,10 +134,10 @@
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="board-detail-deleted-cards" class="tab deletedCardsTabView" ng-if="params.tab==3">
|
||||
<ul class='board-detail__deleted-list'>
|
||||
<h3><?php p($l->t('Deleted cards')); ?></h3>
|
||||
|
||||
<ul class='board-detail__deleted-list'>
|
||||
<li class='board-detail__deleted-list__item' ng-repeat="deletedCard in cardservice.deleted">
|
||||
<span class="icon icon-deck"></span>
|
||||
<span>{{deletedCard.title}}</span>
|
||||
@@ -150,7 +150,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="board-detail-activity" class="tab activityTabView" ng-if="params.tab==4">
|
||||
<div id="board-detail-activity" class="tab activityTabView" ng-if="isTimelineEnabled() && params.tab==4">
|
||||
<activity-component ng-if="boardservice.getCurrent()" type="deck_board" element="boardservice.getCurrent()"></activity-component>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div id="commentsTabView">
|
||||
<div class="newCommentRow comment" data-id="">
|
||||
<div class="newCommentRow comment" data-id="" ng-show="$ctrl.type === 'deck_card'">
|
||||
<div class="authorRow">
|
||||
<div class="avatardiv" avatar ng-attr-user="{{ $ctrl.currentUser.uid }}" ng-attr-displayname="{{ $ctrl.currentUser.displayName }}" ng-attr-size="24"></div>
|
||||
<div class="author currentUser">{{ $ctrl.currentUser.displayName }}</div>
|
||||
@@ -25,7 +25,7 @@
|
||||
{{ activity.subject_rich[1].user.name }}
|
||||
<div class="app-popover-menu-utils">
|
||||
<button class="button-inline icon-more ng-pristine ng-valid ng-empty ng-touched" aria-label="Actions"></button>
|
||||
<div class="popovermenu hidden">
|
||||
<div class="popovermenu hidden menu-left">
|
||||
<ul>
|
||||
<li><a ng-click="$ctrl.updateComment(activity)" class="menuitem action edit permanent" data-action="edit"><span class="icon icon-rename"></span><span>Edit comment</span></a></li>
|
||||
<li><a ng-click="$ctrl.deleteComment(activity)" class="menuitem action delete permanent" data-action="delete"><span class="icon icon-delete"></span><span>Delete comment</span></a></li>
|
||||
|
||||
@@ -92,8 +92,7 @@
|
||||
<ul class="tabHeaders ng-scope">
|
||||
<li class="tabHeader" ng-class="{'selected': (params.tab==0 || !params.tab)}" ui-sref="{tab: 0}"><a><span class="icon icon-description"></span><?php p($l->t('Description')); ?></a></li>
|
||||
<li class="tabHeader" ng-class="{'selected': (params.tab==1)}" ui-sref="{tab: 1}"><a><span class="icon icon-files-dark"></span><?php p($l->t('Attachments')); ?></a></li>
|
||||
<li class="tabHeader" ng-class="{'selected': (params.tab==2)}" ui-sref="{tab: 2}"><a><span class="icon icon-activity"></span><?php p($l->t('Activity/Comments')); ?></a></li>
|
||||
|
||||
<li class="tabHeader" ng-class="{'selected': (params.tab==2)}" ui-sref="{tab: 2}" ng-if="isTimelineEnabled()"><a><span class="icon icon-activity"></span><?php p($l->t('Timeline')); ?></a></li>
|
||||
</ul>
|
||||
<div class="tabDetails">
|
||||
<span class="save-indicator saved"><?php p($l->t('Saved')); ?></span>
|
||||
@@ -131,7 +130,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section-content card-activity activityTabView" ng-if="params.tab === 2">
|
||||
<div class="section-content card-activity activityTabView" ng-if="isTimelineEnabled() && params.tab === 2">
|
||||
<activity-component type="deck_card" element="cardservice.getCurrent()"></activity-component>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user