Skip to content

Commit 6cfdff1

Browse files
authored
Merge pull request #2224 from digma-ai/close-wizard-only-on-first-launch
Close wizard only on first launch
2 parents 74b2aa9 + 9c817ac commit 6cfdff1

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed

ide-common/src/main/java/org/digma/intellij/plugin/ui/MainToolWindowCardsController.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import org.digma.intellij.plugin.analytics.*;
99
import org.digma.intellij.plugin.common.*;
1010
import org.digma.intellij.plugin.log.Log;
11+
import org.digma.intellij.plugin.persistence.PersistenceService;
12+
import org.digma.intellij.plugin.recentactivity.RecentActivityToolWindowShower;
1113
import org.digma.intellij.plugin.ui.panels.DisposablePanel;
1214
import org.digma.intellij.plugin.updates.*;
1315
import org.jetbrains.annotations.NotNull;
@@ -95,9 +97,26 @@ public void connectionGained() {
9597
@Override
9698
public void apiClientChanged(@NotNull String newUrl) {
9799
Backgroundable.ensurePooledThread(() -> {
98-
if (wizard.isOn()){
100+
//on new install the wizard opens and lets user install digma backend.
101+
//if the user doesn't have docker and wants to change to centralized deployment,
102+
// user will change the url in settings, the plugin will connect to the centralized deployment,
103+
// but there will be no way out of the wizard because there is no close button and no finish button.
104+
//so here we close the wizard in this scenario, the wizard will close and user will see the login screen.
105+
//isFirstWizardLaunch will be true on new install, when the wizard opens first time,
106+
// the flag will change only when INSTALLATION_WIZARD/FINISH message, so while the wizard is open
107+
// isFirstWizardLaunch should be true.
108+
//if user had a working local deployment and then decides to change to centralized, if the wizard is open
109+
// in that stage the wizard should have a close button.
110+
if (wizard.isOn() && PersistenceService.getInstance().isFirstWizardLaunch()){
99111
if(isCentralized()){
100-
EDT.ensureEDT(() -> wizardFinished());
112+
//do here everything that happens on INSTALLATION_WIZARD/FINISH message
113+
PersistenceService.getInstance().firstWizardLaunchDone();
114+
updateInstallationWizardFlag();
115+
EDT.ensureEDT(() -> {
116+
ToolWindowShower.getInstance(project).showToolWindow();
117+
project.getService(RecentActivityToolWindowShower.class).showToolWindow();
118+
wizardFinished();
119+
});
101120
}
102121
}
103122
});

src/main/kotlin/org/digma/intellij/plugin/ui/recentactivity/RecentActivityToolWindowShower.kt renamed to ide-common/src/main/kotlin/org/digma/intellij/plugin/recentactivity/RecentActivityToolWindowShower.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.digma.intellij.plugin.ui.recentactivity
1+
package org.digma.intellij.plugin.recentactivity
22

33
import com.intellij.openapi.components.Service
44
import com.intellij.openapi.diagnostic.Logger

src/main/kotlin/org/digma/intellij/plugin/ui/recentactivity/RecentActivityService.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import org.digma.intellij.plugin.model.rest.recentactivity.RecentActivityResult
1919
import org.digma.intellij.plugin.persistence.PersistenceService
2020
import org.digma.intellij.plugin.posthog.ActivityMonitor
2121
import org.digma.intellij.plugin.posthog.UserActionOrigin
22+
import org.digma.intellij.plugin.recentactivity.RecentActivityToolWindowShower
2223
import org.digma.intellij.plugin.scope.ScopeManager
2324
import org.digma.intellij.plugin.scope.SpanScope
2425
import org.digma.intellij.plugin.ui.common.openJaegerFromRecentActivity

src/main/kotlin/org/digma/intellij/plugin/ui/recentactivity/RecentActivityToolWindowFactory.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import com.intellij.ui.content.ContentFactory
1010
import com.intellij.util.ui.JBUI
1111
import org.digma.intellij.plugin.analytics.AnalyticsService
1212
import org.digma.intellij.plugin.log.Log
13+
import org.digma.intellij.plugin.recentactivity.RecentActivityToolWindowShower
1314
import org.digma.intellij.plugin.ui.common.statuspanels.createAggressiveUpdatePanel
1415
import org.digma.intellij.plugin.ui.common.statuspanels.createNoConnectionPanel
1516
import java.awt.CardLayout

src/main/kotlin/org/digma/intellij/plugin/ui/wizard/InstallationWizardSidePanelWindowPanel.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ import org.digma.intellij.plugin.ui.jcef.serializeAndExecuteWindowPostMessageJav
6767
import org.digma.intellij.plugin.ui.jcef.updateDigmaEngineStatus
6868
import org.digma.intellij.plugin.ui.notificationcenter.AppNotificationCenter
6969
import org.digma.intellij.plugin.ui.panels.DisposablePanel
70-
import org.digma.intellij.plugin.ui.recentactivity.RecentActivityToolWindowShower
70+
import org.digma.intellij.plugin.recentactivity.RecentActivityToolWindowShower
7171
import org.digma.intellij.plugin.ui.settings.ApplicationUISettingsChangeNotifier
7272
import org.digma.intellij.plugin.ui.settings.SettingsChangeListener
7373
import org.digma.intellij.plugin.ui.settings.Theme
@@ -144,8 +144,6 @@ fun createInstallationWizardSidePanelWindowPanel(project: Project, wizardSkipIns
144144
)
145145

146146

147-
PersistenceService.getInstance().firstWizardLaunchDone()
148-
149147

150148
val lifeSpanHandler: CefLifeSpanHandlerAdapter = object : CefLifeSpanHandlerAdapter() {
151149
override fun onAfterCreated(browser: CefBrowser) {
@@ -224,6 +222,8 @@ fun createInstallationWizardSidePanelWindowPanel(project: Project, wizardSkipIns
224222
DigmathonService.getInstance().setProductKey(it)
225223
}
226224

225+
PersistenceService.getInstance().firstWizardLaunchDone()
226+
227227
EDT.ensureEDT {
228228
updateInstallationWizardFlag()
229229
ToolWindowShower.getInstance(project).showToolWindow()

0 commit comments

Comments
 (0)