Skip to content

Commit b0d4b5a

Browse files
committed
Replace AlertBox with Alert component
This replaces the old AlertBox with the new Alert (type `warning`) in the dashboard.
1 parent e148325 commit b0d4b5a

File tree

7 files changed

+20
-34
lines changed

7 files changed

+20
-34
lines changed

components/dashboard/src/components/AlertBox.tsx

Lines changed: 0 additions & 16 deletions
This file was deleted.

components/dashboard/src/components/ConfirmationModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* See License-AGPL.txt in the project root for license information.
55
*/
66

7-
import AlertBox from "./AlertBox";
7+
import Alert from "./Alert";
88
import Modal from "./Modal";
99
import { useRef, useEffect } from "react";
1010

@@ -22,7 +22,7 @@ export default function ConfirmationModal(props: {
2222
const child: React.ReactChild[] = [<p className="mt-3 mb-3 text-base text-gray-500">{props.areYouSureText}</p>];
2323

2424
if (props.warningText) {
25-
child.unshift(<AlertBox>{props.warningText}</AlertBox>);
25+
child.unshift(<Alert type="warning">{props.warningText}</Alert>);
2626
}
2727

2828
const isEntity = (x: any): x is Entity => typeof x === "object" && "name" in x;

components/dashboard/src/projects/ProjectVariables.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import { Project, ProjectEnvVar } from "@gitpod/gitpod-protocol";
88
import { useContext, useEffect, useState } from "react";
9-
import AlertBox from "../components/AlertBox";
9+
import Alert from "../components/Alert";
1010
import CheckBox from "../components/CheckBox";
1111
import InfoBox from "../components/InfoBox";
1212
import { Item, ItemField, ItemFieldContextMenu, ItemsList } from "../components/ItemsList";
@@ -131,17 +131,17 @@ function AddVariableModal(props: { project?: Project; onClose: () => void }) {
131131
>
132132
<h3 className="mb-4">New Variable</h3>
133133
<div className="border-t border-b border-gray-200 dark:border-gray-800 -mx-6 px-6 py-4 flex flex-col">
134-
<AlertBox>
134+
<Alert type="warning">
135135
<strong>Project environment variables can be exposed.</strong>
136136
<br />
137137
Even if <strong>Hide Variable in Workspaces</strong> is enabled, anyone with read access to your
138138
repository can access secret values if they are printed in the terminal, logged, or persisted to the
139139
file system.
140-
</AlertBox>
140+
</Alert>
141141
{error && (
142-
<AlertBox className="mt-4">
142+
<Alert type="error" className="mt-4">
143143
{String(error).replace(/Error: Request \w+ failed with message: /, "")}
144-
</AlertBox>
144+
</Alert>
145145
)}
146146
<div className="mt-8">
147147
<h4>Name</h4>

components/dashboard/src/settings/Integrations.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { AuthProviderEntry, AuthProviderInfo } from "@gitpod/gitpod-protocol";
88
import { SelectAccountPayload } from "@gitpod/gitpod-protocol/lib/auth";
99
import React, { useContext, useEffect, useState } from "react";
10-
import AlertBox from "../components/AlertBox";
10+
import Alert from "../components/Alert";
1111
import CheckBox from "../components/CheckBox";
1212
import ConfirmationModal from "../components/ConfirmationModal";
1313
import { ContextMenuEntry } from "../components/ContextMenu";
@@ -748,7 +748,7 @@ export function GitIntegrationModal(
748748
<h3 className="pb-2">{mode === "new" ? "New Git Integration" : "Git Integration"}</h3>
749749
<div className="space-y-4 border-t border-b border-gray-200 dark:border-gray-800 mt-2 -mx-6 px-6 py-4">
750750
{mode === "edit" && providerEntry?.status !== "verified" && (
751-
<AlertBox>You need to activate this integration.</AlertBox>
751+
<Alert type="warning">You need to activate this integration.</Alert>
752752
)}
753753
<div className="flex flex-col">
754754
<span className="text-gray-500">

components/dashboard/src/settings/Plans.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
import { PlanCoupon, GithubUpgradeURL } from "@gitpod/gitpod-protocol/lib/payment-protocol";
1717
import { Plans, Plan, PlanType } from "@gitpod/gitpod-protocol/lib/plans";
1818
import { ChargebeeClient } from "../chargebee/chargebee-client";
19-
import AlertBox from "../components/AlertBox";
19+
import Alert from "../components/Alert";
2020
import InfoBox from "../components/InfoBox";
2121
import Modal from "../components/Modal";
2222
import SelectableCard from "../components/SelectableCard";
@@ -741,12 +741,12 @@ export default function () {
741741
). The new total will be effective from the next billing cycle.
742742
</InfoBox>
743743
)}
744-
<AlertBox className="mb-4">
744+
<Alert type="warning" className="mb-4">
745745
Total:{" "}
746746
{(confirmUpgradeToPlan.currency === "EUR" ? "€" : "$") +
747747
confirmUpgradeToPlan.pricePerMonth}{" "}
748748
per month
749-
</AlertBox>
749+
</Alert>
750750
</div>
751751
<div className="flex justify-end mt-6">
752752
<button onClick={doUpgrade}>Upgrade Plan</button>

components/dashboard/src/settings/Teams.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import React, { useContext, useEffect, useRef, useState } from "react";
88
import ContextMenu, { ContextMenuEntry } from "../components/ContextMenu";
99
import { PageWithSubMenu } from "../components/PageWithSubMenu";
1010
import { getGitpodService } from "../service/service";
11-
import AlertBox from "../components/AlertBox";
11+
import Alert from "../components/Alert";
1212
import Modal from "../components/Modal";
1313
import {
1414
AssigneeIdentifier,
@@ -730,7 +730,7 @@ function AddMembersModal(props: {
730730
</select>
731731
</div>
732732

733-
<AlertBox>Additional Charge: {expectedPrice} per month</AlertBox>
733+
<Alert type="warning">Additional Charge: {expectedPrice} per month</Alert>
734734
</div>
735735
<div className="flex justify-end mt-6">
736736
<button className={"ml-2"} onClick={() => props.onBuy(getPlan(), quantity, props.sub)}>
@@ -831,7 +831,9 @@ function NewTeamModal(props: {
831831
</select>
832832
</div>
833833

834-
<AlertBox className="mt-2">Total: {expectedPrice} per month</AlertBox>
834+
<Alert type="warning" className="mt-2">
835+
Total: {expectedPrice} per month
836+
</Alert>
835837
</div>
836838
<div className="flex justify-end mt-6">
837839
<button className={"ml-2"} onClick={() => props.onBuy(plan, quantity)}>

components/dashboard/src/workspaces/ConnectToSSHModal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useState } from "react";
88
import Modal from "../components/Modal";
99
import Tooltip from "../components/Tooltip";
1010
import copy from "../images/copy.svg";
11-
import AlertBox from "../components/AlertBox";
11+
import Alert from "../components/Alert";
1212
import InfoBox from "../components/InfoBox";
1313

1414
function InputWithCopy(props: { value: string; tip?: string; className?: string }) {
@@ -62,12 +62,12 @@ function SSHView(props: SSHProps) {
6262
return (
6363
<div className="border-t border-b border-gray-200 dark:border-gray-800 mt-2 -mx-6 px-6 py-6">
6464
<div className="mt-1 mb-4">
65-
<AlertBox>
65+
<Alert type="warning">
6666
<p className="text-red-500 whitespace-normal text-base">
6767
<b>Anyone</b> on the internet with this command can access the running workspace. The command
6868
includes a generated access token that resets on every workspace restart.
6969
</p>
70-
</AlertBox>
70+
</Alert>
7171
<InfoBox className="mt-4">
7272
<p className="text-gray-500 whitespace-normal text-base">
7373
Before connecting via SSH, make sure you have an existing SSH private key on your machine. You

0 commit comments

Comments
 (0)