Skip to content

Commit

Permalink
[Fleet] Fix image in readme for installed integration (#188476)
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet authored Jul 16, 2024
1 parent f02a41c commit 601e42e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export function useLinks() {
version: string;
}) => {
const imagePath = removeRelativePath(path);
const filePath = `${epmRouteService.getInfoPath(packageName, version)}/${imagePath}`;

const filePath = `${epmRouteService.getInfoPath(packageName, version)}${imagePath}`;
return http.basePath.prepend(filePath);
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ describe('Readme', () => {
const img = result.getByAltText('Image');

expect(img).toHaveStyle('max-width: 100%');
expect(img).toHaveAttribute('src', '/mock/api/fleet/epm/packages/test/1.0.0//img/image.png');
expect(img).toHaveAttribute('src', '/mock/api/fleet/epm/packages/test/1.0.0/img/image.png');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function Readme({
(uri: string) => {
const isRelative =
uri.indexOf('http://') === 0 || uri.indexOf('https://') === 0 ? false : true;

const fullUri = isRelative ? toRelativeImage({ packageName, version, path: uri }) : uri;
return fullUri;
},
Expand Down

0 comments on commit 601e42e

Please sign in to comment.