Skip to content

Commit 0b4a34e

Browse files
committed
course: move help box to menus
1 parent d270f8c commit 0b4a34e

File tree

9 files changed

+16
-80
lines changed

9 files changed

+16
-80
lines changed

src/packages/frontend/course/assignments/assignments-panel.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import {
3030
import * as styles from "../styles";
3131
import * as util from "../util";
3232
import { Assignment } from "./assignment";
33-
import { HelpBox } from "../configuration/help-box";
3433

3534
interface Props {
3635
frame_id?: string;
@@ -229,15 +228,6 @@ export const AssignmentsPanel: React.FC<Props> = React.memo((props: Props) => {
229228

230229
return (
231230
<div>
232-
<div
233-
style={{
234-
margin: "30px auto",
235-
fontSize: "12pt",
236-
maxWidth: "800px",
237-
}}
238-
>
239-
<HelpBox />
240-
</div>
241231
<Alert
242232
type="info"
243233
style={{ margin: "auto", fontSize: "12pt", maxWidth: "800px" }}

src/packages/frontend/course/configuration/configuration-panel.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import { debounce } from "lodash";
77
import { Card, Row, Col } from "antd";
8-
// React libraries and Components
98
import {
109
React,
1110
redux,
@@ -26,7 +25,6 @@ import {
2625
import { StudentProjectUpgrades } from "./upgrades";
2726
import { CourseActions } from "../actions";
2827
import { CourseSettingsRecord, CourseStore } from "../store";
29-
import { HelpBox } from "./help-box";
3028
import { Nbgrader } from "./nbgrader";
3129
import { Parallel } from "./parallel";
3230
import { DisableStudentCollaboratorsPanel } from "./disable-collaborators";
@@ -261,8 +259,6 @@ export const ConfigurationPanel: React.FC<Props> = React.memo(
261259
{render_nbgrader()}
262260
</Col>
263261
<Col md={12} style={{ padding: "15px" }}>
264-
<HelpBox />
265-
<br />
266262
{render_disable_students()}
267263
<br />
268264
{render_student_project_functionality()}

src/packages/frontend/course/configuration/help-box.tsx

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/packages/frontend/course/handouts/handouts-panel.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import * as styles from "../styles";
2525
// CoCalc and course components
2626
import * as util from "../util";
2727
import { Handout } from "./handout";
28-
import { HelpBox } from "../configuration/help-box";
2928

3029
interface HandoutsPanelReactProps {
3130
frame_id?: string;
@@ -184,15 +183,6 @@ export const HandoutsPanel: React.FC<HandoutsPanelReactProps> = React.memo(
184183
function render_no_handouts(): Rendered {
185184
return (
186185
<div>
187-
<div
188-
style={{
189-
margin: "30px auto",
190-
fontSize: "12pt",
191-
maxWidth: "800px",
192-
}}
193-
>
194-
<HelpBox />
195-
</div>
196186
<Alert
197187
type="info"
198188
style={{ margin: "auto", fontSize: "12pt", maxWidth: "800px" }}

src/packages/frontend/course/students/students-panel.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import {
4040
} from "../store";
4141
import * as util from "../util";
4242
import { Student, StudentNameDescription } from "./students-panel-student";
43-
import { HelpBox } from "../configuration/help-box";
4443

4544
interface StudentsPanelReactProps {
4645
frame_id?: string; // used for state caching
@@ -424,7 +423,10 @@ export const StudentsPanel: React.FC<StudentsPanelReactProps> = React.memo(
424423
x.account_id != null
425424
? x.first_name + " " + x.last_name
426425
: x.email_address;
427-
const email = !include_name_search && (x.account_id != null) && x.email_address ? " (" + x.email_address + ")": "";
426+
const email =
427+
!include_name_search && x.account_id != null && x.email_address
428+
? " (" + x.email_address + ")"
429+
: "";
428430
v.push(
429431
<option key={key} value={key} label={student_name + email}>
430432
{student_name + email}
@@ -772,15 +774,6 @@ export const StudentsPanel: React.FC<StudentsPanelReactProps> = React.memo(
772774
function render_no_students(): Rendered {
773775
return (
774776
<div>
775-
<div
776-
style={{
777-
margin: "30px auto",
778-
fontSize: "12pt",
779-
maxWidth: "800px",
780-
}}
781-
>
782-
<HelpBox />
783-
</div>
784777
<Alert
785778
type="info"
786779
style={{

src/packages/frontend/frame-editors/course-editor/actions.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Course Frame Editor Actions
99

1010
import { FrameTree } from "../frame-tree/types";
1111
import { Actions, CodeEditorState } from "../code-editor/actions";
12+
import { open_new_tab } from "@cocalc/frontend/misc";
1213

1314
interface CourseEditorState extends CodeEditorState {}
1415

@@ -42,7 +43,7 @@ export class CourseEditorActions extends Actions<CourseEditorState> {
4243
private init_changes_state(): void {
4344
const syncdb = this.course_actions.syncdb;
4445
syncdb.on("has-uncommitted-changes", (has_uncommitted_changes) =>
45-
this.setState({ has_uncommitted_changes })
46+
this.setState({ has_uncommitted_changes }),
4647
);
4748
syncdb.on("has-unsaved-changes", (has_unsaved_changes) => {
4849
this.setState({ has_unsaved_changes });
@@ -105,6 +106,10 @@ export class CourseEditorActions extends Actions<CourseEditorState> {
105106
this.course_actions.syncdb.redo();
106107
this.course_actions.syncdb.commit();
107108
}
109+
110+
help = (): void => {
111+
open_new_tab("https://doc.cocalc.com/teaching-instructors.html");
112+
};
108113
}
109114

110115
export { CourseEditorActions as Actions };

src/packages/frontend/frame-editors/course-editor/editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ const commands = set([
2727
//"increase_font_size",
2828
"save",
2929
"time_travel",
30+
"help",
3031
]);
3132

32-
//const buttons = set(["decrease_font_size", "increase_font_size"]);
3333
const buttons = undefined;
3434

3535
const course_students: EditorDescription = {

src/packages/frontend/frame-editors/frame-tree/commands/generic-commands.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -986,9 +986,9 @@ addCommands({
986986
support: {
987987
alwaysShow: true,
988988
pos: 6,
989-
group: "help-link",
989+
group: "usergroup-add",
990990
icon: "medkit",
991-
label: "Support Ticket",
991+
label: "Contact Us!",
992992
button: labels.support,
993993
title:
994994
"Create a support ticket. Ask the people at CoCalc a question, report a bug, etc.",
@@ -1001,13 +1001,11 @@ addCommands({
10011001
pos: 10,
10021002
group: "help-link",
10031003
icon: "youtube",
1004-
label: "Videos",
1004+
label: "YouTube Videos",
10051005
button: "Videos",
10061006
title: "Browse videos about CoCalc.",
10071007
onClick: () => {
1008-
openNewTab(
1009-
"https://www.youtube.com/playlist?list=PLOEk1mo1p5tJmEuAlou4JIWZFH7IVE2PZ",
1010-
);
1008+
openNewTab("https://www.youtube.com/@cocalc-cloud");
10111009
},
10121010
},
10131011
[SEARCH_COMMANDS]: {

src/packages/next/components/videos.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Carousel } from "antd";
22
import { useState } from "react";
3-
43
import { Icon } from "@cocalc/frontend/components/icon";
54
import { Paragraph } from "components/misc";
65
import A from "components/misc/A";
@@ -70,7 +69,7 @@ function VideoItem({
7069
></iframe>
7170
<A
7271
style={{ color: "white", float: "right", marginRight: "10px" }}
73-
href="https://www.youtube.com/playlist?list=PLOEk1mo1p5tJmEuAlou4JIWZFH7IVE2PZ"
72+
href="https://www.youtube.com/@cocalc-cloud"
7473
>
7574
<Icon name="youtube" style={{ color: "red" }} /> More Videos
7675
</A>

0 commit comments

Comments
 (0)