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

Fix table column visibility preferences triggering redundant requests #727

Merged
merged 1 commit into from
Feb 3, 2024

Conversation

nscuro
Copy link
Member

@nscuro nscuro commented Feb 3, 2024

Description

Fixes table column visibility preferences triggering redundant requests.

Addressed Issue

N/A

Additional Details

When applying user preferences for column visibility, fields of the bootstrap table were accessed directly. Apparently the bootstrap table has watches on those fields, which caused table contents to be loaded at least twice, instead of once.

This does not happen when using the "official" table.showColumn / table.hideColumn methods. Switching to those no longer causes duplicate requests.

Checklist

When applying user preferences for column visibility, fields of the bootstrap table were accessed directly. Apparently the bootstrap table has watches on those fields, which caused table contents to be loaded at least twice, instead of once.

This does not happen when using the "official" `table.showColumn` / `table.hideColumn` methods. Switching to those no longer causes duplicate requests.

Signed-off-by: nscuro <nscuro@protonmail.com>
@nscuro nscuro added the defect Something isn't working label Feb 3, 2024
@nscuro nscuro added this to the 4.11 milestone Feb 3, 2024
@nscuro nscuro merged commit 22371f5 into DependencyTrack:master Feb 3, 2024
9 checks passed
@nscuro nscuro deleted the fix-redundant-request branch February 3, 2024 20:03
@rkg-mm
Copy link
Contributor

rkg-mm commented Feb 4, 2024

@nscuro does this fix the same as I fixed in #658 (see additional section)?

@nscuro
Copy link
Member Author

nscuro commented Feb 4, 2024

Ah, sorry it didn't occur to me that you already identified and fixed this particular issue!

Looks like our solutions are different but achieve the same thing. Reading the Defer URL docs it looks like the more sustainable approach, so may use that instead of what I hacked together. 😆

@rkg-mm
Copy link
Contributor

rkg-mm commented Feb 4, 2024

Yes I came across this when implementing the other stuff and fixed it directly since it had an effect on what I did there :D maybe should have documented it better :D Yes I think that would be the better approach

@nscuro
Copy link
Member Author

nscuro commented Feb 4, 2024

Hmmm I just tested and deferUrl is not universally usable. For example in the project list, it causes the list to always be empty until a project is added or the filter toggles are used. Using the table's refresh button does nothing.

@rkg-mm
Copy link
Contributor

rkg-mm commented Feb 4, 2024

Hmm ok I didn't notice any issues :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants