Conversation
…to accomodate for some space for a gama simulation
…s and can't be written directly in the useState
…sed, and its functionnality is best done directly on the streamplayerscreen components instead of having another component that acts nearly the same
…efore using it to display misc informations
…actually used with a redefined this
…g in the selector simulation
…(containing only a single element), redefned it to array[]. Assigned simulationList to it on creation to avoid undefined cases, but added checks to avoid undefined issues by using ternary operators in the template that return null or a simple string if subProjectsList is undefined.
…onsole, and used template syntax of logger
…uce code scattering
…ot properly reset when selecting a sub project folder
… to manipulate, and easier to read
…tor. checking the size of the subProjectList is pointless now, as it is the only list used. Also clarified the comment explaining the div
… interface. These can be added back in a later interation of the app
…onent declaration
… by the MODEL and CATALOG defined in constants.
… catalog instead of testing the length of the attribute "entries", which is much cleaner
…hat the subprojectList[index] is always a VU_CATALOG_SETTING_JSON, and removed unecessary if statement, as we only use the subProjectsList for clarity now
…ained a set of subprojects, but this hceck is no longer necessary. Reworded the log ( couldn't separate this into 2 different commits)
…simulationList on component mounting.
…G_SETTING_JSON, VU_MODEL_SETTING_JSON instead. selected simulation is always of type MODEL, while simulationList can contain both.
…the error object.
…TALOG_SETTING_JSON
RoiArthurB
left a comment
There was a problem hiding this comment.
Better but still some work to really finish to cleaning the project.
Also, since you're using the interfaces to type received JSON, maybe you can do some check on them instead of the json.type == string. This would ensure that the rest of the code is manipulating this objects. But no necessary for this PR.
| } else if (Array.isArray(simulationList[index])) { | ||
| logger.debug(simulationList[index].model_file_path) | ||
|
|
||
| if (subProjectsList[index].type === "catalog") { //? we additionaly check if the simulation is a catalog, not necessary but allows for adding extra types |
There was a problem hiding this comment.
Also check that it's matching the interface VU_CATALOG_SETTING_JSON
| addToPath(index) | ||
| if (simulationList[index].splashscreen !== undefined) { | ||
| setSelectedSplashscreen(simulationList[index].splashscreen); | ||
|
|
There was a problem hiding this comment.
Wrong logger id name VideoStreamManager
| try { | ||
| addToPath(index) | ||
| logger.debug("[SELECTOR SIMULATION] handlesimulation, simulationList[index].type == catalog, {name}", { name: subProjectsList[0].name }); | ||
| logger.debug("[SELECTOR SIMULATION] handlesimulation, simulationList[index].type == catalog, {name}", { name: subProjectsList[index].name }); |
There was a problem hiding this comment.
Remove capsule and properly use Logtap configuration (you have to put those informations in the getLogger function)
| return updatedPlayerList; | ||
| }); | ||
| logger.info(" This player have been removed from playerList : ", id); | ||
| logger.info(" This player have been removed from playerList : ", {id}); |
| import pluginReact from "eslint-plugin-react"; | ||
| import { defineConfig } from "eslint/config"; | ||
|
|
||
| export default defineConfig([ |
There was a problem hiding this comment.
Please add comments to explain how you configured ESLint as it's a bit complicated to read as is
There was a problem hiding this comment.
I used "npm init @eslint/config@latest" as per the official documentation, followed the steps in the terminal, which ended up making this configuration file. I didn't write it by hand, nor should we read it
There was a problem hiding this comment.
I cannot directly answer to the comment, but since the types are not proper classes but instead instances, it would require implementing type guard functions as using instanceof is not possible since interfaces are ditched at runtime. As per the official typescript documentation, this would require creating a function that will also just check the type attribute of the interface.
A cleaner implementation (using instanceof) would require classes, which would make the constant file bigger and heavier, I think that the current system is a good compromise.
|



Pull Request
Checklist
Description
Addressed all eslint problems. This goes from simple syntaxic errors (not using brackets when using the logger for example) to bigger problems.
A special attention was paid to the Selector simulation component, reworked how it works to be a bit more unreliable, avoided cases where its list of simulation can be undefined by assigning it at creation, and having roadblocks avoiding trying to render undefined elements.
added "entries" property in the interface Simulation contained in the constants.ts file for better typing. Removed or commented a lot of unused functionalities, those mostly being the unused "gama display" mode, that is not going to be implemented in the foreseeable future, cleaning up massively some components.
cleaned up imports and unused variables.
Removed unused pages, like streamplayerscreenControl, whose functionnality can be implemented directly in streamplayerscreen. Removing it means less problems, only one file needs to be implemented. Removed unused Test component that should never have left the dev branch
I fixed my linter, which for some reason didn't highlight ~90% of errors
Related Issue