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

[BUG] onSelectedDataSources not acting as expected for DataSourceMenu selectable #6367

Closed
derek-ho opened this issue Apr 8, 2024 · 4 comments
Labels
bug Something isn't working multiple datasource multiple datasource project untriaged

Comments

@derek-ho
Copy link
Contributor

derek-ho commented Apr 8, 2024

Describe the bug

There is a bug that DataSourceMenu selectable view is always setting the selected datasource as the default one, even after user select otherwise.

In my local code, console log shows that I select a local cluster (default is 9202):

{
    "id": "",
    "label": "Local cluster"
}

In DataSourceMenu component, this is successfully logged out as the activeOption

[
    {
        "id": "",
        "label": "Local cluster"
    }
]

In DataSourceSelectable component, after getDefaultDatasource function it changes back to the default:

[
    {
        "id": "94ffa650-f11a-11ee-a585-793f7b098e1a",
        "label": "9202"
    }
]

Can reproduce this by setting up datasource menu with multiple option, and use the selectable config, and try to select anything that isn't the default. The onSelectedDataSources function will keep on outputting the default even after you select something different.

@yujin-emma
Copy link
Contributor

Hi, @derek-ho , for case 3, could you also please provide the dataSourceOption list, just want to confirm

[
    {
        "id": "94ffa650-f11a-11ee-a585-793f7b098e1a",
        "label": "9202"
    }
]

exist in the datsSourceOption list and dataSourceId is valid

@derek-ho
Copy link
Contributor Author

derek-ho commented Apr 8, 2024

Hi @yujin-emma sorry for the confusion - these are not 3 cases that I am testing, it is one case - basically I am selecting a different option other than the default, and it is being passed fine at least into the datasourcemenu component. However, within the datasourceselectable component it is somehow getting reset to the default one, even if passed in activeoption

@derek-ho
Copy link
Contributor Author

derek-ho commented Apr 9, 2024

@yujin-emma @zhongnansu I just pulled main and the bug is gone - if changes were made that address this I think we can close?

@zhongnansu
Copy link
Member

zhongnansu commented Apr 9, 2024

@yujin-emma @zhongnansu I just pulled main and the bug is gone - if changes were made that address this I think we can close?

@derek-ho couldn't reproduce, I tried DataSourceSelectable in example plugin, it successfully print out the selected data source instead of default . Closing for now If there's still issue, feel free to reopen.
image

@zhongnansu zhongnansu added the multiple datasource multiple datasource project label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working multiple datasource multiple datasource project untriaged
Projects
None yet
Development

No branches or pull requests

3 participants