fix save button (#8732)

This commit is contained in:
Vadim Ogievetsky 2019-10-24 15:25:28 -07:00 committed by Fangjin Yang
parent cc3650ee3b
commit efd669757e
4 changed files with 14 additions and 3 deletions

View File

@ -25,7 +25,7 @@ exports[`show log describe show log 1`] = `
<a <a
class="bp3-button bp3-minimal" class="bp3-button bp3-minimal"
download="test" download="test"
href="test" href="/some/base_url/druid/index/test/log"
role="button" role="button"
tabindex="0" tabindex="0"
> >

View File

@ -23,7 +23,9 @@ import { ShowLog } from './show-log';
describe('show log', () => { describe('show log', () => {
it('describe show log', () => { it('describe show log', () => {
const showLog = <ShowLog status={'RUNNING'} endpoint={'test'} downloadFilename={'test'} />; const showLog = (
<ShowLog status={'RUNNING'} endpoint={'/druid/index/test/log'} downloadFilename={'test'} />
);
const { container } = render(showLog); const { container } = render(showLog);
expect(container.firstChild).toMatchSnapshot(); expect(container.firstChild).toMatchSnapshot();
}); });

View File

@ -148,7 +148,12 @@ export class ShowLog extends React.PureComponent<ShowLogProps, ShowLogState> {
)} )}
<ButtonGroup className="right-buttons"> <ButtonGroup className="right-buttons">
{downloadFilename && ( {downloadFilename && (
<AnchorButton text="Save" minimal download={downloadFilename} href={endpoint} /> <AnchorButton
text="Save"
minimal
download={downloadFilename}
href={UrlBaser.base(endpoint)}
/>
)} )}
<Button <Button
text="Copy" text="Copy"

View File

@ -20,4 +20,8 @@ import 'core-js/stable';
import { configure } from 'enzyme'; import { configure } from 'enzyme';
import enzymeAdapterReact16 from 'enzyme-adapter-react-16'; import enzymeAdapterReact16 from 'enzyme-adapter-react-16';
import { UrlBaser } from './singletons/url-baser';
configure({ adapter: new (enzymeAdapterReact16 as any)() }); configure({ adapter: new (enzymeAdapterReact16 as any)() });
UrlBaser.baseUrl = '/some/base_url';