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

MTV-1974: Move common package into forklift #1524

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@
"repository": "https://github.com/kubev2v/forklift-console-plugin.git",
"workspaces": [
"packages/eslint-plugin",
"packages/common",
"packages/forklift-console-plugin"
],
"scripts": {
"clean": "rm -rf ./dist ./coverage && yarn workspace @kubev2v/common run clean && yarn workspace @kubev2v/forklift-console-plugin run clean",
"clean": "rm -rf ./dist ./coverage && yarn workspace @kubev2v/forklift-console-plugin run clean",
"clean:all": "yarn run clean && rm -rf ./node_modules ./tmp",
"build": "NODE_ENV=production yarn workspace @kubev2v/common run build && NODE_ENV=production yarn workspace @kubev2v/forklift-console-plugin run build",
"start": "concurrently \"NODE_ENV=development yarn workspace @kubev2v/common run start\" \"NODE_ENV=development yarn workspace @kubev2v/forklift-console-plugin run start\"",
"build": "NODE_ENV=production yarn workspace @kubev2v/forklift-console-plugin run build",
"start": "NODE_ENV=development yarn workspace @kubev2v/forklift-console-plugin run start",
"i18n": "yarn workspace @kubev2v/forklift-console-plugin run i18n",
"lint": "yarn workspaces run lint",
"lint:fix": "yarn workspaces run lint:fix",
"test:i18n": "bash ./ci/test-i18n.sh",
"test": "yarn workspace @kubev2v/common run build && yarn workspaces run test",
"test:coverage": "yarn workspace @kubev2v/common run build && yarn workspaces run test:coverage",
"test:updateSnapshot": "yarn workspace @kubev2v/common run build && yarn workspaces run test:updateSnapshot",
"test": "yarn workspaces run test",
"test:coverage": "yarn workspaces run test:coverage",
"test:updateSnapshot": "yarn workspaces run test:updateSnapshot",
"test:e2e": "cd testing && cypress run --browser chrome --headed",
"console": "bash ./ci/start-console.sh",
"console:stop": "bash ./ci/stop-console.sh",
Expand Down
37 changes: 0 additions & 37 deletions packages/common/rollup.config.js

This file was deleted.

19 changes: 0 additions & 19 deletions packages/common/src/components/Icons/RedHatProgressionIcon.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions packages/common/src/components/Icons/index.ts

This file was deleted.

32 changes: 0 additions & 32 deletions packages/common/src/components/QueryClientHoc/QueryClientHoc.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions packages/common/src/components/QueryClientHoc/index.ts

This file was deleted.

5 changes: 0 additions & 5 deletions packages/common/src/index.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/forklift-console-plugin/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ const moduleNameMapper = {
...pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/',
}),

// Mappings for monorepo packages
'@kubev2v/common/(.*)$': '<rootDir>/../common/dist/$1',
};

// Sync object
Expand Down
1 change: 0 additions & 1 deletion packages/forklift-console-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"test:updateSnapshot": "TZ=UTC jest --updateSnapshot"
},
"dependencies": {
"@kubev2v/common": "*",
"@kubev2v/types": "0.0.20",
"@openshift-console/dynamic-plugin-sdk": "1.8.0",
"@patternfly/react-charts": "7.4.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, { createContext, FC, PropsWithChildren, useContext } from 'react';

import { ResourceField, SortType, useSort } from '@kubev2v/common';
import { useSort } from './common/components/TableView/sort';
import { SortType } from './common/components/TableView/types';
import { ResourceField } from './common/utils/types';

export type TableSortContextProps = {
activeSort: SortType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { FC, ReactNode } from 'react';
import { useForkliftTranslation } from 'src/utils';

import { FormGroupWithHelpText, TypeaheadSelect, TypeaheadSelectOption } from '@kubev2v/common';
import {
K8sResourceKind,
useFlag,
Expand All @@ -10,6 +9,12 @@ import {
import { Popover } from '@patternfly/react-core';
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';

import { FormGroupWithHelpText } from './components/FormGroupWithHelpText/FormGroupWithHelpText';
import {
TypeaheadSelect,
TypeaheadSelectOption,
} from './components/TypeaheadSelect/TypeaheadSelect';

interface ProjectNameSelectProps {
value: string | undefined;
options: TypeaheadSelectOption[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ export * from './Filter';
export * from './FilterGroup';
export * from './FormGroupWithHelpText';
export * from './HelpIconPopover';
export * from './Icons';
export * from './LoadingDots';
export * from './Page';
export * from './QueryClientHoc';
export * from './TableView';
export * from './TypeaheadSelect';
// @endindex
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { useState } from 'react';
import { useForkliftTranslation } from 'src/utils/i18n';

import { ManageColumnsModal, ManageColumnsToolbarItem } from '@kubev2v/common';
import { ResourceField } from '@kubev2v/common';
import { ManageColumnsModal } from '../common/components/TableView/ManageColumnsModal';
import { ManageColumnsToolbarItem } from '../common/components/TableView/ManageColumnsToolbarItem';
import { ResourceField } from '../common/utils/types';

export interface ManageColumnsToolbarProps {
/** Read only. State maintained by parent component. */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,6 @@
import React, { FC, ReactNode, useEffect, useMemo, useState } from 'react';
import { useForkliftTranslation } from 'src/utils/i18n';

import {
AttributeValueFilter,
createMetaMatcher,
DEFAULT_PER_PAGE,
DefaultHeader,
DefaultRow,
defaultSupportedFilters,
defaultValueMatchers,
ErrorState,
FilterGroup,
FilterRenderer,
GlobalActionToolbarProps,
Loading,
NoResultsFound,
NoResultsMatchFilter,
ResourceField,
RowProps,
TableView,
TableViewHeaderProps,
toFieldFilter,
useFields,
usePagination,
UserSettings,
useUrlFilters,
ValueMatcher,
withTr,
} from '@kubev2v/common';
import {
Level,
LevelItem,
Expand All @@ -41,6 +14,31 @@ import {
} from '@patternfly/react-core';
import { FilterIcon } from '@patternfly/react-icons';

import { AttributeValueFilter } from '../common/components/FilterGroup/AttributeValueFilter';
import { FilterGroup } from '../common/components/FilterGroup/FilterGroup';
import { toFieldFilter } from '../common/components/FilterGroup/helpers';
import {
createMetaMatcher,
defaultSupportedFilters,
defaultValueMatchers,
} from '../common/components/FilterGroup/matchers';
import { FilterRenderer, ValueMatcher } from '../common/components/FilterGroup/types';
import { useUrlFilters } from '../common/components/FilterGroup/useUrlFilters';
import {
ErrorState,
Loading,
NoResultsFound,
NoResultsMatchFilter,
} from '../common/components/Page/PageStates';
import { UserSettings } from '../common/components/Page/types';
import { useFields } from '../common/components/Page/useFields';
import { DEFAULT_PER_PAGE, usePagination } from '../common/components/Page/usePagination';
import { DefaultHeader } from '../common/components/TableView/DefaultHeader';
import { DefaultRow } from '../common/components/TableView/DefaultRow';
import { TableView } from '../common/components/TableView/TableView';
import { RowProps, TableViewHeaderProps } from '../common/components/TableView/types';
import { withTr } from '../common/components/TableView/withTr';
import { GlobalActionToolbarProps, ResourceField } from '../common/utils/types';
import {
TableSortContext,
TableSortContextProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React, { FC, useState } from 'react';

import {
DefaultHeader,
GlobalActionToolbarProps,
RowProps,
TableViewHeaderProps,
withTr,
} from '@kubev2v/common';
import { Td, Th } from '@patternfly/react-table';

import { DefaultHeader } from '../common/components/TableView/DefaultHeader';
import { RowProps, TableViewHeaderProps } from '../common/components/TableView/types';
import { withTr } from '../common/components/TableView/withTr';
import { GlobalActionToolbarProps } from '../common/utils/types';

import StandardPage, { StandardPageProps } from './StandardPage';

export function withRowSelection<T>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getResourceUrl } from 'src/modules/Providers/utils';
import { useHasSufficientProviders } from 'src/utils/fetch';
import { ForkliftTrans, useForkliftTranslation } from 'src/utils/i18n';

import { ExternalLink } from '@kubev2v/common';
import { ExternalLink } from '@forklift/common/components/ExternalLink/ExternalLink';
import { ProviderModelRef } from '@kubev2v/types';
import { Button, Flex, FlexItem } from '@patternfly/react-core';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactNode, useState } from 'react';
import { DetailsItem } from 'src/modules/Providers/utils';

import { FormGroupWithHelpText } from '@kubev2v/common';
import { FormGroupWithHelpText } from '@forklift/common/components/FormGroupWithHelpText/FormGroupWithHelpText';
import { ProviderModelGroupVersionKind, V1beta1Provider } from '@kubev2v/types';
import { ResourceLink } from '@openshift-console/dynamic-plugin-sdk';
import { Form, FormSelect, FormSelectOption } from '@patternfly/react-core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactNode } from 'react';
import { DetailsItem } from 'src/modules/Providers/utils';

import { FormGroupWithHelpText } from '@kubev2v/common';
import { FormGroupWithHelpText } from '@forklift/common/components/FormGroupWithHelpText/FormGroupWithHelpText';
import { ProviderModelGroupVersionKind, V1beta1Provider } from '@kubev2v/types';
import { ResourceLink } from '@openshift-console/dynamic-plugin-sdk';
import { Form, FormSelect, FormSelectOption } from '@patternfly/react-core';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';

import { ResourceField, RowProps } from '@kubev2v/common';
import { RowProps } from '@forklift/common/components/TableView/types';
import { ResourceField } from '@forklift/common/utils/types';
import { Td, Tr } from '@patternfly/react-table';

import { NetworkMapActionsDropdown } from '../../actions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import StandardPage from 'src/components/page/StandardPage';
import { useGetDeleteAndEditAccessReview } from 'src/modules/Providers/hooks';
import { useForkliftTranslation } from 'src/utils/i18n';

import { EnumToTuple, loadUserSettings, ResourceFieldFactory } from '@kubev2v/common';
import { EnumToTuple } from '@forklift/common/components/FilterGroup/helpers';
import { loadUserSettings } from '@forklift/common/components/Page/userSettings';
import { ResourceFieldFactory } from '@forklift/common/utils/types';
import {
NetworkMapModel,
NetworkMapModelGroupVersionKind,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NetworkMapData } from 'src/modules/NetworkMaps/utils';

import { ResourceField } from '@kubev2v/common';
import { ResourceField } from '@forklift/common/utils/types';

export type CellProps = {
data: NetworkMapData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Link } from 'react-router-dom';
import { getResourceUrl, TableIconCell } from 'src/modules/Providers/utils';
import { useForkliftTranslation } from 'src/utils/i18n';

import { getResourceFieldValue } from '@kubev2v/common';
import { getResourceFieldValue } from '@forklift/common/components/FilterGroup/matchers';
import { NetworkMapModelRef } from '@kubev2v/types';
import { Button, Popover, Spinner, Text, TextContent, TextVariants } from '@patternfly/react-core';
import { CheckCircleIcon, ExclamationCircleIcon } from '@patternfly/react-icons';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { loadFromLocalStorage, removeFromLocalStorage, saveToLocalStorage } from '@kubev2v/common';
import {
loadFromLocalStorage,
removeFromLocalStorage,
saveToLocalStorage,
} from '@forklift/common/utils/localStorage';

export interface OverviewUserSettings {
welcome?: WelcomeSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getResourceUrl } from 'src/modules/Providers/utils';
import { useHasSufficientProviders } from 'src/utils/fetch';
import { ForkliftTrans, useForkliftTranslation } from 'src/utils/i18n';

import { ExternalLink } from '@kubev2v/common';
import { ExternalLink } from '@forklift/common/components/ExternalLink/ExternalLink';
import { ProviderModelRef } from '@kubev2v/types';
import { Button, Flex, FlexItem } from '@patternfly/react-core';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Validation } from 'src/modules/Providers/utils/types';
import { validateK8sName } from 'src/modules/Providers/utils/validators';
import { ForkliftTrans, useForkliftTranslation } from 'src/utils/i18n';

import { FormGroupWithHelpText } from '@kubev2v/common';
import { FormGroupWithHelpText } from '@forklift/common/components/FormGroupWithHelpText/FormGroupWithHelpText';
import {
K8sResourceCommon,
NetworkMapModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { CreateVmMigrationPageState } from 'src/modules/Providers/views/migrate/types';
import { ForkliftTrans, useForkliftTranslation } from 'src/utils';

import { FormGroupWithHelpText } from '@kubev2v/common';
import { FormGroupWithHelpText } from '@forklift/common/components/FormGroupWithHelpText/FormGroupWithHelpText';
import { V1beta1Provider } from '@kubev2v/types';
import {
Flex,
Expand Down
Loading
Loading