Skip to content

Conversation

smg6511
Copy link
Collaborator

@smg6511 smg6511 commented Sep 29, 2025

What does it do?

  • Updates processors and frontend js to properly set the state and visibility of the preview ("View") button (in the Resource panel UI) and Resource tree contextual menus.
  • Adds new logic to determine validity of web and sym link content to more reliably build the correct (or empty) preview URL.
  • Fixes the logic setting a Resource's deleted state in the UI (changing via the tree and/or panel button was not setting the switch in the settings area).

Why is it needed?

Primarily, as noted in the issue solved, weblink URLs were not being built because the target Resource's URL was not being parsed/built. Also, discovered along the way of fixing this, the view button/tree item was not always showing/hiding/being disabled as expected. Lastly, one could pass obviously malformed content for weblinks resulting in bad links and previews.

How to test

  • Create various Resource types and toggle their deleted setting (from both the panel UI and tree), noting that this action should affect the "View" button states and tree menu items as expected (a deleted Resource should hide its View option).
  • Create valid web and sym links and verify that the correct document is shown when clicking "View"
  • Create invalid weblinks in various ways and verify the "View" button is disabled and the tree menu item is hidden.

Note

I made the choice to disable instead of hide the View button for invalid web/symlinks, in contrast to how it's hidden for deleted Resources. I'm of the mind that action buttons/links shouldn't be hidden at all, just disabled. (It seems somewhat jarring for items to appear and disappear from the main UI.) This would be similar to the common pattern of showing, say, a Submit or Save button in a disabled state until the form it relates to is completely filled out. Let me know your thoughts on this, as I'd move to make a few more changes to make this behavior consistent.

Related issue(s)/PR(s)

Resolves #16195

Incorporates new methods to assess whether a preview is/should be made available in the manager UI. Corrects some other issues with the deleted state being shown incorrectly in certain scenarios (such as changing it via contextual menu in the tree)
For the smaller files: Fix format, modernize
Code quality, modernization upates
Correct error causes by undefined value on resource template change
Formatting fixes, modernization, variable naming improvements, and a few documentation additions
Remove placeholder override (has no functionality)
Remove listener and method with no apparent use. Searched code and the element the method looks for ([id]-hd) is never created for the referenced field.
@smg6511 smg6511 added the pr/review-needed Pull request requires review and testing. label Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/review-needed Pull request requires review and testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use_weblink_target breaks weblink preview if target is ID or link tag
1 participant