From 539d1b194fd6fa3cf942b6b998258d04024ca2a3 Mon Sep 17 00:00:00 2001 From: Mateusz Jenek Date: Thu, 1 Aug 2024 11:05:07 +0200 Subject: [PATCH] fix: open resource type doc do not scroll to selected type --- scripts/download-humctl.js | 2 +- src/adapters/humctl/HumctlAdapter.ts | 2 +- src/controllers/HumanitecSidebarController.ts | 10 ++++++---- src/providers/AvailableResourceTypesProvider.ts | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/download-humctl.js b/scripts/download-humctl.js index 03bb161..54a77fe 100755 --- a/scripts/download-humctl.js +++ b/scripts/download-humctl.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -const CLI_VERSION = '0.25.1'; +const CLI_VERSION = '0.28.0'; const fs = require('node:fs/promises'); const extractZip = require('extract-zip'); diff --git a/src/adapters/humctl/HumctlAdapter.ts b/src/adapters/humctl/HumctlAdapter.ts index c4f65d8..326f9f7 100644 --- a/src/adapters/humctl/HumctlAdapter.ts +++ b/src/adapters/humctl/HumctlAdapter.ts @@ -42,7 +42,7 @@ export class HumctlAdapter implements IHumctlAdapter { throw new UnsupportedOperatingSystemError(os, arch); } - let humctlEmbeddedBinaryFilename = `cli_0.25.1_${os}_${arch}`; + let humctlEmbeddedBinaryFilename = `cli_0.28.0_${os}_${arch}`; if (os === 'win32') { humctlEmbeddedBinaryFilename += '.exe'; } diff --git a/src/controllers/HumanitecSidebarController.ts b/src/controllers/HumanitecSidebarController.ts index 96b714b..8dd60e9 100644 --- a/src/controllers/HumanitecSidebarController.ts +++ b/src/controllers/HumanitecSidebarController.ts @@ -1,7 +1,9 @@ import * as vscode from 'vscode'; -import { AvailableResourceTypesProvider } from '../providers/AvailableResourceTypesProvider'; +import { + AvailableResourceTypesProvider, + ResourceTypeTreeItem, +} from '../providers/AvailableResourceTypesProvider'; import { IResourceTypeRepository } from '../repos/ResourceTypeRepository'; -import { ResourceType } from '../domain/ResourceType'; import { ILoggerService } from '../services/LoggerService'; import { isHumanitecExtensionError } from '../errors/IHumanitecExtensionError'; import { @@ -106,7 +108,7 @@ export class HumanitecSidebarController { disposable = vscode.commands.registerCommand( 'humanitec.sidebar.availableResources.open_resource_type_doc', - async (resourceType: ResourceType) => { + async (resourceType: ResourceTypeTreeItem) => { try { let url = vscode.Uri.parse( 'https://developer.humanitec.com/platform-orchestrator/reference/resource-types/' @@ -114,7 +116,7 @@ export class HumanitecSidebarController { if (resourceType !== undefined) { url = vscode.Uri.parse( 'https://developer.humanitec.com/platform-orchestrator/reference/resource-types/#' + - resourceType.type + resourceType.resourceType ); } vscode.env.openExternal(url); diff --git a/src/providers/AvailableResourceTypesProvider.ts b/src/providers/AvailableResourceTypesProvider.ts index 7fbfbce..e47eaff 100644 --- a/src/providers/AvailableResourceTypesProvider.ts +++ b/src/providers/AvailableResourceTypesProvider.ts @@ -87,7 +87,7 @@ export type AvailableResourceTypesTreeItem = | ResourceTypePropertyTreeItem | ResourceTypePropertyValueTreeItem; -class ResourceTypeTreeItem extends vscode.TreeItem { +export class ResourceTypeTreeItem extends vscode.TreeItem { constructor( public readonly resourceType: string, public readonly name: string