* passing onClick prop to header with the existing onChange method.
* basic test checking that label click fires the onChange method.
* cleaning up stuff caught by linting.
* feat: read control panel configs from registry
* fix: order imports
* fix: remove index.js and get items on-the-fly, remove extraOverrides
* fix: lint
* fix: unit tests
* fix: unit tests
* fix: lint
* fix: unit tests
* Separate vis-specific controls from centralized controls
* Remove comment
* Update state's vizType when switching to a new visualization. This fixes the renderTrigger bug.
* Rename functions for better readability
* Fix lint issues
* Fix nits
* Fix vscode rename mistake
* [WIP] bug fix for FixedOrMetricControl not rendering
* Updated value preview and type selection
* fix metric control not on setting polygon elevation data
* Updated layout of FoM comp
* linting fixes
* linting fix pt. 2
* linting fix pt. 3
* fix scatter tooltip to work with metric control
* Fixed tests
* Creating withVerification HOC
* Updating to use componentDidMount and componentDidUpdate and adding propTypes
* Adding tests to withVerification
* Adding documentation to withVerification
* Adding dropdown to DatasourceControl and ability to change datasource
* Style fixes
* Adding unit tests for datasource/get endpoint
* Fixing issue with dropdown overflow and style changes
* Fixing issues rebasing metadata button and fixing sort for datasource with no name
Summary: We want to allow grouping by on expressions, including the
ability to select expressions (without group-by). The UI ain't good yet
.. it is not at the feature parity of say adhoc filters/metrics that
come with a nice text-box to edit the SQL. But
this suffices for my usecase for now.
(The UI would have to be redone ... but that would require some refactoring
to merge the AdhocFilter/Metric/Popover stuff such that it can be used
for this use case too.)
Also fixed a bug in the SelectControl freeForm selection.
Allow selecting all columns easily: Added a new Select-All special item
that users can select to make all the options in the selectable show
up.
The ability to group by arbitrary expressions is useful because now two
users don't need to create custom computed-fields for this.
* Add d3 micro packages
* Replace d3 imports with specific modules import
* Define d3 colors
* import specific d3 submodules instead of entire d3
* update function name
* move function location and fix small bug
* Move primary color to control
* remove colorscalefactory usage
* remove unused d3
* fix unit test
* fix color picker
* use @superset-ui/color
* update package version
* remove files that are extracted
* replace all references
* fix two files
* Revert some changes to split to another PR
* remove adaptor
* Address Christine's comment
* remove d3 v3 from calendar
* remove d3.scale.threshold
* Get rid of colorScalerFactory and revise hexToRGB
* fix color cleaning
* fix lint
* [SIP-9] Introduce TypeScript
- Introduce TypeScript and co to both source and tests
- Define alias for src directory in both webpack config and jest config so we can avoid using long relative paths like ../../src in both source and tests
- Type check feature flags system to prevent typos of flag names
- Change the feature flags system and the flags on window instead of populating them through the state tree. When introducing the first SCOPED_FILTER feature flag, it became too difficult to pipe the flags through the state initializers and layers of components and containers (the resulting code is hard to read and has a handful of methods taking an additional feature flag map parameter). Given that feature flags don't change throughout the life time of the app, it is better to leave them on window for easy access than piping them through the global state tree, which is meant to store the state of the app which changes frequently.
- Add a barebone filter panel that only shows when the SCOPED_FILTER feature flag is on
* Remove unnecessary dev-dependency on gl
* - Adding linting for TypeScript files via tslint.
- Fixing linting for Javascript files importing Typscript files
- Also fix linting for Javascript files that now leverage the webpack alias for the src directory
- up Typescript and type def versions
* Rename src directory's webpack alias from @ to src to be more explicit.
* refactor color scheme
* Update data structure
* Update color scheme files
* wip
* convert all sequential schemes
* Update how color schemes are managed. Extend it for sequential schemes
* extract color setup into separate file
* Update imports
* update imports
* Add new functions to Registry
* Update ColorSchemeManager to extends Registry and update unit tests
* Add test for Registry
* Rename ColorSchemeManager to ColorSchemeRegistry
* Fix unit tests
* Update API
* Fix imports
* Add label field
* Fix reference to colors
* update SequentialScheme contructor
* Fix controls
* rename manager to registry
* Split sequential schemes into multiple files
* update sequential color labels
* add values and valuesAsPromise()
* use .values()
* [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.
* [feat] Feature flag system via config
Adding a feature flag system that is driven by superset_config.py. This change includes:
- Server side changes to specify a dedicated FEATURE_FLAG dictionary for listing feature flags. E.g.
```
FEATURE_FLAGS = { 'SCOPED_FILTER': true }
```
- Pass the new feature flags to client via bootstrap-data
- Client side changes to inject feature flags into the redux state tree for dashboard, explore view and SqlLab
- Client side refactor/clean up so the feature flags can be properly tested. Also avoid modifying incoming bootstrap data when creating initial state for the redux state tree
- Re-enable tests that were previously disabled for ExploreViewContainer
* Fix lint errors.
* Remove the partial attempt to get reference to src working in tests (so we don't have to write ../../../src and such in tests). This will in a separate PR.
* [explore] add "View samples" modal to action buttons
Also broke down the `View query` and `View results` as different
request so that viewing the query does not require fetching the results
anymore
* fix js tests
* lint
* Create new classes for handling categorical colors
* verify to pass existing unit tests
* separate logic for forcing color and getting color
* replace getColorFromScheme with CategoricalColorManager
* organize static functions
* migrate to new function
* Remove ALL_COLOR_SCHEMES
* move sequential colors to another file
* extract categorical colors to separate file
* move airbnb and lyft colors to separate files
* fix missing toFunction()
* Rewrite to support local and global force items, plus namespacing.
* fix references
* revert nvd3
* update namespace api
* Update the visualizations
* update usage with static functions
* update unit test
* add unit test
* rename default namespace
* add unit test for color namespace
* add unit test for namespace
* start unit test for colorschememanager
* add unit tests for color scheme manager
* check returns for chaining
* complete unit test for the new classes
* fix color tests
* update unit tests
* update unit tests
* move color scheme registration to common
* update unit test
* rename sharedForcedColors to parentForcedColors
* remove import
* Bumping react==16.4.1 & enzyme==3.3.0
The upgrade was pretty smooth except for a cryptic message coming
out of react-select around running multiple copies of React. It turns
out the `common` bundle had React and was conflicting with explore and
dashboard apps, only in 16.x. This somehow wasn't a problem in 15.x
outside of the wasted resources.
Running 16.4 should bring in all sorts of perf improvements and features
we've all been waiting for.
https://reactjs.org/blog/2017/09/26/react-v16.0.html
TODO: react-bootstrap-datetimepicker isn't compatible with React 16
* Trying to deprecate react-bootstrap-datetime
* Moving forward
* Reintroducing tests
* Improve URLs for Chart and Dashboard ModelViews
Prior to this, the ModelView for Chart and Dashboard would be
at `/slicemodelview/list/` and `/dashboardmodelview/list/`.
Now we have cleaner URLs at `/chart/list/` and `/dashboard/list/`
* Fix unrelated js lint
* addressing comments
* WIP
* Working version
* Clean code
* Fix lint
* Fix unit test; show only for sqla
* Working on UX
* Dropdown working 66%
* Working but needs CSS
* Fixed table
* Fix lint
* Fix unit test
* Fix languages path
* Fixes
* Fix Javascript lint
* [toasts] get rid of notify globals, refactor messageToasts for use by entire app
* [remove notify] use arrow func in ajax call
* fix lint + tests
* actually fix tests from messageToast refactor
* add 'test:one' npm script
* debugger
* [toasts] convert bootstrap flash messages to toasts in explore + sqllab
* [toasts][tests] import from right file
* [explore] fix autocomplete on verbose names
Currently when searching for metrics or groupbys, the autocomplete
search functionality only matches based on the metric_name, though in
some cases the verbose_name is displayed and disregarded for search
purposes.
Also another issue is that not all pre-defined metrics show up in the
drop down which is confusing. Users may have simple metrics for which
they setup a nice verbose name and/or description and expect to see
those in the dropdown.
This PR addresses it for metric and column-related dropdowns.
* Add unit test
* Added support for URLShortLinkButton to work for the dashboard case
* Fix lint errors and test
* Change references to 'slice' to 'chart'.
* Add unit tests to improve coverage
* Fixing lint errors
* Refactor to make URLShortLink more generic. Remove history modification code, redirect should be handling this.
* Remove history modification code, redirect should be handling this
* Generate a shorter link without the directory, and delegate default linked to the contents of window.location
* Fix lint errors
* Fix test_shortner test to check for new pattern
* Remove usage of addHistory to manipulate explore shortlink redirection
* Address build failure and using better practices for shortlink defaults
* Fixing alphabetical order
* More syntax mistakes
* Revert explore view history changes
* Fix use of component props, & rebase