Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
52a7824
added walthrough in package.json
msivasubramaniaan May 19, 2022
9eecf00
Merge branch 'main' into 2414-create-get-started-for-openshift-in-vsc…
msivasubramaniaan May 24, 2022
26849f3
added steps on the walkthrough
msivasubramaniaan May 31, 2022
3092b6c
Merge branch 'main' into 2414-create-get-started-for-openshift-in-vsc…
msivasubramaniaan Jun 1, 2022
36d3e1f
changed title and description of the steps
msivasubramaniaan Jun 1, 2022
7c58658
Merge branch 'main' into 2414-create-get-started-for-openshift-in-vsc…
msivasubramaniaan Jun 1, 2022
f3b4824
added additional login option and post corresponding message
msivasubramaniaan Jun 1, 2022
ff0171c
Update login description in package.json
msivasubramaniaan Jun 2, 2022
10fdbcd
Update debug description in package.json
msivasubramaniaan Jun 2, 2022
937c83d
Update login title in package.json
msivasubramaniaan Jun 2, 2022
fe2c009
added show registry step and updated the gifs
msivasubramaniaan Jun 2, 2022
b05ccb8
Merge branch '2414-create-get-started-for-openshift-in-vscode-open-wa…
msivasubramaniaan Jun 2, 2022
376099d
used the exisiting message passing
msivasubramaniaan Jun 2, 2022
bc7ce64
Update open browser desc package.json
msivasubramaniaan Jun 2, 2022
d3357d1
Update create component desc package.json
msivasubramaniaan Jun 2, 2022
9ac4978
Update push component desc package.json
msivasubramaniaan Jun 2, 2022
f3968cd
updated desc and gifs
msivasubramaniaan Jun 2, 2022
8dd7f57
updated desc of show registries
msivasubramaniaan Jun 2, 2022
1de2189
added openInView into onCommand for makes the step get completes
msivasubramaniaan Jun 2, 2022
94ff9d5
Update the main desc package.json
msivasubramaniaan Jun 2, 2022
fba0856
Update the login desc package.json
msivasubramaniaan Jun 2, 2022
47c7ed6
Update the show registry desc package.json
msivasubramaniaan Jun 2, 2022
009b39f
updated the vscode-openshift-tools.gif
msivasubramaniaan Jun 2, 2022
41c7c99
updated the vscode-openshift-tools.gif
msivasubramaniaan Jun 2, 2022
13fce0f
Merge branch '2414-create-get-started-for-openshift-in-vscode-open-wa…
msivasubramaniaan Jun 2, 2022
83b868e
reverted the gif
msivasubramaniaan Jun 2, 2022
84c91d9
Merge branch 'main' into 2414-create-get-started-for-openshift-in-vsc…
msivasubramaniaan Jun 8, 2022
355d406
change login title and desc
msivasubramaniaan Jun 10, 2022
5e88ae8
Add activation event and Provision OpenShift cluster button
dgolovin Jun 15, 2022
da906a2
Revert "Add activation event and Provision OpenShift cluster button"
dgolovin Jun 15, 2022
be5d77c
Rename 'Connect using ...' to 'Provision ...'
dgolovin Jun 16, 2022
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
Binary file added images/walkthrough/createComponent.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/walkthrough/loginCluster.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/walkthrough/push.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 63 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -896,11 +896,6 @@
}
],
"keybindings": [
{
"command": "openshift.explorer.login",
"key": "alt+shift+l",
"mac": "ctrl+shift+l"
},
{
"command": "openshift.explorer.refresh",
"key": "alt+shift+r",
Expand Down Expand Up @@ -1561,6 +1556,69 @@
}
]
},
"walkthroughs": [
{
"id": "openshiftWalkthrough",
"title": "Getting Started with OpenShift",
"description": "A sample walkthrough",
Comment thread
msivasubramaniaan marked this conversation as resolved.
Outdated
"steps": [
{
"id": "login",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

This step does not look right to me. Login is just a way to get access to cluster resources and it does not matter how cluster is provisioned or where it is located.

What I see is attempt to mix cluster login, provisioning and location in one step.

I suggest to bubble up one more step. 'Get access to OpenShift cluster' or 'Provision or use existing OpenShift cluster'
Where we can have button to open 'Add Cluster Editor'. Then reduce Login step to just a description and login button.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Changed the login title and description. Please refer the screenshot

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this covers the use case of differentiating the Login and provision workflow. The description also works for me. LGTM.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it is still two questions answered in one step.

'Connect using OpenShift Local' sounds awkward to me, I would say 'Connect using ssh' or 'Connect to OpenShift using SSH'. Both sounds good to me. Lets try 'Connect to OpenShift Using OpenShift Local' does that sound good? It is not for me.

IMHO first someone who is interested would ask where/how one can get OpenShift instance? Then ask how to work with it or see what is in it through the UI elements provided by extension they've just installed and that would require to log into the cluster.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here OpenShift local refers to renamed CodeReadyContainers. So connect using OpenShift local should open the CRC view we currently have.

"title": "Login to Openshift",
Comment thread
msivasubramaniaan marked this conversation as resolved.
Outdated
"description": "This step will helps with login to Openshift.\n[Connect using remote OpenShift Cluster](command:openshift.explorer.login)\n[Connect using OpenShift Local](command:openshift.explorer.addCluster?[\"crc\"])\n[Connect using Developer Sandbox](command:openshift.explorer.addCluster?[\"sandbox\"])",
Comment thread
msivasubramaniaan marked this conversation as resolved.
Outdated
"media": {
"image": "images/walkthrough/loginCluster.gif",
"altText": "login to cluster"
},
"completionEvents": [
"onCommand:openshift.explorer.login",
"onCommand:openshift.explorer.addCluster",
"onCommand:openshift.explorer.login.credentialsLogin",
"onCommand:openshift.explorer.login.tokenLogin"
]
},
{
"id": "createComponent",
"title": "Create a Component using Registry Viewer",
"description": "This step will run a command and check off once it has been run.\n[Create Component](command:openshift.componentType.newComponent)",
Comment thread
msivasubramaniaan marked this conversation as resolved.
Outdated
"media": {
"image": "images/walkthrough/createComponent.gif",
"altText": "create component"
},
"completionEvents": [
"onCommand:openshift.componentType.newComponent"
]
},
{
"id": "pushComponent",
"title": "Push a Component to the connected cluster",
"description": "This step will push the component into the cluster.",
Comment thread
msivasubramaniaan marked this conversation as resolved.
Outdated
"media": {
"image": "images/walkthrough/push.gif",
"altText": "push"
}
},
{
"id": "debug",
"title": "Debug the Component locally",
"description": "This step helps to understand, debugging a component locally.",
Comment thread
msivasubramaniaan marked this conversation as resolved.
Outdated
"media": {
"image": "images/walkthrough/push.gif",
"altText": "push"
}
},
{
"id": "openInBrowser",
"title": "Open the Component in Browser",
"description": "This step helps to understand, opening the component in browser.",
Comment thread
msivasubramaniaan marked this conversation as resolved.
Outdated
"media": {
"image": "images/walkthrough/push.gif",
"altText": "push"
Comment thread
msivasubramaniaan marked this conversation as resolved.
Outdated
}
}
]
}
],
"configuration": [
{
"type": "object",
Expand Down
9 changes: 6 additions & 3 deletions src/openshift/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*-----------------------------------------------------------------------------------------------*/

import { window, commands, env, QuickPickItem, ExtensionContext, Terminal, Uri, workspace } from 'vscode';
import { window, commands, env, QuickPickItem, ExtensionContext, Terminal, Uri, workspace, WebviewPanel } from 'vscode';
import { Command } from '../odo/command';
import OpenShiftItem, { clusterRequired } from './openshiftItem';
import { CliExitData, CliChannel } from '../cli';
Expand Down Expand Up @@ -108,8 +108,11 @@ export class Cluster extends OpenShiftItem {
}

@vsCommand('openshift.explorer.addCluster')
static add(): void {
ClusterViewLoader.loadView('Add OpenShift Cluster');
static async add(value: string): Promise<void> {
const webViewPanel: WebviewPanel = await ClusterViewLoader.loadView('Add OpenShift Cluster');
if(value?.length > 0){
await webViewPanel.webview.postMessage({action: 'cluster', param: value});
}
}

@vsCommand('openshift.explorer.stopCluster')
Expand Down
83 changes: 45 additions & 38 deletions src/webview/cluster/app/cluster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import * as React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import { vscodeApi } from '../vsCodeMessage';
import {
Button,
Card,
Expand All @@ -25,45 +26,51 @@ import './images/logo.png';
const useStyles = makeStyles(clusterStyle);

const clusterTypes = [
{
heading: 'Deploy it locally on your laptop',
description: 'Install on Laptop: Red Hat CodeReady Containers.',
smallInfo: 'Create a minimal OpenShift 4 cluster on your desktop/laptop for local development and testing.',
imageUrl: ['https://www.openshift.com/hubfs/images/icons/Icon-Red_Hat-Hardware-Laptop-A-Black-RGB.svg'],
urlAlt: 'crc',
redirectLink: '',
buttonText: 'Create/Refresh cluster',
tooltip: 'You can create/run local OpenShift 4 cluster using this wizard.'
},
{
heading: 'Launch Developer Sandbox',
description: 'Free access to the Developer Sandbox for Red Hat OpenShift',
smallInfo: 'The sandbox provides you with a private OpenShift environment in a shared, multi-tenant OpenShift cluster that is pre-configured with a set of developer tools.',
imageUrl: ['https://assets.openshift.com/hubfs/images/logos/osh/Logo-Red_Hat-OpenShift-A-Standard-RGB.svg'],
urlAlt: 'dev sandbox',
redirectLink: '',
buttonText: 'Start your OpenShift experience',
tooltip: 'Launch your Developer Sandbox for Red Hat OpenShift'
},
{
heading: 'Deploy it in your public cloud',
description: 'Run OpenShift clusters on your own by installing from another cloud provider.',
smallInfo: 'This includes Azure Red Hat Openshift, Red Hat OpenShift on IBM Cloud, Red Hat OpenShift Service on AWS, Google Cloud, AWS (x86_64), Azure.',
imageUrl: ['https://www.openshift.com/hubfs/images/logos/logo_aws.svg', 'https://www.openshift.com/hubfs/images/logos/logo-try-cloud.svg', 'https://www.openshift.com/hubfs/images/logos/logo_google_cloud.svg'],
urlAlt: 'public cloud',
redirectLink: 'https://console.redhat.com/openshift/create',
buttonText: 'Try it in your cloud',
tooltip: 'For complete installation, follow the official documentation.'
}
{
heading: 'Deploy it locally on your laptop',
description: 'Install on Laptop: Red Hat CodeReady Containers.',
smallInfo: 'Create a minimal OpenShift 4 cluster on your desktop/laptop for local development and testing.',
imageUrl: ['https://www.openshift.com/hubfs/images/icons/Icon-Red_Hat-Hardware-Laptop-A-Black-RGB.svg'],
urlAlt: 'crc',
redirectLink: '',
buttonText: 'Create/Refresh cluster',
tooltip: 'You can create/run local OpenShift 4 cluster using this wizard.'
},
{
heading: 'Launch Developer Sandbox',
description: 'Free access to the Developer Sandbox for Red Hat OpenShift',
smallInfo: 'The sandbox provides you with a private OpenShift environment in a shared, multi-tenant OpenShift cluster that is pre-configured with a set of developer tools.',
imageUrl: ['https://assets.openshift.com/hubfs/images/logos/osh/Logo-Red_Hat-OpenShift-A-Standard-RGB.svg'],
urlAlt: 'dev sandbox',
redirectLink: '',
buttonText: 'Start your OpenShift experience',
tooltip: 'Launch your Developer Sandbox for Red Hat OpenShift'
},
{
heading: 'Deploy it in your public cloud',
description: 'Run OpenShift clusters on your own by installing from another cloud provider.',
smallInfo: 'This includes Azure Red Hat Openshift, Red Hat OpenShift on IBM Cloud, Red Hat OpenShift Service on AWS, Google Cloud, AWS (x86_64), Azure.',
imageUrl: ['https://www.openshift.com/hubfs/images/logos/logo_aws.svg', 'https://www.openshift.com/hubfs/images/logos/logo-try-cloud.svg', 'https://www.openshift.com/hubfs/images/logos/logo_google_cloud.svg'],
urlAlt: 'public cloud',
redirectLink: 'https://console.redhat.com/openshift/create',
buttonText: 'Try it in your cloud',
tooltip: 'For complete installation, follow the official documentation.'
}
];

const vscodeApi = window.vscodeApi;

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export default function Header() {
const classes = useStyles();
const [showWizard, setShowWizard] = React.useState('');

React.useEffect(() => {
return vscodeApi.onMessage((message) => {
if (['crc', 'sandbox'].includes(message.data.param)) {
setShowWizard(message.data.param);
}
});
})

const handleView = (index: number) => {
switch (index) {
case 0:
Expand Down Expand Up @@ -141,7 +148,7 @@ export default function Header() {
<div className={classes.iconContainer}>
<img className={classes.image} src='assets/logo.png' alt="redhat-openshift"></img>
</div>
{ showWizard === 'crc' && (
{showWizard === 'crc' && (
<div className={classes.rowBody}>
<Card className={classes.cardContent}>
<Typography variant="body2" component="p" style={{ padding: 20 }}>
Expand All @@ -151,20 +158,20 @@ export default function Header() {
</Card>
</div>
)}
{ showWizard === 'sandbox' && (
{showWizard === 'sandbox' && (
<div className={classes.rowBody}>
<Card className={classes.cardContent}>
<Typography variant="body2" component="p" style={{ padding: 20 }}>
The sandbox provides you with a private OpenShift environment in a shared, multi-tenant OpenShift cluster that is pre-configured with a set of developer tools. <br></br>Discover the rich capabilities of the full developer experience on OpenShift with the sandbox.
The sandbox provides you with a private OpenShift environment in a shared, multi-tenant OpenShift cluster that is pre-configured with a set of developer tools. <br></br>Discover the rich capabilities of the full developer experience on OpenShift with the sandbox.
</Typography>
<Button variant="outlined" href='https://developers.redhat.com/developer-sandbox' className={classes.button} style={{ margin: 15, textTransform: 'none' }}>Learn More</Button>
<Button variant="outlined" href='mailto:devsandbox@redhat.com' className={classes.button} style={{ margin: 15, textTransform: 'none' }}>Contact Us</Button>
<Button variant="outlined" href='https://dn.dev/DevNationSlack'className={classes.button} style={{ margin: 15, textTransform: 'none' }}>Connect on Slack</Button>
<AddSandboxView/>
<Button variant="outlined" href='https://dn.dev/DevNationSlack' className={classes.button} style={{ margin: 15, textTransform: 'none' }}>Connect on Slack</Button>
<AddSandboxView vscode={vscodeApi} />
</Card>
</div>
)}
{ !showWizard && (
{!showWizard && (
<div className={classes.cardContainer}>
<InfrastructureLayout clusterTypes={clusterTypes}></InfrastructureLayout>
</div>
Expand Down
3 changes: 0 additions & 3 deletions src/webview/cluster/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
<% if (!production) { %>
<script src="./devstub.js"></script>
<% } %>
<script>
window.vscodeApi = acquireVsCodeApi();
</script>
<style>
html,
body {
Expand Down
8 changes: 4 additions & 4 deletions src/webview/cluster/app/sandboxView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function addSandboxView(props): JSX.Element {
window.addEventListener('message', messageListener);

function postMessage(action: string, payload?: any): void {
window.vscodeApi.postMessage({ action, payload });
props.vscode.postMessage({ action, payload });
}

React.useEffect(() => {
Expand Down Expand Up @@ -225,7 +225,7 @@ export default function addSandboxView(props): JSX.Element {
const handleRequestVerificationCode = () => {
const rawPhoneNumber = phoneNumber.slice(countryCode.length);
const fullCountryCode = '+' + countryCode;

setInProgress(true);
postMessage('sandboxRequestVerificationCode', { rawPhoneNumber, fullCountryCode });
}
Expand Down Expand Up @@ -360,7 +360,7 @@ export default function addSandboxView(props): JSX.Element {
const handleLoginButton = () => {
postMessage('sandboxLoginUsingDataInClipboard', {url: currentState.consoleDashboard});
};

return (
<>
{( currentState.action === 'sandboxPageProvisioned' ) && (
Expand Down Expand Up @@ -411,4 +411,4 @@ export default function addSandboxView(props): JSX.Element {
<Provisioned />
</>
)
}
}
37 changes: 37 additions & 0 deletions src/webview/cluster/vsCodeMessage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*-----------------------------------------------------------------------------------------------
* Copyright (c) Red Hat, Inc. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*-----------------------------------------------------------------------------------------------*/

declare const acquireVsCodeApi: Function;

interface VSCodeApi {
getState: () => any;
setState: (newState: any) => any;
postMessage: (message: any) => void;
}

class VSCodeWrapper {
private readonly vscodeApi: VSCodeApi = acquireVsCodeApi();

/**
* Send message to the extension framework.
* @param message
*/
public postMessage(message: any): void {
this.vscodeApi.postMessage(message);
}

/**
* Add listener for messages from extension framework.
* @param callback called when the extension sends a message
* @returns function to clean up the message eventListener.
*/
public onMessage(callback: (message: any) => void): () => void {
window.addEventListener('message', callback);
return () => window.removeEventListener('message', callback);
}
}

// Singleton to prevent multiple fetches of VsCodeAPI.
export const vscodeApi: VSCodeWrapper = new VSCodeWrapper();