CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/course/configuration/delete-all-student-projects.tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Button, Card, Popconfirm } from "antd";
7
import { FormattedMessage, useIntl } from "react-intl";
8
9
import { Icon, Paragraph } from "@cocalc/frontend/components";
10
import { course } from "@cocalc/frontend/i18n";
11
12
export function DeleteAllStudentProjects({ actions }) {
13
const intl = useIntl();
14
15
return (
16
<Card
17
title={
18
<>
19
<Icon name="trash" />{" "}
20
{intl.formatMessage(course.delete_student_projects)}
21
</>
22
}
23
>
24
<Popconfirm
25
title={intl.formatMessage({
26
id: "course.delete-all-student-projects.confirm.title",
27
defaultMessage:
28
"Delete all student projects and remove students from them?",
29
})}
30
description={
31
<div style={{ maxWidth: "400px" }}>
32
<FormattedMessage
33
id="course.delete-all-student-projects.confirm"
34
defaultMessage={`You will still temporarily have access to the deleted projects
35
in the Projects page (select "Deleted and Hidden"),
36
but students will be removed from the deleted projects immediately.`}
37
/>
38
</div>
39
}
40
onConfirm={() => actions.student_projects.deleteAllStudentProjects()}
41
okText={intl.formatMessage({
42
id: "course.delete-all-student-projects.confirm.yes",
43
defaultMessage: "YES, DELETE all Student Projects",
44
})}
45
>
46
<Button danger>
47
<Icon name="trash" />{" "}
48
{intl.formatMessage(course.delete_student_projects)}...
49
</Button>
50
</Popconfirm>
51
<hr />
52
<Paragraph type="secondary">
53
<FormattedMessage
54
id="course.delete-all-student-projects.info"
55
defaultMessage={`If for some reason you would like to delete all the student projects
56
created for this course, you may do so by clicking above.
57
Be careful!
58
Students will be removed from the deleted projects.`}
59
/>
60
</Paragraph>
61
</Card>
62
);
63
}
64
65