-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable chat for preview users (#1403)
- Loading branch information
1 parent
a4715f4
commit d858755
Showing
7 changed files
with
72 additions
and
2 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { template } from "./template.html"; | ||
|
||
export const PREVIEW_ENDED_MESSAGE = ` | ||
<div style="font-size: 14px;"> | ||
<h3>Tabnine Chat - Preview Period Ended</h3> | ||
<p> | ||
The preview period for Tabnine Chat in Visual Studio Code has now ended. We hope you found it valuable for your coding projects and enjoyed the experience. | ||
</p> | ||
<p> | ||
To continue using Tabnine Chat and access its full range of features, we invite you to subscribe to one of our plans. | ||
</p> | ||
<p> | ||
You can find detailed information about our pricing and the additional benefits of a subscription on our <a href="https://www.tabnine.com/pricing">pricing page</a>. | ||
</p> | ||
<p> | ||
If you have any questions or need assistance, our support team is always ready to help. | ||
</p> | ||
</div>`; | ||
|
||
export const html = (logoSrc: string) => | ||
template(PREVIEW_ENDED_MESSAGE, logoSrc); |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Disposable, ExtensionContext, WebviewView, window } from "vscode"; | ||
import { fireEvent } from "../../binary/requests/requests"; | ||
import { html } from "./previewEnded.html"; | ||
import { getIcon } from "./getIcon"; | ||
|
||
export function previewEndedView(context: ExtensionContext): Disposable { | ||
return window.registerWebviewViewProvider("tabnine.chat.preview_ended", { | ||
resolveWebviewView(webviewView: WebviewView) { | ||
context.subscriptions.push( | ||
webviewView.onDidChangeVisibility(() => { | ||
if (webviewView.visible) { | ||
void fireEvent({ | ||
name: "tabnine-chat-preview-ended-visible", | ||
}); | ||
} | ||
}) | ||
); | ||
const view = webviewView.webview; | ||
view.options = { | ||
enableScripts: true, | ||
enableCommandUris: true, | ||
}; | ||
const logoSrc = getIcon(context, view); | ||
view.html = html(logoSrc); | ||
|
||
void fireEvent({ | ||
name: "tabnine-chat-preview-ended-inited", | ||
}); | ||
}, | ||
}); | ||
} |