Skip to content

Commit

Permalink
Reorganize import from DataViews: import only from directory
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Nov 30, 2023
1 parent 035d2f8 commit a8c9b36
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
9 changes: 8 additions & 1 deletion packages/edit-site/src/components/dataviews/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
export { default as DataViews } from './dataviews';
export { VIEW_LAYOUTS } from './constants';
export {
VIEW_LAYOUTS,
LAYOUT_GRID,
LAYOUT_TABLE,
LAYOUT_SIDE_BY_SIDE,
ENUMERATION_TYPE,
OPERATOR_IN,
} from './constants';
15 changes: 8 additions & 7 deletions packages/edit-site/src/components/page-pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ import { useSelect, useDispatch } from '@wordpress/data';
*/
import Page from '../page';
import Link from '../routes/link';
import { DataViews, VIEW_LAYOUTS } from '../dataviews';
import {
DataViews,
VIEW_LAYOUTS,
ENUMERATION_TYPE,
LAYOUT_GRID,
LAYOUT_TABLE,
OPERATOR_IN,
} from '../dataviews';
import { default as DEFAULT_VIEWS } from '../sidebar-dataviews/default-views';
import {
trashPostAction,
Expand All @@ -31,12 +38,6 @@ import {
import SideEditor from './side-editor';
import Media from '../media';
import { unlock } from '../../lock-unlock';
import {
ENUMERATION_TYPE,
LAYOUT_GRID,
LAYOUT_TABLE,
OPERATOR_IN,
} from '../dataviews/constants';
const { useLocation } = unlock( routerPrivateApis );

const EMPTY_ARRAY = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ import Page from '../page';
import Link from '../routes/link';
import { useAddedBy, AvatarImage } from '../list/added-by';
import { TEMPLATE_POST_TYPE } from '../../utils/constants';
import { DataViews } from '../dataviews';
import {
DataViews,
ENUMERATION_TYPE,
OPERATOR_IN,
LAYOUT_GRID,
LAYOUT_TABLE,
} from '../dataviews/constants';
} from '../dataviews';
import {
useResetTemplateAction,
deleteTemplateAction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { __experimentalHStack as HStack } from '@wordpress/components';
import { useLink } from '../routes/link';
import SidebarNavigationItem from '../sidebar-navigation-item';
import { unlock } from '../../lock-unlock';
import { VIEW_LAYOUTS } from '../dataviews/constants';
import { VIEW_LAYOUTS } from '../dataviews';
const { useLocation } = unlock( routerPrivateApis );

export default function DataViewItem( {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { trash } from '@wordpress/icons';
/**
* Internal dependencies
*/
import { LAYOUT_TABLE, OPERATOR_IN } from '../dataviews/constants';
import { LAYOUT_TABLE, OPERATOR_IN } from '../dataviews';

const DEFAULT_PAGE_BASE = {
type: LAYOUT_TABLE,
Expand Down

0 comments on commit a8c9b36

Please sign in to comment.