Skip to content

Commit

Permalink
Merge 08670c5 into 94d73f3
Browse files Browse the repository at this point in the history
  • Loading branch information
campos20 authored Sep 19, 2020
2 parents 94d73f3 + 08670c5 commit 58a41c5
Show file tree
Hide file tree
Showing 63 changed files with 2,778 additions and 369 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": {
"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": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.0.4",
"@testing-library/user-event": "^12.1.4",
"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,59 +9,51 @@ 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,
multiCubes: { requestedScrambles: mbld },
fmcLanguages: fmcTranslationsHelper(translations),
};

if (password != null && password.length > 0) {
if (!!password) {
payload.zipPassword = password;
}

return postToTnoodle(zipEndpoint, payload);
};

export const fetchWcaEvents = () => {
return fetch(baseUrl + wcaEventsEndpoint);
return fetch(baseUrl + wcaEventsEndpoint).then((response) =>
response.json()
);
};

export const fetchFormats = () => {
return fetch(baseUrl + formatsEndpoint);
return fetch(baseUrl + formatsEndpoint).then((response) => response.json());
};

export const fetchSuggestedFmcTranslations = (wcif) => {
return postToTnoodle(suggestedFmcTranslationsEndpoint, wcif);
return postToTnoodle(
suggestedFmcTranslationsEndpoint,
wcif
).then((response) => response.json());
};

export const fetchBestMbldAttempt = (wcif) => {
return postToTnoodle(bestMbldAttemptEndpoint, wcif);
return postToTnoodle(bestMbldAttemptEndpoint, wcif).then((response) =>
response.json()
);
};

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,
},
};
return fetch(baseUrl + versionEndpoint).then((response) => response.json());
};

export const fetchAvailableFmcTranslations = () => {
return fetch(baseUrl + fmcTranslationsEndpoint);
return fetch(baseUrl + fmcTranslationsEndpoint).then((response) =>
response.json()
);
};

/**
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
Loading

0 comments on commit 58a41c5

Please sign in to comment.