Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Requiere resources in *.vm

Adria Alonso
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 9, 2019

Hello ,

I am trying to add https://docs.atlassian.com/aui/8.5.1/docs/single-select.html

to my custom *.vm file but I can't make it work.

Not working:

  • $webResourceManager.requireResourcesForContext("com.atlassian.auiplugin:aui-select"
  • #requireResourcesForContext("com.atlassian.auiplugin:aui-select")

Thank you in advance

4 answers

0 votes
Adria Alonso
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 8, 2019

Including the plugin Custom Select List

But I'll leave it open since I dont consider it the Correct solution for using resources in vm templates, furthermore, the version of select2 that is using is the old one

0 votes
Adria Alonso
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 14, 2019

Which is the functional way?

OR anyone has a working example in releasenotes-html.vm?

0 votes
Adria Alonso
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2019

It just shows it as plain text : /

To be more precise, i'm on releasenoteshtml.vm , slightly modifying the *.vm.

JIRA 8.4.1

Tuncay Senturk
Community Champion
October 10, 2019

Try to use it in

<html>

<head>
$webResourceManager.requireResource("com.atlassian.auiplugin:aui-select")
</head>

</html>
Adria Alonso
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2019

Keeps with the same problem.

In Velocity.properties.xml, cached is disabled

Also I've forced putting the <head> tags since the vm starts with:

#disable_html_escaping()

##Text is escaped twice so that the characters generated in the text area display properly escaped (JRA-12184)

###macro (doubleEncode $html)

## $textUtils.htmlEncode($textUtils.htmlEncode($html))

###end

<title>$textUtils.htmlEncode($action.getText('release.notes.html.title', $project, $version))</title>

<body>

The fact that there's a title tag in there with no head tags and then an opening body tag is rare to me. I've tried several combination, also what you mentioned and still nothing.

I believe this is created from releasenote.jsp located in secure/views/project

Adria Alonso
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2019

In Velocity.properties I see:

#----------------------------------------------------------------------------
# RESOURCE MANAGEMENT
#----------------------------------------------------------------------------
# Allows alternative ResourceManager and ResourceCache implementations
# to be plugged in.
#----------------------------------------------------------------------------

resource.manager.class = com.atlassian.velocity.PluginAwareResourceManager
resource.manager.cache.class = com.atlassian.velocity.PluginAwareResourceManager$Cache
resource.manager.defaultcache.size=0

0 votes
Tuncay Senturk
Community Champion
October 9, 2019

 

Hello @Adria Alonso 

For single select you can use this

$webResourceManager.requireResource("com.atlassian.auiplugin:aui-select")

or Select2 you can use this

$webResourceManager.requireResource("com.atlassian.auiplugin:aui-select2") 

Suggest an answer

Log in or Sign up to answer