Skip to content

Commit 8028102

Browse files
committed
eliminate another use of react-bootstrap
1 parent fe701af commit 8028102

File tree

1 file changed

+30
-24
lines changed

1 file changed

+30
-24
lines changed

src/packages/frontend/project/settings/settings.tsx

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* License: MS-RSL – see LICENSE.md for details
44
*/
55

6-
import { Alert as AntdAlert } from "antd";
6+
import { Alert } from "antd";
77
import {
88
redux,
99
rclass,
@@ -23,8 +23,6 @@ import { SCHEMA } from "@cocalc/util/schema";
2323
import React from "react";
2424
import { Body } from "./body";
2525

26-
const { Alert } = require("react-bootstrap");
27-
2826
interface ReactProps {
2927
project_id: string;
3028
group?: string;
@@ -108,7 +106,7 @@ const ProjectSettings0 = rclass<ReactProps>(
108106
}
109107
this._table = webapp_client.sync_client.sync_table(
110108
{ projects_admin: query },
111-
[]
109+
[],
112110
);
113111
this._table.on("change", () => {
114112
this.setState({
@@ -119,23 +117,30 @@ const ProjectSettings0 = rclass<ReactProps>(
119117

120118
render_admin_message() {
121119
return (
122-
<Alert bsStyle="warning" style={{ margin: "10px" }}>
123-
<h4>
124-
<strong>Warning:</strong> you are editing the project settings as an{" "}
125-
<strong>administrator</strong>.
126-
</h4>
127-
<ul>
128-
<li>
129-
{" "}
130-
You are not a collaborator on this project, but can edit files,
131-
etc.{" "}
132-
</li>
133-
<li>
134-
{" "}
135-
You are an admin: actions will not be logged to the project log.
136-
</li>
137-
</ul>
138-
</Alert>
120+
<Alert
121+
type="warning"
122+
style={{ margin: "10px" }}
123+
message={
124+
<>
125+
<strong>Warning:</strong> you are editing the project settings as
126+
an <strong>administrator</strong>. This is deprecated and should
127+
hardly work.
128+
</>
129+
}
130+
description={
131+
<ul>
132+
<li>
133+
You are not a collaborator on this project, but some things
134+
might still work since you are a site admin.
135+
</li>
136+
<li>
137+
You should probably impersonate a collaborator on this project
138+
instead.
139+
</li>
140+
<li>Actions will not be logged to the project log.</li>
141+
</ul>
142+
}
143+
/>
139144
);
140145
}
141146

@@ -167,11 +172,12 @@ const ProjectSettings0 = rclass<ReactProps>(
167172
}
168173
}
169174

170-
if (project == undefined) {
175+
if (project == null) {
171176
return <Loading />;
172177
} else {
173178
return (
174179
<div style={{ padding: "15px" }}>
180+
{this.render_admin_message()}
175181
{this.state.admin_project != undefined
176182
? this.render_admin_message()
177183
: undefined}
@@ -187,12 +193,12 @@ const ProjectSettings0 = rclass<ReactProps>(
187193
);
188194
}
189195
}
190-
}
196+
},
191197
);
192198

193199
export function SandboxProjectSettingsWarning() {
194200
return (
195-
<AntdAlert
201+
<Alert
196202
showIcon
197203
style={{ margin: "auto", fontSize: "14pt" }}
198204
type="warning"

0 commit comments

Comments
 (0)