Skip to content
Snippets Groups Projects
Unverified Commit b4877b80 authored by Tom Robinson's avatar Tom Robinson Committed by GitHub
Browse files

Merge pull request #8493 from metabase/circle2-fe-linters

Add frontend linters to CircleCI 2 config
parents 2a98361a cb1e7189
No related branches found
No related tags found
No related merge requests found
......@@ -399,6 +399,42 @@ jobs:
- /home/circleci/.yarn-cache
- /home/circleci/metabase/metabase/node_modules
fe-linter-eslint:
<<: *defaults
steps:
- attach_workspace:
at: /home/circleci/
- restore_cache:
<<: *restore-fe-deps-cache
- run:
name: Run ESLint linter
command: yarn lint-eslint
no_output_timeout: 5m
fe-linter-prettier:
<<: *defaults
steps:
- attach_workspace:
at: /home/circleci/
- restore_cache:
<<: *restore-fe-deps-cache
- run:
name: Run Prettier formatting linter
command: yarn lint-prettier
no_output_timeout: 5m
fe-linter-flow:
<<: *defaults
steps:
- attach_workspace:
at: /home/circleci/
- restore_cache:
<<: *restore-fe-deps-cache
- run:
name: Run Flow type checker
command: yarn flow
no_output_timeout: 5m
fe-tests-karma:
<<: *defaults
steps:
......@@ -528,6 +564,15 @@ workflows:
- fe-deps:
requires:
- checkout
- fe-linter-eslint:
requires:
- fe-deps
- fe-linter-prettier:
requires:
- fe-deps
- fe-linter-flow:
requires:
- fe-deps
- fe-tests-karma:
requires:
- fe-deps
......
......@@ -88,6 +88,7 @@ type Props = {
parameterId: ParameterId,
defaultValue: string,
) => void,
setParameterIndex: (parameterId: ParameterId, index: number) => void,
editingParameter: ?Parameter,
......
......@@ -38,6 +38,7 @@ type Props = {
parameterId: ParameterId,
defaultValue: string,
) => void,
setParameterIndex?: (parameterId: ParameterId, index: number) => void,
removeParameter?: (parameterId: ParameterId) => void,
setEditingParameter?: (parameterId: ParameterId) => void,
};
......@@ -100,9 +101,17 @@ export default class Parameters extends Component {
}
}
handleSortEnd = ({ oldIndex, newIndex }) => {
handleSortEnd = ({
oldIndex,
newIndex,
}: {
oldIndex: number,
newIndex: number,
}) => {
const { parameters, setParameterIndex } = this.props;
setParameterIndex(parameters[oldIndex].id, newIndex);
if (setParameterIndex) {
setParameterIndex(parameters[oldIndex].id, newIndex);
}
};
render() {
......@@ -189,7 +198,6 @@ import {
SortableContainer,
SortableElement,
SortableHandle,
arrayMove,
} from "react-sortable-hoc";
const StaticParameterWidgetList = ({ children, ...props }) => {
......
......@@ -278,7 +278,7 @@ export default class NativeQueryEditor extends Component {
}
};
setParameterIndex = (parameterId, parameterIndex) => {
setParameterIndex = (parameterId: ParameterId, parameterIndex: number) => {
const { query, setDatasetQuery } = this.props;
query
.setParameterIndex(parameterId, parameterIndex)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment