зеркало из https://github.com/nextcloud/deck.git
Merge branch 'master' into bugfix/768/due-date-notification-archive
This commit is contained in:
Коммит
03ad5cb040
|
@ -447,7 +447,7 @@ input.input-inline {
|
|||
margin: $board-item-margin;
|
||||
white-space: normal;
|
||||
position: relative;
|
||||
box-shadow: 0 0 3px var(--color-background-darker, $color-darkgrey);
|
||||
box-shadow: 0 0 3px 1px var(--color-background-darker, $color-darkgrey);
|
||||
border-radius: 3px;
|
||||
transition: margin 250ms linear;
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
|
|||
$scope.defaultColors = ['31CC7C', '317CCC', 'FF7A66', 'F1DB50', '7C31CC', 'CC317C', '3A3B3D', 'CACBCD'];
|
||||
$scope.board = BoardService.getCurrent();
|
||||
$scope.uploader = FileService.uploader;
|
||||
$scope.searchText = '';
|
||||
|
||||
$scope.startTitleEdit = function(card) {
|
||||
card.renameTitle = card.title;
|
||||
|
|
|
@ -51,7 +51,8 @@ class ActivityService {
|
|||
for (let index in this.toEnhanceWithComments) {
|
||||
if (this.toEnhanceWithComments.hasOwnProperty(index)) {
|
||||
let item = this.toEnhanceWithComments[index];
|
||||
item.commentModel = this.commentCollection.get(item.subject_rich[1].comment);
|
||||
let commentId = Array.isArray(item.subject_rich[1].comment) ? item.subject_rich[1].comment.id : item.subject_rich[1].comment;
|
||||
item.commentModel = this.commentCollection.get(commentId);
|
||||
if (typeof item.commentModel !== 'undefined') {
|
||||
this.toEnhanceWithComments = this.toEnhanceWithComments.filter((entry) => entry.activity_id !== item.activity_id);
|
||||
}
|
||||
|
|
|
@ -158,18 +158,19 @@ class DeckProvider implements IProvider {
|
|||
* @param array $parameters
|
||||
*/
|
||||
protected function setSubjects(IEvent $event, $subject, array $parameters) {
|
||||
$placeholders = $replacements = [];
|
||||
$placeholders = $replacements = $richParameters = [];
|
||||
foreach ($parameters as $placeholder => $parameter) {
|
||||
$placeholders[] = '{' . $placeholder . '}';
|
||||
if (is_array($parameter) && array_key_exists('name', $parameter)) {
|
||||
$replacements[] = $parameter['name'];
|
||||
$richParameters[$placeholder] = $parameter;
|
||||
} else {
|
||||
$replacements[] = '';
|
||||
}
|
||||
}
|
||||
|
||||
$event->setParsedSubject(str_replace($placeholders, $replacements, $subject))
|
||||
->setRichSubject($subject, $parameters);
|
||||
->setRichSubject($subject, $richParameters);
|
||||
$event->setSubject($subject, $parameters);
|
||||
}
|
||||
|
||||
|
@ -284,7 +285,11 @@ class DeckProvider implements IProvider {
|
|||
$event->setParsedMessage($comment->getMessage());
|
||||
} catch (NotFoundException $e) {
|
||||
}
|
||||
$params['comment'] = $subjectParams['comment'];
|
||||
$params['comment'] =[
|
||||
'type' => 'highlight',
|
||||
'id' => $subjectParams['comment'],
|
||||
'name' => $comment->getMessage()
|
||||
];
|
||||
}
|
||||
return $params;
|
||||
}
|
||||
|
|
|
@ -465,7 +465,7 @@ class DeckProviderTest extends TestCase {
|
|||
|
||||
public function testParseParamForComment() {
|
||||
$comment = $this->createMock(IComment::class);
|
||||
$comment->expects($this->once())
|
||||
$comment->expects($this->any())
|
||||
->method('getMessage')
|
||||
->willReturn('Comment content');
|
||||
$this->commentsManager->expects($this->once())
|
||||
|
@ -481,7 +481,11 @@ class DeckProviderTest extends TestCase {
|
|||
'comment' => 123
|
||||
];
|
||||
$expected = [
|
||||
'comment' => 123,
|
||||
'comment' => [
|
||||
'type' => 'highlight',
|
||||
'id' => 123,
|
||||
'name' => 'Comment content'
|
||||
]
|
||||
];
|
||||
$actual = $this->invokePrivate($this->provider, 'parseParamForComment', [$subjectParams, $params, $event]);
|
||||
$this->assertEquals($expected, $actual);
|
||||
|
|
Загрузка…
Ссылка в новой задаче