Skip to content

Commit 5712629

Browse files
Merge pull request #8646 from sagemathinc/fix-project-new-20251110
frontend/projects page: always show create project dialog
2 parents 8654825 + 818aeed commit 5712629

File tree

1 file changed

+24
-52
lines changed

1 file changed

+24
-52
lines changed

src/packages/frontend/projects/create-project.tsx

Lines changed: 24 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77
Create a new project
88
*/
99

10-
import { Button, Card, Col, Form, Input, Modal, Row, Space } from "antd";
10+
import { Button, Card, Col, Form, Input, Modal, Row } from "antd";
1111
import { delay } from "awaiting";
1212
import { FormattedMessage, useIntl } from "react-intl";
1313

14-
import { Well } from "@cocalc/frontend/antd-bootstrap";
1514
import {
1615
CSS,
1716
redux,
@@ -226,7 +225,7 @@ export function NewProjectCreator({
226225
<Button
227226
cocalc-test={"create-project"}
228227
size="large"
229-
disabled={noProjects || state !== "view"}
228+
disabled={state !== "view"}
230229
onClick={toggle_editing}
231230
style={{ width: "100%" }}
232231
>
@@ -413,24 +412,6 @@ export function NewProjectCreator({
413412
</Row>
414413
{render_add_license()}
415414
{render_license()}
416-
{noProjects && (
417-
<Row>
418-
<Col sm={24} style={{ marginTop: "10px" }}>
419-
<Space>
420-
<Button disabled={state === "saving"} onClick={cancel_editing}>
421-
{intl.formatMessage(labels.cancel)}
422-
</Button>
423-
<Button
424-
disabled={isDisabled()}
425-
onClick={() => create_project()}
426-
type="primary"
427-
>
428-
{renderOKButtonText()}
429-
</Button>
430-
</Space>
431-
</Col>
432-
</Row>
433-
)}
434415
{render_error()}
435416
</>
436417
);
@@ -451,37 +432,28 @@ export function NewProjectCreator({
451432

452433
function render_project_creation(): React.JSX.Element | undefined {
453434
if (state === "view") return;
454-
// if user has no projects yet, show the create dialog directly – otherwise its a modal
455-
if (noProjects) {
456-
return (
457-
<Well style={{ backgroundColor: "#FFF" }}>
458-
{render_input_section()}
459-
</Well>
460-
);
461-
} else {
462-
return (
463-
<Modal
464-
title={intl.formatMessage(labels.create_project)}
465-
open={state === "edit" || state === "saving"}
466-
okButtonProps={{ disabled: isDisabled() }}
467-
okText={renderOKButtonText()}
468-
cancelText={intl.formatMessage(labels.cancel)}
469-
onCancel={cancel_editing}
470-
onOk={create_project}
471-
confirmLoading={state === "saving"}
472-
width={{
473-
xs: "90%",
474-
sm: "90%",
475-
md: "80%",
476-
lg: "75%",
477-
xl: "70%",
478-
xxl: "60%",
479-
}}
480-
>
481-
{render_input_section()}
482-
</Modal>
483-
);
484-
}
435+
return (
436+
<Modal
437+
title={intl.formatMessage(labels.create_project)}
438+
open={state === "edit" || state === "saving"}
439+
okButtonProps={{ disabled: isDisabled() }}
440+
okText={renderOKButtonText()}
441+
cancelText={intl.formatMessage(labels.cancel)}
442+
onCancel={cancel_editing}
443+
onOk={create_project}
444+
confirmLoading={state === "saving"}
445+
width={{
446+
xs: "90%",
447+
sm: "90%",
448+
md: "80%",
449+
lg: "75%",
450+
xl: "70%",
451+
xxl: "60%",
452+
}}
453+
>
454+
{render_input_section()}
455+
</Modal>
456+
);
485457
}
486458

487459
return (

0 commit comments

Comments
 (0)