dashjoin / platform

Dashjoin Is an Open Source & Cloud Native Low Code Development and Integration Platform that helps teams deliver applications faster 🚀 Uses a data-driven approach inspired by Linked Data to make use of your existing assets
https://dashjoin.com
GNU Affero General Public License v3.0
91 stars 8 forks source link

Cannot view table with special characters #324

Open aeberhart opened 7 months ago

aeberhart commented 7 months ago

The issue only happens with " " (space) characters in the resource name. Other special characters work fine. In this case, react admin cannot map the browser route to the resource.

Just tested with the latest version of react-admin (4.16.11). The behaviour changed but was still buggy.

Asked in the RA admin discord of there were any rules for choosing / escaping resource names

aeberhart commented 6 months ago

postpone RA update

maybe replace table names containing space with _

aeberhart commented 6 months ago

we should remove the upload special handling once the underlying RA issue is fixed

aeberhart commented 4 months ago

react admin behaves as follows w.r.t. special characters in resource names:

aeberhart commented 4 months ago

RA useCreatePath:

                return removeDoubleSlashes(
                    `${basename}/${resource}/${encodeURIComponent(id)}/show`
                );
aeberhart commented 4 months ago

test code


const AdminApp = () => (
    <Admin dataProvider={dataProvider}>
        <Resource name="ö" list={LIST} edit={EDIT} />
        <Resource name="a!b" list={LIST} edit={EDIT} />
        <Resource name="a b" list={LIST} edit={EDIT} />
        <Resource name="a/b" list={LIST} edit={EDIT} />
        <Resource name="a%2Fb" list={LIST} edit={EDIT} />
        <Resource name="a@b" list={LIST} edit={EDIT} />
        <Resource name="a\b" list={LIST} edit={EDIT} />
        <Resource name="a'b" list={LIST} edit={EDIT} />
        <Resource name='a"b' list={LIST} edit={EDIT} />
        <Resource name="a:b" list={LIST} edit={EDIT} />
        <Resource name="a+b" list={LIST} edit={EDIT} />

        <Resource name="a#b" list={LIST} edit={EDIT} />
        <Resource name="a?b" list={LIST} edit={EDIT} />
        <Resource name="a%b" list={LIST} edit={EDIT} />
        <Resource name="a%23b" list={LIST} edit={EDIT} />
    </Admin>
);

export const LIST = () => {
    return <p>{useResourceContext()}</p>
}
export const EDIT = () => {
    return <p>{useResourceContext() + ' - ' + useGetRecordId()}</p>
}
aeberhart commented 4 months ago

TODO still: special handling for tables that have # in their resource name