Commit 485a4554 authored by TJHeeringa's avatar TJHeeringa

Eslinted src

parent bcd0d3bb
......@@ -2,8 +2,8 @@ import "@icon/open-iconic/open-iconic.css";
import MomentUtils from "@date-io/moment";
import { library } from "@fortawesome/fontawesome-svg-core";
import {faBars,faCheck,faChevronLeft,faHome,faIgloo,faPlus,faSignOutAlt,faTimes,faUser} from "@fortawesome/free-solid-svg-icons";
import { fab } from "@fortawesome/free-brands-svg-icons";
import {faBars,faCheck,faChevronLeft,faHome,faIgloo,faPlus,faSignOutAlt,faTimes,faUser} from "@fortawesome/free-solid-svg-icons";
import CssBaseline from "@material-ui/core/CssBaseline";
import { MuiPickersUtilsProvider } from "@material-ui/pickers";
import moment from "moment";
......
import makeStyles from "@material-ui/core/styles/makeStyles";
import PropTypes from "prop-types";
import React from "react";
import { Col, Row } from "reactstrap";
import makeStyles from "@material-ui/core/styles/makeStyles";
const useStyles = makeStyles(theme=>({
column: {
......
import React from "react";
import DateTimeField from "./DateTimeField";
export const DateField = (props) => {return <DateTimeField format={"YYYY/MM/DD"} {...props}/>}
export const DateField = (props) => {return <DateTimeField format={"YYYY/MM/DD"} {...props}/>;};
export default DateField
\ No newline at end of file
export default DateField;
\ No newline at end of file
import { makeStyles, useTheme } from "@material-ui/core/styles";
import {KeyboardDatePicker} from "@material-ui/pickers";
import PropTypes from "prop-types";
import React from "react";
import {TextValidator} from "react-material-ui-form-validator";
import {KeyboardDatePicker} from "@material-ui/pickers";
import EmailLists from "../../Pages/Email/EmailLists";
const useStyles = makeStyles(theme => ({
......
......@@ -26,7 +26,7 @@ const SelectField = (props) => {
{...selectEditorProps(name)}
{...remaining_props}
>
{props.children}
{ props.children }
</SelectValidator>
);
};
......
import React from "react";
import DateTimeField from "./DateTimeField";
export const TimeField = (props) => {return <DateTimeField format={"HH:mm"} {...props}/>}
export const TimeField = (props) => {return <DateTimeField format={"HH:mm"} {...props}/>;};
export default TimeField
\ No newline at end of file
export default TimeField;
\ No newline at end of file
import { Component } from 'react'
import React from 'react'
import {AvField, AvForm, AvCheckbox, AvGroup, AvInput, AvFeedback} from "availity-reactstrap-validation";
import {Row, Col, Label, Button} from 'reactstrap'
import "./MembershipForm.css"
import "./MembershipForm.css";
import {AvCheckbox, AvFeedback,AvField, AvForm, AvGroup, AvInput} from "availity-reactstrap-validation";
import React, { Component } from "react";
import {Button,Col, Label, Row} from "reactstrap";
import { v4 as uuidv4 } from "uuid";
import {Helper} from "../../Helper";
import { v4 as uuidv4 } from 'uuid';
export class MembershipForm extends Component {
constructor(props){
......@@ -13,55 +14,55 @@ export class MembershipForm extends Component {
membership.type_url = membership.type.url;
this.state = {
membership: this.props.membership
}
};
}
handleValidSubmit = (event, values) => {
let membership = this.state.membership;
membership.type_url = membership.type.url;
return Helper.api_call(this.state.membership.url, "PATCH", this.state.membership, 'json',
(membership)=>{this.handleMembershipChange('type', membership.type)})
return Helper.api_call(this.state.membership.url, "PATCH", this.state.membership, "json",
(membership)=>{this.handleMembershipChange("type", membership.type);});
};
handleMembershipChange = (field, value) => {
this.setState(prevState => {
let membership = prevState.membership;
membership[field] = value;
return {membership: membership}
return {membership: membership};
});
};
render() {
return (
<AvForm id="membership_form" onValidSubmit={this.handleValidSubmit} ref={c => (this.form = c)}>
<AvForm id={"membership_form"} onValidSubmit={this.handleValidSubmit} ref={c => (this.form = c)}>
<h4>Membership</h4>
{this.props.wide
{ this.props.wide
?
<x-fragment>
<AvField
type="date"
name="date_joined"
label="Date Joined"
type={"date"}
name={"date_joined"}
label={"Date Joined"}
value={this.state.membership.date_joined}
onChange={(event) => this.handleMembershipChange('date_joined', event.target.value)}
onChange={(event) => this.handleMembershipChange("date_joined", event.target.value)}
disabled={true}
/>
<AvField
type="select"
name="type"
label="Type"
type={"select"}
name={"type"}
label={"Type"}
value={this.state.membership.type_url}
onChange={(event) => this.handleMembershipChange('type_url', event.target.value)}
onChange={(event) => this.handleMembershipChange("type_url", event.target.value)}
disabled={true}
>
<option key={uuidv4()} value={this.state.membership.type.url}>{this.state.membership.type.type}</option>
<option key={uuidv4()} value={this.state.membership.type.url}>{ this.state.membership.type.type }</option>
</AvField>
<AvField
type="select"
name="visible_after_date_left"
label="My info still visible after I left:"
type={"select"}
name={"visible_after_date_left"}
label={"My info still visible after I left:"}
value={this.state.membership.visible_after_date_left}
onChange={(event) => this.handleMembershipChange('visible_after_date_left', event.target.value)}
onChange={(event) => this.handleMembershipChange("visible_after_date_left", event.target.value)}
disabled={false}
>
<option value={true}>Yes</option>
......@@ -72,55 +73,55 @@ export class MembershipForm extends Component {
<x-fragment>
<Col>
<Row>
<Col className="membership_form_col_narrow" xs="12" sm="3">
<Label className="membership_form_label_narrow" for="date_joined">Date Joined</Label>
<Col className={"membership_form_col_narrow"} xs={"12"} sm={"3"}>
<Label className={"membership_form_label_narrow"} for={"date_joined"}>Date Joined</Label>
</Col>
<Col xs="12" sm="2">
<Col xs={"12"} sm={"2"}>
<AvField
type="date"
name="date_joined"
id="date_joined"
type={"date"}
name={"date_joined"}
id={"date_joined"}
value={this.state.membership.date_joined}
onChange={(event) => this.handleMembershipChange('date_joined', event.target.value)}
onChange={(event) => this.handleMembershipChange("date_joined", event.target.value)}
disabled={true}
/>
</Col>
</Row><Row>
<Col className="membership_form_col_narrow" xs="12" sm="3">
<Label className="membership_form_label_narrow" for="type">Type</Label>
<Col className={"membership_form_col_narrow"} xs={"12"} sm={"3"}>
<Label className={"membership_form_label_narrow"} for={"type"}>Type</Label>
</Col>
<Col xs="12" sm="2">
<Col xs={"12"} sm={"2"}>
<AvField
type="select"
name="type"
id="type"
type={"select"}
name={"type"}
id={"type"}
value={this.state.membership.type_url}
onChange={(event) => this.handleMembershipChange('type_url', event.target.value)}
onChange={(event) => this.handleMembershipChange("type_url", event.target.value)}
disabled={true}
>
{this.props.membertypes.map(membertype=>
<option key={uuidv4()} value={membertype.url}>{membertype.type}</option>
)}
{ this.props.membertypes.map(membertype=>
<option key={uuidv4()} value={membertype.url}>{ membertype.type }</option>
) }
</AvField>
</Col>
</Row><Row>
<Col className="membership_form_col_narrow" xs="12" sm="3">
<Label className="membership_form_label_narrow" for="visible_after_date_left">My info still visible after I left:</Label>
<Col className={"membership_form_col_narrow"} xs={"12"} sm={"3"}>
<Label className={"membership_form_label_narrow"} for={"visible_after_date_left"}>My info still visible after I left:</Label>
</Col>
<Col xs="12" sm="2">
<Col xs={"12"} sm={"2"}>
<AvField
type="select"
name="visible_after_date_left"
id="visible_after_date_left"
type={"select"}
name={"visible_after_date_left"}
id={"visible_after_date_left"}
value={this.state.membership.visible_after_date_left}
onChange={(event) => this.handleMembershipChange('visible_after_date_left', event.target.value)}
onChange={(event) => this.handleMembershipChange("visible_after_date_left", event.target.value)}
>
<option value="true">Yes</option>
<option value="false">No</option>
<option value={"true"}>Yes</option>
<option value={"false"}>No</option>
</AvField>
</Col>
<Col xs="12" sm="2">
<Button color="success" type="submit">Save</Button>
<Col xs={"12"} sm={"2"}>
<Button color={"success"} type={"submit"}>Save</Button>
</Col>
</Row>
</Col>
......
import { Component } from 'react'
import React from 'react'
import {AvForm, AvInput, AvField} from "availity-reactstrap-validation";
import {Button, Col, FormGroup, Row} from "reactstrap";
import {Helper} from "App/Helper";
import { v4 as uuidv4 } from 'uuid';
import {AvField,AvForm, AvInput} from "availity-reactstrap-validation";
import React, { Component } from "react";
import {Button, Col, FormGroup, Row} from "reactstrap";
import { v4 as uuidv4 } from "uuid";
import {AlertHandlerContext} from "../../Contexts/AlertHandler";
......@@ -15,27 +15,27 @@ export class AssociationSpecificDataForm extends Component {
};
patchSpecificData(association_specific_data){
Helper.api_call(association_specific_data.url, "PATCH", association_specific_data, 'json',
()=>{this.context.handleAlertHandler('green', 'Save successful')},
()=>{this.context.handleAlertHandler('red', 'Save failed')});
};
Helper.api_call(association_specific_data.url, "PATCH", association_specific_data, "json",
()=>{this.context.handleAlertHandler("green", "Save successful");},
()=>{this.context.handleAlertHandler("red", "Save failed");});
}
getDataField(specific_data){
return this.props.association_specific_data_fields.filter((field)=>{return specific_data.data_field === field.url})[0];
return this.props.association_specific_data_fields.filter((field)=>{return specific_data.data_field === field.url;})[0];
}
getType(data_field){
let type_dict = {
"Boolean": "select",
'Number': "number",
'String': "text",
'Choice': "select",
"Number": "number",
"String": "text",
"Choice": "select",
};
return type_dict[data_field.type]
return type_dict[data_field.type];
}
getChoices(data_field){
return data_field.choices.split(',')
return data_field.choices.split(",");
}
render() {
......@@ -45,46 +45,46 @@ export class AssociationSpecificDataForm extends Component {
let choices = this.getChoices(data_field);
return(
<AvForm id="association_specific_data_form" onValidSubmit={this.handleValidSubmit} ref={c => (this.form = c)}>
<FormGroup className="FormGroup">
<AvForm id={"association_specific_data_form"} onValidSubmit={this.handleValidSubmit} ref={c => (this.form = c)}>
<FormGroup className={"FormGroup"}>
<Row>
<Col xs="12" sm="3">
{association_specific_data.name}
<Col xs={"12"} sm={"3"}>
{ association_specific_data.name }
</Col>
<Col xs="12" sm="2">
{type === 'select' ?
<Col xs={"12"} sm={"2"}>
{ type === "select" ?
(data_field.type === "Choice"
?
<AvField
type={type}
name="value"
name={"value"}
value={association_specific_data.value}
>
{choices.map((choice) => {
return <option key={uuidv4()} value={choice}>{choice}</option>
})}
{ choices.map((choice) => {
return <option key={uuidv4()} value={choice}>{ choice }</option>;
}) }
</AvField>
:
<AvField
type={type}
name="value"
name={"value"}
value={association_specific_data.value}
>
<option key={uuidv4()} value="Yes">Yes</option>
<option key={uuidv4()} value="No">No</option>
<option key={uuidv4()} value={"Yes"}>Yes</option>
<option key={uuidv4()} value={"No"}>No</option>
</AvField>
)
:
<AvField
type={type}
name="value"
name={"value"}
value={association_specific_data.value}
>
</AvField>
}
</Col>
<Col xs="12" sm="2">
<Button color="success" type="submit">Save</Button>
<Col xs={"12"} sm={"2"}>
<Button color={"success"} type={"submit"}>Save</Button>
</Col>
</Row>
</FormGroup>
......
......@@ -2,12 +2,12 @@ import "react-simple-tree-menu/dist/main.css";
import { makeStyles, useTheme } from "@material-ui/core/styles";
import React from "react";
import {loremIpsum} from "react-lorem-ipsum";
import { useGet } from "restful-react";
import CardGrid from "../../Components/Card/CardGrid";
import ContactCard from "../../Components/Card/ContactCard";
import PageContent from "../../Components/PageLayout/Content/Content";
import {loremIpsum} from "react-lorem-ipsum";
const useStyles = makeStyles(theme => ({
......
......@@ -6,6 +6,7 @@ import { Helper } from "App/Helper";
import React, { Component } from "react";
import { withRouter } from "react-router-dom";
import { Button, Col, Row } from "reactstrap";
import Block from "../../Components/PageLayout/Content/Block";
export class AssociationInfoScreen extends Component {
......
......@@ -4,11 +4,13 @@ import MomentUtils from "@date-io/moment";
import { withStyles } from "@material-ui/core";
import Button from "@material-ui/core/Button";
import Collapse from "@material-ui/core/Collapse";
import Container from "@material-ui/core/Container";
import List from "@material-ui/core/List";
import ListItem from "@material-ui/core/ListItem";
import ListItemText from "@material-ui/core/ListItemText";
import MenuItem from "@material-ui/core/MenuItem";
import { makeStyles, useTheme } from "@material-ui/core/styles";
import Typography from "@material-ui/core/Typography";
import BallotIcon from "@material-ui/icons/Ballot";
import Create from "@material-ui/icons/Create";
import EuroIcon from "@material-ui/icons/Euro";
......@@ -23,8 +25,6 @@ import { Helper } from "App/Helper";
import {padStart} from "lodash";
import moment from "moment";
import React, { Component } from "react";
import Container from "@material-ui/core/Container";
import Typography from "@material-ui/core/Typography";
import {SelectValidator, TextValidator, ValidatorForm} from "react-material-ui-form-validator";
import { withRouter } from "react-router-dom";
import { v4 as uuidv4 } from "uuid";
......
import Avatar from "@material-ui/core/Avatar";
import Container from "@material-ui/core/Container";
import List from "@material-ui/core/List";
import ListItem from "@material-ui/core/ListItem";
import makeStyles from "@material-ui/core/styles/makeStyles";
import useTheme from "@material-ui/core/styles/useTheme";
import Typography from "@material-ui/core/Typography";
......@@ -7,9 +10,7 @@ import PageContent from "App/Components/PageLayout/Content/Content";
import PropTypes from "prop-types";
import React from "react";
import {useGet} from "restful-react";
import List from "@material-ui/core/List";
import ListItem from "@material-ui/core/ListItem";
import Avatar from "@material-ui/core/Avatar";
import Info from "../../Components/Info/Info";
......@@ -66,7 +67,7 @@ const MyMatches = (props) => {
/>
</div>
</ListItem>
))}
)) }
</List>
</Block>
</Container>
......
import "react-big-calendar/lib/sass/styles.scss";
import {Typography} from "@material-ui/core";
import { BackButton } from "App/Components/BackButton";
import { Helper } from "App/Helper";
import EventModalBoard from "App/Pages/Calendar/EventModalBoard";
......@@ -10,8 +11,8 @@ import { Calendar, momentLocalizer, Views } from "react-big-calendar";
import { withRouter } from "react-router-dom";
import {Button, Col, Container, CustomInput,Label, Row} from "reactstrap";
import { v4 as uuidv4 } from "uuid";
import Block from "../../Components/PageLayout/Content/Block";
import {Typography} from "@material-ui/core";
const localizer = momentLocalizer(moment);
......
import Typography from "@material-ui/core/Typography";
import { AvCheckbox, AvFeedback, AvField, AvForm, AvGroup, AvInput, AvRadio,AvRadioGroup } from "availity-reactstrap-validation";
import { isEmpty } from "lodash";
import React, {Component} from "react";
import { AvField, AvForm, AvCheckbox, AvGroup, AvInput, AvFeedback, AvRadioGroup, AvRadio } from "availity-reactstrap-validation";
import Modal from 'react-bootstrap/Modal';
import Modal from "react-bootstrap/Modal";
import {Button, Col, Container, Row} from "reactstrap";
import Typography from '@material-ui/core/Typography';
import { isEmpty } from 'lodash';
export class EventModalMember extends Component {
......@@ -24,58 +24,58 @@ export class EventModalMember extends Component {
return (
<Modal
show={open}
size={'m'}
aria-labelledby="contained-modal-title-vcenter"
size={"m"}
aria-labelledby={"contained-modal-title-vcenter"}
centered={true}
>
<AvForm id="modal-event-form" onValidSubmit={this.handleValidSubmit} ref={c => (this.form = c)}>
<AvForm id={"modal-event-form"} onValidSubmit={this.handleValidSubmit} ref={c => (this.form = c)}>
<Modal.Header>
<Modal.Title id="contained-modal-title-vcenter">
{current_event.name}
<Modal.Title id={"contained-modal-title-vcenter"}>
{ current_event.name }
</Modal.Title>
<Typography variant={'caption'}>
{current_event.start_date.toLocaleString()} till {current_event.end_date.toLocaleString()}
<Typography variant={"caption"}>
{ current_event.start_date.toLocaleString() } till { current_event.end_date.toLocaleString() }
</Typography>
</Modal.Header>
<Modal.Body>
<p>{current_event.description}</p>
<p>{ current_event.description }</p>
<AvRadioGroup
name="enroll"
label=""
name={"enroll"}
label={""}
required
>
{current_event.enrollment_options.map((option, id)=>
{ current_event.enrollment_options.map((option, id)=>
<AvRadio
key={option+id}
label={'' + option.participation_fee + ": " + option.name}
label={"" + option.participation_fee + ": " + option.name}
value={option.url}
checked={current_enrollment.enrollment_option && option.url === current_enrollment.enrollment_option.url}
onChange={(event) => this.props.handleEnrollmentChange('enrollment_option', event.target.value)}
onChange={(event) => this.props.handleEnrollmentChange("enrollment_option", event.target.value)}
/>
)}
) }
</AvRadioGroup>
</Modal.Body>
<Modal.Footer style={{'justifyContent': 'space-between'}}>
<Modal.Footer style={{"justifyContent": "space-between"}}>
<div>
{current_event.unenrollable && enrolled &&
<Button color='primary' onClick={()=>{this.props.handleEventUnenroll()}}>Unenroll</Button>
{ current_event.unenrollable && enrolled &&
<Button color={"primary"} onClick={()=>{this.props.handleEventUnenroll();}}>Unenroll</Button>
}
</div>
<div>
{enrolled
{ enrolled
? (current_event.enrollable &&
<Button color='primary' type="submit">Save</Button>
<Button color={"primary"} type={"submit"}>Save</Button>
)
: (current_event.enrollable &&
<Button color='primary' type="submit">Enroll</Button>
<Button color={"primary"} type={"submit"}>Enroll</Button>
)
}
&nbsp;
<Button onClick={()=>{this.props.cancelModal()}}>{current_event.enrollable ? 'Cancel' : 'Close'}</Button>
<Button onClick={()=>{this.props.cancelModal();}}>{ current_event.enrollable ? "Cancel" : "Close" }</Button>
</div>
</Modal.Footer>
</AvForm>
</Modal>
)
);
}
}
\ No newline at end of file
import {Typography} from "@material-ui/core";
import Button from "@material-ui/core/Button";
import Divider from "@material-ui/core/Divider";
import makeStyles from "@material-ui/core/styles/makeStyles";
import ContactsIcon from "@material-ui/icons/Contacts";
import CollapsableList from "App/Components/Lists/CollapsableList";
import ConfirmationModal from "App/Components/Modals/ConfirmationModal";
import { useAlertHandler } from "App/Contexts/AlertHandler";
import { Helper } from "App/Helper";
import PropTypes from "prop-types";