-
Notifications
You must be signed in to change notification settings - Fork 523
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw Better Error when running registries commands when No Registrie…
…s are Connected (#4101) * fix genericV2 root not showing up when adding registry * throw good error when no registries are connected * use hasTrackedRegistries function * use npm dot com
- Loading branch information
Showing
7 changed files
with
69 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See LICENSE.md in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { CommonRegistryItem, isCommonRegistryItem } from '@microsoft/vscode-docker-registries'; | ||
import * as vscode from 'vscode'; | ||
import { UnifiedRegistryItem } from "./UnifiedRegistryTreeDataProvider"; | ||
|
||
export const ConnectRegistryContextValue: string = 'connectregistry'; | ||
|
||
export function isConnectRegistryTreeItem(item: unknown): item is UnifiedRegistryItem<CommonRegistryItem> { | ||
return isCommonRegistryItem(item) && item.type === ConnectRegistryContextValue; | ||
} | ||
|
||
/** | ||
* Creates a tree item that can be used to connect a new registry | ||
*/ | ||
export function getConnectRegistryTreeItem(): UnifiedRegistryItem<CommonRegistryItem> { | ||
return { | ||
provider: undefined, | ||
parent: undefined, | ||
wrappedItem: { | ||
label: vscode.l10n.t('Connect Registry...'), | ||
type: ConnectRegistryContextValue, | ||
iconPath: new vscode.ThemeIcon('plug'), | ||
command: { | ||
command: 'vscode-docker.registries.connectRegistry' | ||
}, | ||
parent: undefined | ||
} | ||
}; | ||
} |
This file contains 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
This file contains 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