Jira下拉菜单与子级别

时间:2016-10-31 19:16:10

标签: jira jira-plugin

我正在尝试使用<web-section> <web-item>标记构建插件时实现this行为,但文档中没有任何内容可以帮助我找出正确的标记。我知道该解决方案可以用html构建子级别,因此<web-section> <web-item>必须有类似的东西。有任何想法吗?感谢

预期行为:

enter image description here

1 个答案:

答案 0 :(得分:1)

我担心这不可能。 Atlassian似乎有意识地决定只允许在部分中分组菜单项而不是在可扩展的子菜单中:

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

atlassian_plugin.xml:

<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>