Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Rename datasource file #243

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/DataSource.test.ts → src/XRayDataSource.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { XrayDataSource } from './DataSource';
import { XrayDataSource } from './XRayDataSource';
import {
ArrayVector,
DataFrame,
Expand Down Expand Up @@ -108,10 +108,10 @@
expect(nodes.fields.length).toBe(9);
const edges: DataFrame = response.data[1];
expect(edges.fields.length).toBe(7);
expect(edges.fields.find((f) => f.name === NodeGraphDataFrameFieldNames.mainStat)?.values.toArray()).toEqual(

Check warning on line 111 in src/XRayDataSource.test.ts

View workflow job for this annotation

GitHub Actions / build

'toArray' is deprecated. this is not necessary. This only exists to help migrate Vector to Array
expect.arrayContaining(['N/A'])
);
expect(edges.fields.find((f) => f.name === NodeGraphDataFrameFieldNames.secondaryStat)?.values.toArray()).toEqual(

Check warning on line 114 in src/XRayDataSource.test.ts

View workflow job for this annotation

GitHub Actions / build

'toArray' is deprecated. this is not necessary. This only exists to help migrate Vector to Array
expect.arrayContaining([undefined])
);
expect(response.data[0].fields[0].config.links[0].internal.query.query).toBe(
Expand All @@ -126,9 +126,9 @@
expect(df.fields[0].config.links?.[0].url).toBe(
'https://us-east.console.aws.amazon.com/xray/home?region=us-east#/insights/${__value.raw}'
);
expect(df.fields[1].display?.(df.fields[1].values.get(0)).text).toBe('1 hours 16 minutes 30 seconds');

Check warning on line 129 in src/XRayDataSource.test.ts

View workflow job for this annotation

GitHub Actions / build

'get' is deprecated. Use [idx]. This only exists to help migrate Vector to Array
expect(df.fields[1].display?.(df.fields[1].values.get(1)).text).toBe('23 minutes 42 seconds');

Check warning on line 130 in src/XRayDataSource.test.ts

View workflow job for this annotation

GitHub Actions / build

'get' is deprecated. Use [idx]. This only exists to help migrate Vector to Array
expect(df.fields[1].display?.(df.fields[1].values.get(2)).text).toBe('42 seconds');

Check warning on line 131 in src/XRayDataSource.test.ts

View workflow job for this annotation

GitHub Actions / build

'get' is deprecated. Use [idx]. This only exists to help migrate Vector to Array
});

it('adds correct resolution based on interval', async () => {
Expand Down Expand Up @@ -495,31 +495,31 @@
}

function makeTraceSummariesResponse(): DataFrame {
return new MutableDataFrame({

Check warning on line 498 in src/XRayDataSource.test.ts

View workflow job for this annotation

GitHub Actions / build

'MutableDataFrame' is deprecated. use standard DataFrame, or create one with PartialDataFrame
name: 'TraceSummaries',
fields: [
{
name: 'Id',
type: FieldType.string,
values: new ArrayVector(['12345', '67890']),

Check warning on line 504 in src/XRayDataSource.test.ts

View workflow job for this annotation

GitHub Actions / build

'ArrayVector' is deprecated. use a simple Array<T>
},
{
name: 'Duration',
type: FieldType.number,
values: new ArrayVector([10, 20]),

Check warning on line 509 in src/XRayDataSource.test.ts

View workflow job for this annotation

GitHub Actions / build

'ArrayVector' is deprecated. use a simple Array<T>
},
],
});
}

function makeInsightResponse(): DataFrame {
return new MutableDataFrame({

Check warning on line 516 in src/XRayDataSource.test.ts

View workflow job for this annotation

GitHub Actions / build

'MutableDataFrame' is deprecated. use standard DataFrame, or create one with PartialDataFrame
name: 'InsightSummaries',
fields: [
{
name: 'InsightId',
type: FieldType.string,
values: new ArrayVector(['12345', '67890', 'sss']),

Check warning on line 522 in src/XRayDataSource.test.ts

View workflow job for this annotation

GitHub Actions / build

'ArrayVector' is deprecated. use a simple Array<T>
},
{
name: 'Duration',
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/QueryEditor/AccountIdDropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { XrayDataSource } from 'DataSource';
import { XrayDataSource } from 'XRayDataSource';
import { useAccountIds } from './useAccountIds';
import { XrayQuery } from '../../types';
import { TimeRange } from '@grafana/data';
Expand Down
2 changes: 1 addition & 1 deletion src/components/QueryEditor/QueryEditor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { render, screen, fireEvent, act, waitFor, waitForElementToBeRemoved } from '@testing-library/react';
import { QueryEditor } from './QueryEditor';
import { Group, Region, XrayJsonData, XrayQuery, XrayQueryType } from '../../types';
import { XrayDataSource } from '../../DataSource';
import { XrayDataSource } from '../../XRayDataSource';
import { DataSourceInstanceSettings, ScopedVars, TypedVariableModel } from '@grafana/data';

const defaultProps = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/QueryEditor/QueryEditorForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
traceListOption,
traceStatisticsOption,
} from './constants';
import { XrayDataSource } from '../../DataSource';
import { XrayDataSource } from '../../XRayDataSource';
import { getTemplateSrv } from '@grafana/runtime';
import { AccountIdDropdown } from './AccountIdDropdown';
import { EditorRow, EditorFieldGroup, EditorField } from '@grafana/experimental';
Expand Down
2 changes: 1 addition & 1 deletion src/components/QueryEditor/QuerySection.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { XRayQueryField } from './XRayQueryField';
import React from 'react';
import { XrayDataSource } from '../../DataSource';
import { XrayDataSource } from '../../XRayDataSource';
import { css } from '@emotion/css';
import { XrayQuery } from '../../types';
import { QueryTypeOption } from './constants';
Expand Down
2 changes: 1 addition & 1 deletion src/components/QueryEditor/XRayQueryField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Prism from 'prismjs';
import { Node } from 'slate';
import { QueryField, TypeaheadInput, TypeaheadOutput, BracesPlugin, SlatePrism } from '@grafana/ui';
import { QueryEditorProps } from '@grafana/data';
import { XrayDataSource } from 'DataSource';
import { XrayDataSource } from 'XRayDataSource';
import { XrayQuery, XrayJsonData, XrayQueryType } from 'types';
import { XRayLanguageProvider } from 'language_provider';
import { tokenizer } from 'syntax';
Expand Down
2 changes: 1 addition & 1 deletion src/components/QueryEditor/XrayLinks.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useTheme2 } from '@grafana/ui';
import { css } from '@emotion/css';
import { XrayDataSource } from '../../DataSource';
import { XrayDataSource } from '../../XRayDataSource';
import { XrayQuery } from '../../types';
import { GrafanaTheme2, TimeRange } from '@grafana/data';
import React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/components/QueryEditor/XrayLinksOld.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { stylesFactory } from '@grafana/ui';
import { css } from '@emotion/css';
import { XrayDataSource } from '../../DataSource';
import { XrayDataSource } from '../../XRayDataSource';
import { XrayQuery } from '../../types';
import { TimeRange } from '@grafana/data';
import React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/components/QueryEditor/useAccountIds.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { XrayDataSource } from 'DataSource';
import { XrayDataSource } from 'XRayDataSource';
import { useAsync } from 'react-use';
import { XrayQuery } from 'types';
import { useError } from './useError';
Expand Down
2 changes: 1 addition & 1 deletion src/components/QueryEditor/useGroups.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { XrayDataSource } from '../../DataSource';
import { XrayDataSource } from '../../XRayDataSource';
import { Group } from '../../types';
import useAsync from 'react-use/lib/useAsync';
import { useError } from './useError';
Expand Down
2 changes: 1 addition & 1 deletion src/components/QueryEditor/useInitQuery.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Group, Region, XrayQuery, XrayQueryType } from '../../types';
import { XrayDataSource } from '../../DataSource';
import { XrayDataSource } from '../../XRayDataSource';
import { useEffect } from 'react';
import { dummyAllGroup } from './constants';

Expand Down
2 changes: 1 addition & 1 deletion src/components/QueryEditor/useRegions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import useAsync from 'react-use/lib/useAsync';
import { XrayDataSource } from '../../DataSource';
import { XrayDataSource } from '../../XRayDataSource';
import { Region } from '../../types';
import { useError } from './useError';

Expand Down
2 changes: 1 addition & 1 deletion src/language_provider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LanguageProvider } from '@grafana/data';
import { XrayDataSource } from 'DataSource';
import { XrayDataSource } from 'XRayDataSource';
import { TypeaheadInput, TypeaheadOutput } from '@grafana/ui';
import { BOOLEAN_KEYWORDS, NUMBER_KEYWORDS, STRING_KEYWORDS, COMPLEX_KEYWORDS } from 'syntax';

Expand Down
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { DataSourcePlugin } from '@grafana/data';
import CheatSheet from './components/CheatSheet';
import { ConfigEditor } from './components/ConfigEditor/ConfigEditor';
import { QueryEditor } from './components/QueryEditor/QueryEditor';
import { XrayDataSource } from './DataSource';
import { XrayDataSource } from './XRayDataSource';
import { XrayJsonData, XrayQuery } from './types';

export const plugin = new DataSourcePlugin<XrayDataSource, XrayQuery, XrayJsonData, AwsAuthDataSourceSecureJsonData>(
Expand Down