1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

align action buttons in table to the right

This commit is contained in:
Steffen Vogel 2021-03-08 22:42:22 +01:00
parent 17aa021d1e
commit 13c0c0970c
7 changed files with 23 additions and 8 deletions

View file

@ -39,15 +39,19 @@ class TableColumn extends Component {
checkboxKey: '',
checkboxDisabled: null,
labelStyle: null,
labelModifier: null
labelModifier: null,
align: 'left'
};
render() {
return (
<th width={this.props.width}>
{this.props.title}
</th>
);
let style = {
textAlign: this.props.align,
width: this.props.width
};
return <th style={style}>
{this.props.title}
</th>;
}
}

View file

@ -250,7 +250,7 @@ class CustomTable extends Component {
}
return cell;
} // addCell
}
static getDerivedStateFromProps(props, state) {
const rows = CustomTable.getRows(props);
@ -329,9 +329,13 @@ class CustomTable extends Component {
onCellFocus: () => { },
onCellBlur: () => { }
};
let cellStyle = {
textAlign: children[cellIndex].props.align
};
return <td
key={cellIndex}
style={cellStyle}
tabIndex={tabIndex}
onClick={evtHdls.onCellClick}
onFocus={evtHdls.onCellFocus}

View file

@ -132,6 +132,7 @@ class EditFilesDialog extends React.Component {
/>
<TableColumn
title=''
align='right'
deleteButton
onDelete={(index) => this.deleteFile(index)}
editButton

View file

@ -445,6 +445,7 @@ class InfrastructureComponents extends Component {
{this.state.currentUser.role === "Admin" ?
<TableColumn
width='150'
align='right'
editButton
showEditButton ={(index) => this.isLocalIC(index, ics)}
exportButton

View file

@ -821,6 +821,7 @@ class Scenario extends React.Component {
<TableColumn
title=''
width='200'
align='right'
editButton
deleteButton
exportButton
@ -918,6 +919,7 @@ class Scenario extends React.Component {
<TableColumn
title=''
width='200'
align='right'
editButton
deleteButton
exportButton
@ -974,7 +976,8 @@ class Scenario extends React.Component {
onDownload={(index) => this.downloadResultData(index)}
/>
<TableColumn
width='300'
width='200'
align='right'
editButton
downloadAllButton
deleteButton

View file

@ -271,6 +271,7 @@ class Scenarios extends Component {
/>
<TableColumn
width='200'
align='right'
editButton
deleteButton
exportButton

View file

@ -155,6 +155,7 @@ class Users extends Component {
/>
<TableColumn
width='200'
align='right'
editButton
deleteButton
onEdit={index => this.setState({