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/disable-collaborators.tsx
Views: 687
1
import { Card, Checkbox } from "antd";
2
import { FormattedMessage, useIntl } from "react-intl";
3
4
import { Icon, Paragraph } from "@cocalc/frontend/components";
5
import { course } from "@cocalc/frontend/i18n";
6
7
interface Props {
8
checked: boolean;
9
on_change: (checked: boolean) => void;
10
}
11
12
export function DisableStudentCollaboratorsPanel({
13
checked,
14
on_change,
15
}: Props) {
16
const intl = useIntl();
17
18
const title = intl.formatMessage(course.collaborator_policy);
19
20
return (
21
<Card
22
title={
23
<>
24
<Icon name="envelope" /> {title}
25
</>
26
}
27
>
28
<div>
29
<Checkbox
30
checked={checked}
31
onChange={(e) => on_change((e.target as any).checked)}
32
>
33
<FormattedMessage
34
id="course.configuration.disable-collaborators.title"
35
defaultMessage={"Allow arbitrary collaborators"}
36
/>
37
</Checkbox>
38
</div>
39
<hr />
40
<Paragraph type="secondary">
41
<FormattedMessage
42
id="course.configuration.disable-collaborators.description"
43
defaultMessage={`If this box is checked (this is the default),
44
the owner and any collaborator on this student project may add collaborators to this project.
45
If this box is not checked, any collaborators on this student project will be removed,
46
with the exception of the student, instructor, and TAs whenever the projects are reconfigured.
47
Here "instructor and TAs" means any user who is an owner or collaborator on the teaching project,
48
i.e. the project containing the course file.
49
After "Allow arbitrary collaborators" is checked,
50
collaborators to be excluded are removed when opening the course file or upon clicking
51
"Reconfigure all projects".
52
{br}
53
<b>NOTE:</b> There is also a new "Disable adding or removing collaborators" option below,
54
which you should also consider using.`}
55
values={{ br: <br /> }}
56
/>
57
</Paragraph>
58
</Card>
59
);
60
}
61
62