Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into zoltan/span-marker-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltanbedi committed Feb 23, 2021
2 parents b8a45d7 + 9ce07b1 commit fe20c23
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 18 deletions.
7 changes: 6 additions & 1 deletion e2e/suite1/specs/trace-view-scrolling.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { e2e } from '@grafana/e2e';
import { selectors } from '@grafana/e2e-selectors';

describe('Trace view', () => {
it('Can lazy load big traces', () => {
Expand All @@ -25,7 +26,11 @@ describe('Trace view', () => {

e2e().wait('@longTrace');

e2e.components.TraceViewer.spanBar().should('have.length', 100);
e2e()
.get(selectors.components.TraceViewer.spanBar(), { timeout: 50000 })
.should('be.visible')
.and('have.length', 100);

e2e.pages.Explore.General.scrollBar().scrollTo('center');

// After scrolling we should have 140 spans instead of the first 100
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,54 @@
import React from 'react';
import { renderComponentWithTheme } from '../../utils/storybook/withTheme';
import { CallToActionCard } from './CallToActionCard';
import { select, text } from '@storybook/addon-knobs';
import { CallToActionCard, CallToActionCardProps } from './CallToActionCard';
import { NOOP_CONTROL } from '../../../.storybook/preview';
import { Story } from '@storybook/react';
import { Button } from '../Button/Button';
import { action } from '@storybook/addon-actions';

export default {
title: 'Layout/CallToActionCard',
component: CallToActionCard,
parameters: {
knobs: {
disabled: true,
},
},
argTypes: {
Element: { control: { type: 'select', options: ['button', 'custom'] } },
className: NOOP_CONTROL,
callToActionElement: NOOP_CONTROL,
theme: NOOP_CONTROL,
},
};

export const basic = () => {
interface StoryProps extends Partial<CallToActionCardProps> {
Element: string;
H1Text: string;
buttonText: string;
}

export const Basic: Story<StoryProps> = (args) => {
const ctaElements: { [key: string]: JSX.Element } = {
custom: <h1>This is just H1 tag, you can any component as CTA element</h1>,
custom: <h1>{args.H1Text}</h1>,
button: (
<Button size="lg" icon="plus" onClick={action('cta button clicked')}>
Add datasource
{args.buttonText}
</Button>
),
};
const ctaElement = select(
'Call to action element',
{
Custom: 'custom',
Button: 'button',
},
'custom'
);

return renderComponentWithTheme(CallToActionCard, {
message: text('Call to action message', 'Renders message prop content'),
callToActionElement: ctaElements[ctaElement],
footer: text('Call to action footer', 'Renders footer prop content'),
message: args.message,
callToActionElement: ctaElements[args.Element],
footer: args.footer,
});
};

Basic.args = {
Element: 'custom',
message: 'Renders message prop content',
footer: 'Renders footer prop content',
H1Text: 'This is just H1 tag, you can any component as CTA element',
buttonText: 'Add datasource',
};
10 changes: 9 additions & 1 deletion packages/grafana-ui/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"exclude": ["**/*.story.tsx", "**/*.test.ts*", "**/*.tmpl.ts", "dist", "node_modules", "src/utils/storybook"],
"exclude": [
"**/*.story.tsx",
"**/*.story.internal.tsx",
"**/*.test.ts*",
"**/*.tmpl.ts",
"dist",
"node_modules",
"src/utils/storybook"
],
"extends": "./tsconfig.json"
}

0 comments on commit fe20c23

Please sign in to comment.