Skip to content

Commit

Permalink
Update schema field unit layout
Browse files Browse the repository at this point in the history
  • Loading branch information
hevp committed Jan 8, 2021
1 parent c5f8337 commit 73edbec
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
12 changes: 12 additions & 0 deletions webui/app/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -807,10 +807,22 @@ a.navbar-brand {
color: #333;
}

.schema-field {
font-weight: bold;
}

.schema-field span:nth-child(2) {
color: grey;
}

.required.property {
color: #F45D00;
}

.required.property span:nth-child(2) {
color: #FF9D63;
}

/*****************************************************************************/
/* help and about pages */

Expand Down
6 changes: 3 additions & 3 deletions webui/src/components/editrecord.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,13 +386,13 @@ const EditRecord = React.createClass({
<label htmlFor={id} className="col-sm-3 control-label" style={{fontWeight:'bold'}}>
<span style={{float:'right'}}>
<span style={{color:isError?'red':'black'}}>
{title}&nbsp;
{title}
</span>
<span>
{schema.get('unit') ? <span style={{color: 'grey'}}> {'(' + schema.get('unit') + ')'} </span> : false }
{schema.get('unit') ? <span style={{color: 'grey'}}>&nbsp;{'(' + schema.get('unit') + ')'}</span> : false }
</span>
<span>
{schema.get('isRequired') ? "*" : ""}&nbsp;
&nbsp;{schema.get('isRequired') ? "*" : ""}
</span>
</span>
</label> }
Expand Down
7 changes: 4 additions & 3 deletions webui/src/components/schema.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const Schema = React.createClass({
mixins: [React.addons.PureRenderMixin],

renderSchema([id, schema]) {
const requiredClass = schema.get('isRequired') ? "required property":"";
const requiredClass = schema.get('isRequired') ? "required property" : "";

const type = schema.get('type');
const title = schema.get('title');
Expand Down Expand Up @@ -70,8 +70,9 @@ export const Schema = React.createClass({
return (
<li key={id} className="row field-general">
<div className="col-sm-6">
<p className={requiredClass}>
<span className="bold">{title} {schema.get('unit') ? ' [' + schema.get('unit') + ']' : false }</span>
<p className={"schema-field " + requiredClass}>
<span>{title}</span>
<span>{schema.get('unit') ? ' (' + schema.get('unit') + ')' : false }</span>
<span className="mono-style">
{title ? " :: " : ""}
{id}
Expand Down

0 comments on commit 73edbec

Please sign in to comment.