Skip to content

Commit

Permalink
Merge branch 'dev-version-1' of https://github.com/Five-Fishes/Club-M…
Browse files Browse the repository at this point in the history
…anagement-React-Client into event-attendee

� Conflicts:
�	src/main/webapp/app/shared/model/event-attendee.model.ts
  • Loading branch information
CarlosSia committed Apr 14, 2021
2 parents 91ad3f6 + ed8525b commit a276562
Show file tree
Hide file tree
Showing 58 changed files with 1,466 additions and 601 deletions.
34 changes: 27 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@fortawesome/free-solid-svg-icons": "5.8.1",
"@fortawesome/react-fontawesome": "0.1.4",
"availity-reactstrap-validation": "2.5.1",
"axios": "0.19.0",
"axios": "0.21.1",
"bootstrap": "4.3.1",
"bootswatch": "4.3.1",
"firebase": "^8.2.9",
Expand Down
4 changes: 3 additions & 1 deletion src/main/webapp/app/_bootstrap-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ $theme-colors: (
'secondary': #068ab4,
'tertiary': #154b67,
'action': #1db2a1,
'cancel': #dd5959
'cancel': #dd5959,
'expense': #c21717,
'income': #0e516d
);
5 changes: 0 additions & 5 deletions src/main/webapp/app/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,6 @@ http://stackoverflow.com/questions/23436430/bootstrap-3-input-group-100-width */
margin-top: -0.5rem;
}

.form-control {
border: 1px solid #07ade1;
padding: 17px;
}

/* jhipster-needle-scss-add-main JHipster will add new css style */

/*
Expand Down
6 changes: 5 additions & 1 deletion src/main/webapp/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import { AUTHORITIES } from 'app/config/constants';
import AppRoutes from 'app/routes';
import { fetchAccount } from './shared/services/auth.service';

import Frame from 'app/entities/event-crew/frame';

const baseHref = document
.querySelector('base')
.getAttribute('href')
Expand Down Expand Up @@ -51,7 +53,9 @@ export class App extends React.Component<IAppProps> {

<div className="flex-grow-1">
<ErrorBoundary>
<AppRoutes />
<Container>
<AppRoutes />
</Container>
</ErrorBoundary>
</div>

Expand Down
5 changes: 5 additions & 0 deletions src/main/webapp/app/config/icon-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ import { faFacebookF } from '@fortawesome/free-brands-svg-icons/faFacebookF';
import { faGoogle } from '@fortawesome/free-brands-svg-icons/faGoogle';
import { faEllipsisV } from '@fortawesome/free-solid-svg-icons/faEllipsisV';
import { faEllipsisH } from '@fortawesome/free-solid-svg-icons/faEllipsisH';
import { faCar } from '@fortawesome/free-solid-svg-icons/faCar';
import { faWhatsappSquare } from '@fortawesome/free-brands-svg-icons/faWhatsappSquare';

import { library } from '@fortawesome/fontawesome-svg-core';
import { faCar } from '@fortawesome/free-solid-svg-icons/faCar';
import { faWhatsappSquare } from '@fortawesome/free-brands-svg-icons/faWhatsappSquare';
Expand Down Expand Up @@ -84,6 +87,8 @@ export const loadIcons = () => {
faGoogle,
faEllipsisV,
faEllipsisH,
faCar,
faWhatsappSquare,
faCalendarAlt,
faClock,
faMapMarkerAlt,
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/app/config/notification-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default () => next => action => {
break;

case 404:
addErrorAlert('Not found', 'error.url.not.found');
addErrorAlert('Not found', 'error.urlNotFound');
break;

default:
Expand Down
164 changes: 164 additions & 0 deletions src/main/webapp/app/entities/budget/budget-create.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
import React from 'react';
import { connect } from 'react-redux';
import { Link, RouteComponentProps } from 'react-router-dom';
import { Button, Row, Col, Label } from 'reactstrap';
import { AvForm, AvGroup, AvInput, AvField } from 'availity-reactstrap-validation';
import { Translate, translate } from 'react-jhipster';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { IRootState } from 'app/shared/reducers';
import '../../styles/event-module.scss';

import { createEntity, reset } from './budget.reducer';

export interface IBudgetCreateProps extends StateProps, DispatchProps, RouteComponentProps<{ id: string; eventId: string }> {}

export class EventBudgetCreate extends React.Component<IBudgetCreateProps> {
constructor(props) {
super(props);
}

componentWillUpdate(nextProps, nextState) {
if (nextProps.updateSuccess !== this.props.updateSuccess && nextProps.updateSuccess) {
this.handleClose();
}
}

componentDidMount() {
this.props.reset();
}

saveEntity = (event, errors, values) => {
if (errors.length === 0) {
const { budgetEntity } = this.props;
const entity = {
...budgetEntity,
...values
};

this.props.createEntity(entity);
}
};

handleClose = () => {
this.props.history.push(`/entity/event-budget/event/${this.props.match.params.eventId}`);
};

render() {
const { loading, updating, errorMessage } = this.props;
const { eventId } = this.props.match.params;

return (
<div>
<Row className="justify-content-center">
<Col md="8">
<h2 id="clubmanagementApp.eventBudget.home.createLabel" className="event-module-heading">
<Translate contentKey="clubmanagementApp.eventBudget.home.createLabel">Create Event Budget</Translate>
</h2>
</Col>
</Row>
<Row className="justify-content-center">
<Col md="8">
{loading ? (
<p>Loading...</p>
) : (
<AvForm model={{}} onSubmit={this.saveEntity}>
<AvField hidden id="budget-eventId" type="string" className="form-control" name="eventId" value={eventId} />

<AvGroup>
<Label id="amountLabel" for="budget-amount">
<Translate contentKey="clubmanagementApp.eventBudget.amount">Amount</Translate>
</Label>
<AvField
id="budget-amount"
type="number"
name="amount"
validate={{
required: { value: true, errorMessage: 'Please enter an amount for this budget' },
min: { value: 0, errorMessage: 'Amount cannot be less than 0' },
pattern: { value: '^([0-9]*.?[0-9]{1,2})$', errorMessage: 'Please enter a valid amount with max of 2 decimal values' }
}}
/>
</AvGroup>
<AvGroup>
<Label id="nameLabel" for="budget-name">
<Translate contentKey="clubmanagementApp.eventBudget.name">Name</Translate>
</Label>
<AvField
id="budget-name"
type="text"
name="name"
required
validate={{
required: { value: true, errorMessage: 'Please enter a name for this budget' },
maxLength: { value: 100, errorMessage: 'Name cannot be more than 100 characters' }
}}
/>
</AvGroup>
<AvGroup>
<Label id="typeLabel" for="budget-type">
<Translate contentKey="clubmanagementApp.eventBudget.type">Type</Translate>
</Label>
<AvInput id="budget-type" type="select" className="form-control" name="type">
<option value="" selected disabled>
{translate('global.select.selectOne')}
</option>
<option value="INCOME">{translate('clubmanagementApp.TransactionType.INCOME')}</option>
<option value="EXPENSE">{translate('clubmanagementApp.TransactionType.EXPENSE')}</option>
</AvInput>
</AvGroup>
<AvGroup>
<Label id="detailsLabel" for="budget-details">
<Translate contentKey="clubmanagementApp.eventBudget.details">Details</Translate>
</Label>
<AvInput
id="budget-details"
type="textarea"
name="details"
validate={{
maxLength: { value: 200, errorMessage: 'Details cannot be more than 200 characters' }
}}
/>
</AvGroup>
<span className="text-error">{errorMessage ? errorMessage.response.data.detail : ''}</span>
<div className="text-center mx-4 d-flex justify-content-between justify-content-md-center mb-2">
<Button tag={Link} id="cancel-save" to={`/entity/event-budget/event/${eventId}`} replace color="cancel">
<FontAwesomeIcon icon="arrow-left" />
&nbsp;
<Translate contentKey="entity.action.cancel">Cancel</Translate>
</Button>
&nbsp;
<Button color="action" id="save-entity" type="submit" disabled={updating}>
<FontAwesomeIcon icon="save" />
&nbsp;
<Translate contentKey="entity.action.create">Create</Translate>
</Button>
</div>
</AvForm>
)}
</Col>
</Row>
</div>
);
}
}

const mapStateToProps = (storeState: IRootState) => ({
budgetEntity: storeState.budget.entity,
loading: storeState.budget.loading,
updating: storeState.budget.updating,
updateSuccess: storeState.budget.updateSuccess,
errorMessage: storeState.budget.errorMessage
});

const mapDispatchToProps = {
createEntity,
reset
};

type StateProps = ReturnType<typeof mapStateToProps>;
type DispatchProps = typeof mapDispatchToProps;

export default connect(
mapStateToProps,
mapDispatchToProps
)(EventBudgetCreate);
13 changes: 6 additions & 7 deletions src/main/webapp/app/entities/budget/budget-delete-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@ import React from 'react';
import { connect } from 'react-redux';
import { RouteComponentProps } from 'react-router-dom';
import { Modal, ModalHeader, ModalBody, ModalFooter, Button } from 'reactstrap';
import { Translate, ICrudGetAction, ICrudDeleteAction } from 'react-jhipster';
import { Translate } from 'react-jhipster';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

import { IBudget } from 'app/shared/model/budget.model';
import { IRootState } from 'app/shared/reducers';
import { getEntity, deleteEntity } from './budget.reducer';

export interface IBudgetDeleteDialogProps extends StateProps, DispatchProps, RouteComponentProps<{ id: string }> {}
export interface IBudgetDeleteDialogProps extends StateProps, DispatchProps, RouteComponentProps<{ id: string; eventId: string }> {}

export class BudgetDeleteDialog extends React.Component<IBudgetDeleteDialogProps> {
componentDidMount() {
this.props.getEntity(this.props.match.params.id);
this.props.getEntity(this.props.match.params.id, this.props.match.params.eventId);
}

confirmDelete = event => {
this.props.deleteEntity(this.props.budgetEntity.id);
this.props.deleteEntity(this.props.budgetEntity.id, this.props.budgetEntity.eventId);
this.handleClose(event);
};

Expand All @@ -33,8 +32,8 @@ export class BudgetDeleteDialog extends React.Component<IBudgetDeleteDialogProps
<ModalHeader toggle={this.handleClose}>
<Translate contentKey="entity.delete.title">Confirm delete operation</Translate>
</ModalHeader>
<ModalBody id="clubmanagementApp.budget.delete.question">
<Translate contentKey="clubmanagementApp.budget.delete.question" interpolate={{ id: budgetEntity.id }}>
<ModalBody id="clubmanagementApp.eventBudget.delete.question">
<Translate contentKey="clubmanagementApp.eventBudget.delete.question" interpolate={{ id: budgetEntity.id }}>
Are you sure you want to delete this Budget?
</Translate>
</ModalBody>
Expand Down
Loading

0 comments on commit a276562

Please sign in to comment.