Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3ea04c6
added serverless functions view and UI
msivasubramaniaan Jul 3, 2023
a511e98
updated UI and added create fuction API
msivasubramaniaan Jul 4, 2023
c5523fd
added build API and UI imporovements
msivasubramaniaan Jul 5, 2023
7ec2fe6
added run API
msivasubramaniaan Jul 6, 2023
2ce3ef3
add terminal view for build and run commands
msivasubramaniaan Jul 9, 2023
c0a6a3c
UI imporvements
msivasubramaniaan Jul 10, 2023
7a14355
added vscodeMessage
msivasubramaniaan Jul 10, 2023
2c6f702
updated tools.json
msivasubramaniaan Jul 10, 2023
6324a4c
updated tools.json
msivasubramaniaan Jul 10, 2023
77362ea
fix for test failures
msivasubramaniaan Jul 10, 2023
9c95381
send name and path after building
msivasubramaniaan Jul 10, 2023
f78368a
added error dialog
msivasubramaniaan Jul 13, 2023
397d3c8
Merge branch 'main' into 2993-implement-serverless-functions-into-ope…
msivasubramaniaan Jul 13, 2023
bab07d6
moved weview to context menu
msivasubramaniaan Jul 17, 2023
cc2df9e
reverted CLI
msivasubramaniaan Jul 17, 2023
e9a1274
reverted
msivasubramaniaan Jul 17, 2023
bcfb9c0
Merge branch 'main' into 2993-implement-serverless-functions-into-ope…
msivasubramaniaan Jul 17, 2023
c5d9571
fixed filter component folder while selection
msivasubramaniaan Jul 18, 2023
c1ddb15
UI updated
msivasubramaniaan Jul 18, 2023
998bbf6
UI changes
Jul 20, 2023
30408d1
changed UI and added deploy function
Jul 21, 2023
50c5935
added icon on dropdown
Jul 24, 2023
2243514
reverted to func v1.10.0 and removed deploy functionality
Jul 24, 2023
fc02ab4
Merge branch 'main' into 2993-implement-serverless-functions-into-ope…
msivasubramaniaan Jul 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ src/webview/welcome
src/webview/git-import
src/webview/helm-chart
src/webview/feedback
src/webview/serverless-function
test/sandbox-registration
1 change: 1 addition & 0 deletions build/esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const webviews = [
'log',
'welcome',
'feedback',
'serverless-function',
'add-service-binding',
'openshift-terminal',
];
Expand Down
4 changes: 0 additions & 4 deletions images/title/dark/icon-refresh.svg

This file was deleted.

53 changes: 0 additions & 53 deletions images/title/light/icon-refresh.svg

This file was deleted.

109 changes: 96 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,7 @@
"command": "openshift.explorer.refresh",
"title": "Refresh Application Explorer View",
"category": "OpenShift",
"icon": {
"dark": "images/title/dark/icon-refresh.svg",
"light": "images/title/light/icon-refresh.svg"
}
"icon": "$(refresh)"
},
{
"command": "openshift.explorer.reportIssue",
Expand Down Expand Up @@ -634,10 +631,7 @@
"command": "openshift.componentTypesView.refresh",
"title": "Refresh Components Types View",
"category": "OpenShift",
"icon": {
"dark": "images/title/dark/icon-refresh.svg",
"light": "images/title/light/icon-refresh.svg"
}
"icon": "$(refresh)"
},
{
"command": "openshift.componentType.openStarterProjectRepository",
Expand Down Expand Up @@ -697,10 +691,7 @@
"command": "openshift.componentsView.refresh",
"title": "Refresh Components View",
"category": "OpenShift",
"icon": {
"dark": "images/title/dark/icon-refresh.svg",
"light": "images/title/light/icon-refresh.svg"
}
"icon": "$(refresh)"
},
{
"command": "openshift.componentTypesView.registry.openInView",
Expand Down Expand Up @@ -803,6 +794,43 @@
"command": "openshift.sandbox.signup",
"title": "Provision OpenShift Developer Sandbox",
"category": "OpenShift"
},
{
"command": "openshift.Serverless.openFunction",
"title": "Open Function",
Comment thread
msivasubramaniaan marked this conversation as resolved.
"category": "OpenShift"
},
{
"command": "openshift.Serverless.createFunction",
"title": "Create Function",
"category": "OpenShift",
"icon": "$(plus)"
},
{
"command": "openshift.Serverless.refresh",
"title": "Refresh Serverless Function View",
"category": "OpenShift",
"icon": "$(refresh)"
},
{
"command": "openshift.Serverless.build",
"title": "Build",
"category": "OpenShift"
},
{
"command": "openshift.Serverless.buildAndRun",
"title": "Build and Run",
"category": "OpenShift"
},
{
"command": "openshift.Serverless.run",
"title": "Run",
"category": "OpenShift"
},
{
"command": "openshift.Serverless.stopRun",
"title": "Stop",
"category": "OpenShift"
Comment thread
msivasubramaniaan marked this conversation as resolved.
}
],
"keybindings": [
Expand Down Expand Up @@ -847,6 +875,10 @@
"id": "openshiftComponentTypesView",
"name": "Devfile Registries"
},
{
"id": "openshiftServerlessFunctionsView",
"name": "Serverless Functions"
},
{
"id": "openshiftDebugView",
"name": "Debug Sessions"
Expand Down Expand Up @@ -1111,7 +1143,32 @@
{
"command": "openshift.component.binding.add",
"when": "false"
},
{
"command": "openshift.Serverless.openFunction",
"when": "false"
},
{
"command": "openshift.Serverless.refresh",
"when": "false"
},
{
"command": "openshift.Serverless.build",
"when": "false"
},
{
"command": "openshift.Serverless.buildAndRun",
"when": "false"
},
{
"command": "openshift.Serverless.run",
"when": "false"
},
{
"command": "openshift.Serverless.stopRun",
"when": "false"
}

],
"view/title": [
{
Expand Down Expand Up @@ -1173,6 +1230,16 @@
"command": "openshift.component.openImportFromGit",
"when": "view == openshiftComponentsView",
"group": "navigation"
},
{
"command": "openshift.Serverless.createFunction",
"when": "view == openshiftServerlessFunctionsView",
"group": "navigation@0"
},
{
"command": "openshift.Serverless.refresh",
"when": "view == openshiftServerlessFunctionsView",
"group": "navigation@1"
}
],
"view/item/context": [
Expand Down Expand Up @@ -1258,7 +1325,7 @@
},
{
"command": "openshift.project.create",
"when": "view == openshiftProjectExplorer && viewItem == openshift.k8sContext && isLoggedIn",
"when": "view == openshiftProjectExplorer && viewItem == openshift.k8sContext",
"group": "c1"
},
{
Expand Down Expand Up @@ -1433,6 +1500,22 @@
{
"command": "openshift.resource.openInDeveloperConsole",
"when": "view == openshiftProjectExplorer && viewItem == openshift.k8sObject && isOpenshiftCluster || openshift.k8sObject.helm && isOpenshiftCluster"
},
{
"command": "openshift.Serverless.build",
"when": "view == openshiftServerlessFunctionsView && viewItem =~ /^(localFunctions|localFunctionsWithBuild)$/"
},
{
"command": "openshift.Serverless.buildAndRun",
"when": "view == openshiftServerlessFunctionsView && viewItem =~ /^(localFunctions|localFunctionsWithBuild)$/"
},
{
"command": "openshift.Serverless.run",
"when": "view == openshiftServerlessFunctionsView && viewItem =~ /^(localFunctionsWithBuild)$/"
},
{
"command": "openshift.Serverless.stopRun",
"when": "view == openshiftServerlessFunctionsView && viewItem =~ /^(running)$/"
}
]
},
Expand Down
2 changes: 2 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { extendClusterExplorer } from './k8s/clusterExplorer';
import { Cluster } from './openshift/cluster';
import { Component } from './openshift/component';
import { ComponentTypesView } from './registriesView';
import { ServerlessFunctionView } from './serveressFunction/view';
import { startTelemetry } from './telemetry';
import { ToolsConfig } from './tools';
import { TokenStore } from './util/credentialManager';
Expand Down Expand Up @@ -96,6 +97,7 @@ export async function activate(extensionContext: ExtensionContext): Promise<unkn
new DebugSessionsView().createTreeView('openshiftDebugView'),
...Component.init(),
ComponentTypesView.instance.createTreeView('openshiftComponentTypesView'),
ServerlessFunctionView.getInstance(),
ComponentsTreeDataProvider.instance.createTreeView('openshiftComponentsView'),
window.registerWebviewViewProvider('openShiftTerminalView', OpenShiftTerminalManager.getInstance(), { webviewOptions: { retainContextWhenHidden: true, } }),
];
Expand Down
3 changes: 3 additions & 0 deletions src/k8s/deploymentConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export class DeploymentConfig {
getDeploymentConfigs(): CommandText {
return new CommandText('oc get deploymentConfig -o json');
},
getDeploymentFunctions(): CommandText {
return new CommandText('func list -o json');
},
showDeploymentConfigLog(deploymentConfig: string): CommandText {
return new CommandText('oc logs', `dc/${deploymentConfig}`);
},
Expand Down
3 changes: 3 additions & 0 deletions src/openshift/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export class Cluster extends OpenShiftItem {
.then(async (result) => {
if (result.stderr === '') {
Cluster.explorer.refresh();
Cluster.serverlessView.refresh();
void commands.executeCommand('setContext', 'isLoggedIn', false);
const logoutInfo = await window.showInformationMessage('Successfully logged out. Do you want to login to a new cluster', 'Yes', 'No');
if (logoutInfo === 'Yes') {
Expand All @@ -56,6 +57,7 @@ export class Cluster extends OpenShiftItem {
@vsCommand('openshift.explorer.refresh')
static refresh(): void {
Cluster.explorer.refresh();
Cluster.serverlessView.refresh();
}

@vsCommand('openshift.about')
Expand Down Expand Up @@ -549,6 +551,7 @@ export class Cluster extends OpenShiftItem {
static async loginMessage(clusterURL: string, result: CliExitData): Promise<string | undefined> {
if (result.stderr === '') {
Cluster.explorer.refresh();
Cluster.serverlessView.refresh();
await commands.executeCommand('setContext', 'isLoggedIn', true);
return `Successfully logged in to '${clusterURL}'`;
}
Expand Down
3 changes: 3 additions & 0 deletions src/openshift/openshiftItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { QuickPickItem, commands, window } from 'vscode';
import { OpenShiftExplorer } from '../explorer';
import { Odo, OpenShiftObject, getInstance } from '../odo';
import { Project } from '../odo/project';
import { ServerlessFunctionView } from '../serveressFunction/view';

export class QuickPickCommand implements QuickPickItem {
constructor (public label: string,
Expand All @@ -28,6 +29,8 @@ export default class OpenShiftItem {

protected static readonly explorer: OpenShiftExplorer = OpenShiftExplorer.getInstance();

protected static readonly serverlessView: ServerlessFunctionView = ServerlessFunctionView.getInstance();

static validateUniqueName(data: Array<OpenShiftObject>, value: string): string {
const openshiftObject = data.find((item) => item.getName() === value);
return openshiftObject && 'This name is already used, please enter different name.';
Expand Down
1 change: 1 addition & 0 deletions src/openshift/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class Project extends OpenShiftItem {
const projectName = selectedItem.label;
await CliChannel.getInstance().executeTool(Command.setActiveProject(projectName));
Project.explorer.refresh();
Project.serverlessView.refresh();
message = `Project '${projectName}' set as active.`;
}
return message;
Expand Down
Loading