Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jira dropdown menu with sub-level

I'm trying to achieve this behavior while building a plugin using the <web-section> <web-item> tags but there is nothing in the docs that will help me to figure out the proper tags. I know that solution works to build sub-levels with html so there has to be something similar for <web-section> <web-item>. Any ideas? Thanks

Expected behavior:

enter image description here

like image 208
Carlos Avatar asked Nov 08 '22 06:11

Carlos


1 Answers

I'm afraid that this IS NOT currently possible. It seems a conscious UX decision of Atlassian to only allow grouping menu items in sections and not in expandable sub-menus:

JIRA custom top navbar menu using web-items and web-sections

atlassian_plugin.xml:

<?xml version="1.0" encoding="UTF-8"?>    
<atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}" plugins-version="2">
    <plugin-info>
        <description>${project.description}</description>
        <version>${project.version}</version>
        <vendor name="${project.organization.name}" url="${project.organization.url}"/>
        <param name="plugin-icon">images/pluginIcon.png</param>
        <param name="plugin-logo">images/pluginLogo.png</param>
    </plugin-info>
    
    <web-item key="top-menu-dropdown" section="system.top.navigation.bar" weight="100">
        <label>My custom menu</label>
        <link linkId="top-menu-dropdown-link-id"/>
    </web-item>

    <web-section key="first-section" location="top-menu-dropdown-link-id" weight="10">
        <label>First section</label>
    </web-section>

    <web-item key="first-section-first-item" section="top-menu-dropdown-link-id/first-section" weight="10">
        <label>First item</label>
        <link>https://example.com/1/1</link>
    </web-item>

    <web-item key="first-section-second-item" section="top-menu-dropdown-link-id/first-section" weight="10">
        <label>Second item</label>
        <link>https://example.com/1/2</link>
    </web-item>

    <web-section key="second-section" location="top-menu-dropdown-link-id" weight="10">
        <label>Second section</label>
    </web-section>

    <web-item key="second-section-first-item" section="top-menu-dropdown-link-id/second-section" weight="10">
        <label>First item</label>
        <link>https://example.com/2/1</link>
    </web-item>

    <web-item key="second-section-second-item" section="top-menu-dropdown-link-id/second-section" weight="10">
        <label>Second item</label>
        <link>https://example.com/2/2</link>
    </web-item>
</atlassian-plugin>
like image 74
jannis Avatar answered Dec 28 '22 16:12

jannis