Unverified Commit 8f0cf22c authored by Marcos Iglesias's avatar Marcos Iglesias Committed by GitHub

Removes unnecessary ESLint rule; fixes no-use-before-define issues and removes ESLint rule (#537)

parent 82d843e9
......@@ -11,17 +11,12 @@ import { BrowsePage } from '..';
describe('BrowsePage', () => {
const setup = () => {
const wrapper = shallow<BrowsePage>(<BrowsePage />);
return { props, wrapper };
return shallow<BrowsePage>(<BrowsePage />);
};
let props;
let wrapper;
beforeAll(() => {
const setupResult = setup();
props = setupResult.props;
wrapper = setupResult.wrapper;
wrapper = setup();
});
describe('render', () => {
......
......@@ -9,18 +9,6 @@ import { filterFromObj } from 'ducks/utilMethods';
import { UpdateSearchFilter, UpdateFilterRequest } from './reducer';
/**
* Listens to actions triggers by user updates to the filter state..
*/
export function* filterWatcher(): SagaIterator {
/*
TODO: If we want to minimize api calls on checkbox quick-select,
we will have to debounce and accumulate filter updates elsewhere.
To be revisited when we have more checkbox filters
*/
yield takeEvery(UpdateSearchFilter.REQUEST, filterWorker);
}
/*
* Generates new filter shape from action payload.
* Then executes a search on current resource based with new filters and current search state values.
......@@ -50,3 +38,15 @@ export function* filterWorker(action: UpdateFilterRequest): SagaIterator {
})
);
}
/**
* Listens to actions triggers by user updates to the filter state..
*/
export function* filterWatcher(): SagaIterator {
/*
TODO: If we want to minimize api calls on checkbox quick-select,
we will have to debounce and accumulate filter updates elsewhere.
To be revisited when we have more checkbox filters
*/
yield takeEvery(UpdateSearchFilter.REQUEST, filterWorker);
}
......@@ -38,6 +38,41 @@ import tableOwnersReducer, {
TableOwnerReducerState,
} from './owners/reducer';
export const initialPreviewState = {
data: {},
status: null,
};
export const initialTableDataState: TableMetadata = {
badges: [],
cluster: '',
columns: [],
database: '',
is_editable: false,
is_view: false,
key: '',
last_updated_timestamp: 0,
schema: '',
name: '',
description: '',
table_writer: { application_url: '', description: '', id: '', name: '' },
partition: { is_partitioned: false },
table_readers: [],
source: { source: '', source_type: '' },
resource_reports: [],
watermarks: [],
programmatic_descriptions: {},
};
export const initialState: TableMetadataReducerState = {
isLoading: true,
lastIndexed: null,
preview: initialPreviewState,
statusCode: null,
tableData: initialTableDataState,
tableOwners: initialOwnersState,
};
/* ACTIONS */
export function getTableData(
key: string,
......@@ -53,6 +88,7 @@ export function getTableData(
type: GetTableData.REQUEST,
};
}
export function getTableDataFailure(): GetTableDataResponse {
return {
type: GetTableData.FAILURE,
......@@ -64,6 +100,7 @@ export function getTableDataFailure(): GetTableDataResponse {
},
};
}
export function getTableDataSuccess(
data: TableMetadata,
owners: OwnerDict,
......@@ -259,41 +296,6 @@ export interface TableMetadataReducerState {
tableOwners: TableOwnerReducerState;
}
export const initialPreviewState = {
data: {},
status: null,
};
export const initialTableDataState: TableMetadata = {
badges: [],
cluster: '',
columns: [],
database: '',
is_editable: false,
is_view: false,
key: '',
last_updated_timestamp: 0,
schema: '',
name: '',
description: '',
table_writer: { application_url: '', description: '', id: '', name: '' },
partition: { is_partitioned: false },
table_readers: [],
source: { source: '', source_type: '' },
resource_reports: [],
watermarks: [],
programmatic_descriptions: {},
};
export const initialState: TableMetadataReducerState = {
isLoading: true,
lastIndexed: null,
preview: initialPreviewState,
statusCode: null,
tableData: initialTableDataState,
tableOwners: initialOwnersState,
};
export default function reducer(
state: TableMetadataReducerState = initialState,
action
......
......@@ -33,6 +33,13 @@ export function filterFromObj(
}, {});
}
export function logAction(declaredProps: ActionLogParams) {
const inferredProps = {
location: window.location.pathname,
};
postActionLog({ ...inferredProps, ...declaredProps });
}
export function logClick(
event: React.MouseEvent<HTMLElement>,
declaredProps?: ActionLogParams
......@@ -61,10 +68,3 @@ export function logClick(
logAction({ ...inferredProps, ...declaredProps });
}
export function logAction(declaredProps: ActionLogParams) {
const inferredProps = {
location: window.location.pathname,
};
postActionLog({ ...inferredProps, ...declaredProps });
}
......@@ -282,7 +282,6 @@
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-use-before-define": "warn",
"@typescript-eslint/member-delimiter-style": [
"off",
{
......@@ -323,7 +322,6 @@
}
}
],
"@typescript-eslint/indent": "off",
"array-callback-return": "warn",
"camelcase": "off",
"class-methods-use-this": "off",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment