Skip to content

Commit 80ce40c

Browse files
authored
Feat: Removing components from ASO, Detectors, Kubectl, & Periscope commands (#1261)
Signed-off-by: Tejhan Diallo <82427254+tejhan@users.noreply.github.com>
1 parent cd07b42 commit 80ce40c

File tree

10 files changed

+38
-55
lines changed

10 files changed

+38
-55
lines changed

webview-ui/src/AzureServiceOperator/AzureServiceOperator.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { VSCodeLink } from "@vscode/webview-ui-toolkit/react";
21
import styles from "./AzureServiceOperator.module.css";
32
import { InitialState } from "../../../src/webview-contract/webviewDefinitions/azureServiceOperator";
43
import { useEffect } from "react";
@@ -64,7 +63,7 @@ export function AzureServiceOperator(initialState: InitialState) {
6463
<p>
6564
The Azure Service Operator helps you provision Azure resources and connect your applications to them
6665
from within Kubernetes.
67-
<VSCodeLink href="https://aka.ms/aks/aso">&nbsp;Learn more</VSCodeLink>
66+
<a href="https://aka.ms/aks/aso">&nbsp;Learn more</a>
6867
</p>
6968
<div className={styles.content}>
7069
<div className={styles.inputPane}>

webview-ui/src/AzureServiceOperator/Inputs.tsx

+11-19
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import {
2-
VSCodeButton,
3-
VSCodeDropdown,
4-
VSCodeLink,
5-
VSCodeOption,
6-
VSCodeTextField,
7-
} from "@vscode/webview-ui-toolkit/react";
1+
import { VSCodeDropdown, VSCodeOption } from "@vscode/webview-ui-toolkit/react";
82
import styles from "./AzureServiceOperator.module.css";
93
import { ASOState, EventDef, InstallStepStatus } from "./helpers/state";
104
import { EventHandlers } from "../utilities/state";
@@ -74,30 +68,30 @@ export function Inputs(props: InputsProps) {
7468
<FontAwesomeIcon className={styles.infoIndicator} icon={faInfoCircle} />
7569
Provide the App ID and password of a Service Principal with Contributor permissions for your
7670
subscription. This allows ASO to create resources in your subscription on your behalf.
77-
<VSCodeLink href="https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli">
71+
<a href="https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli">
7872
&nbsp; Learn more
79-
</VSCodeLink>
73+
</a>
8074
</p>
8175

8276
<label htmlFor="spappid" className={styles.label}>
8377
Enter App ID of service principal:
8478
</label>
85-
<VSCodeTextField
79+
<input
80+
type="text"
8681
value={appId || ""}
8782
readOnly={!canEditSP}
8883
required
8984
id="spappid"
9085
onInput={handleAppIdChange}
9186
className={styles.control}
9287
size={50}
93-
type="text"
9488
placeholder="e.g. 041ccd53-e72f-45d1-bbff-382c82f6f9a1"
9589
/>
9690

9791
<label htmlFor="spcred" className={styles.label}>
9892
Enter Password of Service Principal:
9993
</label>
100-
<VSCodeTextField
94+
<input
10195
value={appSecret || ""}
10296
readOnly={!canEditSP}
10397
required
@@ -109,9 +103,9 @@ export function Inputs(props: InputsProps) {
109103
placeholder="Service principal password"
110104
/>
111105

112-
<VSCodeButton disabled={!canCheckSP} onClick={handleCheckSPClick}>
106+
<button disabled={!canCheckSP} onClick={handleCheckSPClick}>
113107
Check
114-
</VSCodeButton>
108+
</button>
115109
</div>
116110
{canViewSubscriptions && (
117111
<div className={styles.inputContainer}>
@@ -121,9 +115,7 @@ export function Inputs(props: InputsProps) {
121115
The supplied service principal has some role assignments on the following subscriptions. Please
122116
ensure these are adequate for the Azure resources that ASO will be creating in your selected
123117
subscription.
124-
<VSCodeLink href="https://azure.github.io/azure-service-operator/#installation">
125-
&nbsp; Learn more
126-
</VSCodeLink>
118+
<a href="https://azure.github.io/azure-service-operator/#installation">&nbsp; Learn more</a>
127119
</p>
128120

129121
<label htmlFor="sub-select" className={styles.label}>
@@ -143,9 +135,9 @@ export function Inputs(props: InputsProps) {
143135
</VSCodeOption>
144136
))}
145137
</VSCodeDropdown>
146-
<VSCodeButton disabled={!canStartInstalling} type="submit">
138+
<button disabled={!canStartInstalling} type="submit">
147139
Install
148-
</VSCodeButton>
140+
</button>
149141
</div>
150142
)}
151143
</form>

webview-ui/src/Detector/Detector.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { VSCodeDivider, VSCodeLink } from "@vscode/webview-ui-toolkit/react";
21
import { InitialState } from "../../../src/webview-contract/webviewDefinitions/detector";
32
import { SingleDetector } from "./SingleDetector";
43
import { useStateManagement } from "../utilities/state";
@@ -11,9 +10,8 @@ export function Detector(initialState: InitialState) {
1110
<>
1211
<h2>{state.name}</h2>
1312
{state.description && state.description !== "test" && <p>{state.description}</p>}
14-
To perform more checks on your cluster, visit{" "}
15-
<VSCodeLink href={state.portalDetectorUrl}>AKS Diagnostics</VSCodeLink>.
16-
<VSCodeDivider style={{ marginTop: "16px" }} />
13+
To perform more checks on your cluster, visit <a href={state.portalDetectorUrl}>AKS Diagnostics</a>.
14+
<hr style={{ marginTop: "16px" }} />
1715
{state.detectors.map((detector) => (
1816
<SingleDetector key={detector.name} {...detector}></SingleDetector>
1917
))}

webview-ui/src/Kubectl/CommandInput.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { VSCodeButton, VSCodeTextField } from "@vscode/webview-ui-toolkit/react";
21
import styles from "./Kubectl.module.css";
32
import { FormEvent } from "react";
43

@@ -32,18 +31,19 @@ export function CommandInput(props: CommandInputProps) {
3231
<label htmlFor="command-input" className={styles.label}>
3332
Command
3433
</label>
35-
<VSCodeTextField
34+
<input
35+
type="text"
3636
id="command-input"
3737
className={styles.control}
3838
value={props.command}
3939
onInput={handleCommandChange}
4040
onKeyUp={onKeyPress}
4141
/>
4242
<div className={styles.commands}>
43-
<VSCodeButton disabled={!canRun} onClick={() => props.onRunCommand(props.command)}>
43+
<button disabled={!canRun} onClick={() => props.onRunCommand(props.command)}>
4444
Run
45-
</VSCodeButton>
46-
{!props.matchesExisting && <VSCodeButton onClick={props.onSaveRequest}>Save</VSCodeButton>}
45+
</button>
46+
{!props.matchesExisting && <button onClick={props.onSaveRequest}>Save</button>}
4747
</div>
4848
</div>
4949
);

webview-ui/src/Kubectl/Kubectl.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { VSCodeDivider } from "@vscode/webview-ui-toolkit/react";
21
import { CommandCategory, InitialState, PresetCommand } from "../../../src/webview-contract/webviewDefinitions/kubectl";
32
import styles from "./Kubectl.module.css";
43
import { CommandList } from "./CommandList";
@@ -75,7 +74,7 @@ export function Kubectl(initialState: InitialState) {
7574
<div className={styles.wrapper}>
7675
<header className={styles.mainHeading}>
7776
<h2>Kubectl Command Run for {state.clusterName}</h2>
78-
<VSCodeDivider />
77+
<hr />
7978
</header>
8079
<nav className={styles.commandNav}>
8180
<CommandList
@@ -93,7 +92,7 @@ export function Kubectl(initialState: InitialState) {
9392
onRunCommand={handleRunCommand}
9493
onSaveRequest={handleSaveRequest}
9594
/>
96-
<VSCodeDivider />
95+
<hr />
9796
<CommandOutput
9897
isCommandRunning={state.isCommandRunning}
9998
output={state.output}

webview-ui/src/Kubectl/SaveCommandDialog.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { FormEvent, useState } from "react";
22
import { Dialog } from "../components/Dialog";
3-
import { VSCodeButton, VSCodeDivider, VSCodeTextField } from "@vscode/webview-ui-toolkit/react";
43
import styles from "./Kubectl.module.css";
54

65
type ChangeEvent = Event | FormEvent<HTMLElement>;
@@ -41,27 +40,28 @@ export function SaveCommandDialog(props: SaveCommandDialogProps) {
4140
<h2>Save Command As</h2>
4241

4342
<form onSubmit={handleSubmit}>
44-
<VSCodeDivider />
43+
<hr />
4544

4645
<div className={styles.inputContainer}>
4746
<label htmlFor="cmd-name-input" className={styles.label}>
4847
Name
4948
</label>
50-
<VSCodeTextField
49+
<input
50+
type="text"
5151
id="command-input"
5252
className={styles.control}
5353
value={name}
5454
onInput={handleNameChange}
5555
/>
5656
</div>
5757

58-
<VSCodeDivider />
58+
<hr />
5959

6060
<div className={styles.buttonContainer}>
61-
<VSCodeButton type="submit" disabled={!canSave()}>
61+
<button type="submit" disabled={!canSave()}>
6262
Ok
63-
</VSCodeButton>
64-
<VSCodeButton onClick={props.onCancel}>Cancel</VSCodeButton>
63+
</button>
64+
<button onClick={props.onCancel}>Cancel</button>
6565
</div>
6666
</form>
6767
</Dialog>

webview-ui/src/Periscope/ErrorView.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { VSCodeDivider } from "@vscode/webview-ui-toolkit/react";
21
import { KustomizeConfig } from "../../../src/webview-contract/webviewDefinitions/periscope";
32
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
43
import { faTimesCircle } from "@fortawesome/free-solid-svg-icons";
@@ -15,7 +14,7 @@ export function ErrorView(props: ErrorViewProps) {
1514
<>
1615
<FontAwesomeIcon className={styles.errorIndicator} icon={faTimesCircle} />
1716
AKS Periscope failed to run on &#39;{props.clusterName}&#39;. Please see the error below for more details.
18-
<VSCodeDivider />
17+
<hr />
1918
<h3>Periscope settings (from VS Code Configuration)</h3>
2019
<dl className={styles.settinglist}>
2120
<dt>GitHub organisation (containing aks-periscope repo with Kustomize base)</dt>
@@ -30,7 +29,7 @@ export function ErrorView(props: ErrorViewProps) {
3029
<dt>Release tag (for {props.config.repoOrg}/aks-periscope GitHub repo)</dt>
3130
<dd>{props.config.releaseTag}</dd>
3231
</dl>
33-
<VSCodeDivider />
32+
<hr />
3433
<pre>{props.message}</pre>
3534
</>
3635
);

webview-ui/src/Periscope/NodeActions.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react";
21
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
32
import { faClone, faDownload } from "@fortawesome/free-solid-svg-icons";
43

@@ -20,16 +19,16 @@ export function NodeActions(props: NodeActionsProps) {
2019

2120
return (
2221
<>
23-
<VSCodeButton onClick={copyShareLink}>
22+
<button onClick={copyShareLink}>
2423
<FontAwesomeIcon icon={faClone} />
2524
&nbsp;Copy 7-Day Shareable Link
26-
</VSCodeButton>
25+
</button>
2726
&nbsp;
2827
{props.isUploaded && (
29-
<VSCodeLink href={shareableLink} title={shareableLink} target="_blank">
28+
<a href={shareableLink} title={shareableLink} target="_blank" rel="noreferrer">
3029
<FontAwesomeIcon icon={faDownload} />
3130
&nbsp;Download Zip
32-
</VSCodeLink>
31+
</a>
3332
)}
3433
</>
3534
);

webview-ui/src/Periscope/Periscope.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { VSCodeDivider, VSCodeLink } from "@vscode/webview-ui-toolkit/react";
21
import { useEffect } from "react";
32
import { InitialState } from "../../../src/webview-contract/webviewDefinitions/periscope";
43
import { ErrorView } from "./ErrorView";
@@ -30,11 +29,9 @@ export function Periscope(initialState: InitialState) {
3029
AKS Periscope collects and exports node and pod logs into an Azure Blob storage account to help you
3130
analyse and identify potential problems or easily share the information during the troubleshooting
3231
process.
33-
<VSCodeLink href="https://azure.github.io/vscode-aks-tools/features/aks-periscope.html">
34-
&nbsp;Learn more
35-
</VSCodeLink>
32+
<a href="https://azure.github.io/vscode-aks-tools/features/aks-periscope.html">&nbsp;Learn more</a>
3633
</p>
37-
<VSCodeDivider />
34+
<hr />
3835
{
3936
{
4037
error: (

webview-ui/src/Periscope/SuccessView.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { VSCodeDivider, VSCodeProgressRing } from "@vscode/webview-ui-toolkit/react";
1+
import { VSCodeProgressRing } from "@vscode/webview-ui-toolkit/react";
22
import { useEffect } from "react";
33
import { NodeUploadStatus, PodLogs } from "../../../src/webview-contract/webviewDefinitions/periscope";
44
import { NodeActions } from "./NodeActions";
@@ -87,7 +87,7 @@ export function SuccessView(props: SuccessViewProps) {
8787
</tbody>
8888
</table>
8989

90-
<VSCodeDivider />
90+
<hr />
9191

9292
{props.selectedNode && props.nodePodLogs && (
9393
<NodeLogs node={props.selectedNode} podLogs={props.nodePodLogs} />

0 commit comments

Comments
 (0)