plesk/plesk-ext-sdk

Route to / break all other routes

Closed this issue · 1 comments

Description: All another routes doesn't work if one of them uses '/' path to route
Plesk version: 17.9.5
plesk-ext-sdk: 0.4.0
Actual result:
Works only route to /, all other routes opens this one.
Expected result:
All another routes works too

Additional info:

extension.config.js:

module.exports = {
    routes: [
        {
            path: '/',
            component: 'settings/Settings',
            title: 'Settings',
        },
        {
            path: '/access',
            component: 'domain/RemoteAccess',
            title: 'Remote Access',
        },
    ],
};

Workaround:

module.exports = {
    routes: [
        {
            path: '/settings',
            component: 'settings/Settings',
            title: 'Settings',
        },
        {
            path: '/access',
            component: 'domain/RemoteAccess',
            title: 'Remote Access',
        },
    ],
};

But this route must be at top of the routes. This route used from extension page, to open extensions settings. Button 'Open' from extension always routes to /.
But if there are no route the first will be given.

Add exact: true for an exact match.

{
            path: '/',
            exact: true,
            component: 'settings/Settings',
            title: 'Settings',
        }