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 type errors in Visualization Builder #3025

Closed
tmarkley opened this issue Dec 4, 2022 · 3 comments · Fixed by #3732
Closed

Fix type errors in Visualization Builder #3025

tmarkley opened this issue Dec 4, 2022 · 3 comments · Fixed by #3732
Assignees
Labels
good first issue Good for newcomers help wanted Community development is encouraged technical debt If not paid, jeapardizes long-term success and maintainability of the repository. typescript v2.7.0 vis builder

Comments

@tmarkley
Copy link
Contributor

tmarkley commented Dec 4, 2022

Task for #1660

PR: (many PRs)

Code owners can you help address this?
@ashwin-pc @abbyhu2000

There were also many instances of implicit any that I temporarily fixed in #3022:

https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3022/files#diff-352c660687bf179d2b9b6571083659d169ceb9333a8e65a6628d7f713133c27e

$ tsc --noEmit
...

src/plugins/vis_builder/public/embeddable/disabled_embeddable.tsx:11:10 - error TS2724: '"./vis_builder_embeddable"' has no exported member named 'VisBuilderInput'. Did you mean 'VisBuilderOutput'?

11 import { VisBuilderInput, VISBUILDER_EMBEDDABLE } from './vis_builder_embeddable';
            ~~~~~~~~~~~~~~~

src/plugins/vis_builder/public/plugin.ts:135:13 - error TS2322: Type 'string | number | boolean | SavedObjectAttributes | SavedObjectAttributeSingle[]' is not assignable to type 'string | undefined'.
  Type 'number' is not assignable to type 'string'.

135             description: attributes?.description!,
                ~~~~~~~~~~~

  src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts:43:3
    43   description?: string;
         ~~~~~~~~~~~
    The expected type comes from property 'description' which is declared here on type 'VisualizationListItem'

src/plugins/vis_builder/public/plugin.ts:142:13 - error TS2322: Type 'string | number | boolean | SavedObjectAttributes | SavedObjectAttributeSingle[]' is not assignable to type 'string'.
  Type 'number' is not assignable to type 'string'.

142             title: attributes?.title!,
                ~~~~~

  src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts:42:3
    42   title: string;
         ~~~~~
    The expected type comes from property 'title' which is declared here on type 'VisualizationListItem'

@joshuarrrr joshuarrrr added technical debt If not paid, jeapardizes long-term success and maintainability of the repository. typescript good first issue Good for newcomers help wanted Community development is encouraged and removed untriaged labels Dec 6, 2022
@DaniilShest
Copy link

DaniilShest commented Mar 18, 2023

I want to pick up this issue. Most of errors are already solved, but I want to solve this error src/plugins/vis_builder/public/embeddable/disabled_embeddable.tsx:11:10 - error TS2724: '"./vis_builder_embeddable"' has no exported member named 'VisBuilderInput'. Did you mean 'VisBuilderOutput'?
Do I need to create a new Interface something like this?
image
Am i right?

@DaniilShest
Copy link

Can you please take a look on my solution? I created a new Interface in src\plugins\vis_builder\public\embeddable\vis_builder_embeddable.tsx .
image
And then I replaced an expression in this file: src\plugins\vis_builder\public\embeddable\vis_builder_embeddable_factory.tsx
image Is it a right solution?

@ashwin-pc
Copy link
Member

@DaniilShest sorry i missed your earlier message, I have a PR coming out for another feature that fixes this too. I forgot to remove the label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Community development is encouraged technical debt If not paid, jeapardizes long-term success and maintainability of the repository. typescript v2.7.0 vis builder
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants