Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.24.0",
"bootstrap": "^5.1.3",
"axios": "^0.27.2",
"bootstrap": "^5.2.0",
"formik": "^2.2.9",
"lodash": "^4.17.21",
"node-gyp": "^8.4.0",
"node-gyp": "^8.4.1",
"react": "^17.0.2",
"react-beautiful-dnd": "^13.1.0",
"react-bootstrap": "^2.0.2",
"react-bootstrap": "^2.5.0",
"react-dom": "^17.0.2",
"react-router-dom": "^5.3.0",
"react-router-dom": "^5.3.3",
"react-scripts": "^5.0.1",
"yup": "^0.32.11"
},
Expand Down Expand Up @@ -44,10 +44,11 @@
]
},
"devDependencies": {
"concurrently": "^6.3.0",
"concurrently": "^6.5.1",
"cors": "^2.8.5",
"express": "^4.17.1",
"eslint": "^8.22.0",
"express": "^4.18.1",
"node-sass": "^7.0.1",
"nodemon": "^2.0.15"
"nodemon": "^2.0.19"
}
}
2 changes: 1 addition & 1 deletion src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
margin-top: 56px;
flex-direction: column;
padding: 10px 20px;
}
}
2 changes: 1 addition & 1 deletion src/Components/DraggableListGroup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

.draggable-list {
flex-direction: row;
}
}
2 changes: 1 addition & 1 deletion src/Components/FormCheck.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.form-check-input {
margin-top: 0;
}
}
24 changes: 13 additions & 11 deletions src/Components/Navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
margin: -6px 8px 0 12px;
}

.nav-link, .nav-item * {
.nav-link,
.nav-item * {
font-size: 0.875rem;
}

Expand All @@ -22,16 +23,17 @@
}

@media (prefers-reduced-motion: no-preference) {
.title-logo {
animation: clockwise-spin infinite 20s linear;
}
.title-logo {
animation: clockwise-spin infinite 20s linear;
}
}

@keyframes clockwise-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
from {
transform: rotate(0deg);
}

to {
transform: rotate(360deg);
}
}
2 changes: 1 addition & 1 deletion src/Components/Section.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.card {
margin-bottom: 10px;
}
}
8 changes: 6 additions & 2 deletions src/Data/Boards.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"pico": {
"minPin": 0,
"maxPin": 29,
"analogPins": [26, 27, 28],
"analogPins": [
26,
27,
28
],
"invalidPins": []
}
}
}
2 changes: 1 addition & 1 deletion src/Data/Buttons.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@
"A1": "13",
"A2": "14"
}
}
}
2 changes: 1 addition & 1 deletion src/Data/Controllers.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
"A1": "28",
"A2": "18"
}
}
}
6 changes: 3 additions & 3 deletions src/Pages/HomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export default function HomePage() {
<p>Please select a menu option to proceed.</p>
<Section title="Firmware Version">
<div className="card-body">
<div className="card-text">Current Version: { currentVersion }</div>
<div className="card-text">Latest Version: { latestVersion }</div>
<div className="card-text">Current Version: {currentVersion}</div>
<div className="card-text">Latest Version: {latestVersion}</div>
{(latestVersion && currentVersion !== latestVersion) ?
<div className="mt-3">
<a
Expand All @@ -37,7 +37,7 @@ export default function HomePage() {
Get Latest Version
</a>
</div>
: null}
: null}
</div>
</Section>
</div>
Expand Down
14 changes: 7 additions & 7 deletions src/Pages/LEDConfigPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ const defaultValue = {
let usedPins = [];

const schema = yup.object().shape({
brightnessMaximum : yup.number().required().positive().integer().min(0).max(255).label('Max Brightness'),
brightnessSteps : yup.number().required().positive().integer().min(1).max(10).label('Brightness Steps'),
brightnessMaximum: yup.number().required().positive().integer().min(0).max(255).label('Max Brightness'),
brightnessSteps: yup.number().required().positive().integer().min(1).max(10).label('Brightness Steps'),
// eslint-disable-next-line no-template-curly-in-string
dataPin : yup.number().required().min(-1).max(29).test('', '${originalValue} is already assigned!', (value) => usedPins.indexOf(value) === -1).label('Data Pin'),
ledFormat : yup.number().required().positive().integer().min(0).max(3).label('LED Format'),
ledLayout : yup.number().required().positive().integer().min(0).max(2).label('LED Layout'),
ledsPerButton : yup.number().required().positive().integer().min(1).label('LEDs Per Pixel'),
dataPin: yup.number().required().min(-1).max(29).test('', '${originalValue} is already assigned!', (value) => usedPins.indexOf(value) === -1).label('Data Pin'),
ledFormat: yup.number().required().positive().integer().min(0).max(3).label('LED Format'),
ledLayout: yup.number().required().positive().integer().min(0).max(2).label('LED Layout'),
ledsPerButton: yup.number().required().positive().integer().min(1).label('LEDs Per Pixel'),
});

const getLedButtons = (buttonLabels, map, excludeNulls) => {
Expand Down Expand Up @@ -162,7 +162,7 @@ export default function LEDConfigPage() {
error={errors.ledFormat}
isInvalid={errors.ledFormat}
onChange={handleChange}
>
>
{LED_FORMATS.map((o, i) => <option key={`ledFormat-option-${i}`} value={o.value}>{o.label}</option>)}
</FormSelect>
<FormSelect
Expand Down
4 changes: 2 additions & 2 deletions src/Pages/PinMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function PinMappingPage() {
}, [setButtonMappings, selectedController]);

const handlePinChange = (e, prop) => {
const newMappings = {...buttonMappings};
const newMappings = { ...buttonMappings };
if (e.target.value)
newMappings[prop].pin = parseInt(e.target.value);
else
Expand All @@ -40,7 +40,7 @@ export default function PinMappingPage() {
e.preventDefault();
e.stopPropagation();

let mappings = {...buttonMappings};
let mappings = { ...buttonMappings };
validateMappings(mappings);

if (Object.keys(mappings).filter(p => !!mappings[p].error).length) {
Expand Down
5 changes: 2 additions & 3 deletions src/Pages/PinMappings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ table.pin-mapping-table {
display: inline-block;
width: 80px;

+ .invalid-feedback {
+.invalid-feedback {
display: inline;
margin-left: 20px;
margin-right: 10px;
Expand All @@ -30,5 +30,4 @@ table.pin-mapping-table {
line-height: 2rem;
margin-right: 10px;
}
}

}
4 changes: 2 additions & 2 deletions src/Pages/SettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ const SOCD_MODES = [
];

const schema = yup.object().shape({
dpadMode : yup.number().required().oneOf(DPAD_MODES.map(o => o.value)).label('D-Pad Mode'),
dpadMode: yup.number().required().oneOf(DPAD_MODES.map(o => o.value)).label('D-Pad Mode'),
inputMode: yup.number().required().oneOf(INPUT_MODES.map(o => o.value)).label('Input Mode'),
socdMode : yup.number().required().oneOf(SOCD_MODES.map(o => o.value)).label('SOCD Mode'),
socdMode: yup.number().required().oneOf(SOCD_MODES.map(o => o.value)).label('SOCD Mode'),
});

const FormContext = () => {
Expand Down
34 changes: 17 additions & 17 deletions src/Services/WebApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ import axios from 'axios';
const baseUrl = process.env.NODE_ENV === 'production' ? '' : 'http://localhost:8080';

export const baseButtonMappings = {
Up: { pin: -1, error: null },
Down: { pin: -1, error: null },
Left: { pin: -1, error: null },
Up: { pin: -1, error: null },
Down: { pin: -1, error: null },
Left: { pin: -1, error: null },
Right: { pin: -1, error: null },
B1: { pin: -1, error: null },
B2: { pin: -1, error: null },
B3: { pin: -1, error: null },
B4: { pin: -1, error: null },
L1: { pin: -1, error: null },
R1: { pin: -1, error: null },
L2: { pin: -1, error: null },
R2: { pin: -1, error: null },
S1: { pin: -1, error: null },
S2: { pin: -1, error: null },
L3: { pin: -1, error: null },
R3: { pin: -1, error: null },
A1: { pin: -1, error: null },
A2: { pin: -1, error: null },
B1: { pin: -1, error: null },
B2: { pin: -1, error: null },
B3: { pin: -1, error: null },
B4: { pin: -1, error: null },
L1: { pin: -1, error: null },
R1: { pin: -1, error: null },
L2: { pin: -1, error: null },
R2: { pin: -1, error: null },
S1: { pin: -1, error: null },
S2: { pin: -1, error: null },
L3: { pin: -1, error: null },
R3: { pin: -1, error: null },
A1: { pin: -1, error: null },
A2: { pin: -1, error: null },
};

async function resetSettings() {
Expand Down
2 changes: 1 addition & 1 deletion src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ input.form-control {
.card-header {
background-color: $primary;
color: $white;
}
}