Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// @flow
import React from 'react';
import { MenuItem, Intent } from '@blueprintjs/core';
import { MultiSelect } from '@blueprintjs/select';
const INTENTS = [Intent.NONE, Intent.PRIMARY, Intent.SUCCESS, Intent.DANGER, Intent.WARNING];
type Indicator = {
name: string,
active: boolean,
height: number,
rank: number,
};
type Props = {
indicators: Array,
onUpdateIndicators: (Indicator, boolean) => void,
};
type State = {
indicators: Array,
};
<div>Remember Me</div>
<div>
</div>
<button fill="{true}" disabled="{isSubmitting}" type="submit">
{isSubmitting ? 'Signing In...' : 'Sign In'}
</button>
)
{ch.map(perm => {
const checked = values.permissions.includes(perm)
const disabled = !updatablePermissions.includes(perm)
return (
)
})}
))}
<div>
<button type="submit" disabled="{isSubmitting}">
{isSubmitting ? `Saving...` : `Save`}
</button>
</div>
)
}
onSuccess={(data: Run) => {
Toaster.show({
message: `Run ${data.run_id} submitted successfully!`,
intent: Intent.SUCCESS,
})
history.push(`/runs/${data.run_id}`)
}}
onFailure={() => {
const values = this.getOptionsValues(options)
if (options.length > 0) {
if (values.length < 2) {
optionsIntent = Intent.DANGER
optionsError = 'You need at least 2 options.'
} else if (values.length > 30) {
optionsIntent = Intent.DANGER
optionsError = 'You need at most 30 options.'
} else {
optionsIntent = Intent.SUCCESS
}
}
if (optionsIntent === Intent.SUCCESS && question.length > 0) {
formState = FormState.Valid
}
return { optionsError, optionsIntent, questionIntent, formState }
}
socket.listen('scanner::scanfinished::*', function (evt) {
toaster.dismiss(toast);
toaster.show({
message: evt.clean ? 'No changes since last scan'
: 'Library scan successfully finished',
iconName: 'tick',
intent: Intent.SUCCESS,
timeout: 3500
});
})
}
onCopy() {
this.setState({ copied: true });
SupremeToaster.show({
message: (
<div>Link Copied to Clipboard 👍 <br> Share it to invite others to this room </div>
),
intent: Intent.SUCCESS,
});
}
{isCollection && (
<div>
{content.pubs.length}
</div>
)}
<div>
{collectionConversations}
</div>
<div>
{collectionMerges}
{Math.random() < 0.3 && (
{collectionReviews}
)}
</div>
<div>
{collectionReviews}
{Math.random() < 0.3 && (
{collectionReviews}
)}
</div>
{isCollection && collectionIsOpen && (
onClick={() => {
copy(logValue ? logValue : '', { format: 'text/plain' });
AppToaster.show({
message: 'Log copied to clipboard',
intent: Intent.SUCCESS,
});
}}
/>
import { Intent } from "@blueprintjs/core"
import { HTTPMethod } from "http-method-enum"
export const HTTPMethodIntent: { [method in HTTPMethod]: Intent } = {
[HTTPMethod.CONNECT]: Intent.DANGER,
[HTTPMethod.DELETE]: Intent.DANGER,
[HTTPMethod.GET]: Intent.PRIMARY,
[HTTPMethod.HEAD]: Intent.WARNING,
[HTTPMethod.OPTIONS]: Intent.NONE,
[HTTPMethod.PATCH]: Intent.SUCCESS,
[HTTPMethod.POST]: Intent.SUCCESS,
[HTTPMethod.PUT]: Intent.SUCCESS,
[HTTPMethod.TRACE]: Intent.NONE
}
export const HTTPStatusCodeIntent = (code: number) => {
if (200 <= code && code < 300) {
return Intent.SUCCESS
} else if (300 <= code && code < 400) {
return Intent.PRIMARY
} else if (400 <= code && code < 500) {
return Intent.WARNING
} else if (500 <= code && code < 600) {
return Intent.DANGER
} else {
return Intent.NONE
}
}