plesk / plesk-ext-sdk

Toolkit for development extensions for Plesk
Apache License 2.0
11 stars 7 forks source link

Route to / break all other routes #14

Closed mdsina closed 5 years ago

mdsina commented 5 years ago

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.

ekaragodin commented 5 years ago

Add exact: true for an exact match.

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