Skip to content

Commit

Permalink
Merge branch 'master' of github.com:uqlibrary/fez-frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
jannakha committed Aug 8, 2017
2 parents 1b5bb0e + 9e69dbd commit 6608f65
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/modules/AddRecord/components/AddRecord.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default class AddRecord extends React.Component {
{
!this.props.loadingSearch &&
<div className="layout-card">
<div className="columns">
<div className="columns action-buttons">
<div className="column is-hidden-mobile"/>
<div className="column is-narrow-desktop">
<RaisedButton
Expand Down
9 changes: 4 additions & 5 deletions src/modules/Dashboard/components/Lure.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import FlatButton from 'material-ui/FlatButton';
import FontIcon from 'material-ui/FontIcon';

const Lure = ({claimPublicationResults}) => {
return (
<div>
return (
<div>
{claimPublicationResults && claimPublicationResults.size > 0 && this.state.showAppbar && (
<div className="warning alertWrapper">
<div className="columns">
Expand All @@ -28,9 +28,8 @@ const Lure = ({claimPublicationResults}) => {
</div>
</div>
</div> )}
</div>
)
}
</div>
);
};

Lure.propTypes = {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/PublicationForm/components/PublicationForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default class PublicationForm extends Component {
<Alert type="info" title="Success" message={'New publication has been saved...'} outsideLayout />
}
<div className="layout-card">
<div className="columns">
<div className="columns action-buttons">
<div className="column is-hidden-mobile"/>
<div className="column is-narrow-desktop">
<RaisedButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class PublicationSearchForm extends Component {
<StandardCard title={this.props.locale.title} help={this.props.locale.help}>
<div>{this.props.locale.text}</div>
<form onSubmit={this.props.handleSubmit}>
<div className="columns">
<div className="columns action-buttons">
<div className="column">
<Field component={TextField}
className="requiredField"
Expand Down
42 changes: 28 additions & 14 deletions src/modules/PublicationsList/components/PublicationCitation.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import FlatButton from 'material-ui/FlatButton';
import RaisedButton from 'material-ui/RaisedButton';

import {publicationTypes} from 'config';

// citations for different publication types
Expand Down Expand Up @@ -28,23 +30,37 @@ export default class PublicationCitation extends Component {

_renderCitation = (publicationTypeId) => {
const filteredPublicationType = publicationTypeId ?
publicationTypes(this.citationComponents).filter((item) => { return item.id === publicationTypeId; }) : null;
publicationTypes(this.citationComponents).filter((item) => {
return item.id === publicationTypeId;
}) : null;
return filteredPublicationType && filteredPublicationType.length > 0 && filteredPublicationType[0].citationComponent ?
React.createElement(filteredPublicationType[0].citationComponent, {publication: this.props.publication}) : <div>Citation display not available for {publicationTypeId}</div>;
React.createElement(filteredPublicationType[0].citationComponent, {publication: this.props.publication}) :
<div>Citation display not available for {publicationTypeId}</div>;
}

render() {
const actions = this.props.actions && this.props.actions.length > 0 ?
this.props.actions.map((action, index) => {
return (
<FlatButton
fullWidth
key={index}
secondary
label={action.label}
className="publicationAction"
onTouchTap={() => (action.handleAction(this.props.publication))}
/>
<div className="column is-narrow">
{index === 0 ? (
<RaisedButton
secondary
key={index}
label={action.label}
className={`publicationAction buttonOrder${index}`}
onTouchTap={() => (action.handleAction(this.props.publication))}
/>
) : (
<FlatButton
secondary
key={index}
label={action.label}
className={`publicationAction buttonOrder${index}`}
onTouchTap={() => (action.handleAction(this.props.publication))}
/>
)}
</div>
);
}) : null;
return (
Expand All @@ -60,10 +76,8 @@ export default class PublicationCitation extends Component {
{
this.props.actions && this.props.actions.length > 0 &&
<div className="publicationActions columns is-gapless">
<div className="column is-hidden-mobile" />
<div className="column is-narrow">
{actions}
</div>
<div className="column is-hidden-mobile"/>
{actions}
</div>
}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
@media (max-width: 768px) {
.publicationActions {
margin-top: 12px;
text-align: right;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ exports[`PublicationSubtypesList renders correctly with subtypes list 1`] = `
>
<TextFieldLabel
disabled={false}
htmlFor="selectedValue-undefined-Publicationsubtype-57840"
htmlFor="selectedValue-undefined-Publicationsubtype-331"
muiTheme={
Object {
"appBar": Object {
Expand Down Expand Up @@ -595,7 +595,7 @@ exports[`PublicationSubtypesList renders correctly with subtypes list 1`] = `
}
>
<label
htmlFor="selectedValue-undefined-Publicationsubtype-57840"
htmlFor="selectedValue-undefined-Publicationsubtype-331"
style={
Object {
"color": "rgba(0, 0, 0, 0.3)",
Expand Down Expand Up @@ -632,7 +632,7 @@ exports[`PublicationSubtypesList renders correctly with subtypes list 1`] = `
"top": 8,
}
}
id="selectedValue-undefined-Publicationsubtype-57840"
id="selectedValue-undefined-Publicationsubtype-331"
labelStyle={
Object {
"paddingLeft": 0,
Expand Down Expand Up @@ -670,7 +670,7 @@ exports[`PublicationSubtypesList renders correctly with subtypes list 1`] = `
}
>
<div
id="selectedValue-undefined-Publicationsubtype-57840"
id="selectedValue-undefined-Publicationsubtype-331"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
Expand Down Expand Up @@ -1534,7 +1534,7 @@ exports[`PublicationSubtypesList renders correctly without subtypes list 1`] = `
>
<TextFieldLabel
disabled={false}
htmlFor="selectedValue-undefined-Publicationsubtype-23680"
htmlFor="selectedValue-undefined-Publicationsubtype-32200"
muiTheme={
Object {
"appBar": Object {
Expand Down Expand Up @@ -1960,7 +1960,7 @@ exports[`PublicationSubtypesList renders correctly without subtypes list 1`] = `
}
>
<label
htmlFor="selectedValue-undefined-Publicationsubtype-23680"
htmlFor="selectedValue-undefined-Publicationsubtype-32200"
style={
Object {
"color": "rgba(0, 0, 0, 0.3)",
Expand Down Expand Up @@ -1997,7 +1997,7 @@ exports[`PublicationSubtypesList renders correctly without subtypes list 1`] = `
"top": 8,
}
}
id="selectedValue-undefined-Publicationsubtype-23680"
id="selectedValue-undefined-Publicationsubtype-32200"
labelStyle={
Object {
"paddingLeft": 0,
Expand Down Expand Up @@ -2035,7 +2035,7 @@ exports[`PublicationSubtypesList renders correctly without subtypes list 1`] = `
}
>
<div
id="selectedValue-undefined-Publicationsubtype-23680"
id="selectedValue-undefined-Publicationsubtype-32200"
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
Expand Down
8 changes: 8 additions & 0 deletions src/sass/_muifixes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,11 @@ button[type=button] {
content: " *";
color: $error-color;
}

// To negate the spacing fix for column inside a form
@media (max-width: 768px) {
div.columns.action-buttons > .column {
padding-top: 6px !important;
padding-bottom: 6px !important;
}
}

0 comments on commit 6608f65

Please sign in to comment.