Skip to content

Commit 3a4e712

Browse files
authored
Merge pull request #7573 from sagemathinc/r-ide
"R IDE" string
2 parents 6aaa2c9 + eee9a3f commit 3a4e712

File tree

16 files changed

+99
-59
lines changed

16 files changed

+99
-59
lines changed

src/packages/comm/x11-apps.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
//import { IconName } from "@cocalc/frontend/components/icon";
7+
import { R_IDE } from "@cocalc/util/consts/ui";
78

89
interface APPS_Interface {
910
[k: string]: {
@@ -102,8 +103,8 @@ export const APPS: Readonly<APPS_Interface> = Object.freeze({
102103
},
103104
rstudio: {
104105
icon: "r",
105-
desc: "An integrated development environment (IDE) for R. RStudio, Inc. is in no way affiliated with CoCalc",
106-
label: "RStudio",
106+
desc: "An integrated development environment (IDE) for R. Posit Software, PBC (formerly RStudio, PBC) is in no way affiliated with CoCalc",
107+
label: R_IDE,
107108
},
108109
/* See https://github.com/sagemathinc/cocalc/issues/5427
109110
Sometimes, Octave GUI works, sometimes not.

src/packages/frontend/account/delete-account.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
44
*/
55

6-
import { Component, React, Rendered, rtypes } from "../app-framework";
7-
import { Button, ButtonToolbar, Well } from "../antd-bootstrap";
8-
import { ErrorDisplay, Icon, A } from "../components";
6+
import { Button, ButtonToolbar, Well } from "@cocalc/frontend/antd-bootstrap";
7+
import {
8+
Component,
9+
React,
10+
Rendered,
11+
rtypes,
12+
} from "@cocalc/frontend/app-framework";
13+
import { A, ErrorDisplay, Icon } from "@cocalc/frontend/components";
914

1015
interface Props {
1116
initial_click: () => void;

src/packages/frontend/account/keyboard-settings.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@
33
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
44
*/
55

6-
import { useTypedRedux } from "../app-framework";
7-
import { Icon, LabeledRow, Loading, SelectorInput } from "../components";
8-
import { Panel } from "../antd-bootstrap";
9-
import { set_account_table } from "./util";
10-
import { IS_MACOS } from "../feature";
6+
import { Panel } from "@cocalc/frontend/antd-bootstrap";
7+
import { useTypedRedux } from "@cocalc/frontend/app-framework";
8+
import {
9+
Icon,
10+
LabeledRow,
11+
Loading,
12+
SelectorInput,
13+
} from "@cocalc/frontend/components";
14+
import { IS_MACOS } from "@cocalc/frontend/feature";
1115
import keyboardShortcuts from "./keyboard-shortcuts";
16+
import { set_account_table } from "./util";
1217

1318
const KEYBOARD_SHORTCUTS = keyboardShortcuts(IS_MACOS);
1419

@@ -29,7 +34,7 @@ export const KeyboardSettings: React.FC = () => {
2934
v.push(
3035
<LabeledRow key={desc} label={desc} label_cols={LABEL_COLS}>
3136
{shortcut}
32-
</LabeledRow>
37+
</LabeledRow>,
3338
);
3439
}
3540
return v;

src/packages/frontend/account/profile-image.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,24 @@
44
*/
55

66
import { Map as ImmutableMap } from "immutable";
7-
import { Button, ButtonToolbar, FormControl, Well } from "../antd-bootstrap";
8-
import { Component, Rendered } from "../app-framework";
9-
import { ErrorDisplay, Loading, ProfileIcon } from "../components";
107
import Pica from "pica";
11-
import gravatarUrl from "./gravatar-url";
12-
import { webapp_client } from "@cocalc/frontend/webapp-client";
138
import ReactCropComponent from "react-image-crop";
149
import "react-image-crop/dist/ReactCrop.css";
10+
import gravatarUrl from "./gravatar-url";
11+
12+
import {
13+
Button,
14+
ButtonToolbar,
15+
FormControl,
16+
Well,
17+
} from "@cocalc/frontend/antd-bootstrap";
18+
import { Component, Rendered } from "@cocalc/frontend/app-framework";
19+
import {
20+
ErrorDisplay,
21+
Loading,
22+
ProfileIcon,
23+
} from "@cocalc/frontend/components";
24+
import { webapp_client } from "@cocalc/frontend/webapp-client";
1525

1626
// This is what facebook uses, and it makes
1727
// 40x40 look very good. It takes about 20KB

src/packages/frontend/account/profile-settings.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@
44
*/
55

66
import { Map } from "immutable";
7-
import { rclass, rtypes, Component, Rendered } from "../app-framework";
8-
import { Panel } from "../antd-bootstrap";
9-
import { LabeledRow, Loading, Gap } from "../components";
10-
import { ColorPicker } from "../colorpicker";
11-
import { ProfileImageSelector, setProfile } from "./profile-image";
7+
8+
import { Panel } from "@cocalc/frontend/antd-bootstrap";
9+
import {
10+
Component,
11+
Rendered,
12+
rclass,
13+
rtypes,
14+
} from "@cocalc/frontend/app-framework";
15+
import { ColorPicker } from "@cocalc/frontend/colorpicker";
16+
import { Gap, LabeledRow, Loading } from "@cocalc/frontend/components";
1217
import { Avatar } from "./avatar/avatar";
18+
import { ProfileImageSelector, setProfile } from "./profile-image";
1319

1420
interface Props {
1521
email_address?: string;

src/packages/frontend/account/sign-out.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
33
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
44
*/
5-
6-
import { React, Rendered, redux } from "../app-framework";
75
import { Button, Popconfirm } from "antd";
6+
87
import { LogoutOutlined } from "@ant-design/icons";
8+
import { React, Rendered, redux } from "@cocalc/frontend/app-framework";
99
import track from "@cocalc/frontend/user-tracking";
1010

1111
interface Props {

src/packages/frontend/account/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
44
*/
55

6-
import { redux } from "../app-framework";
7-
import { alert_message } from "../alerts";
6+
import { alert_message } from "@cocalc/frontend/alerts";
7+
import { redux } from "@cocalc/frontend/app-framework";
88

99
export function set_account_table(obj: object): void {
1010
redux.getTable("account").set(obj);

src/packages/frontend/components/link-retry.tsx

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
44
*/
55

6-
import { Button } from "antd";
6+
import { Button, Tooltip } from "antd";
77

88
import {
99
useEffect,
1010
useIsMountedRef,
1111
useState,
1212
} from "@cocalc/frontend/app-framework";
13-
import { Icon, Loading, Gap } from "@cocalc/frontend/components";
13+
import { Gap, Icon, Loading } from "@cocalc/frontend/components";
1414
import { open_new_tab } from "@cocalc/frontend/misc";
1515
import { retry_until_success } from "@cocalc/util/async-utils";
1616
import { COLORS } from "@cocalc/util/theme";
@@ -24,6 +24,7 @@ interface Props {
2424
onClick?: () => void;
2525
autoStart?: boolean;
2626
maxTime?: number;
27+
tooltip?: string;
2728
}
2829

2930
const LinkRetry: React.FC<Props> = ({
@@ -35,6 +36,7 @@ const LinkRetry: React.FC<Props> = ({
3536
autoStart,
3637
maxTime = 30000,
3738
loadingText,
39+
tooltip,
3840
}: Props) => {
3941
const isMountedRef = useIsMountedRef();
4042
const [working, setWorking] = useState<boolean>(false);
@@ -104,42 +106,44 @@ const LinkRetry: React.FC<Props> = ({
104106
}
105107
}, []);
106108

109+
function renderError() {
110+
if (!error) return;
111+
return (
112+
<span style={{ color: COLORS.ANTD_RED_WARN }}>
113+
<Gap /> (failed to load)
114+
</span>
115+
);
116+
}
117+
107118
switch (mode) {
108119
case "link":
120+
const aLink = (
121+
<a onClick={click} style={{ cursor: "pointer" }}>
122+
{children}
123+
</a>
124+
);
125+
const a = tooltip ? <Tooltip title={tooltip}>{aLink}</Tooltip> : aLink;
109126
return (
110127
<span>
111-
<a onClick={click} style={{ cursor: "pointer" }}>
112-
{children}
113-
</a>
128+
{a}
114129
{mode === "link" && loading && (
115130
<span>
116131
<Gap /> <Loading text={loadingText} />
117132
</span>
118133
)}
119-
{error && (
120-
<>
121-
<span style={{ color: COLORS.ANTD_RED_WARN }}>
122-
<Gap /> (failed to load)
123-
</span>
124-
</>
125-
)}
134+
{renderError()}
126135
</span>
127136
);
128137
case "button":
129-
return (
138+
const btn = (
130139
<Button onClick={click} size={size}>
131140
{children}
132-
{loading ? (
133-
<Icon name="cocalc-ring" spin />
134-
) : (
135-
error && (
136-
<span style={{ color: COLORS.ANTD_RED_WARN }}>
137-
(failed to load)
138-
</span>
139-
)
140-
)}
141+
{loading ? <Icon name="cocalc-ring" spin /> : renderError()}
141142
</Button>
142143
);
144+
if (tooltip) {
145+
return <Tooltip title={tooltip}>{btn}</Tooltip>;
146+
}
143147
default:
144148
throw Error("invalid mode");
145149
}

src/packages/frontend/course/configuration/customize-student-project-functionality.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
} from "@cocalc/frontend/app-framework";
1717
import { Icon, Tip } from "@cocalc/frontend/components";
1818
import type { StudentProjectFunctionality } from "@cocalc/util/db-schema/projects";
19+
import { R_IDE } from "@cocalc/util/consts/ui";
1920
export type { StudentProjectFunctionality };
2021

2122
interface Option {
@@ -71,9 +72,8 @@ const OPTIONS: Option[] = [
7172
},
7273
{
7374
name: "disableRServer",
74-
title: "RStudio Server",
75-
description:
76-
"Disable the user interface for running an RStudio server in student projects. RStudio is an IDE for R.",
75+
title: R_IDE,
76+
description: `Disable the user interface for running the ${R_IDE} server in student projects. This is an IDE for coding in R.`,
7777
},
7878
{
7979
name: "disableTerminals",

src/packages/frontend/frame-editors/jupyter-editor/markdown-notebook.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Frame for working with a Jupyter notebook as a single markdown
88
document, like in RStudio or our RMarkdown editor.
99
*/
1010

11-
import { Rendered, Component } from "../../app-framework";
11+
import { Rendered, Component } from "@cocalc/frontend/app-framework";
1212

1313
interface Props {
1414
project_id: string;

0 commit comments

Comments
 (0)