Merge branch 'master' into bugfix/768/due-date-notification-archive

This commit is contained in:
Julius Härtl 2018-12-20 11:30:07 +01:00 коммит произвёл GitHub
Родитель 8b750b7c7c 35bec2749c
Коммит 03ad5cb040
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 18 добавлений и 7 удалений

Просмотреть файл

@ -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);