From e9a3799337aa255eb7da7675af5765be91c7b733 Mon Sep 17 00:00:00 2001 From: ntsekouras Date: Tue, 30 Jan 2024 13:05:21 +0200 Subject: [PATCH 1/3] DataViews: Update folders structure --- packages/dataviews/src/{ => actions}/bulk-actions.js | 2 +- packages/dataviews/src/{ => actions}/item-actions.js | 2 +- packages/dataviews/src/{ => filters}/add-filter.js | 6 +++--- packages/dataviews/src/{ => filters}/filter-summary.js | 6 +++--- packages/dataviews/src/{ => filters}/filters.js | 2 +- packages/dataviews/src/{ => filters}/reset-filters.js | 0 packages/dataviews/src/{ => filters}/search.js | 0 packages/dataviews/src/{ => views}/view-grid.js | 2 +- packages/dataviews/src/{ => views}/view-list.js | 0 packages/dataviews/src/{ => views}/view-table.js | 8 ++++---- 10 files changed, 14 insertions(+), 14 deletions(-) rename packages/dataviews/src/{ => actions}/bulk-actions.js (99%) rename packages/dataviews/src/{ => actions}/item-actions.js (99%) rename packages/dataviews/src/{ => filters}/add-filter.js (97%) rename packages/dataviews/src/{ => filters}/filter-summary.js (96%) rename packages/dataviews/src/{ => filters}/filters.js (98%) rename packages/dataviews/src/{ => filters}/reset-filters.js (100%) rename packages/dataviews/src/{ => filters}/search.js (100%) rename packages/dataviews/src/{ => views}/view-grid.js (97%) rename packages/dataviews/src/{ => views}/view-list.js (100%) rename packages/dataviews/src/{ => views}/view-table.js (98%) diff --git a/packages/dataviews/src/bulk-actions.js b/packages/dataviews/src/actions/bulk-actions.js similarity index 99% rename from packages/dataviews/src/bulk-actions.js rename to packages/dataviews/src/actions/bulk-actions.js index 9fd9f628286e09..48e999b80f2a58 100644 --- a/packages/dataviews/src/bulk-actions.js +++ b/packages/dataviews/src/actions/bulk-actions.js @@ -12,7 +12,7 @@ import { useMemo, useState, useCallback } from '@wordpress/element'; /** * Internal dependencies */ -import { unlock } from './lock-unlock'; +import { unlock } from '../lock-unlock'; const { DropdownMenuV2: DropdownMenu, diff --git a/packages/dataviews/src/item-actions.js b/packages/dataviews/src/actions/item-actions.js similarity index 99% rename from packages/dataviews/src/item-actions.js rename to packages/dataviews/src/actions/item-actions.js index ce4dd6abef0568..b465998bd8fac2 100644 --- a/packages/dataviews/src/item-actions.js +++ b/packages/dataviews/src/actions/item-actions.js @@ -14,7 +14,7 @@ import { moreVertical } from '@wordpress/icons'; /** * Internal dependencies */ -import { unlock } from './lock-unlock'; +import { unlock } from '../lock-unlock'; const { DropdownMenuV2: DropdownMenu, diff --git a/packages/dataviews/src/add-filter.js b/packages/dataviews/src/filters/add-filter.js similarity index 97% rename from packages/dataviews/src/add-filter.js rename to packages/dataviews/src/filters/add-filter.js index 4f77a35c52d2ea..b5d718942dff2d 100644 --- a/packages/dataviews/src/add-filter.js +++ b/packages/dataviews/src/filters/add-filter.js @@ -12,9 +12,9 @@ import { Children, Fragment } from '@wordpress/element'; /** * Internal dependencies */ -import { unlock } from './lock-unlock'; -import { LAYOUT_LIST, OPERATORS } from './constants'; -import { DropdownMenuRadioItemCustom } from './dropdown-menu-helper'; +import { unlock } from '../lock-unlock'; +import { LAYOUT_LIST, OPERATORS } from '../constants'; +import { DropdownMenuRadioItemCustom } from '../dropdown-menu-helper'; const { DropdownMenuV2: DropdownMenu, diff --git a/packages/dataviews/src/filter-summary.js b/packages/dataviews/src/filters/filter-summary.js similarity index 96% rename from packages/dataviews/src/filter-summary.js rename to packages/dataviews/src/filters/filter-summary.js index 723fee5b3ee52e..e5dd88d3112437 100644 --- a/packages/dataviews/src/filter-summary.js +++ b/packages/dataviews/src/filters/filter-summary.js @@ -13,9 +13,9 @@ import { Children, Fragment } from '@wordpress/element'; /** * Internal dependencies */ -import { OPERATOR_IN, OPERATOR_NOT_IN, OPERATORS } from './constants'; -import { unlock } from './lock-unlock'; -import { DropdownMenuRadioItemCustom } from './dropdown-menu-helper'; +import { OPERATOR_IN, OPERATOR_NOT_IN, OPERATORS } from '../constants'; +import { unlock } from '../lock-unlock'; +import { DropdownMenuRadioItemCustom } from '../dropdown-menu-helper'; const { DropdownMenuV2: DropdownMenu, diff --git a/packages/dataviews/src/filters.js b/packages/dataviews/src/filters/filters.js similarity index 98% rename from packages/dataviews/src/filters.js rename to packages/dataviews/src/filters/filters.js index a101a077539900..9c7911c5684101 100644 --- a/packages/dataviews/src/filters.js +++ b/packages/dataviews/src/filters/filters.js @@ -14,7 +14,7 @@ import { OPERATOR_IN, OPERATOR_NOT_IN, LAYOUT_LIST, -} from './constants'; +} from '../constants'; const sanitizeOperators = ( field ) => { let operators = field.filterBy?.operators; diff --git a/packages/dataviews/src/reset-filters.js b/packages/dataviews/src/filters/reset-filters.js similarity index 100% rename from packages/dataviews/src/reset-filters.js rename to packages/dataviews/src/filters/reset-filters.js diff --git a/packages/dataviews/src/search.js b/packages/dataviews/src/filters/search.js similarity index 100% rename from packages/dataviews/src/search.js rename to packages/dataviews/src/filters/search.js diff --git a/packages/dataviews/src/view-grid.js b/packages/dataviews/src/views/view-grid.js similarity index 97% rename from packages/dataviews/src/view-grid.js rename to packages/dataviews/src/views/view-grid.js index c8cc3516e1cbb6..4e8a64e0f3752b 100644 --- a/packages/dataviews/src/view-grid.js +++ b/packages/dataviews/src/views/view-grid.js @@ -12,7 +12,7 @@ import { useAsyncList } from '@wordpress/compose'; /** * Internal dependencies */ -import ItemActions from './item-actions'; +import ItemActions from '../actions/item-actions'; export default function ViewGrid( { data, diff --git a/packages/dataviews/src/view-list.js b/packages/dataviews/src/views/view-list.js similarity index 100% rename from packages/dataviews/src/view-list.js rename to packages/dataviews/src/views/view-list.js diff --git a/packages/dataviews/src/view-table.js b/packages/dataviews/src/views/view-table.js similarity index 98% rename from packages/dataviews/src/view-table.js rename to packages/dataviews/src/views/view-table.js index 264662c19369dd..c970de48818a76 100644 --- a/packages/dataviews/src/view-table.js +++ b/packages/dataviews/src/views/view-table.js @@ -28,10 +28,10 @@ import { /** * Internal dependencies */ -import { unlock } from './lock-unlock'; -import ItemActions from './item-actions'; -import { ENUMERATION_TYPE, OPERATORS, SORTING_DIRECTIONS } from './constants'; -import { DropdownMenuRadioItemCustom } from './dropdown-menu-helper'; +import { unlock } from '../lock-unlock'; +import ItemActions from '../actions/item-actions'; +import { ENUMERATION_TYPE, OPERATORS, SORTING_DIRECTIONS } from '../constants'; +import { DropdownMenuRadioItemCustom } from '../dropdown-menu-helper'; const { DropdownMenuV2: DropdownMenu, From 8b511565f16c57be5ec161db4b7be4cdfdab724c Mon Sep 17 00:00:00 2001 From: ntsekouras Date: Tue, 30 Jan 2024 13:16:11 +0200 Subject: [PATCH 2/3] fix imports --- packages/dataviews/src/constants.js | 6 +++--- packages/dataviews/src/dataviews.js | 4 ++-- packages/dataviews/src/filters/{filters.js => index.js} | 0 3 files changed, 5 insertions(+), 5 deletions(-) rename packages/dataviews/src/filters/{filters.js => index.js} (100%) diff --git a/packages/dataviews/src/constants.js b/packages/dataviews/src/constants.js index b3d17d7fd1145f..2d6f99c4c3c7a5 100644 --- a/packages/dataviews/src/constants.js +++ b/packages/dataviews/src/constants.js @@ -12,9 +12,9 @@ import { /** * Internal dependencies */ -import ViewTable from './view-table'; -import ViewGrid from './view-grid'; -import ViewList from './view-list'; +import ViewTable from './views/view-table'; +import ViewGrid from './views/view-grid'; +import ViewList from './views/view-list'; // Field types. export const ENUMERATION_TYPE = 'enumeration'; diff --git a/packages/dataviews/src/dataviews.js b/packages/dataviews/src/dataviews.js index 64a70d46c7d127..9f8c2cb9770d9f 100644 --- a/packages/dataviews/src/dataviews.js +++ b/packages/dataviews/src/dataviews.js @@ -13,9 +13,9 @@ import { useMemo, useState, useCallback, useEffect } from '@wordpress/element'; import Pagination from './pagination'; import ViewActions from './view-actions'; import Filters from './filters'; -import Search from './search'; +import Search from './filters/search'; import { VIEW_LAYOUTS, LAYOUT_TABLE } from './constants'; -import BulkActions from './bulk-actions'; +import BulkActions from './actions/bulk-actions'; const defaultGetItemId = ( item ) => item.id; const defaultOnSelectionChange = () => {}; diff --git a/packages/dataviews/src/filters/filters.js b/packages/dataviews/src/filters/index.js similarity index 100% rename from packages/dataviews/src/filters/filters.js rename to packages/dataviews/src/filters/index.js From 43949e7e493589a0a0ad17d92a9f5752c594dffc Mon Sep 17 00:00:00 2001 From: ntsekouras Date: Tue, 30 Jan 2024 13:24:55 +0200 Subject: [PATCH 3/3] rename views->layouts folder --- packages/dataviews/src/constants.js | 6 +++--- .../dataviews/src/{views/view-grid.js => layouts/grid.js} | 0 .../dataviews/src/{views/view-list.js => layouts/list.js} | 0 .../dataviews/src/{views/view-table.js => layouts/table.js} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename packages/dataviews/src/{views/view-grid.js => layouts/grid.js} (100%) rename packages/dataviews/src/{views/view-list.js => layouts/list.js} (100%) rename packages/dataviews/src/{views/view-table.js => layouts/table.js} (100%) diff --git a/packages/dataviews/src/constants.js b/packages/dataviews/src/constants.js index 2d6f99c4c3c7a5..5d3e68ff4583cf 100644 --- a/packages/dataviews/src/constants.js +++ b/packages/dataviews/src/constants.js @@ -12,9 +12,9 @@ import { /** * Internal dependencies */ -import ViewTable from './views/view-table'; -import ViewGrid from './views/view-grid'; -import ViewList from './views/view-list'; +import ViewTable from './layouts/table'; +import ViewGrid from './layouts/grid'; +import ViewList from './layouts/list'; // Field types. export const ENUMERATION_TYPE = 'enumeration'; diff --git a/packages/dataviews/src/views/view-grid.js b/packages/dataviews/src/layouts/grid.js similarity index 100% rename from packages/dataviews/src/views/view-grid.js rename to packages/dataviews/src/layouts/grid.js diff --git a/packages/dataviews/src/views/view-list.js b/packages/dataviews/src/layouts/list.js similarity index 100% rename from packages/dataviews/src/views/view-list.js rename to packages/dataviews/src/layouts/list.js diff --git a/packages/dataviews/src/views/view-table.js b/packages/dataviews/src/layouts/table.js similarity index 100% rename from packages/dataviews/src/views/view-table.js rename to packages/dataviews/src/layouts/table.js