| Summary: |
Layers table is not updated correctly when "all/in project/not in project" filter is applied |
| Product: |
[Build System, Metadata & Runtime] Toaster
|
Reporter: |
Elliot Smith <elliot.smith> |
| Component: |
toaster | Assignee: |
Michael Wood <michael.g.wood> |
| Status: |
VERIFIED
FIXED
|
QA Contact: |
Alexandru Roman <alexandru.costinx.roman> |
| Severity: |
normal
|
|
|
| Priority: |
Medium
|
CC: |
alexandru.costinx.roman, belen.barros.pena, jessica.zhang, stanciux.mihail
|
| Version: |
2.0 | |
|
| Target Milestone: |
2.0 | |
|
| Hardware: |
x86 | |
|
| OS: |
Multiple | |
|
| Whiteboard: |
|
|
OS type for building Yocto:
|
---
|
Type of Regression:
|
---
|
|
Verified:
|
|
Documentation change:
|
No (bug/feature does not impact docs)
|
Bug noted on master @ 75bad1b64bd485a50af69ed1f8663a0dadbb5f9e Selecting one of the layer state filter options, i.e. - "All" - "Layers added to this project" - "Layers not added to this project" from the filter button on the "Add | Delete" column does not update the add/remove buttons for the displayed layers correctly. For example: (1) After the "Layers added to this project" filter is applied, layers in the project still display the "Add layer" button, rather than the "Remove layer" one. (2) After the "Layers not added to this project" filter is applied, layers not in the project still display the "Remove layer" button rather than the "Add layer" one. To replicate (1): * Start Toaster in managed mode. * Add a new project. * Click the "Layers" link in the "Compatible metadata" menu (left-hand side). * Add a layer via its "Add layer" button. NB the layer is added correctly. * Change the filter (funnel icon in right-most column) to "Layers added to this project". The layers display correctly in the filtered list, but they have the wrong buttons ("Add layer" rather than "Remove layer"). Refreshing the page shows the correct buttons. The source of the issue seems to be that the ctx for the page is set when the page is first loaded, including which layers are in the project; however, when you apply the filter, the ctx is not changed, so it contains old information about the project's layers. Because tableInit() resets the show/hide state of the add/remove layer buttons every time it's called, the information about the current state of the layer is then being overwritten when the filter is applied to the table.