feat: improvements to rte upload

This commit is contained in:
James
2022-01-21 16:56:24 -05:00
6 changed files with 32 additions and 9 deletions

View File

@@ -22,4 +22,20 @@
margin: 0 0 0 $baseline;
}
}
.rich-text__wrap {
.field-type-gutter {
display: none;
}
}
.rich-text__toolbar {
margin-bottom: 0;
}
.rich-text__editor {
background-color: white;
border: 1px solid $color-light-gray;
border-top: none;
min-height: base(5);
padding: base(.35) base(.5);
}
}

View File

@@ -7,6 +7,7 @@ import { PayloadRequest } from '../../express/types';
type Arguments = {
data: unknown
overrideAccess?: boolean
key: string | number
depth: number
currentDepth?: number
payload: Payload
@@ -19,6 +20,7 @@ export const populate = async ({
id,
collection,
data,
key,
overrideAccess,
depth,
currentDepth,
@@ -30,7 +32,7 @@ export const populate = async ({
field: Field
collection: Collection
}): Promise<void> => {
let dataRef = data as Record<string, unknown>;
const dataRef = data as Record<string, unknown>;
const doc = await payload.operations.collections.findByID({
req: {
@@ -47,8 +49,8 @@ export const populate = async ({
});
if (doc) {
dataRef = doc;
dataRef[key] = doc;
} else {
dataRef = null;
dataRef[key] = null;
}
};

View File

@@ -40,7 +40,8 @@ export const recurseNestedFields = ({
id: value,
field,
collection,
data: data[field.name][i],
data: data[field.name],
key: i,
overrideAccess,
depth,
currentDepth,
@@ -58,7 +59,8 @@ export const recurseNestedFields = ({
id,
field,
collection,
data: data[field.name][i],
data: data[field.name],
key: i,
overrideAccess,
depth,
currentDepth,
@@ -75,7 +77,8 @@ export const recurseNestedFields = ({
id: data[field.name].value,
field,
collection,
data: data[field.name].value,
data: data[field.name],
key: 'value',
overrideAccess,
depth,
currentDepth,
@@ -90,7 +93,8 @@ export const recurseNestedFields = ({
id: data[field.name],
field,
collection,
data: data[field.name],
data,
key: field.name,
overrideAccess,
depth,
currentDepth,

View File

@@ -62,7 +62,8 @@ export const recurseRichText = ({
promises.push(populate({
req,
id: element.value.id,
data: element.value,
data: element,
key: 'value',
overrideAccess,
depth,
currentDepth,

View File