Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render() {
let address = 'team42.local';
let status = 'Unknown', icon = IconNames.HELP, intent;
switch (this.props.status) {
case ConnectionStatus.HEALTHY:
status = 'Healthy';
icon = IconNames.TICK_CIRCLE;
intent = Intent.SUCCESS;
break;
case ConnectionStatus.WARNING:
status = 'Warning';
icon = IconNames.WARNING_SIGN;
intent = Intent.WARNING;
break;
// case ConnectionStatus.ERROR:
// status = 'Error';
// icon = IconNames.ERROR;
// intent = Intent.DANGER;
// break;
const About: React.SFC = props => (
<dialog title="About">
<div>
<div>
<p>
The <i>Source Academy</i> is a computer-mediated learning environment for studying the
structure and interpretation of computer programs. Students write and run their programs
in their web browser, using sublanguages of JavaScript called{' '}
<a href="{LINKS.SOURCE_DOCS}">Source §1, Source §2, Source §3 and Source §4</a>, designed
for the first four chapters of the textbook{' '}
<a href="{LINKS.TEXTBOOK}">
Structure and Interpretation of Computer Programs, JavaScript Adaptation
</a></p></div></div></dialog>
const profile = this.props.name ? (
<menuitem>
) : null;
const logout = this.props.name ? (
<menuitem>
) : null;
return (
<menu>
{profile}
<menuitem>
<menuitem>
{logout}
</menuitem></menuitem></menu>
);
}
</menuitem></menuitem>
static dataTypeToIcon(dataType: string): IconName {
switch (dataType) {
case 'TIMESTAMP':
return IconNames.TIME;
case 'VARCHAR':
return IconNames.FONT;
case 'BIGINT':
case 'FLOAT':
return IconNames.NUMERICAL;
default:
return IconNames.HELP;
}
}
renderExtraMenu(isRune: boolean) {
const { onExplain } = this.props;
const { query, autoComplete, useCache, wrapQuery, useApproximateCountDistinct, useApproximateTopN } = this.state;
return <menu>
<menuitem href="{isRune">
{
!isRune &&
<>
<menuitem> onExplain(query, this.getContext())}
/>
this.setState({wrapQuery: !wrapQuery})}</menuitem></menuitem></menu>
},
"treemap": {
label: "Treemap",
createContentElement: (props) => {
const treemapProps = {
...props,
configStore: treemapConfigStore,
implRef: treemapImplRef
};
return ;
},
tools: [
{
id: "interaction",
icon: IconNames.HELP,
createContentElement: (props) => {
return ;
},
title: "Treemap interaction help"
},
{
id: "export-image",
createContentElement: (props) => {
return ;
},
title: "Export treemap as JPEG"
},
{
id: "config",
icon: IconNames.COG,
createContentElement: (props) => {
queryContext,
onQueryContextChange,
onEditContext,
onHistory,
onPrettier,
} = this.props;
const useCache = getUseCache(queryContext);
const useApproximateCountDistinct = getUseApproximateCountDistinct(queryContext);
const useApproximateTopN = getUseApproximateTopN(queryContext);
const numContextKeys = Object.keys(queryContext).length;
return (
<menu>
<menuitem href="{runeMode">
<menuitem>
{!runeMode && (
<>
{onExplain && (
<menuitem>
)}
{
onQueryContextChange(
setUseApproximateCountDistinct(queryContext, !useApproximateCountDistinct),</menuitem></menuitem></menuitem></menu>
},
"pie-chart": {
label: "Pie-chart",
createContentElement: (props) => {
const piechartProps = {
...props,
configStore: pieChartConfigStore,
implRef: piechartImplRef
};
return ;
},
tools: [
{
id: "interaction",
icon: IconNames.HELP,
createContentElement: (props) => {
return ;
}
},
{
id: "export-image",
createContentElement: (props) => {
return ;
},
title: "Export pie-chart as JPEG"
},
{
id: "config",
icon: IconNames.COG,
createContentElement: (props) => {
return ;
<button>
</button><button>
{aboutDialogOpen && setAboutDialogOpen(false)} />}
{doctorDialogOpen && setDoctorDialogOpen(false)} />}
{coordinatorDynamicConfigDialogOpen && (
setCoordinatorDynamicConfigDialogOpen(false)}
/>
)}
{overlordDynamicConfigDialogOpen && (
setOverlordDynamicConfigDialogOpen(false)} />
)}
);
});
</button>