Skip to content

Commit 22f96e5

Browse files
committed
Ona updates
1 parent 1a88c22 commit 22f96e5

File tree

11 files changed

+695
-798
lines changed

11 files changed

+695
-798
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Gitpod Browser extension
22

3-
[![Setup Automated](https://img.shields.io/badge/setup-automated-blue?logo=gitpod)](https://gitpod.io/#https://github.com/gitpod-io/browser-extension)
3+
[![Setup Automated](https://img.shields.io/badge/setup-automated-blue?logo=gitpod)](https://app.ona.com/#https://github.com/gitpod-io/browser-extension)
44

55
This is the browser extension for Gitpod. It supports Chrome (see [Chrome Web Store](https://chrome.google.com/webstore/detail/dodmmooeoklaejobgleioelladacbeki/)), Firefox (see [Firefox Add-ons](https://addons.mozilla.org/firefox/addon/gitpod/)) and Edge (see [how to install Chrome extensions](https://support.microsoft.com/help/4538971/microsoft-edge-add-or-remove-extensions)), and adds a **Gitpod** button to the configured GitLab, GitHub and Bitbucket installations (defaults to `gitlab.com`, `github.com` and `bitbucket.org`) which immediately creates a Gitpod workspace for the current git context:
66

assets/icon.png

-9.24 KB
Loading

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "gitpod",
3-
"displayName": "Gitpod",
2+
"name": "ona",
3+
"displayName": "Ona",
44
"version": "2.4.3",
55
"description": "The developer platform for on-demand cloud development environments. Create software faster and more securely.",
6-
"author": "Gitpod <info@gitpod.io>",
7-
"homepage": "https://www.gitpod.io",
6+
"author": "Ona <info@ona.com>",
7+
"homepage": "https://ona.com",
88
"scripts": {
99
"dev": "plasmo dev --source-maps --no-minify",
1010
"watch-dev": "pnpm build-dev-tools && .bin/watch-sync serve ./build/chrome-mv3-dev",
@@ -23,7 +23,7 @@
2323
"configcat-js": "^9.6.0",
2424
"configcat-react": "^4.9.0",
2525
"lucide-react": "^0.474.0",
26-
"plasmo": "^0.89.2",
26+
"plasmo": "^0.90.5",
2727
"react": "^18.3.1",
2828
"react-dom": "^18.3.1",
2929
"react-hotkeys-hook": "^4.6.1",

pnpm-lock.yaml

Lines changed: 668 additions & 777 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/background.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import addDomainPermissionToggle from "webext-permission-toggle";
1010

1111
browser.runtime.onInstalled.addListener((details) => {
1212
if (details.reason === "install") {
13-
browser.tabs.create({ url: "https://www.gitpod.io/extension-activation?track=true" });
13+
browser.tabs.create({ url: "https://ona.com" });
1414
}
1515
});
16-
browser.runtime.setUninstallURL("https://www.gitpod.io/extension-uninstall?track=true");
16+
// browser.runtime.setUninstallURL("https://ona.com");
1717

1818
export {};

src/button/button.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import classNames from "classnames";
33
import { useEffect, useMemo, useRef, useState } from "react";
44
import { useHotkeys } from "react-hotkeys-hook";
55
import Logo from "react:./logo-mark.svg";
6-
import { EVENT_CURRENT_URL_CHANGED } from "~constants";
6+
import { DEFAULT_ONA_ENDPOINT, EVENT_CURRENT_URL_CHANGED } from "~constants";
77
import { FeatureFlags, useFlag } from "~hooks/use-configcat";
88
import { OnaLettermark } from "~icons/OnaLettermark";
99
import { STORAGE_KEY_ADDRESS, STORAGE_KEY_ALWAYS_OPTIONS, STORAGE_KEY_NEW_TAB } from "~storage";
@@ -17,7 +17,7 @@ type Props = {
1717
urlTransformer?: (url: string) => string;
1818
};
1919
export const GitpodButton = ({ application, additionalClassNames, urlTransformer }: Props) => {
20-
const [address] = useStorage<string>(STORAGE_KEY_ADDRESS);
20+
const [address] = useStorage<string>(STORAGE_KEY_ADDRESS, DEFAULT_ONA_ENDPOINT);
2121
const [openInNewTab] = useStorage<boolean>(STORAGE_KEY_NEW_TAB, true);
2222
const [disableAutostart] = useStorage<boolean>(STORAGE_KEY_ALWAYS_OPTIONS, false);
2323
const [showDropdown, setShowDropdown] = useState(false);
@@ -38,11 +38,15 @@ export const GitpodButton = ({ application, additionalClassNames, urlTransformer
3838
};
3939
}, []);
4040

41+
const isOna = useMemo(() => address && isOnaEndpoint(address), [address]);
4142
const actions = useMemo(() => {
4243
const parsedHref = !urlTransformer ? currentHref : urlTransformer(currentHref);
44+
45+
const autoStartParam = isOna ? "" : "?autostart=true";
46+
4347
return [
4448
{
45-
href: `${address}/?autostart=${!disableAutostart}#${parsedHref}`,
49+
href: `${address}/${autoStartParam}#${parsedHref}`,
4650
label: "Open",
4751
},
4852
{
@@ -55,7 +59,6 @@ export const GitpodButton = ({ application, additionalClassNames, urlTransformer
5559
const firstActionRef = useRef<HTMLAnchorElement | null>(null);
5660

5761
const target = openInNewTab ? "_blank" : "_self";
58-
const isOna = useMemo(() => address && isOnaEndpoint(address), [address]);
5962
const effectiveDisableAutostart = isOna ? true : disableAutostart;
6063

6164
const toggleDropdown = () => {

src/button/logo-mark.svg

Lines changed: 5 additions & 1 deletion
Loading

src/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export const DEFAULT_GITPOD_ENDPOINT = "https://gitpod.io";
21
export const DEFAULT_ONA_ENDPOINT = "https://app.ona.com";
32
export const ALL_ORIGINS_WILDCARD = "*://*/*";
43
export const EVENT_CURRENT_URL_CHANGED = "current-url-changed";

src/contents/gitpod-dashboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const isSiteGitpod = (): boolean => {
1111
};
1212

1313
export const config: PlasmoCSConfig = {
14-
matches: ["https://gitpod.io/*", "https://app.gitpod.io/*", "https://*.gitpod.cloud/*"],
14+
matches: ["https://gitpod.io/*", "https://app.ona.com/*", "https://*.gitpod.cloud/*"],
1515
};
1616

1717
const storage = new Storage();

src/popup.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { Storage } from "@plasmohq/storage";
22
import { useStorage } from "@plasmohq/storage/hook";
33
import { CheckIcon } from "lucide-react";
4-
import React, { useCallback, useEffect, useState, type FormEvent, type PropsWithChildren } from "react";
4+
import { useCallback, useEffect, useState, type FormEvent, type PropsWithChildren } from "react";
55
import browser from "webextension-polyfill";
66
import { Button } from "~components/forms/Button";
77
import { CheckboxInputField } from "~components/forms/CheckboxInputField";
88
import { InputField } from "~components/forms/InputField";
99
import { TextInput } from "~components/forms/TextInputField";
10-
import { ALL_ORIGINS_WILDCARD, DEFAULT_GITPOD_ENDPOINT, DEFAULT_ONA_ENDPOINT } from "~constants";
10+
import { ALL_ORIGINS_WILDCARD, DEFAULT_ONA_ENDPOINT } from "~constants";
1111
import { ConfigCatProvider, configCatProviderConfig, FeatureFlags, useFlag } from "~hooks/use-configcat";
1212
import { useTemporaryState } from "~hooks/use-temporary-state";
1313
import {
@@ -34,7 +34,7 @@ const Animate = ({ children, on }: PropsWithChildren<{ on?: string }>) => {
3434
function PopupContent() {
3535
const [error, setError] = useState<string>();
3636

37-
const [storedAddress] = useStorage<string>(STORAGE_KEY_ADDRESS, DEFAULT_GITPOD_ENDPOINT);
37+
const [storedAddress] = useStorage<string>(STORAGE_KEY_ADDRESS, DEFAULT_ONA_ENDPOINT);
3838
const [address, setAddress] = useState<string>(storedAddress);
3939
const [justSaved, setJustSaved] = useTemporaryState(false, 2000);
4040

@@ -102,7 +102,7 @@ function PopupContent() {
102102
<form className="w-full" onSubmit={updateAddress} action="#">
103103
<InputField
104104
label={`${isOnaEnabled ? "Ona" : "Gitpod"} URL`}
105-
hint={`${isOnaEnabled ? "Ona" : "Gitpod"} instance URL, e.g., ${isOnaEnabled ? DEFAULT_ONA_ENDPOINT : DEFAULT_GITPOD_ENDPOINT}.`}
105+
hint={`${isOnaEnabled ? "Ona" : "Gitpod"} instance URL, e.g. ${DEFAULT_ONA_ENDPOINT}.`}
106106
topMargin={false}
107107
>
108108
<div className="flex w-full h-10 max-w-sm items-center space-x-2">
@@ -144,8 +144,9 @@ function PopupContent() {
144144
<CheckboxInputField
145145
label="Always start with options"
146146
hint="Changes the primary button to always open with options"
147-
checked={disableAutostart}
147+
checked={isOnaEnabled ? true : disableAutostart}
148148
onChange={setDisableAutostart}
149+
disabled={isOnaEnabled}
149150
/>
150151
<CheckboxInputField
151152
label="Automatic instance hopping"

0 commit comments

Comments
 (0)