PWNAGERobotics / ScoutingPASS

A FRC Competition Scouting Application
https://pwnagerobotics.github.io/ScoutingPASS/
63 stars 469 forks source link

Updating config does nothing #34

Closed markzakharyan closed 2 years ago

markzakharyan commented 2 years ago

Hi, after updating the config json for 2022, the changes that I made aren't propagating. I've checked to make sure that I've updated the right file, of course.

I'm updating /2022/RR_config.js

Is there anything that I'm doing wrong? I've checked to make sure that the json is valid, and no errors are being thrown. The app just looks the same as before.

Thanks for the help, Team 6560, Charging Champions

This is the updated file:

var config_data = `
{
    "title": "Scouting PASS 2022",
    "page_title": "Rapid React",
    "elements": {
        "prematch": {
            "Scouter Initials": {
                "code": "s",
                "type": "scouter",
                "size": 5,
                "maxSize": 5,
                "required": "true"
            },
            "Event": {
                "code": "e",
                "type": "event",
                "defaultValue": "2022flwp",
                "required": "true",
                "disabled": "true"
            },
            "Match Level": {
                "code": "l",
                "type": "level",
                "choices": {
                    "qm": "Quals<br>",
                    "ef": "Eighth-Final<br>",
                    "qf": "Quarter-Final<br>",
                    "sf": "Semi-Final<br>",
                    "f": "Final"
                },
                "defaultValue": "qm",
                "required": "true"
            },
            "Match #": {
                "code": "m",
                "type": "match",
                "min": 1,
                "max": 100,
                "required": "true"
            },
            "Robot": {
                "code": "r",
                "type": "robot",
                "choices": {
                    "r1": "Red-1",
                    "b1": "Blue-1<br>",
                    "r2": "Red-2",
                    "b2": "Blue-2<br>",
                    "r3": "Red-3",
                    "b3": "Blue-3"
                },
                "required": "true"
            },
            "Team #": {
                "code": "t",
                "type": "team",
                "min": 1,
                "max": 99999
            },
            "Auto Start Position": {
                "code": "as",
                "title": "Auto Start Position",
                "type": "field_image",
                "required": "false",
                "filename": "2022/field_image.png"
            }
        },
        "auton": {
            "Taxi": {
                "code": "at",
                "title": "Taxied?",
                "type": "bool"
            },
            "Upper Cargo Scored": {
                "code": "au",
                "title": "Uppoer Cargo Scored",
                "type": "counter"
            },
            "Lower Cargo Scored": {
                "code": "al",
                "title": "Lower Cargo Scored",
                "type": "counter"
            },
            "Auto Aquired Cargo": {
                "code": "ac",
                "title": "Picked up more cargo?",
                "type": "bool"
            }
        },
        "teleop": {
            "Upper Cargo Scored": {
                "code": "tu",
                "title": "Uppoer Cargo Scored",
                "type": "counter"
            },
            "Lower Cargo Scored": {
                "code": "tl",
                "title": "Lower Cargo Scored",
                "type": "counter"
            },
            "Was Defended": {
                "code": "wd",
                "title": "Was Defended",
                "type": "bool"
            },
            "Wallbot?": {
                "code": "wbt",
                "title": "Wallbot?",
                "type": "bool"
            },
            "Cargo Intake From": {
                "code": "cif",
                "title": "Cargo Intake From",
                "type": "radio",
                "choices": {
                    "t": "Terminal<br>",
                    "g": "Ground<br>",
                    "b": "Both<br>",
                    "x": "Not Attempted"
                },
                "defaultValue": "x"
            },
            "Shooting Spot": {
                "code": "ss",
                "title": "Shooting Spot",
                "type": "field_image",
                "filename": "2022/field_image.png"
            }
        },
        "endgame": {
            "Climb": {
                "code": "c",
                "title": "Climb",
                "type": "radio",
                "choices": {
                    "1": "Low<br>",
                    "2": "Mid<br>",
                    "3": "High<br>",
                    "4": "Traversal<br>",
                    "a": "Attempted but failed<br>",
                    "x": "Not attempted"
                },
                "defaultValue": "x"
            },
            "If climb failed,<br>Last successful rung,<br>if any": {
                "code": "lsr",
                "title": "If climb failed,<br>last attempted rung,<br>if any",
                "type": "radio",
                "choices": {
                    "1": "Low<br>",
                    "2": "Mid<br>",
                    "3": "High<br>",
                    "4": "Traversal<br>",
                    "n": "No successful rung<br>",
                    "x": "n/a"
                },
                "defaultValue": "x"
            },
            "Started Climb before Endgame": {
                "code": "be",
                "title": "Started climb before EndGame",
                "type": "bool"
            },
            "Num of Robots Climbed": {
                "code": "cn",
                "title": "# of alliance bots climbed",
                "type": "counter"
            }
        },
        "postmatch": {
            "Alliance Won?": {
                "code": "wl",
                "title": "Alliance Won?",
                "type": "boolean"
            },
            "Climb Ranking Point": {
                "code": "crp",
                "title": "Climb Ranking Point",
                "type": "boolean"
            },
            "Shooter Ranking Point": {
                "code": "srp",
                "title": "Shooter Ranking Point",
                "type": "boolean"
            },
            "Driver Skill": {
                "code": "ds",
                "title": "Driver Skill",
                "type": "radio",
                "choices": {
                    "n": "Not Effective<br>",
                    "a": "Average<br>",
                    "v": "Very Effective<br>",
                    "x": "Not Observed"
                },
                "defaultValue": "x"
            },
            "Defense Rating": {
                "code": "dr",
                "title": "Defense Rating",
                "type": "radio",
                "choices": {
                    "n": "Not Effective<br>",
                    "a": "Average<br>",
                    "v": "Very Effective<br>",
                    "x": "Not Observed"
                },
                "defaultValue": "x"
            },
            "Shot enemy balls away?": {
                "code": "ba",
                "title": "Shot enemy balls away?",
                "type": "bool"
            },
            "Died/Tipped": {
                "code": "d",
                "title": "Died/Tipped",
                "type": "bool"
            },
            "Card Foul": {
                "code": "cf",
                "title": "Yellow/Red Card",
                "type": "bool"
            },
            "Make good alliance partner?": {
                "code": "all",
                "title": "Make good alliance partner?",
                "type": "bool"
            },
            "Comments": {
                "code": "co",
                "title": "Comments",
                "type": "text",
                "size": 15,
                "maxSize": 50
            },
            "Confidence Rating": {
                "code": "cnf",
                "title": "Confidence Rating",
                "type": "radio",
                "choices": {
                    "v": "Very Confident<br>",
                    "a": "Average<br>",
                    "n": "Not Confident"
                },
                "defaultValue": "a"
            }
        }
    }
}`;
fuddster commented 2 years ago

I'd be happy to help.

A few troubleshooting tips:

1) Are you hitting our link (pwnagerobotics.github.io/ScoutingPass) or yours (markzakharyan.github.io/ScoutingPass)?

It appears you haven't set up your repository to enable GitHub Pages. Instructions here https://pages.github.com/. Short version. Settings -> Pages -> Source Branch: Main -> Click Save. It should pop up a box with your URL to use for your own version of the website with your configuration changes.

2) You have your URL, click it. Does it show anything?

If it doesn't look like it should there is most likely an error in your config file. Usually, a missing bracket or comma is the problem. If you're not a JSON programmer let me know and I can take a quick look and find it for you.

If those aren't the problem, give me a link to the webpage and I will take a look at it.

Scott Scouting/Programming Mentor Team 2451 - PWNAGE

markzakharyan commented 2 years ago

Thanks for the help!

GH Pages doesn't seem to be the issue (url: https://markzakharyan.github.io/ScoutingPASS)

I ran the json through an online json validator and it seems like it's valid json so I don't think that's the issue either

markzakharyan commented 2 years ago

The website is the same as before, even after updating the config file. I used a different device in case the website was being cached. And the publicly hosted json is what I changed so it's not an issue with my changes not being propagated on GH Pages.

fuddster commented 2 years ago

Ok. I found it. The three boolean fields that you entered have "type":"boolean" it should be "type":"bool".

I admit, not the best decision we made. I'll probably put in a ticket to support both bool and boolean in the next release.

If that fixes your issue, please close this ticket.

fuddster commented 2 years ago

It looks like you know your way around a web page. If you look at the console for the web page you'll see this message:

Unrecognized type: boolean

That's a clue that some field had a wrong type.

We will be improving our error handling in the next off-season.

Thanks for using ScoutingPASS!

markzakharyan commented 2 years ago

Alright, this was definitely my bad. I should've checked the console.

Thanks for the help!

I'll also contribute to this project soon, my team likes using Google Sheets instead of excel so I wrote up an AppScript macro that can be used for sheets users to parse the QR code.