umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.46k stars 2.68k forks source link

Misc link picker modal issues #16838

Open abjerner opened 2 months ago

abjerner commented 2 months ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

14.1

Bug summary

I've tried playing a bit around with the link picker modal, and have experienced a few issues, which resulted in me starting a discussion on Discord.

Some of my issues may be due to lack of documentation, as I haven't been able to find any documentation or examples on how to use the modal.

No import map

Most modals seem to be a part of @umbraco-cms/backoffice/modal, but the link picker modal is not part of this import, nor any other imports. Lee Kelleher mentioned that this will addressed for 14.2, so looking forward to this.

Option to hide anchor doesn't work

It seems that there is an option to hide anchor field, but I can't work out how to use this. The comment above the referenced line also suggests that this may not work.

No option to hide target property

The link picker modal/overlay has a Target property. In previous versions of Umbraco, it was possible to hide this option for context where a target doesn't really make sense. I'm using this in Skybrud Redirects, so I'm missing this option in Umbraco 14.

No option to restrict link type

In Umbraco 6 and uComponents, the URL picker had an option to restrict the type of link that could be submitted. E.g. to so that only content and media links would be allowed, but not external links. I'd imagine the Multi URL picker was somewhat inspired by the URL picker in uComponents, and I've been missing this option a few times for the Multi URL picker.

It would be great for both the Multi URL picker property editor and the link picker modal to support this.

Editing link title or query/anchor removes unique and url from submitted value

In Umbraco 13 and earlier versions, one could select a content or media item, in which case the Link title property would be populated with the name of the selected item. One could then afterwards edit both the link title and anchor/query, which would then be part of the submitted link object.

In Umbraco 14, editing either of the Anchor / querystring or Link title properties, the item selection is lost, meaning the unqiue and url properties are missing in the submitted link object.

url of submitted value is the GUID key, not the actual URL

In previous versions of Umbraco, selecting a content or media item, the Link field would be populated with the URL of that item, and also be the value of the url property of the resulting link object.

In Umbraco 14 the field isn't populated with the URL, and the url property is simply the GUID key of the selected item, not the URL.

Setting initial link value doesn't work

In Umbraco 14, setting an initial link doesn't seem to be supported. Since submitting the link picker modal returns in a value object with a link property, I would imagine something like this would set the initial link that is shown when the picker is opened:

const modalContext = this.modalManagerContext?.open(this, UMB_LINK_PICKER_MODAL, {
    modal: {
        size: "medium",
    },
    value: {
        link: {
            type: "document",
            unique: "b87dc2bb-26ae-48f3-93fc-1b9b58b38c62",
            url: "b87dc2bb-26ae-48f3-93fc-1b9b58b38c62"
        }
    }
});

General layout

The general layout of the overlay/modal could IMO be improved. For one, the default size of the modal is small, result in the modal components being very compact. For custom code opening the modal, one can always set the size to something like medium instead, but I'd say that the Link and Anchor / querystring ideally should be laid out on two different lines, rather than on the same line.

image

image

Specifics

No response

Steps to reproduce

See Bug summary.

Expected result / actual result

No response


This item has been added to our backlog AB#44594

github-actions[bot] commented 2 months ago

Hi there @abjerner!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

bjarnef commented 2 months ago

Regarding Anchor / querystring I think it is fine these fields are next to each other, but it can use CSS Container Queries https://caniuse.com/css-container-queries so the two fields are stacked in small modal width.