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

Renaming bfetch, charts, console plugin folder to kebab-case #396

Closed
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 packages/osd-spec-to-console/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ At the root of the OpenSearch Dashboards repository, run the following commands:

```sh
# OSS
yarn spec_to_console -g "<OPENSEARCH-REPO-FOLDER>/rest-api-spec/src/main/resources/rest-api-spec/api/*" -d "src/plugins/console/server/lib/spec_definitions/json/generated"
yarn spec_to_console -g "<OPENSEARCH-REPO-FOLDER>/rest-api-spec/src/main/resources/rest-api-spec/api/*" -d "src/plugins/console/server/lib/spec-definitions/json/generated"

```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/

import { fetchStreaming } from './fetch_streaming';
import { mockXMLHttpRequest } from '../test_helpers/xhr';
import { mockXMLHttpRequest } from '../test-helpers/xhr';

const tick = () => new Promise((resolve) => setTimeout(resolve, 1));

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/charts/public/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const createStartContract = (): Start => ({
theme: themeServiceMock,
});

export { colorMapsMock } from './static/color_maps/mock';
export { colorMapsMock } from './static/color-maps/mock';

export const chartPluginMock = {
createSetupContract,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
import { SelectOption } from './select';
import { SwitchOption } from './switch';
import { ColorSchemaParams } from './types';
import { ColorSchema } from '../color_maps';
import { ColorSchema } from '../color-maps';

export type SetColorSchemaOptionsValue = <T extends keyof ColorSchemaParams>(
paramName: T,
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/charts/public/static/components/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* GitHub history for details.
*/

import { ColorSchemas } from '../color_maps';
import { ColorSchemas } from '../color-maps';
import { Rotates } from './collections';

export interface ColorSchemaParams {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/charts/public/static/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
* GitHub history for details.
*/

export * from './color_maps';
export * from './color-maps';
export * from './components';
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import { EuiScreenReaderOnly } from '@elastic/eui';
import { i18n } from '@osd/i18n';
import React, { useEffect } from 'react';
import { createReadOnlyAceEditor } from '../models/legacy_core_editor';
import { createReadOnlyAceEditor } from '../models/legacy-core-editor';

interface EditorExampleProps {
panel: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* GitHub history for details.
*/

export { NetworkRequestStatusBar } from './network_request_status_bar';
export { NetworkRequestStatusBar } from './network-request-status-bar';
export { SomethingWentWrongCallout } from './something_went_wrong_callout';
export { TopNavMenuItem, TopNavMenu } from './top_nav_menu';
export { ConsoleMenu } from './console_menu';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import {

import { useServicesContext } from '../../contexts';
import { HistoryViewer } from './history_viewer';
import { useEditorReadContext } from '../../contexts/editor_context';
import { useEditorReadContext } from '../../contexts/editor-context';
import { useRestoreRequestFromHistory } from '../../hooks';

interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ import { DevToolsSettings } from '../../../services';
import { subscribeResizeChecker } from '../editor/legacy/subscribe_console_resize_checker';

// @ts-ignore
import * as InputMode from '../../models/legacy_core_editor/mode/input';
import * as InputMode from '../../models/legacy-core-editor/mode/input';
const inputMode = new InputMode.Mode();
import * as editor from '../../models/legacy_core_editor';
import { applyCurrentSettings } from '../editor/legacy/console_editor/apply_editor_settings';
import * as editor from '../../models/legacy-core-editor';
import { applyCurrentSettings } from '../editor/legacy/console-editor/apply_editor_settings';

interface Props {
settings: DevToolsSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { EuiProgress } from '@elastic/eui';

import { EditorContentSpinner } from '../../components';
import { Panel, PanelsContainer } from '../../../../../opensearch_dashboards_react/public';
import { Editor as EditorUI, EditorOutput } from './legacy/console_editor';
import { Editor as EditorUI, EditorOutput } from './legacy/console-editor';
import { StorageKeys } from '../../../services';
import { useEditorReadContext, useServicesContext, useRequestReadContext } from '../../contexts';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import { DevToolsSettings } from '../../../../../services';
import { CoreEditor } from '../../../../../types';
import { CustomAceEditor } from '../../../../models/legacy_core_editor';
import { CustomAceEditor } from '../../../../models/legacy-core-editor';

export function applyCurrentSettings(
editor: CoreEditor | CustomAceEditor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* GitHub history for details.
*/

jest.mock('../../../../contexts/editor_context/editor_registry.ts', () => ({
jest.mock('../../../../contexts/editor-context/editor_registry.ts', () => ({
instance: {
setInputEditor: () => {},
getInputEditor: () => ({
Expand All @@ -44,7 +44,7 @@ jest.mock('../../../../../lib/mappings/mappings', () => ({
retrieveAutoCompleteInfo: () => {},
clearSubscriptions: () => {},
}));
jest.mock('../../../../models/sense_editor', () => {
jest.mock('../../../../models/sense-editor', () => {
return {
create: () => ({
getCoreEditor: () => ({
Expand All @@ -64,7 +64,7 @@ jest.mock('../../../../models/sense_editor', () => {
});

jest.mock(
'../../../../hooks/use_send_current_request_to_opensearch/send_request_to_opensearch',
'../../../../hooks/use-send-current-request-to-opensearch/send_request_to_opensearch',
() => ({
sendRequestToOpenSearch: jest.fn(),
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import {
} from '../../../../contexts';

// Mocked functions
import { sendRequestToOpenSearch } from '../../../../hooks/use_send_current_request_to_opensearch/send_request_to_opensearch';
import { sendRequestToOpenSearch } from '../../../../hooks/use-send-current-request-to-opensearch/send_request_to_opensearch';
import { getEndpointFromPosition } from '../../../../../lib/autocomplete/get_endpoint_from_position';

import * as consoleMenuActions from '../console_menu_actions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import {
useSendCurrentRequestToOpenSearch,
useSetInputEditor,
} from '../../../../hooks';
import * as senseEditor from '../../../../models/sense_editor';
import * as senseEditor from '../../../../models/sense-editor';
import { autoIndent, getDocumentation } from '../console_menu_actions';
import { subscribeResizeChecker } from '../subscribe_console_resize_checker';
import { applyCurrentSettings } from './apply_editor_settings';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
useRequestReadContext,
useServicesContext,
} from '../../../../contexts';
import { createReadOnlyAceEditor, CustomAceEditor } from '../../../../models/legacy_core_editor';
import { createReadOnlyAceEditor, CustomAceEditor } from '../../../../models/legacy-core-editor';
import { subscribeResizeChecker } from '../subscribe_console_resize_checker';
import { applyCurrentSettings } from './apply_editor_settings';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* GitHub history for details.
*/
import { throttle } from 'lodash';
import { SenseEditor } from '../../../../models/sense_editor';
import { SenseEditor } from '../../../../models/sense-editor';

interface Actions {
senseEditor: SenseEditor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/

import { getEndpointFromPosition } from '../../../../lib/autocomplete/get_endpoint_from_position';
import { SenseEditor } from '../../../models/sense_editor';
import { SenseEditor } from '../../../models/sense-editor';

export async function autoIndent(editor: SenseEditor, event: Event) {
event.preventDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
* GitHub history for details.
*/

export { EditorOutput, Editor } from './console_editor';
export { EditorOutput, Editor } from './console-editor';
export { getDocumentation, autoIndent } from './console_menu_actions';
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import React, { useState } from 'react';
import { i18n } from '@osd/i18n';
import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiPageContent } from '@elastic/eui';
import { ConsoleHistory } from '../console_history';
import { ConsoleHistory } from '../console-history';
import { Editor } from '../editor';
import { Settings } from '../settings';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* GitHub history for details.
*/

import { SenseEditor } from '../../models/sense_editor';
import { SenseEditor } from '../../models/sense-editor';

export class EditorRegistry {
private inputEditor: SenseEditor | undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/console/public/application/contexts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ export {
useEditorActionContext,
useEditorReadContext,
EditorContextProvider,
} from './editor_context';
} from './editor-context';
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* GitHub history for details.
*/
import { CoreEditor, Position } from '../../types';
import { TokenIterator } from '../../lib/token_iterator';
import { TokenIterator } from '../../lib/token-iterator';

interface Dependencies {
position: Position;
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/console/public/application/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/

export { useSetInputEditor } from './use_set_input_editor';
export { useRestoreRequestFromHistory } from './use_restore_request_from_history';
export { useSendCurrentRequestToOpenSearch } from './use_send_current_request_to_opensearch';
export { useRestoreRequestFromHistory } from './use-restore-request-from-history';
export { useSendCurrentRequestToOpenSearch } from './use-send-current-request-to-opensearch';
export { useSaveCurrentTextObject } from './use_save_current_text_object';
export { useDataInit } from './use_data_init';
export { useDataInit } from './use-data-init';
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/

import RowParser from '../../../lib/row_parser';
import { SenseEditor } from '../../models/sense_editor';
import { SenseEditor } from '../../models/sense-editor';
/**
* This function is considered legacy and should not be changed or updated before we have editor
* interfaces in place (it's using a customized version of Ace directly).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* GitHub history for details.
*/
import { useCallback } from 'react';
import { instance as registry } from '../../contexts/editor_context/editor_registry';
import { instance as registry } from '../../contexts/editor-context/editor_registry';
import { restoreRequestFromHistory } from './restore_request_from_history';

export const useRestoreRequestFromHistory = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* GitHub history for details.
*/

import { SenseEditor } from '../../models/sense_editor';
import { SenseEditor } from '../../models/sense-editor';
import { getEndpointFromPosition } from '../../../lib/autocomplete/get_endpoint_from_position';
import { MetricsTracker } from '../../../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/

jest.mock('./send_request_to_opensearch', () => ({ sendRequestToOpenSearch: jest.fn() }));
jest.mock('../../contexts/editor_context/editor_registry', () => ({
jest.mock('../../contexts/editor-context/editor_registry', () => ({
instance: { getInputEditor: jest.fn() },
}));
jest.mock('./track', () => ({ track: jest.fn() }));
Expand All @@ -43,7 +43,7 @@ import { renderHook, act } from '@testing-library/react-hooks';
import { ContextValue, ServicesContextProvider } from '../../contexts';
import { serviceContextMock } from '../../contexts/services_context.mock';
import { useRequestActionContext } from '../../contexts/request_context';
import { instance as editorRegistry } from '../../contexts/editor_context/editor_registry';
import { instance as editorRegistry } from '../../contexts/editor-context/editor_registry';

import { sendRequestToOpenSearch } from './send_request_to_opensearch';
import { useSendCurrentRequestToOpenSearch } from './use_send_current_request_to_opensearch';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/
import { i18n } from '@osd/i18n';
import { useCallback } from 'react';
import { instance as registry } from '../../contexts/editor_context/editor_registry';
import { instance as registry } from '../../contexts/editor-context/editor_registry';
import { useRequestActionContext, useServicesContext } from '../../contexts';
import { sendRequestToOpenSearch } from './send_request_to_opensearch';
import { track } from './track';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
* GitHub history for details.
*/
import { useCallback } from 'react';
import { useEditorActionContext } from '../contexts/editor_context';
import { instance as registry } from '../contexts/editor_context/editor_registry';
import { useEditorActionContext } from '../contexts/editor-context';
import { instance as registry } from '../contexts/editor-context/editor_registry';

export const useSetInputEditor = () => {
const dispatch = useEditorActionContext();
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/console/public/application/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { HttpSetup, NotificationsSetup } from 'src/core/public';
import { ServicesContextProvider, EditorContextProvider, RequestContextProvider } from './contexts';
import { Main } from './containers';
import { createStorage, createHistory, createSettings } from '../services';
import * as localStorageObjectClient from '../lib/local_storage_object_client';
import * as localStorageObjectClient from '../lib/local-storage-object-client';
import { createUsageTracker } from '../services/tracker';
import { UsageCollectionSetup } from '../../../usage_collection/public';
import { createApi, createOpenSearchHostService } from './lib';
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/console/public/application/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
* GitHub history for details.
*/

export * from './legacy_core_editor/legacy_core_editor';
export * from './sense_editor';
export * from './legacy-core-editor/legacy_core_editor';
export * from './sense-editor';
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ import {
EditorEvent,
AutoCompleterFunction,
} from '../../../types';
import { AceTokensProvider } from '../../../lib/ace_token_provider';
import * as curl from '../sense_editor/curl';
import { AceTokensProvider } from '../../../lib/ace-token-provider';
import * as curl from '../sense-editor/curl';
import smartResize from './smart_resize';

// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/

import { SenseEditor } from './sense_editor';
import * as core from '../legacy_core_editor';
import * as core from '../legacy-core-editor';

export function create(element: HTMLElement) {
const coreEditor = core.create(element);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/

export * from './create';
export * from '../legacy_core_editor/create_readonly';
export * from '../legacy-core-editor/create_readonly';
export { MODE } from '../../../lib/row_parser';
export { SenseEditor } from './sense_editor';
export { getEndpointFromPosition } from '../../../lib/autocomplete/get_endpoint_from_position';
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/
/* eslint no-undef: 0 */

import '../legacy_core_editor/legacy_core_editor.test.mocks';
import '../legacy-core-editor/legacy_core_editor.test.mocks';

import jQuery from 'jquery';
jest.spyOn(jQuery, 'ajax').mockImplementation(
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/console/public/application/stores/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { Reducer } from 'react';
import { produce } from 'immer';
import { identity } from 'fp-ts/lib/function';
import { BaseResponseType } from '../../types/common';
import { OpenSearchRequestResult } from '../hooks/use_send_current_request_to_opensearch/send_request_to_opensearch';
import { OpenSearchRequestResult } from '../hooks/use-send-current-request-to-opensearch/send_request_to_opensearch';

export type Actions =
| { type: 'sendRequest'; payload: undefined }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
import '../../application/models/sense_editor/sense_editor.test.mocks';
import '../../application/models/sense-editor/sense_editor.test.mocks';

import $ from 'jquery';

Expand All @@ -38,7 +38,7 @@ import $ from 'jquery';
// this lib. We also need to import application specific mocks which is not ideal.
// In this situation, the token provider lib knows about app models in tests, which it really shouldn't. Should create
// a better sandbox in future.
import { create, SenseEditor } from '../../application/models/sense_editor';
import { create, SenseEditor } from '../../application/models/sense-editor';

import { Position, Token, TokensProvider } from '../../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
import '../../../application/models/sense_editor/sense_editor.test.mocks';
import '../../../application/models/sense-editor/sense_editor.test.mocks';
import * as mappings from '../mappings';

describe('Mappings', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/console/public/lib/osd/__tests__/kb.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import _ from 'lodash';
import { populateContext } from '../../autocomplete/engine';

import '../../../application/models/sense_editor/sense_editor.test.mocks';
import '../../../application/models/sense-editor/sense_editor.test.mocks';
import * as osd from '../../osd';
import * as mappings from '../../mappings/mappings';

Expand Down
Loading