Skip to content

Commit 2a1a08e

Browse files
committed
Revert "un-deprecate sage worksheets"
This reverts commit 6f00c6e.
1 parent 1695444 commit 2a1a08e

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

src/packages/frontend/project/new/file-type-selector.tsx

Lines changed: 27 additions & 3 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 { Col, Flex, Row, Tag } from "antd";
6+
import { Col, Flex, Modal, Row, Tag } from "antd";
77
import { Gutter } from "antd/es/grid/row";
88
import type { ReactNode } from "react";
99
import { FormattedMessage, useIntl } from "react-intl";
@@ -372,6 +372,30 @@ export function FileTypeSelector({
372372
function renderSageWS() {
373373
if (!availableFeatures.sage) return;
374374

375+
function handleClick(ext) {
376+
Modal.confirm({
377+
icon: <Icon name="exclamation-circle" />,
378+
title: intl.formatMessage({
379+
id: "project.new.file-type-selector.sagews.modal.title",
380+
defaultMessage: "SageMath Worksheets are Deprecated",
381+
}),
382+
content: intl.formatMessage({
383+
id: "project.new.file-type-selector.sagews.modal.content",
384+
defaultMessage:
385+
"Consider creating a Jupyter Notebook and use a SageMath Kernel (use the 'SageMath Notebook' button). You can also convert existing SageMath Worksheets to Jupyter Notebooks by opening the worksheet and clicking 'Jupyter'.",
386+
}),
387+
okText: intl.formatMessage({
388+
id: "project.new.file-type-selector.sagews.modal.ok",
389+
defaultMessage: "Create SageMath Worksheet Anyways",
390+
}),
391+
onOk: (close) => {
392+
create_file(ext);
393+
close();
394+
},
395+
closable: true,
396+
});
397+
}
398+
375399
return (
376400
<Col sm={sm} md={md}>
377401
<Tip
@@ -381,12 +405,12 @@ export function FileTypeSelector({
381405
tip={intl.formatMessage({
382406
id: "new.file-type-selector.sagews.tooltip",
383407
defaultMessage:
384-
"Create an interactive worksheet for using the SageMath mathematical software, Python, R, and many other systems. Do mathematics, draw plots, compute integrals, work with matrices, etc.",
408+
"Create an interactive worksheet for using the SageMath mathematical software, Python, R, and many other systems. Do sophisticated mathematics, draw plots, compute integrals, work with matrices, etc.",
385409
})}
386410
>
387411
<NewFileButton
388412
name={intl.formatMessage(labels.sagemath_worksheet)}
389-
on_click={create_file}
413+
on_click={handleClick}
390414
ext="sagews"
391415
size={btnSize}
392416
active={btnActive("sagews")}

0 commit comments

Comments
 (0)