Skip to content

Commit

Permalink
Merge pull request #689 from huridocs/407-settings-btn
Browse files Browse the repository at this point in the history
#407 - Fix edit/delete buttons position on Settings
  • Loading branch information
danicatalan authored Nov 29, 2016
2 parents 64c974c + f4d4591 commit ce48c32
Show file tree
Hide file tree
Showing 22 changed files with 83 additions and 77 deletions.
21 changes: 0 additions & 21 deletions app/react/App/scss/Vars.scss

This file was deleted.

19 changes: 12 additions & 7 deletions app/react/App/scss/elements/_panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
}

.panel > .list-group .list-group-item {
//border-width: 1px 0 1px 3px;
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
-webkit-justify-content: space-between;
justify-content: space-between;
line-height: 23px;
border-color: $c-grey-light;
border-left-color: transparent;
Expand Down Expand Up @@ -42,13 +47,18 @@
}

.form-group {
margin: 0 0 5px;
width: 100%;
margin: 3px 0;
}
.form-control {
margin: 0;
}
}

.list-group-item-actions {
white-space: nowrap;
}

.panel {
.list-group {
.list-group-item {
Expand Down Expand Up @@ -96,10 +106,5 @@
opacity: 0;
}
}
.list-group-item-actions {
position: absolute;
top: 10px;
right: 10px;
}
}
}
17 changes: 17 additions & 0 deletions app/react/App/scss/modules/_settings-nav.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
.navLinks {
@include draggable;
}

.NavlinksSettings {
.panel-heading {
height: 50px;
padding: 0 15px;
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
-webkit-justify-content: space-between;
justify-content: space-between;
}
.list-group-item {
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
}
}
6 changes: 6 additions & 0 deletions app/react/App/scss/modules/_settings-translations.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.EditTranslationForm {
.list-group-item {
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
}
}
2 changes: 1 addition & 1 deletion app/react/App/scss/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
@import "modules/settings-nav";
@import "modules/settings-metadata";
@import "modules/settings-filters";
@import "modules/settings-translations";
@import "modules/uploads";
@import "modules/login";
@import "modules/markdown";
Expand All @@ -38,4 +39,3 @@
@import "../../Timeline/scss/timeline";
@import "utilities/utilities";

@import "transitions/transitions";
Empty file.
2 changes: 1 addition & 1 deletion app/react/I18N/components/EditTranslationForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class EditTranslationForm extends Component {

let contextName = defaultTranslationContext.label;
return (
<div className="relationType">
<div className="EditTranslationForm">
<Form
model="translationsForm"
onSubmit={this.props.saveTranslations}>
Expand Down
2 changes: 1 addition & 1 deletion app/react/Pages/components/PagesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class PagesList extends Component {
{pages.map((page, index) =>
<li key={index} className="list-group-item">
<I18NLink to={'/settings/pages/edit/' + page.get('sharedId')}>{page.get('title')}</I18NLink>
<div className="pull-right">
<div className="list-group-item-actions">
<I18NLink to={'/settings/pages/edit/' + page.get('sharedId')} className="btn btn-default btn-xs">
<i className="fa fa-pencil"></i>&nbsp;
<span>{t('System', 'Edit')}</span>
Expand Down
2 changes: 1 addition & 1 deletion app/react/Settings/components/DocumentTypesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class DocumentTypesList extends Component {
}
return <li key={index} className="list-group-item">
<I18NLink to={'/settings/documents/edit/' + template._id}>{template.name}</I18NLink>
<div className="pull-right">
<div className="list-group-item-actions">
<I18NLink to={'/settings/documents/edit/' + template._id} className="btn btn-default btn-xs">
<i className="fa fa-pencil"></i>&nbsp;
<span>{t('System', 'Edit')}</span>
Expand Down
2 changes: 1 addition & 1 deletion app/react/Settings/components/EntityTypesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class EntityTypesList extends Component {
}
return <li key={index} className="list-group-item">
<Link to={'/settings/entities/edit/' + template._id}>{template.name}</Link>
<div className="pull-right">
<div className="list-group-item-actions">
<Link to={'/settings/entities/edit/' + template._id} className="btn btn-default btn-xs">
<i className="fa fa-pencil"></i>&nbsp;
<span>{t('System', 'Edit')}</span>
Expand Down
15 changes: 8 additions & 7 deletions app/react/Settings/components/NavlinkForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,18 @@ export class NavlinkForm extends Component {
<i className="fa fa-reorder"></i>&nbsp;
<i className="fa fa-link"></i>&nbsp;&nbsp;{link.title && link.title.trim().length ? link.title : <em>no title</em>}
</span>
</div>
<div>
<button type="button"
className="btn btn-danger btn-xs pull-right property-remove"
onClick={() => this.props.removeLink(index)}>
<i className="fa fa-trash"></i> Delete
</button>
&nbsp;
<button type="button"
className="btn btn-default btn-xs pull-right property-edit"
className="btn btn-default btn-xs property-edit"
onClick={() => this.props.editLink(link.localID)}>
<i className="fa fa-pencil"></i> Edit
</button>
<button type="button"
className="btn btn-danger btn-xs property-remove"
onClick={() => this.props.removeLink(index)}>
<i className="fa fa-trash"></i> Delete
</button>
</div>

<ShowIf if={uiState.get('editingLink') === link.localID}>
Expand Down
4 changes: 2 additions & 2 deletions app/react/Settings/components/NavlinksSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export class NavlinksSettings extends Component {

render() {
const {collection, links} = this.props;
const nameGroupClass = 'template-name form-group';
const nameGroupClass = 'template-name';

const payload = {_id: collection.get('_id'), _rev: collection.get('_rev'), links};

return (
<div className="relationType">
<div className="NavlinksSettings">
<div className="col-xs-12">
<Form model="settings.navlinksData"
onSubmit={this.props.saveLinks.bind(this, payload)}
Expand Down
2 changes: 1 addition & 1 deletion app/react/Settings/components/RelationTypesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class RelationTypesList extends Component {
{this.props.relationTypes.toJS().map((relationType, index) => {
return <li key={index} className="list-group-item">
<I18NLink to={'/settings/connections/edit/' + relationType._id}>{relationType.name}</I18NLink>
<div className="pull-right">
<div className="list-group-item-actions">
<I18NLink to={'/settings/connections/edit/' + relationType._id} className="btn btn-default btn-xs">
<i className="fa fa-pencil"></i>&nbsp;
<span>{t('System', 'Edit')}</span>
Expand Down
2 changes: 1 addition & 1 deletion app/react/Settings/components/ThesaurisList.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class ThesaurisList extends Component {
{this.props.dictionaries.toJS().map((dictionary, index) => {
return <li key={index} className="list-group-item">
<I18NLink to={'/settings/dictionaries/edit/' + dictionary._id}>{dictionary.name}</I18NLink>
<div className="pull-right">
<div className="list-group-item-actions">
<I18NLink to={'/settings/dictionaries/edit/' + dictionary._id} className="btn btn-default btn-xs">
<i className="fa fa-pencil"></i>&nbsp;
<span>{t('System', 'Edit')}</span>
Expand Down
2 changes: 1 addition & 1 deletion app/react/Settings/components/TranslationsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class TranslationsList extends Component {
{defaultTranslation.contexts.map((context, index) => {
return <li key={index} className="list-group-item">
<I18NLink to={'/settings/translations/edit/' + encodeURIComponent(context.id)}>{context.label}</I18NLink>
<div className="pull-right">
<div className="list-group-item-actions">
<I18NLink to={'/settings/translations/edit/' + encodeURIComponent(context.id)} className="btn btn-default btn-xs">
<i className="fa fa-language"></i>
<span>{t('System', 'Translate')}</span>
Expand Down
4 changes: 2 additions & 2 deletions app/react/Settings/components/specs/NavlinkForm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ describe('NavlinkForm', () => {
});

it('should have an edit button to activate editing link mode', () => {
component.find('button').last().props().onClick();
component.find('button').first().props().onClick();
expect(props.editLink).toHaveBeenCalledWith('newLink1');
});

it('should have a remove button to remove a link', () => {
component.find('button').first().props().onClick();
component.find('button').last().props().onClick();
expect(props.removeLink).toHaveBeenCalledWith(1);
});

Expand Down
40 changes: 19 additions & 21 deletions app/react/Templates/components/MetadataProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,26 @@ export class MetadataProperty extends Component {

return connectDragSource(connectDropTarget(
<li className={propertyClass}>
<div>
<span className="property-name"><i className="fa fa-reorder"></i>&nbsp;<i className={iconClass}></i>&nbsp;{label}</span>
<div className="pull-right">
<ShowIf if={formState.errors[`properties.${index}.label.duplicated`]}>
<span className="validation-error">
<i className="fa fa-exclamation-triangle"></i>&nbsp;Duplicated label&nbsp;
</span>
</ShowIf>
<button type="button" className="btn btn-default btn-xs property-edit" onClick={() => this.props.editProperty(localID)}>
<i className="fa fa-pencil"></i> Edit
</button>
<button type="button" className="btn btn-danger btn-xs property-remove"
onClick={() => this.props.removeProperty('RemovePropertyModal', index)} >
<i className="fa fa-trash"></i> Delete
</button>
<span className="property-name"><i className="fa fa-reorder"></i>&nbsp;<i className={iconClass}></i>&nbsp;{label}</span>
<div className="list-group-item-actions">
<ShowIf if={formState.errors[`properties.${index}.label.duplicated`]}>
<span className="validation-error">
<i className="fa fa-exclamation-triangle"></i>&nbsp;Duplicated label&nbsp;
</span>
</ShowIf>
<button type="button" className="btn btn-default btn-xs property-edit" onClick={() => this.props.editProperty(localID)}>
<i className="fa fa-pencil"></i> Edit
</button>
<button type="button" className="btn btn-danger btn-xs property-remove"
onClick={() => this.props.removeProperty('RemovePropertyModal', index)} >
<i className="fa fa-trash"></i> Delete
</button>
</div>
<ShowIf if={editingProperty === localID}>
<div className={'propery-form' + (editingProperty === localID ? ' expand' : '') }>
{this.renderForm()}
</div>
</div>
<ShowIf if={editingProperty === localID}>
<div className={'propery-form' + (editingProperty === localID ? ' expand' : '') }>
{this.renderForm()}
</div>
</ShowIf>
</ShowIf>
</li>
));
}
Expand Down
8 changes: 5 additions & 3 deletions app/react/Templates/components/PropertyOption.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ export class PropertyOption extends Component {

return (
connectDragSource(
<li className="list-group-item" >
<i className="fa fa-clone"></i>&nbsp;
<i className={iconClass}></i>&nbsp;{label}
<li className="list-group-item">
<span>
<i className="fa fa-clone"></i>
<i className={iconClass}></i>&nbsp;{label}
</span>
</li>
)
);
Expand Down
2 changes: 2 additions & 0 deletions app/react/Templates/scss/templates.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
border-radius: 4px !important;
border: 1px solid $c-grey-light !important;
box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05) !important;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
.fa-clone,
.fa-arrows-v {
margin: 0 15px 0 0;
Expand Down
2 changes: 1 addition & 1 deletion app/react/Thesauris/scss/thesauris.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}
.list-group-item .btn {
position: absolute;
top: 10px;
top: 13px;
right: 15px;
}
}
2 changes: 0 additions & 2 deletions app/react/components/Elements/scss/alert.scss
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
@import "../../../App/scss/Vars.scss";

4 changes: 1 addition & 3 deletions app/react/components/Elements/scss/feedback.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import "../../../App/scss/Vars.scss";

.feedback {
text-align: center;
display: inline-block;
Expand All @@ -9,7 +7,7 @@
font-style: italic;

.fa {
color: $hardFontColor;
color: #222;
}

&-success {
Expand Down

0 comments on commit ce48c32

Please sign in to comment.