Skip to content

Commit

Permalink
chore:removing progress bar upon clearing all stages (#70)
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya-eddy <aditya282003@gmail.com>
  • Loading branch information
Aditya-eddy authored Oct 7, 2024
1 parent 30c04a5 commit bd0e690
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
17 changes: 16 additions & 1 deletion sidebar/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ let actionStarted = false;
const navigateToConfigButton = document.getElementById('backtoHome');
const backtoHome = document.getElementById('backArrow');
const selectedIconButton = document.getElementById('selectedIconNumber');
const ProgressStepperContainer = document.getElementById('progress-stepper');
let FilePath = "";

//cleanup required
Expand Down Expand Up @@ -394,6 +395,8 @@ document.addEventListener('ciCdStepClick', function (e) {
type: "openLink",
url: "https://keploy.io/docs", // Replace this with the URL you want to navigate to
});// Example of opening a link


}
});

Expand All @@ -407,13 +410,25 @@ document.addEventListener('addUsersClick', function (e) {
type: "openLink",
url: "https://app.keploy.io", // Replace this with the URL you want to navigate to
});// Example of opening a link

vscode.postMessage({
type:"progressStatus",
value:"false"
})
}
});

// Handle messages sent from the extension
window.addEventListener('message', event => {
const message = event.data;
// console.log("message", message);
console.log("message", message);

if(message.type === "progressBarStatus"){
if(message.value == false){
ProgressStepperContainer.style.display = "none";
}
}


if (message.type === 'navigateToHome') {
vscode.postMessage({
Expand Down
20 changes: 19 additions & 1 deletion src/SidebarProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ export class SidebarProvider implements vscode.WebviewViewProvider {

const apiResponse = this._context.globalState.get<string>('apiResponse') || "No response";
const signedIn = this._context.globalState.get<string>('SignedOthers') || "false";
const progressBarVisible = this._context.globalState.get<boolean>('progressVisible') ?? true;


console.log("signedIn others value", signedIn);

Expand Down Expand Up @@ -404,7 +406,14 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
}
break;
}
case "progressStatus":{
if(progressBarVisible == true && data.value == "false"){

Check warning on line 410 in src/SidebarProvider.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Expected '===' and instead saw '=='

Check warning on line 410 in src/SidebarProvider.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Expected '===' and instead saw '=='

Check warning on line 410 in src/SidebarProvider.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Expected '===' and instead saw '=='

Check warning on line 410 in src/SidebarProvider.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Expected '===' and instead saw '=='

Check warning on line 410 in src/SidebarProvider.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Expected '===' and instead saw '=='

Check warning on line 410 in src/SidebarProvider.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Expected '===' and instead saw '=='
console.log("progressbarVisible and data value: ",progressBarVisible,data.value);
await this._context.globalState.update("progressVisible", false);
}

break;
}
case "openLink": {

try {
Expand Down Expand Up @@ -549,7 +558,7 @@ export class SidebarProvider implements vscode.WebviewViewProvider {

// Stop the interval when the webview is no longer active
public dispose() {
if (this._interval) {
if (this._interval) {
clearInterval(this._interval);
}
}
Expand All @@ -567,6 +576,15 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
type: 'signedIn',
value: signedIn,
});

const progressBarVisible = this._context.globalState.get<boolean>('progressVisible') ?? true;


this._view.webview.postMessage({
type: 'progressBarStatus',
value: progressBarVisible,
});

}
}
public revive(panel: vscode.WebviewView) {
Expand Down
6 changes: 4 additions & 2 deletions webviews/components/KeployHome.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
let settingsIcon = document.querySelector(".settings-icon");
let currentStep = 1;
let backConfigButton;
let progressBarHide;
function goToNextStep(step) {
currentStep = step;
}
function resetCurrentStep() {
Expand Down Expand Up @@ -83,6 +84,7 @@
detail: { step: 'add-users' },
});
document.dispatchEvent(event);
}
}
const toggleRecording = () => {
Expand Down Expand Up @@ -345,7 +347,7 @@
</div>
{/if}
<div class="loader" id="loader"></div>
<div class="stepper-container">
<div class="stepper-container" id="progress-stepper">
<div class="step-line"></div>
<div class="step">
<span
Expand Down

0 comments on commit bd0e690

Please sign in to comment.