Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor view/app/Query/query.tsx #503

Open
abelzis opened this issue Jan 9, 2024 · 0 comments
Open

Refactor view/app/Query/query.tsx #503

abelzis opened this issue Jan 9, 2024 · 0 comments
Assignees
Labels
tech debt Technical debt

Comments

@abelzis
Copy link
Collaborator

abelzis commented Jan 9, 2024

This file is a bit of a mess.

Refactor:

  1. Move the <DataGrid> part to its own file src/view/app/Components/Layout/Query/QueryFormTable.tsx.
  2. messageEvent function:
    a) consider adding event types
    b) move logic to it's own file
    c) it might even return a tsx element in some cases, which is not clear.
    d) in 'data' case there is a headerRenderer function assignment. This should be moved to the QueryFormTable.tsx file mentioned above (see addFilterRendererToColumns). Only the update of the state variables should be done here.
  3. handleKeyDown:
    a) add two enums: key and key code (consider https://www.npmjs.com/package/ts-key-enum BUT CREATE SEPARATE TICKET AND BRANCH)
    4. Replace view/app/Query/query.tsx components to more 'reactive' components #502
  4. Add interfaces to any type objects.
    6. Some of the functions can be moved to outside the main function or to a new file query.ts, e.g. setting column widths or other properties.
    7. Please add jsdoc comments to the functions, briefly explaining what it does and describing input parameters and return values. Please use typescript, so describe types, props etc.
@abelzis abelzis added the tech debt Technical debt label Jan 9, 2024
@abelzis abelzis added this to the February minor milestone Jan 9, 2024
@mmarkauskas mmarkauskas linked a pull request Mar 15, 2024 that will close this issue
@PauliusKu PauliusKu removed this from the March minor milestone Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech debt Technical debt
Projects
None yet
3 participants