0.111.0 • Published 7 years ago

react-talend-components v0.111.0

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
7 years ago

react-talend-components

A set of stateless components which follows the Talend Guidelines

NPM

Travis CI Quality dependencies devdependencies peerdependencies Codacy Badge

Conventions

Please look at our CONTRIBUTING first.

Please read our style guidelines first.

Supported browsers

Thanks to BrowserStack for providing real browser testing infrastructure.

How to create a new component

All components are created using the yeoman talend generator using stateless option.

yo talend:react-component
> (nature) stateless
> (tests) snapshot

No {children} for leaf

We want to avoid {children} as much as possible. We believe an app should only pass arguments to stateless components.

So please don't do Pull Requests (PR) to add {children} on leaf components.

But what is a leaf component ? It's a component that is not supposed to contain another component. For example the following components are leaf components:

  • AppHeaderBar
  • SidePanel
  • List
  • Breadcrumb
  • Icon
  • Action(s)

But the following are not leaf:

  • Layout

If you feel the need to add {children} this means we have forget a use case. In this case please expose your use case and try to see how it could be done by passing some props.

onClick / onEvent

The API we have for all components is the following for an event handler

const onClick(event, payload) {
	//do what ever you want
}
return <APureComponents onClick={onClick} />

Write tests + docs

Our tests are using the react-test-renderer aka snapshot testing. This is by far the best tool to test pure components.

For the documentation and developpement environnement we are using React StoryBook.

    npm start

No anchor

If you want to create a link please use Action component which accept a link prop.

Anchor need href. We are in a single page application, so JavaScript decides the behavior, not the browser. So we don't want to see any anchor link in the markup.

If you want to use Button from react-bootstrap don't forget to add the role + bsStyle="link".

const model = {id: ...};
const onClick(event, payload) {
	//do what ever you want
	payload.action.label === 'click me';
	payload.model === model;
};
<Action
	label="click me"
	icon="svg-yeah"
	onClick={onClick}
	model={model}
	/>

Use Icon for icon

We all are used to <i className="fa fa-XX" /> but this is finished now. We are using <Icon name="fa-xx" /> because with this one we are able to support svg icons which is on the way to be our next gen icons sets.

If you want you can register an new Icon this way:

Icon.register('svg-test', (<svg viewBox="0 0 20 20"><path d="M10.219,1.688c-4.471,0-8.094,3.623-8.094,8.094s3.623,8.094,8.094,8.094s8.094-3.623,8.094-8.094S14.689,1.688,10.219,1.688 M10.219,17.022c-3.994,0-7.242-3.247-7.242-7.241c0-3.994,3.248-7.242,7.242-7.242c3.994,0,7.241,3.248,7.241,7.242C17.46,13.775,14.213,17.022,10.219,17.022 M15.099,7.03c-0.167-0.167-0.438-0.167-0.604,0.002L9.062,12.48l-2.269-2.277c-0.166-0.167-0.437-0.167-0.603,0c-0.166,0.166-0.168,0.437-0.002,0.603l2.573,2.578c0.079,0.08,0.188,0.125,0.3,0.125s0.222-0.045,0.303-0.125l5.736-5.751C15.268,7.466,15.265,7.196,15.099,7.03" /></svg>));

Add component into screenshot CI

open screenshots.config.json file.

The top of the file should stay unchanged. The stories are registred this way:

    "Action": {
      "default": [
        {
          "name": "action-default",
          "selector": ["#default", "#hidelabel"]
        }
      ]
    },
  • Action is the string name of 'storiesOf(' call
  • default is the exact string of the .add / .addWithInfo call
  • the content is an array of Object with name + selector
  • name will be the name of the screenshot(s)
  • selector is a string or an array of string which is behind used to call document.querySelect(selector) so you can try your selector.

npm scripts

  • npm start -> launch storybook on localhost:6006
  • npm run prepublish -> build the sources into the lib folder
  • npm test -> to execute unit test
  • npm run lint -> check the code style
  • npm run watch -> watch the source to trigger a build

LICENSE

Copyright (c) 2006-2016 Talend

Licensed under the Apache V2 License

0.111.0

7 years ago

0.110.0

7 years ago

0.109.0

7 years ago

0.108.0

7 years ago

0.107.0

7 years ago

0.106.0

7 years ago

0.105.0

7 years ago

0.104.0

7 years ago

0.103.0

7 years ago

0.102.4

7 years ago

0.102.3

7 years ago

0.102.1

7 years ago

0.102.0

7 years ago

0.101.0

7 years ago

0.100.0

7 years ago

0.99.0

7 years ago

0.98.0

7 years ago

0.97.0

7 years ago

0.96.0

7 years ago

0.95.0

7 years ago

0.94.0

7 years ago

0.93.0

7 years ago

0.92.0

7 years ago

0.91.0

7 years ago

0.90.0

7 years ago

0.89.0

7 years ago

0.88.0

7 years ago

0.87.0

7 years ago

0.86.0

7 years ago

0.85.1

7 years ago

0.85.0

7 years ago

0.84.0

7 years ago

0.83.1

7 years ago

0.83.0

7 years ago

0.82.0

7 years ago

0.81.0

7 years ago

0.80.0

7 years ago

0.79.0

7 years ago

0.78.0

7 years ago

0.77.0

7 years ago

0.76.0

7 years ago

0.75.1

7 years ago

0.75.0

7 years ago

0.74.2

7 years ago

0.74.1

7 years ago

0.74.0

7 years ago

0.73.0

7 years ago

0.72.3

7 years ago

0.72.2

7 years ago

0.72.1

7 years ago

0.72.0

7 years ago

0.71.2

7 years ago

0.71.1

7 years ago

0.71.0

7 years ago

0.70.1

7 years ago

0.70.0

7 years ago

0.69.0

7 years ago

0.68.1

7 years ago

0.68.0

7 years ago

0.67.0

7 years ago

0.66.4

7 years ago

0.66.3

7 years ago

0.66.2

7 years ago

0.66.1

7 years ago

0.66.0

7 years ago

0.65.0

7 years ago

0.64.0

7 years ago

0.63.1

7 years ago

0.63.0

7 years ago

0.62.0

7 years ago

0.61.4

7 years ago

0.61.3

7 years ago

0.61.2

7 years ago

0.61.1

7 years ago

0.61.0

7 years ago

0.60.7

7 years ago

0.60.6

7 years ago

0.60.5

7 years ago

0.60.4

7 years ago

0.60.3

7 years ago

0.60.2

7 years ago

0.52.0

7 years ago

0.51.1

7 years ago

0.51.0

7 years ago

0.50.6

7 years ago

0.50.5

7 years ago

0.50.4

7 years ago

0.50.3

7 years ago

0.50.2

7 years ago

0.50.1

7 years ago

0.50.0

7 years ago

0.49.1

7 years ago

0.49.0

7 years ago

0.48.0

7 years ago

0.47.5

7 years ago

0.47.4

7 years ago

0.47.3

7 years ago

0.47.2

7 years ago

0.47.1

7 years ago

0.47.0

7 years ago

0.46.1

7 years ago

0.46.0

7 years ago

0.45.0

7 years ago

0.44.0

7 years ago

0.43.1

7 years ago

0.43.0

7 years ago

0.42.0

7 years ago

0.41.2

7 years ago

0.41.1

7 years ago

0.41.0

7 years ago

0.40.0

7 years ago

0.39.2

7 years ago

0.39.1

7 years ago

0.39.0

7 years ago

0.38.3

7 years ago

0.38.2

7 years ago

0.38.1

7 years ago

0.38.0

7 years ago

0.37.0

7 years ago

0.36.4

7 years ago

0.36.3

7 years ago

0.36.2

7 years ago

0.36.1

7 years ago

0.36.0

7 years ago

0.35.1

7 years ago

0.35.0

7 years ago

0.34.2

7 years ago

0.34.1

7 years ago

0.34.0

7 years ago

0.33.0

7 years ago

0.32.0

7 years ago

0.31.0

7 years ago

0.30.2

7 years ago

0.30.1

7 years ago

0.30.0

7 years ago

0.29.0

7 years ago

0.28.0

7 years ago

0.27.0

7 years ago

0.26.5

7 years ago

0.26.4

7 years ago

0.26.3

7 years ago

0.26.2

7 years ago

0.26.1

7 years ago

0.26.0

7 years ago

0.25.5

7 years ago

0.25.4

7 years ago

0.25.3

7 years ago

0.25.2

7 years ago

0.25.1

7 years ago

0.25.0

7 years ago

0.24.0

7 years ago

0.23.0

7 years ago

0.22.0

7 years ago

0.21.1

7 years ago

0.21.0

7 years ago

0.20.1

7 years ago

0.20.0

7 years ago

0.19.0

7 years ago

0.18.2

7 years ago

0.18.1

7 years ago

0.18.0

7 years ago

0.17.2

7 years ago

0.17.1

7 years ago

0.17.0

7 years ago

0.16.0

7 years ago

0.15.2

7 years ago

0.15.1

7 years ago

0.15.0

7 years ago

0.14.4

7 years ago

0.14.3

7 years ago

0.14.2

7 years ago

0.14.1

7 years ago

0.14.0

7 years ago

0.13.1

7 years ago

0.13.0

7 years ago

0.12.2

7 years ago

0.12.1

7 years ago

0.12.0

7 years ago

0.11.0

7 years ago

0.10.3

7 years ago

0.10.2

7 years ago

0.10.1

7 years ago

0.10.0

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.8.7

7 years ago

0.8.6

7 years ago

0.8.5

7 years ago

1.0.0

7 years ago

0.8.4

7 years ago

0.8.3

7 years ago

0.8.2

7 years ago

0.8.1

7 years ago

0.8.0

7 years ago

0.7.2

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago