Skip to content

Commit

Permalink
[EZP-28729] Missing tooltips for multifile upload and switch view (#48)
Browse files Browse the repository at this point in the history
* [EZP-28729] Missing tooltips for multifile upload and switch view

* [EZP-28729] remove 'missplaced' function call.

* [EZP-28729] Adding new line to file, reverting file permissions

* [EZP-28683] Tooltips for single icons instead of whole div

* [EZP-28729] Simplify propTypes structure
  • Loading branch information
ViniTou authored and Łukasz Serwatka committed Jan 25, 2018
1 parent d861e7e commit 76ea362
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Resources/public/js/MultiFileUpload.module.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Resources/public/js/MultiFileUpload.module.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Resources/public/js/SubItems.module.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Resources/public/js/SubItems.module.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/modules/multi-file-upload/multi.file.upload.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default class MultiFileUploadModule extends Component {
}

return (
<div className="m-mfu__btn--upload" onClick={this.showUploadPopup.bind(this, [])}>
<div className="m-mfu__btn--upload" title={this.props.uploadBtnLabel} onClick={this.showUploadPopup.bind(this, [])}>
<svg className="ez-icon">
<use xlinkHref="/bundles/ezplatformadminui/img/ez-icons.svg#upload"></use>
</svg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,17 @@ export default class ViewSwitcherComponent extends Component {
*
* @param {String} id
* @param {String} icon icon identifier
* @param {String} title label for title attribiute
* @returns {Element}
* @memberof ViewSwitcherComponent
*/
renderButton(id, icon) {
renderButton(id, icon, title) {
const baseClassName = 'c-grid-switcher__option';
const attrs = {
id,
onClick: this.toggleListView.bind(this, id),
className: baseClassName
className: baseClassName,
title
};

if (this.state.activeView === id) {
Expand Down Expand Up @@ -69,8 +71,8 @@ export default class ViewSwitcherComponent extends Component {

return (
<div className={componentClassName}>
{this.renderButton('table', 'view-list')}
{this.renderButton('grid', 'view-grid')}
{this.renderButton('table', 'view-list', this.props.labels.listViewTitle)}
{this.renderButton('grid', 'view-grid', this.props.labels.gridViewTitle)}
</div>
);
}
Expand All @@ -79,5 +81,16 @@ export default class ViewSwitcherComponent extends Component {
ViewSwitcherComponent.propTypes = {
onViewChange: PropTypes.func.isRequired,
activeView: PropTypes.string.isRequired,
isDisabled: PropTypes.bool.isRequired
isDisabled: PropTypes.bool.isRequired,
labels: PropTypes.shape({
listViewTitle: PropTypes.string.isRequired,
gridViewTitle: PropTypes.string.isRequired
}).isRequired
};

ViewSwitcherComponent.defaultProps = {
labels: {
listViewTitle: "View as list",
gridViewTitle: "View as grid"
}
};

0 comments on commit 76ea362

Please sign in to comment.