-
Notifications
You must be signed in to change notification settings - Fork 60
Provide keybinding for Login, push and refresh commands #835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
2531a3f
7b47334
34db2be
935b3e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ import { V1ServicePort, V1Service } from '@kubernetes/client-node'; | |
| import { isURL } from 'validator'; | ||
| import { Refs, Ref, Type } from '../util/refs'; | ||
| import { Delayer } from '../util/async'; | ||
| import { contextGlobalState } from '../extension'; | ||
|
|
||
| export class Component extends OpenShiftItem { | ||
|
|
||
|
|
@@ -148,13 +149,27 @@ export class Component extends OpenShiftItem { | |
| ); | ||
| } | ||
|
|
||
| static getPushCmd(): Thenable< string | undefined> { | ||
| return contextGlobalState.globalState.get('PUSH'); | ||
| } | ||
|
|
||
| static setPushCmd(component, application, project): Thenable<void> { | ||
| return contextGlobalState.globalState.update('PUSH', `odo push ${component} --app ${application} --project ${project}`); | ||
| } | ||
|
|
||
| static async push(context: OpenShiftObject): Promise<string> { | ||
| const component = await Component.getOpenShiftCmdData(context, | ||
| "In which Project you want to push the changes", | ||
| "In which Application you want to push the changes", | ||
| "For which Component you want to push the changes"); | ||
| if (!component) return null; | ||
| Component.odo.executeInTerminal(Command.pushComponent(component.getParent().getParent().getName(), component.getParent().getName(), component.getName())); | ||
| const getPushCmd = await Component.getPushCmd(); | ||
| if (getPushCmd && !context) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With this check in place there is no way to use push command from command palette. After first push it will always push the same component until context menu for component in tree is used. |
||
| Component.odo.executeInTerminal(getPushCmd); | ||
| } else { | ||
| const component = await Component.getOpenShiftCmdData(context, | ||
| "In which Project you want to push the changes", | ||
| "In which Application you want to push the changes", | ||
| "For which Component you want to push the changes"); | ||
| if (!component) return null; | ||
| Component.setPushCmd(component.getName(), component.getParent().getName(), component.getParent().getParent().getName()); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should be just saving () => {
Component.odo.executeInTerminal(Command.pushComponent(component.getParent().getParent().getName(), component.getParent().getName(), component.getName()));
}here. |
||
| Component.odo.executeInTerminal(Command.pushComponent(component.getParent().getParent().getName(), component.getParent().getName(), component.getName())); | ||
| } | ||
| } | ||
|
|
||
| static async watch(context: OpenShiftObject): Promise<void> { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.