publish
diff --git a/client/homebrew/editor/metadataEditor/metadataEditor.less b/client/homebrew/editor/metadataEditor/metadataEditor.less
index f0974fb6c..be1a9aa9c 100644
--- a/client/homebrew/editor/metadataEditor/metadataEditor.less
+++ b/client/homebrew/editor/metadataEditor/metadataEditor.less
@@ -10,6 +10,15 @@
height : calc(100vh - 54px); // 54px is the height of the navbar + snippet bar. probably a better way to dynamic get this.
overflow-y : auto;
+ .sectionHead {
+ font-weight: 1000;
+ margin: 20px 0;
+
+ &:first-of-type {
+ margin-top: 0;
+ }
+ }
+
& > div {
margin-bottom: 10px;
}
@@ -30,6 +39,7 @@
}
.field{
display : flex;
+ flex-wrap : wrap;
width : 100%;
min-width : 200px;
&>label{
@@ -78,6 +88,11 @@
font-size : 0.8em;
}
}
+
+ small {
+ font-size : 0.6em;
+ font-style : italic;
+ }
}
@@ -128,10 +143,6 @@
button.unpublish{
.button(@silver);
}
- small{
- font-size : 0.6em;
- font-style : italic;
- }
}
.delete.field .value{
@@ -196,6 +207,7 @@
}
.field .list {
display: flex;
+ flex: 1 0;
flex-wrap: wrap;
> * {
diff --git a/client/homebrew/editor/stringArrayEditor/stringArrayEditor.jsx b/client/homebrew/editor/stringArrayEditor/stringArrayEditor.jsx
index 790cfba95..4fc570cef 100644
--- a/client/homebrew/editor/stringArrayEditor/stringArrayEditor.jsx
+++ b/client/homebrew/editor/stringArrayEditor/stringArrayEditor.jsx
@@ -9,7 +9,9 @@ const StringArrayEditor = createClass({
label : '',
values : [],
valuePatterns : null,
+ validators : [],
placeholder : '',
+ notes : [],
unique : false,
cannotEdit : [],
onChange : ()=>{}
@@ -83,7 +85,8 @@ const StringArrayEditor = createClass({
}
const matchesPatterns = !this.props.valuePatterns || this.props.valuePatterns.some((pattern)=>!!(value || '').match(pattern));
const uniqueIfSet = !this.props.unique || !values.includes(value);
- return matchesPatterns && uniqueIfSet;
+ const passesValidators = !this.props.validators || this.props.validators.every((validator)=>validator(value));
+ return matchesPatterns && uniqueIfSet && passesValidators;
},
handleValueInputKeyDown : function(event, index) {
@@ -123,17 +126,21 @@ const StringArrayEditor = createClass({
);
- return
+ return
{this.props.label}
-
- {valueElements}
-
-
this.handleValueInputKeyDown(e)}
- onChange={(e)=>this.setState({ temporaryValue: e.target.value })}/>
- {this.valueIsValid(this.state.temporaryValue) ?
{ e.stopPropagation(); this.addValue(this.state.temporaryValue); }}>
: null}
+
+
+ {valueElements}
+
+
this.handleValueInputKeyDown(e)}
+ onChange={(e)=>this.setState({ temporaryValue: e.target.value })}/>
+ {this.valueIsValid(this.state.temporaryValue) ?
{ e.stopPropagation(); this.addValue(this.state.temporaryValue); }}>
: null}
+
+
+ {this.props.notes ? this.props.notes.map((n)=>
{n}
) : null}
;
}
diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx
index 0f6c5387e..61c42297d 100644
--- a/client/homebrew/pages/editPage/editPage.jsx
+++ b/client/homebrew/pages/editPage/editPage.jsx
@@ -330,6 +330,17 @@ const EditPage = createClass({
;
}
+ if(this.state.errors.response.error.status === 409) {
+ console.log(this.state.errors.response);
+ const message = this.state.errors.response.body?.message;
+ return
+ Oops!
+
+ {message ? message : 'Conflict: please refresh to get latest changes'}
+
+ ;
+ }
+
return
Oops!