Skip to content

Commit

Permalink
Allow dismissing login notifications and update button label (#1819)
Browse files Browse the repository at this point in the history
* Update Login Notification

* Rename "Commands" webview to "Cloud"

* No more platform

---------

Co-authored-by: Sebastian Tiedtke <sebastiantiedtke@gmail.com>
  • Loading branch information
pastuxso and sourishkrout authored Nov 21, 2024
1 parent 11b8184 commit 9f2ece2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README-platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Stateful provides a powerful set of tools for creating, running, discovering, st
Stateful combines the power of interactive DevOps Notebooks with a robust set of features designed to streamline your development and operational processes. There are two major pieces:

- **Stateful Extension**: A super set of the open-source Runme project, offering enhanced features for authentication, collaboration, and security, making it ideal for teams and enterprises.
- **Stateful Platform**: A SaaS solution that integrates with GitHub and Slack, serving as a collaboration hub for finding, launching, running, sharing, and troubleshooting Notebooks and their metadata.
- **Stateful Cloud**: A SaaS solution that integrates with GitHub and Slack, serving as a collaboration hub for finding, launching, running, sharing, and troubleshooting Notebooks and their metadata.

<br />

Expand All @@ -23,7 +23,7 @@ Stateful combines the power of interactive DevOps Notebooks with a robust set of

### Platform

The Stateful platform offers a suite of tools and services designed to enhance your development lifecycle.
The Stateful cloud offers a suite of tools and services designed to enhance your development lifecycle.

- **Believe in Your Docs Again**: Transform your documentation into actionable, GitOps-compatible, cloud-native DevOps Notebooks that are collaborative and searchable.
- **Markdown and VS Code Integration**: Repurpose your existing engineering docs (READMEs, runbooks, etc.) by making commands runnable and configurable, stored next to code in Git.
Expand All @@ -35,7 +35,7 @@ The Stateful platform offers a suite of tools and services designed to enhance y

### Features

- **Runnable Engineering Docs**: Launch Markdown files from GitHub as runnable DevOps Notebooks, saving sessions to the Stateful platform.
- **Runnable Engineering Docs**: Launch Markdown files from GitHub as runnable DevOps Notebooks, saving sessions to the Stateful cloud.
- **Easy Discovery**: Quickly locate and launch DevOps Notebooks from your GitHub organization with one click to open in VS Code, clone the repo, and start running.
- **History and Metadata**: Automatically save commands, metadata, outputs, and history to Stateful. Search your history, see diffs, share, and troubleshoot processes.
- **Slack Integration**: Easily escalate or share DevOps Notebooks and commands on Slack for team troubleshooting and discussion.
Expand All @@ -47,7 +47,7 @@ The Stateful platform offers a suite of tools and services designed to enhance y

1. **Sign Up**: Create your free account at [Stateful](https://platform.stateful.com/).
2. **Install VS Code Extension**: Download the Stateful extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=stateful.platform). The extension is fully compatible with Runme, but adds authentication, collaboration, and security features, making it secure for teams and inside companies.
3. **Explore**: Start creating, running, sharing, and discussing your first DevOps Notebook and its commands using the Stateful platform.
3. **Explore**: Start creating, running, sharing, and discussing your first DevOps Notebook and its commands using the Stateful cloud.

For detailed documentation and tutorials, visit our [Documentation](https://stateful.com/docs).

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@
{
"id": "runme.cloud",
"type": "webview",
"name": "Commands",
"name": "Cloud",
"visibility": "visible"
},
{
Expand Down
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,7 @@ export enum TELEMETRY_EVENTS {
NotebookGist = 'runme.notebookGist',
CellGist = 'runme.cellGist',
ShellWarning = 'extension.shellWarning',
OpenWorkspace = 'cloud.OpenWorkspace',
}

export enum WebViews {
Expand Down
16 changes: 12 additions & 4 deletions src/extension/provider/statefulAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import fetch from 'node-fetch'
import jwt, { JwtPayload } from 'jsonwebtoken'

import { getAuthTokenPath, getDeleteAuthToken, getRunmeAppUrl } from '../../utils/configuration'
import { AuthenticationProviders, PLATFORM_USER_SIGNED_IN } from '../../constants'
import { AuthenticationProviders, PLATFORM_USER_SIGNED_IN, TELEMETRY_EVENTS } from '../../constants'
import { RunmeUriHandler } from '../handler/uri'
import ContextState from '../contextState'
import getLogger from '../logger'
Expand Down Expand Up @@ -574,14 +574,22 @@ export class StatefulAuthProvider implements AuthenticationProvider, Disposable
}

showLoginNotification() {
const openDashboardStr = 'Open Dashboard'
if (!this.context.globalState.get<boolean>(TELEMETRY_EVENTS.OpenWorkspace, true)) {
return
}

const openWorkspace = 'Open Workspace'
const dontAskAgain = "Don't ask again"

window
.showInformationMessage('Logged into the Stateful Platform', openDashboardStr)
.showInformationMessage('Logged into the Stateful Cloud', openWorkspace, dontAskAgain)
.then((answer) => {
if (answer === openDashboardStr) {
if (answer === openWorkspace) {
const dashboardUri = getRunmeAppUrl(['app'])
const uri = Uri.parse(dashboardUri)
env.openExternal(uri)
} else if (answer === dontAskAgain) {
this.context.globalState.update(TELEMETRY_EVENTS.OpenWorkspace, false)
}
})
}
Expand Down

0 comments on commit 9f2ece2

Please sign in to comment.