fix: Allow directly navigating to a the filtered app view

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2023-10-30 12:46:15 +01:00
Родитель 430b86f48d
Коммит 5b9f53a039
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 45FAE7268762B400
5 изменённых файлов: 21 добавлений и 5 удалений

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

@ -15,6 +15,7 @@
<licence>agpl</licence>
<author>Frank Karlitschek</author>
<author>Joas Schilling</author>
<author>Ferdinand Thiessen</author>
<default_enable />
<types>
@ -64,7 +65,7 @@
<navigations>
<navigation>
<name>Activity</name>
<route>activity.Activities.showList</route>
<route>activity.Activities.index</route>
<icon>activity.svg</icon>
<order>1</order>
</navigation>

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

@ -31,7 +31,8 @@ return [
['name' => 'Settings#personal', 'url' => '/settings', 'verb' => 'POST'],
['name' => 'Settings#admin', 'url' => '/settings/admin', 'verb' => 'POST'],
['name' => 'Settings#feed', 'url' => '/settings/feed', 'verb' => 'POST'],
['name' => 'Activities#showList', 'url' => '/', 'verb' => 'GET'],
['name' => 'Feed#show', 'url' => '/rss.php', 'verb' => 'GET'],
['name' => 'Activities#index', 'url' => '/', 'verb' => 'GET'],
['name' => 'Activities#showList', 'url' => '/{filter}', 'verb' => 'GET'],
],
];

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

@ -53,6 +53,17 @@ class ActivitiesController extends Controller {
parent::__construct($appName, $request);
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*
* @param string $filter
* @return TemplateResponse
*/
public function index(): TemplateResponse {
return $this->showList('all');
}
/**
* @NoAdminRequired
* @NoCSRFRequired

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

@ -105,7 +105,7 @@ class ActivityWidget implements IAPIWidget, IButtonWidget, IIconWidget, IReloada
*/
public function getUrl(): ?string {
return $this->urlGenerator->getAbsoluteURL(
$this->urlGenerator->linkToRoute(Application::APP_ID . '.Activities.showList')
$this->urlGenerator->linkToRoute(Application::APP_ID . '.Activities.index')
);
}
@ -194,7 +194,7 @@ class ActivityWidget implements IAPIWidget, IButtonWidget, IIconWidget, IReloada
new WidgetButton(
WidgetButton::TYPE_MORE,
$this->urlGenerator->getAbsoluteURL(
$this->urlGenerator->linkToRoute(Application::APP_ID . '.Activities.showList')
$this->urlGenerator->linkToRoute(Application::APP_ID . '.Activities.index')
),
$this->l10n->t('More activities')
),

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

@ -1,12 +1,15 @@
import type { RouteConfig } from 'vue-router'
import ActivityFeed from './views/ActivityFeed.vue'
export const routes = [
{
path: '/',
name: 'root',
redirect: { path: '/all' },
},
{
path: '/:view',
component: ActivityFeed,
props: true,
},
]
] as RouteConfig[]