Skip to content

Commit

Permalink
Merge pull request #53 from oslabs-beta/tony/frontendERD
Browse files Browse the repository at this point in the history
dev readme udpate
  • Loading branch information
annni11 authored Aug 23, 2023
2 parents 8773fb3 + 3c39949 commit 6d63603
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion DEV_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ else (database === DBType.sqlite) {}<br>

<img src="./assets/readmeImages/erdArchitecture.png" height=500/>

<p>The road map is finish connecting the siloed pieces for postgres, then moving on to mysql</p>
<p>The road map is finish connecting the siloed pieces for postgres, then moving on to mysql <br><br> <b>***Important*** <br> There is not an entry for this system yet but this file frontend/components/iews/ERTables/ERDisplayWindow.tsx will replace frontend/components/iews/ERTables/ERTabling.tsx when this is ready</b></p>

<p><b>2. ERD Logic Update</b><br>Currently, previous wrote the frontend to send back a big bundle of all the operations done in the frontend ERD Table. This ERD table object is divided by add, drop, and alter. All the add operations will execute first then drop, then alter. This is <b>BAD</b>. <br><br> We need to redesign frontend to send back "sequental" operations instead of bundling operations by add, drop, alter because it takes care of multiple edge cases and users in the front can do as many operations they want to ensure <b>SAVE</b> works. I illustrated the problem below. The current backend is written out already. We just need to make sure the frontend is send back the appropriate logic</p>

<img src="./assets/readmeImages/ERD_before_after.png" height=500/>

<br><br> <b>**_Important_** <br> This is wrtten at backend/src/ipcHandlers/dbCRUDHandlerERD.ts and will replace backend/src/ipcHandlers/dbCRUDHandler.ts when this is ready</b>

<p><b>3. Async event emmiters between front/backend</b></p>
<p>Currently, the way the feedback modal works is by handling events that are emitted from both the frontend and the backend. Ideally, this should be refactored to be state dependent rather than event dependent, as it controls the display of the modal. This can be tied into the centralized async event emitter added to frontend/components/app.tsx, in conjunction with migration to reducers from state variables. The goal will be to house modal messages in the store tied to the main app reducer. From there, the async handler can send new messages to the state via main app dispatch, and any other front end feedback can do the same.<br><br>
The main roadblock in the way of finalizing the transfer of event handlers out of the frontend is the way the dblist (list of databases in the sidebar) gets updated. Many event handlers in the backend send a dblist update event out to update the front end. Ideally, this should be handled by returning the new dblist changes out of the handler and using that resolved value to update state whenever an action would cause a dblist change. Right now, app.tsx has a useEffect running that listens for those dblist updates every frame. This is inefficient as a frontend concern.<br><br>
Expand Down

0 comments on commit 6d63603

Please sign in to comment.