Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: For the relation fields in Admin UI, add a "Open Record In New Tab" button #4936

Open
beltebelt opened this issue May 16, 2024 · 1 comment

Comments

@beltebelt
Copy link

beltebelt commented May 16, 2024

This could just be a simple UI change on the Admin UI. Currently for the relation fields we have an "Info" control, hovering on which shows a tooltip with the related record details. We could have an additional control (or the same control can have both hover and click actions) to open the related record in a new tab. Just a button that does window.open("https://<HOST>/_/#/collections?collectionId=<collectionId>&filter=&sort=-created&recordId=<relatedRecordId>","_blank")

Something like:
image

I am assuming an anchor/button at RecordInfo.svelte#L55:

@beltebelt
Copy link
Author

beltebelt commented May 22, 2024

Proposed implementation:

<!-- ui/src/components/records/RecordInfo.svelte#55 -->
    {#if record && record.id && record.collectionId}
        <a
            href="/#/collections?collectionId={record.collectionId}&filter=&sort=-created&recordId={record.id}"
            target="_blank"
        >
            <i
                class="link-hint txt-sm ri-share-box-fill"
                use:tooltip={{
                    text: "Open Record In New Tab",
                    class: "code",
                    position: "top",
                }}
            />
        </a>
    {/if}
<!-- ui/src/components/records/RecordsList.svelte#434 -->
<!-- on:click={() => dispatch("select", record)} -->
on:click={(e) => {
    if (!e.target.classList.contains("ri-share-box-fill")) dispatch("select", record);
}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant