Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
id: string,
name: string.isRequired,
status: string,
definition: objectOf(any)
})
).isRequired,
initialTemplates: arrayOf(
shape({
id: string,
name: string.isRequired,
status: string,
definition: objectOf(any),
data: objectOf(any)
})
),
onSubmit: func.isRequired
};
static defaultProps = {
initialTemplates: []
};
state = {
contentTemplates: []
};
// eslint-disable-next-line react/sort-comp
UNSAFE_componentWillMount() {
const newState = {
contentTemplates: [...this.props.initialTemplates]
};
newState.contentTemplates.forEach(template => (template.guid = guid()));
import React, { Component } from 'react';
import FormControl from '@material-ui/core/FormControl';
import Input from '@material-ui/core/Input';
import InputLabel from '@material-ui/core/InputLabel';
import mime from 'mime-types';
import { func, arrayOf, string } from 'prop-types';
import styles from './styles.scss';
class UrlUploader extends Component {
static propTypes = {
onUpload: func.isRequired,
acceptedFileTypes: arrayOf(string)
};
static defaultProps = {
acceptedFileTypes: []
};
state = {
image: '',
fetchingImage: false,
uploadError: false
};
preventInput = evt => {
// todo: a "retrieve" button so we can have manual input without pasting
evt.preventDefault();
);
}
}
Credentials.defaultProps = {
isLoading: false,
isDeleting: false,
};
Credentials.propTypes = {
appName: string.isRequired,
plan: string.isRequired,
appId: string.isRequired,
permissions: array.isRequired,
fetchPermissions: func.isRequired,
handleCreatePermission: func.isRequired,
handleDeletePermission: func.isRequired,
handleEditPermission: func.isRequired,
isOwner: bool.isRequired,
isLoading: bool,
isDeleting: bool,
errors: array.isRequired,
handleDeleteApp: func.isRequired,
};
const mapStateToProps = state => {
const appOwner = get(getAppInfoByName(state), 'owner');
const userEmail = get(state, 'user.data.email');
const appPermissions = getAppPermissionsByName(state);
const planState = getAppPlanByName(state);
return {
appName: get(state, '$getCurrentApp.name'),
plan: get(planState, 'plan'),
appId: get(state, '$getCurrentApp.id'),
type="number"
className="form-control"
onChange={e => updateValue(Number(e.target.value))}
value={formattedValue}
/>
{addon}
<div>
</div>
);
}
ValueSlider.propTypes = {
value: number.isRequired,
updateValue: func.isRequired,
step: number,
min: number,
max: number,
addonText: string,
toFixedDigits: number,
};
ValueSlider.defaultProps = {
step: 1,
min: 0,
max: 100,
addonText: null,
toFixedDigits: null,
};
export default ValueSlider;
return (
<div style="{filterSidebarStyles.controlPanelStyles}">
{header}
{tabBar}
{insetComponent}
</div>
);
}
}
FilterSidebar.propTypes = {
activeFilterSidebarTab: oneOf(Object.values(filterSidebarTabsEnum)).isRequired,
makeGuideTabActive: func.isRequired,
makeSearchTabActive: func.isRequired,
makeFacilitiesTabActive: func.isRequired,
fetchFilterOptions: func.isRequired,
fetchContributors: func.isRequired,
fetchContributorTypes: func.isRequired,
fetchCountries: func.isRequired,
contributorsData: contributorOptionsPropType.isRequired,
contributorTypesData: contributorTypeOptionsPropType.isRequired,
countriesData: countryOptionsPropType.isRequired,
vectorTileFeatureIsActive: bool.isRequired,
fetchingFeatureFlags: bool.isRequired,
};
function mapStateToProps({
ui: {
activeFilterSidebarTab,
))}
);
CheckBoxSelect.propTypes = {
checked: array.isRequired,
handleChangeChecked: func.isRequired,
updateFilterMovies: func.isRequired,
};
const actions = { updateFilterMovies };
const mapDispatchToProps = dispatch => bindActionCreators(actions, dispatch);
const enhance = compose(
connect(null, mapDispatchToProps),
withStateHandlers(
{
checked: [],
},
{
handleChangeChecked: ({ checked }) => (label, wasChecked) => {
if (label === 'All') {
return ({ checked: [label] });
}
value={value}
onBlur={onBlur}
onLookupSave={onChange}
getItems={getOrganizations}
required={required}
sortedColumnKey="name"
/>
);
}
OrganizationLookup.propTypes = {
helperTextInvalid: string,
isValid: bool,
onBlur: func,
onChange: func.isRequired,
required: bool,
value: Organization,
};
OrganizationLookup.defaultProps = {
helperTextInvalid: '',
isValid: true,
onBlur: () => {},
required: false,
value: null,
};
export default withI18n()(OrganizationLookup);
export { OrganizationLookup as _OrganizationLookup };
};
/**
* props for {@link Items}
*
* @typedef props
*
* @property {func} getItemKey item key value getter
* @property {array | object} initialSelection A single or list of objects that should start off selected
* @property {iterable} items An iterable that yields `[key, item]` pairs such as an ES2015 Map
* @property {func} onSelectionChange A callback that fires when the selection state changes
* @property {func | string} renderItem A render prop for the list item elements. A tagname string, such as `"div"`, is also valid
* @property {checkbox | radio} selectionModel A string corresponding to a selection model
*/
Items.propTypes = {
getItemKey: func.isRequired,
initialSelection: oneOfType([array, object]),
items: iterable.isRequired,
onSelectionChange: func,
renderItem: oneOfType([func, string]),
selectionModel: oneOf(['checkbox', 'radio'])
};
/**
* default props for {@link Items}
*
* @typedef @defaultProps
*/
Items.defaultProps = {
getItemKey: ({ id }) => id,
selectionModel: 'radio'
};
remove: actions.remove,
alert: alertActions.alert,
}, dispatch)
}
export class AdminAgentView extends Component {
static propTypes = {
agents: list.isRequired,
loading: bool,
query: func.isRequired,
stop: func.isRequired,
close: func.isRequired,
remove: func.isRequired,
alert: func.isRequired,
i18n: func.isRequired,
}
static defaultProps = {
i18n: createI18n(language).createChild('list'),
}
state = {
category: 'ALL',
openConfirm: false,
openConfig: false,
}
componentDidMount () {
const { query } = this.props
query()
this.isMount = true
function NewTodoInput({addTodo, nextTodo, updateTodo}) {
return (
<div>
<input value="{nextTodo}" type="text"> updateTodo(e.target.value)} placeholder="new todo item"/>
<button>add</button>
</div>
);
}
NewTodoInput.displayName = 'NewTodoInput';
NewTodoInput.propTypes = {
addTodo: func.isRequired,
nextTodo: string.isRequired,
updateTodo: func.isRequired,
};
export default connect(
[SELECT_NEXT_TODO],
([nextTodo], {bindDispatch}) => ({
nextTodo,
addTodo: bindDispatch(ADD_TODO, nextTodo),
updateTodo: bindDispatch(UPDATE_NEXT_TODO),
}),
{
listeners: {
[UPDATE_NEXT_TODO]: (value, {setPartialState}) => {
setPartialState(SELECT_NEXT_TODO, value);
},
[ADD_TODO]: (value, {setPartialState}) => {
setPartialState(SELECT_NEXT_TODO, '');