Skip to content

Commit 93335ab

Browse files
KevSlashNullroboquat
authored andcommitted
Replace AlertBox with Alert component
This replaces the old AlertBox with the new Alert (type `warning`) in the dashboard.
1 parent 889fb90 commit 93335ab

File tree

6 files changed

+17
-31
lines changed

6 files changed

+17
-31
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

@@ -26,7 +26,7 @@ export default function ConfirmationModal(props: {
2626
];
2727

2828
if (props.warningText) {
29-
children.unshift(<AlertBox>{props.warningText}</AlertBox>);
29+
children.unshift(<Alert type="warning">{props.warningText}</Alert>);
3030
}
3131

3232
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";
@@ -132,17 +132,17 @@ function AddVariableModal(props: { project?: Project; onClose: () => void }) {
132132
>
133133
<h3 className="mb-4">New Variable</h3>
134134
<div className="border-t border-b border-gray-200 dark:border-gray-800 -mx-6 px-6 py-4 flex flex-col">
135-
<AlertBox>
135+
<Alert type="warning">
136136
<strong>Project environment variables can be exposed.</strong>
137137
<br />
138138
Even if <strong>Hide Variable in Workspaces</strong> is enabled, anyone with read access to your
139139
repository can access secret values if they are printed in the terminal, logged, or persisted to the
140140
file system.
141-
</AlertBox>
141+
</Alert>
142142
{error && (
143-
<AlertBox className="mt-4">
143+
<Alert type="error" className="mt-4">
144144
{String(error).replace(/Error: Request \w+ failed with message: /, "")}
145-
</AlertBox>
145+
</Alert>
146146
)}
147147
<div className="mt-8">
148148
<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";
@@ -751,7 +751,7 @@ export function GitIntegrationModal(
751751
<h3 className="pb-2">{mode === "new" ? "New Git Integration" : "Git Integration"}</h3>
752752
<div className="space-y-4 border-t border-b border-gray-200 dark:border-gray-800 mt-2 -mx-6 px-6 py-4">
753753
{mode === "edit" && providerEntry?.status !== "verified" && (
754-
<AlertBox>You need to activate this integration.</AlertBox>
754+
<Alert type="warning">You need to activate this integration.</Alert>
755755
)}
756756
<div className="flex flex-col">
757757
<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";
@@ -737,12 +737,12 @@ export default function () {
737737
). The new total will be effective from the next billing cycle.
738738
</InfoBox>
739739
)}
740-
<AlertBox className="mb-4">
740+
<Alert type="warning" className="mb-4">
741741
Total:{" "}
742742
{(confirmUpgradeToPlan.currency === "EUR" ? "€" : "$") +
743743
confirmUpgradeToPlan.pricePerMonth}{" "}
744744
per month
745-
</AlertBox>
745+
</Alert>
746746
</div>
747747
<div className="flex justify-end mt-6">
748748
<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
@@ -7,7 +7,7 @@
77
import React, { useContext, useEffect, useRef, useState } from "react";
88
import ContextMenu, { ContextMenuEntry } from "../components/ContextMenu";
99
import { getGitpodService } from "../service/service";
10-
import AlertBox from "../components/AlertBox";
10+
import Alert from "../components/Alert";
1111
import Modal from "../components/Modal";
1212
import {
1313
AssigneeIdentifier,
@@ -727,7 +727,7 @@ function AddMembersModal(props: {
727727
</select>
728728
</div>
729729

730-
<AlertBox>Additional Charge: {expectedPrice} per month</AlertBox>
730+
<Alert type="warning">Additional Charge: {expectedPrice} per month</Alert>
731731
</div>
732732
<div className="flex justify-end mt-6">
733733
<button className={"ml-2"} onClick={() => props.onBuy(getPlan(), quantity, props.sub)}>
@@ -829,7 +829,9 @@ function NewTeamModal(props: {
829829
</select>
830830
</div>
831831

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

0 commit comments

Comments
 (0)