Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const makeGradingStatus = (gradingStatus: string) => {
let iconName: IconName;
let intent: Intent;
let tooltip: string;
switch (gradingStatus) {
case GradingStatuses.graded:
iconName = IconNames.TICK;
intent = Intent.SUCCESS;
tooltip = 'Fully graded';
break;
case GradingStatuses.grading:
iconName = IconNames.TIME;
intent = Intent.WARNING;
tooltip = 'Grading in progress';
break;
case GradingStatuses.none:
iconName = IconNames.CROSS;
intent = Intent.DANGER;
tooltip = 'Not graded yet';
break;
default:
// Shows default icon if this assessment is ungraded
iconName = IconNames.DISABLE;
intent = Intent.PRIMARY;
tooltip = `Not applicable`;
break;
}
renderVerdict = (verdict: SubmissionVerdict) => {
switch (verdict) {
case GradingVerdict.Accepted:
return Accepted
case GradingVerdict.WrongAnswer:
return Wrong Answer
case GradingVerdict.TimeLimitExceeded:
return Time Limit Exceeded
case GradingVerdict.MemoryLimitExceeded:
return Memory Limit Exceeded
case GradingVerdict.RuntimeError:
return Runtime Error
case GradingVerdict.CompilationError:
return Compilation Error
case GradingVerdict.InternalError:
return Internal Error
default:
return Pending
}
}
itemPredicate={(query, mode) =>
query.length === 0 || mode.name.includes(query)
}
itemRenderer={(mode, props) => (
)}
onItemSelect={this.onItemSelect}
>
<button disabled="{singleMode" mode="">
);
}
</button>
>
Available
{" "}
in the full
{" "}
range of
{" "}
visual intents!
<br>
function getSeverityByError(error) {
if ("response" in error) {
return Intent.WARNING;
}
return Intent.DANGER;
}
const toastFeatureNotAvailable = () => {
this.props.toaster.show({
message: `Your browser does not support this feature at the moment 😕.
You can however, share you screen with Chrome using a browser extension`,
intent: Intent.WARNING,
});
};
{t('Press the key, or Esc to cancel')}
<button disabled="{disabled}">
{value ? t('Change') : t('Set')}
</button>
{!disabled && value && !recording && (
<button>
{t('Remove')}
</button>
)}
)
}
}
const getTagIntent = ({ isLSC }, timeRemaining) =>
timeRemaining > 600 && isLSC
? Intent.DANGER
: timeRemaining > 600
? Intent.PRIMARY
: timeRemaining > 0
? Intent.WARNING
: timeRemaining == 0
? Intent.SUCCESS
: Intent.NONE
{allSolidsSelected ? "All" : highlighted.length} solid
{highlighted.length !== 1 || allSolidsSelected ? "s" : ""}{" "}
selected
<button> this.setState({ open: false })}>
Cancel
</button>
<button>
Apply
</button>
<button>
{valid && this.props.pipeline
? subsetDescription(this.props.value, this.props.pipeline)
: "Invalid Solid Selection"}
</button>
);
}
}
)(({ proxyPort, port, allowLAN, t }) => (
<section title="{t('Relay">
{t('If you do not know what is this section for, leave it unconfigured')}
{port === proxyPort && (
{t('Proxy port and poi port are the same, are you sure?')}
</section>