Merge branch 'master' of github.com:keen-studio/payload

This commit is contained in:
James
2020-10-09 13:39:07 -04:00
10 changed files with 174 additions and 117 deletions

View File

@@ -179,12 +179,21 @@ const RenderArray = React.memo((props) => {
permissions,
value,
readOnly,
style,
width,
minRows,
maxRows,
} = props;
return (
<DragDropContext onDragEnd={onDragEnd}>
<div className={baseClass}>
<div
className={baseClass}
style={{
...style,
width,
}}
>
<header className={`${baseClass}__header`}>
<h3>{label}</h3>
<Error
@@ -240,7 +249,7 @@ const RenderArray = React.memo((props) => {
</div>
)}
</Droppable>
{!readOnly && (
{(!readOnly && (rows.length < maxRows || maxRows === undefined)) && (
<div className={`${baseClass}__add-button-wrap`}>
<Button
onClick={() => addRow(value)}
@@ -270,6 +279,8 @@ RenderArray.defaultProps = {
path: '',
value: undefined,
readOnly: false,
style: {},
width: undefined,
maxRows: undefined,
minRows: undefined,
};
@@ -300,6 +311,8 @@ RenderArray.propTypes = {
fields: PropTypes.shape({}),
}).isRequired,
readOnly: PropTypes.bool,
style: PropTypes.shape({}),
width: PropTypes.string,
maxRows: PropTypes.number,
minRows: PropTypes.number,
};

View File

@@ -37,6 +37,8 @@ const Blocks = (props) => {
permissions,
admin: {
readOnly,
style,
width,
},
} = props;
@@ -136,6 +138,8 @@ const Blocks = (props) => {
value={value}
blocks={blocks}
readOnly={readOnly}
style={style}
width={width}
minRows={minRows}
/>
);
@@ -176,6 +180,8 @@ Blocks.propTypes = {
}),
admin: PropTypes.shape({
readOnly: PropTypes.bool,
style: PropTypes.shape({}),
width: PropTypes.string,
}),
};
@@ -197,12 +203,21 @@ const RenderBlocks = React.memo((props) => {
toggleCollapse,
blocks,
readOnly,
style,
width,
minRows,
maxRows,
} = props;
return (
<DragDropContext onDragEnd={onDragEnd}>
<div className={baseClass}>
<div
className={baseClass}
style={{
...style,
width,
}}
>
<header className={`${baseClass}__header`}>
<h3>{label}</h3>
@@ -282,7 +297,7 @@ const RenderBlocks = React.memo((props) => {
)}
</Droppable>
{!readOnly && (
{(!readOnly && (rows.length < maxRows || maxRows === undefined)) && (
<div className={`${baseClass}__add-button-wrap`}>
<Popup
buttonType="custom"
@@ -326,6 +341,8 @@ RenderBlocks.defaultProps = {
path: '',
value: undefined,
readOnly: false,
style: {},
width: undefined,
maxRows: undefined,
minRows: undefined,
};
@@ -357,6 +374,8 @@ RenderBlocks.propTypes = {
).isRequired,
toggleCollapse: PropTypes.func.isRequired,
readOnly: PropTypes.bool,
style: PropTypes.shape({}),
width: PropTypes.string,
maxRows: PropTypes.number,
minRows: PropTypes.number,
};

View File

@@ -16,140 +16,140 @@
* @author Joe Gibson (@gibsjose)
*/
code[class*="language-"],
pre[class*="language-"] {
color: #c5c8c6;
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier, monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
line-height: 1.5;
code[class*="language-"],
pre[class*="language-"] {
color: #c5c8c6;
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
font-family: Inconsolata, Monaco, Consolas, "Courier New", Courier, monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
border-radius: 0.3em;
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: 0.5em 0;
overflow: auto;
border-radius: 0.3em;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #1d1f21;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #1d1f21;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: 0.1em;
border-radius: 0.3em;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: #7C7C7C;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: #7c7c7c;
}
.token.punctuation {
color: #c5c8c6;
}
.token.punctuation {
color: #c5c8c6;
}
.namespace {
opacity: .7;
}
.namespace {
opacity: 0.7;
}
.token.property,
.token.keyword,
.token.tag {
color: #96CBFE;
}
.token.property,
.token.keyword,
.token.tag {
color: #96cbfe;
}
.token.class-name {
color: #FFFFB6;
text-decoration: underline;
}
.token.class-name {
color: #ffffb6;
text-decoration: underline;
}
.token.boolean,
.token.constant {
color: #99CC99;
}
.token.boolean,
.token.constant {
color: #99cc99;
}
.token.symbol,
.token.deleted {
color: #f92672;
}
.token.symbol,
.token.deleted {
color: #f92672;
}
.token.number {
color: #FF73FD;
}
.token.number {
color: #ff73fd;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #A8FF60;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #a8ff60;
}
.token.variable {
color: #C6C5FE;
}
.token.variable {
color: #c6c5fe;
}
.token.operator {
color: #EDEDED;
}
.token.operator {
color: #ededed;
}
.token.entity {
color: #FFFFB6;
cursor: help;
}
.token.entity {
color: #ffffb6;
cursor: help;
}
.token.url {
color: #96CBFE;
}
.token.url {
color: #96cbfe;
}
.language-css .token.string,
.style .token.string {
color: #87C38A;
}
.language-css .token.string,
.style .token.string {
color: #87c38a;
}
.token.atrule,
.token.attr-value {
color: #F9EE98;
}
.token.atrule,
.token.attr-value {
color: #f9ee98;
}
.token.function {
color: #DAD085;
}
.token.function {
color: #dad085;
}
.token.regex {
color: #E9C062;
}
.token.regex {
color: #e9c062;
}
.token.important {
color: #fd971f;
}
.token.important {
color: #fd971f;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.italic {
font-style: italic;
}

View File

@@ -18,13 +18,21 @@ const Group = (props) => {
fieldTypes,
admin: {
readOnly,
style,
width,
},
} = props;
const path = pathFromProps || name;
return (
<div className="field-type group">
<div
className="field-type group"
style={{
...style,
width,
}}
>
<FieldTypeGutter />
<div className={`${baseClass}__content-wrapper`}>
@@ -64,6 +72,8 @@ Group.propTypes = {
fieldTypes: PropTypes.shape({}).isRequired,
admin: PropTypes.shape({
readOnly: PropTypes.bool,
style: PropTypes.shape({}),
width: PropTypes.string,
}),
};

View File

@@ -93,6 +93,7 @@ const ForgotPassword = () => {
<Email
label="Email Address"
name="email"
autoComplete="email"
required
/>
<FormSubmit>Submit</FormSubmit>

View File

@@ -84,6 +84,7 @@ const Login = () => {
error="password"
label="Password"
name="password"
autoComplete="off"
required
/>
<Link to={`${admin}/forgot`}>

View File

@@ -73,6 +73,7 @@ const ResetPassword = () => {
error="password"
label="New Password"
name="password"
autoComplete="off"
required
/>
<ConfirmPassword />

View File

@@ -46,6 +46,7 @@ const DefaultEditView = (props) => {
admin: {
useAsTitle,
disableDuplicate,
disableScrollOnSuccess,
},
timestamps,
preview,
@@ -67,6 +68,7 @@ const DefaultEditView = (props) => {
onSuccess={onSave}
disabled={!hasSavePermission}
initialState={initialState}
disableScrollOnSuccess={disableScrollOnSuccess}
>
<div className={`${baseClass}__main`}>
<Meta
@@ -229,6 +231,7 @@ DefaultEditView.propTypes = {
admin: PropTypes.shape({
useAsTitle: PropTypes.string,
disableDuplicate: PropTypes.bool,
disableScrollOnSuccess: PropTypes.bool,
}),
fields: PropTypes.arrayOf(PropTypes.shape({})),
preview: PropTypes.func,