Skip to content

Commit

Permalink
fixes ui base components
Browse files Browse the repository at this point in the history
  • Loading branch information
Elorfin committed Jan 27, 2021
1 parent 89334e9 commit d4a9845
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 22 deletions.
11 changes: 4 additions & 7 deletions src/main/app/Resources/modules/action/components/toolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@ import {buildToolbar} from '#/main/app/action/utils'

/**
* Creates a toolbar of actions.
*
* @param props
* @constructor
*/
const StaticToolbar = props => {
const toolbar = buildToolbar(props.toolbar, props.actions, props.scope)

return (0 !== toolbar.length &&
<nav role="toolbar" className={props.className} style={props.style}>
<nav role="toolbar" className={classes(props.className, props.name)} style={props.style}>
{toolbar.map((group, groupIndex) => [
0 !== groupIndex &&
<span
Expand All @@ -33,11 +30,11 @@ const StaticToolbar = props => {
/>,
...group.map((action) =>
<Button
{...omit(action, 'name')}
id={`${props.id}${action.id || action.name}`}
{...omit(action, 'name', 'className')}
id={`${props.id || props.name || ''}${action.id || action.name}`}
key={action.id || action.name}
disabled={props.disabled || action.disabled}
className={classes(`${props.className}-btn`, props.buttonName, action.className)}
className={classes(`${props.name || props.className}-btn`, props.buttonName, action.className)}
tooltip={props.tooltip}
size={props.size}
onClick={action.onClick ? () => {
Expand Down
5 changes: 5 additions & 0 deletions src/main/app/Resources/modules/action/prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ const Toolbar = {

/**
* The base class of the toolbar (it's used to generate classNames which can be used for styling).
*/
name: T.string,

/**
* The additional classes to add to the toolbar.
*
* @type {string}
*/
Expand Down
12 changes: 0 additions & 12 deletions src/main/app/Resources/modules/api/router/mock.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class SummaryLink extends Component {

{(collapsible || 0 !== this.props.additional.length) &&
<Toolbar
className="summary-link-actions"
name="summary-link-actions"
buttonName="btn-summary"
tooltip="bottom"
toolbar="collapse more"
Expand Down
2 changes: 1 addition & 1 deletion src/main/app/Resources/translations/actions.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"close": "Close",
"close-summary": "Close summary",
"collapse": "Collapse",
"comment": "Leave a comment",
"comment": "Comment",
"configure": "Configure",
"copy": "Copy",
"copy-model": "Copy as model",
Expand Down
2 changes: 1 addition & 1 deletion src/main/app/Resources/translations/actions.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"close": "Fermer",
"close-summary": "Fermer le sommaire",
"collapse": "Replier",
"comment": "Laisser un commentaire",
"comment": "Commenter",
"configure": "Configurer",
"copy": "Copier",
"copy-model": "Copier comme modèle",
Expand Down
15 changes: 15 additions & 0 deletions src/main/core/Resources/less/users/message.less
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@
padding: @panel-body-padding;
}

// message variants

.user-message-highlight {
.user-message {
border-color: @brand-primary;
Expand All @@ -164,3 +166,16 @@
border-bottom-color: @brand-primary;
}
}

.user-message-hidden {
.user-message {
background: @gray-lighter;
border: 1px solid @gray-lighter;
&:before {
border-color: transparent @gray-lighter transparent transparent;
}
&:after {
border-color: transparent transparent transparent @gray-lighter;
}
}
}

0 comments on commit d4a9845

Please # to comment.