feat: add admin description to collections and globals
This commit is contained in:
@@ -26,6 +26,9 @@ const DefaultGlobalView: React.FC<Props> = (props) => {
|
||||
fields,
|
||||
preview,
|
||||
label,
|
||||
admin: {
|
||||
description,
|
||||
} = {},
|
||||
} = global;
|
||||
|
||||
const hasSavePermission = permissions?.update?.permission;
|
||||
@@ -55,6 +58,9 @@ const DefaultGlobalView: React.FC<Props> = (props) => {
|
||||
{' '}
|
||||
{label}
|
||||
</h1>
|
||||
{description && (
|
||||
<div className={`${baseClass}__sub-header`}>{description}</div>
|
||||
)}
|
||||
</header>
|
||||
<RenderFields
|
||||
operation="update"
|
||||
|
||||
@@ -19,7 +19,13 @@
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin: 0;
|
||||
}
|
||||
margin-bottom: base(1);
|
||||
}
|
||||
|
||||
&__sub-header {
|
||||
margin-top: base(.25);
|
||||
}
|
||||
|
||||
&__collection-actions {
|
||||
|
||||
@@ -25,6 +25,9 @@ const DefaultList: React.FC<Props> = (props) => {
|
||||
singular: singularLabel,
|
||||
plural: pluralLabel,
|
||||
},
|
||||
admin: {
|
||||
description,
|
||||
},
|
||||
},
|
||||
data,
|
||||
newDocumentURL,
|
||||
@@ -52,6 +55,9 @@ const DefaultList: React.FC<Props> = (props) => {
|
||||
Create New
|
||||
</Pill>
|
||||
)}
|
||||
{description && (
|
||||
<div className={`${baseClass}__sub-header`}>{description}</div>
|
||||
)}
|
||||
</header>
|
||||
<ListControls
|
||||
handleChange={setListControls}
|
||||
|
||||
@@ -29,6 +29,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
&__sub-header {
|
||||
flex-basis: 100%;
|
||||
margin-top: base(.25);
|
||||
}
|
||||
|
||||
.table {
|
||||
table {
|
||||
width: 100%;
|
||||
|
||||
@@ -35,7 +35,7 @@ const ListView: React.FC<ListIndexProps> = (props) => {
|
||||
const { permissions } = useAuth();
|
||||
const location = useLocation();
|
||||
const { setStepNav } = useStepNav();
|
||||
const { getPreference, setPreference } = usePreferences();
|
||||
const { getPreference } = usePreferences();
|
||||
|
||||
const [fields] = useState(() => formatFields(collection));
|
||||
const [listControls, setListControls] = useState<ListControls>({});
|
||||
|
||||
@@ -23,6 +23,7 @@ const collectionSchema = joi.object().keys({
|
||||
admin: joi.object({
|
||||
useAsTitle: joi.string(),
|
||||
defaultColumns: joi.array().items(joi.string()),
|
||||
description: joi.string(),
|
||||
enableRichTextRelationship: joi.boolean(),
|
||||
components: joi.object({
|
||||
views: joi.object({
|
||||
|
||||
@@ -99,6 +99,7 @@ export type PayloadCollectionConfig = {
|
||||
admin?: {
|
||||
useAsTitle?: string;
|
||||
defaultColumns?: string[];
|
||||
description?: string;
|
||||
disableDuplicate?: boolean;
|
||||
components?: {
|
||||
views?: {
|
||||
|
||||
@@ -3,6 +3,9 @@ import joi from 'joi';
|
||||
const globalSchema = joi.object().keys({
|
||||
slug: joi.string().required(),
|
||||
label: joi.string(),
|
||||
admin: joi.object({
|
||||
description: joi.string(),
|
||||
}),
|
||||
hooks: joi.object({
|
||||
beforeValidate: joi.array().items(joi.func()),
|
||||
beforeChange: joi.array().items(joi.func()),
|
||||
|
||||
@@ -54,6 +54,7 @@ export type PayloadGlobalConfig = {
|
||||
}
|
||||
fields: Field[];
|
||||
admin?: {
|
||||
description: string,
|
||||
components?: {
|
||||
views?: {
|
||||
Edit?: React.ComponentType
|
||||
|
||||
Reference in New Issue
Block a user