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

Cloning an app resource with a visual editor does not clone the visual editor part #4809

Closed
emenslin opened this issue Apr 18, 2024 · 5 comments · Fixed by #4902
Closed

Cloning an app resource with a visual editor does not clone the visual editor part #4809

emenslin opened this issue Apr 18, 2024 · 5 comments · Fixed by #4902
Assignees
Labels
1 - Bug Incorrect behavior of the product 2 - App Resources Issues that are related to app resources
Milestone

Comments

@emenslin
Copy link
Collaborator

Describe the bug
Cloning any app resource that has a visual editor component (e.g. web links, record formatters) only clones the XML portion and you cannot access the visual editor.

To Reproduce
Steps to reproduce the behavior:

  1. Go to app resource
  2. Click on any resource with a visual editor (e.g. web links)
  3. Click on the 'clone' or 'add' button
  4. Save
  5. See there is no option to switch to visual editor

Expected behavior
It should clone the entire resource and you should be able to use the visual editor

Screenshots

MDV4D0LwVk.mp4

Please, also fill out the following information manually:

@emenslin emenslin added 1 - Bug Incorrect behavior of the product 2 - App Resources Issues that are related to app resources labels Apr 18, 2024
@emenslin emenslin added this to the 7.9.4 milestone Apr 18, 2024
@grantfitzsimmons
Copy link
Member

That is because the visual editor only is used when the resource is named exactly WebLinks. Specify will only use app resources that define web links if they are named exactly. This is also true for DataObjFormatters and UIFormatters. Since the resource is cloned, it adds a (2), which means Specify doesn’t recognize it as a resource that can be edited visually nor will it use it as a valid source for web links.

@CarolineDenis CarolineDenis modified the milestones: 7.9.4, 7.9.x Apr 18, 2024
@maxpatiiuk
Copy link
Member

Grant is correct.

Though, I guess we could make the process better.
Mainly:

  • either disable the clone button for such resources (easy, but not ideal)
  • or, when clone is pressed, show a dialog prompting the user to pick the destination location for the resource (and ensure the destination does not have a resource by this name already)
    • though I guess this dialog would be useful for most app resource types
    • OR, when creating a new app resource, give an option to select an existing app resource (or even ability to clone from a default app resource that ships with specify) - this is kind of what Form Definition creation has already

@grantfitzsimmons
Copy link
Member

either disable the clone button for such resources (easy, but not ideal)

During today's development meeting, it was decided that this would be the solution for now.

@CarolineDenis
Copy link
Contributor

@grantfitzsimmons,
Can yo confirm that those are the three resources we need to disable the clone button for?

  • WebLinks
  • DataObjFormatters
  • UIFormatters

@CarolineDenis CarolineDenis self-assigned this May 10, 2024
@grantfitzsimmons
Copy link
Member

We need to disable the clone button for any app resources that are recognized by name alone, which most likely includes:

  • TypeSearches
  • WebLinks
  • DataObjFormatters
  • UIFormatters
  • QueryFreqList
  • QueryExtraList
  • DataEntryTaskInit
  • InteractionsTaskInit
  • UserPreferences
  • CollectionPreferences
  • ExpressSearchConfig
  • leaflet-layers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - Bug Incorrect behavior of the product 2 - App Resources Issues that are related to app resources
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants