freeCodeCamp / league-for-good

An open source sports league management tool
BSD 3-Clause "New" or "Revised" License
163 stars 106 forks source link

Button and Dashboard is no longer working #108

Closed paulywill closed 6 years ago

paulywill commented 6 years ago

Need some confirmation... but I have tried to generate a new clone from the repo and the dashboard does not appear to be working for any of the buttons.

Is anyone else having this issue with a fresh copy?

paulywill commented 6 years ago

@makkoli : is there any reason some of the buttons on the dashboard would stop working?

paulywill commented 6 years ago

image

Issue confirmed on Slack channel.

paulywill commented 6 years ago

I'm trying to test if the issue is because of the depreciation of material-ui and reference @material-ui/core instead in CreateLeagueSelector.jsx

ie.

import React from 'react';
import PropTypes from 'prop-types';
import {
    Card,
    CardActions,
    CardTitle
} from '@material-ui/core/Card';
import CreateLeagueButton from './CreateLeagueButton.jsx';

import { sports } from '../sports.js';
import { cssCreateLeague } from '../styles';

// Creates a list of different buttons for selecting
// a sport type for the new league
// Once a sport type is selected, the proper form will be rendered
const CreateLeagueSelector = ({onSelect, selectedSport})=> (
    <Card style={cssCreateLeague.card.style}>
        <CardTitle
            subtitle='Choose a sport'
            subtitleColor={cssCreateLeague.card.title.subtitleColor}
            title='Create a New League'
            titleColor={cssCreateLeague.card.title.titleColor}
        />
        <CardActions>
            {sports.map((sport, i) => {
                return (
                    <CreateLeagueButton
                        active={selectedSport === sport.name}
                        icon={sport.icon}
                        key={i}
                        label={sport.name}
                        onClick={onSelect}
                    />
                );
            })
        }
        </CardActions>
    </Card>
);

CreateLeagueSelector.propTypes = {
    onSelect: PropTypes.func,
    selectedSport: PropTypes.string
};

export default CreateLeagueSelector;

However the Eslint in my Atom is picking up the following:

Error ESLint Unable to resolve path to module '@material-ui/core/Card'. (import/no-unresolved) 7:8

Even though I added and updated the package.json @material-ui is still not being added to the webpack.

paulywill commented 6 years ago

After studying the history of TravisCI builds I git checkout 74a6fb9 which was the last successful build.

The dashboard appears to functional at this point.

Some of the recent commits will have have to be checked as to which causing the issue.

paulywill commented 6 years ago

@ahstein3521 : what were the features you were implementing in b1982a2?

paulywill commented 6 years ago

Commit for master: 8916011 appears to compile correctly as well.

lieberscott commented 6 years ago

I figured it out. The onTouchTap event has been deprecated from material-ui and needed to be replaced with onClick in the CreateLeagueButton.jsx file it should work now, I submitted a pull request [https://github.com/freeCodeCamp/league-for-good/pull/109]

paulywill commented 6 years ago

@lieberscott Can you check the other views/panels?

ie the Games list icon is not working, but the Teams roaster list icon is for mine.

lieberscott commented 6 years ago

@paulywill Ahh, yes, same here. It seems there are onTouchTap handlers throughout the code. I'm making my way through to replace them all with onClick. I believe the games icon you referenced is here ...

client > src > components > dashboard > seasons > seasons_list > seasonLink.jsx

changing onTouchTap to onClick should work there. Let me know. Meanwhile I'll make a new PR when I think I've replaced all the onTouchTap's

lieberscott commented 6 years ago

I just updated the PR, I think I got them all working

paulywill commented 6 years ago

@lieberscott, nice! There may be a few more.

The delete button under games doesn't appear to work. image

Nor the back button when editing a game.

image

This is where some more TDD and tests would catch these ones.