Skip to content

Commit

Permalink
refactor: remove unused code (apache#8300)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristw authored and Grace Guo committed Sep 30, 2019
1 parent f12de2a commit f8fd064
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 502 deletions.
1 change: 0 additions & 1 deletion superset/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@
"redux-undo": "^1.0.0-beta9-9-7",
"regenerator-runtime": "^0.13.3",
"shortid": "^2.2.6",
"underscore": "^1.8.3",
"urijs": "^1.18.10"
},
"devDependencies": {
Expand Down
47 changes: 0 additions & 47 deletions superset/assets/spec/javascripts/modules/colors_spec.jsx

This file was deleted.

42 changes: 0 additions & 42 deletions superset/assets/spec/javascripts/modules/geo_spec.jsx

This file was deleted.

32 changes: 0 additions & 32 deletions superset/assets/spec/javascripts/modules/sandbox_spec.jsx

This file was deleted.

99 changes: 0 additions & 99 deletions superset/assets/spec/javascripts/modules/time_spec.js

This file was deleted.

8 changes: 0 additions & 8 deletions superset/assets/spec/javascripts/modules/utils_spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import {
formatSelectOptionsForRange,
mainMetric,
roundDecimal,
} from '../../../src/modules/utils';

describe('utils', () => {
Expand Down Expand Up @@ -66,11 +65,4 @@ describe('utils', () => {
expect(mainMetric(metrics)).toBe('foo');
});
});
describe('roundDecimal', () => {
it('rounding method to limit the number of decimal digits', () => {
expect(roundDecimal(1.139, 2)).toBe(1.14);
expect(roundDecimal(1.13929, 3)).toBe(1.139);
expect(roundDecimal(1.13929)).toBe(1);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ import { decimal2sexagesimal } from 'geolib';

import TextControl from './TextControl';
import ControlHeader from '../ControlHeader';
import { defaultViewport } from '../../../modules/geo';

export const DEFAULT_VIEWPORT = {
longitude: 6.85236157047845,
latitude: 31.222656842808707,
zoom: 1,
bearing: 0,
pitch: 0,
};

const PARAMS = [
'longitude',
Expand All @@ -49,7 +56,7 @@ const propTypes = {
const defaultProps = {
onChange: () => {},
default: { type: 'fix', value: 5 },
value: defaultViewport,
value: DEFAULT_VIEWPORT,
};

export default class ViewportControl extends React.Component {
Expand Down
4 changes: 2 additions & 2 deletions superset/assets/src/explore/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ import {
mainMetric,
} from '../modules/utils';
import * as v from './validators';
import { defaultViewport } from '../modules/geo';
import ColumnOption from '../components/ColumnOption';
import OptionDescription from '../components/OptionDescription';
import { DEFAULT_VIEWPORT } from '../explore/components/controls/ViewportControl';

const categoricalSchemeRegistry = getCategoricalSchemeRegistry();
const sequentialSchemeRegistry = getSequentialSchemeRegistry();
Expand Down Expand Up @@ -1866,7 +1866,7 @@ export const controls = {
renderTrigger: false,
description: t('Parameters related to the view and perspective on the map'),
// default is whole world mostly centered
default: defaultViewport,
default: DEFAULT_VIEWPORT,
// Viewport changes shouldn't prompt user to re-run query
dontRefreshOnChange: true,
},
Expand Down
27 changes: 0 additions & 27 deletions superset/assets/src/modules/colors.js

This file was deleted.

57 changes: 0 additions & 57 deletions superset/assets/src/modules/geo.js

This file was deleted.

Loading

0 comments on commit f8fd064

Please sign in to comment.