Skip to content

Commit

Permalink
[Rename] Refactored src/core/public directory (#93)
Browse files Browse the repository at this point in the history
* [Rename] Refactored src/core/public directory

Signed-off-by: Mihir Soni <[email protected]>

* [Rename] addressed review feedbacks

Signed-off-by: Mihir Soni <[email protected]>
  • Loading branch information
mihirsoni committed Mar 20, 2021
1 parent 7a22b8e commit b576780
Show file tree
Hide file tree
Showing 107 changed files with 401 additions and 401 deletions.
2 changes: 1 addition & 1 deletion src/core/public/_core.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* designed to emulate root-element stretching and overflow
* prevention previously handled in kbn_chrome.less
* prevention previously handled in osd_chrome.less
*/
.coreSystemRootDomElement {
overflow-x: hidden;
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@import '@elastic/eui/src/global_styling/variables/header';

$kbnHeaderOffset: $euiHeaderHeightCompensation * 2;
$osdHeaderOffset: $euiHeaderHeightCompensation * 2;
20 changes: 10 additions & 10 deletions src/core/public/apm_system.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('ApmSystem', () => {
windowSpy = jest.spyOn(global as any, 'window', 'get').mockImplementation(() => ({
location: {
protocol: 'http:',
hostname: 'mykibanadomain.com',
hostname: 'myopensearch-dashboardsdomain.com',
port: '5601',
},
}));
Expand Down Expand Up @@ -93,29 +93,29 @@ describe('ApmSystem', () => {
expect(
wrappedObserver({
type: 'http-request',
name: 'GET http://mykibanadomain.com:5601/asdf/qwerty',
name: 'GET http://myopensearch-dashboardsdomain.com:5601/asdf/qwerty',
} as Transaction)
).toEqual({ type: 'http-request', name: 'GET /asdf/qwerty' });

// Does not modify URLs that are not on the same origin
expect(
wrappedObserver({
type: 'http-request',
name: 'GET https://mykibanadomain.com:5601/asdf/qwerty',
name: 'GET https://myopensearch-dashboardsdomain.com:5601/asdf/qwerty',
} as Transaction)
).toEqual({
type: 'http-request',
name: 'GET https://mykibanadomain.com:5601/asdf/qwerty',
name: 'GET https://myopensearch-dashboardsdomain.com:5601/asdf/qwerty',
});

expect(
wrappedObserver({
type: 'http-request',
name: 'GET http://mykibanadomain.com:9200/asdf/qwerty',
name: 'GET http://myopensearch-dashboardsdomain.com:9200/asdf/qwerty',
} as Transaction)
).toEqual({
type: 'http-request',
name: 'GET http://mykibanadomain.com:9200/asdf/qwerty',
name: 'GET http://myopensearch-dashboardsdomain.com:9200/asdf/qwerty',
});

expect(
Expand All @@ -138,28 +138,28 @@ describe('ApmSystem', () => {
expect(
wrappedObserver({
type: 'http-request',
name: 'GET http://mykibanadomain.com:5601/alpha',
name: 'GET http://myopensearch-dashboardsdomain.com:5601/alpha',
} as Transaction)
).toEqual({ type: 'http-request', name: 'GET /' });

expect(
wrappedObserver({
type: 'http-request',
name: 'GET http://mykibanadomain.com:5601/alpha/',
name: 'GET http://myopensearch-dashboardsdomain.com:5601/alpha/',
} as Transaction)
).toEqual({ type: 'http-request', name: 'GET /' });

expect(
wrappedObserver({
type: 'http-request',
name: 'GET http://mykibanadomain.com:5601/alpha/beta',
name: 'GET http://myopensearch-dashboardsdomain.com:5601/alpha/beta',
} as Transaction)
).toEqual({ type: 'http-request', name: 'GET /beta' });

expect(
wrappedObserver({
type: 'http-request',
name: 'GET http://mykibanadomain.com:5601/alpha/beta/',
name: 'GET http://myopensearch-dashboardsdomain.com:5601/alpha/beta/',
} as Transaction)
).toEqual({ type: 'http-request', name: 'GET /beta/' });

Expand Down
8 changes: 4 additions & 4 deletions src/core/public/apm_system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
*/

import type { ApmBase } from '@elastic/apm-rum';
import { modifyUrl } from '@kbn/std';
import { modifyUrl } from '@osd/std';
import type { InternalApplicationStart } from './application';

/** "GET protocol://hostname:port/pathname" */
const HTTP_REQUEST_TRANSACTION_NAME_REGEX = /^(GET|POST|PUT|HEAD|PATCH|DELETE|OPTIONS|CONNECT|TRACE)\s(.*)$/;

/**
* This is the entry point used to boot the frontend when serving a application
* that lives in the Kibana Platform.
* that lives in the OpenSearch Dashboards Platform.
*/

interface ApmConfig {
Expand Down Expand Up @@ -66,10 +66,10 @@ export class ApmSystem {
if (!this.enabled || !start) return;
/**
* Register listeners for navigation changes and capture them as
* route-change transactions after Kibana app is bootstrapped
* route-change transactions after OpenSearch Dashboards app is bootstrapped
*/
start.application.currentAppId$.subscribe((appId) => {
const apmInstance = (window as any).elasticApm;
const apmInstance = (window as any).opensearchApm;
if (appId && apmInstance && typeof apmInstance.startTransaction === 'function') {
apmInstance.startTransaction(`/app/${appId}`, 'route-change', {
managed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
import { deepFreeze } from '@kbn/std';
import type { PublicMethodsOf } from '@kbn/utility-types';
import { deepFreeze } from '@osd/std';
import type { PublicMethodsOf } from '@osd/utility-types';
import { CapabilitiesService, CapabilitiesStart } from './capabilities_service';

const createStartContractMock = (): jest.Mocked<CapabilitiesStart> => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
import { RecursiveReadonly } from '@kbn/utility-types';
import { deepFreeze } from '@kbn/std';
import { RecursiveReadonly } from '@osd/utility-types';
import { deepFreeze } from '@osd/std';

import { Capabilities } from '../../../types/capabilities';
import { HttpStart } from '../../http';
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/application/integration_tests/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import React, { ReactElement } from 'react';
import { act } from 'react-dom/test-utils';
import { mount } from 'enzyme';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@osd/i18n/react';

import { AppMountParameters } from '../types';
import { MockedMounterTuple, Mountable } from '../test_types';
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/application/test_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import type { PublicMethodsOf } from '@kbn/utility-types';
import type { PublicMethodsOf } from '@osd/utility-types';
import { AppUnmount, Mounter } from './types';
import { ApplicationService } from './application_service';

Expand Down
6 changes: 3 additions & 3 deletions src/core/public/application/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { Observable } from 'rxjs';
import { History } from 'history';
import { RecursiveReadonly } from '@kbn/utility-types';
import { RecursiveReadonly } from '@osd/utility-types';

import { MountPoint } from '../types';
import { Capabilities } from './capabilities';
Expand Down Expand Up @@ -728,10 +728,10 @@ export interface ApplicationStart {
*
* @example
* ```ts
* // current url: `https://kibana:8080/base-path/s/my-space/app/dashboard`
* // current url: `https://opensearch-dashboards:8080/base-path/s/my-space/app/dashboard`
*
* // will call `application.navigateToApp('discover', { path: '/some-path?foo=bar'})`
* application.navigateToUrl('https://kibana:8080/base-path/s/my-space/app/discover/some-path?foo=bar')
* application.navigateToUrl('https://opensearch-dashboards:8080/base-path/s/my-space/app/discover/some-path?foo=bar')
* application.navigateToUrl('/base-path/s/my-space/app/discover/some-path?foo=bar')
* application.navigateToUrl('./discover/some-path?foo=bar')
*
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/application/ui/app_not_found_screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { EuiEmptyPrompt, EuiPage, EuiPageBody, EuiPageContent } from '@elastic/eui';
import React from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@osd/i18n/react';

export const AppNotFound = () => (
<EuiPage style={{ minHeight: '100%' }} data-test-subj="appNotFoundPageContent">
Expand Down
Loading

0 comments on commit b576780

Please sign in to comment.