Skip to content

Commit

Permalink
Merge 93a7830 into 94d73f3
Browse files Browse the repository at this point in the history
  • Loading branch information
campos20 committed Sep 14, 2020
2 parents 94d73f3 + 93a7830 commit e42203c
Show file tree
Hide file tree
Showing 63 changed files with 1,192 additions and 152 deletions.
24 changes: 17 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
language: java
jdk: openjdk8
sudo: true
jobs:
include:
- language: java
jdk: openjdk8
sudo: true
script:
- ./gradlew assemble
- ./gradlew check
- ./gradlew buildOfficial

script:
- ./gradlew assemble
- ./gradlew check
- ./gradlew buildOfficial
- language: node_js
node_js: 10
script:
- cd tnoodle-ui
- npm install
- npm test -- --coverage
after_script:
- COVERALLS_REPO_TOKEN=$coveralls_repo_token npm run coveralls
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

TNoodle is a software suite that contains the official WCA scramble program. It consists of the core scrambling code (primarily written in Java) as well as a UI and server to generate a fully autonomous JAR file

[![Build Status](https://travis-ci.org/thewca/tnoodle.svg?branch=master)](https://travis-ci.org/thewca/tnoodle)
[![Build Status](https://travis-ci.org/thewca/tnoodle.svg?branch=master)](https://travis-ci.org/thewca/tnoodle) [![Coverage Status](https://coveralls.io/repos/github/thewca/tnoodle/badge.svg?branch=master)](https://coveralls.io/github/thewca/tnoodle?branch=master)

## WCA Scramble Program

Expand Down
90 changes: 46 additions & 44 deletions tnoodle-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,48 @@
{
"name": "tnoodle-ui",
"version": "0.1.0",
"private": true,
"homepage": "http://localhost:2014/scramble",
"proxy": "http://localhost:2014",
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"bootstrap": "^4.4.1",
"fetch-intercept": "^2.3.1",
"node-sass": "^4.13.1",
"react": "^16.12.0",
"react-bootstrap": "^1.0.0-beta.16",
"react-dom": "^16.12.0",
"react-icons": "^3.10.0",
"react-redux": "^7.1.3",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.3",
"redux": "^4.0.5"
},
"eslintConfig": {
"extends": "react-app"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --watchAll --watchAll=false",
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
"name": "tnoodle-ui",
"version": "0.1.0",
"private": true,
"homepage": "http://localhost:2014/scramble",
"proxy": "http://localhost:2014",
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"bootstrap": "^4.4.1",
"fetch-intercept": "^2.3.1",
"node-sass": "^4.13.1",
"react": "^16.12.0",
"react-bootstrap": "^1.0.0-beta.16",
"react-dom": "^16.12.0",
"react-icons": "^3.10.0",
"react-redux": "^7.1.3",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.3",
"redux": "^4.0.5"
},
"eslintConfig": {
"extends": "react-app"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --watchAll --watchAll=false",
"eject": "react-scripts eject",
"coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"coveralls": "^3.1.0"
}
}
4 changes: 2 additions & 2 deletions tnoodle-ui/src/App.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { Component } from "react";
import SideBar from "./components/SideBar";
import "bootstrap/dist/css/bootstrap.css";
import "./App.css";
import Main from "./components/Main";
import SideBar from "./main/components/SideBar";
import Main from "./main/components/Main";

class App extends Component {
render() {
Expand Down
11 changes: 0 additions & 11 deletions tnoodle-ui/src/App.test.js

This file was deleted.

6 changes: 0 additions & 6 deletions tnoodle-ui/src/functions/wca.helper.js

This file was deleted.

15 changes: 0 additions & 15 deletions tnoodle-ui/src/functions/wcif.functions.js

This file was deleted.

2 changes: 1 addition & 1 deletion tnoodle-ui/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import App from "./App";
import * as serviceWorker from "./serviceWorker";

import { Provider } from "react-redux";
import store from "./redux/Store";
import store from "./main/redux/Store";

ReactDOM.render(
<Provider store={store}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ let bestMbldAttemptEndpoint = "/frontend/mbld/best";
let wcaEventsEndpoint = "/frontend/data/events";
let formatsEndpoint = "/frontend/data/formats";

export const copiesExtensionId =
"org.worldcubeassociation.tnoodle.SheetCopyCount";

export const fetchZip = (wcif, mbld, password, translations) => {
let payload = {
wcif,
Expand Down Expand Up @@ -46,20 +43,6 @@ export const fetchRunningVersion = () => {
return fetch(baseUrl + versionEndpoint);
};

/**
* This is the default extension object the backend expects
* @param {} copies
*/
export const getDefaultCopiesExtension = (copies = 1) => {
return {
id: copiesExtensionId,
specUrl: "",
data: {
numCopies: copies,
},
};
};

export const fetchAvailableFmcTranslations = () => {
return fetch(baseUrl + fmcTranslationsEndpoint);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BASE_PATH } from "../App";
import { BASE_PATH } from "../../App";

// Members of the Software Team can configure this here: https://www.worldcubeassociation.org/oauth/applications/123.

Expand Down Expand Up @@ -83,16 +83,16 @@ export function gotoPreLoginPath() {

export function fetchMe() {
return wcaApiFetch("/me")
.then(response => response.json())
.then(json => json.me);
.then((response) => response.json())
.then((json) => json.me);
}

export function fetchVersionInfo() {
return wcaApiFetch("/scramble-program").then(response => response.json());
return wcaApiFetch("/scramble-program").then((response) => response.json());
}

export function getCompetitionJson(competitionId) {
return wcaApiFetch(`/competitions/${competitionId}/wcif`).then(response =>
return wcaApiFetch(`/competitions/${competitionId}/wcif`).then((response) =>
response.json()
);
}
Expand All @@ -101,7 +101,7 @@ export function getUpcomingManageableCompetitions() {
let oneWeekAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
return wcaApiFetch(
`/competitions?managed_by_me=true&start=${oneWeekAgo.toISOString()}`
).then(response => response.json());
).then((response) => response.json());
}

function getHashParameter(name) {
Expand Down Expand Up @@ -141,11 +141,11 @@ function wcaApiFetch(path, fetchOptions) {
fetchOptions = Object.assign({}, fetchOptions, {
headers: new Headers({
Authorization: `Bearer ${wcaAccessToken}`,
"Content-Type": "application/json"
})
"Content-Type": "application/json",
}),
});

return fetch(`${baseApiUrl}${path}`, fetchOptions).then(response => {
return fetch(`${baseApiUrl}${path}`, fetchOptions).then((response) => {
if (!response.ok) {
throw new Error(`${response.status}: ${response.statusText}`);
}
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { updateWcaEvent, updateFileZipBlob } from "../redux/ActionCreators";
import {
getDefaultCopiesExtension,
copiesExtensionId,
} from "../api/tnoodle.api";
} from "../helper/wcif.helper";
import MbldDetail from "./MbldDetail";
import FmcTranslationsDetail from "./FmcTranslationsDetail";
import "./EventPicker.css";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ const EventPickerTable = connect(
mapDispatchToProps
)(
class extends Component {
componentDidMount = function () {
componentDidMount() {
this.getFormats();
this.getWcaEvents();
this.getFmcTranslations();
};
}

getFormats = () => {
fetchFormats()
Expand All @@ -49,8 +49,8 @@ const EventPickerTable = connect(
return response.json();
}
})
.then((formats) => {
this.props.setWcaFormats(formats);
.then((response) => {
this.props.setWcaFormats(response);
});
};

Expand All @@ -61,8 +61,8 @@ const EventPickerTable = connect(
return response.json();
}
})
.then((wcaEvents) => {
this.props.setWcaEvents(wcaEvents);
.then((response) => {
this.props.setWcaEvents(response);
});
};

Expand All @@ -74,9 +74,10 @@ const EventPickerTable = connect(
}
})
.then((availableTranslations) => {
if (!availableTranslations) {
// TODO evaluate impact of this. It's probably a useless check
/*if (!availableTranslations) {
return;
}
}*/
let translations = Object.keys(availableTranslations).map(
(translationId) => ({
id: translationId,
Expand Down Expand Up @@ -161,8 +162,6 @@ const EventPickerTable = connect(
(item) =>
item.id === event.id
)}
disabled={editingDisabled}
setBlobNull={this.setBlobNull}
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,23 @@ const FmcTranslationsDetail = connect(
checked={
translation.status
}
onChange={(e) =>
onChange={(
e
) =>
this.handleTranslation(
translation.id, e.target.checked
translation.id,
e
.target
.checked
)
}
/>
</th>
{j <
TRANSLATIONS_PER_LINE -
1 && (
<th />
)}
1 && (
<th />
)}
</React.Fragment>
);
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit e42203c

Please sign in to comment.