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

No image found for data source causes UI bugs #84

Closed
Itaykal opened this issue Mar 31, 2023 · 0 comments · Fixed by #85
Closed

No image found for data source causes UI bugs #84

Itaykal opened this issue Mar 31, 2023 · 0 comments · Fixed by #85
Assignees

Comments

@Itaykal
Copy link
Contributor

Itaykal commented Mar 31, 2023

When there's no image for at least one of the data sources the UI wont load any data source.
This bug originates in app/api/data_source.py in line 33:

@staticmethod
    def from_data_source_class(name: str, data_source_class: BaseDataSource) -> 'DataSourceTypeDto':
        with open(f"static/data_source_icons/{name}.png", "rb") as file:
            encoded_string = base64.b64encode(file.read())
            image_base64 = f"data:image/png;base64,{encoded_string.decode()}"

        return DataSourceTypeDto(
            name=name,
            display_name=data_source_class.get_display_name(),
            config_fields=data_source_class.get_config_fields(),
            image_base64=image_base64,
            has_prerequisites=data_source_class.has_prerequisites()
        )

The function is lacking error handling, handle the errors and fix it.

@Itaykal Itaykal self-assigned this Mar 31, 2023
@Itaykal Itaykal linked a pull request Mar 31, 2023 that will close this issue
@Roey7 Roey7 closed this as completed in #85 Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant