Fix generated fronted urls
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -357,6 +357,6 @@ class DeckProvider implements IProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function deckUrl($endpoint) {
|
public function deckUrl($endpoint) {
|
||||||
return $this->urlGenerator->linkToRouteAbsolute('deck.page.index') . '#!' . $endpoint;
|
return $this->urlGenerator->linkToRouteAbsolute('deck.page.index') . '#' . $endpoint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class ResourceProvider implements IProvider {
|
|||||||
*/
|
*/
|
||||||
public function getResourceRichObject(IResource $resource): array {
|
public function getResourceRichObject(IResource $resource): array {
|
||||||
$board = $this->getBoard($resource);
|
$board = $this->getBoard($resource);
|
||||||
$link = \OC::$server->getURLGenerator()->linkToRoute('deck.page.index') . '#!/board/' . $resource->getId();
|
$link = \OC::$server->getURLGenerator()->linkToRoute('deck.page.index') . '#/board/' . $resource->getId();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'type' => self::RESOURCE_TYPE,
|
'type' => self::RESOURCE_TYPE,
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class ResourceProviderCard implements IProvider {
|
|||||||
throw new ResourceException('No unique card found for resource, this should never happen');
|
throw new ResourceException('No unique card found for resource, this should never happen');
|
||||||
}
|
}
|
||||||
|
|
||||||
$link = $this->urlGenerator->linkToRoute('deck.page.index') . '#/board/' . $board->getId() . '/cards/' . $resource->getId();
|
$link = $this->urlGenerator->linkToRoute('deck.page.index') . '#/board/' . $board->getId() . '/card/' . $resource->getId();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'type' => self::RESOURCE_TYPE,
|
'type' => self::RESOURCE_TYPE,
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ class Notifier implements INotifier {
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$notification->setLink($this->url->linkToRouteAbsolute('deck.page.index') . '#!/board/' . $boardId . '/card/' . $cardId . '');
|
$notification->setLink($this->url->linkToRouteAbsolute('deck.page.index') . '#/board/' . $boardId . '/card/' . $cardId . '');
|
||||||
break;
|
break;
|
||||||
case 'card-overdue':
|
case 'card-overdue':
|
||||||
$cardId = $notification->getObjectId();
|
$cardId = $notification->getObjectId();
|
||||||
@@ -123,7 +123,7 @@ class Notifier implements INotifier {
|
|||||||
$notification->setParsedSubject(
|
$notification->setParsedSubject(
|
||||||
(string) $l->t('The card "%s" on "%s" has reached its due date.', $params)
|
(string) $l->t('The card "%s" on "%s" has reached its due date.', $params)
|
||||||
);
|
);
|
||||||
$notification->setLink($this->url->linkToRouteAbsolute('deck.page.index') . '#!/board/' . $boardId . '/card/' . $cardId . '');
|
$notification->setLink($this->url->linkToRouteAbsolute('deck.page.index') . '#/board/' . $boardId . '/card/' . $cardId . '');
|
||||||
break;
|
break;
|
||||||
case 'card-comment-mentioned':
|
case 'card-comment-mentioned':
|
||||||
$cardId = $notification->getObjectId();
|
$cardId = $notification->getObjectId();
|
||||||
@@ -150,7 +150,7 @@ class Notifier implements INotifier {
|
|||||||
if ($notification->getMessage() === '{message}') {
|
if ($notification->getMessage() === '{message}') {
|
||||||
$notification->setParsedMessage($notification->getMessageParameters()['message']);
|
$notification->setParsedMessage($notification->getMessageParameters()['message']);
|
||||||
}
|
}
|
||||||
$notification->setLink($this->url->linkToRouteAbsolute('deck.page.index') . '#!/board/' . $boardId . '/card/' . $cardId . '');
|
$notification->setLink($this->url->linkToRouteAbsolute('deck.page.index') . '#/board/' . $boardId . '/card/' . $cardId . '');
|
||||||
break;
|
break;
|
||||||
case 'board-shared':
|
case 'board-shared':
|
||||||
$boardId = $notification->getObjectId();
|
$boardId = $notification->getObjectId();
|
||||||
@@ -173,7 +173,7 @@ class Notifier implements INotifier {
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$notification->setLink($this->url->linkToRouteAbsolute('deck.page.index') . '#!/board/' . $boardId . '/');
|
$notification->setLink($this->url->linkToRouteAbsolute('deck.page.index') . '#/board/' . $boardId . '/');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $notification;
|
return $notification;
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ class DeckProvider implements IFullTextSearchProvider {
|
|||||||
try {
|
try {
|
||||||
$board =
|
$board =
|
||||||
$this->fullTextSearchService->getBoardFromCardId((int)$document->getId());
|
$this->fullTextSearchService->getBoardFromCardId((int)$document->getId());
|
||||||
$path = '#!/board/' . $board->getId() . '//card/' . $document->getId();
|
$path = '#/board/' . $board->getId() . '/card/' . $document->getId();
|
||||||
$document->setLink($this->urlGenerator->linkToRoute('deck.page.index') . $path);
|
$document->setLink($this->urlGenerator->linkToRoute('deck.page.index') . $path);
|
||||||
} catch (DoesNotExistException $e) {
|
} catch (DoesNotExistException $e) {
|
||||||
} catch (MultipleObjectsReturnedException $e) {
|
} catch (MultipleObjectsReturnedException $e) {
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ class DeckProviderTest extends TestCase {
|
|||||||
->with('deck.page.index')
|
->with('deck.page.index')
|
||||||
->willReturn('http://localhost/index.php/apps/deck/');
|
->willReturn('http://localhost/index.php/apps/deck/');
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'http://localhost/index.php/apps/deck/#!board/1/card/1',
|
'http://localhost/index.php/apps/deck/#board/1/card/1',
|
||||||
$this->provider->deckUrl('board/1/card/1')
|
$this->provider->deckUrl('board/1/card/1')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -186,7 +186,7 @@ class DeckProviderTest extends TestCase {
|
|||||||
'type' => 'highlight',
|
'type' => 'highlight',
|
||||||
'id' => 1,
|
'id' => 1,
|
||||||
'name' => 'Board',
|
'name' => 'Board',
|
||||||
'link' => '#!/board/1',
|
'link' => '#/board/1',
|
||||||
],
|
],
|
||||||
'user' => [
|
'user' => [
|
||||||
'type' => 'user',
|
'type' => 'user',
|
||||||
@@ -303,7 +303,7 @@ class DeckProviderTest extends TestCase {
|
|||||||
'type' => 'highlight',
|
'type' => 'highlight',
|
||||||
'id' => 1,
|
'id' => 1,
|
||||||
'name' => 'Board name',
|
'name' => 'Board name',
|
||||||
'link' => '#!/board/1/',
|
'link' => '#/board/1/',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
$actual = $this->invokePrivate($this->provider, 'parseParamForBoard', ['board', $subjectParams, $params]);
|
$actual = $this->invokePrivate($this->provider, 'parseParamForBoard', ['board', $subjectParams, $params]);
|
||||||
|
|||||||
Reference in New Issue
Block a user