-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add login button to plugin welcome page [IDE-798] #248
Draft
andrewrobinsonhodges-snyk
wants to merge
7
commits into
main
Choose a base branch
from
feat/add-login-button
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
553c8d0
feat: add login button to plugin welcome page
andrewrobinsonhodges-snyk 54e1f11
style: styled auth button, tidied up html for welcome panel and fixed…
andrewrobinsonhodges-snyk 7b86cf4
style: fixed newline position in warning text.
andrewrobinsonhodges-snyk d8b88a4
style: fixed newline position in warning text.
andrewrobinsonhodges-snyk 5e57709
test: add test for new html variable
andrewrobinsonhodges-snyk 1940658
Merge branch 'main' into feat/add-login-button
andrewrobinsonhodges-snyk 7359fda
refactor: rename panel warning text string
andrewrobinsonhodges-snyk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
import java.util.concurrent.CompletableFuture; | ||
|
||
import org.eclipse.jface.viewers.TreeNode; | ||
import org.eclipse.jface.wizard.WizardDialog; | ||
import org.eclipse.lsp4e.LSPEclipseUtils; | ||
import org.eclipse.lsp4j.Location; | ||
import org.eclipse.lsp4j.Position; | ||
|
@@ -18,13 +19,13 @@ | |
import org.eclipse.swt.browser.ProgressEvent; | ||
import org.eclipse.swt.program.Program; | ||
import org.eclipse.swt.widgets.Display; | ||
|
||
import com.google.gson.Gson; | ||
|
||
import io.snyk.eclipse.plugin.html.BaseHtmlProvider; | ||
import io.snyk.eclipse.plugin.html.HtmlProviderFactory; | ||
import io.snyk.eclipse.plugin.html.StaticPageHtmlProvider; | ||
import io.snyk.eclipse.plugin.utils.SnykLogger; | ||
import io.snyk.eclipse.plugin.wizards.SnykWizard; | ||
|
||
@SuppressWarnings("restriction") | ||
public class BrowserHandler { | ||
|
@@ -66,6 +67,18 @@ public Object function(Object[] arguments) { | |
} | ||
}; | ||
|
||
new BrowserFunction(browser, "initiateLogin") { | ||
@Override | ||
public Object function(Object[] arguments) { | ||
SnykWizard wizard = new SnykWizard(); | ||
WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(),wizard); | ||
|
||
dialog.setBlockOnOpen(true); | ||
dialog.open(); | ||
return null; | ||
Comment on lines
+73
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: don't duplicate the code, but move |
||
} | ||
}; | ||
|
||
browser.addLocationListener(new LocationListener() { | ||
@Override | ||
public void changing(LocationEvent event) { | ||
|
@@ -89,6 +102,7 @@ public void completed(ProgressEvent event) { | |
} | ||
} | ||
}); | ||
|
||
initBrowserText(); | ||
} | ||
|
||
|
@@ -127,7 +141,6 @@ public CompletableFuture<Void> updateBrowserContent(TreeNode node) { | |
browser.setText(browserContent); | ||
}); | ||
}); | ||
|
||
} | ||
|
||
private BaseHtmlProvider getHtmlProvider(TreeNode node) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The jetbrains link does not look right :)