chore: removing Druid from front- and back- end (#20338)

* first pass at removing native Druid nosql

* removing having_druid

* addressing comments, linting

* fixed all tests

* addressing comments

* redirected to ui-core TimeGranularity type

* query form metric linting

* fixed broken chart type

* implementing feedback
This commit is contained in:
AAfghahi
2022-07-08 11:57:03 -04:00
committed by GitHub
parent 9856d88c03
commit 0ce0c6e1eb
47 changed files with 65 additions and 454 deletions

View File

@@ -80,18 +80,6 @@ test('Should render correct elements for SQL', () => {
expect(screen.getByRole('tabpanel', { name: 'Saved' })).toBeVisible();
});
test('Should render correct elements for native Druid', () => {
const props = { ...createProps(), datasource: { type: 'druid' } };
render(<AdhocMetricEditPopover {...props} />);
expect(screen.getByRole('tab', { name: 'Custom SQL' })).toHaveAttribute(
'aria-disabled',
'true',
);
expect(screen.getByRole('tab', { name: 'Simple' })).toBeEnabled();
expect(screen.getByRole('tab', { name: 'Saved' })).toBeEnabled();
expect(screen.getByRole('tabpanel', { name: 'Saved' })).toBeVisible();
});
test('Should render correct elements for allow ad-hoc metrics', () => {
const props = {
...createProps(),

View File

@@ -323,15 +323,6 @@ export default class AdhocMetricEditPopover extends React.PureComponent {
autoFocus: true,
};
if (
this.props.datasource?.type === 'druid' &&
aggregateSelectProps.options
) {
aggregateSelectProps.options = aggregateSelectProps.options.filter(
aggregate => aggregate !== 'AVG',
);
}
const stateIsValid = adhocMetric.isValid() || savedMetric?.metric_name;
const hasUnsavedChanges =
!adhocMetric.equals(propsAdhocMetric) ||
@@ -431,18 +422,11 @@ export default class AdhocMetricEditPopover extends React.PureComponent {
<Tabs.TabPane
key={EXPRESSION_TYPES.SQL}
tab={
extra.disallow_adhoc_metrics ||
this.props.datasource?.type === 'druid' ? (
extra.disallow_adhoc_metrics ? (
<Tooltip
title={
this.props.datasource?.type === 'druid'
? t(
'Custom SQL ad-hoc metrics are not available for the native Druid connector',
)
: t(
'Custom SQL ad-hoc metrics are not enabled for this dataset',
)
}
title={t(
'Custom SQL ad-hoc metrics are not enabled for this dataset',
)}
>
{t('Custom SQL')}
</Tooltip>
@@ -451,10 +435,7 @@ export default class AdhocMetricEditPopover extends React.PureComponent {
)
}
data-test="adhoc-metric-edit-tab#custom"
disabled={
extra.disallow_adhoc_metrics ||
this.props.datasource?.type === 'druid'
}
disabled={extra.disallow_adhoc_metrics}
>
<SQLEditor
data-test="sql-editor"