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

[Fleet] add readme to uploaded package info and fix images #84944

Merged

Conversation

neptunian
Copy link
Contributor

@neptunian neptunian commented Dec 3, 2020

#84583

  • Add readme property and path if exists to package info
  • Have images in package details page use the src over the path property

Test

  • Upload a package
  • Visit Package details page of the uploaded package. See readme.md, screenshots, and logo loading correctly.

[screenshot coming]

@neptunian neptunian self-assigned this Dec 3, 2020
jfsiii pushed a commit to jfsiii/kibana that referenced this pull request Dec 3, 2020
Clarify EPR types relationship with package spec. i.e. what required properties it makes optional, what properties it adds, which property types it changes, etc.

3 TS errors and I think they're all expected to be fixed by elastic#84944

ERROR x-pack failed
      x-pack/plugins/fleet/public/applications/fleet/hooks/use_package_icon_type.ts:45:66 - error TS2339: Property 'path' does not exist on type 'PackageSpecIcon'.

      45     const localIconSrc = Array.isArray(svgIcons) && (svgIcons[0].path || svgIcons[0].src);
                                                                          ~~~~

      x-pack/plugins/fleet/public/applications/fleet/sections/epm/screens/detail/overview_panel.tsx:13:24 - error TS2339: Property 'readme' does not exist on type 'PackageInfo'.

      13   const { screenshots, readme, name, version } = props;
                                ~~~~~~

      x-pack/plugins/fleet/public/applications/fleet/sections/epm/screens/detail/overview_panel.tsx:18:36 - error TS2322: Type 'PackageSpecScreenshot[] | (PackageSpecScreenshot[] & RegistryImage[])' is not assignable to type 'RegistryImage[]'.
        Type 'PackageSpecScreenshot[]' is not assignable to type 'RegistryImage[]'.
          Property 'path' is missing in type 'PackageSpecScreenshot' but required in type 'RegistryImage'.

      18       {screenshots && <Screenshots images={screenshots} />}
                                            ~~~~~~

        x-pack/plugins/fleet/common/types/models/epm.ts:115:3
          115   path: string;
                ~~~~
          'path' is declared here.
        x-pack/plugins/fleet/public/applications/fleet/sections/epm/screens/detail/screenshots.tsx:14:3
          14   images: ScreenshotItem[];
               ~~~~~~
          The expected type comes from property 'images' which is declared here on type 'IntrinsicAttributes & ScreenshotProps'

      Found 3 errors.
@neptunian neptunian marked this pull request as ready for review December 3, 2020 21:11
@neptunian neptunian requested a review from a team December 3, 2020 21:11
@neptunian neptunian added the release_note:skip Skip the PR/issue when compiling release notes label Dec 3, 2020
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Dec 3, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@jfsiii
Copy link
Contributor

jfsiii commented Dec 4, 2020

@elasticmachine merge upstream

@jfsiii
Copy link
Contributor

jfsiii commented Dec 4, 2020

Ran merge to re-test. Looked like unrelated failure

@neptunian
Copy link
Contributor Author

@elasticmachine merge upstream

@neptunian neptunian force-pushed the 84583-add-info-uploaded-packages branch from c9df235 to 52d812e Compare December 4, 2020 14:09
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 1.1MB 1.1MB +298.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@neptunian neptunian merged commit db70286 into elastic:master Dec 4, 2020
neptunian added a commit to neptunian/kibana that referenced this pull request Dec 4, 2020
…84944)

* use the relative src instead of path for package images

* add readme to package info for uploaded packages

* let toPackageImage take the image object and check path if no src

* use variable
neptunian added a commit that referenced this pull request Dec 4, 2020
…85036)

* use the relative src instead of path for package images

* add readme to package info for uploaded packages

* let toPackageImage take the image object and check path if no src

* use variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants