Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Officers to Add a LinkedIn Link to Profile #270

Open
wants to merge 5 commits into
base: devlop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions app/js/common/components/UserForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class UserForm extends Component {
<ModalBody>
<fieldset className="form-group">
<div className="form-group row">
<label htmlFor="dce" className="col-3 col-form-label">RIT Username</label>
<div className="col-9">
<label htmlFor="dce" className="col-4 col-form-label">RIT Username</label>
<div className="col-8">
<input
type="text"
name="dce"
Expand All @@ -123,8 +123,8 @@ class UserForm extends Component {
</div>
</div>
<div className="form-group row">
<label htmlFor="firstName" className="col-3 col-form-label">First Name</label>
<div className="col-9">
<label htmlFor="firstName" className="col-4 col-form-label">First Name</label>
<div className="col-8">
<input
type="text"
name="firstName"
Expand All @@ -140,8 +140,8 @@ class UserForm extends Component {
</div>
</div>
<div className="form-group row">
<label htmlFor="lastName" className="col-3 col-form-label">Last Name</label>
<div className="col-9">
<label htmlFor="lastName" className="col-4 col-form-label">Last Name</label>
<div className="col-8">
<input
type="text"
name="lastName"
Expand All @@ -157,8 +157,8 @@ class UserForm extends Component {
</div>
</div>
<div className="form-group row">
<label htmlFor="image" className="col-3 col-form-label">Image</label>
<div className="col-9">
<label htmlFor="image" className="col-4 col-form-label">Image</label>
<div className="col-8">
<input
type="text"
name="image"
Expand Down
7 changes: 0 additions & 7 deletions app/js/gtv/Page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import TorqueSlides, { TorqueSlide } from 'torque-react';
import { getEvents } from 'events/actions';
import ColorView from 'gtv/components/ColorView';
import EventPanels from 'gtv/containers/EventPanels';
import EventHighlight from 'gtv/containers/EventHighlight';
import ThreeWeek from 'gtv/containers/ThreeWeek';
Expand Down Expand Up @@ -54,15 +53,9 @@ class GTV extends Component {
<TorqueSlide>
<EventPanels />
</TorqueSlide>
<TorqueSlide duration={5}>
<ColorView color="white" />
</TorqueSlide>
<TorqueSlide>
<ThreeWeek />
</TorqueSlide>
<TorqueSlide duration={5}>
<ColorView color="black" />
</TorqueSlide>
</TorqueSlides>
</div>
);
Expand Down
17 changes: 0 additions & 17 deletions app/js/gtv/components/ColorView.jsx

This file was deleted.

10 changes: 9 additions & 1 deletion app/js/officers/components/Officer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class Officer extends Component {
static propTypes = {
title: PropTypes.string.isRequired,
email: PropTypes.string.isRequired,
linkedinUrl: PropTypes.string,
user: PropTypes.shape({
firstName: PropTypes.string,
lastname: PropTypes.string,
Expand Down Expand Up @@ -44,6 +45,7 @@ class Officer extends Component {
title,
user,
email,
linkedinUrl,
editItem,
deleteItem,
showActions,
Expand All @@ -54,7 +56,13 @@ class Officer extends Component {
return (
<SwipeArea onLeft={this.showActions} onRight={this.hideActions} className="actions-container-fade col-sm-6 col-lg-3 pb-3">
<div className="media">
<img className="mr-3" src={gravatar(dce, image)} alt="Officer" height={80} />
{linkedinUrl ? (
<a href={linkedinUrl} target="_blank" rel="noopener noreferrer">
<img className="mr-3" src={gravatar(dce, image)} alt="Officer" height={80} />
</a>
) : (
<img className="mr-3" src={gravatar(dce, image)} alt="Officer" height={80} />
)}
<div className="d-flex align-self-center flex-column media-body">
<h5 className="mb-0">{title}</h5>
<p className="m-0">
Expand Down
41 changes: 31 additions & 10 deletions app/js/officers/components/OfficerForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class OfficerForm extends Component {
primaryOfficer: PropTypes.bool,
startDate: PropTypes.string,
endDate: PropTypes.string,
linkedinUrl: PropTypes.string,
user: PropTypes.shape({
firstName: PropTypes.string,
lastName: PropTypes.string,
Expand Down Expand Up @@ -72,6 +73,7 @@ class OfficerForm extends Component {
primaryOfficer: !!officer.primaryOfficer,
startDate: officer.startDate ? moment(officer.startDate).format(dayFormat) : '',
endDate: officer.endDate ? moment(officer.endDate).format(dayFormat) : '',
linkedinUrl: officer.linkedinUrl || null,
}}
validationSchema={yup.object()
.shape({
Expand All @@ -95,6 +97,7 @@ class OfficerForm extends Component {
// value to '' for formik to use it as a controlled component, the 'isAfter'
// validation will be active, effectively requiring a value. We need to figure
// out how to have yup validate a field only if the field isn't empty (something other than '').
linkedinUrl: yup.string().url('Must be a URL.').nullable(),
})}
onSubmit={(
values
Expand All @@ -106,6 +109,7 @@ class OfficerForm extends Component {
primaryOfficer: values.primaryOfficer,
startDate: moment(values.startDate).toISOString(),
endDate: values.endDate ? moment(values.endDate).toISOString() : null,
linkedinUrl: values.linkedinUrl,
user: {
firstName: values.firstName,
lastName: values.lastName,
Expand Down Expand Up @@ -134,8 +138,8 @@ class OfficerForm extends Component {
}) => (
<fieldset className="form-group">
<div className="form-group row">
<label htmlFor="title" className="col-3 col-form-label">Title</label>
<div className="col-9">
<label htmlFor="title" className="col-4 col-form-label">Title</label>
<div className="col-8">
<input
type="text"
name="title"
Expand All @@ -152,8 +156,8 @@ class OfficerForm extends Component {
</div>
</div>
<div className="form-group row">
<label htmlFor="email" className="col-3 col-form-label">Email Alias</label>
<InputGroup className="col-9">
<label htmlFor="email" className="col-4 col-form-label">Email Alias</label>
<InputGroup className="col-8">
<input
type="text"
name="email"
Expand All @@ -173,8 +177,8 @@ class OfficerForm extends Component {
</InputGroup>
</div>
<div className="form-group row">
<label htmlFor="committeeName" className="col-3 col-form-label">Committee</label>
<div className="col-9">
<label htmlFor="committeeName" className="col-4 col-form-label">Committee</label>
<div className="col-8">
<FormikSelectInput
name="committeeName"
id="committeeName"
Expand Down Expand Up @@ -221,8 +225,8 @@ class OfficerForm extends Component {
</div>
</div>
<div className="form-group row">
<label htmlFor="startDate" className="col-3 col-form-label">Start Date</label>
<div className="col-9">
<label htmlFor="startDate" className="col-4 col-form-label">Start Date</label>
<div className="col-8">
{/* TODO: Update to use a cross-browser date picker */}
<input
type="date"
Expand All @@ -240,8 +244,8 @@ class OfficerForm extends Component {
</div>
</div>
<div className="form-group row">
<label htmlFor="endDate" className="col-3 col-form-label">End Date</label>
<div className="col-9">
<label htmlFor="endDate" className="col-4 col-form-label">End Date</label>
<div className="col-8">
{/* TODO: Update to use a cross-browser date picker */}
<input
type="date"
Expand All @@ -257,6 +261,23 @@ class OfficerForm extends Component {
&& <FormFeedback style={{ display: 'block' }}>{errors.endDate}</FormFeedback>}
</div>
</div>
<div className="form-group row">
<label htmlFor="linkedinUrl" className="col-4 col-form-label">LinkedIn URL</label>
<div className="col-8">
<input
type="text"
name="linkedinUrl"
id="linkedinUrl"
className="form-control"
onChange={handleChange}
onBlur={handleBlur}
value={values.linkedinUrl}
/>
{touched.linkedinUrl
&& errors.linkedinUrl
&& <FormFeedback style={{ display: 'block' }}>{errors.linkedinUrl}</FormFeedback>}
</div>
</div>
</fieldset>
)}
renderFooter={({
Expand Down
16 changes: 8 additions & 8 deletions app/js/scoreboard/components/AddMembershipModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ class AddMembershipModal extends Component {
}) => (
<fieldset className="form-group">
<div className="form-group row">
<label htmlFor="startDate" className="col-3 col-form-label">Start Date</label>
<div className="col-9">
<label htmlFor="startDate" className="col-4 col-form-label">Start Date</label>
<div className="col-8">
{/* TODO: Update to use a cross-browser date picker */}
<input
type="date"
Expand All @@ -104,8 +104,8 @@ class AddMembershipModal extends Component {
</div>
</div>
<div className="form-group row">
<label htmlFor="endDate" className="col-3 col-form-label">End Date</label>
<div className="col-9">
<label htmlFor="endDate" className="col-4 col-form-label">End Date</label>
<div className="col-8">
{/* TODO: Update to use a cross-browser date picker */}
<input
type="date"
Expand All @@ -123,8 +123,8 @@ class AddMembershipModal extends Component {
</div>
</div>
<div className="form-group row">
<label htmlFor="reason" className="col-3 col-form-label">Reason</label>
<div className="col-9">
<label htmlFor="reason" className="col-4 col-form-label">Reason</label>
<div className="col-8">
<textarea
name="reason"
id="reason"
Expand All @@ -141,8 +141,8 @@ class AddMembershipModal extends Component {
</div>
</div>
<div className="form-group row">
<label htmlFor="committeeName" className="col-3 col-form-label">Committee</label>
<div className="col-9">
<label htmlFor="committeeName" className="col-4 col-form-label">Committee</label>
<div className="col-8">
<select
name="committeeName"
id="committeeName"
Expand Down
Loading