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

DataViews: Cleanup unused type property #61197

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/dataviews/src/stories/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ export const fields = [
id: 'type',
maxWidth: 400,
enableHiding: false,
type: 'enumeration',
elements: [
{ value: 'Not a planet', label: 'Not a planet' },
{ value: 'Ice giant', label: 'Ice giant' },
Expand All @@ -189,7 +188,6 @@ export const fields = [
{
header: 'Categories',
id: 'categories',
type: 'enumeration',
elements: [
{ value: 'Space', label: 'Space' },
{ value: 'NASA', label: 'NASA' },
Expand Down
3 changes: 0 additions & 3 deletions packages/edit-site/src/components/page-pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
DEFAULT_CONFIG_PER_VIEW_TYPE,
} from '../sidebar-dataviews/default-views';
import {
ENUMERATION_TYPE,
LAYOUT_GRID,
LAYOUT_TABLE,
LAYOUT_LIST,
Expand Down Expand Up @@ -317,7 +316,6 @@ export default function PagePages() {
header: __( 'Author' ),
id: 'author',
getValue: ( { item } ) => item._embedded?.author[ 0 ]?.name,
type: ENUMERATION_TYPE,
elements:
authors?.map( ( { id, name } ) => ( {
value: id,
Expand All @@ -330,7 +328,6 @@ export default function PagePages() {
getValue: ( { item } ) =>
STATUSES.find( ( { value } ) => value === item.status )
?.label ?? item.status,
type: ENUMERATION_TYPE,
elements: STATUSES,
enableSorting: false,
filterBy: {
Expand Down
3 changes: 0 additions & 3 deletions packages/edit-site/src/components/page-patterns/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import {
TEMPLATE_PART_ALL_AREAS_CATEGORY,
PATTERN_SYNC_TYPES,
PATTERN_DEFAULT_CATEGORY,
ENUMERATION_TYPE,
OPERATOR_IS,
} from '../../utils/constants';
import {
Expand Down Expand Up @@ -348,7 +347,6 @@ export default function DataviewsPatterns() {
</span>
);
},
type: ENUMERATION_TYPE,
elements: SYNC_FILTERS,
filterBy: {
operators: [ OPERATOR_IS ],
Expand All @@ -364,7 +362,6 @@ export default function DataviewsPatterns() {
render: ( { item } ) => {
return <Author viewType={ view.type } item={ item } />;
},
type: ENUMERATION_TYPE,
elements: authors,
filterBy: {
isPrimary: true,
Expand Down
2 changes: 0 additions & 2 deletions packages/edit-site/src/components/page-templates/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import AddNewTemplate from '../add-new-template';
import { useAddedBy } from './hooks';
import {
TEMPLATE_POST_TYPE,
ENUMERATION_TYPE,
OPERATOR_IS_ANY,
LAYOUT_GRID,
LAYOUT_TABLE,
Expand Down Expand Up @@ -323,7 +322,6 @@ export default function PageTemplates() {
render: ( { item } ) => {
return <AuthorField viewType={ view.type } item={ item } />;
},
type: ENUMERATION_TYPE,
elements: authors,
width: '1%',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-site/src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const POST_TYPE_LABELS = {
export const LAYOUT_GRID = 'grid';
export const LAYOUT_TABLE = 'table';
export const LAYOUT_LIST = 'list';
export const ENUMERATION_TYPE = 'enumeration';

export const OPERATOR_IS = 'is';
export const OPERATOR_IS_NOT = 'isNot';
export const OPERATOR_IS_ANY = 'isAny';
Expand Down