Fix timer control missing from issue view on Jira DC/Server 10+#439
Open
reikjarloekl wants to merge 1 commit into
Open
Fix timer control missing from issue view on Jira DC/Server 10+#439reikjarloekl wants to merge 1 commit into
reikjarloekl wants to merge 1 commit into
Conversation
Since Jira Data Center/Server 10, the command-bar toolbar's inner
container (.aui-toolbar2-inner) has a <ul class="aui-toolbar2-primary">
as its first child instead of a nested <div>. The existing selector
.ops-menus > div:first-child > div:first-child
therefore matched nothing, so applyIssueLogic() returned early and the
worklog timer control was never injected into the issue view toolbar.
Keep the original selector as the primary lookup (so behaviour on
pre-10 Jira is unchanged) and fall back to the stable
.aui-toolbar2-inner container when it finds nothing (Jira 10+).
Fixes shridhar-tl#425
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fixes #425.
After upgrading a Jira Data Center/Server instance to Jira 10, the worklog timer control no longer appears in the issue-view command bar (it used to sit next to the Edit / Comment buttons).
Root cause
applyIssueLogic()locates the DC/Server toolbar with:In Jira 10 the AUI toolbar structure is:
The final
> div:first-childexpects a<div>, but the first child of.aui-toolbar2-inneris now<ul class="aui-toolbar2-primary">. The selector matches nothing, soel.length === 0and the function returns early — the timer control is never injected.Fix
Keep the original selector as the primary lookup (unchanged behaviour on pre-10 Jira, so no regression there) and fall back to the stable
.aui-toolbar2-innercontainer only when the original finds nothing (Jira 10+):Verification