chore(frontend): Spelling (#25452)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-authored-by: Geido <60598000+geido@users.noreply.github.com> Co-authored-by: Evan Rusackas <evan@preset.io>
This commit is contained in:
parent
dd4f223a39
commit
d0c9cde0ba
|
|
@ -225,11 +225,11 @@ function setFilterBarOrientation(orientation: 'vertical' | 'horizontal') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function openMoreFilters(intercetFilterState = true) {
|
function openMoreFilters(waitFilterState = true) {
|
||||||
interceptFilterState();
|
interceptFilterState();
|
||||||
cy.getBySel('dropdown-container-btn').click();
|
cy.getBySel('dropdown-container-btn').click();
|
||||||
|
|
||||||
if (intercetFilterState) {
|
if (waitFilterState) {
|
||||||
cy.wait('@postFilterState');
|
cy.wait('@postFilterState');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -568,7 +568,7 @@ describe('Native filters', () => {
|
||||||
]);
|
]);
|
||||||
enterNativeFilterEditModal();
|
enterNativeFilterEditModal();
|
||||||
selectFilter(1);
|
selectFilter(1);
|
||||||
// Select dependdent option and auto use platform for genre
|
// Select dependent option and auto use platform for genre
|
||||||
cy.get(nativeFilters.filterConfigurationSections.displayedSection).within(
|
cy.get(nativeFilters.filterConfigurationSections.displayedSection).within(
|
||||||
() => {
|
() => {
|
||||||
cy.contains('Values are dependent on other filters')
|
cy.contains('Values are dependent on other filters')
|
||||||
|
|
|
||||||
|
|
@ -204,9 +204,9 @@ export function expandFilterOnLeftPanel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ************************************************************************
|
/** ************************************************************************
|
||||||
* Collapes Native Filter from the left panel on dashboard
|
* Collapses Native Filter from the left panel on dashboard
|
||||||
* @returns {None}
|
* @returns {None}
|
||||||
* @summary helper for collape native filter
|
* @summary helper for collapse native filter
|
||||||
************************************************************************* */
|
************************************************************************* */
|
||||||
export function collapseFilterOnLeftPanel() {
|
export function collapseFilterOnLeftPanel() {
|
||||||
cy.get(nativeFilters.filterFromDashboardView.collapse)
|
cy.get(nativeFilters.filterFromDashboardView.collapse)
|
||||||
|
|
@ -429,7 +429,7 @@ export function undoDeleteNativeFilter() {
|
||||||
|
|
||||||
/** ************************************************************************
|
/** ************************************************************************
|
||||||
* Check Native Filter tooltip content
|
* Check Native Filter tooltip content
|
||||||
* @param index: tooltip indext to check
|
* @param index: tooltip index to check
|
||||||
* @param value: tooltip value to check
|
* @param value: tooltip value to check
|
||||||
* @return {null}
|
* @return {null}
|
||||||
* @summary helper for checking native filter tooltip content by index
|
* @summary helper for checking native filter tooltip content by index
|
||||||
|
|
@ -475,10 +475,10 @@ export function applyAdvancedTimeRangeFilterOnDashboard(
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ************************************************************************
|
/** ************************************************************************
|
||||||
* Input default valule in Native filter in filter settings
|
* Input default value in Native filter in filter settings
|
||||||
* @param defaultValue: default value for native filter
|
* @param defaultValue: default value for native filter
|
||||||
* @return {null}
|
* @return {null}
|
||||||
* @summary helper for input default valule in Native filter in filter settings
|
* @summary helper for input default value in Native filter in filter settings
|
||||||
************************************************************************* */
|
************************************************************************* */
|
||||||
export function inputNativeFilterDefaultValue(
|
export function inputNativeFilterDefaultValue(
|
||||||
defaultValue: string,
|
defaultValue: string,
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ describe.skip('AdhocFilters', () => {
|
||||||
cy.wait('@filterValues');
|
cy.wait('@filterValues');
|
||||||
|
|
||||||
// selecting a new filter should auto-open the popup,
|
// selecting a new filter should auto-open the popup,
|
||||||
// so the tabshould be visible by now
|
// so the tab should be visible by now
|
||||||
cy.get('#filter-edit-popover #adhoc-filter-edit-tabs-tab-SQL').click();
|
cy.get('#filter-edit-popover #adhoc-filter-edit-tabs-tab-SQL').click();
|
||||||
cy.get('#filter-edit-popover .ace_content').click();
|
cy.get('#filter-edit-popover .ace_content').click();
|
||||||
cy.get('#filter-edit-popover .ace_text-input').type(filterContent);
|
cy.get('#filter-edit-popover .ace_text-input').type(filterContent);
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ describe.skip('SqlLab datasource panel', () => {
|
||||||
cy.visit('/sqllab');
|
cy.visit('/sqllab');
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO the test bellow is flaky, and has been disabled for the time being
|
// TODO the test below is flaky, and has been disabled for the time being
|
||||||
// (notice the `it.skip`)
|
// (notice the `it.skip`)
|
||||||
it('creates a table preview when a database, schema, and table are selected', () => {
|
it('creates a table preview when a database, schema, and table are selected', () => {
|
||||||
cy.intercept('/superset/table/**').as('tableMetadata');
|
cy.intercept('/superset/table/**').as('tableMetadata');
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ const { getConfig, setConfig } = failOnConsoleError({
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set infividual tests to allow certain console erros to NOT fail, e.g
|
// Set individual tests to allow certain console errors to NOT fail, e.g
|
||||||
// cy.allowConsoleErrors(['foo', /^some bar-regex.*/]);
|
// cy.allowConsoleErrors(['foo', /^some bar-regex.*/]);
|
||||||
// This will be reset between tests.
|
// This will be reset between tests.
|
||||||
Cypress.Commands.addAll({
|
Cypress.Commands.addAll({
|
||||||
|
|
|
||||||
|
|
@ -26,4 +26,4 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
- add certified icon to columoption ([#1330](https://github.com/apache-superset/superset-ui/issues/1330)) ([a415c41](https://github.com/apache-superset/superset-ui/commit/a415c413954bc9c093ab5dfde62d458cf3224073))
|
- add certified icon to columnoption ([#1330](https://github.com/apache-superset/superset-ui/issues/1330)) ([a415c41](https://github.com/apache-superset/superset-ui/commit/a415c413954bc9c093ab5dfde62d458cf3224073))
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ test('returns empty array if timeseries_limit_metric and x_axis_sort are include
|
||||||
).toEqual([]);
|
).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('returns emoty array if timeseries_limit_metric is an empty array', () => {
|
test('returns empty array if timeseries_limit_metric is an empty array', () => {
|
||||||
expect(
|
expect(
|
||||||
extractExtraMetrics({
|
extractExtraMetrics({
|
||||||
...baseFormData,
|
...baseFormData,
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ describe('defineSavedMetrics', () => {
|
||||||
expect(defineSavedMetrics({ ...dataset, metrics: undefined })).toEqual([]);
|
expect(defineSavedMetrics({ ...dataset, metrics: undefined })).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns default saved metrics if souce is a Query', () => {
|
it('returns default saved metrics if source is a Query', () => {
|
||||||
expect(defineSavedMetrics(testQuery as QueryResponse)).toEqual(
|
expect(defineSavedMetrics(testQuery as QueryResponse)).toEqual(
|
||||||
DEFAULT_METRICS,
|
DEFAULT_METRICS,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ export default class ColorSchemeRegistry<T> extends RegistryWithDefaultKey<T> {
|
||||||
get(key?: string, strict = false) {
|
get(key?: string, strict = false) {
|
||||||
const target = super.get(key) as T | undefined;
|
const target = super.get(key) as T | undefined;
|
||||||
|
|
||||||
// fallsback to default scheme if any
|
// falls back to default scheme if any
|
||||||
if (!strict && !target) {
|
if (!strict && !target) {
|
||||||
const defaultKey = super.getDefaultKey();
|
const defaultKey = super.getDefaultKey();
|
||||||
if (defaultKey) {
|
if (defaultKey) {
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,7 @@ export enum QueryState {
|
||||||
TimedOut = 'timed_out',
|
TimedOut = 'timed_out',
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inidcates a Query's state is still processing
|
// Indicates a Query's state is still processing
|
||||||
export const runningQueryStateList: QueryState[] = [
|
export const runningQueryStateList: QueryState[] = [
|
||||||
QueryState.Running,
|
QueryState.Running,
|
||||||
QueryState.Started,
|
QueryState.Started,
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ export type QueryFormExtraFilter = {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
/** These properties will be appended to those pre-existing in the form data/query object */
|
/** These properties will be appended to those preexisting in the form data/query object */
|
||||||
export type ExtraFormDataAppend = {
|
export type ExtraFormDataAppend = {
|
||||||
adhoc_filters?: AdhocFilter[];
|
adhoc_filters?: AdhocFilter[];
|
||||||
filters?: QueryObjectFilterClause[];
|
filters?: QueryObjectFilterClause[];
|
||||||
|
|
|
||||||
|
|
@ -218,7 +218,7 @@ describe('callApi()', () => {
|
||||||
const unstringified = (calls[0][1] as RequestInit).body as FormData;
|
const unstringified = (calls[0][1] as RequestInit).body as FormData;
|
||||||
const hasCorruptKey = unstringified.has('corrupt');
|
const hasCorruptKey = unstringified.has('corrupt');
|
||||||
expect(hasCorruptKey).toBeFalsy();
|
expect(hasCorruptKey).toBeFalsy();
|
||||||
// When a corrupt attribute is encountred, a console.error call is made with info about the corrupt attribute
|
// When a corrupt attribute is encountered, a console.error call is made with info about the corrupt attribute
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
expect(console.error).toHaveBeenCalledTimes(1);
|
expect(console.error).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
import { overrideExtraFormData } from '../../src/query/processExtraFormData';
|
import { overrideExtraFormData } from '../../src/query/processExtraFormData';
|
||||||
|
|
||||||
describe('overrideExtraFormData', () => {
|
describe('overrideExtraFormData', () => {
|
||||||
it('should assign allowed non-existent value', () => {
|
it('should assign allowed nonexistent value', () => {
|
||||||
expect(
|
expect(
|
||||||
overrideExtraFormData(
|
overrideExtraFormData(
|
||||||
{
|
{
|
||||||
|
|
@ -82,7 +82,7 @@ describe('overrideExtraFormData', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should override pre-existing extra value', () => {
|
it('should override preexisting extra value', () => {
|
||||||
expect(
|
expect(
|
||||||
overrideExtraFormData(
|
overrideExtraFormData(
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ export const basicData = {
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
location: 'AMEA',
|
location: 'AMEA',
|
||||||
program_language: 'Javscript',
|
program_language: 'JavaScript',
|
||||||
Count: 134,
|
Count: 134,
|
||||||
'Most Recent Data': '2022-07-25 13:00:00.000',
|
'Most Recent Data': '2022-07-25 13:00:00.000',
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ const expandColumns = memoizeOne(expandArray);
|
||||||
/**
|
/**
|
||||||
* Load sample data for testing
|
* Load sample data for testing
|
||||||
* @param props the original props passed to SuperChart
|
* @param props the original props passed to SuperChart
|
||||||
* @param pageLength number of records perpage
|
* @param pageLength number of records per page
|
||||||
* @param rows the target number of records
|
* @param rows the target number of records
|
||||||
* @param cols the target number of columns
|
* @param cols the target number of columns
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -331,7 +331,7 @@ function Icicle(element, props) {
|
||||||
tooltip.interrupt().transition().duration(250).style('opacity', 0);
|
tooltip.interrupt().transition().duration(250).style('opacity', 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
// When clicking a subdivision, the vis will zoom in to it
|
// When clicking a subdivision, the vis will zoom into it
|
||||||
function click(d) {
|
function click(d) {
|
||||||
if (!d.children) {
|
if (!d.children) {
|
||||||
if (d.parent) {
|
if (d.parent) {
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ export const getLayer: getLayerType<unknown> = (
|
||||||
?.reverse() as Color[];
|
?.reverse() as Color[];
|
||||||
|
|
||||||
return new HeatmapLayer({
|
return new HeatmapLayer({
|
||||||
id: `heatmp-layer-${fd.slice_id}` as const,
|
id: `heatmap-layer-${fd.slice_id}` as const,
|
||||||
data,
|
data,
|
||||||
intensity,
|
intensity,
|
||||||
radiusPixels,
|
radiusPixels,
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ const config: ControlPanelConfig = {
|
||||||
name: 'intensity',
|
name: 'intensity',
|
||||||
config: {
|
config: {
|
||||||
type: 'SelectControl',
|
type: 'SelectControl',
|
||||||
label: t('Intesity'),
|
label: t('Intensity'),
|
||||||
description: t(
|
description: t(
|
||||||
'Intensity is the value multiplied by the weight to obtain the final weight',
|
'Intensity is the value multiplied by the weight to obtain the final weight',
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ export const showControls: CustomControlItem = {
|
||||||
default: false,
|
default: false,
|
||||||
description: t(
|
description: t(
|
||||||
'Whether to show extra controls or not. Extra controls ' +
|
'Whether to show extra controls or not. Extra controls ' +
|
||||||
'include things like making mulitBar charts stacked ' +
|
'include things like making multiBar charts stacked ' +
|
||||||
'or side by side.',
|
'or side by side.',
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ const config: ControlPanelConfig = {
|
||||||
default: false,
|
default: false,
|
||||||
description: t(
|
description: t(
|
||||||
'Whether to show extra controls or not. Extra controls ' +
|
'Whether to show extra controls or not. Extra controls ' +
|
||||||
'include things like making mulitBar charts stacked ' +
|
'include things like making multiBar charts stacked ' +
|
||||||
'or side by side.',
|
'or side by side.',
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ describe('EchartsGraph transformProps', () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should transform chart props for viz with category and falsey normalization', () => {
|
it('should transform chart props for viz with category and falsy normalization', () => {
|
||||||
const formData: SqlaFormData = {
|
const formData: SqlaFormData = {
|
||||||
colorScheme: 'bnbColors',
|
colorScheme: 'bnbColors',
|
||||||
datasource: '3__table',
|
datasource: '3__table',
|
||||||
|
|
|
||||||
|
|
@ -1038,7 +1038,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
// After initial load the table should resize only when the new sizes
|
// After initial load the table should resize only when the new sizes
|
||||||
// Are not only scrollbar updates, otherwise, the table would twicth
|
// Are not only scrollbar updates, otherwise, the table would twitch
|
||||||
const scrollBarSize = getScrollBarSize();
|
const scrollBarSize = getScrollBarSize();
|
||||||
const { width: tableWidth, height: tableHeight } = tableSize;
|
const { width: tableWidth, height: tableHeight } = tableSize;
|
||||||
// Table is increasing its original size
|
// Table is increasing its original size
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ test('returns server error description', async () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('returns sesion expire description when CSRF token expired', async () => {
|
test('returns session expire description when CSRF token expired', async () => {
|
||||||
const errorMessage = 'CSRF token expired';
|
const errorMessage = 'CSRF token expired';
|
||||||
fetchMock.post(
|
fetchMock.post(
|
||||||
queryValidationApiRoute,
|
queryValidationApiRoute,
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ describe('QueryAutoRefresh', () => {
|
||||||
expect(fetchMock.calls(refreshApi)).toHaveLength(1);
|
expect(fetchMock.calls(refreshApi)).toHaveLength(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Does not fail and attempts to refresh when given pending query and invlaid query', async () => {
|
it('Does not fail and attempts to refresh when given pending query and invalid query', async () => {
|
||||||
const store = mockStore();
|
const store = mockStore();
|
||||||
fetchMock.get(refreshApi, {
|
fetchMock.get(refreshApi, {
|
||||||
result: [
|
result: [
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ export interface QueryAutoRefreshProps {
|
||||||
queriesLastUpdate: number;
|
queriesLastUpdate: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns true if the Query.state matches one of the specifc values indicating the query is still processing on server
|
// returns true if the Query.state matches one of the specific values indicating the query is still processing on server
|
||||||
export const isQueryRunning = (q: Query): boolean =>
|
export const isQueryRunning = (q: Query): boolean =>
|
||||||
runningQueryStateList.includes(q?.state);
|
runningQueryStateList.includes(q?.state);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ import { ISaveableDatasource } from 'src/SqlLab/components/SaveDatasetModal';
|
||||||
|
|
||||||
export const mockedActions = sinon.stub({ ...actions });
|
export const mockedActions = sinon.stub({ ...actions });
|
||||||
|
|
||||||
export const alert = { bsStyle: 'danger', msg: 'Ooops', id: 'lksvmcx32' };
|
export const alert = { bsStyle: 'danger', msg: 'Oops', id: 'lksvmcx32' };
|
||||||
export const table = {
|
export const table = {
|
||||||
dbId: 1,
|
dbId: 1,
|
||||||
selectStar: 'SELECT * FROM ab_user',
|
selectStar: 'SELECT * FROM ab_user',
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ test('does not handle onClicks when disabled', () => {
|
||||||
// test stories from the storybook!
|
// test stories from the storybook!
|
||||||
test('All the sorybook gallery variants mount', () => {
|
test('All the sorybook gallery variants mount', () => {
|
||||||
const { getAllByRole } = render(<ButtonGallery />);
|
const { getAllByRole } = render(<ButtonGallery />);
|
||||||
|
|
||||||
const permutationCount =
|
const permutationCount =
|
||||||
Object.values(buttonStyles.options).filter(o => o).length *
|
Object.values(buttonStyles.options).filter(o => o).length *
|
||||||
Object.values(buttonSizes.options).length;
|
Object.values(buttonSizes.options).length;
|
||||||
|
|
|
||||||
|
|
@ -231,7 +231,7 @@ export default function DrillByModal({
|
||||||
config.column,
|
config.column,
|
||||||
config.groupbyFieldName,
|
config.groupbyFieldName,
|
||||||
);
|
);
|
||||||
acc.overridenGroupbyFields.add(config.groupbyFieldName);
|
acc.overriddenGroupbyFields.add(config.groupbyFieldName);
|
||||||
}
|
}
|
||||||
const adhocFilterFieldName =
|
const adhocFilterFieldName =
|
||||||
config?.adhocFilterFieldName || DEFAULT_ADHOC_FILTER_FIELD_NAME;
|
config?.adhocFilterFieldName || DEFAULT_ADHOC_FILTER_FIELD_NAME;
|
||||||
|
|
@ -241,14 +241,14 @@ export default function DrillByModal({
|
||||||
simpleFilterToAdhoc(filter),
|
simpleFilterToAdhoc(filter),
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
acc.overridenAdhocFilterFields.add(adhocFilterFieldName);
|
acc.overriddenAdhocFilterFields.add(adhocFilterFieldName);
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
formData: {},
|
formData: {},
|
||||||
overridenGroupbyFields: new Set<string>(),
|
overriddenGroupbyFields: new Set<string>(),
|
||||||
overridenAdhocFilterFields: new Set<string>(),
|
overriddenAdhocFilterFields: new Set<string>(),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
[getNewGroupby],
|
[getNewGroupby],
|
||||||
|
|
@ -288,14 +288,14 @@ export default function DrillByModal({
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
return formData;
|
return formData;
|
||||||
}
|
}
|
||||||
const { formData: overrideFormData, overridenAdhocFilterFields } =
|
const { formData: overrideFormData, overriddenAdhocFilterFields } =
|
||||||
getFormDataChangesFromConfigs(drillByConfigs.slice(0, index));
|
getFormDataChangesFromConfigs(drillByConfigs.slice(0, index));
|
||||||
|
|
||||||
const newFormData = {
|
const newFormData = {
|
||||||
...formData,
|
...formData,
|
||||||
...overrideFormData,
|
...overrideFormData,
|
||||||
};
|
};
|
||||||
overridenAdhocFilterFields.forEach(adhocFilterField => ({
|
overriddenAdhocFilterFields.forEach(adhocFilterField => ({
|
||||||
...newFormData,
|
...newFormData,
|
||||||
[adhocFilterField]: [
|
[adhocFilterField]: [
|
||||||
...formData[adhocFilterField],
|
...formData[adhocFilterField],
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ const OVERRIDE_ERROR_MESSAGE_COMPONENT = (_: ErrorMessageComponentProps) => (
|
||||||
<div>Custom error</div>
|
<div>Custom error</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
test('should return undefined for a non existent key', () => {
|
test('should return undefined for a nonexistent key', () => {
|
||||||
expect(getErrorMessageComponentRegistry().get('INVALID_KEY')).toEqual(
|
expect(getErrorMessageComponentRegistry().get('INVALID_KEY')).toEqual(
|
||||||
undefined,
|
undefined,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,7 @@ export function useListViewState({
|
||||||
);
|
);
|
||||||
|
|
||||||
const columnsWithSelect = useMemo(() => {
|
const columnsWithSelect = useMemo(() => {
|
||||||
// add exact filter type so filters with falsey values are not filtered out
|
// add exact filter type so filters with falsy values are not filtered out
|
||||||
const columnsWithFilter = columns.map(f => ({ ...f, filter: 'exact' }));
|
const columnsWithFilter = columns.map(f => ({ ...f, filter: 'exact' }));
|
||||||
return bulkSelectMode
|
return bulkSelectMode
|
||||||
? [bulkSelectColumnConfig, ...columnsWithFilter]
|
? [bulkSelectColumnConfig, ...columnsWithFilter]
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ test('renders underlined text and emits event when clickable', () => {
|
||||||
expect(style.textDecoration).toBe('underline');
|
expect(style.textDecoration).toBe('underline');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('renders clicable items with blue icons when the bar is collapsed', async () => {
|
test('renders clickable items with blue icons when the bar is collapsed', async () => {
|
||||||
await runWithBarCollapsed(async () => {
|
await runWithBarCollapsed(async () => {
|
||||||
const onClick = jest.fn();
|
const onClick = jest.fn();
|
||||||
const items = [{ ...ITEMS[0], onClick }, ITEMS[1]];
|
const items = [{ ...ITEMS[0], onClick }, ITEMS[1]];
|
||||||
|
|
|
||||||
|
|
@ -109,8 +109,8 @@ const StyledItem = styled.div<{
|
||||||
`}
|
`}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Make sure big tootips are truncated
|
// Make sure big tooltips are truncated
|
||||||
const TootipContent = styled.div`
|
const TooltipContent = styled.div`
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-line-clamp: 20;
|
-webkit-line-clamp: 20;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
|
|
@ -161,7 +161,7 @@ const Item = ({
|
||||||
return isTruncated || collapsed || (tooltip && tooltip !== title) ? (
|
return isTruncated || collapsed || (tooltip && tooltip !== title) ? (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
placement={tooltipPlacement}
|
placement={tooltipPlacement}
|
||||||
title={<TootipContent>{tooltip}</TootipContent>}
|
title={<TooltipContent>{tooltip}</TooltipContent>}
|
||||||
>
|
>
|
||||||
{content}
|
{content}
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
|
||||||
|
|
@ -121,14 +121,14 @@ const basicData: BasicData[] = [
|
||||||
{
|
{
|
||||||
key: 3,
|
key: 3,
|
||||||
name: '128 GB SSD',
|
name: '128 GB SSD',
|
||||||
category: 'Hardrive',
|
category: 'Harddrive',
|
||||||
price: 49.99,
|
price: 49.99,
|
||||||
description: 'Reliable and fast data storage',
|
description: 'Reliable and fast data storage',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 4,
|
key: 4,
|
||||||
name: '128 GB SSD',
|
name: '128 GB SSD',
|
||||||
category: 'Hardrive',
|
category: 'Harddrive',
|
||||||
price: 49.99,
|
price: 49.99,
|
||||||
description: 'Reliable and fast data storage',
|
description: 'Reliable and fast data storage',
|
||||||
},
|
},
|
||||||
|
|
@ -149,14 +149,14 @@ const basicData: BasicData[] = [
|
||||||
{
|
{
|
||||||
key: 7,
|
key: 7,
|
||||||
name: '256 GB SSD',
|
name: '256 GB SSD',
|
||||||
category: 'Hardrive',
|
category: 'Harddrive',
|
||||||
price: 175,
|
price: 175,
|
||||||
description: 'Reliable and fast data storage',
|
description: 'Reliable and fast data storage',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 8,
|
key: 8,
|
||||||
name: '1 TB SSD',
|
name: '1 TB SSD',
|
||||||
category: 'Hardrive',
|
category: 'Harddrive',
|
||||||
price: 349.99,
|
price: 349.99,
|
||||||
description: 'Reliable and fast data storage',
|
description: 'Reliable and fast data storage',
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ const basicData: = [
|
||||||
{
|
{
|
||||||
key: 3,
|
key: 3,
|
||||||
name: '128 GB SSD',
|
name: '128 GB SSD',
|
||||||
category: 'Hardrive',
|
category: 'Harddrive',
|
||||||
price: '49.99'
|
price: '49.99'
|
||||||
description: 'Reliable and fast data storage',
|
description: 'Reliable and fast data storage',
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ test('alphabeticalSort bad inputs no errors', () => {
|
||||||
// incorrect non-object values
|
// incorrect non-object values
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
expect(alphabeticalSort('name', 3, [])).toBe(undefined);
|
expect(alphabeticalSort('name', 3, [])).toBe(undefined);
|
||||||
// incorrect object values without specificed key
|
// incorrect object values without specified key
|
||||||
expect(alphabeticalSort('name', {}, {})).toBe(undefined);
|
expect(alphabeticalSort('name', {}, {})).toBe(undefined);
|
||||||
// Object as value for name when it should be a string
|
// Object as value for name when it should be a string
|
||||||
expect(
|
expect(
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ test('use the default timezone when an invalid timezone is provided', async () =
|
||||||
expect(onTimezoneChange).toHaveBeenLastCalledWith('Africa/Abidjan');
|
expect(onTimezoneChange).toHaveBeenLastCalledWith('Africa/Abidjan');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('render timezones in correct oder for standard time', async () => {
|
test('render timezones in correct order for standard time', async () => {
|
||||||
const TimezoneSelector = await loadComponent('2022-01-01');
|
const TimezoneSelector = await loadComponent('2022-01-01');
|
||||||
const onTimezoneChange = jest.fn();
|
const onTimezoneChange = jest.fn();
|
||||||
render(
|
render(
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import userEvent from '@testing-library/user-event';
|
||||||
import TooltipParagraph from '.';
|
import TooltipParagraph from '.';
|
||||||
|
|
||||||
test('starts hidden with default props', () => {
|
test('starts hidden with default props', () => {
|
||||||
render(<TooltipParagraph>This is tootlip description.</TooltipParagraph>);
|
render(<TooltipParagraph>This is tooltip description.</TooltipParagraph>);
|
||||||
expect(screen.queryByRole('tooltip')).not.toBeInTheDocument();
|
expect(screen.queryByRole('tooltip')).not.toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ export {
|
||||||
/*
|
/*
|
||||||
* Components that conflict with the ones in src/components.
|
* Components that conflict with the ones in src/components.
|
||||||
* We should try to avoid using Ant Design directly. The components
|
* We should try to avoid using Ant Design directly. The components
|
||||||
* listed bellow may need review. Avoid incrementing this list by using
|
* listed below may need review. Avoid incrementing this list by using
|
||||||
* or extending the components in src/components.
|
* or extending the components in src/components.
|
||||||
*/
|
*/
|
||||||
export {
|
export {
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ jest.mock('src/dashboard/actions/dashboardState', () => ({
|
||||||
}));
|
}));
|
||||||
jest.mock('src/components/ResizableSidebar/useStoredSidebarWidth');
|
jest.mock('src/components/ResizableSidebar/useStoredSidebarWidth');
|
||||||
|
|
||||||
// mock following dependant components to fix the prop warnings
|
// mock following dependent components to fix the prop warnings
|
||||||
jest.mock('src/components/Select/Select', () => () => (
|
jest.mock('src/components/Select/Select', () => () => (
|
||||||
<div data-test="mock-select" />
|
<div data-test="mock-select" />
|
||||||
));
|
));
|
||||||
|
|
@ -169,7 +169,7 @@ describe('DashboardBuilder', () => {
|
||||||
const expectedCount =
|
const expectedCount =
|
||||||
undoableDashboardLayoutWithTabs.present.TABS_ID.children.length;
|
undoableDashboardLayoutWithTabs.present.TABS_ID.children.length;
|
||||||
const tabPanels = within(parentSize).getAllByRole('tabpanel', {
|
const tabPanels = within(parentSize).getAllByRole('tabpanel', {
|
||||||
// to include invisiable tab panels
|
// to include invisible tab panels
|
||||||
hidden: true,
|
hidden: true,
|
||||||
});
|
});
|
||||||
expect(tabPanels.length).toBe(expectedCount);
|
expect(tabPanels.length).toBe(expectedCount);
|
||||||
|
|
@ -190,7 +190,7 @@ describe('DashboardBuilder', () => {
|
||||||
const expectedCount =
|
const expectedCount =
|
||||||
undoableDashboardLayoutWithTabs.present.TABS_ID.children.length;
|
undoableDashboardLayoutWithTabs.present.TABS_ID.children.length;
|
||||||
const tabPanels = within(parentSize).getAllByRole('tabpanel', {
|
const tabPanels = within(parentSize).getAllByRole('tabpanel', {
|
||||||
// to include invisiable tab panels
|
// to include invisible tab panels
|
||||||
hidden: true,
|
hidden: true,
|
||||||
});
|
});
|
||||||
expect(tabPanels.length).toBe(expectedCount);
|
expect(tabPanels.length).toBe(expectedCount);
|
||||||
|
|
|
||||||
|
|
@ -360,7 +360,7 @@ test('should show all roles', async () => {
|
||||||
spyIsFeatureEnabled.mockReturnValue(true);
|
spyIsFeatureEnabled.mockReturnValue(true);
|
||||||
|
|
||||||
const props = createProps();
|
const props = createProps();
|
||||||
const propsWithDashboardIndo = { ...props, dashboardInfo };
|
const propsWithDashboardInfo = { ...props, dashboardInfo };
|
||||||
|
|
||||||
const open = () => waitFor(() => userEvent.click(getSelect()));
|
const open = () => waitFor(() => userEvent.click(getSelect()));
|
||||||
const getSelect = () =>
|
const getSelect = () =>
|
||||||
|
|
@ -372,7 +372,7 @@ test('should show all roles', async () => {
|
||||||
const findAllSelectOptions = () =>
|
const findAllSelectOptions = () =>
|
||||||
waitFor(() => getElementsByClassName('.ant-select-item-option-content'));
|
waitFor(() => getElementsByClassName('.ant-select-item-option-content'));
|
||||||
|
|
||||||
render(<PropertiesModal {...propsWithDashboardIndo} />, {
|
render(<PropertiesModal {...propsWithDashboardInfo} />, {
|
||||||
useRedux: true,
|
useRedux: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -393,7 +393,7 @@ test('should show active owners with dashboard rbac', async () => {
|
||||||
spyIsFeatureEnabled.mockReturnValue(true);
|
spyIsFeatureEnabled.mockReturnValue(true);
|
||||||
|
|
||||||
const props = createProps();
|
const props = createProps();
|
||||||
const propsWithDashboardIndo = { ...props, dashboardInfo };
|
const propsWithDashboardInfo = { ...props, dashboardInfo };
|
||||||
|
|
||||||
const open = () => waitFor(() => userEvent.click(getSelect()));
|
const open = () => waitFor(() => userEvent.click(getSelect()));
|
||||||
const getSelect = () =>
|
const getSelect = () =>
|
||||||
|
|
@ -405,7 +405,7 @@ test('should show active owners with dashboard rbac', async () => {
|
||||||
const findAllSelectOptions = () =>
|
const findAllSelectOptions = () =>
|
||||||
waitFor(() => getElementsByClassName('.ant-select-item-option-content'));
|
waitFor(() => getElementsByClassName('.ant-select-item-option-content'));
|
||||||
|
|
||||||
render(<PropertiesModal {...propsWithDashboardIndo} />, {
|
render(<PropertiesModal {...propsWithDashboardInfo} />, {
|
||||||
useRedux: true,
|
useRedux: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -426,7 +426,7 @@ test('should show active owners without dashboard rbac', async () => {
|
||||||
spyIsFeatureEnabled.mockReturnValue(false);
|
spyIsFeatureEnabled.mockReturnValue(false);
|
||||||
|
|
||||||
const props = createProps();
|
const props = createProps();
|
||||||
const propsWithDashboardIndo = { ...props, dashboardInfo };
|
const propsWithDashboardInfo = { ...props, dashboardInfo };
|
||||||
|
|
||||||
const open = () => waitFor(() => userEvent.click(getSelect()));
|
const open = () => waitFor(() => userEvent.click(getSelect()));
|
||||||
const getSelect = () =>
|
const getSelect = () =>
|
||||||
|
|
@ -438,7 +438,7 @@ test('should show active owners without dashboard rbac', async () => {
|
||||||
const findAllSelectOptions = () =>
|
const findAllSelectOptions = () =>
|
||||||
waitFor(() => getElementsByClassName('.ant-select-item-option-content'));
|
waitFor(() => getElementsByClassName('.ant-select-item-option-content'));
|
||||||
|
|
||||||
render(<PropertiesModal {...propsWithDashboardIndo} />, {
|
render(<PropertiesModal {...propsWithDashboardInfo} />, {
|
||||||
useRedux: true,
|
useRedux: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -356,7 +356,7 @@ test('Should render "annotationsError"', () => {
|
||||||
render(<SliceHeader {...props} />, { useRedux: true, useRouter: true });
|
render(<SliceHeader {...props} />, { useRedux: true, useRouter: true });
|
||||||
expect(
|
expect(
|
||||||
screen.getByRole('img', {
|
screen.getByRole('img', {
|
||||||
name: 'One ore more annotation layers failed loading.',
|
name: 'One or more annotation layers failed loading.',
|
||||||
}),
|
}),
|
||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
@ -368,7 +368,7 @@ test('Should not render "annotationsError" and "annotationsLoading"', () => {
|
||||||
render(<SliceHeader {...props} />, { useRedux: true, useRouter: true });
|
render(<SliceHeader {...props} />, { useRedux: true, useRouter: true });
|
||||||
expect(
|
expect(
|
||||||
screen.queryByRole('img', {
|
screen.queryByRole('img', {
|
||||||
name: 'One ore more annotation layers failed loading.',
|
name: 'One or more annotation layers failed loading.',
|
||||||
}),
|
}),
|
||||||
).not.toBeInTheDocument();
|
).not.toBeInTheDocument();
|
||||||
expect(
|
expect(
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ type SliceHeaderProps = SliceHeaderControlsProps & {
|
||||||
};
|
};
|
||||||
|
|
||||||
const annotationsLoading = t('Annotation layers are still loading.');
|
const annotationsLoading = t('Annotation layers are still loading.');
|
||||||
const annotationsError = t('One ore more annotation layers failed loading.');
|
const annotationsError = t('One or more annotation layers failed loading.');
|
||||||
const CrossFilterIcon = styled(Icons.ApartmentOutlined)`
|
const CrossFilterIcon = styled(Icons.ApartmentOutlined)`
|
||||||
${({ theme }) => `
|
${({ theme }) => `
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ class Chart extends Component {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// `cacheBusterProp` is jected by react-hot-loader
|
// `cacheBusterProp` is injected by react-hot-loader
|
||||||
return this.props.cacheBusterProp !== nextProps.cacheBusterProp;
|
return this.props.cacheBusterProp !== nextProps.cacheBusterProp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -789,7 +789,7 @@ const FiltersConfigForm = (
|
||||||
filterValues={(column: Column) => !!column.is_dttm}
|
filterValues={(column: Column) => !!column.is_dttm}
|
||||||
datasetId={datasetId}
|
datasetId={datasetId}
|
||||||
onChange={column => {
|
onChange={column => {
|
||||||
// We need reset default value when when column changed
|
// We need reset default value when column changed
|
||||||
setNativeFilterFieldValues(form, filterId, {
|
setNativeFilterFieldValues(form, filterId, {
|
||||||
granularity_sqla: column,
|
granularity_sqla: column,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ test('Clicking on checkbox', () => {
|
||||||
expect(props.forceUpdate).toBeCalled();
|
expect(props.forceUpdate).toBeCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Clicking on checkbox when resetConfig:flase', () => {
|
test('Clicking on checkbox when resetConfig:false', () => {
|
||||||
const props = createProps();
|
const props = createProps();
|
||||||
(getControlItems as jest.Mock).mockReturnValue([
|
(getControlItems as jest.Mock).mockReturnValue([
|
||||||
{ name: 'name_1', config: { renderTrigger: true, resetConfig: false } },
|
{ name: 'name_1', config: { renderTrigger: true, resetConfig: false } },
|
||||||
|
|
|
||||||
|
|
@ -379,7 +379,7 @@ test('deletes a filter', async () => {
|
||||||
onSave,
|
onSave,
|
||||||
});
|
});
|
||||||
const removeButtons = screen.getAllByRole('img', { name: 'trash' });
|
const removeButtons = screen.getAllByRole('img', { name: 'trash' });
|
||||||
// remove NATIVE_FILTER-3 which isn't a dependancy of any other filter
|
// remove NATIVE_FILTER-3 which isn't a dependency of any other filter
|
||||||
userEvent.click(removeButtons[2]);
|
userEvent.click(removeButtons[2]);
|
||||||
userEvent.click(screen.getByRole('button', { name: SAVE_REGEX }));
|
userEvent.click(screen.getByRole('button', { name: SAVE_REGEX }));
|
||||||
await waitFor(() =>
|
await waitFor(() =>
|
||||||
|
|
@ -420,7 +420,7 @@ test('deletes a filter including dependencies', async () => {
|
||||||
onSave,
|
onSave,
|
||||||
});
|
});
|
||||||
const removeButtons = screen.getAllByRole('img', { name: 'trash' });
|
const removeButtons = screen.getAllByRole('img', { name: 'trash' });
|
||||||
// remove NATIVE_FILTER-2 which is a dependancy of NATIVE_FILTER-1
|
// remove NATIVE_FILTER-2 which is a dependency of NATIVE_FILTER-1
|
||||||
userEvent.click(removeButtons[1]);
|
userEvent.click(removeButtons[1]);
|
||||||
userEvent.click(screen.getByRole('button', { name: SAVE_REGEX }));
|
userEvent.click(screen.getByRole('button', { name: SAVE_REGEX }));
|
||||||
await waitFor(() =>
|
await waitFor(() =>
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ describe('getChartIdsFromLayout', () => {
|
||||||
windowSpy.mockImplementation(() => ({
|
windowSpy.mockImplementation(() => ({
|
||||||
location: {
|
location: {
|
||||||
origin: 'https://localhost',
|
origin: 'https://localhost',
|
||||||
search: '?unkown_param=value',
|
search: '?unknown_param=value',
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
const urlWithStandalone = getDashboardUrl({
|
const urlWithStandalone = getDashboardUrl({
|
||||||
|
|
@ -97,7 +97,7 @@ describe('getChartIdsFromLayout', () => {
|
||||||
standalone: DashboardStandaloneMode.HideNav,
|
standalone: DashboardStandaloneMode.HideNav,
|
||||||
});
|
});
|
||||||
expect(urlWithStandalone).toBe(
|
expect(urlWithStandalone).toBe(
|
||||||
`path?unkown_param=value&standalone=${DashboardStandaloneMode.HideNav}`,
|
`path?unknown_param=value&standalone=${DashboardStandaloneMode.HideNav}`,
|
||||||
);
|
);
|
||||||
windowSpy.mockRestore();
|
windowSpy.mockRestore();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ const SAVE_AS_DATASET = 'save_as_dataset';
|
||||||
// a tooltip for user can see the full name by hovering over the visually truncated string in UI
|
// a tooltip for user can see the full name by hovering over the visually truncated string in UI
|
||||||
const VISIBLE_TITLE_LENGTH = 25;
|
const VISIBLE_TITLE_LENGTH = 25;
|
||||||
|
|
||||||
// Assign icon for each DatasourceType. If no icon assingment is found in the lookup, no icon will render
|
// Assign icon for each DatasourceType. If no icon assignment is found in the lookup, no icon will render
|
||||||
export const datasourceIconLookup = {
|
export const datasourceIconLookup = {
|
||||||
[DatasourceType.Query]: (
|
[DatasourceType.Query]: (
|
||||||
<Icons.ConsoleSqlOutlined className="datasource-svg" />
|
<Icons.ConsoleSqlOutlined className="datasource-svg" />
|
||||||
|
|
@ -188,7 +188,7 @@ class DatasourceControl extends PureComponent {
|
||||||
const { columns } = datasource;
|
const { columns } = datasource;
|
||||||
// the current granularity_sqla might not be a temporal column anymore
|
// the current granularity_sqla might not be a temporal column anymore
|
||||||
const timeCol = this.props.form_data?.granularity_sqla;
|
const timeCol = this.props.form_data?.granularity_sqla;
|
||||||
const isGranularitySqalTemporal = columns.find(
|
const isGranularitySqlaTemporal = columns.find(
|
||||||
({ column_name }) => column_name === timeCol,
|
({ column_name }) => column_name === timeCol,
|
||||||
)?.is_dttm;
|
)?.is_dttm;
|
||||||
// the current main_dttm_col might not be a temporal column anymore
|
// the current main_dttm_col might not be a temporal column anymore
|
||||||
|
|
@ -198,7 +198,7 @@ class DatasourceControl extends PureComponent {
|
||||||
|
|
||||||
// if the current granularity_sqla is empty or it is not a temporal column anymore
|
// if the current granularity_sqla is empty or it is not a temporal column anymore
|
||||||
// let's update the control value
|
// let's update the control value
|
||||||
if (datasource.type === 'table' && !isGranularitySqalTemporal) {
|
if (datasource.type === 'table' && !isGranularitySqlaTemporal) {
|
||||||
const temporalColumn = isDefaultTemporal
|
const temporalColumn = isDefaultTemporal
|
||||||
? defaultTemporalColumn
|
? defaultTemporalColumn
|
||||||
: temporalColumns?.[0];
|
: temporalColumns?.[0];
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ describe('controlUtils', () => {
|
||||||
expect(control?.value).toBeNull();
|
expect(control?.value).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns null for non-existent field', () => {
|
it('returns null for nonexistent field', () => {
|
||||||
const control = getControlState('NON_EXISTENT', 'table', state);
|
const control = getControlState('NON_EXISTENT', 'table', state);
|
||||||
expect(control).toBeNull();
|
expect(control).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,7 @@ export class StandardizedFormData {
|
||||||
controlsState: ControlStateMapping;
|
controlsState: ControlStateMapping;
|
||||||
} {
|
} {
|
||||||
/*
|
/*
|
||||||
* Transfrom form_data between different viz. Return new form_data and controlsState.
|
* Transform form_data between different viz. Return new form_data and controlsState.
|
||||||
* 1. get memorized form_data by viz type or get previous form_data
|
* 1. get memorized form_data by viz type or get previous form_data
|
||||||
* 2. collect public control values
|
* 2. collect public control values
|
||||||
* 3. generate initial targetControlsState
|
* 3. generate initial targetControlsState
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,8 @@ export interface IDatabaseTable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a given item matches the isIDatabsetTable interface
|
* Checks if a given item matches the isIDatabaseTable interface
|
||||||
* @param item Object to check if it matches the isIDatabsetTable interface
|
* @param item Object to check if it matches the isIDatabaseTable interface
|
||||||
* @returns boolean true if matches interface
|
* @returns boolean true if matches interface
|
||||||
*/
|
*/
|
||||||
export const isIDatabaseTable = (item: any): boolean => {
|
export const isIDatabaseTable = (item: any): boolean => {
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,7 @@ test('searches for a table name', async () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('renders a warning icon when a table name has a pre-existing dataset', async () => {
|
test('renders a warning icon when a table name has a preexisting dataset', async () => {
|
||||||
render(
|
render(
|
||||||
<LeftPanel
|
<LeftPanel
|
||||||
setDataset={mockFun}
|
setDataset={mockFun}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ const useGetDatasetRelatedCounts = (id: string) => {
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Todo: this useEffect should be used to call all count methods conncurently
|
// Todo: this useEffect should be used to call all count methods concurrently
|
||||||
// when we populate data for the new tabs. For right separating out this
|
// when we populate data for the new tabs. For right separating out this
|
||||||
// api call for building the usage page.
|
// api call for building the usage page.
|
||||||
if (id) {
|
if (id) {
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,7 @@ const RightMenu = ({
|
||||||
SupersetClient.get({
|
SupersetClient.get({
|
||||||
endpoint: `/api/v1/database/?q=${rison.encode(payload)}`,
|
endpoint: `/api/v1/database/?q=${rison.encode(payload)}`,
|
||||||
}).then(({ json }: Record<string, any>) => {
|
}).then(({ json }: Record<string, any>) => {
|
||||||
// There might be some existings Gsheets and Clickhouse DBs
|
// There might be some existing Gsheets and Clickhouse DBs
|
||||||
// with allow_file_upload set as True which is not possible from now on
|
// with allow_file_upload set as True which is not possible from now on
|
||||||
const allowedDatabasesWithFileUpload =
|
const allowedDatabasesWithFileUpload =
|
||||||
json?.result?.filter(
|
json?.result?.filter(
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ describe('QueryPreviewModal', () => {
|
||||||
await waitForComponentToPaint(wrapper);
|
await waitForComponentToPaint(wrapper);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders a SynxHighlighter', () => {
|
it('renders a SyntaxHighlighter', () => {
|
||||||
expect(wrapper.find(SyntaxHighlighter)).toExist();
|
expect(wrapper.find(SyntaxHighlighter)).toExist();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ export interface RowLevelSecurityModalProps {
|
||||||
show: boolean;
|
show: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEAFULT_RULE = {
|
const DEFAULT_RULE = {
|
||||||
name: '',
|
name: '',
|
||||||
filter_type: FilterType.Regular,
|
filter_type: FilterType.Regular,
|
||||||
tables: [],
|
tables: [],
|
||||||
|
|
@ -133,7 +133,7 @@ function RowLevelSecurityModal(props: RowLevelSecurityModalProps) {
|
||||||
const { rule, addDangerToast, addSuccessToast, onHide, show } = props;
|
const { rule, addDangerToast, addSuccessToast, onHide, show } = props;
|
||||||
|
|
||||||
const [currentRule, setCurrentRule] = useState<RLSObject>({
|
const [currentRule, setCurrentRule] = useState<RLSObject>({
|
||||||
...DEAFULT_RULE,
|
...DEFAULT_RULE,
|
||||||
});
|
});
|
||||||
const [disableSave, setDisableSave] = useState<boolean>(true);
|
const [disableSave, setDisableSave] = useState<boolean>(true);
|
||||||
|
|
||||||
|
|
@ -204,7 +204,7 @@ function RowLevelSecurityModal(props: RowLevelSecurityModalProps) {
|
||||||
// initialize
|
// initialize
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isEditMode) {
|
if (!isEditMode) {
|
||||||
setCurrentRule({ ...DEAFULT_RULE });
|
setCurrentRule({ ...DEFAULT_RULE });
|
||||||
} else if (rule?.id !== null && !loading && !fetchError) {
|
} else if (rule?.id !== null && !loading && !fetchError) {
|
||||||
fetchResource(rule.id as number);
|
fetchResource(rule.id as number);
|
||||||
}
|
}
|
||||||
|
|
@ -249,7 +249,7 @@ function RowLevelSecurityModal(props: RowLevelSecurityModalProps) {
|
||||||
|
|
||||||
const hide = () => {
|
const hide = () => {
|
||||||
clearError();
|
clearError();
|
||||||
setCurrentRule({ ...DEAFULT_RULE });
|
setCurrentRule({ ...DEFAULT_RULE });
|
||||||
onHide();
|
onHide();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,8 @@ export enum ResourceStatus {
|
||||||
export type Resource<T> = LoadingState | CompleteState<T> | ErrorState;
|
export type Resource<T> = LoadingState | CompleteState<T> | ErrorState;
|
||||||
|
|
||||||
// Trying out something a little different: a separate type per status.
|
// Trying out something a little different: a separate type per status.
|
||||||
// This should let Typescript know whether a Resource has a result or error.
|
// This should let TypeScript know whether a Resource has a result or error.
|
||||||
// It's possible that I'm expecting too much from Typescript here.
|
// It's possible that I'm expecting too much from TypeScript here.
|
||||||
// If this ends up causing problems, we can change the type to:
|
// If this ends up causing problems, we can change the type to:
|
||||||
//
|
//
|
||||||
// export type Resource<T> = {
|
// export type Resource<T> = {
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ export type TableMetaData = {
|
||||||
columns: Column[];
|
columns: Column[];
|
||||||
};
|
};
|
||||||
|
|
||||||
type TableMetadataReponse = {
|
type TableMetadataResponse = {
|
||||||
json: TableMetaData;
|
json: TableMetaData;
|
||||||
response: Response;
|
response: Response;
|
||||||
};
|
};
|
||||||
|
|
@ -130,7 +130,7 @@ const tableApi = api.injectEndpoints({
|
||||||
catalog,
|
catalog,
|
||||||
schema,
|
schema,
|
||||||
})}`,
|
})}`,
|
||||||
transformResponse: ({ json }: TableMetadataReponse) => json,
|
transformResponse: ({ json }: TableMetadataResponse) => json,
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
tableExtendedMetadata: builder.query<
|
tableExtendedMetadata: builder.query<
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,7 @@ function DatabaseList({
|
||||||
SupersetClient.get({
|
SupersetClient.get({
|
||||||
endpoint: `/api/v1/database/?q=${rison.encode(payload)}`,
|
endpoint: `/api/v1/database/?q=${rison.encode(payload)}`,
|
||||||
}).then(({ json }: Record<string, any>) => {
|
}).then(({ json }: Record<string, any>) => {
|
||||||
// There might be some existings Gsheets and Clickhouse DBs
|
// There might be some existing Gsheets and Clickhouse DBs
|
||||||
// with allow_file_upload set as True which is not possible from now on
|
// with allow_file_upload set as True which is not possible from now on
|
||||||
const allowedDatabasesWithFileUpload =
|
const allowedDatabasesWithFileUpload =
|
||||||
json?.result?.filter(
|
json?.result?.filter(
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@ describe('DatasetList', () => {
|
||||||
).toBeFalsy();
|
).toBeFalsy();
|
||||||
act(() => {
|
act(() => {
|
||||||
wrapper
|
wrapper
|
||||||
.find('#duplicate-action-tooltop')
|
.find('#duplicate-action-tooltip')
|
||||||
.at(0)
|
.at(0)
|
||||||
.find('.action-button')
|
.find('.action-button')
|
||||||
.props()
|
.props()
|
||||||
|
|
@ -212,7 +212,7 @@ describe('DatasetList', () => {
|
||||||
await waitForComponentToPaint(wrapper);
|
await waitForComponentToPaint(wrapper);
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
wrapper
|
wrapper
|
||||||
.find('#duplicate-action-tooltop')
|
.find('#duplicate-action-tooltip')
|
||||||
.at(0)
|
.at(0)
|
||||||
.find('.action-button')
|
.find('.action-button')
|
||||||
.props()
|
.props()
|
||||||
|
|
|
||||||
|
|
@ -478,7 +478,7 @@ const DatasetList: FunctionComponent<DatasetListProps> = ({
|
||||||
)}
|
)}
|
||||||
{canDuplicate && original.kind === 'virtual' && (
|
{canDuplicate && original.kind === 'virtual' && (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
id="duplicate-action-tooltop"
|
id="duplicate-action-tooltip"
|
||||||
title={t('Duplicate')}
|
title={t('Duplicate')}
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -197,14 +197,14 @@ describe('RuleList RTL', () => {
|
||||||
expect(table).toBeInTheDocument();
|
expect(table).toBeInTheDocument();
|
||||||
|
|
||||||
const nameColumn = await within(table).findByText('Name');
|
const nameColumn = await within(table).findByText('Name');
|
||||||
const fitlerTypeColumn = await within(table).findByText('Filter Type');
|
const filterTypeColumn = await within(table).findByText('Filter Type');
|
||||||
const groupKeyColumn = await within(table).findByText('Group Key');
|
const groupKeyColumn = await within(table).findByText('Group Key');
|
||||||
const clauseColumn = await within(table).findByText('Clause');
|
const clauseColumn = await within(table).findByText('Clause');
|
||||||
const modifiedColumn = await within(table).findByText('Last modified');
|
const modifiedColumn = await within(table).findByText('Last modified');
|
||||||
const actionsColumn = await within(table).findByText('Actions');
|
const actionsColumn = await within(table).findByText('Actions');
|
||||||
|
|
||||||
expect(nameColumn).toBeInTheDocument();
|
expect(nameColumn).toBeInTheDocument();
|
||||||
expect(fitlerTypeColumn).toBeInTheDocument();
|
expect(filterTypeColumn).toBeInTheDocument();
|
||||||
expect(groupKeyColumn).toBeInTheDocument();
|
expect(groupKeyColumn).toBeInTheDocument();
|
||||||
expect(clauseColumn).toBeInTheDocument();
|
expect(clauseColumn).toBeInTheDocument();
|
||||||
expect(modifiedColumn).toBeInTheDocument();
|
expect(modifiedColumn).toBeInTheDocument();
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,6 @@ export default function setupApp() {
|
||||||
window.jQuery = $;
|
window.jQuery = $;
|
||||||
require('bootstrap');
|
require('bootstrap');
|
||||||
|
|
||||||
// setup appwide custom error messages
|
// set up app wide custom error messages
|
||||||
setupErrorMessages();
|
setupErrorMessages();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,6 @@ describe('isFrontendRoute', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false if a route does not match', () => {
|
it('returns false if a route does not match', () => {
|
||||||
expect(isFrontendRoute('/non-existent/path/')).toBe(false);
|
expect(isFrontendRoute('/nonexistent/path/')).toBe(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ const reducers = {
|
||||||
explore,
|
explore,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* In some cases the jinja template injects two seperate React apps into basic.html
|
/* In some cases the jinja template injects two separate React apps into basic.html
|
||||||
* One for the top navigation Menu and one for the application below the Menu
|
* One for the top navigation Menu and one for the application below the Menu
|
||||||
* The first app to connect to the Redux debugger wins which is the menu blocking
|
* The first app to connect to the Redux debugger wins which is the menu blocking
|
||||||
* the application from being able to connect to the redux debugger.
|
* the application from being able to connect to the redux debugger.
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ module.exports = {
|
||||||
context.report({
|
context.report({
|
||||||
node,
|
node,
|
||||||
message:
|
message:
|
||||||
"Don't use variables in translation string templates. Flask-babel is a static translation translation service, so it can’t handle strings that include variables",
|
"Don't use variables in translation string templates. Flask-babel is a static translation service, so it can’t handle strings that include variables",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5499,7 +5499,7 @@ msgstr ""
|
||||||
msgid "Intervals"
|
msgid "Intervals"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Intesity"
|
msgid "Intensity"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
|
|
@ -6977,7 +6977,7 @@ msgstr ""
|
||||||
msgid "One or more parameters specified in the query are missing."
|
msgid "One or more parameters specified in the query are missing."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "One ore more annotation layers failed loading."
|
msgid "One or more annotation layers failed loading."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Only SELECT statements are allowed against this database."
|
msgid "Only SELECT statements are allowed against this database."
|
||||||
|
|
@ -12168,7 +12168,7 @@ msgstr ""
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Whether to show extra controls or not. Extra controls include things like"
|
"Whether to show extra controls or not. Extra controls include things like"
|
||||||
" making mulitBar charts stacked or side by side."
|
" making multiBar charts stacked or side by side."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Whether to show minor ticks on the axis"
|
msgid "Whether to show minor ticks on the axis"
|
||||||
|
|
|
||||||
|
|
@ -5498,7 +5498,7 @@ msgstr ""
|
||||||
msgid "Intervals"
|
msgid "Intervals"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Intesity"
|
msgid "Intensity"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
|
|
@ -6974,7 +6974,7 @@ msgstr ""
|
||||||
msgid "One or more parameters specified in the query are missing."
|
msgid "One or more parameters specified in the query are missing."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "One ore more annotation layers failed loading."
|
msgid "One or more annotation layers failed loading."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Only SELECT statements are allowed against this database."
|
msgid "Only SELECT statements are allowed against this database."
|
||||||
|
|
@ -12155,7 +12155,7 @@ msgstr ""
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Whether to show extra controls or not. Extra controls include things like"
|
"Whether to show extra controls or not. Extra controls include things like"
|
||||||
" making mulitBar charts stacked or side by side."
|
" making multiBar charts stacked or side by side."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "Whether to show minor ticks on the axis"
|
msgid "Whether to show minor ticks on the axis"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue