Merge remote-tracking branch 'origin/master' into fix/tooltip-position

This commit is contained in:
Jarrod Flesch
2023-03-13 11:28:41 -04:00
8 changed files with 44 additions and 16 deletions

View File

@@ -2,9 +2,14 @@
.clickable-arrow {
cursor: pointer;
transform: rotate(-90deg);
&--left {
&--right {
.icon {
transform: rotate(-90deg);
}
}
&--left .icon {
transform: rotate(90deg);
}

View File

@@ -18,6 +18,10 @@
}
}
.clickable-arrow--right {
margin-right: base(.25);
}
.clickable-arrow,
&__page {
@extend %btn-reset;

View File

@@ -93,16 +93,7 @@ const Pagination: React.FC<Props> = (props) => {
}
// Add prev and next arrows based on necessity
nodes.push({
type: 'ClickableArrow',
props: {
updatePage: () => updatePage(prevPage),
isDisabled: !hasPrevPage,
direction: 'left',
},
});
nodes.push({
nodes.unshift({
type: 'ClickableArrow',
props: {
updatePage: () => updatePage(nextPage),
@@ -111,6 +102,15 @@ const Pagination: React.FC<Props> = (props) => {
},
});
nodes.unshift({
type: 'ClickableArrow',
props: {
updatePage: () => updatePage(prevPage),
isDisabled: !hasPrevPage,
direction: 'left',
},
});
return (
<div className={baseClass}>
{nodes.map((node, i) => {

View File

@@ -44,7 +44,7 @@ const buildColumns = ({
return [...acc, field];
}, collection.fields);
const flattenedFields = flattenFields(combinedFields);
const flattenedFields = flattenFields(combinedFields, true);
// sort the fields to the order of activeColumns
const sortedFields = flattenedFields.sort((a, b) => {

View File

@@ -8,10 +8,9 @@ import deepCopyObject from './deepCopyObject';
import { toWords } from './formatLabels';
import { SanitizedConfig } from '../config/types';
const nonOptionalFieldTypes = ['group', 'array', 'blocks'];
const propertyIsOptional = (field: Field) => {
return fieldAffectsData(field) && (('required' in field && field.required === true) || nonOptionalFieldTypes.includes(field.type));
return fieldAffectsData(field) && (('required' in field && field.required === true));
};
function getCollectionIDType(collections: SanitizedCollectionConfig[], slug: string): 'string' | 'number' {