Commit Graph

17 Commits

Author SHA1 Message Date
Maxime Beauchemin
1dd4d7a587 Apply ASF licenses throughout the code base (#5800)
* Add license headers

* reabased

* lint

* Removing licenses from vendors folder
2019-01-15 15:53:27 -08:00
Krist Wongsuphasawat
fcec748b62 Use @superset-ui/number-format and @superset-ui/time-format for formatting. (#6470)
refactor: proxy all d3 number and time formatting calls
2018-12-04 13:24:07 -08:00
aboganas
71a713dcec replace missing round function in d3 to fix MapBox (#6444)
* replace missing round function in d3

* added unit test

* fixed linting
2018-11-27 21:34:27 -08:00
Krist Wongsuphasawat
3c6e882d28 [bugfix] Display raw value in addition to ERROR (#6417)
* Display raw value in addition to ERROR

* update unit test
2018-11-26 10:44:42 -08:00
Maxime Beauchemin
4690563d40 [bugfix] prevent d3-format from raising (#6386)
Since https://github.com/apache/incubator-superset/pull/6287 and
effectively moving to a new version of d3, d3-format and d3-time-format
raises when receiving invalid input strings.

This code wraps the potential issues inside `try` blocks that will
effectively return an `ERROR` string as output to the formatting
function.
2018-11-14 11:22:06 -08:00
Krist Wongsuphasawat
1473e2cced Integrate translation module @superset-ui/translation (#6222)
* add translation modules

* Update package.json

* Update instructions in CONTRIBUTING

* Remove old files

* Add new entry point "translation"

* Change imports

* move setupTranslation code

* remove translation from entry

* Update python template

* Refactor utils into smaller, independent files

* Define preamble

* working state

* combine toggleCheckbox with setupApp

* move code block out of document.ready

* move setupClient to preamble

* fix unit tests

* update package version

* delete deletion code
2018-10-30 14:51:44 -07:00
Chris Williams
d8d50a168d [superset-client] use getClientErrorObject for client error handling (#6163)
* [superset-client] use getClientErrorObject for client error handling

* fix getClientErrorObject json parsing

* fix getClientErrorObject test typos

* kick build
2018-10-22 22:42:56 -07:00
Christine Chambers
9029701f24 [refactor] Migrate from Mocha+Chai to Jest (#6079)
* [refactor] Migrate from Mocha+Chai to Jest

This change migrates all the existing unit tests
- to Jest's global expect and matchers from chai's imported expect, asserts and matchers.
- to Jest's describe/test from mocha's describe/it

The majority of the mechanical changes to tests are achieved through running jest-codemods. The only two note-worthy manual tweaks:
1. Setting a testURL of http://localhost in jest config and adjusting a few tests to leverage this value instead of relying on about:blank.
2. Re-enabling ExploreChartPanel_spec which was previously commented out as we cannot have empty tests with nothing in it with Jest. :)

This change also removes dependencies to Mocha and Chai.

* Remove the test:one command as it now does the same thing as test.

* Fixing lint errors. The diff looks large but is large done through `yarn run lint --fix`

The only noteworthy change is the one in eslintrc for tests. The env has been updated from mocha to jest.

* Adding eslint-plugin-jest and further modify tests.

- One small fix in sqllab's Timer Spec for a test that is not using the spy it created for testing.
- Deletion of a duplicated test caught by eslint-plugin-jest.

* - Make istanbul coverage work with Jest.

- Remove dependency on stand-alone istanbul and babel-istanbul as they're built-into jest. Yes!

* Attempt to fix dynamic imports in tests.

* run sequentially and log heap usage

* - tweaking maxworkers for travis and specifying coverageDirectory for codecov

- remove dynamic import in shim.js now that it is set in babelrc for tests only.
2018-10-15 13:10:18 -07:00
Krist Wongsuphasawat
4c21c65824 Remove lodash.throttle and replace underscore calls with lodash (#5946)
* remove lodash.throttle from dependency

* add babel-plugin-lodash'

* use lodash instead of underscore for isFunction

* switch underscore to lodash

* switch from underscore to lodash flatten

* Remove slugify and use kebabCase from lodash instead
2018-09-26 23:28:57 -07:00
Krist Wongsuphasawat
0e93a94ae4 [SIP-5] Refactor nvd3 (#5838)
* move into folder and scaffold adaptor

* extract width and height

* remove jquery

* extract showBrush

* extract lineInterpolation

* extract xAxisFormat and yAxisFormat

* extract annotationData

* extract xTicksLayout and colorScheme

* extract showXXX

* extract x and y axis labels

* extract showminmax

* extract pie chart props

* extract area chart props

* extract logscale and yAxisBounds

* extract margin

* extract bubble props x,y,size

* extract contribution, comparisonType and color_picker

* remove the last fd.xxx

* remove unnecessary variables

* remove slice.container

* fix unit test reference

* Rewrite logic to compute max label lengths to use only d3, not jquery.

* extract annotationLayers and no more slice.xxx in nvd3vis

* rename x, y, size to xField, yField, sizeField

* use arrow function

* move tooltip function

* extract helper functions into utils

* remove unused argument

* fix height calculation and show bar labels

* rename function

* update unit test

* organize tooltip generator

* update line_multi

* Add proptypes for data

* list proptypes for data

* extract tooltip function for bubble chart

* rename variables

* remove console.log

* enumerate vizTypes and pieLabelType

* parse maxBubble

* use new color scale

* fix import"

* remove line
2018-09-16 20:38:30 -07:00
Chris Williams
b453cd2bf2 [lint] turn no-undef back on, set browser, cypress, and mocha env's (#5879)
* [lint] turn no-undef back on, set browser, cypress, and mocha env's, and fix issues

* [lint] fix undefined var in TimeTable.jsx
2018-09-13 14:45:24 -07:00
Chris Williams
66fcf9b687 [formats] add better defaults for time + number formatting (#4843)
* [formats] add better defaults for time + number formatting

* [formatDate] add tests for concise formatDate

* [nvd3] use verbose time format in tooltips

* [number format] improve number format description

* [formats] revert to .3s defaults, tweak number format preview

* [formats] default number vis to .3s
2018-04-20 15:55:25 -07:00
Maxime Beauchemin
c0db6dbb57 Moving some JS folders (#4820)
* Moving folders

* Pointing to new locations
2018-04-17 21:05:01 -07:00
Maxime Beauchemin
ed9867c0cc Use 'count' as the default metric when available (#4606)
* Use 'count' as the default metric when available

Count is a much better default than the current behavior which is to use
whatever the first metric in the list happens to be.

* Addressing nits
2018-03-19 21:51:51 -07:00
Maxime Beauchemin
c21513fb8c Adding rowcount label to explore view header (#4059) 2017-12-15 11:47:44 -08:00
Maxime Beauchemin
3e51c61dbf [explore] improve bubble viz (#2927)
* [explore] improve bubble viz

* allow for custom axis formatters
* reorg the control panels

* Addressing comments
2017-06-19 22:09:09 -07:00
Maxime Beauchemin
74086dae2b [bars] fix sort numeric bar on x axis (#2812) 2017-05-30 11:18:25 -07:00