3
3
* License: MS-RSL – see LICENSE.md for details
4
4
*/
5
5
6
- import { Alert as AntdAlert } from "antd" ;
6
+ import { Alert } from "antd" ;
7
7
import {
8
8
redux ,
9
9
rclass ,
@@ -23,8 +23,6 @@ import { SCHEMA } from "@cocalc/util/schema";
23
23
import React from "react" ;
24
24
import { Body } from "./body" ;
25
25
26
- const { Alert } = require ( "react-bootstrap" ) ;
27
-
28
26
interface ReactProps {
29
27
project_id : string ;
30
28
group ?: string ;
@@ -108,7 +106,7 @@ const ProjectSettings0 = rclass<ReactProps>(
108
106
}
109
107
this . _table = webapp_client . sync_client . sync_table (
110
108
{ projects_admin : query } ,
111
- [ ]
109
+ [ ] ,
112
110
) ;
113
111
this . _table . on ( "change" , ( ) => {
114
112
this . setState ( {
@@ -119,23 +117,30 @@ const ProjectSettings0 = rclass<ReactProps>(
119
117
120
118
render_admin_message ( ) {
121
119
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
+ />
139
144
) ;
140
145
}
141
146
@@ -167,11 +172,12 @@ const ProjectSettings0 = rclass<ReactProps>(
167
172
}
168
173
}
169
174
170
- if ( project == undefined ) {
175
+ if ( project == null ) {
171
176
return < Loading /> ;
172
177
} else {
173
178
return (
174
179
< div style = { { padding : "15px" } } >
180
+ { this . render_admin_message ( ) }
175
181
{ this . state . admin_project != undefined
176
182
? this . render_admin_message ( )
177
183
: undefined }
@@ -187,12 +193,12 @@ const ProjectSettings0 = rclass<ReactProps>(
187
193
) ;
188
194
}
189
195
}
190
- }
196
+ } ,
191
197
) ;
192
198
193
199
export function SandboxProjectSettingsWarning ( ) {
194
200
return (
195
- < AntdAlert
201
+ < Alert
196
202
showIcon
197
203
style = { { margin : "auto" , fontSize : "14pt" } }
198
204
type = "warning"
0 commit comments