Compare commits
22
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb04ec6e43 | ||
|
|
42a8d3db4f | ||
|
|
3959de86f4 | ||
|
|
360169c8c9 | ||
|
|
77b338ffb6 | ||
|
|
8571f0430f | ||
|
|
1bfe1a26ba | ||
|
|
564dcc4d4a | ||
|
|
50b70b4ee3 | ||
|
|
00310a49dc | ||
|
|
ec1eea110c | ||
|
|
22d11773e9 | ||
|
|
2de54c0e9b | ||
|
|
5974608fd8 | ||
|
|
6fcaff9cc3 | ||
|
|
f95b1b36ca | ||
|
|
a31195f71e | ||
|
|
506ddef7e9 | ||
|
|
9ac98aa06d | ||
|
|
a8704316ac | ||
|
|
c950dbbd86 | ||
|
|
e00617ac78 |
@@ -14,6 +14,7 @@
|
|||||||
"@fortawesome/free-solid-svg-icons": "^5.15.4",
|
"@fortawesome/free-solid-svg-icons": "^5.15.4",
|
||||||
"@fortawesome/react-fontawesome": "^0.1.19",
|
"@fortawesome/react-fontawesome": "^0.1.19",
|
||||||
"@material-ui/core": "^4.12.4",
|
"@material-ui/core": "^4.12.4",
|
||||||
|
"@material-ui/lab": "^4.0.0-alpha.61",
|
||||||
"@monaco-editor/react": "^4.3.1",
|
"@monaco-editor/react": "^4.3.1",
|
||||||
"@testing-library/jest-dom": "^5.16.1",
|
"@testing-library/jest-dom": "^5.16.1",
|
||||||
"@testing-library/react": "^12.1.2",
|
"@testing-library/react": "^12.1.2",
|
||||||
@@ -28,6 +29,7 @@
|
|||||||
"qrcode.react": "^3.1.0",
|
"qrcode.react": "^3.1.0",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-cookie-consent": "^7.2.1",
|
"react-cookie-consent": "^7.2.1",
|
||||||
|
"react-country-flag": "^3.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
"react-markdown": "^8.0.0",
|
"react-markdown": "^8.0.0",
|
||||||
"react-markdown-editor-lite": "^1.3.3",
|
"react-markdown-editor-lite": "^1.3.3",
|
||||||
@@ -41,6 +43,7 @@
|
|||||||
"reactour": "^1.18.7",
|
"reactour": "^1.18.7",
|
||||||
"redux": "^4.2.0",
|
"redux": "^4.2.0",
|
||||||
"redux-thunk": "^2.4.1",
|
"redux-thunk": "^2.4.1",
|
||||||
|
"rehype-raw": "^6.1.1",
|
||||||
"remark-gemoji": "^7.0.1",
|
"remark-gemoji": "^7.0.1",
|
||||||
"remark-gfm": "^3.0.1",
|
"remark-gfm": "^3.0.1",
|
||||||
"styled-components": "^4.4.1",
|
"styled-components": "^4.4.1",
|
||||||
|
|||||||
@@ -1,10 +1,15 @@
|
|||||||
import {
|
import {
|
||||||
BOARD,
|
BOARD,
|
||||||
} from "./types";
|
} from "./types";
|
||||||
|
import mini_opacity from "../data/mini_opacity.png"
|
||||||
|
import mcu_opacity from "../data/mcu_opacity.png"
|
||||||
|
|
||||||
export const setBoard = (board) => (dispatch) => {
|
export const setBoard = (board) => (dispatch) => {
|
||||||
dispatch({
|
window.sessionStorage.setItem("board", board);
|
||||||
type: BOARD,
|
const root = document.querySelector(':root');
|
||||||
payload: board,
|
root.style.setProperty('--url', `url(${board === "mcu" ? mcu_opacity : mini_opacity})`);
|
||||||
});
|
dispatch({
|
||||||
};
|
type: BOARD,
|
||||||
|
payload: board,
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
const fetchSensorWikiSuccess = sensors => ({
|
||||||
|
type: 'FETCH_SENSORWIKI_SUCCESS',
|
||||||
|
payload: { sensors }
|
||||||
|
})
|
||||||
|
|
||||||
|
export const fetchSensors = () => {
|
||||||
|
return async dispatch => {
|
||||||
|
try {
|
||||||
|
let sensors = await axios.get('https://api.sensors.wiki/sensors/all')
|
||||||
|
dispatch(fetchSensorWikiSuccess(sensors.data))
|
||||||
|
}
|
||||||
|
catch(e){
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,9 +20,15 @@ export const onChangeCode = () => (dispatch, getState) => {
|
|||||||
if (selectedBlock !== null) {
|
if (selectedBlock !== null) {
|
||||||
code.helpurl = selectedBlock.helpUrl
|
code.helpurl = selectedBlock.helpUrl
|
||||||
code.tooltip = selectedBlock.tooltip
|
code.tooltip = selectedBlock.tooltip
|
||||||
|
if (selectedBlock.data) {
|
||||||
|
code.data = selectedBlock.data
|
||||||
|
} else {
|
||||||
|
code.data = null
|
||||||
|
}
|
||||||
} else if (selectedBlock === null) {
|
} else if (selectedBlock === null) {
|
||||||
code.tooltip = Blockly.Msg.tooltip_hint
|
code.tooltip = Blockly.Msg.tooltip_hint
|
||||||
code.helpurl = ''
|
code.helpurl = ''
|
||||||
|
code.data = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ Blockly.Blocks["sensebox_sensor_temp_hum"] = {
|
|||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_temp_hum_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_temp_hum_tooltip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_temp_hum_helpurl);
|
this.setHelpUrl(Blockly.Msg.senseBox_temp_hum_helpurl);
|
||||||
|
this.data = {name: "hdc1080", connection: "I2C"};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -51,6 +52,7 @@ Blockly.Blocks["sensebox_sensor_uv_light"] = {
|
|||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_uv_light_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_uv_light_tooltip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_uv_light_helpurl);
|
this.setHelpUrl(Blockly.Msg.senseBox_uv_light_helpurl);
|
||||||
|
this.data = {name: "veml6070"};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -91,6 +93,7 @@ Blockly.Blocks["sensebox_sensor_bmx055_accelerometer"] = {
|
|||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_bmx055_accelerometer_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_bmx055_accelerometer_tooltip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_bmx055_helpurl);
|
this.setHelpUrl(Blockly.Msg.senseBox_bmx055_helpurl);
|
||||||
|
this.data = {name: "bmx055"};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -122,6 +125,7 @@ Blockly.Blocks["sensebox_sensor_sds011"] = {
|
|||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_sds011_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_sds011_tooltip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_sds011_helpurl);
|
this.setHelpUrl(Blockly.Msg.senseBox_sds011_helpurl);
|
||||||
|
this.data = {name: "sds011"};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -155,6 +159,7 @@ Blockly.Blocks["sensebox_sensor_pressure"] = {
|
|||||||
this.setOutput(true, Types.DECIMAL.typeName);
|
this.setOutput(true, Types.DECIMAL.typeName);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_pressure_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_pressure_tooltip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_pressure_helpurl);
|
this.setHelpUrl(Blockly.Msg.senseBox_pressure_helpurl);
|
||||||
|
this.data = {name: "bmp280"};
|
||||||
this.getField("NAME").setValidator(
|
this.getField("NAME").setValidator(
|
||||||
function (val) {
|
function (val) {
|
||||||
this.updateShape_(val === "Altitude");
|
this.updateShape_(val === "Altitude");
|
||||||
@@ -201,6 +206,7 @@ Blockly.Blocks["sensebox_sensor_bme680_bsec"] = {
|
|||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_bme_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_bme_tooltip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_bme680_helpurl);
|
this.setHelpUrl(Blockly.Msg.senseBox_bme680_helpurl);
|
||||||
|
this.data = {name: "bme680"};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -245,6 +251,7 @@ Blockly.Blocks["sensebox_sensor_ultrasonic_ranger"] = {
|
|||||||
this.setOutput(true, Types.NUMBER.typeName);
|
this.setOutput(true, Types.NUMBER.typeName);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_ultrasonic_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_ultrasonic_tooltip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_ultrasonic_helpurl);
|
this.setHelpUrl(Blockly.Msg.senseBox_ultrasonic_helpurl);
|
||||||
|
this.data = {name: "hc-sr04"};
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Parse XML to restore the number of pins available.
|
* Parse XML to restore the number of pins available.
|
||||||
@@ -382,6 +389,7 @@ Blockly.Blocks["sensebox_scd30"] = {
|
|||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_scd_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_scd_tooltip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_scd_helpurl);
|
this.setHelpUrl(Blockly.Msg.senseBox_scd_helpurl);
|
||||||
|
this.data = {name: "scd30"};
|
||||||
},
|
},
|
||||||
onchange: function (e) {
|
onchange: function (e) {
|
||||||
var dropdown = this.getFieldValue("dropdown");
|
var dropdown = this.getFieldValue("dropdown");
|
||||||
@@ -448,6 +456,7 @@ Blockly.Blocks["sensebox_sensor_truebner_smt50"] = {
|
|||||||
this.setOutput(true, Types.NUMBER.typeName);
|
this.setOutput(true, Types.NUMBER.typeName);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_smt50_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_smt50_tooltip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_smt50_helpurl);
|
this.setHelpUrl(Blockly.Msg.senseBox_smt50_helpurl);
|
||||||
|
this.data = {name: "smt50"};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -470,6 +479,7 @@ Blockly.Blocks["sensebox_sensor_watertemperature"] = {
|
|||||||
.appendField(new Blockly.FieldDropdown(dropdownOptions), "Port");
|
.appendField(new Blockly.FieldDropdown(dropdownOptions), "Port");
|
||||||
this.setOutput(true, Types.NUMBER.typeName);
|
this.setOutput(true, Types.NUMBER.typeName);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_watertemperature_tip);
|
this.setTooltip(Blockly.Msg.senseBox_watertemperature_tip);
|
||||||
|
this.data = {name: "ds18b20"};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -542,6 +552,7 @@ Blockly.Blocks["sensebox_sensor_dps310"] = {
|
|||||||
this.setOutput(true, Types.DECIMAL.typeName);
|
this.setOutput(true, Types.DECIMAL.typeName);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_sensor_dps310_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_sensor_dps310_tooltip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_sensor_dps310_helpurl);
|
this.setHelpUrl(Blockly.Msg.senseBox_sensor_dps310_helpurl);
|
||||||
|
this.data = {name: "dps310"};
|
||||||
this.getField("NAME").setValidator(
|
this.getField("NAME").setValidator(
|
||||||
function (val) {
|
function (val) {
|
||||||
this.updateShape_(val === "Altitude");
|
this.updateShape_(val === "Altitude");
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ Blockly.Blocks["variables_set_dynamic"] = {
|
|||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.appendValueInput("VALUE")
|
this.appendValueInput("VALUE")
|
||||||
.appendField("set", "set")
|
.appendField(Blockly.Msg.variables_set, Blockly.Msg.variables_set)
|
||||||
.appendField("", "type")
|
// .appendField("", "type")
|
||||||
.appendField(new Blockly.FieldVariable("VAR"), "VAR")
|
.appendField(new Blockly.FieldVariable("VAR"), "VAR")
|
||||||
.appendField("to");
|
.appendField(Blockly.Msg.variables_to);
|
||||||
},
|
},
|
||||||
onchange: function (e) {
|
onchange: function (e) {
|
||||||
let variableID = this.getFieldValue("VAR");
|
let variableID = this.getFieldValue("VAR");
|
||||||
|
|||||||
@@ -19,10 +19,12 @@ export const UI = {
|
|||||||
variable_DECIMAL: "Kommazahl (float)",
|
variable_DECIMAL: "Kommazahl (float)",
|
||||||
variables_TEXT: "Text (string)",
|
variables_TEXT: "Text (string)",
|
||||||
variables_ARRAY: "Array (array)",
|
variables_ARRAY: "Array (array)",
|
||||||
variables_CHARACTER: "char (char)",
|
variables_CHARACTER: "Buchstabe (char)",
|
||||||
variables_BOOLEAN: "Boolean (boolean)",
|
variables_BOOLEAN: "Boolean (boolean)",
|
||||||
variables_NULL: "void (void)",
|
variables_NULL: "void (void)",
|
||||||
variables_UNDEF: "undefined",
|
variables_UNDEF: "undefined",
|
||||||
|
variables_set: "Schreibe",
|
||||||
|
variables_to: "",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tooltips
|
* Tooltips
|
||||||
@@ -97,11 +99,14 @@ export const UI = {
|
|||||||
* Tablet Dialog
|
* Tablet Dialog
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
tabletDialog_connect: "senseBox Connect App öffnen",
|
||||||
tabletDialog_headline: "Tablet Modus ist aktiviert!",
|
tabletDialog_headline: "Tablet Modus ist aktiviert!",
|
||||||
tabletDialog_text:
|
tabletDialog_text:
|
||||||
"Der Tablet Modus wurde aktiviert. Du kannst nun Programmcodes über die senseBox Connect App auf deine senseBox kopieren. Der Tablet Modus kann in den Einstellungen deaktiviert werden",
|
"Der Tablet Modus wurde aktiviert. Du kannst nun Programmcodes über die senseBox Connect App auf deine senseBox kopieren. Der Tablet Modus kann in den Einstellungen deaktiviert werden",
|
||||||
tabletDialog_more:
|
tabletDialog_more:
|
||||||
"Weitere Informationen und den Link zum Download der App findest du unter: ",
|
"Weitere Informationen und den Link zum Download der App findest du unter: ",
|
||||||
|
compiledialog_process: "Dein Code wird compiliert!",
|
||||||
|
compiledialog_instructions: "Übertrage ihn anschließend mithlfe der senseBoxConnect-App..",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reset Dialog
|
* Reset Dialog
|
||||||
@@ -130,7 +135,7 @@ export const UI = {
|
|||||||
* Compile Dialog
|
* Compile Dialog
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
compiledialog_success: "Dein Programm wurde erfolgreich kompiliert.",
|
||||||
compiledialog_headline: "Fehler",
|
compiledialog_headline: "Fehler",
|
||||||
compiledialog_text:
|
compiledialog_text:
|
||||||
"Beim kompilieren ist ein Fehler aufgetreten. Überprüfe deine Blöcke und versuche es erneut",
|
"Beim kompilieren ist ein Fehler aufgetreten. Überprüfe deine Blöcke und versuche es erneut",
|
||||||
@@ -150,6 +155,7 @@ export const UI = {
|
|||||||
button_next: "nächster Schritt",
|
button_next: "nächster Schritt",
|
||||||
button_tutorial_overview: "Tutorial Übersicht",
|
button_tutorial_overview: "Tutorial Übersicht",
|
||||||
button_login: "Anmelden",
|
button_login: "Anmelden",
|
||||||
|
button_createVariable: "Typisierte Variable erstellen",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -311,5 +317,15 @@ export const UI = {
|
|||||||
deviceselection_head: "Welches Board benutzt du?",
|
deviceselection_head: "Welches Board benutzt du?",
|
||||||
deviceselection_keep_selection: "Speichere meine Auswahl fürs nächste Mal (Du kannst das Board später in den Einstellungen wechseln)",
|
deviceselection_keep_selection: "Speichere meine Auswahl fürs nächste Mal (Du kannst das Board später in den Einstellungen wechseln)",
|
||||||
deviceselection_footnote: "Hier kommst du zur alten Blockly Version für den ",
|
deviceselection_footnote: "Hier kommst du zur alten Blockly Version für den ",
|
||||||
deviceselection_footnote_02: "oder die"
|
deviceselection_footnote_02: "oder die",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sensor Markdown Information
|
||||||
|
*/
|
||||||
|
sensorinfo_info: "Informationen zum Sensor",
|
||||||
|
sensorinfo_description: "Beschreibung",
|
||||||
|
sensorinfo_measurable_phenos: "Messbare Phänomene",
|
||||||
|
sensorinfo_manufacturer: "Hersteller",
|
||||||
|
sensorinfo_lifetime: "Lebensdauer",
|
||||||
|
sensorinfo_explanation: "Diese Informationen wurden aus [sensors.wiki](https://sensors.wiki) entnommen. Für weitere Informationen besuchen Sie den Abschnitt über diesen Sensor "
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ export const IO = {
|
|||||||
ARD_DIGITALREAD_TIP: "Read digital value on a pin: HIGH or LOW",
|
ARD_DIGITALREAD_TIP: "Read digital value on a pin: HIGH or LOW",
|
||||||
ARD_DIGITALWRITE: "set digitial pin#",
|
ARD_DIGITALWRITE: "set digitial pin#",
|
||||||
ARD_DIGITALWRITE_TIP: "Write digital value HIGH or LOW to a specific Port",
|
ARD_DIGITALWRITE_TIP: "Write digital value HIGH or LOW to a specific Port",
|
||||||
ARD_FUN_RUN_LOOP: "Arduino loop forever:",
|
ARD_FUN_RUN_LOOP: "Loop()",
|
||||||
ARD_FUN_RUN_SETUP: "Arduino run first:",
|
ARD_FUN_RUN_SETUP: "Setup()",
|
||||||
ARD_FUN_RUN_TIP: "Defines the Arduino setup() and loop() functions.",
|
ARD_FUN_RUN_TIP: "Defines the Arduino setup() and loop() functions.",
|
||||||
ARD_HIGH: "HIGH",
|
ARD_HIGH: "HIGH",
|
||||||
ARD_HIGHLOW_TIP: "Set a pin state logic High or Low.",
|
ARD_HIGHLOW_TIP: "Set a pin state logic High or Low.",
|
||||||
|
|||||||
@@ -15,14 +15,16 @@ export const UI = {
|
|||||||
toolbox_motors: "Motors",
|
toolbox_motors: "Motors",
|
||||||
variable_NUMBER: "Number (int)",
|
variable_NUMBER: "Number (int)",
|
||||||
variable_SHORT_NUMBER: "char",
|
variable_SHORT_NUMBER: "char",
|
||||||
variable_LONG: " Zahl (long)",
|
variable_LONG: "Big number (long)",
|
||||||
variable_DECIMAL: "Decimal (float)",
|
variable_DECIMAL: "Decimal (float)",
|
||||||
variables_TEXT: "Text (string)",
|
variables_TEXT: "Text (string)",
|
||||||
variables_ARRAY: "Array (array)",
|
variables_ARRAY: "Array (array)",
|
||||||
variables_CHARACTER: "char (char)",
|
variables_CHARACTER: "Character (char)",
|
||||||
variables_BOOLEAN: "Boolean (boolean)",
|
variables_BOOLEAN: "Boolean (boolean)",
|
||||||
variables_NULL: "void (void)",
|
variables_NULL: "void (void)",
|
||||||
variables_UNDEF: "undefined",
|
variables_UNDEF: "undefined",
|
||||||
|
variables_set: "set",
|
||||||
|
variables_to: "to",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tooltips
|
* Tooltips
|
||||||
@@ -99,6 +101,7 @@ export const UI = {
|
|||||||
"Tablet mode has been activated. You can now copy program codes to your senseBox via the senseBox Connect app. Tablet mode can be deactivated in the settings",
|
"Tablet mode has been activated. You can now copy program codes to your senseBox via the senseBox Connect app. Tablet mode can be deactivated in the settings",
|
||||||
tabletDialog_more:
|
tabletDialog_more:
|
||||||
"For more information and the link to download the app, please visit: ",
|
"For more information and the link to download the app, please visit: ",
|
||||||
|
tabletDialog_connect: "Open senseBox Connect App",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reset Dialog
|
* Reset Dialog
|
||||||
@@ -126,10 +129,12 @@ export const UI = {
|
|||||||
* Compile Dialog
|
* Compile Dialog
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
compiledialog_success: "Your code has been compiled successfully.",
|
||||||
compiledialog_headline: "Error",
|
compiledialog_headline: "Error",
|
||||||
compiledialog_text:
|
compiledialog_text:
|
||||||
"While compiling an error occured. Please check your blocks and try again",
|
"While compiling an error occured. Please check your blocks and try again",
|
||||||
|
compiledialog_process: "Your code is being compiled!",
|
||||||
|
compiledialog_instructions: "After that, transfer it using the senseBoxConnect app.",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Buttons
|
* Buttons
|
||||||
@@ -145,6 +150,7 @@ export const UI = {
|
|||||||
button_next: "Next step",
|
button_next: "Next step",
|
||||||
button_tutorial_overview: "Tutorial overview",
|
button_tutorial_overview: "Tutorial overview",
|
||||||
button_login: "Login",
|
button_login: "Login",
|
||||||
|
button_createVariable: "Create Typed Variable",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -300,13 +306,21 @@ export const UI = {
|
|||||||
codeeditor_compile_progress:
|
codeeditor_compile_progress:
|
||||||
"Your code will now be compiled and then downloaded to your computer",
|
"Your code will now be compiled and then downloaded to your computer",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Device Selction
|
* Device Selction
|
||||||
* */
|
* */
|
||||||
deviceselection_head: "Which board are you using?",
|
deviceselection_head: "Which board are you using?",
|
||||||
deviceselection_keep_selection: "Save my choice (You can change the board later in the settings)",
|
deviceselection_keep_selection: "Save my choice (You can change the board later in the settings)",
|
||||||
deviceselection_footnote: "Here you can access the old blockly Version for the",
|
deviceselection_footnote: "Here you can access the old blockly Version for the",
|
||||||
deviceselection_footnote_02: "or the",
|
deviceselection_footnote_02: "or the",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sensor Markdown Information
|
||||||
|
* */
|
||||||
|
sensorinfo_info: "Informationen regarding the Sensor",
|
||||||
|
sensorinfo_description: "Description",
|
||||||
|
sensorinfo_measurable_phenos: "Measurable Phenomena",
|
||||||
|
sensorinfo_manufacturer: "Manufacturer",
|
||||||
|
sensorinfo_lifetime: "Lifetime",
|
||||||
|
sensorinfo_explanation: "This information was fetched from [sensors.wiki](https://sensors.wiki). For more information visit the section on this sensor ",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ class Toolbox extends React.Component {
|
|||||||
this.props.workspace,
|
this.props.workspace,
|
||||||
"callbackName",
|
"callbackName",
|
||||||
[
|
[
|
||||||
[`${Blockly.Msg.variable_SHORT_NUMBER}`, "char"],
|
|
||||||
[`${Blockly.Msg.variable_NUMBER}`, "int"],
|
[`${Blockly.Msg.variable_NUMBER}`, "int"],
|
||||||
[`${Blockly.Msg.variable_LONG}`, "long"],
|
[`${Blockly.Msg.variable_LONG}`, "long"],
|
||||||
[`${Blockly.Msg.variable_DECIMAL}`, "float"],
|
[`${Blockly.Msg.variable_DECIMAL}`, "float"],
|
||||||
@@ -33,7 +32,7 @@ class Toolbox extends React.Component {
|
|||||||
|
|
||||||
// Add your button and give it a callback name.
|
// Add your button and give it a callback name.
|
||||||
const button = document.createElement("button");
|
const button = document.createElement("button");
|
||||||
button.setAttribute("text", "Create Typed Variable");
|
button.setAttribute("text", Blockly.Msg.button_createVariable);
|
||||||
button.setAttribute("callbackKey", "callbackName");
|
button.setAttribute("callbackKey", "callbackName");
|
||||||
|
|
||||||
xmlList.push(button);
|
xmlList.push(button);
|
||||||
@@ -41,6 +40,7 @@ class Toolbox extends React.Component {
|
|||||||
// This gets all the variables that the user creates and adds them to the
|
// This gets all the variables that the user creates and adds them to the
|
||||||
// flyout.
|
// flyout.
|
||||||
const blockList = Blockly.VariablesDynamic.flyoutCategoryBlocks(workspace);
|
const blockList = Blockly.VariablesDynamic.flyoutCategoryBlocks(workspace);
|
||||||
|
console.log(blockList);
|
||||||
xmlList = xmlList.concat(blockList);
|
xmlList = xmlList.concat(blockList);
|
||||||
return xmlList;
|
return xmlList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import Sidebar from "./Sidebar";
|
|||||||
import Dialog from "../Dialog";
|
import Dialog from "../Dialog";
|
||||||
import SaveIcon from "./SaveIcon";
|
import SaveIcon from "./SaveIcon";
|
||||||
import store from "../../store";
|
import store from "../../store";
|
||||||
|
import DeviceSelection from "../DeviceSelection";
|
||||||
|
|
||||||
const CodeEditor = (props) => {
|
const CodeEditor = (props) => {
|
||||||
//const [filehandle, setFileHandle] = useState();
|
//const [filehandle, setFileHandle] = useState();
|
||||||
@@ -192,6 +193,7 @@ void loop() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<DeviceSelection />
|
||||||
<Grid item lg={4} md={4}>
|
<Grid item lg={4} md={4}>
|
||||||
<Button
|
<Button
|
||||||
style={{ padding: "1rem", margin: "1rem" }}
|
style={{ padding: "1rem", margin: "1rem" }}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class Compile extends Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {}
|
componentDidMount() { }
|
||||||
|
|
||||||
componentDidUpdate(props) {
|
componentDidUpdate(props) {
|
||||||
if (props.name !== this.props.name) {
|
if (props.name !== this.props.name) {
|
||||||
@@ -232,8 +232,8 @@ class Compile extends Component {
|
|||||||
>
|
>
|
||||||
<div className="overlay">
|
<div className="overlay">
|
||||||
{/* <img src={Copy} width="400" alt="copyimage"></img> */}
|
{/* <img src={Copy} width="400" alt="copyimage"></img> */}
|
||||||
<h2>Dein Code wird kompiliert!</h2>
|
<h2>{Blockly.Msg.compiledialog_process}</h2>
|
||||||
<p>übertrage ihn anschließend mithlfe der senseBoxConnect-App</p>
|
<p>{Blockly.Msg.compiledialog_instructions}</p>
|
||||||
<p>
|
<p>
|
||||||
{Blockly.Msg.compile_overlay_help}
|
{Blockly.Msg.compile_overlay_help}
|
||||||
<a href="/faq" target="_blank">
|
<a href="/faq" target="_blank">
|
||||||
@@ -291,7 +291,7 @@ class Compile extends Component {
|
|||||||
button={Blockly.Msg.button_close}
|
button={Blockly.Msg.button_close}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<p>Dein Code wurde erfolgreich kompiliert</p>
|
<p>{Blockly.Msg.compiledialog_success}</p>
|
||||||
<a href={this.state.link}>
|
<a href={this.state.link}>
|
||||||
<Button
|
<Button
|
||||||
style={{ color: "white" }}
|
style={{ color: "white" }}
|
||||||
@@ -303,7 +303,7 @@ class Compile extends Component {
|
|||||||
icon={faClipboardCheck}
|
icon={faClipboardCheck}
|
||||||
style={{ marginRight: "5px" }}
|
style={{ marginRight: "5px" }}
|
||||||
/>{" "}
|
/>{" "}
|
||||||
Starte Übertragung
|
{Blockly.Msg.tabletDialog_connect}
|
||||||
</Button>
|
</Button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import { withStyles } from "@material-ui/core/styles";
|
|||||||
import * as Blockly from "blockly";
|
import * as Blockly from "blockly";
|
||||||
import { IconButton, Grid, Avatar, Typography } from "@material-ui/core";
|
import { IconButton, Grid, Avatar, Typography } from "@material-ui/core";
|
||||||
import { setBoard } from "../actions/boardAction";
|
import { setBoard } from "../actions/boardAction";
|
||||||
import mini_opacity from "../data/mini_opacity.png"
|
|
||||||
import mcu_opacity from "../data/mcu_opacity.png"
|
|
||||||
|
|
||||||
const styles = (theme) => ({
|
const styles = (theme) => ({
|
||||||
link: {
|
link: {
|
||||||
@@ -29,30 +27,29 @@ class DeviceSeclection extends Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
open: this.props.selectedBoard !== "" ? false : true,
|
open: props.selectedBoard ? false : true,
|
||||||
selectedBoard : this.props.selectedBoard,
|
selectedBoard: "",
|
||||||
saveSettings: false,
|
saveSettings: false,
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleDialog = () => {
|
toggleDialog = () => {
|
||||||
|
|
||||||
this.props.setBoard(this.state.selectedBoard)
|
this.props.setBoard(this.state.selectedBoard)
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onChange = (e) => {
|
||||||
|
if (e.target.checked) {
|
||||||
|
this.setState({ saveSettings: true });
|
||||||
|
} else {
|
||||||
|
this.setState({ saveSettings: false });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
onclick = (e, value) => {
|
onclick = (e, value) => {
|
||||||
console.log(e, value)
|
this.setState({ selectedBoard: value })
|
||||||
const root = document.querySelector(':root');
|
|
||||||
root.style.setProperty('--url', `url(${value === "mcu" ? mcu_opacity : mini_opacity })`);
|
|
||||||
this.setState({selectedBoard: value})
|
|
||||||
this.props.setBoard(value)
|
this.props.setBoard(value)
|
||||||
this.setState({ open: !this.state });
|
this.setState({ open: !this.state });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -65,25 +62,24 @@ class DeviceSeclection extends Component {
|
|||||||
title={Blockly.Msg.deviceselection_head}
|
title={Blockly.Msg.deviceselection_head}
|
||||||
content={""}
|
content={""}
|
||||||
onClick={this.toggleDialog}
|
onClick={this.toggleDialog}
|
||||||
disabled={this.state.selectedBoard===""}
|
disabled={this.state.selectedBoard === ""}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<Grid container spacing={2} style={{ textAlign : "center" }}>
|
<Grid container spacing={2} style={{ textAlign: "center" }}>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
<IconButton onClick={(e) => this.onclick(e, "mcu")}>
|
<IconButton onClick={(e) => this.onclick(e, "mcu")}>
|
||||||
<Avatar
|
<Avatar
|
||||||
alt="Sensebox MCU"
|
alt="Sensebox MCU"
|
||||||
src="/media/hardware/senseboxmcu.png"
|
src="/media/hardware/senseboxmcu.png"
|
||||||
style={{
|
style={{
|
||||||
border: this.state.selectedBoard === "mcu" ? 'medium solid DeepSkyBlue': "0.1px solid lightgray",
|
border: this.state.selectedBoard === "mcu" ? 'medium solid DeepSkyBlue' : "0.1px solid lightgray",
|
||||||
width:"20vw",
|
width: "20vw",
|
||||||
height: "20vw"
|
height: "20vw"
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<p>senseBox MCU</p>
|
<p>senseBox MCU</p>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
{/* <Grid item xs={4}>
|
{/* <Grid item xs={4}>
|
||||||
<IconButton onClick={(e) => this.onclick(e, "esp")}>
|
<IconButton onClick={(e) => this.onclick(e, "esp")}>
|
||||||
<Avatar
|
<Avatar
|
||||||
@@ -93,22 +89,22 @@ class DeviceSeclection extends Component {
|
|||||||
border: this.state.selectedBoard == "esp" ? 'medium solid DeepSkyBlue': "0.1px solid lightgray",
|
border: this.state.selectedBoard == "esp" ? 'medium solid DeepSkyBlue': "0.1px solid lightgray",
|
||||||
width:"20vw",
|
width:"20vw",
|
||||||
height: "20vw"
|
height: "20vw"
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<p>Sensebox ESP</p>
|
<p>Sensebox ESP</p>
|
||||||
</Grid> */}
|
</Grid> */}
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
<IconButton onClick={(e) => this.onclick(e, "mini")}>
|
<IconButton onClick={(e) => this.onclick(e, "mini")}>
|
||||||
<Avatar
|
<Avatar
|
||||||
alt="Sensebox Mini"
|
alt="Sensebox Mini"
|
||||||
src="/media/hardware/senseboxmcumini.png"
|
src="/media/hardware/senseboxmcumini.png"
|
||||||
style={{
|
style={{
|
||||||
border: this.state.selectedBoard === "mini" ? 'medium solid DeepSkyBlue': "0.1px solid lightgray",
|
border: this.state.selectedBoard === "mini" ? 'medium solid DeepSkyBlue' : "0.1px solid lightgray",
|
||||||
width:"20vw",
|
width: "20vw",
|
||||||
height: "20vw"
|
height: "20vw"
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<p>senseBox MCU:mini</p>
|
<p>senseBox MCU:mini</p>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -133,5 +129,5 @@ const mapStateToProps = (state) => ({
|
|||||||
|
|
||||||
export default connect(
|
export default connect(
|
||||||
mapStateToProps,
|
mapStateToProps,
|
||||||
{setBoard}
|
{ setBoard }
|
||||||
)(withStyles(styles, { withTheme: true })(DeviceSeclection));
|
)(withStyles(styles, { withTheme: true })(DeviceSeclection));
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import Button from "@material-ui/core/Button";
|
|||||||
import Typography from "@material-ui/core/Typography";
|
import Typography from "@material-ui/core/Typography";
|
||||||
import * as Blockly from "blockly";
|
import * as Blockly from "blockly";
|
||||||
import ReactMarkdown from "react-markdown";
|
import ReactMarkdown from "react-markdown";
|
||||||
|
import rehypeRaw from "rehype-raw";
|
||||||
import Container from "@material-ui/core/Container";
|
import Container from "@material-ui/core/Container";
|
||||||
import ExpansionPanel from "@material-ui/core/ExpansionPanel";
|
import ExpansionPanel from "@material-ui/core/ExpansionPanel";
|
||||||
import ExpansionPanelSummary from "@material-ui/core/ExpansionPanelSummary";
|
import ExpansionPanelSummary from "@material-ui/core/ExpansionPanelSummary";
|
||||||
@@ -61,6 +62,7 @@ class Faq extends Component {
|
|||||||
className="news"
|
className="news"
|
||||||
allowDangerousHtml="true"
|
allowDangerousHtml="true"
|
||||||
children={object.answer}
|
children={object.answer}
|
||||||
|
rehypePlugins={[rehypeRaw]}
|
||||||
></ReactMarkdown>
|
></ReactMarkdown>
|
||||||
</Typography>
|
</Typography>
|
||||||
</ExpansionPanelDetails>
|
</ExpansionPanelDetails>
|
||||||
|
|||||||
@@ -187,7 +187,6 @@ class Home extends Component {
|
|||||||
</Grid>
|
</Grid>
|
||||||
) : null}
|
) : null}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<DeviceSelection />
|
<DeviceSelection />
|
||||||
{/* <HintTutorialExists /> */}
|
{/* <HintTutorialExists /> */}
|
||||||
{this.props.platform ? (
|
{this.props.platform ? (
|
||||||
|
|||||||
+12
-10
@@ -41,6 +41,7 @@ import {
|
|||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import * as Blockly from "blockly";
|
import * as Blockly from "blockly";
|
||||||
import Tooltip from "@material-ui/core/Tooltip";
|
import Tooltip from "@material-ui/core/Tooltip";
|
||||||
|
import NavbarSettings from "./NavbarSettings";
|
||||||
|
|
||||||
const styles = (theme) => ({
|
const styles = (theme) => ({
|
||||||
drawerWidth: {
|
drawerWidth: {
|
||||||
@@ -127,6 +128,7 @@ class Navbar extends Component {
|
|||||||
<Link to={"/"} style={{ marginLeft: "10px" }}>
|
<Link to={"/"} style={{ marginLeft: "10px" }}>
|
||||||
<img src={senseboxLogo} alt="senseBox-Logo" width="30" />
|
<img src={senseboxLogo} alt="senseBox-Logo" width="30" />
|
||||||
</Link>
|
</Link>
|
||||||
|
<NavbarSettings />
|
||||||
{isTutorial ? (
|
{isTutorial ? (
|
||||||
<Link
|
<Link
|
||||||
to={"/tutorial"}
|
to={"/tutorial"}
|
||||||
@@ -149,7 +151,7 @@ class Navbar extends Component {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
this.openTour();
|
this.openTour();
|
||||||
}}
|
}}
|
||||||
style={{ margin: "0 30px 0 auto" }}
|
style={{ margin: "0 30px 0 0" }}
|
||||||
>
|
>
|
||||||
<FontAwesomeIcon icon={faQuestionCircle} />
|
<FontAwesomeIcon icon={faQuestionCircle} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
@@ -163,7 +165,7 @@ class Navbar extends Component {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
this.openTour();
|
this.openTour();
|
||||||
}}
|
}}
|
||||||
style={{ margin: "0 30px 0 auto" }}
|
style={{ margin: "0 30px 0 0" }}
|
||||||
>
|
>
|
||||||
<FontAwesomeIcon icon={faQuestionCircle} />
|
<FontAwesomeIcon icon={faQuestionCircle} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
@@ -214,11 +216,11 @@ class Navbar extends Component {
|
|||||||
</div>
|
</div>
|
||||||
<List>
|
<List>
|
||||||
{[
|
{[
|
||||||
{
|
{
|
||||||
text: Blockly.Msg.navbar_blockly,
|
text: Blockly.Msg.navbar_blockly,
|
||||||
icon: faPuzzlePiece,
|
icon: faPuzzlePiece,
|
||||||
link: "/",
|
link: "/",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: Blockly.Msg.navbar_tutorials,
|
text: Blockly.Msg.navbar_tutorials,
|
||||||
icon: faChalkboardTeacher,
|
icon: faChalkboardTeacher,
|
||||||
@@ -329,9 +331,9 @@ class Navbar extends Component {
|
|||||||
onClick={
|
onClick={
|
||||||
item.function
|
item.function
|
||||||
? () => {
|
? () => {
|
||||||
item.function();
|
item.function();
|
||||||
this.toggleDrawer();
|
this.toggleDrawer();
|
||||||
}
|
}
|
||||||
: this.toggleDrawer
|
: this.toggleDrawer
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
import React, { Component } from 'react';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import { setLanguage } from '../actions/generalActions';
|
||||||
|
import MenuItem from '@material-ui/core/MenuItem';
|
||||||
|
import Select from '@material-ui/core/Select';
|
||||||
|
import { setBoard } from '../actions/boardAction';
|
||||||
|
import ReactCountryFlag from "react-country-flag";
|
||||||
|
import { MuiThemeProvider, createTheme } from '@material-ui/core/styles';
|
||||||
|
|
||||||
|
const theme = createTheme({
|
||||||
|
overrides: {
|
||||||
|
MuiSelect: {
|
||||||
|
select: {
|
||||||
|
'&:focus': {
|
||||||
|
backgroundColor: 'transparent',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
class NavbarSettings extends Component {
|
||||||
|
componentDidMount() {
|
||||||
|
// Ensure that Blockly.setLocale is adopted in the component.
|
||||||
|
// Otherwise, the text will not be displayed until the next update of the component.
|
||||||
|
this.forceUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
handleChange = (event) => {
|
||||||
|
this.props.setLanguage(event.target.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<div style={{ margin: "0 0 0 auto", display: "flex" }}>
|
||||||
|
<div style={{ margin: "0 30px 0 auto", display: "flex" }}>
|
||||||
|
<MuiThemeProvider theme={theme}>
|
||||||
|
<Select
|
||||||
|
value={this.props.selectedBoard}
|
||||||
|
onChange={(e) => this.props.setBoard(e.target.value)}
|
||||||
|
disableUnderline={true}
|
||||||
|
style={{ backgroundColor: "transparent !important" }}
|
||||||
|
// IconComponent={() => <div />}
|
||||||
|
>
|
||||||
|
<MenuItem value="mcu">senseBox MCU</MenuItem>
|
||||||
|
<MenuItem value="mini">senseBox MCU mini</MenuItem>
|
||||||
|
</Select>
|
||||||
|
</MuiThemeProvider>
|
||||||
|
</div>
|
||||||
|
<div style={{ margin: "0 0 0 auto", display: "flex" }}>
|
||||||
|
<MuiThemeProvider theme={theme}>
|
||||||
|
<Select
|
||||||
|
value={this.props.language}
|
||||||
|
onChange={this.handleChange}
|
||||||
|
disableUnderline={true}
|
||||||
|
IconComponent={() => null}
|
||||||
|
>
|
||||||
|
<MenuItem value={'en_US'} >
|
||||||
|
<ReactCountryFlag
|
||||||
|
countryCode="US"
|
||||||
|
svg
|
||||||
|
cdnSuffix="svg"
|
||||||
|
title="US"
|
||||||
|
/>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem value={'de_DE'}>
|
||||||
|
<ReactCountryFlag
|
||||||
|
countryCode="DE"
|
||||||
|
svg
|
||||||
|
cdnSuffix="svg"
|
||||||
|
title="DE"
|
||||||
|
/>
|
||||||
|
</MenuItem>
|
||||||
|
</Select>
|
||||||
|
</MuiThemeProvider>
|
||||||
|
</div>
|
||||||
|
</div >
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapStateToProps = state => ({
|
||||||
|
language: state.general.language,
|
||||||
|
selectedBoard: state.board.board
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, { setLanguage, setBoard })(NavbarSettings);
|
||||||
@@ -18,6 +18,7 @@ import Divider from "@material-ui/core/Divider";
|
|||||||
import Typography from "@material-ui/core/Typography";
|
import Typography from "@material-ui/core/Typography";
|
||||||
import Backdrop from "@material-ui/core/Backdrop";
|
import Backdrop from "@material-ui/core/Backdrop";
|
||||||
import CircularProgress from "@material-ui/core/CircularProgress";
|
import CircularProgress from "@material-ui/core/CircularProgress";
|
||||||
|
import DeviceSelection from "../DeviceSelection";
|
||||||
|
|
||||||
const styles = (theme) => ({
|
const styles = (theme) => ({
|
||||||
link: {
|
link: {
|
||||||
@@ -60,9 +61,8 @@ class ProjectHome extends Component {
|
|||||||
this.setState({
|
this.setState({
|
||||||
snackbar: true,
|
snackbar: true,
|
||||||
key: Date.now(),
|
key: Date.now(),
|
||||||
message: `Dein angefragtes ${
|
message: `Dein angefragtes ${type === "gallery" ? "Galerie-" : ""
|
||||||
type === "gallery" ? "Galerie-" : ""
|
}Projekt konnte nicht gefunden werden.`,
|
||||||
}Projekt konnte nicht gefunden werden.`,
|
|
||||||
type: "error",
|
type: "error",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -108,6 +108,7 @@ class ProjectHome extends Component {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<h1>{data}</h1>
|
<h1>{data}</h1>
|
||||||
|
<DeviceSelection />
|
||||||
{this.props.progress ? (
|
{this.props.progress ? (
|
||||||
<Backdrop open invisible>
|
<Backdrop open invisible>
|
||||||
<CircularProgress color="primary" />
|
<CircularProgress color="primary" />
|
||||||
@@ -127,9 +128,8 @@ class ProjectHome extends Component {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Link
|
<Link
|
||||||
to={`/${
|
to={`/${data === "Projekte" ? "project" : "gallery"
|
||||||
data === "Projekte" ? "project" : "gallery"
|
}/${project._id}`}
|
||||||
}/${project._id}`}
|
|
||||||
style={{ textDecoration: "none", color: "inherit" }}
|
style={{ textDecoration: "none", color: "inherit" }}
|
||||||
>
|
>
|
||||||
<h3 style={{ marginTop: 0 }}>{project.title}</h3>
|
<h3 style={{ marginTop: 0 }}>{project.title}</h3>
|
||||||
@@ -153,7 +153,7 @@ class ProjectHome extends Component {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Link>
|
</Link>
|
||||||
{this.props.user &&
|
{this.props.user &&
|
||||||
this.props.user.email === project.creator ? (
|
this.props.user.email === project.creator ? (
|
||||||
<div>
|
<div>
|
||||||
<Divider
|
<Divider
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
import React from "react";
|
||||||
|
import Box from "@material-ui/core/Box";
|
||||||
|
import Tab from "@material-ui/core/Tab";
|
||||||
|
import TabContext from "@material-ui/lab/TabContext";
|
||||||
|
import TabList from "@material-ui/lab/TabList";
|
||||||
|
import TabPanel from "@material-ui/lab/TabPanel";
|
||||||
|
import store from "../store";
|
||||||
|
import ReactMarkdown from "react-markdown";
|
||||||
|
import * as Blockly from "blockly";
|
||||||
|
|
||||||
|
|
||||||
|
export default function LabTabs() {
|
||||||
|
const [value, setValue] = React.useState('1');
|
||||||
|
|
||||||
|
const handleChange = (event, newValue) => {
|
||||||
|
setValue(newValue);
|
||||||
|
};
|
||||||
|
|
||||||
|
// get the description in the current language if no lang is give return english or the first one
|
||||||
|
function filterLanguage(options) {
|
||||||
|
var lang;
|
||||||
|
if (window.localStorage.getItem("locale")) {
|
||||||
|
lang = window.localStorage.getItem("locale").split("_")[0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
lang = "en";
|
||||||
|
}
|
||||||
|
for (var i = 0; i < options.length; i++) {
|
||||||
|
if (options[i].languageCode === lang) {
|
||||||
|
return options[i].text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return options[0].text;
|
||||||
|
}
|
||||||
|
var currentStore = store.getState();
|
||||||
|
// ALL SENSOR DATA FROM WIKI
|
||||||
|
var sensorData = currentStore.sensorwiki;
|
||||||
|
// NAME OF SELECTED BLOCK
|
||||||
|
var sensorName = currentStore.workspace.code.data.name;
|
||||||
|
// SEARCH ALL DATA FOR SELECTED BLOCK NAME
|
||||||
|
var sensorInfo = sensorData.find(function (element) {
|
||||||
|
return element.slug === sensorName;
|
||||||
|
});
|
||||||
|
if (sensorInfo) {
|
||||||
|
sensorInfo.markdown = "Coming soon...";
|
||||||
|
|
||||||
|
// GET DESCRIPTION OF SELECTED BLOCK
|
||||||
|
sensorInfo.details = `# ${sensorName.toUpperCase()}
|
||||||
|
${Blockly.Msg.sensorinfo_explanation} [${sensorName.toUpperCase()}](https://sensors.wiki/sensor/detail/${sensorName})
|
||||||
|
## ${Blockly.Msg.sensorinfo_description}
|
||||||
|
${filterLanguage(sensorInfo.description.item)}
|
||||||
|
## ${Blockly.Msg.sensorinfo_measurable_phenos}
|
||||||
|
## ${Blockly.Msg.sensorinfo_manufacturer}
|
||||||
|
${sensorInfo.manufacturer}
|
||||||
|
## ${Blockly.Msg.sensorinfo_lifetime}
|
||||||
|
${sensorInfo.lifePeriod}`
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box sx={{ width: '100%', typography: 'body1' }}>
|
||||||
|
<TabContext value={value}>
|
||||||
|
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
|
||||||
|
<TabList onChange={handleChange}>
|
||||||
|
<Tab label="Basic Information" value="1" />
|
||||||
|
<Tab label="Details" value="2" />
|
||||||
|
</TabList>
|
||||||
|
</Box>
|
||||||
|
<TabPanel value="1">
|
||||||
|
{sensorInfo ? <ReactMarkdown>{sensorInfo.markdown}</ReactMarkdown> : "No data available"}
|
||||||
|
</TabPanel>
|
||||||
|
<TabPanel value="2">
|
||||||
|
{sensorInfo ? <ReactMarkdown>{sensorInfo.details}</ReactMarkdown> : "No data available"}
|
||||||
|
</TabPanel>
|
||||||
|
</TabContext>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,17 +1,41 @@
|
|||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
|
||||||
import withWidth from "@material-ui/core/withWidth";
|
import withWidth from "@material-ui/core/withWidth";
|
||||||
|
import { Button, Card } from "@material-ui/core";
|
||||||
import { Card } from "@material-ui/core";
|
|
||||||
import * as Blockly from "blockly";
|
import * as Blockly from "blockly";
|
||||||
import CardContent from "@material-ui/core/CardContent";
|
import CardContent from "@material-ui/core/CardContent";
|
||||||
|
|
||||||
import Typography from "@material-ui/core/Typography";
|
import Typography from "@material-ui/core/Typography";
|
||||||
import ReactMarkdown from "react-markdown";
|
import ReactMarkdown from "react-markdown";
|
||||||
|
import Dialog from "@material-ui/core/Dialog";
|
||||||
|
import DialogActions from "@material-ui/core/DialogActions";
|
||||||
|
import DialogContent from "@material-ui/core/DialogContent";
|
||||||
|
import Slide from "@material-ui/core/Slide";
|
||||||
|
import SensorInfo from "./SensorInfo";
|
||||||
|
import store from "../store";
|
||||||
|
|
||||||
|
const Transition = React.forwardRef(function Transition(props, ref) {
|
||||||
|
return <Slide direction="up" ref={ref} {...props} />;
|
||||||
|
});
|
||||||
|
|
||||||
class TooltipViewer extends Component {
|
class TooltipViewer extends Component {
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.inputRef = React.createRef();
|
||||||
|
this.state = {
|
||||||
|
open: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleDialog = () => {
|
||||||
|
this.setState({ open: !this.state });
|
||||||
|
};
|
||||||
|
|
||||||
|
openDialog = () => {
|
||||||
|
this.setState({ open: true });
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
@@ -29,14 +53,46 @@ class TooltipViewer extends Component {
|
|||||||
{Blockly.Msg.tooltip_viewer}
|
{Blockly.Msg.tooltip_viewer}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<ReactMarkdown linkTarget="_blank">
|
<Typography variant="body2" component="p">
|
||||||
{this.props.tooltip}
|
<ReactMarkdown linkTarget="_blank">
|
||||||
</ReactMarkdown>
|
{this.props.tooltip}
|
||||||
|
</ReactMarkdown>
|
||||||
{this.props.helpurl !== "" ? (
|
{store.getState().workspace.code.data ? (
|
||||||
<ReactMarkdown>{`${Blockly.Msg.tooltip_moreInformation} [${Blockly.Msg.labels_here}](${this.props.helpurl})`}</ReactMarkdown>
|
<Button
|
||||||
) : null}
|
label="Mehr"
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
onClick={() => {
|
||||||
|
this.openDialog();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Sensor Informationen
|
||||||
|
</Button>
|
||||||
|
) : (
|
||||||
|
<ReactMarkdown>{`${Blockly.Msg.tooltip_moreInformation} [${Blockly.Msg.labels_here}](${this.props.helpurl})`}</ReactMarkdown>
|
||||||
|
)}
|
||||||
|
</Typography>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
{store.getState().workspace.code.data ? (<Dialog
|
||||||
|
open={this.state.open}
|
||||||
|
TransitionComponent={Transition}
|
||||||
|
keepMounted
|
||||||
|
aria-describedby="alert-dialog-slide-description"
|
||||||
|
onClose={() => {
|
||||||
|
this.toggleDialog();
|
||||||
|
}}
|
||||||
|
maxWidth={"md"}
|
||||||
|
fullWidth={true}
|
||||||
|
>
|
||||||
|
<DialogContent>
|
||||||
|
<SensorInfo></SensorInfo>
|
||||||
|
</DialogContent>
|
||||||
|
<DialogActions>
|
||||||
|
<Button onClick={() => {
|
||||||
|
this.toggleDialog();
|
||||||
|
}}>Close</Button>
|
||||||
|
</DialogActions>
|
||||||
|
</Dialog>) : (null)}
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import Tooltip from "@material-ui/core/Tooltip";
|
|||||||
import IconButton from "@material-ui/core/IconButton";
|
import IconButton from "@material-ui/core/IconButton";
|
||||||
import Snackbar from "../Snackbar";
|
import Snackbar from "../Snackbar";
|
||||||
import Divider from "@material-ui/core/Divider";
|
import Divider from "@material-ui/core/Divider";
|
||||||
|
import DeviceSelection from "../DeviceSelection";
|
||||||
|
|
||||||
const styles = (theme) => ({
|
const styles = (theme) => ({
|
||||||
outerDiv: {
|
outerDiv: {
|
||||||
@@ -243,14 +244,11 @@ class TutorialHome extends Component {
|
|||||||
cy="50%"
|
cy="50%"
|
||||||
fill="none"
|
fill="none"
|
||||||
stroke-width="10"
|
stroke-width="10"
|
||||||
stroke-dashoffset={`${
|
stroke-dashoffset={`${75 * 2 * Math.PI * (1 - (50 / 100 + success / 2))
|
||||||
75 * 2 * Math.PI * (1 - (50 / 100 + success / 2))
|
}`}
|
||||||
}`}
|
stroke-dasharray={`${75 * 2 * Math.PI * (1 - (50 / 100 - success / 2))
|
||||||
stroke-dasharray={`${
|
} ${75 * 2 * Math.PI * (1 - (50 / 100 + success / 2))
|
||||||
75 * 2 * Math.PI * (1 - (50 / 100 - success / 2))
|
}`}
|
||||||
} ${
|
|
||||||
75 * 2 * Math.PI * (1 - (50 / 100 + success / 2))
|
|
||||||
}`}
|
|
||||||
></circle>
|
></circle>
|
||||||
)}
|
)}
|
||||||
{success < 1 && !error ? (
|
{success < 1 && !error ? (
|
||||||
@@ -265,9 +263,8 @@ class TutorialHome extends Component {
|
|||||||
cy="50%"
|
cy="50%"
|
||||||
fill="none"
|
fill="none"
|
||||||
stroke-width="10"
|
stroke-width="10"
|
||||||
stroke-dashoffset={`${
|
stroke-dashoffset={`${75 * 2 * Math.PI * (1 - (50 / 100 + success / 2))
|
||||||
75 * 2 * Math.PI * (1 - (50 / 100 + success / 2))
|
}`}
|
||||||
}`}
|
|
||||||
stroke-dasharray={`${75 * 2 * Math.PI}`}
|
stroke-dasharray={`${75 * 2 * Math.PI}`}
|
||||||
></circle>
|
></circle>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -279,8 +276,8 @@ class TutorialHome extends Component {
|
|||||||
tutorialStatus === "Error"
|
tutorialStatus === "Error"
|
||||||
? this.props.classes.outerDivError
|
? this.props.classes.outerDivError
|
||||||
: tutorialStatus === "Success"
|
: tutorialStatus === "Success"
|
||||||
? this.props.classes.outerDivSuccess
|
? this.props.classes.outerDivSuccess
|
||||||
: null
|
: null
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className={this.props.classes.innerDiv}>
|
<div className={this.props.classes.innerDiv}>
|
||||||
@@ -311,6 +308,7 @@ class TutorialHome extends Component {
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<DeviceSelection />
|
||||||
{this.props.user ? (
|
{this.props.user ? (
|
||||||
<div>
|
<div>
|
||||||
<h2>User Tutorials</h2>
|
<h2>User Tutorials</h2>
|
||||||
|
|||||||
@@ -38,6 +38,19 @@ export class Login extends Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
if (this.props.message.id === "LOGIN_FAIL") {
|
||||||
|
this.setState({
|
||||||
|
email: "",
|
||||||
|
password: "",
|
||||||
|
snackbar: true,
|
||||||
|
key: Date.now(),
|
||||||
|
message: Blockly.Msg.messages_LOGIN_FAIL,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
componentDidUpdate(props) {
|
componentDidUpdate(props) {
|
||||||
const { message } = this.props;
|
const { message } = this.props;
|
||||||
if (message !== props.message) {
|
if (message !== props.message) {
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class Compile extends Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {}
|
componentDidMount() { }
|
||||||
|
|
||||||
componentDidUpdate(props) {
|
componentDidUpdate(props) {
|
||||||
if (props.name !== this.props.name) {
|
if (props.name !== this.props.name) {
|
||||||
@@ -232,8 +232,8 @@ class Compile extends Component {
|
|||||||
>
|
>
|
||||||
<div className="overlay">
|
<div className="overlay">
|
||||||
{/* <img src={Copy} width="400" alt="copyimage"></img> */}
|
{/* <img src={Copy} width="400" alt="copyimage"></img> */}
|
||||||
<h2>Dein Code wird kompiliert!</h2>
|
<h2>{Blockly.Msg.compiledialog_process}</h2>
|
||||||
<p>übertrage ihn anschließend mithlfe der senseBoxConnect-App</p>
|
<p>{Blockly.Msg.compiledialog_instructions}</p>
|
||||||
<p>
|
<p>
|
||||||
{Blockly.Msg.compile_overlay_help}
|
{Blockly.Msg.compile_overlay_help}
|
||||||
<a href="/faq" target="_blank">
|
<a href="/faq" target="_blank">
|
||||||
@@ -291,7 +291,7 @@ class Compile extends Component {
|
|||||||
button={Blockly.Msg.button_close}
|
button={Blockly.Msg.button_close}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<p>Dein Code wurde erfolgreich kompiliert</p>
|
<p>{Blockly.Msg.compiledialog_success}</p>
|
||||||
<a href={this.state.link}>
|
<a href={this.state.link}>
|
||||||
<Button
|
<Button
|
||||||
style={{ color: "white" }}
|
style={{ color: "white" }}
|
||||||
@@ -303,7 +303,7 @@ class Compile extends Component {
|
|||||||
icon={faClipboardCheck}
|
icon={faClipboardCheck}
|
||||||
style={{ marginRight: "5px" }}
|
style={{ marginRight: "5px" }}
|
||||||
/>{" "}
|
/>{" "}
|
||||||
Starte Übertragung
|
{Blockly.Msg.tabletDialog_connect}
|
||||||
</Button>
|
</Button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,11 +15,13 @@ const compareNumberOfBlocks = (originalBlocks, userBlocks) => {
|
|||||||
var blocks;
|
var blocks;
|
||||||
if(originalBlocks.length > userBlocks.length){
|
if(originalBlocks.length > userBlocks.length){
|
||||||
blocks = originalBlocks.length-userBlocks.length;
|
blocks = originalBlocks.length-userBlocks.length;
|
||||||
return {text: `Es wurde${blocks === 1 ? '' : 'n'} ${blocks} Bl${blocks === 1 ? 'ock' : 'öcke'} zu wenig verwendet.`, type: 'error'};
|
//return {text: `Es wurde${blocks === 1 ? '' : 'n'} ${blocks} Bl${blocks === 1 ? 'ock' : 'öcke'} zu wenig verwendet.`, type: 'error'};
|
||||||
|
return {text: `Du kannst deinen Programmcode kompilieren, aber es wurde${blocks === 1 ? '' : 'n'} ${blocks} Bl${blocks === 1 ? 'ock' : 'öcke'} weniger verwendet als in der hinterlegten Lösung.`, type: 'success'};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
blocks = userBlocks.length-originalBlocks.length;
|
blocks = userBlocks.length-originalBlocks.length;
|
||||||
return {text: `Es wurde${blocks === 1 ? '' : 'n'} ${blocks} Bl${blocks === 1 ? 'ock' : 'öcke'} zu viel verwendet.`, type: 'error'};
|
//return {text: `Es wurde${blocks === 1 ? '' : 'n'} ${blocks} Bl${blocks === 1 ? 'ock' : 'öcke'} zu viel verwendet.`, type: 'error'};
|
||||||
|
return {text: `Du kannst deinen Programmcode kompilieren, aber es wurde${blocks === 1 ? '' : 'n'} ${blocks} Bl${blocks === 1 ? 'ock' : 'öcke'} mehr verwendet als in der hinterlegten Lösung.`, type: 'success'};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,12 @@ import ReactDOM from "react-dom";
|
|||||||
import "./index.css";
|
import "./index.css";
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
import * as serviceWorker from "./serviceWorker";
|
import * as serviceWorker from "./serviceWorker";
|
||||||
|
import store from "./store";
|
||||||
|
import { fetchSensors } from "./actions/sensorwikiActions";
|
||||||
|
|
||||||
|
store.dispatch(fetchSensors());
|
||||||
|
|
||||||
|
fetchSensors();
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
|
|||||||
@@ -1,9 +1,20 @@
|
|||||||
import { BOARD } from '../actions/types';
|
import { BOARD } from '../actions/types';
|
||||||
|
import mini_opacity from "../data/mini_opacity.png"
|
||||||
|
import mcu_opacity from "../data/mcu_opacity.png"
|
||||||
|
|
||||||
const initialValue = () => {
|
const initialValue = () => {
|
||||||
return "";
|
if (window.sessionStorage.getItem("board")) {
|
||||||
|
setBackgroundImage(window.sessionStorage.getItem("board"));
|
||||||
|
return window.sessionStorage.getItem("board");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const setBackgroundImage = (board) => {
|
||||||
|
const root = document.querySelector(':root');
|
||||||
|
root.style.setProperty('--url', `url(${board === "mcu" ? mcu_opacity : mini_opacity})`);
|
||||||
|
}
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
board: initialValue()
|
board: initialValue()
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ import generalReducer from './generalReducer';
|
|||||||
import projectReducer from './projectReducer';
|
import projectReducer from './projectReducer';
|
||||||
import messageReducer from './messageReducer';
|
import messageReducer from './messageReducer';
|
||||||
import authReducer from './authReducer';
|
import authReducer from './authReducer';
|
||||||
import boardReducer from './boardReducer'
|
import boardReducer from './boardReducer';
|
||||||
|
import sensorwikiReducer from './sensorwikiReducer';
|
||||||
|
|
||||||
export default combineReducers({
|
export default combineReducers({
|
||||||
auth: authReducer,
|
auth: authReducer,
|
||||||
@@ -16,5 +17,6 @@ export default combineReducers({
|
|||||||
builder: tutorialBuilderReducer,
|
builder: tutorialBuilderReducer,
|
||||||
project: projectReducer,
|
project: projectReducer,
|
||||||
general: generalReducer,
|
general: generalReducer,
|
||||||
message: messageReducer
|
message: messageReducer,
|
||||||
|
sensorwiki: sensorwikiReducer
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
const sensors = (state = [] , action) => {
|
||||||
|
switch(action.type) {
|
||||||
|
case 'FETCH_SENSORWIKI_SUCCESS':
|
||||||
|
return action.payload.sensors
|
||||||
|
default:
|
||||||
|
return state
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default sensors
|
||||||
Reference in New Issue
Block a user