fix: Switch to route based urls (fix #4467)

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-11-11 23:02:22 +01:00
parent 29d5913e8b
commit 9f98f0bd5f
3 changed files with 32 additions and 0 deletions

View File

@@ -25,6 +25,11 @@
return [
'routes' => [
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
['name' => 'page#indexList', 'url' => '/board', 'verb' => 'GET'],
['name' => 'page#indexBoard', 'url' => '/board/{boardId}', 'verb' => 'GET'],
['name' => 'page#indexBoardDetails', 'url' => '/board/{boardId}/details', 'verb' => 'GET'],
['name' => 'page#indexCard', 'url' => '/board/{boardId}/card/{cardId}', 'verb' => 'GET'],
['name' => 'page#redirectToCard', 'url' => '/card/{cardId}', 'verb' => 'GET'],
// boards

View File

@@ -23,6 +23,8 @@
namespace OCA\Deck\Controller;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
use \OCP\AppFramework\Http\RedirectResponse;
use OCA\Deck\AppInfo\Application;
use OCA\Deck\Db\Acl;
@@ -99,6 +101,30 @@ class PageController extends Controller {
return $response;
}
#[NoAdminRequired]
#[NoCSRFRequired]
public function indexList(): TemplateResponse {
return $this->index();
}
#[NoAdminRequired]
#[NoCSRFRequired]
public function indexBoard(int $boardId): TemplateResponse {
return $this->index($boardId);
}
#[NoAdminRequired]
#[NoCSRFRequired]
public function indexBoardDetails(int $boardId): TemplateResponse {
return $this->index($boardId);
}
#[NoAdminRequired]
#[NoCSRFRequired]
public function indexCard(int $cardId): TemplateResponse {
return $this->index(cardId: $cardId);
}
/**
* @NoAdminRequired
* @NoCSRFRequired

View File

@@ -34,6 +34,7 @@ import Overview from './components/overview/Overview.vue'
Vue.use(Router)
export default new Router({
mode: 'history',
base: generateUrl('/apps/deck/'),
linkActiveClass: 'active',
routes: [