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

tt-dev #111

Merged
merged 17 commits into from
Mar 9, 2021
Merged
Show file tree
Hide file tree
Changes from 12 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
Binary file modified client/public/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions client/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Team Formation",
"name": "HackGT Team Formation App",
"icons": [
{
"src": "favicon.ico",
Expand Down
1 change: 1 addition & 0 deletions client/public/starsHome.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion client/src/components/Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Content extends Component {
console.log(this.state.loggedIn)
return (<div className="Content-container">
<Switch>
<Route exact="exact" path="/login">
<Route exact path="/login">
<Login/>
</Route>
<ProtectedRoute loggedIn={this.state.loggedIn} exact="exact" path={["/", "/feed"]} visible={this.state.data.visible} header={HeaderFeed} component={Feed}/>
Expand Down
23 changes: 17 additions & 6 deletions client/src/components/EditProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ import environment from './Environment';
import skills from '../constants/skills';
import years from '../constants/years';
import schools from '../constants/schools';
import tracks from '../constants/tracks';
import Filter from 'bad-words'

const mutation = graphql `
mutation EditProfileMutation($name: String, $grad_year: String, $school: String, $skills: [String], $experience: String, $contact: String, $contact_method: String, $visible: Int) {
update_user(name: $name, grad_year: $grad_year, school: $school, skills: $skills, experience: $experience, contact: $contact, contact_method: $contact_method, visible: $visible) {
mutation EditProfileMutation($name: String, $grad_year: String, $school: String, $skills: [String], $track: String $experience: String, $contact: String, $contact_method: String, $visible: Int) {
update_user(name: $name, grad_year: $grad_year, school: $school, skills: $skills, track: $track, experience: $experience, contact: $contact, contact_method: $contact_method, visible: $visible) {
name
grad_year
school
track
skills
experience
contact
Expand All @@ -50,6 +52,7 @@ query EditProfileQuery {
grad_year
contact
skills
track
experience
contact_method
slackid
Expand All @@ -67,6 +70,7 @@ class EditProfile extends Component {
name: "",
school: "",
grad_year: "",
track: "",
skills: [],
experience: "",
public: true,
Expand Down Expand Up @@ -119,8 +123,6 @@ class EditProfile extends Component {
return <div>{error.message}</div>;
} else if (props) {
props = props.user_profile;
console.log(props)
console.log(years)
if (!this.state.name && props.name) {
this.setState({
...props
Expand All @@ -138,6 +140,9 @@ class EditProfile extends Component {
required="required"/>
<Form.Select className="input-container-small" required="required" label='Year in School' defaultValue={props.grad_year} onChange={this.onYearChange} options={years} placeholder='Year in School'/>
</Form.Group>
<Form.Group>
<Form.Select className="input-container-large" label='Track' defaultValue={props.track} onChange={this.onChange("track")} options={tracks}/>
</Form.Group>
<Form.Group>
<Form.Select className="input-container-large" label="Skills" placeholder='Skills' defaultValue={props.skills} onChange={this.onSkillsChange} fluid="fluid" multiple="multiple" selection="selection" search="search" options={skills}/>
</Form.Group>
Expand All @@ -146,7 +151,7 @@ class EditProfile extends Component {
</Form.Group>
<Form.Group>
<div className="editCheckbox">
<Checkbox label='Make my profile public' onChange={this.onPrivacyChange} checked={(this.state.visible == 1)}/>
<Checkbox label='Make my profile public' onChange={this.onPrivacyChange} checked={(this.state.visible === 1)}/>
</div>
</Form.Group>
<div className="button-container">
Expand Down Expand Up @@ -199,7 +204,12 @@ class EditProfile extends Component {

onYearChange = (e, {value}) => {
this.setState({grad_year: value})
}
};

// Generic state handler, as long as values are reachable at top level
onChange = (state) => (e, {value}) => {
this.setState({[state]: value});
};

onSchoolChange = (e, { value }) => {
this.setState({school: value});
Expand Down Expand Up @@ -259,6 +269,7 @@ class EditProfile extends Component {
school: this.state.school,
contact: this.state.contact,
skills: this.state.skills,
track: this.state.track,
experience: this.state.experience,
contact_method: this.state.contact_method,
visible: this.state.visible
Expand Down
7 changes: 6 additions & 1 deletion client/src/components/Feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Feed extends Component {
skills: [],
years: [],
schools: [],
tracks: [],
teams: false,
showSecondModal: false,
};
Expand All @@ -35,6 +36,7 @@ class Feed extends Component {
skill={this.state.skills}
grad_year={this.state.years}
school={this.state.schools}
track={this.state.tracks}
user_id={this.props.user_id}
/>
);
Expand Down Expand Up @@ -81,7 +83,8 @@ class Feed extends Component {
</div>
{this.state.skills.length ||
this.state.years.length ||
this.state.schools.length ? (
this.state.schools.length ||
this.state.tracks.length ? (
<div className="user-input">
<div className="filters-applied">
<text>Filters Applied</text>
Expand All @@ -91,6 +94,7 @@ class Feed extends Component {
skills={this.state.skills}
years={this.state.years}
schools={this.state.schools}
tracks={this.state.tracks}
allFilterClickListener={this.allFilterClickListener}
/>
</div>
Expand Down Expand Up @@ -130,6 +134,7 @@ class Feed extends Component {
teams: false,
searchTerm: "",
skills: [],
tracks: [],
years: [],
schools: [],
});
Expand Down
10 changes: 7 additions & 3 deletions client/src/components/FeedCards.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import environment from './Environment';
import {Redirect} from 'react-router-dom';

const getUsersQuery = graphql `
query FeedCardsQuery($skill: String, $grad_year: String, $school: String, $search: String) {
users(skill:$skill, grad_year:$grad_year, school:$school, search:$search) {
query FeedCardsQuery($skill: String, $grad_year: String, $school: String, $search: String, $track: String) {
users(skill:$skill, grad_year:$grad_year, school:$school, search:$search, track:$track) {
name
email
school
grad_year
contact
skills
track
experience
visible
uuid
Expand All @@ -38,11 +39,13 @@ class FeedCards extends Component {
console.log(`skills: ${this.props.skill}`);
let grad_year = this.props.grad_year.join(',');
let school = this.props.school.join(',');
let track = this.props.track.join(',');
return (<QueryRenderer environment={environment} query={getUsersQuery} variables={{
search: search,
skill: skill,
grad_year: grad_year,
school: school
school: school,
track: track
}} render={({error, props}) => {
if (error) {
// return <div>{error.message}</div>;
Expand All @@ -60,6 +63,7 @@ class FeedCards extends Component {
experience={user.experience}
id={user.id}
team={props.user_profile.team}
track={user.track}
slackid={user.slackid}
/>
})
Expand Down
8 changes: 8 additions & 0 deletions client/src/components/InputTagCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ const InputTagCollection = props => {
</div>)
}

for (const track of props.tracks) {
elements.push(
<div>
<Label data-name={track} horizontal content={track} removeIcon='delete' onRemove={(e, data) => props.allFilterClickListener(data['data-name'], "tracks")}/>
</div>
)
}

return (<div id="chosen-tags">
{elements}
</div>);
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Login extends Component {

<div class="txt1 text-center p-t-54 p-b-20">
<span>
This portal is only available to participants who are confirmed for HackGT 7! Please contact [email protected] if you encounter any issues
This portal is only available to participants who are confirmed for HealthTech! Please contact [email protected] if you encounter any issues
</span>
</div>
</form>
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/NotificationGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class NotificationGroup extends Component {
console.log(props.notifications);
var user = this.props.user_id;
var notifications = props.notifications;
var colors = ["#A8C5D6", "#CCBEDF"];
var colors = ["#68B6E5", "#A562A6"];
var count = 0;
var notificationCards = notifications.map((notif) => {
console.log("SENDERR: ", notif.sender)
Expand Down Expand Up @@ -82,9 +82,9 @@ class NotificationGroup extends Component {
borderRightWidth: 0,
borderLeftWidth: 0,
marginLeft: 0,
paddingLeft: 0,
paddingLeft: (notificationCards.length > 0) ? 0 : "10px",
paddingRight: 0,
color: "#A8C5D6"
color: "#A562A6"
}}
>
{notificationMessage}
Expand Down
25 changes: 25 additions & 0 deletions client/src/components/SideMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "./css/SideMenu.css";
import skills from "../constants/skills";
import schools from "../constants/schools";
import years from "../constants/years";
import tracks from "../constants/tracks";

import SideMenuPicture from "./css/assets/SideMenuPicture.svg";

Expand Down Expand Up @@ -53,6 +54,18 @@ class SideMenu extends Component {
});
}

const trackOptions = [];
for (const track in tracks) {
const curr = tracks[track].value;
trackOptions.push({
key: curr,
text: curr,
value: curr,
onClick: (e, { value }) =>
this.props.allFilterClickListener(value, "tracks"),
})
}

if (this.props.onTeamPage) {
return (
<div className="SideMenu-container">
Expand Down Expand Up @@ -138,6 +151,18 @@ class SideMenu extends Component {
scrolling="scrolling"
closeOnChange="false"
/>
<h3 className="h3">TRACKS</h3>
<Dropdown
className="filter-box"
item="item"
text="Select Tracks"
search="search"
selection
options={trackOptions}
fullTextSearch
scrolling
closeOnChange={false}
/>
{/* <img class="moveImage" src={SideMenuPicture} alt="React Logo" /> */}
</div>
);
Expand Down
9 changes: 1 addition & 8 deletions client/src/components/TeamCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,10 @@ class TeamCard extends Component {
// on='click'
// hideOnScroll
// />
var colors = [
'violet',
'yellow',
'orange'
]
var count = 0;
var skill;
// var viewskill;
let link = "/team/" + this.props.id;
var colors = ["#A0CCC9", "#EBABCA"];
var count = 0;
var colors = ["#68B6E5", "#EB9922"];
var viewskill = this.props.interests.map((skill) => (
<Label
size="mini"
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/TeamInformation.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class TeamInformation extends Component {
}
render() {
console.log(this.state.interest_options)
var colors = ["#A0CCC9", "#EBABCA"];
var colors = ["#68B6E5", "#EB9922"];
var count = 0;
var interestLabels = this.state.interests.map((interest) => (
<Label
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/TeamNotifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class TeamNotifications extends Component {
} else if (props) {
console.log(JSON.stringify(props));
var notifications = props.team_notifications;
var colors = ["#A8C5D6", "#CCBEDF"];
var colors = ["#68B6E5", "#A562A6"];
var count = 0;
var notificationCards = notifications.map((notif) => {
return (
Expand Down
5 changes: 4 additions & 1 deletion client/src/components/UserCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class UserCard extends Component {
/>
);
}
var colors = ["#A0CCC9", "#EBABCA"];
var colors = ["#68B6E5", "#EB9922"];
var count = 0;
var viewskill = this.props.skills.map((skill) => (
<Label
Expand Down Expand Up @@ -66,6 +66,9 @@ class UserCard extends Component {
<Card.Meta className="gradYear">
Graduation Year: {this.props.grad_year}
</Card.Meta>
<Card.Meta>
Track: {(this.props.track) ? this.props.track : 'None'}
</Card.Meta>
<div
className="ui divider"
style={{
Expand Down
Loading