feat: adds classnames to list, edit views (#7596)
## Description Copy of #7595 for beta branch
This commit is contained in:
@@ -100,7 +100,10 @@ export const DefaultEditView: React.FC = () => {
|
||||
!(globalConfig?.versions?.drafts && globalConfig?.versions?.drafts?.autosave)) &&
|
||||
!disableLeaveWithoutSaving
|
||||
|
||||
const classes = [baseClass, id && `${baseClass}--is-editing`].filter(Boolean).join(' ')
|
||||
const classes = [baseClass, id && `${baseClass}--is-editing`]
|
||||
|
||||
if (globalSlug) classes.push(`global-edit--${globalSlug}`)
|
||||
if (collectionSlug) classes.push(`collection-edit--${collectionSlug}`)
|
||||
|
||||
const [schemaPath, setSchemaPath] = React.useState(entitySlug)
|
||||
const [validateBeforeSubmit, setValidateBeforeSubmit] = useState(() => {
|
||||
@@ -187,7 +190,7 @@ export const DefaultEditView: React.FC = () => {
|
||||
)
|
||||
|
||||
return (
|
||||
<main className={classes}>
|
||||
<main className={classes.filter(Boolean).join(' ')}>
|
||||
<OperationProvider operation={operation}>
|
||||
<Form
|
||||
action={action}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-misused-promises */
|
||||
'use client'
|
||||
|
||||
import type { CollectionComponentMap } from '@payloadcms/ui/utilities/buildComponentMap'
|
||||
@@ -98,7 +99,7 @@ export const DefaultListView: React.FC = () => {
|
||||
}, [setStepNav, labels, drawerDepth])
|
||||
|
||||
return (
|
||||
<div className={baseClass}>
|
||||
<div className={`${baseClass} ${baseClass}--${collectionSlug}`}>
|
||||
<SetViewActions actions={actionsMap?.List} />
|
||||
{BeforeList}
|
||||
<SelectionProvider docs={data.docs} totalDocs={data.totalDocs}>
|
||||
@@ -120,7 +121,9 @@ export const DefaultListView: React.FC = () => {
|
||||
{!smallBreak && (
|
||||
<ListSelection label={getTranslation(collectionConfig.labels.plural, i18n)} />
|
||||
)}
|
||||
{Description && <div className={`${baseClass}__sub-header`}>{Description}</div>}
|
||||
{Description ? (
|
||||
<div className={`${baseClass}__sub-header`}>{Description}</div>
|
||||
) : null}
|
||||
</Fragment>
|
||||
)}
|
||||
</header>
|
||||
@@ -189,17 +192,13 @@ export const DefaultListView: React.FC = () => {
|
||||
/>
|
||||
{smallBreak && (
|
||||
<div className={`${baseClass}__list-selection`}>
|
||||
<Fragment>
|
||||
<ListSelection
|
||||
label={getTranslation(collectionConfig.labels.plural, i18n)}
|
||||
/>
|
||||
<div className={`${baseClass}__list-selection-actions`}>
|
||||
<EditMany collection={collectionConfig} fieldMap={fieldMap} />
|
||||
<PublishMany collection={collectionConfig} />
|
||||
<UnpublishMany collection={collectionConfig} />
|
||||
<DeleteMany collection={collectionConfig} />
|
||||
</div>
|
||||
</Fragment>
|
||||
<ListSelection label={getTranslation(collectionConfig.labels.plural, i18n)} />
|
||||
<div className={`${baseClass}__list-selection-actions`}>
|
||||
<EditMany collection={collectionConfig} fieldMap={fieldMap} />
|
||||
<PublishMany collection={collectionConfig} />
|
||||
<UnpublishMany collection={collectionConfig} />
|
||||
<DeleteMany collection={collectionConfig} />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Fragment>
|
||||
|
||||
@@ -31,6 +31,7 @@ export interface Config {
|
||||
export interface UserAuthOperations {
|
||||
forgotPassword: {
|
||||
email: string;
|
||||
password: string;
|
||||
};
|
||||
login: {
|
||||
email: string;
|
||||
@@ -42,6 +43,7 @@ export interface UserAuthOperations {
|
||||
};
|
||||
unlock: {
|
||||
email: string;
|
||||
password: string;
|
||||
};
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user