Skip to content

Commit

Permalink
closes #18
Browse files Browse the repository at this point in the history
  • Loading branch information
konradmainzer committed Oct 16, 2019
1 parent b497357 commit 092f400
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 26 deletions.
18 changes: 1 addition & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@
"view/item/context": [
{
"command": "serviceBusExplorer.editEntry",
"when": "view == servicebus-namespaces && viewItem == namespace",
"group": "inline"
"when": "view == servicebus-namespaces && viewItem == namespace"
},
{
"command": "serviceBusExplorer.toggleCollapseAll",
Expand Down Expand Up @@ -229,11 +228,6 @@
"command": "serviceBusExplorer.deleteSubscription",
"when": "view == servicebus-namespaces && viewItem == subscription"
},
{
"command": "serviceBusExplorer.deleteSubscription",
"when": "view == servicebus-namespaces && viewItem == subscription",
"group": "inline"
},
{
"command": "serviceBusExplorer.createTopic",
"when": "view == servicebus-namespaces && viewItem == topiclist",
Expand All @@ -247,11 +241,6 @@
"command": "serviceBusExplorer.deleteTopic",
"when": "view == servicebus-namespaces && viewItem == topic"
},
{
"command": "serviceBusExplorer.deleteTopic",
"when": "view == servicebus-namespaces && viewItem == topic",
"group": "inline"
},
{
"command": "serviceBusExplorer.createQueue",
"when": "view == servicebus-namespaces && viewItem == queuelist",
Expand All @@ -264,11 +253,6 @@
{
"command": "serviceBusExplorer.deleteQueue",
"when": "view == servicebus-namespaces && viewItem == queue"
},
{
"command": "serviceBusExplorer.deleteQueue",
"when": "view == servicebus-namespaces && viewItem == queue",
"group": "inline"
}
],
"commandPalette": [
Expand Down
12 changes: 6 additions & 6 deletions src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ export default function registerCommands(
commands.registerCommand('serviceBusExplorer.createSubscription', async (node: Topic) => {
var state = await subscriptionUI.createSubscription();
await node.createSubscription(state.name);
serviceBusProvider.reBuildTree(node);
serviceBusProvider.refresh(node);
}),

commands.registerCommand('serviceBusExplorer.deleteSubscription', async (node: Subscription) => {
var state = await subscriptionUI.deleteSubscription();

if (state.confirm.toUpperCase() === "YES") {
await node.deleteSubscription();
serviceBusProvider.reBuildTree(node.parent);
serviceBusProvider.refresh(node.parent);
}
else {
window.showErrorMessage('Deletion has not been confirmed as "Yes" was not typed');
Expand All @@ -88,15 +88,15 @@ export default function registerCommands(
commands.registerCommand('serviceBusExplorer.createTopic', async (node: TopicList) => {
var state = await topicUI.createTopic();
await node.createTopic(state.name);
serviceBusProvider.reBuildTree(node);
serviceBusProvider.refresh(node);
}),

commands.registerCommand('serviceBusExplorer.deleteTopic', async (node: Topic) => {
var state = await topicUI.deleteTopic();

if (state.confirm.toUpperCase() === "YES") {
await node.deleteTopic();
serviceBusProvider.reBuildTree(node.parent);
serviceBusProvider.refresh(node);
}
else {
window.showErrorMessage('Deletion has not been confirmed as "Yes" was not typed');
Expand All @@ -106,15 +106,15 @@ export default function registerCommands(
commands.registerCommand('serviceBusExplorer.createQueue', async (node: QueueList) => {
var state = await queueUI.createQueue();
await node.createQueue(state.name);
serviceBusProvider.reBuildTree(node);
serviceBusProvider.refresh(node);
}),

commands.registerCommand('serviceBusExplorer.deleteQueue', async (node: Queue) => {
var state = await queueUI.deleteQueue();

if (state.confirm.toUpperCase() === "YES") {
await node.deleteQueue();
serviceBusProvider.reBuildTree(node.parent);
serviceBusProvider.refresh(node.parent);
}
else {
window.showErrorMessage('Deletion has not been confirmed as "Yes" was not typed');
Expand Down
4 changes: 2 additions & 2 deletions src/namespace/namespaceItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export class NameSpaceItem extends ExplorerItemBase {
let topics = await this.data.clientInstance.getTopics();
let queues = await this.data.clientInstance.getQueues();

this.children.push(new QueueList(this.data, this.collapsibleState, queues.length || 0));
this.children.push(new TopicList(this.data, this.collapsibleState, topics.length || 0));
this.children.push(new QueueList(this.data, queues.length ? this.collapsibleState : TreeItemCollapsibleState.None, queues.length || 0));
this.children.push(new TopicList(this.data, topics.length ? this.collapsibleState : TreeItemCollapsibleState.None, topics.length || 0));
}

return Promise.resolve(this.children);
Expand Down
2 changes: 1 addition & 1 deletion src/topic/topicList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class TopicList extends ExplorerItemBase {

for (var i = 0; i < topicDetails.length; i++) {
var subscriptions: ISubscription[] = await this.itemData.clientInstance.getSubscriptions(topicDetails[i].title || '');
topics.push(new Topic(this.itemData, topicDetails[i].title, this, this.collapsibleState, subscriptions.length));
topics.push(new Topic(this.itemData, topicDetails[i].title, this, subscriptions.length ? this.collapsibleState : TreeItemCollapsibleState.None, subscriptions.length));
}

this.children = topics;
Expand Down

0 comments on commit 092f400

Please sign in to comment.