Skip to content

Commit

Permalink
Consolidate ExitFullScreenButton (elastic#170404)
Browse files Browse the repository at this point in the history
## Summary

close elastic#168696

- Remove old copy from `kibana_react`
- Remove -types and -mocks packages, move them into a single package
(not needed since we don't use bazel now)

### Risks

No Risks, since old copy was not used
  • Loading branch information
Dosant authored Nov 3, 2023
1 parent 9b6edea commit c2f6fc4
Show file tree
Hide file tree
Showing 39 changed files with 29 additions and 405 deletions.
4 changes: 1 addition & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,7 @@ examples/share_examples @elastic/appex-sharedux
src/plugins/share @elastic/appex-sharedux
packages/kbn-shared-svg @elastic/apm-ui
packages/shared-ux/avatar/solution @elastic/appex-sharedux
packages/shared-ux/button/exit_full_screen/impl @elastic/appex-sharedux
packages/shared-ux/button/exit_full_screen/mocks @elastic/appex-sharedux
packages/shared-ux/button/exit_full_screen/types @elastic/appex-sharedux
packages/shared-ux/button/exit_full_screen @elastic/appex-sharedux
packages/shared-ux/button_toolbar @elastic/appex-sharedux
packages/shared-ux/card/no_data/impl @elastic/appex-sharedux
packages/shared-ux/card/no_data/mocks @elastic/appex-sharedux
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -679,9 +679,7 @@
"@kbn/share-plugin": "link:src/plugins/share",
"@kbn/shared-svg": "link:packages/kbn-shared-svg",
"@kbn/shared-ux-avatar-solution": "link:packages/shared-ux/avatar/solution",
"@kbn/shared-ux-button-exit-full-screen": "link:packages/shared-ux/button/exit_full_screen/impl",
"@kbn/shared-ux-button-exit-full-screen-mocks": "link:packages/shared-ux/button/exit_full_screen/mocks",
"@kbn/shared-ux-button-exit-full-screen-types": "link:packages/shared-ux/button/exit_full_screen/types",
"@kbn/shared-ux-button-exit-full-screen": "link:packages/shared-ux/button/exit_full_screen",
"@kbn/shared-ux-button-toolbar": "link:packages/shared-ux/button_toolbar",
"@kbn/shared-ux-card-no-data": "link:packages/shared-ux/card/no_data/impl",
"@kbn/shared-ux-card-no-data-mocks": "link:packages/shared-ux/card/no_data/mocks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
* Side Public License, v 1.
*/

export { ExitFullScreenButtonKibanaProvider, ExitFullScreenButtonProvider } from './src/services';
export { ExitFullScreenButton as ExitFullScreenButtonComponent } from './src/exit_full_screen_button.component';
export { ExitFullScreenButtonKibanaProvider } from './src/services';
export { ExitFullScreenButton } from './src/exit_full_screen_button';
export type { ExitFullScreenButtonProps, ExitFullScreenButtonKibanaDependencies } from './types';
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/packages/shared-ux/button/exit_full_screen/impl'],
rootDir: '../../../..',
roots: ['<rootDir>/packages/shared-ux/button/exit_full_screen'],
};
3 changes: 0 additions & 3 deletions packages/shared-ux/button/exit_full_screen/mocks/README.md

This file was deleted.

6 changes: 3 additions & 3 deletions packages/shared-ux/button/exit_full_screen/mocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
export {
getKibanaDependenciesMock as getExitFullScreenButtonKibanaDependenciesMock,
getServicesMock as getExitFullScreenButtonServicesMock,
} from './src/jest';
} from './jest';

export { StorybookMock as ExitFullScreenButtonStorybookMock } from './src/storybook';
export type { Params as ExitFullScreenButtonStorybookParams } from './src/storybook';
export { StorybookMock as ExitFullScreenButtonStorybookMock } from './storybook';
export type { Params as ExitFullScreenButtonStorybookParams } from './storybook';
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* Side Public License, v 1.
*/

import {
import { of } from 'rxjs';
import type {
ExitFullScreenButtonKibanaDependencies,
ExitFullScreenButtonServices,
} from '@kbn/shared-ux-button-exit-full-screen-types';
import { of } from 'rxjs';
} from '../types';

/**
* Return a Jest mock of the services for the `ExitFullScreenButton` component.
Expand Down
5 changes: 0 additions & 5 deletions packages/shared-ux/button/exit_full_screen/mocks/kibana.jsonc

This file was deleted.

6 changes: 0 additions & 6 deletions packages/shared-ux/button/exit_full_screen/mocks/package.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@

import { action } from '@storybook/addon-actions';
import { AbstractStorybookMock, ArgumentParams } from '@kbn/shared-ux-storybook-mock';
import type {
ExitFullScreenButtonProps as Props,
ExitFullScreenButtonServices,
} from '@kbn/shared-ux-button-exit-full-screen-types';
import { of } from 'rxjs';
import type { ExitFullScreenButtonProps as Props, ExitFullScreenButtonServices } from '../types';

type PropArguments = Pick<Props, 'toggleChrome'>;

Expand Down
21 changes: 0 additions & 21 deletions packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { i18n } from '@kbn/i18n';
import { css } from '@emotion/react';
import cx from 'classnames';

import type { ExitFullScreenButtonComponentProps as Props } from '@kbn/shared-ux-button-exit-full-screen-types';
import type { ExitFullScreenButtonComponentProps as Props } from '../types';

import './exit_full_screen_button.scss';

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

import React from 'react';
import { ExitFullScreenButtonStorybookMock } from '@kbn/shared-ux-button-exit-full-screen-mocks';
import type { ExitFullScreenButtonStorybookParams } from '@kbn/shared-ux-button-exit-full-screen-mocks';
import {
ExitFullScreenButtonStorybookMock,
type ExitFullScreenButtonStorybookParams,
} from '../mocks';

import { ExitFullScreenButtonProvider } from './services';
import { ExitFullScreenButton as Component } from './exit_full_screen_button';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { keys } from '@elastic/eui';
import {
getExitFullScreenButtonServicesMock,
getExitFullScreenButtonKibanaDependenciesMock,
} from '@kbn/shared-ux-button-exit-full-screen-mocks';
} from '../mocks';

import { ExitFullScreenButton } from './exit_full_screen_button';
import { ExitFullScreenButtonKibanaProvider, ExitFullScreenButtonProvider } from './services';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import React, { useCallback, useEffect } from 'react';
import { useEuiTheme, keys } from '@elastic/eui';
import { css } from '@emotion/react';
import useMountedState from 'react-use/lib/useMountedState';
import useObservable from 'react-use/lib/useObservable';

import type { ExitFullScreenButtonProps as Props } from '@kbn/shared-ux-button-exit-full-screen-types';
import type { ExitFullScreenButtonProps as Props } from '../types';

import useObservable from 'react-use/lib/useObservable';
import { ExitFullScreenButton as Component } from './exit_full_screen_button.component';
import { useServices } from './services';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
Services,
ExitFullScreenButtonServices,
ExitFullScreenButtonKibanaDependencies,
} from '@kbn/shared-ux-button-exit-full-screen-types';
} from '../types';

const ExitFullScreenButtonContext = React.createContext<Services | null>(null);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../../tsconfig.base.json",
"extends": "../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand All @@ -15,8 +15,8 @@
],
"kbn_references": [
"@kbn/i18n",
"@kbn/shared-ux-button-exit-full-screen-types",
"@kbn/shared-ux-button-exit-full-screen-mocks",
"@kbn/shared-ux-storybook-mock",
"@kbn/core-custom-branding-common"
],
"exclude": [
"target/**/*",
Expand Down
3 changes: 0 additions & 3 deletions packages/shared-ux/button/exit_full_screen/types/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/shared-ux/button/exit_full_screen/types/kibana.jsonc

This file was deleted.

6 changes: 0 additions & 6 deletions packages/shared-ux/button/exit_full_screen/types/package.json

This file was deleted.

16 changes: 0 additions & 16 deletions packages/shared-ux/button/exit_full_screen/types/tsconfig.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit c2f6fc4

Please sign in to comment.