Skip to content

Commit e625495

Browse files
committed
AXON-193: move jqls to local variable
1 parent 93b8007 commit e625495

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

src/views/jira/treeViews/customJqlViewProvider.ts

+8-10
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,18 @@ export class CustomJQLViewProvider implements TreeDataProvider<TreeItem>, Dispos
4040
private _onDidChangeTreeData = new EventEmitter<TreeItem | undefined | void>();
4141
readonly onDidChangeTreeData = this._onDidChangeTreeData.event;
4242

43-
private _jqlEntries: JQLEntry[] = [];
44-
4543
constructor() {
4644
this._disposable = Disposable.from(
4745
Container.jqlManager.onDidJQLChange(this.refresh, this),
4846
Container.siteManager.onDidSitesAvailableChange(this.refresh, this),
4947
commands.registerCommand(Commands.RefreshCustomJqlExplorer, this.refresh, this),
5048
);
5149

52-
this._jqlEntries = Container.jqlManager.getCustomJQLEntries();
53-
5450
window.createTreeView(CustomJQLViewProviderId, { treeDataProvider: this });
5551

56-
if (this._jqlEntries.length > 0) {
52+
const jqlEntries = Container.jqlManager.getCustomJQLEntries();
53+
54+
if (jqlEntries.length > 0) {
5755
setCommandContext(CommandContext.CustomJQLExplorer, Container.config.jira.explorer.enabled);
5856
}
5957

@@ -64,8 +62,8 @@ export class CustomJQLViewProvider implements TreeDataProvider<TreeItem>, Dispos
6462

6563
private onConfigurationChanged(e: ConfigurationChangeEvent) {
6664
if (configuration.changed(e, 'jira.jqlList') || configuration.changed(e, 'jira.explorer')) {
67-
this._jqlEntries = Container.jqlManager.getCustomJQLEntries();
68-
if (this._jqlEntries.length > 0) {
65+
const jqlEntries = Container.jqlManager.getCustomJQLEntries();
66+
if (jqlEntries.length > 0) {
6967
setCommandContext(CommandContext.CustomJQLExplorer, Container.config.jira.explorer.enabled);
7068
} else {
7169
setCommandContext(CommandContext.CustomJQLExplorer, false);
@@ -90,9 +88,9 @@ export class CustomJQLViewProvider implements TreeDataProvider<TreeItem>, Dispos
9088
} else {
9189
SearchJiraHelper.clearIssues(CustomJQLViewProviderId);
9290

93-
this._jqlEntries = Container.jqlManager.getCustomJQLEntries();
94-
return this._jqlEntries.length
95-
? this._jqlEntries.map((jqlEntry) => new JiraIssueQueryNode(jqlEntry))
91+
const jqlEntries = Container.jqlManager.getCustomJQLEntries();
92+
return jqlEntries.length
93+
? jqlEntries.map((jqlEntry) => new JiraIssueQueryNode(jqlEntry))
9694
: [CustomJQLViewProvider._treeItemConfigureJqlMessage];
9795
}
9896
}

src/views/jira/treeViews/jiraAssignedWorkItemsViewProvider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class AssignedWorkItemsViewProvider implements TreeDataProvider<TreeItem>
5454
if (configuration.changed(e, 'jira.explorer.enabled')) {
5555
setCommandContext(CommandContext.AssignedIssueExplorer, Container.config.jira.explorer.enabled);
5656
this.refresh();
57-
} else if (configuration.changed(e, 'jira.explorer.showIssueIcons')) {
57+
} else if (configuration.changed(e, 'jira.explorer')) {
5858
this.refresh();
5959
}
6060
}

src/views/jira/treeViews/utils.ts

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export const loginToJiraMessageNode = createLabelItem('Please login to Jira', {
4242
title: 'Login to Jira',
4343
arguments: [ProductJira],
4444
});
45+
4546
export class JiraIssueNode extends TreeItem {
4647
private children: JiraIssueNode[];
4748

0 commit comments

Comments
 (0)